OpendTect-6_4  6.4
uiattrdesced.h
Go to the documentation of this file.
1 #ifndef uiattrdesced_h
2 #define uiattrdesced_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: N. Hemstra
9  Date: May 2005
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 -*/
14 
15 #include "uiattributesmod.h"
16 #include "uigroup.h"
17 #include "uiattribfactory.h"
18 #include "changetracker.h"
19 #include "paramsetget.h"
20 #include "datapack.h"
21 #include "helpview.h"
22 
23 namespace Attrib { class Desc; class DescSet; class DescSetMan; };
24 namespace ZDomain { class Info; }
25 
26 class uiAttrDescEd;
27 class uiAttrSel;
28 class uiAttrSelData;
29 class uiImagAttrSel;
30 class uiSteeringSel;
31 class uiSteerAttrSel;
32 
33 using namespace Attrib;
34 
39 mExpClass(uiAttributes) EvalParam
40 {
41 public:
42  EvalParam( const char* lbl, const char* par1=0,
43  const char* par2=0, int idx=mUdf(int) )
44  : label_(lbl), par1_(par1), par2_(par2), pgidx_(idx)
45  , evaloutput_(false) {}
46 
47  bool operator==(const EvalParam& ep) const
48  {
49  return label_==ep.label_ && par1_==ep.par1_ &&
50  par2_==ep.par2_ && pgidx_==ep.pgidx_;
51  }
52 
56  int pgidx_;
58 
59 };
60 
61 
67 {
68 public:
69  virtual ~uiAttrDescEdCreater() {}
70  virtual uiAttrDescEd* create(uiParent*) const = 0;
71 
72 };
73 
74 
83 mExpClass(uiAttributes) uiAttrDescEd : public uiGroup
85 public:
86 
87  virtual ~uiAttrDescEd();
88  HelpKey helpKey() { return helpkey_; }
89  void setDesc(Desc*,DescSetMan*);
90  void setDescSet( DescSet* ds ) { ads_ = ds; }
91  Desc* curDesc() { return desc_; }
92  const Desc* curDesc() const { return desc_; }
93 
94  void setZDomainInfo(const ZDomain::Info*);
95  const ZDomain::Info* getZDomainInfo() const;
96 
97  uiString errMsgStr(Desc* desc);
98  virtual uiString commit(Desc* desc=0);
102 
103  virtual int getOutputIdx(float val) const { return (int)val; }
104  virtual float getOutputValue(int idx) const { return (float)idx; }
105  virtual void setOutputStep(float step) {}
106 
107  virtual void getEvalParams(TypeSet<EvalParam>&) const {}
108 
109  virtual const char* attribName() const = 0;
110  const char* displayName() const { return dispname_; }
111  void setDisplayName(const char* nm ) { dispname_ = nm; }
112 
113  enum DomainType { Both, Time, Depth };
114  DomainType domainType() const { return domtyp_; }
115  void setDomainType( DomainType t ) { domtyp_ = t; }
116 
117  enum DimensionType { AnyDim, Only3D, Only2D };
118  DimensionType dimensionType() const { return dimtyp_; }
119  void setDimensionType( DimensionType t ) { dimtyp_ = t; }
120 
121  bool is2D() const { return is2d_; }
122 
123  void setNeedInputUpdate() { needinpupd_ = true; }
124 
125  virtual void setDataPackInp(const TypeSet<DataPack::FullID>&);
126 
127  static const char* getInputAttribName(uiAttrSel*,const Desc&);
128 
129  static const char* timegatestr();
130  static const char* frequencystr();
131  static const char* stepoutstr();
132  static const char* filterszstr();
133 
134 protected:
135 
136  uiAttrDescEd(uiParent*,bool is2d,const HelpKey&);
137 
138  virtual bool setParameters(const Desc&) { return true; }
139  virtual bool getParameters(Desc&) { return true; }
140  virtual bool setInput(const Desc&) { return true; }
141  virtual bool getInput(Desc&) { return true; }
142  virtual bool setOutput(const Desc&) { return true; }
143  virtual bool getOutput(Desc&);
144 
145  virtual bool areUIParsOK() { return true; }
146 
147  void fillOutput(Desc&,int selout);
148  void fillInp(uiAttrSel*,Desc&,int);
149  void fillInp(uiSteeringSel*,Desc&,int);
150  void fillInp(uiSteerAttrSel*,Desc&,int);
151 
152  void putInp(uiAttrSel*,const Desc&,int inpnr);
153  void putInp(uiSteerAttrSel*,const Desc&,int inpnr);
154  void putInp(uiSteeringSel*,const Desc&,int inpnr);
155 
156  bool needInputUpdate() const { return needinpupd_; }
157 
158  uiString zDepLabel(const uiString& pre,
159  const uiString& post) const;
161  { return zDepLabel( uiString::emptyString(),
162  tr("gate")); }
164  { return zDepLabel( uiString::emptyString(),
165  tr("shift"));}
166  bool zIsTime() const;
167 
169  uiAttrSel* createInpFld(bool is2d,const char* txt=0);
170  uiAttrSel* createInpFld(const uiAttrSelData&,const char* txt=0);
171  uiImagAttrSel* createImagInpFld(bool is2d);
172  bool getInputDPID(uiAttrSel*,DataPack::FullID&) const;
173  Desc* getInputDescFromDP(uiAttrSel*) const;
174 
181  bool is2d_;
184 
186 
187  static const char* sKeyOtherGrp();
188  static const char* sKeyBasicGrp();
189  static const char* sKeyFilterGrp();
190  static const char* sKeyFreqGrp();
191  static const char* sKeyPatternGrp();
192  static const char* sKeyStatsGrp();
193  static const char* sKeyPositionGrp();
194  static const char* sKeyDipGrp();
195 
196  static uiString sInputTypeError(int input);
197 
198 
199 
200 private:
201 
205 
206 };
207 
208 
209 #define mDeclReqAttribUIFns \
210 protected: \
211  static uiAttrDescEd* createInstance(uiParent*,bool); \
212  static int factoryid_; \
213 public: \
214  static void initClass(); \
215  virtual const char* attribName() const; \
216  static int factoryID() { return factoryid_; }
217 
218 
219 #define mInitAttribUIPars( clss, attr, displaynm, grp, domtyp, dimtyp ) \
220 \
221 int clss::factoryid_ = -1; \
222 \
223 void clss::initClass() \
224 { \
225  if ( factoryid_ < 0 ) \
226  factoryid_ = uiAF().add( displaynm, attr::attribName(), grp, \
227  clss::createInstance, (int)domtyp, (int)dimtyp ); \
228 } \
229 \
230 uiAttrDescEd* clss::createInstance( uiParent* p, bool is2d ) \
231 { \
232  uiAttrDescEd* de = new clss( p, is2d ); \
233  de->setDisplayName( displaynm ); \
234  de->setDomainType( domtyp ); \
235  de->setDimensionType( dimtyp ); \
236  return de; \
237 } \
238 \
239 const char* clss::attribName() const \
240 { \
241  return attr::attribName(); \
242 }
243 
244 #define mInitAttribUI( clss, attr, displaynm, grp ) \
245  mInitAttribUIPars(clss,attr,displaynm,grp,uiAttrDescEd::Both, \
246  uiAttrDescEd::AnyDim)
247 
248 #endif
Definition: uigroup.h:54
DescSet * ads_
Definition: uiattrdesced.h:180
BufferString attrnm_
Definition: uiattrdesced.h:176
#define mExpClass(module)
Definition: commondefs.h:160
virtual void getEvalParams(TypeSet< EvalParam > &) const
Definition: uiattrdesced.h:107
bool needinpupd_
Definition: uiattrdesced.h:182
bool is2D() const
Definition: uiattrdesced.h:121
DomainType domtyp_
Definition: uiattrdesced.h:177
HelpKey helpKey()
Definition: uiattrdesced.h:88
bool is2d_
Definition: uiattrdesced.h:181
virtual void setOutputStep(float step)
Definition: uiattrdesced.h:105
virtual bool setInput(const Desc &)
Definition: uiattrdesced.h:140
const Desc * curDesc() const
Definition: uiattrdesced.h:92
DomainType
Definition: uiattrdesced.h:113
uiString gateLabel() const
Definition: uiattrdesced.h:160
#define mODTextTranslationClass(clss)
Definition: uistring.h:38
User interface element for getting attribute with both real and imaginary part.
Definition: uiattrsel.h:247
Manages attribute description set.
Definition: attribdescsetman.h:28
Attribute description editor.
Definition: uiattrdesced.h:83
uiString errmsg_
Definition: uiattrdesced.h:179
Set of attribute descriptions.
Definition: attribdescset.h:35
uiString shiftLabel() const
Definition: uiattrdesced.h:163
Definition: uiattrdesced.h:113
virtual bool areUIParsOK()
Definition: uiattrdesced.h:145
void setDimensionType(DimensionType t)
Definition: uiattrdesced.h:119
static const uiString & emptyString()
Definition: uistring.h:109
virtual bool getInput(Desc &)
Definition: uiattrdesced.h:141
DimensionType dimensionType() const
Definition: uiattrdesced.h:118
int pgidx_
Definition: uiattrdesced.h:56
Definition: uistring.h:89
Definition: uiparent.h:26
ChangeTracker chtr_
Definition: uiattrdesced.h:168
Definition: helpview.h:49
HelpKey helpkey_
Definition: uiioobjsel.h:101
virtual float getOutputValue(int idx) const
Definition: uiattrdesced.h:104
Attribute description editor creator.
Definition: uiattrdesced.h:66
bool needInputUpdate() const
Definition: uiattrdesced.h:156
void setDescSet(DescSet *ds)
Definition: uiattrdesced.h:90
void setNeedInputUpdate()
Definition: uiattrdesced.h:123
const char * displayName() const
Definition: uiattrdesced.h:110
BufferString dispname_
Definition: uiattrdesced.h:202
bool operator==(const EvalParam &ep) const
Definition: uiattrdesced.h:47
Set of (small) copyable elements.
Definition: commontypes.h:30
bool evaloutput_
Definition: uiattrdesced.h:57
Description of an attribute in an Attrib::DescSet. Each attribute has a name (e.g. "Similarity"), a user reference (e.g. "My similarity"), and at least one output. In addition, it may have parameters and inputs. If it has multiple outputs, only one of the outputs are selected.
Definition: attribdesc.h:89
BufferString label_
Definition: uiattrdesced.h:53
virtual bool getParameters(Desc &)
Definition: uiattrdesced.h:139
#define mUdf(type)
Use this macro to get the undefined for simple types.
Definition: undefval.h:272
const ZDomain::Info * zdomaininfo_
Definition: uiattrdesced.h:183
EvalParam(const char *lbl, const char *par1=0, const char *par2=0, int idx=mUdf(int))
Definition: uiattrdesced.h:42
HelpKey helpkey_
Definition: uiattrdesced.h:175
virtual bool setParameters(const Desc &)
Definition: uiattrdesced.h:138
DimensionType dimtyp_
Definition: uiattrdesced.h:178
Definition: uisteeringsel.h:24
DescSetMan * adsman_
Definition: uiattrdesced.h:204
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:40
Updates a variable when changes occur.
Definition: changetracker.h:25
TypeSet< DataPack::FullID > dpfids_
Definition: uiattrdesced.h:185
static uiHor3DInterpol * create(uiParent *)
virtual int getOutputIdx(float val) const
Definition: uiattrdesced.h:103
void setDesc(const Attrib::Desc *)
BufferString par1_
Definition: uiattrdesced.h:54
User interface for attribute selection data.
Definition: uiattrsel.h:39
DomainType domainType() const
Definition: uiattrdesced.h:114
User interface element for storing attribute desc selection.
Definition: uiattrsel.h:174
Definition: commontypes.h:39
void setDisplayName(const char *nm)
Definition: uiattrdesced.h:111
virtual bool setOutput(const Desc &)
Definition: uiattrdesced.h:142
void setDomainType(DomainType t)
Definition: uiattrdesced.h:115
DimensionType
Definition: uiattrdesced.h:117
Desc * desc_
Definition: uiattrdesced.h:203
BufferString par2_
Definition: uiattrdesced.h:55
Definition: uiattrdesced.h:117
Attribute Steering ui element: data + selection of type.
Definition: uisteeringsel.h:56
virtual ~uiAttrDescEdCreater()
Definition: uiattrdesced.h:69
Desc * curDesc()
Definition: uiattrdesced.h:91
Information of z-domain.
Definition: zdomain.h:91
Compound key consisting of ints.
Definition: multiid.h:25
Semblance Attribute.
Definition: attribdataholder.h:25
FixedString Depth()
Definition: keystrs.h:60
Definition: zdomain.h:20
Description of attribute parameters to evaluate.
Definition: uiattrdesced.h:39

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