42 enum Type { NodeOnly, Leaved, Leaf };
48 virtual
Type type() const = 0;
49 virtual
bool isEmpty()
const {
return false; }
50 virtual bool isUndef()
const {
return false; }
51 virtual bool hasChildren()
const = 0;
52 bool isLeaf()
const {
return type()==Leaf; }
53 bool isLeaved()
const {
return type()==Leaved; }
76 virtual int level()
const = 0;
92 void doUse(
const char*,
int*);
93 void notifChange(
bool isrem=
false);
99 int treeDepth()
const;
100 bool isBelow(
const UnitRef*)
const;
102 bool precedes(
const UnitRef&)
const;
106 virtual void use(
const char* s ) { doUse(s,0); }
107 virtual void getPropsFrom(
const IOPar&);
108 virtual void putPropsTo(
IOPar&)
const;
126 virtual bool isEmpty()
const {
return refs_.isEmpty(); }
128 virtual bool hasLeaves()
const = 0;
131 virtual void setCode(
const char* c ) { code_ = c; }
137 int nrRefs()
const {
return refs_.size(); }
138 UnitRef&
ref(
int idx ) {
return *refs_[idx]; }
139 const UnitRef&
ref(
int idx )
const {
return *refs_[idx]; }
142 virtual bool isParentOf(
const UnitRef&)
const;
144 UnitRef*
find(
const char* urcode ) {
return fnd(urcode); }
145 const UnitRef*
find(
const char* urcode )
const{
return fnd(urcode); }
147 virtual int nrLeaves()
const;
148 virtual int level()
const {
return upnode_?upnode_->level()+1:0; }
156 UnitRef* fnd(
const char*)
const;
162 virtual bool add(UnitRef*,
bool rev=
false);
163 virtual bool insert(UnitRef*,
int posidx);
164 virtual UnitRef* replace(
int uridx,UnitRef*);
165 void swapChildren(
int,
int);
166 void remove(
int uridx )
168 void remove(
const UnitRef* ur )
173 virtual void getPropsFrom(
const IOPar&);
174 virtual void putPropsTo(
IOPar&)
const;
176 void changeTimeRange(
float dtime);
188 : NodeUnitRef(up,c,d) {}
204 : NodeUnitRef(up,c,d)
213 virtual int nrLeaves()
const {
return refs_.size(); }
215 {
return refs_.
isEmpty() ? 0 : refs_[0]->firstLeaf(); }
229 virtual void use(
const char* s ) { doUse(s,&levelid_); }
242 virtual bool isUndef()
const;
248 void setLithology(
int);
251 Color dispColor(
bool lith_else_upnode)
const;
252 virtual int level()
const {
return upnode_?upnode_->level()+1:0; }
260 virtual void use(
const char* s ) { doUse(s,&lith_); }
265 virtual void getPropsFrom(
const IOPar&);
#define mExpClass(module)
Definition: commondefs.h:160
int lithology() const
Definition: stratunitref.h:247
To be able to send and/or receive CallBacks, inherit from this class.
Definition: callback.h:272
NodeUnitRef * topNode()
Definition: stratunitref.h:270
virtual int level() const
Definition: stratunitref.h:252
virtual void use(const char *s)
Definition: stratunitref.h:106
UnitRef for units containing Leaf units only.
Definition: stratunitref.h:199
virtual const LeafUnitRef * firstLeaf() const
Definition: stratunitref.h:214
const UnitRef & ref(int idx) const
Definition: stratunitref.h:139
UnitRef & ref(int idx)
Definition: stratunitref.h:138
UnitRef for units containing non-Leaf units only.
Definition: stratunitref.h:183
int lith_
Definition: stratunitref.h:257
bool isLeaved() const
Definition: stratunitref.h:53
NodeUnitRef * upnode_
Definition: stratunitref.h:85
virtual int level() const
Definition: stratunitref.h:148
NodeOnlyUnitRef(NodeUnitRef *up, const char *c, const char *d=0)
Definition: stratunitref.h:186
Interval< float > timerg_
Definition: stratunitref.h:153
virtual bool hasChildren() const
Definition: stratunitref.h:127
virtual const LeafUnitRef * firstLeaf() const
Definition: stratunitref.h:253
ObjectSet< T >::size_type indexOf(const ObjectSet< T > &os, const S &val)
Locate object in set.
Definition: objectset.h:169
virtual bool isParentOf(const UnitRef &) const
Definition: stratunitref.h:75
virtual T * removeSingle(size_type, bool keep_order=true)
Definition: objectset.h:460
#define mDeclareEnumUtils(enm)
Some utilities surrounding the often needed enum <-> string table.
Definition: enums.h:258
const OD::String & description() const
Definition: stratunitref.h:59
Level::ID levelid_
Definition: stratunitref.h:226
Definition: callback.h:254
virtual void fill(BufferString &bs) const
Definition: stratunitref.h:259
Set of pointers to objects.
Definition: commontypes.h:32
virtual Interval< float > timeRange() const
Definition: stratunitref.h:133
virtual void use(const char *s)
Definition: stratunitref.h:260
Color color_
Definition: stratunitref.h:88
virtual void use(const char *s)
Definition: stratunitref.h:229
int ID
Definition: stratlevel.h:46
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:47
int indexOf(const UnitRef *ur) const
Definition: stratunitref.h:140
const NodeUnitRef * upNode(int skip=0) const
Definition: stratunitref.h:67
Level::ID levelID() const
Definition: stratunitref.h:210
bool isLeaf() const
Definition: stratunitref.h:52
void setUpNode(NodeUnitRef *newpar)
Definition: stratunitref.h:69
a name and an ID.
Definition: stratlith.h:37
Notifier< UnitRef > changed
Definition: stratunitref.h:78
virtual const OD::String & code() const
Definition: stratunitref.h:130
const LeafUnitRef * getLeaf(const Lithology &l) const
Definition: stratunitref.h:221
#define mUdf(type)
Use this macro to get the undefined for simple types.
Definition: undefval.h:272
encapsulates the read-access-only part of strings in OD.
Definition: odstring.h:31
NodeUnitRef * upNode(int skip=0)
UnitRef for units containing other units only.
Definition: stratunitref.h:118
virtual Type type() const
Definition: stratunitref.h:191
virtual bool isEmpty() const
Definition: stratunitref.h:49
virtual bool isEmpty() const
Definition: stratunitref.h:126
UnitRef for layers.
Definition: stratunitref.h:236
const IOPar & pars() const
Definition: stratunitref.h:64
Color color() const
Definition: stratunitref.h:61
BufferString code_
Definition: stratunitref.h:154
static const char * sKeyPropsFor()
Definition: stratunitref.h:110
const LeafUnitRef * getLeaf(int i) const
Definition: stratunitref.h:218
Reference data for a stratigraphic unit.
Definition: stratunitref.h:38
virtual bool isUndef() const
Definition: stratunitref.h:50
virtual int nrLeaves() const
Definition: stratunitref.h:213
Type
Definition: stratunitref.h:42
Stratigraphy.
Definition: stratlevel.h:26
ObjectSet< UnitRef > refs_
Definition: stratunitref.h:152
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:40
const UnitRef * find(const char *urcode) const
Definition: stratunitref.h:145
virtual Type type() const
Definition: stratunitref.h:207
int nrRefs() const
Definition: stratunitref.h:137
Tree of UnitRef's.
Definition: stratreftree.h:29
virtual void setCode(const char *)
Definition: stratunitref.h:58
Concatenated short keys separated by dots. Used for Object identifiers in the Object Manager...
Definition: compoundkey.h:23
LeavedUnitRef(NodeUnitRef *up, const char *c, const char *d=0)
Definition: stratunitref.h:202
virtual void setCode(const char *c)
Definition: stratunitref.h:131
Color is an RGB color object, with a transparancy. The storage is in a 4-byte integer, similar to Qt.
Definition: color.h:26
virtual bool hasLeaves() const
Definition: stratunitref.h:208
virtual void fill(BufferString &bs) const
Definition: stratunitref.h:105
bool isEmpty(const NLAModel *mdl)
virtual void setDescription(const char *d)
Definition: stratunitref.h:60
virtual bool hasChildren() const
Definition: stratunitref.h:245
UnitRef * find(const char *urcode)
Definition: stratunitref.h:144
void removeAllChildren()
Definition: stratunitref.h:170
Notifier< UnitRef > toBeDeleted
Definition: stratunitref.h:79
IOPar pars_
Definition: stratunitref.h:89
BufferString desc_
Definition: stratunitref.h:87
IOPar & pars()
Definition: stratunitref.h:63
virtual bool hasLeaves() const
Definition: stratunitref.h:190
virtual void fill(BufferString &bs) const
Definition: stratunitref.h:228
virtual Type type() const
Definition: stratunitref.h:244
static const char * sKeyTreeProps()
Definition: stratunitref.h:111
void deepErase(ObjectSet< T > &os)
empty the ObjectSet deleting all objects pointed to.
Definition: objectset.h:118