OpendTect-6_4  6.4
uiposprovider.h
Go to the documentation of this file.
1 #ifndef uiposprovider_h
2 #define uiposprovider_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: Bert
9  Date: Feb 2008
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 -*/
14 
15 #include "uiiomod.h"
16 #include "uicompoundparsel.h"
17 #include "uidialog.h"
18 #include "uiposprovgroup.h"
19 #include "iopar.h"
20 
21 class uiButton;
22 class uiGenInput;
23 namespace Pos { class Provider; }
24 class uiPosProvGroup;
25 class TrcKeyZSampling;
26 
31 public:
32 
33  struct Setup : public uiPosProvGroup::Setup
34  {
35  enum ChoiceType { All, OnlySeisTypes, OnlyRanges, RangewithPolygon,
36  VolumeTypes };
37 
38  Setup( bool is_2d, bool with_step, bool with_z )
39  : uiPosProvGroup::Setup(is_2d,with_step,with_z)
40  , seltxt_(uiStrings::sPosition(2))
41  , allownone_(false)
42  , useworkarea_(true)
43  , choicetype_(OnlyRanges) {}
44  virtual ~Setup() {}
45 
46  mDefSetupMemb(uiString,seltxt)
47  mDefSetupMemb(ChoiceType,choicetype)
48  mDefSetupMemb(bool,allownone)
49  mDefSetupMemb(bool,useworkarea)
50  };
51 
52  uiPosProvider(uiParent*,const Setup&);
53 
54  void usePar(const IOPar&);
55  bool fillPar(IOPar&) const;
56  void setExtractionDefaults();
57 
58  void setSampling(const TrcKeyZSampling&);
59  void getSampling(TrcKeyZSampling&,const IOPar* =0) const;
60 
61  Pos::Provider* createProvider() const;
62 
63  bool is2D() const { return setup_.is2d_; }
64  bool isAll() const { return !curGrp(); }
65 
66 protected:
67 
69  uiButton* fullsurvbut_;
70  uiButton* openbut_;
71  uiButton* savebut_;
74 
75  void selChg(CallBacker*);
76  void fullSurvPush(CallBacker*);
77  void openCB(CallBacker*);
78  void saveCB(CallBacker*);
79  uiPosProvGroup* curGrp() const;
80 };
81 
82 
86 {
87 public:
88 
90 
91  uiPosProvSel(uiParent*,const Setup&);
92  ~uiPosProvSel();
93 
94  void usePar(const IOPar&);
95  void fillPar( IOPar& iop ) const { iop.merge(iop_); }
96 
97  Pos::Provider* curProvider() { return prov_; }
98  const Pos::Provider* curProvider() const { return prov_; }
99 
100  const TrcKeyZSampling& envelope() const;
101  void setInput(const TrcKeyZSampling&,bool chgtype=true);
102  void setInput(const TrcKeyZSampling& initcs,
103  const TrcKeyZSampling& ioparcs);
104  void setInputLimit(const TrcKeyZSampling&);
105  const TrcKeyZSampling& inputLimit() const { return setup_.tkzs_; }
106 
107  bool isAll() const;
108  void setToAll();
109 
110 protected:
111 
112  Setup setup_;
116 
117  void doDlg(CallBacker*);
118  BufferString getSummary() const;
119  void setCSToAll() const;
120  void setProvFromCS();
121  void mkNewProv(bool updsumm=true);
122 };
123 
124 
129 public:
130  typedef uiPosProvider::Setup Setup;
131 
132  uiPosProvDlg(uiParent*,const Setup&,const uiString&);
133  ~uiPosProvDlg();
134 
135  void setSampling(const TrcKeyZSampling&);
136  void getSampling(TrcKeyZSampling&,const IOPar* =0) const;
137 
138 protected:
139  bool acceptOK(CallBacker*);
140 
142 };
143 
144 
145 #endif
Definition: uigroup.h:54
Pos::Provider * curProvider()
Definition: uiposprovider.h:97
#define mExpClass(module)
Definition: commondefs.h:160
To be able to send and/or receive CallBacks, inherit from this class.
Definition: callback.h:272
FixedString Setup()
Definition: keystrs.h:116
const Pos::Provider * curProvider() const
Definition: uiposprovider.h:98
Provides a series of positions; can also be used for subselection.
Definition: posprovider.h:33
Pos::Provider * prov_
Definition: uiposprovider.h:114
Single-line element allowing multi-parameter to be set via a dialog.
Definition: uicompoundparsel.h:31
uiGenInput * selfld_
Definition: uiposprovider.h:68
#define mODTextTranslationClass(clss)
Definition: uistring.h:38
void usePar(const IOPar &iop, ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:188
void merge(const IOPar &)
merge entries using the set() command
void fillPar(IOPar &iop) const
Definition: uiposprovider.h:95
bool isAll() const
Definition: uiposprovider.h:64
uiButton * openbut_
Definition: uiposprovider.h:70
IOPar iop_
Definition: uiposprovider.h:113
Definition: uistring.h:89
Definition: uiparent.h:26
bool is2D() const
Definition: uiposprovider.h:63
Definition: uidialog.h:42
const TrcKeyZSampling & inputLimit() const
Definition: uiposprovider.h:105
Definition: uiposprovgroup.h:27
ObjectSet< uiPosProvGroup > grps_
Definition: uiposprovider.h:72
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:47
group for providing positions, usually for 2D or 3D seismics
Definition: uiposprovgroup.h:23
Setup setup_
Definition: uiposprovider.h:112
Hor+Vert sampling in 3D surveys.
Definition: trckeyzsampling.h:35
TrcKeyZSampling & tkzs_
Definition: uiposprovider.h:115
General Input Element.
Definition: uigeninput.h:58
FixedString All()
Definition: keystrs.h:36
Position.
Definition: commontypes.h:42
#define mDefSetupMemb(typ, memb)
Definition: commondefs.h:137
void fillPar(IOPar &iop, const ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:175
uiButton * fullsurvbut_
Definition: uiposprovider.h:69
uiButton * savebut_
Definition: uiposprovider.h:71
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:40
Dialog to capture a user&#39;s Pos::Provider wishes.
Definition: uiposprovider.h:127
lets user choose a way to provide positions
Definition: uiposprovider.h:29
CompoundParSel to capture a user&#39;s Pos::Provider wishes.
Definition: uiposprovider.h:85
static uiString sPosition(int num=1)
Definition: uistrings.h:402
Setup setup_
Definition: uiposprovider.h:73
uiPosProvider::Setup Setup
Definition: uiposprovider.h:89
uiPosProvider * selfld_
Definition: uiposprovider.h:141

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2019