OpendTect-6_4  6.4
stratreftree.h
Go to the documentation of this file.
1 #ifndef stratreftree_h
2 #define stratreftree_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: Bert Bril
9  Date: Dec 2003
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 -*/
14 
15 #include "stratmod.h"
16 #include "stratunitref.h"
17 #include "stratlith.h"
18 #include "stratcontent.h"
19 #include "repos.h"
20 #include "od_iosfwd.h"
21 
22 namespace Strat
23 {
24 class LevelSet;
25 
26 
30 {
31 public:
32  RefTree();
33  ~RefTree();
34 
35  Repos::Source source() const { return src_; }
36 
37  LithologySet& lithologies() { return liths_; }
38  const LithologySet& lithologies() const { return liths_; }
39  ContentSet& contents() { return contents_; }
40  const ContentSet& contents() const { return contents_; }
41 
42  static const char* sKeyNoCode() { return "<no_code>"; }
43 
47  const UnitRef* notifUnit() const { return notifun_; }
49 
50  const LeafUnitRef& undefLeaf() const { return udfleaf_; }
51  virtual int level() const { return 0; }
52 
53  static void getStdNames(BufferStringSet&);
54  static RefTree* createStd(const char*);
55 
56  void createFromLevelSet(const LevelSet&);
58  const LeavedUnitRef* getLevelSetUnit(const char* lvlnm) const;
59 
60  void addLevelUnit(const Level&);
61  void removeLevelUnit(const Level&);
62  // adds & removes units from levels on RefTree created
63  // using createFromLevelSet()
64 
66 
67 protected:
68 
69  void initTree();
70  void setToActualTypes();
71 
74  const UnitRef* notifun_;
76 
77  void levelToBeRemoved(CallBacker*);
78 
79 public:
80 
83 
84  // for printing, export or something.
85  // otherwise, use RepositoryAccess::write()
86  bool read(od_istream&);
87  bool write(od_ostream&) const;
88 
89  friend class RefTreeMgr;
90 
91  void reportChange(const UnitRef*,bool isrem=false);
92  void reportAdd(const UnitRef*);
93  bool addLeavedUnit(const char*,const char*);
94  Strat::LeavedUnitRef* getByLevel(int lvlid) const;//first match
95 
96 };
97 
98 mGlobal(Strat) const RefTree& RT();
99 inline RefTree& eRT() { return const_cast<RefTree&>( RT() ); }
100 
101 // Needless to say that if you push, make sure you pop (so afterwards the real
102 // default RefTree is restored
104 mGlobal(Strat) void popRefTree();
105 
106 mGlobal(Strat) void setRT(RefTree*);
109 
110 
111 } // namespace Strat
112 
113 
114 #endif
#define mExpClass(module)
Definition: commondefs.h:160
To be able to send and/or receive CallBacks, inherit from this class.
Definition: callback.h:272
LithologySet liths_
Definition: stratreftree.h:72
Set of Stratigraphic levels.
Definition: stratlevel.h:99
OD class for stream write common access to the user log file, or std::cout in batch progs...
Definition: od_ostream.h:26
UnitRef for units containing Leaf units only.
Definition: stratunitref.h:199
void setRT(RefTree *)
UnitRef for units containing non-Leaf units only.
Definition: stratunitref.h:183
Definition: stratlith.h:77
#define mGlobal(module)
Definition: commondefs.h:163
void pushRefTree(RefTree *)
BufferString name_
Definition: stratreftree.h:82
Notifier< RefTree > unitAdded
Definition: stratreftree.h:44
Notifier< RefTree > unitChanged
Definition: stratreftree.h:45
Set of BufferString objects.
Definition: bufstringset.h:28
OD class for stream read.
Definition: od_istream.h:24
ContentSet contents_
Definition: stratreftree.h:73
Repos::Source source() const
Definition: stratreftree.h:35
Notifier< RefTree > unitToBeDeleted
Definition: stratreftree.h:46
Definition: callback.h:254
Stratigraphic level.
Definition: stratlevel.h:42
virtual int level() const
Definition: stratreftree.h:51
Repos::Source src_
Definition: stratreftree.h:81
Source
Definition: repos.h:25
UnitRef for layers.
Definition: stratunitref.h:236
Reference data for a stratigraphic unit.
Definition: stratunitref.h:38
set of names for stuff that can be inside porous layers
Definition: stratcontent.h:73
const UnitRef * notifun_
Definition: stratreftree.h:74
Notifier< RefTree > deleteNotif
Definition: stratreftree.h:65
Stratigraphy.
Definition: stratlevel.h:26
const LeafUnitRef & undefLeaf() const
Definition: stratreftree.h:50
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:40
Tree of UnitRef&#39;s.
Definition: stratreftree.h:29
void popRefTree()
const RefTree & RT()
RefTree & eRT()
Definition: stratreftree.h:99
const ContentSet & contents() const
Definition: stratreftree.h:40
const LithologySet & lithologies() const
Definition: stratreftree.h:38
const UnitRef * notifUnit() const
if null, assume everything has changed
Definition: stratreftree.h:47
ContentSet & contents()
Definition: stratreftree.h:39
static const char * sKeyNoCode()
Definition: stratreftree.h:42
LithologySet & lithologies()
Definition: stratreftree.h:37
LeafUnitRef & udfleaf_
Definition: stratreftree.h:75

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