OpendTect  6.6
wellman.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: Aug 2003
9  RCS: $Id$
10 ________________________________________________________________________
11 
12 
13 -*/
14 
15 #include "wellmod.h"
16 #include "sets.h"
17 #include "bufstring.h"
18 #include <bitset>
19 
20 class DBKey;
21 class IOObj;
22 class MultiID;
23 class BufferStringSet;
24 class UnitOfMeasure;
25 
26 namespace Well
27 {
28 
29 class Data;
30 
31 /*\brief Tells the Well Manager what you need to be loaded.*/
32 
33 #define mWellNrSubObjTypes 9
34 
35 enum SubObjType { Inf=0, Trck=1, D2T=2, CSMdl=3, Mrkrs=4, Logs=5,
37 
38 
40 {
41 public:
42 
43  LoadReqs(bool addall=true);
47  static LoadReqs All();
48  bool operator ==( const LoadReqs& oth ) const
49  { return reqs_ == oth.reqs_; }
50 
52  LoadReqs& remove( SubObjType typ ) { reqs_[typ]=0; return *this; }
53  void setToAll() { *this = All(); }
54  void setEmpty() { reqs_.reset(); }
55  bool isEmpty() const { return reqs_.none(); }
56  void include(const LoadReqs&);
57  void exclude(const LoadReqs&);
58 
59  bool includes( SubObjType typ ) const
60  { return reqs_[typ]; }
61  bool includes(const LoadReqs&) const;
63 
64 protected:
65 
66  std::bitset<mWellNrSubObjTypes> reqs_;
67 };
68 
69 
70 
76 {
77 public:
78  ~Man();
79 
80  void cleanup();
81  void removeObject(const Data*);
82  void removeObject(const MultiID&);
83  Data* get(const MultiID&);
85  Data* get(const DBKey&,LoadReqs);
87  bool isLoaded(const MultiID&) const;
88  bool reload(const MultiID&,LoadReqs lreq);
89  bool reloadDispPars(const MultiID&, bool for2d=false);
90  bool reloadLogs(const MultiID&);
91  bool validID(const MultiID&) const;
92 
93  const char* errMsg() const { return msg_; }
94  ObjectSet<Data>& wells() { return wells_; }
95 
96  static bool getWellKeys(TypeSet<MultiID>&,bool onlyloaded=false);
97  static bool getWellNames(BufferStringSet&,bool onlyloaded=false);
99  bool onlyloaded=false);
102  bool onlyloaded=false);
104  bool onlyloaded=false);
105 
106  static bool getMarkersByID(const MultiID&, BufferStringSet&);
107  static bool getMarkersByID(const MultiID&, BufferStringSet&,
108  TypeSet<Color>&);
109  static bool getMarkersByID(const MultiID&, BufferStringSet&,
112  bool onlyloaded=false);
113 
114  static void dumpMgrInfo(IOPar&);
115 
118 
119 protected:
120 
121  Man() {}
122  static Man* mgr_;
123  mGlobal(Well) friend Man& MGR();
124 
128 
129  int gtByKey(const MultiID&) const;
130  Well::Data* addNew(const MultiID&, LoadReqs lreq=LoadReqs(false));
131 
134 
135 public:
136  mDeprecated("Use getLogNamesByID instead")
137  static bool getLogNames(const MultiID&,BufferStringSet&,
138  bool forceLoad=false);
139  mDeprecated("Use getAllMarkerNames instead")
140  static bool getMarkerNames(BufferStringSet&);
141 
142  mDeprecated("Use get instead")
143  void add(const MultiID&,Data*);
144 
145  mDeprecated("Use removeObject instead")
146  Data* release(const MultiID&);
147 
149  bool reload(const MultiID&);
150 
151 };
152 
154 
155 mGlobal(Well) IOObj* findIOObj(const char* wellnm,const char* uwi);
158 
159 } // namespace Well
160 
Well::Man::getMarkersByID
static bool getMarkersByID(const MultiID &, BufferStringSet &)
Well::Mrkrs
@ Mrkrs
Definition: wellman.h:35
Well::findIOObj
IOObj * findIOObj(const char *wellnm, const char *uwi)
Well::Man::Man
Man()
Definition: wellman.h:121
Well::Man::readReqData
bool readReqData(const MultiID &, Data *, LoadReqs)
Well::LoadReqs::includes
bool includes(SubObjType typ) const
Definition: wellman.h:59
Well::Man::getMarkersByID
static bool getMarkersByID(const MultiID &, BufferStringSet &, TypeSet< Color > &, TypeSet< float > &)
Well::Man::getMarkersByID
static bool getMarkersByID(const MultiID &, BufferStringSet &, TypeSet< Color > &)
Well::Man::depthstorageunit_
static const UnitOfMeasure * depthstorageunit_
Definition: wellman.h:132
Well::Man::errMsg
const char * errMsg() const
Definition: wellman.h:93
Well::displayToStorageDepth
float displayToStorageDepth(float)
Well::Man::reloadDispPars
bool reloadDispPars(const MultiID &, bool for2d=false)
Well::SubObjType
SubObjType
Definition: wellman.h:35
Well::Man::~Man
~Man()
Well::Logs
@ Logs
Definition: wellman.h:35
Well::Data
The holder of all data concerning a certain well.
Definition: welldata.h:121
mGlobal
#define mGlobal(module)
Definition: commondefs.h:180
ObjectSet
Set of pointers to objects.
Definition: commontypes.h:31
BufferStringSet
Set of BufferString objects.
Definition: bufstringset.h:26
Well::LoadReqs::setToAll
void setToAll()
Definition: wellman.h:53
Well::LoadReqs::toString
BufferString toString() const
Well::MGR
Man & MGR()
Well::LoadReqs::add
LoadReqs & add(SubObjType)
Well::CSMdl
@ CSMdl
Definition: wellman.h:35
Well::Man::getAllMarkerNames
static bool getAllMarkerNames(BufferStringSet &, bool onlyloaded=false)
Well::Man::msg_
BufferString msg_
Definition: wellman.h:126
mExpClass
#define mExpClass(module)
Definition: commondefs.h:177
Well::LoadReqs::All
static LoadReqs All()
Well::Man::depthdisplayunit_
static const UnitOfMeasure * depthdisplayunit_
Definition: wellman.h:133
Well::Man::getAllMarkerInfo
static bool getAllMarkerInfo(BufferStringSet &, TypeSet< Color > &, bool onlyloaded=false)
Well::LoadReqs::isEmpty
bool isEmpty() const
Definition: wellman.h:55
Well::LoadReqs::LoadReqs
LoadReqs(SubObjType)
Well::Man::removeObject
void removeObject(const Data *)
Well::Man::isLoaded
bool isLoaded(const MultiID &) const
Repos::Data
@ Data
Definition: repos.h:24
Well::LoadReqs::include
void include(const LoadReqs &)
Well::Man::reloadLogs
bool reloadLogs(const MultiID &)
operator==
bool operator==(const ArrayNDInfo &a1, const ArrayNDInfo &a2)
Definition: arrayndinfo.h:81
Well::Man::reload
bool reload(const MultiID &, LoadReqs lreq)
bufstring.h
Well::Man::addNew
Well::Data * addNew(const MultiID &, LoadReqs lreq=LoadReqs(false))
Well::Man::get
Data * get(const DBKey &, LoadReqs)
Well::D2T
@ D2T
Definition: wellman.h:35
Well::LoadReqs::exclude
void exclude(const LoadReqs &)
Well::Man::dumpMgrInfo
static void dumpMgrInfo(IOPar &)
Well::Man::surveyDepthStorageUnit
static const UnitOfMeasure * surveyDepthStorageUnit()
Well
Definition: directionalsurvey.h:20
Well::DispProps3D
@ DispProps3D
Definition: wellman.h:36
Well::Man::mDeprecated
mDeprecated("Use getLogNamesByID instead") static bool getLogNames(const MultiID &
DBKey
Definition: dbkey.h:21
Well::Man::getWellNames
static bool getWellNames(BufferStringSet &, bool onlyloaded=false)
Well::Inf
@ Inf
Definition: wellman.h:35
mDeprecated
#define mDeprecated(msg)
Definition: plfdefs.h:215
Well::Man::cleanup
void cleanup()
Well::Man::wells_
ObjectSet< Data > wells_
Definition: wellman.h:125
Well::LoadReqs::reqs_
std::bitset< 9 > reqs_
Definition: wellman.h:66
Well::LoadReqs::LoadReqs
LoadReqs(SubObjType, SubObjType, SubObjType)
Well::Man::MGR
friend Man & MGR()
IOObj
Definition: ioobj.h:58
Well::LoadReqs::setEmpty
void setEmpty()
Definition: wellman.h:54
Well::Man
Well manager.
Definition: wellman.h:76
Well::LoadReqs::remove
LoadReqs & remove(SubObjType typ)
Definition: wellman.h:52
Well::Man::getAllLogNames
static bool getAllLogNames(BufferStringSet &, bool onlyloaded=false)
Well::LoadReqs::includes
bool includes(const LoadReqs &) const
MultiID
Compound key consisting of ints.
Definition: multiid.h:24
BufferString
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size.
Definition: bufstring.h:40
Well::LogInfos
@ LogInfos
Definition: wellman.h:36
Well::Man::removeObject
void removeObject(const MultiID &)
UnitOfMeasure
Unit of Measure.
Definition: unitofmeasure.h:35
Well::Man::getLogNamesByID
static bool getLogNamesByID(const MultiID &, BufferStringSet &, bool onlyloaded=false)
Well::LoadReqs::LoadReqs
LoadReqs(bool addall=true)
Well::Man::getWellKeys
static bool getWellKeys(TypeSet< MultiID > &, bool onlyloaded=false)
Well::LoadReqs
Definition: wellman.h:40
Well::Man::get
Data * get(const MultiID &, LoadReqs)
Well::Man::wells
ObjectSet< Data > & wells()
Definition: wellman.h:94
Well::LoadReqs::LoadReqs
LoadReqs(SubObjType, SubObjType)
Well::Man::loadstates_
TypeSet< LoadReqs > loadstates_
Definition: wellman.h:127
sets.h
Well::Man::gtByKey
int gtByKey(const MultiID &) const
Well::DispProps2D
@ DispProps2D
Definition: wellman.h:36
Well::Trck
@ Trck
Definition: wellman.h:35
Well::Man::mgr_
static Man * mgr_
Definition: wellman.h:122
Well::Man::get
Data * get(const MultiID &)
Well::Man::surveyDepthDisplayUnit
static const UnitOfMeasure * surveyDepthDisplayUnit()
IOPar
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:55
sKey::All
FixedString All()
Definition: keystrs.h:35
Well::storageToDisplayDepth
float storageToDisplayDepth(float)
Well::Man::validID
bool validID(const MultiID &) const
TypeSet< MultiID >

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