15 #include "attributeenginemod.h" 63 : desc_(d), enabled_(enabled)
64 , issteering_(false) {}
66 const char*
getDesc()
const {
return desc_; }
93 enum Locality { SingleTrace, PossiblyMultiTrace, MultiTrace };
96 Desc(
const char* attrname,
106 void getAncestorIDs(
DescID cid,
111 bool parseDefStr(
const char*);
113 const char* userRef()
const;
114 void setUserRef(
const char*);
116 int nrOutputs()
const;
117 void selectOutput(
int);
118 int selectedOutput()
const;
134 bool isStored()
const;
135 bool isStoredInMem()
const;
140 { needprovinit_ = yn; }
142 {
return needprovinit_;}
144 int nrInputs()
const;
147 bool setInput(
int,
const Desc*);
149 const Desc* getInput(
int)
const;
155 bool is2D()
const {
return is2d_; }
156 void set2D(
bool yn ) { is2d_ = yn; }
157 bool isPS()
const {
return isps_; }
158 void setPS(
bool yn ) { isps_ = yn; }
164 const char*
errMsg()
const;
167 bool isIdenticalTo(
const Desc&,
168 bool cmpoutput=
true)
const;
169 bool isIdentifiedBy(
const char*)
const;
170 DescID inputId(
int idx)
const;
173 void addParam(
Param*);
175 const Param* getParam(
const char* key)
const;
176 Param* getParam(
const char* key);
177 const ValParam* getValParam(
const char* key)
const;
178 ValParam* getValParam(
const char* key);
179 void setParamEnabled(
const char* key,
bool yn=
true);
180 bool isParamEnabled(
const char* key)
const;
181 void setParamRequired(
const char* key,
bool yn=
true);
182 bool isParamRequired(
const char* key)
const;
185 void updateDefaultParams();
186 void changeStoredID(
const char*);
189 bool removeInput(
int idx);
190 void removeOutputs();
193 void addOutputDataTypeSameAs(
int);
196 static bool getAttribName(
const char* defstr,
BufferString&);
197 static bool getParamString(
const char* defstr,
200 Desc* getStoredInput()
const;
201 DescID getMultiOutputInputID()
const;
205 Desc* cloneDescAndPropagateInput(
const DescID&,
212 const char* onlyneedkey=0)
213 { getKeysVals(defstr,keys, vals, onlyneedkey); }
218 static const char* sKeyInlDipComp();
219 static const char* sKeyCrlDipComp();
220 static const char* sKeyLineDipComp();
224 bool setInput_(
int,Desc*);
225 Param* findParam(
const char* key);
227 static void getKeysVals(
const char* defstr,
230 const char* onlyneedkey=0);
261 #define mGetIntFromDesc( __desc, var, varstring ) \ 263 var = __desc.getValParam(varstring)->getIntValue(0); \ 265 var = __desc.getValParam(varstring)->getDefaultIntValue(0);\ 268 #define mGetFloatFromDesc( __desc, var, varstring ) \ 270 var = __desc.getValParam(varstring)->getFValue(0); \ 272 var = __desc.getValParam(varstring)->getDefaultfValue(0);\ 276 #define mGetDoubleFromDesc( __desc, var, varstring ) \ 278 var = __desc.getValParam(varstring)->getDValue(0); \ 280 var = __desc.getValParam(varstring)->getDefaultdValue(0);\ 284 #define mGetBoolFromDesc( __desc, var, varstring ) \ 286 Attrib::ValParam* valparam##var = \ 287 const_cast<Attrib::ValParam*>(__desc.getValParam(varstring));\ 288 mDynamicCastGet(Attrib::BoolParam*,boolparam##var,valparam##var);\ 289 if ( boolparam##var ) \ 290 var = boolparam##var->isSet() ? boolparam##var->getBoolValue(0)\ 291 : boolparam##var->getDefaultBoolValue(0);\ 294 #define mGetEnumFromDesc( __desc, var, varstring ) \ 296 Attrib::ValParam* valparam##var = \ 297 const_cast<Attrib::ValParam*>(__desc.getValParam(varstring));\ 298 mDynamicCastGet(Attrib::EnumParam*,enumparam##var,valparam##var);\ 299 if ( enumparam##var ) \ 300 var = enumparam##var->isSet() ? enumparam##var->getIntValue(0)\ 301 : enumparam##var->getDefaultIntValue(0);\ 304 #define mGetStringFromDesc( __desc, var, varstring ) \ 306 var = __desc.getValParam(varstring)->getStringValue(0); \ 307 if ( FixedString(var).isEmpty() )\ 308 var = __desc.getValParam(varstring)->getDefaultStringValue(0); \ 311 #define mGetBinIDFromDesc( __desc, var, varstring ) \ 313 var.inl() = __desc.getValParam(varstring)->getIntValue(0); \ 314 var.crl() = __desc.getValParam(varstring)->getIntValue(1); \ 315 if ( mIsUdf(var.inl()) || mIsUdf(var.crl()) )\ 317 Attrib::ValParam* valparam##var = \ 318 const_cast<Attrib::ValParam*>(__desc.getValParam(varstring));\ 319 mDynamicCastGet(Attrib::BinIDParam*,binidparam##var,valparam##var);\ 320 if ( binidparam##var ) \ 321 var = binidparam##var->getDefaultBinIDValue();\ 323 if ( __desc.descSet()->is2D() ) \ 327 #define mGetFloatIntervalFromDesc( __desc, var, varstring ) \ 329 var.start = __desc.getValParam(varstring)->getFValue(0); \ 330 var.stop = __desc.getValParam(varstring)->getFValue(1); \ 331 if ( mIsUdf(var.start) || mIsUdf(var.stop) )\ 333 Attrib::ValParam* valparam##var = \ 334 const_cast<Attrib::ValParam*>(__desc.getValParam(varstring));\ 335 mDynamicCastGet(Attrib::ZGateParam*,gateparam##var,valparam##var);\ 336 if ( gateparam##var ) \ 337 var = gateparam##var->getDefaultGateValue();\ 341 #define mGetFloat( var, varstring ) \ 342 mGetFloatFromDesc( desc_, var, varstring ) 343 #define mGetInt( var, varstring ) \ 344 mGetIntFromDesc( desc_, var, varstring ) 345 #define mGetBool( var, varstring ) \ 346 mGetBoolFromDesc( desc_, var, varstring ) 347 #define mGetEnum( var, varstring ) \ 348 mGetEnumFromDesc( desc_, var, varstring ) 349 #define mGetString( var, varstring ) \ 350 mGetStringFromDesc( desc_, var, varstring ) 351 #define mGetBinID( var, varstring ) \ 352 mGetBinIDFromDesc( desc_, var, varstring ) 353 #define mGetFloatInterval( var, varstring ) \ 354 mGetFloatIntervalFromDesc( desc_, var, varstring ) 355 #define mGetDouble( var, varstring ) \ 356 mGetDoubleFromDesc( desc_, var, varstring ) Attribute Value Parameter.
Definition: attribparambase.h:94
#define mRefCountImpl(ClassName)
Macro to setup a class with destructor for reference counting.
Definition: refcount.h:163
#define mExpClass(module)
Definition: commondefs.h:160
ObjectSet< Param > params_
Definition: attribdesc.h:248
BufferString userref_
Definition: attribdesc.h:250
DescStatusUpdater statusupdater_
Definition: attribdesc.h:254
Locality locality() const
Definition: attribdesc.h:123
bool operator==(const ArrayNDInfo &a1, const ArrayNDInfo &a2)
Definition: arrayndinfo.h:53
bool issteering_
Definition: attribdesc.h:236
void(* DescDefaultsUpdater)(Desc &)
Definition: attribdesc.h:33
void setErrMsg(const char *str)
Definition: attribdesc.h:165
static void getKeysValsPublic(const char *defstr, BufferStringSet &keys, BufferStringSet &vals, const char *onlyneedkey=0)
Definition: attribdesc.h:209
#define mDefSetupClssMemb(clss, typ, memb)
Definition: commondefs.h:133
bool isps_
Definition: attribdesc.h:240
bool usestrcpos_
Definition: attribdesc.h:242
Set of attribute descriptions.
Definition: attribdescset.h:35
bool isSteering() const
Definition: attribdesc.h:127
DescDefaultsUpdater defaultsupdater_
Definition: attribdesc.h:255
bool is2d_
Definition: attribdesc.h:239
AttribDesc ID: each Desc has a unique ID in a set; the boolean isstored allows us to know whether thi...
Definition: attribdescid.h:27
TypeSet< int > outputtypelinks_
Definition: attribdesc.h:235
void setLocality(Locality l)
Definition: attribdesc.h:124
Set of BufferString objects.
Definition: bufstringset.h:28
bool needprovinit_
Definition: attribdesc.h:238
void set2D(bool yn)
Definition: attribdesc.h:156
Set of pointers to objects.
Definition: commontypes.h:32
int seloutput_
Definition: attribdesc.h:251
bool hidden_
Definition: attribdesc.h:237
TypeSet< InputSpec > inputspecs_
Definition: attribdesc.h:244
FixedString Desc()
Definition: keystrs.h:62
void setNeedProvInit(bool yn=true)
Definition: attribdesc.h:139
bool is2D() const
Definition: attribdesc.h:155
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
encapsulates the read-access-only part of strings in OD.
Definition: odstring.h:31
Setup class for Attrib::Desc.
Definition: attribdesc.h:39
A parameter that is used by an attribute.
Definition: attribparambase.h:36
void setUsesTrcPos(bool yn)
Definition: attribdesc.h:126
bool usesTracePosition() const
Definition: attribdesc.h:125
BufferString errmsg_
Definition: attribdesc.h:256
DescSet * descset_
Definition: attribdesc.h:252
Locality locality_
Definition: attribdesc.h:241
ObjectSet< Desc > inputs_
Definition: attribdesc.h:245
void setPS(bool yn)
Definition: attribdesc.h:158
void(* DescStatusUpdater)(Desc &)
Definition: attribdesc.h:32
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:40
Definition: attribdesc.h:160
BufferString errmsg_
Definition: horizontracker.h:119
bool isPS() const
Definition: attribdesc.h:157
void setHidden(bool yn)
Definition: attribdesc.h:131
bool isHidden() const
Definition: attribdesc.h:129
BufferString attribname_
Definition: attribdesc.h:247
DataType
Definition: seistype.h:54
const char * errMsg() const
Definition: horizontracker.h:61
void setSteering(bool yn)
Definition: attribdesc.h:128
bool needProvInit() const
Definition: attribdesc.h:141
SatisfyLevel
Definition: attribdesc.h:160
Semblance Attribute.
Definition: attribdataholder.h:25
TypeSet< Seis::DataType > outputtypes_
Definition: attribdesc.h:234