OpendTect  6.3
stratreftree.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: Dec 2003
9 ________________________________________________________________________
10 
11 -*/
12 
13 #include "stratmod.h"
14 #include "stratunitref.h"
15 #include "stratlith.h"
16 #include "stratcontent.h"
17 #include "repos.h"
18 #include "od_iosfwd.h"
19 
20 namespace Strat
21 {
22 class LevelSet;
23 
24 
28 {
29 public:
30  RefTree();
31  ~RefTree();
32 
33  Repos::Source source() const { return src_; }
34 
35  LithologySet& lithologies() { return liths_; }
36  const LithologySet& lithologies() const { return liths_; }
37  ContentSet& contents() { return contents_; }
38  const ContentSet& contents() const { return contents_; }
39 
40  static const char* sKeyNoCode() { return "<no_code>"; }
41 
45  const UnitRef* notifUnit() const { return notifun_; }
47 
48  const LeafUnitRef& undefLeaf() const { return udfleaf_; }
49  virtual int level() const { return 0; }
50 
51  static void getStdNames(BufferStringSet&);
52  static RefTree* createStd(const char*);
53 
54  void createFromLevelSet(const LevelSet&);
56  const LeavedUnitRef* getLevelSetUnit(const char* lvlnm) const;
57 
59 
60 protected:
61 
62  void initTree();
63  void setToActualTypes();
64 
67  const UnitRef* notifun_;
69 
70  void levelSetChgCB(CallBacker*);
71 
72 public:
73 
76 
77  // for printing, export or something.
78  // otherwise, use RepositoryAccess::write()
79  bool read(od_istream&);
80  bool write(od_ostream&) const;
81 
82  friend class RefTreeMgr;
83 
84  void reportChange(const UnitRef*,bool isrem=false);
85  void reportAdd(const UnitRef*);
86  bool addLeavedUnit(const char*,const char*);
87  Strat::LeavedUnitRef* getByLevel(Level::ID) const;
88 
89 };
90 
91 mGlobal(Strat) const RefTree& RT();
92 inline RefTree& eRT() { return const_cast<RefTree&>( RT() ); }
93 
94 // Needless to say that if you push, make sure you pop (so afterwards the real
95 // default RefTree is restored
97 mGlobal(Strat) void popRefTree();
98 
99 mGlobal(Strat) void setRT(RefTree*);
102 
103 
104 } // namespace Strat
#define mExpClass(module)
Definition: commondefs.h:157
Inherit from this class to be able to send and/or receive CallBacks.
Definition: callback.h:182
LithologySet liths_
Definition: stratreftree.h:65
Set of Stratigraphic levels.
Definition: stratlevel.h:86
OD class for stream write common access to the user log file, or std::cout in batch progs...
Definition: od_ostream.h:25
UnitRef for units containing Leaf units only.
Definition: stratunitref.h:200
void setRT(RefTree *)
UnitRef for units containing non-Leaf units only.
Definition: stratunitref.h:184
Definition: stratlith.h:72
#define mGlobal(module)
Definition: commondefs.h:160
void pushRefTree(RefTree *)
BufferString name_
Definition: stratreftree.h:75
Notifier< RefTree > unitAdded
Definition: stratreftree.h:42
Notifier< RefTree > unitChanged
Definition: stratreftree.h:43
Set of BufferString objects.
Definition: bufstringset.h:25
OD class for stream read.
Definition: od_istream.h:23
ContentSet contents_
Definition: stratreftree.h:66
Repos::Source source() const
Definition: stratreftree.h:33
Notifier< RefTree > unitToBeDeleted
Definition: stratreftree.h:44
Class to help setup a callback handling.
Definition: notify.h:121
virtual int level() const
Definition: stratreftree.h:49
Repos::Source src_
Definition: stratreftree.h:74
Source
Definition: repos.h:23
UnitRef for layers.
Definition: stratunitref.h:240
Reference data for a stratigraphic unit.
Definition: stratunitref.h:36
set of names for stuff that can be inside porous layers
Definition: stratcontent.h:71
const UnitRef * notifun_
Definition: stratreftree.h:67
Notifier< RefTree > deleteNotif
Definition: stratreftree.h:58
Stratigraphy.
Definition: stratlevel.h:25
const LeafUnitRef & undefLeaf() const
Definition: stratreftree.h:48
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:38
Tree of UnitRef&#39;s.
Definition: stratreftree.h:27
void popRefTree()
const RefTree & RT()
RefTree & eRT()
Definition: stratreftree.h:92
const ContentSet & contents() const
Definition: stratreftree.h:38
FixedString ID()
Definition: keystrs.h:71
const LithologySet & lithologies() const
Definition: stratreftree.h:36
const UnitRef * notifUnit() const
if null, assume everything has changed
Definition: stratreftree.h:45
ContentSet & contents()
Definition: stratreftree.h:37
static const char * sKeyNoCode()
Definition: stratreftree.h:40
LithologySet & lithologies()
Definition: stratreftree.h:35
LeafUnitRef & udfleaf_
Definition: stratreftree.h:68

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