OpendTect  6.6
attribdescset.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: Kristofer Tingdahl
8  Date: 07-10-1999
9  RCS: $Id$
10 ________________________________________________________________________
11 
12 -*/
13 
14 #include "attributeenginemod.h"
15 
16 #include "attribdescid.h"
17 #include "callback.h"
18 #include "multiid.h"
19 #include "separstr.h"
20 #include "sets.h"
21 #include "uistring.h"
22 
23 class BufferStringSet;
24 class DataPointSet;
25 
26 namespace Attrib
27 {
28 class Desc; class DescSetup; class SelSpec;
29 
34 mExpClass(AttributeEngine) DescSet : public CallBacker
36 public:
37  DescSet(bool is2d);
38  DescSet(const DescSet&);
39  ~DescSet() { removeAll( false ); }
40 
41  DescSet& operator =(const DescSet&);
42  bool isEmpty() const { return descs_.isEmpty(); }
43  inline int size() const { return nrDescs(true,true); }
44  int indexOf(const char* nm, bool usrref=true) const;
45  inline bool isPresent( const char* nm, bool usr=true ) const
46  { return indexOf(nm,usr) >= 0; }
47 
48  DescSet* optimizeClone(const DescID& targetid) const;
53  void updateInputs();
64  const TypeSet<int>&,
65  const BufferStringSet&,
71  Desc& operator[]( int idx ) { return *desc(idx); }
72  const Desc& operator[]( int idx ) const { return *desc(idx); }
73  int nrDescs(bool inclstored,bool inclhidden) const;
75  Desc* desc( int idx ) { return descs_[idx]; }
76  const Desc* desc( int idx ) const { return descs_[idx]; }
77 
78  Desc* getDesc( const DescID& id )
79  { return gtDesc(id); }
80  const Desc* getDesc( const DescID& id ) const
81  { return gtDesc(id); }
82  DescID getID(const Desc&) const;
83  DescID getID(int) const;
84  DescID getID(const char* ref,bool isusrref,
85  bool mustbestored=false,
86  bool usestorinfo=false) const;
87  void getIds(TypeSet<DescID>&) const;
89  DescID getStoredID(const MultiID&,int selout) const;
90  DescID getStoredID(const MultiID&,int selout,
91  bool create,bool blindcomp=false,
92  const char* blindcompnm=0);
93  Desc* getFirstStored(bool usesteering=true) const;
94  MultiID getStoredKey(const DescID&) const;
96  void getAttribNames(BufferStringSet&,bool inclhidden) const;
97 
98  void removeDesc(const DescID&);
99  void moveDescUpDown(const DescID&,bool);
100  void sortDescSet();
101  void removeAll(bool kpdefault);
102  int removeUnused(bool removestored=false,
103  bool kpdefault=true);
107  bool isAttribUsed(const DescID&,BufferString&) const;
108  bool isAttribUsed(const DescID&) const;
110 
112  ObjectSet<Desc>&, int& id,
113  uiStringSet* errmsgs=0);
114  static Desc* createDesc(const BufferString&, const IOPar&,
115  const BufferString&,uiStringSet*);
117  const BufferString& );
118  DescID createStoredDesc(const MultiID&,int selout,
119  const BufferString& compnm);
120  bool setAllInputDescs(int, const IOPar&,uiStringSet*);
123  int) const;
126 
130 
137 
140  bool withstored=true) const;
142  TypeSet<Attrib::SelSpec>&) const;
143 
145  inline bool containsStoredDescOnly() const
146  { return storedattronly_; }
148  { couldbeanydim_ = yn; }
149  inline bool couldBeUsedInAnyDimension() const
150  { return couldbeanydim_; }
151  bool hasStoredInMem() const;
152 
153  bool exportToDot(const char* nm,const char* fnm) const;
154 
155  inline bool is2D() const { return is2d_; }
156  uiString errMsg() const;
157  static const char* highestIDStr() { return "MaxNrKeys"; }
158  static const char* definitionStr() { return "Definition"; }
159  static const char* userRefStr() { return "UserRef"; }
160  static const char* inputPrefixStr() { return "Input"; }
161  static const char* hiddenStr() { return "Hidden"; }
162  static const char* indexStr() { return "Index"; }
164  { return "Parameter 'id' is not correct"; }
165 
167 
168  void fillPar(IOPar&) const;
169  bool usePar(const IOPar&,uiStringSet* errmsgs=0);
171  uiStringSet*);
172 protected:
173 
174  DescID getFreeID() const;
175 
178  bool is2d_;
184 
185 private:
186 
187  Desc* gtDesc(const DescID&) const;
188 
189 public:
190 
192  static uiString sFactoryEntryNotFound(const char* attrnm);
193 
194 };
195 
196 } // namespace Attrib
197 
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::DescSet::couldbeanydim_
bool couldbeanydim_
Definition: attribdescset.h:180
Attrib::DescSet::operator[]
const Desc & operator[](int idx) const
Definition: attribdescset.h:72
Attrib::DescSet::operator[]
Desc & operator[](int idx)
Definition: attribdescset.h:71
Attrib::DescSet::descs_
ObjectSet< Desc > descs_
Definition: attribdescset.h:176
Attrib::DescSet::fillInUIInputList
void fillInUIInputList(BufferStringSet &) const
Attrib::DescSet::ids_
TypeSet< DescID > ids_
Definition: attribdescset.h:177
Attrib::DescSet::getID
DescID getID(const Desc &) const
Attrib::DescSet::setCouldBeUsedInAnyDimension
void setCouldBeUsedInAnyDimension(bool yn)
Definition: attribdescset.h:147
Attrib::DescSet::getStoredNames
void getStoredNames(BufferStringSet &) const
Attrib::DescSet::getDesc
Desc * getDesc(const DescID &id)
Definition: attribdescset.h:78
Attrib::DescSet::hasStoredInMem
bool hasStoredInMem() const
Attrib::DescSet::nrDescs
int nrDescs(bool inclstored, bool inclhidden) const
use size() if you just want all
uistring.h
Attrib::DescSet::ensureDefStoredPresent
DescID ensureDefStoredPresent() const
Attrib::DescSet::storedattronly_
bool storedattronly_
Definition: attribdescset.h:179
Attrib::DescSet::getAttribNames
void getAttribNames(BufferStringSet &, bool inclhidden) const
uiStringSet
Definition: uistringset.h:23
Attrib::DescSet::storedIDErrStr
static BufferString storedIDErrStr()
Definition: attribdescset.h:163
ObjectSet
Set of pointers to objects.
Definition: commontypes.h:31
Attrib::DescSet::inputPrefixStr
static const char * inputPrefixStr()
Definition: attribdescset.h:160
Attrib::DescSet::addDesc
DescID addDesc(Desc *, DescID newid=DescID())
BufferStringSet
Set of BufferString objects.
Definition: bufstringset.h:26
Attrib::DescSet::useOldSteeringPar
bool useOldSteeringPar(IOPar &, ObjectSet< Desc > &, uiStringSet *)
Attrib::DescSet::getFirstStored
Desc * getFirstStored(bool usesteering=true) const
mExpClass
#define mExpClass(module)
Definition: commondefs.h:177
Attrib::DescSet::handleOldAttributes
void handleOldAttributes(BufferString &, IOPar &, BufferString &, int) const
Attrib::DescSet::createSteeringDesc
bool createSteeringDesc(const IOPar &, BufferString, ObjectSet< Desc > &, int &id, uiStringSet *errmsgs=0)
Attrib::DescSet::indexOf
int indexOf(const char *nm, bool usrref=true) const
Attrib::DescSet::createDesc
Desc * createDesc(const BufferString &, const IOPar &, const BufferString &)
FileMultiString
SeparString with backquotes as separators, use in most ascii files.
Definition: separstr.h:223
Attrib::DescSet::optimizeClone
DescSet * optimizeClone(const TypeSet< DescID > &) const
Attrib::DescSet::indexStr
static const char * indexStr()
Definition: attribdescset.h:162
Attrib::DescSet::fillInSelSpecs
void fillInSelSpecs(Attrib::DescSetup, TypeSet< Attrib::SelSpec > &) const
callback.h
CallBacker
Inherit from this class to be able to send and/or receive CallBacks.
Definition: callback.h:185
Attrib::DescSet::getID
DescID getID(int) const
Attrib::DescSet::isAttribUsed
bool isAttribUsed(const DescID &, BufferString &) const
Attrib::DescSet::is2D
bool is2D() const
Definition: attribdescset.h:155
Attrib::DescSet::sortDescSet
void sortDescSet()
mODTextTranslationClass
#define mODTextTranslationClass(clss)
Definition: uistring.h:40
Attrib::DescSet::getStoredKey
MultiID getStoredKey(const DescID &) const
Attrib::DescSet::defidstr_
BufferString defidstr_
Definition: attribdescset.h:182
Attrib::DescSet::desc
const Desc * desc(int idx) const
Definition: attribdescset.h:76
Attrib::DescSet::fillInAttribColRefs
void fillInAttribColRefs(BufferStringSet &) const
Attrib::DescSet::usePar
bool usePar(const IOPar &, uiStringSet *errmsgs=0)
DataPointSet
Set of data points with group selection.
Definition: datapointset.h:48
Attrib::DescSet::optimizeClone
DescSet * optimizeClone(const BufferStringSet &) const
multiid.h
Attrib::DescSet::getDescFromUIListEntry
Desc * getDescFromUIListEntry(FileMultiString)
will create an empty DataPointSet
Attrib::DescSet::errmsg_
uiString errmsg_
Definition: attribdescset.h:181
Attrib::DescSet::userRefStr
static const char * userRefStr()
Definition: attribdescset.h:159
Attrib::DescSet::fillPar
void fillPar(IOPar &) const
Attrib::DescSet::getIds
void getIds(TypeSet< DescID > &) const
Attrib::DescSet::setAllInputDescs
bool setAllInputDescs(int, const IOPar &, uiStringSet *)
indexOf
BufferStringSet::idx_type indexOf(const BufferStringSet &, const char *)
Attrib::DescSet::createAndAddMultOutDescs
void createAndAddMultOutDescs(const DescID &, const TypeSet< int > &, const BufferStringSet &, TypeSet< DescID > &)
Attrib::DescSet::descToBeRemoved
CNotifier< DescSet, DescID > descToBeRemoved
Definition: attribdescset.h:166
Attrib::DescSet::updateInputs
void updateInputs()
Attrib::DescSet::createDataPointSet
DataPointSet * createDataPointSet(Attrib::DescSetup, bool withstored=true) const
Attrib::DescSet::createStoredDesc
DescID createStoredDesc(const MultiID &, int selout, const BufferString &compnm)
Attrib::DescSet::size
int size() const
Definition: attribdescset.h:43
Attrib::DescSetup
Setup class for Attrib::Desc.
Definition: attribdesc.h:39
Attrib::DescSet::moveDescUpDown
void moveDescUpDown(const DescID &, bool)
Attrib::DescSet::hiddenStr
static const char * hiddenStr()
Definition: attribdescset.h:161
Attrib::DescSet::containsStoredDescOnly
bool containsStoredDescOnly() const
Definition: attribdescset.h:145
Attrib::DescSet::getID
DescID getID(const char *ref, bool isusrref, bool mustbestored=false, bool usestorinfo=false) const
Attrib::DescSet::isPresent
bool isPresent(const char *nm, bool usr=true) const
Definition: attribdescset.h:45
Attrib::DescSet::highestIDStr
static const char * highestIDStr()
Definition: attribdescset.h:157
MPE::removeAll
void removeAll()
Attrib::DescSet::getFreeID
DescID getFreeID() const
Attrib::DescSet::createDesc
static Desc * createDesc(const BufferString &, const IOPar &, const BufferString &, uiStringSet *)
Attrib::DescSet::optimizeClone
DescSet * optimizeClone(const DescID &targetid) const
Attrib::DescSet::getStoredIds
void getStoredIds(TypeSet< DescID > &) const
MultiID
Compound key consisting of ints.
Definition: multiid.h:24
Attrib::DescSet::removeAll
void removeAll(bool kpdefault)
Attrib::DescSet::handleOldMathExpression
void handleOldMathExpression(IOPar &, BufferString &, int) const
BufferString
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size.
Definition: bufstring.h:40
Attrib::DescSet::removeUnused
int removeUnused(bool removestored=false, bool kpdefault=true)
attribdescid.h
uiString
String that is able to hold international (UTF-8) strings for the user interface.
Definition: uistring.h:121
Attrib::DescSet::handleStorageOldFormat
void handleStorageOldFormat(IOPar &)
Attrib::DescSet::handleReferenceInput
void handleReferenceInput(Desc *)
Attrib::DescSet::errMsg
uiString errMsg() const
Attrib::DescSet::exportToDot
bool exportToDot(const char *nm, const char *fnm) const
Attrib::DescSet::gtDesc
Desc * gtDesc(const DescID &) const
Attrib::DescSet::isAttribUsed
bool isAttribUsed(const DescID &) const
Attrib::DescSet::getStoredID
DescID getStoredID(const MultiID &, int selout) const
Attrib::DescSet::insertDesc
DescID insertDesc(Desc *, int, DescID newid=DescID())
Attrib::DescSet::sFactoryEntryNotFound
static uiString sFactoryEntryNotFound(const char *attrnm)
create
static uiHor3DInterpol * create(uiParent *)
Attrib::DescSet::desc
Desc * desc(int idx)
Definition: attribdescset.h:75
Attrib::DescSet
Set of attribute descriptions.
Definition: attribdescset.h:35
Attrib
Semblance Attribute.
Definition: attribdataholder.h:25
Attrib::DescSet::getDesc
const Desc * getDesc(const DescID &id) const
Definition: attribdescset.h:80
sets.h
Attrib::DescSet::cleanUpDescsMissingInputs
void cleanUpDescsMissingInputs()
Attrib::DescSet::~DescSet
~DescSet()
Definition: attribdescset.h:39
Attrib::Desc
Description of an attribute in an Attrib::DescSet. Each attribute has a name (e.g....
Definition: attribdesc.h:89
Attrib::DescSet::couldBeUsedInAnyDimension
bool couldBeUsedInAnyDimension() const
Definition: attribdescset.h:149
Attrib::DescSet::is2d_
bool is2d_
Definition: attribdescset.h:178
Attrib::DescSet::setContainStoredDescOnly
void setContainStoredDescOnly(bool yn)
CNotifier
Notifier with automatic capsule creation.
Definition: notify.h:171
IOPar
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:55
Attrib::DescSet::getStoredID
DescID getStoredID(const MultiID &, int selout, bool create, bool blindcomp=false, const char *blindcompnm=0)
sKey::Desc
FixedString Desc()
Definition: keystrs.h:62
Attrib::DescSet::removeDesc
void removeDesc(const DescID &)
Attrib::DescSet::definitionStr
static const char * definitionStr()
Definition: attribdescset.h:158
TypeSet
Sets of (small) copyable elements.
Definition: commontypes.h:29
Attrib::DescSet::isEmpty
bool isEmpty() const
Definition: attribdescset.h:42
Attrib::DescSet::defattribid_
DescID defattribid_
Definition: attribdescset.h:183
separstr.h

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