OpendTect  6.6
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  RCS: $Id$
10 ________________________________________________________________________
11 
12 -*/
13 
14 #include "stratmod.h"
15 #include "stratunitref.h"
16 #include "stratlith.h"
17 #include "stratcontent.h"
18 #include "repos.h"
19 #include "od_iosfwd.h"
20 
21 namespace Strat
22 {
23 class LevelSet;
24 
25 
29 {
30 public:
33 
34  Repos::Source source() const { return src_; }
35 
36  LithologySet& lithologies() { return liths_; }
37  const LithologySet& lithologies() const { return liths_; }
38  ContentSet& contents() { return contents_; }
39  const ContentSet& contents() const { return contents_; }
40 
41  static const char* sKeyNoCode() { return "<no_code>"; }
42 
46  const UnitRef* notifUnit() const { return notifun_; }
48 
49  const LeafUnitRef& undefLeaf() const { return udfleaf_; }
50  virtual int level() const { return 0; }
51 
53  static RefTree* createStd(const char*);
54 
57  const LeavedUnitRef* getLevelSetUnit(const char* lvlnm) const;
58 
59  void addLevelUnit(const Level&);
60  void removeLevelUnit(const Level&);
61  // adds & removes units from levels on RefTree created
62  // using createFromLevelSet()
63 
65 
66 protected:
67 
68  void initTree();
70 
73  const UnitRef* notifun_;
75 
77 
78 public:
79 
82 
83  // for printing, export or something.
84  // otherwise, use RepositoryAccess::write()
85  bool read(od_istream&);
86  bool write(od_ostream&) const;
87 
88  friend class RefTreeMgr;
89 
90  void reportChange(const UnitRef*,bool isrem=false);
91  void reportAdd(const UnitRef*);
92  bool addLeavedUnit(const char*,const char*);
93  Strat::LeavedUnitRef* getByLevel(int lvlid) const;//first match
94 
95 };
96 
97 mGlobal(Strat) void init(); // initializes RefTreeMgr and loads default tree
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
105 
109 
112 
113 
114 } // namespace Strat
115 
116 
Strat::RefTree::removeLevelUnit
void removeLevelUnit(const Level &)
Repos::Source
Source
Definition: repos.h:24
Strat::RefTree::~RefTree
~RefTree()
Strat::RefTree::createFromLevelSet
void createFromLevelSet(const LevelSet &)
keep contents and lithologies
Strat::RefTree::unitChanged
Notifier< RefTree > unitChanged
Definition: stratreftree.h:44
Strat::RefTree::unitToBeDeleted
Notifier< RefTree > unitToBeDeleted
Definition: stratreftree.h:45
Strat::init
void init()
Strat::RefTree::initTree
void initTree()
Strat::RefTree::read
bool read(od_istream &)
Strat::sKeyDefaultTree
const char * sKeyDefaultTree()
Strat::LithologySet
Definition: stratlith.h:77
Strat::RefTree::getByLevel
Strat::LeavedUnitRef * getByLevel(int lvlid) const
mGlobal
#define mGlobal(module)
Definition: commondefs.h:180
Strat::RefTree::src_
Repos::Source src_
Definition: stratreftree.h:80
BufferStringSet
Set of BufferString objects.
Definition: bufstringset.h:26
Strat::ContentSet
set of names for stuff that can be inside porous layers
Definition: stratcontent.h:73
Strat::RefTree::createStd
static RefTree * createStd(const char *)
mExpClass
#define mExpClass(module)
Definition: commondefs.h:177
Strat::RefTree::contents
ContentSet & contents()
Definition: stratreftree.h:38
od_istream
OD class for stream read common access to the std::cin.
Definition: od_istream.h:24
Strat::LeavedUnitRef
UnitRef for units containing Leaf units only.
Definition: stratunitref.h:199
Strat::Level
Stratigraphic level.
Definition: stratlevel.h:42
Strat::RefTree::write
bool write(od_ostream &) const
Strat::LevelSet
Set of Stratigraphic levels.
Definition: stratlevel.h:99
CallBacker
Inherit from this class to be able to send and/or receive CallBacks.
Definition: callback.h:185
Strat::RefTree::liths_
LithologySet liths_
Definition: stratreftree.h:71
Strat::RefTree::levelToBeRemoved
void levelToBeRemoved(CallBacker *)
Strat::RefTree::notifun_
const UnitRef * notifun_
Definition: stratreftree.h:73
Strat::RefTree
Tree of UnitRef's
Definition: stratreftree.h:29
Strat::RefTree::lithologies
LithologySet & lithologies()
Definition: stratreftree.h:36
Strat::RefTree::udfleaf_
LeafUnitRef & udfleaf_
Definition: stratreftree.h:74
Strat::RefTree::reportChange
void reportChange(const UnitRef *, bool isrem=false)
Strat::RefTree::RefTree
RefTree()
Strat::RefTree::source
Repos::Source source() const
Definition: stratreftree.h:34
stratlith.h
Strat::RT
const RefTree & RT()
Strat::RefTree::contents
const ContentSet & contents() const
Definition: stratreftree.h:39
Strat::RefTree::getLevelSetUnit
const LeavedUnitRef * getLevelSetUnit(const char *lvlnm) const
Notifier
Class to help setup a callback handling.
Definition: notify.h:126
Strat::RefTree::level
virtual int level() const
Definition: stratreftree.h:50
Strat::RefTree::lithologies
const LithologySet & lithologies() const
Definition: stratreftree.h:37
Strat::RefTree::sKeyNoCode
static const char * sKeyNoCode()
Definition: stratreftree.h:41
stratcontent.h
Strat::RefTree::addLeavedUnit
bool addLeavedUnit(const char *, const char *)
BufferString
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size.
Definition: bufstring.h:40
Strat::LeafUnitRef
UnitRef for layers.
Definition: stratunitref.h:236
Strat::NodeOnlyUnitRef
UnitRef for units containing non-Leaf units only.
Definition: stratunitref.h:183
Strat
Stratigraphy.
Definition: stratlevel.h:26
Strat::popRefTree
void popRefTree()
od_iosfwd.h
Strat::eRT
RefTree & eRT()
Definition: stratreftree.h:99
Strat::RefTree::reportAdd
void reportAdd(const UnitRef *)
repos.h
stratunitref.h
Strat::setRT
void setRT(RefTree *)
Strat::RefTree::addLevelUnit
void addLevelUnit(const Level &)
Strat::pushRefTree
void pushRefTree(RefTree *)
Strat::RefTree::setToActualTypes
void setToActualTypes()
Strat::RefTree::notifUnit
const UnitRef * notifUnit() const
if null, assume everything has changed
Definition: stratreftree.h:46
od_ostream
OD class for stream write common access to the user log file, or std::cout in other than od_main.
Definition: od_ostream.h:26
Strat::RefTree::deleteNotif
Notifier< RefTree > deleteNotif
Definition: stratreftree.h:64
Strat::loadDefaultTree
bool loadDefaultTree()
Strat::UnitRef
Reference data for a stratigraphic unit.
Definition: stratunitref.h:38
Strat::RefTree::getStdNames
static void getStdNames(BufferStringSet &)
Strat::RefTree::name_
BufferString name_
Definition: stratreftree.h:81
Strat::RefTree::contents_
ContentSet contents_
Definition: stratreftree.h:72
Strat::RefTree::unitAdded
Notifier< RefTree > unitAdded
Definition: stratreftree.h:43
Strat::RefTree::undefLeaf
const LeafUnitRef & undefLeaf() const
Definition: stratreftree.h:49

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