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

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