OpendTect-6_4  6.4
rockphysics.h
Go to the documentation of this file.
1 #ifndef rockphysics_h
2 #define rockphysics_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: Bert Bril
9  Date: Feb 2012
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 
14 -*/
15 
16 #include "generalmod.h"
17 #include "propertyref.h"
18 #include "repos.h"
19 class MathProperty;
20 class ascistream;
21 class ascostream;
22 
23 
34 namespace RockPhysics
35 {
36 
37 mExpClass(General) Formula : public NamedObject
38 {
39 public:
40 
42 
43  Formula( PropType t, const char* nm=0 )
44  : NamedObject(nm)
45  , type_(t) {}
46 
47  static Formula* get(const IOPar&);
48  ~Formula();
49  Formula( const Formula& f ) { *this = f; }
50  Formula& operator =(const Formula&);
51  inline bool operator ==( const Formula& pr ) const
52  { return name() == pr.name(); }
53  inline bool operator !=( const Formula& pr ) const
54  { return name() != pr.name(); }
55 
56  inline bool hasPropType( PropType t ) const
57  { return type_ == t; }
58 
59  mExpClass(General) ConstDef : public NamedObject
60  {
61  public:
62  ConstDef( const char* nm )
63  : NamedObject(nm)
64  , typicalrg_(mUdf(float),mUdf(float))
65  , defaultval_(mUdf(float)) {}
68  float defaultval_;
69  };
70  mExpClass(General) VarDef : public NamedObject
71  {
72  public:
73  VarDef( const char* nm, PropType t )
74  : NamedObject(nm)
75  , type_(t) {}
77  PropType type_;
79  };
80 
81  PropType type_;
88 
89  bool usePar(const IOPar&);
90  void fillPar(IOPar&) const;
91 
92  bool setDef(const char*); // Will add var- and constdefs
93  MathProperty* getProperty(const PropertyRef* pr=0) const;
94 
95 };
96 
97 
98 mExpClass(General) FormulaSet : public ObjectSet<const Formula>
99 {
100 public:
102  { deepErase( *(ObjectSet<Formula>*)this ); }
103  int getIndexOf(const char*) const;
104  void getRelevant(PropertyRef::StdType,
105  BufferStringSet&) const;
106 
107  const Formula* get( const char* nm ) const
108  {
109  const int idxof = getIndexOf( nm );
110  return idxof<0 ? 0 : (*this)[idxof];
111  }
112 
113  bool save(Repos::Source) const;
114 
115  void readFrom(ascistream&);
116  bool writeTo(ascostream&) const;
117 
118 };
119 
120 
121 
122 } // namespace RockPhysics
123 
125 mGlobal(General) inline RockPhysics::FormulaSet& eROCKPHYSFORMS()
126 { return const_cast<RockPhysics::FormulaSet&>( ROCKPHYSFORMS() ); }
127 
128 
129 #endif
#define mExpClass(module)
Definition: commondefs.h:160
Ref Data for a (usually petrophysical) property.
Definition: rockphysics.h:34
Calculated property.
Definition: mathproperty.h:32
Definition: rockphysics.h:98
bool operator==(const ArrayNDInfo &a1, const ArrayNDInfo &a2)
Definition: arrayndinfo.h:53
ObjectSet< ConstDef > constdefs_
Definition: rockphysics.h:85
Definition: rockphysics.h:70
~FormulaSet()
Definition: rockphysics.h:101
#define mGlobal(module)
Definition: commondefs.h:163
void usePar(const IOPar &iop, ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:188
OpendTect standard ascii format file writing.
Definition: ascstream.h:32
Ref Data for a (usually petrophysical) property.
Definition: propertyref.h:42
RockPhysics::FormulaSet & eROCKPHYSFORMS()
Definition: rockphysics.h:125
Interval< float > typicalrg_
Definition: rockphysics.h:67
Set of BufferString objects.
Definition: bufstringset.h:28
float defaultval_
Definition: rockphysics.h:68
BufferString unit_
Definition: rockphysics.h:84
ConstDef(const char *nm)
Definition: rockphysics.h:62
Set of pointers to objects.
Definition: commontypes.h:32
Definition: rockphysics.h:37
BufferString unit_
Definition: rockphysics.h:78
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:47
BufferString def_
Definition: rockphysics.h:82
VarDef(const char *nm, PropType t)
Definition: rockphysics.h:73
Formula(const Formula &f)
Definition: rockphysics.h:49
ObjectSet< VarDef > vardefs_
Definition: rockphysics.h:86
#define mUdf(type)
Use this macro to get the undefined for simple types.
Definition: undefval.h:272
Source
Definition: repos.h:25
const RockPhysics::FormulaSet & ROCKPHYSFORMS()
PropType type_
Definition: rockphysics.h:77
Repos::Source src_
Definition: rockphysics.h:87
Formula(PropType t, const char *nm=0)
Definition: rockphysics.h:43
bool operator!=(const ArrayNDInfo &a1, const ArrayNDInfo &a2)
Definition: arrayndinfo.h:62
bool hasPropType(PropType t) const
Definition: rockphysics.h:56
void fillPar(IOPar &iop, const ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:175
OpendTect standard ascii format file reading.
Definition: ascstream.h:83
BufferString desc_
Definition: rockphysics.h:76
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:40
Object with a name.
Definition: namedobj.h:35
BufferString desc_
Definition: rockphysics.h:83
Definition: rockphysics.h:59
StdType
Definition: propertyref.h:46
PropertyRef::StdType PropType
Definition: rockphysics.h:41
BufferString desc_
Definition: rockphysics.h:66
virtual const OD::String & name() const
Definition: namedobj.h:47
PropType type_
Definition: rockphysics.h:81
void deepErase(ObjectSet< T > &os)
empty the ObjectSet deleting all objects pointed to.
Definition: objectset.h:118

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