OpendTect  6.3
attribsel.h
Go to the documentation of this file.
1 #pragma once
2 
3 /*+
4 ________________________________________________________________________
5 
6  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
7  Author: Bert Bril
8  Date: Sep 2001
9 ________________________________________________________________________
10 
11 -*/
12 
13 #include "attributeenginemod.h"
14 #include "ranges.h"
15 #include "dbkey.h"
16 #include "bufstringset.h"
17 #include "attribdescid.h"
18 #include "typeset.h"
19 
20 class NLAModel;
21 class BinDataDesc;
22 
23 namespace ZDomain { class Info; }
24 
25 
26 namespace Attrib
27 {
28 
29 class Desc;
30 class DescSet;
31 
43 mExpClass(AttributeEngine) SelSpec
44 {
45 public:
46  SelSpec( const char* r=0, DescID i=cAttribNotSel(),
47  bool n=false, const char* objr=0 )
48  : ref_(r), id_(i), isnla_(n)
49  , objref_(objr)
50  , is2d_(false)
51  , defstring_(0) {}
52 
53  const DescID& id() const { return id_; }
54  bool isNLA() const { return isnla_; }
55  bool is2D() const { return is2d_; }
56  const char* userRef() const { return ref_; }
57  const char* objectRef() const { return objref_; }
58  const char* defString() const { return defstring_; }
59  const char* zDomainKey() const { return zdomainkey_; }
60 
61  bool operator==(const SelSpec&) const;
62  bool operator!=(const SelSpec&) const;
63 
64  void set(const Desc&);
65  void set(const NLAModel&,int);
66  void setUserRef( const char* ref )
67  { ref_ = ref; }
68  void setObjectRef( const char* objr )
69  { objref_ = objr; }
70  void setDefString( const char* def )
71  { defstring_ = def;}
72  void setZDomainKey( const char* key )
73  { zdomainkey_ = key; }
74  void setZDomainKey(const Desc&);
75 
76  void set( const char* r, DescID i, bool isnla,
77  const char* objr )
78  { ref_ = r; id_ = i; isnla_ = isnla; objref_ = objr;
79  defstring_ = ""; zdomainkey_ = ""; }
80 
81  void setIDFromRef(const NLAModel&);
82  void setIDFromRef(const DescSet&);
83  void setRefFromID(const NLAModel&);
84  void setRefFromID(const DescSet&);
85  void set2DFlag( bool yn = true ) { is2d_ = yn; }
86 
87  const StepInterval<int>& discrSpec() const { return discrspec_; }
88  void setDiscrSpec( const StepInterval<int>& ds )
89  { discrspec_ = ds; }
90 
91  void fillPar(IOPar&) const;
92  bool usePar(const IOPar&);
93 
94  bool isStored() const;
95  bool isZTransformed() const;
96 
97  const BinDataDesc* getPreloadDataDesc(Pos::GeomID geomid=-1) const;
98 
99  static const DescID& cNoAttrib();
100  static const DescID& cAttribNotSel();
101  static const DescID& cOtherAttrib();
102 
103 protected:
104 
110  bool isnla_;
112  bool is2d_;
113 
114  static const char* sKeyRef();
115  static const char* sKeyObjRef();
116  static const char* sKeyID();
117  static const char* sKeyIsNLA();
118  static const char* sKeyDefStr();
119  static const char* sKeyIs2D();
120  static const char* sKeyOnlyStoredData();
121 
122  void setDiscr(const DescSet&);
123  void setDiscr(const NLAModel&);
124 };
125 
126 
127 /*
128 \brief Specifies current attribute choices (ID or output nr of NLA model).
129 */
130 
131 mExpClass(AttributeEngine) CurrentSel
132 {
133 public:
135  : attrid_(DescID(-1,true)), outputnr_(-1) {}
136 
139  int outputnr_; // For NLA or attribute nr in 2D
140 
141 };
142 
143 
148 mExpClass(AttributeEngine) SelInfo
149 {
150 public:
151 
152  SelInfo(const DescSet*,const NLAModel* n=0,
153  bool is2d=false,
154  const DescID& ignoreid=DescID::undef(),
155  bool usesteering=false,bool onlysteering=false,
156  bool onlymulticomp=false, bool usehidden=false);
157  SelInfo(const SelInfo&);
158  SelInfo& operator=(const SelInfo&);
159 
167 
168  void fillStored(bool steerdata,const char* filter=0);
169  static bool is2D(const char* defstr_or_ioobjid);
170  static void getZDomainItems(const ZDomain::Info&,bool is2d,
171  BufferStringSet& objnms);
172 
174  static void getAttrNames(const char* defstr_or_ioobjid,
175  BufferStringSet&,bool issteer=false,
176  bool onlymulticomp=false);
177 
178 protected:
179 
180  bool is2d_;
184 
185 };
186 
187 } // namespace Attrib
#define mExpClass(module)
Definition: commondefs.h:157
BufferStringSet ioobjnms_
Definition: attribsel.h:160
SelSpec(const char *r=0, DescID i=cAttribNotSel(), bool n=false, const char *objr=0)
Definition: attribsel.h:46
TypeSet< DescID > attrids_
Definition: attribsel.h:164
const char * userRef() const
Definition: attribsel.h:56
bool operator==(const ArrayNDInfo &a1, const ArrayNDInfo &a2)
Definition: arrayndinfo.h:51
Supplies lists of available attribute input.
Definition: attribsel.h:148
BufferStringSet attrnms_
Definition: attribsel.h:162
Minimum Interface for NLA models.
Definition: nlamodel.h:22
bool usesteering_
Definition: attribsel.h:181
bool is2D(GeomType gt)
Definition: seistype.h:32
void usePar(const IOPar &iop, ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:200
Set of attribute descriptions.
Definition: attribdescset.h:29
int outputnr_
Definition: attribsel.h:139
Definition: dbkey.h:98
AttribDesc ID: each Desc has a unique ID in a set; the boolean isstored allows us to know whether thi...
Definition: attribdescid.h:25
bool isnla_
Definition: attribsel.h:110
bool onlymulticomp_
Definition: attribsel.h:183
BufferStringSet nlaoutnms_
Definition: attribsel.h:163
void setDefString(const char *def)
Definition: attribsel.h:70
const char * objectRef() const
Definition: attribsel.h:57
Set of BufferString objects.
Definition: bufstringset.h:25
const StepInterval< int > & discrSpec() const
Definition: attribsel.h:87
DBKeySet steerids_
Definition: attribsel.h:166
const char * sKeyIs2D()
Definition: segybatchio.h:30
bool is2d_
Definition: attribsel.h:112
BufferStringSet steernms_
Definition: attribsel.h:161
DBKeySet ioobjids_
Definition: attribsel.h:165
void setUserRef(const char *ref)
Definition: attribsel.h:66
FixedString Desc()
Definition: keystrs.h:60
Set of (small) copyable elements.
Definition: commontypes.h:26
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:53
CurrentSel()
Definition: attribsel.h:134
Definition: attribsel.h:131
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:87
BufferString defstring_
Definition: attribsel.h:107
bool is2D() const
Definition: attribsel.h:55
DBKey ioobjkey_
Definition: attribsel.h:138
bool operator!=(const ArrayNDInfo &a1, const ArrayNDInfo &a2)
Definition: arrayndinfo.h:60
void setObjectRef(const char *objr)
Definition: attribsel.h:68
BufferString ref_
Definition: attribsel.h:105
void fillPar(IOPar &iop, const ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:187
const char * defString() const
Definition: attribsel.h:58
Index_Type GeomID
Definition: commontypes.h:48
void setZDomainKey(const char *key)
Definition: attribsel.h:72
void setDiscrSpec(const StepInterval< int > &ds)
Definition: attribsel.h:88
void set2DFlag(bool yn=true)
Definition: attribsel.h:85
BufferString objref_
Definition: attribsel.h:106
bool isNLA() const
Definition: attribsel.h:54
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:38
const char * zDomainKey() const
Definition: attribsel.h:59
DescID id_
Definition: attribsel.h:109
BufferString zdomainkey_
Definition: attribsel.h:108
bool is2d_
Definition: attribsel.h:180
Specifies an attribute selection (ID or output number of NN).
Definition: attribsel.h:43
Full key to any object in the OpendTect data store.
Definition: dbkey.h:36
StepInterval< int > discrspec_
Definition: attribsel.h:111
bool onlysteering_
Definition: attribsel.h:182
Description of binary data.
Definition: bindatadesc.h:41
DescID attrid_
Definition: attribsel.h:137
const DescID & id() const
Definition: attribsel.h:53
Information of z-domain.
Definition: zdomain.h:96
Semblance Attribute.
Definition: attribdataholder.h:21
Definition: zdomain.h:18

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