OpendTect-6_4  6.4
attribdescset.h
Go to the documentation of this file.
1 #ifndef attribdescset_h
2 #define attribdescset_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: Kristofer Tingdahl
9  Date: 07-10-1999
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 -*/
14 
15 #include "attributeenginemod.h"
16 
17 #include "attribdescid.h"
18 #include "callback.h"
19 #include "multiid.h"
20 #include "separstr.h"
21 #include "sets.h"
22 #include "uistring.h"
23 
24 class BufferStringSet;
25 class DataPointSet;
26 
27 namespace Attrib
28 {
29 class Desc; class DescSetup; class SelSpec;
30 
35 mExpClass(AttributeEngine) DescSet : public CallBacker
37 public:
38  DescSet(bool is2d);
39  DescSet(const DescSet&);
40  ~DescSet() { removeAll( false ); }
41 
42  DescSet& operator =(const DescSet&);
43  bool isEmpty() const { return descs_.isEmpty(); }
44  inline int size() const { return nrDescs(true,true); }
45  int indexOf(const char* nm, bool usrref=true) const;
46  inline bool isPresent( const char* nm, bool usr=true ) const
47  { return indexOf(nm,usr) >= 0; }
48 
49  DescSet* optimizeClone(const DescID& targetid) const;
50  DescSet* optimizeClone(const TypeSet<DescID>&) const;
51  DescSet* optimizeClone(const BufferStringSet&) const;
54  void updateInputs();
58  DescID addDesc(Desc*,DescID newid=DescID());
61  DescID insertDesc(Desc*,int,DescID newid=DescID());
64  void createAndAddMultOutDescs(const DescID&,
65  const TypeSet<int>&,
66  const BufferStringSet&,
72  Desc& operator[]( int idx ) { return *desc(idx); }
73  const Desc& operator[]( int idx ) const { return *desc(idx); }
74  int nrDescs(bool inclstored,bool inclhidden) const;
76  Desc* desc( int idx ) { return descs_[idx]; }
77  const Desc* desc( int idx ) const { return descs_[idx]; }
78 
79  Desc* getDesc( const DescID& id )
80  { return gtDesc(id); }
81  const Desc* getDesc( const DescID& id ) const
82  { return gtDesc(id); }
83  DescID getID(const Desc&) const;
84  DescID getID(int) const;
85  DescID getID(const char* ref,bool isusrref,
86  bool mustbestored=false,
87  bool usestorinfo=false) const;
88  void getIds(TypeSet<DescID>&) const;
89  void getStoredIds(TypeSet<DescID>&) const;
90  DescID getStoredID(const MultiID&,int selout=-1,
91  bool create=true,bool blindcomp=false,
92  const char* blindcompnm=0);
93  Desc* getFirstStored(bool usesteering=true) const;
94  MultiID getStoredKey(const DescID&) const;
95  void getStoredNames(BufferStringSet&) 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;
109  void cleanUpDescsMissingInputs();
110 
111  bool createSteeringDesc(const IOPar&,BufferString,
112  ObjectSet<Desc>&, int& id,
113  uiStringSet* errmsgs=0);
114  static Desc* createDesc(const BufferString&, const IOPar&,
115  const BufferString&,uiStringSet*);
116  Desc* createDesc(const BufferString&, const IOPar&,
117  const BufferString& );
118  DescID createStoredDesc(const MultiID&,int selout,
119  const BufferString& compnm);
120  bool setAllInputDescs(int, const IOPar&,uiStringSet*);
121  void handleStorageOldFormat(IOPar&);
122  void handleOldAttributes(BufferString&,IOPar&,BufferString&,
123  int) const;
124  void handleOldMathExpression(IOPar&,BufferString&,int) const;
125  void handleReferenceInput(Desc*);
126 
129  void fillInAttribColRefs(BufferStringSet&) const;
130 
133  void fillInUIInputList(BufferStringSet&) const;
136  Desc* getDescFromUIListEntry(FileMultiString);
137 
139  DataPointSet* createDataPointSet(Attrib::DescSetup,
140  bool withstored=true) const;
141  void fillInSelSpecs(Attrib::DescSetup,
142  TypeSet<Attrib::SelSpec>&) const;
143 
144  void setContainStoredDescOnly(bool yn);
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);
170  bool useOldSteeringPar(IOPar&,ObjectSet<Desc>&,
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 
191  DescID ensureDefStoredPresent() const;
192  static uiString sFactoryEntryNotFound(const char* attrnm);
193 
194 };
195 
196 } // namespace Attrib
197 
198 #endif
const Desc * getDesc(const DescID &id) const
Definition: attribdescset.h:81
#define mExpClass(module)
Definition: commondefs.h:160
TypeSet< DescID > ids_
Definition: attribdescset.h:177
void setCouldBeUsedInAnyDimension(bool yn)
Definition: attribdescset.h:147
const Desc * desc(int idx) const
Definition: attribdescset.h:77
To be able to send and/or receive CallBacks, inherit from this class.
Definition: callback.h:272
Desc * getDesc(const DescID &id)
Definition: attribdescset.h:79
~DescSet()
Definition: attribdescset.h:40
const Desc & operator[](int idx) const
Definition: attribdescset.h:73
Desc & operator[](int idx)
Definition: attribdescset.h:72
Set of data points with group selection.
Definition: datapointset.h:48
#define mODTextTranslationClass(clss)
Definition: uistring.h:38
bool isEmpty() const
Definition: attribdescset.h:43
bool is2D() const
Definition: attribdescset.h:155
void usePar(const IOPar &iop, ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:188
static BufferString storedIDErrStr()
Definition: attribdescset.h:163
Set of attribute descriptions.
Definition: attribdescset.h:35
bool couldBeUsedInAnyDimension() const
Definition: attribdescset.h:149
AttribDesc ID: each Desc has a unique ID in a set; the boolean isstored allows us to know whether thi...
Definition: attribdescid.h:27
Definition: uistring.h:89
Set of BufferString objects.
Definition: bufstringset.h:28
ObjectSet< T >::size_type indexOf(const ObjectSet< T > &os, const S &val)
Locate object in set.
Definition: objectset.h:169
BufferString defidstr_
Definition: attribdescset.h:182
static const char * indexStr()
Definition: attribdescset.h:162
bool isPresent(const char *nm, bool usr=true) const
Definition: attribdescset.h:46
SeparString with backquotes as separators, use in most ascii files.
Definition: separstr.h:119
Set of pointers to objects.
Definition: commontypes.h:32
FixedString Desc()
Definition: keystrs.h:62
void removeAll()
Set of (small) copyable elements.
Definition: commontypes.h:30
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:47
uiString errmsg_
Definition: attribdescset.h:181
CNotifier< DescSet, DescID > descToBeRemoved
Definition: attribdescset.h:166
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
Setup class for Attrib::Desc.
Definition: attribdesc.h:39
static const char * userRefStr()
Definition: attribdescset.h:159
void fillPar(IOPar &iop, const ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:175
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:40
static uiHor3DInterpol * create(uiParent *)
static const char * hiddenStr()
Definition: attribdescset.h:161
bool containsStoredDescOnly() const
Definition: attribdescset.h:145
static const char * highestIDStr()
Definition: attribdescset.h:157
bool is2d_
Definition: attribdescset.h:178
Notifier with automatic capsule creation.
Definition: callback.h:395
Definition: uistring.h:218
static const char * definitionStr()
Definition: attribdescset.h:158
Desc * desc(int idx)
Definition: attribdescset.h:76
const char * errMsg() const
Definition: horizontracker.h:61
bool couldbeanydim_
Definition: attribdescset.h:180
int size() const
Definition: attribdescset.h:44
ObjectSet< Desc > descs_
Definition: attribdescset.h:176
DescID defattribid_
Definition: attribdescset.h:183
bool storedattronly_
Definition: attribdescset.h:179
Compound key consisting of ints.
Definition: multiid.h:25
Semblance Attribute.
Definition: attribdataholder.h:25
static const char * inputPrefixStr()
Definition: attribdescset.h:160

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