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

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