OpendTect  6.6
rockphysics.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: Feb 2012
9  RCS: $Id$
10 ________________________________________________________________________
11 
12 
13 -*/
14 
15 #include "generalmod.h"
16 #include "propertyref.h"
17 #include "repos.h"
18 class MathProperty;
19 class ascistream;
20 class ascostream;
21 
22 
33 namespace RockPhysics
34 {
35 
36 mExpClass(General) Formula : public NamedObject
37 {
38 public:
39 
41 
42  Formula( PropType t, const char* nm=0 )
43  : NamedObject(nm)
44  , type_(t) {}
45 
46  static Formula* get(const IOPar&);
48  Formula( const Formula& f ) { *this = f; }
49  Formula& operator =(const Formula&);
50  inline bool operator ==( const Formula& pr ) const
51  { return name() == pr.name(); }
52  inline bool operator !=( const Formula& pr ) const
53  { return name() != pr.name(); }
54 
55  inline bool hasPropType( PropType t ) const
56  { return type_ == t; }
57 
58  mExpClass(General) ConstDef : public NamedObject
59  {
60  public:
61  ConstDef( const char* nm )
62  : NamedObject(nm)
63  , typicalrg_(mUdf(float),mUdf(float))
64  , defaultval_(mUdf(float)) {}
67  float defaultval_;
68  };
69  mExpClass(General) VarDef : public NamedObject
70  {
71  public:
72  VarDef( const char* nm, PropType t )
73  : NamedObject(nm)
74  , type_(t) {}
78  };
79 
87 
88  bool usePar(const IOPar&);
89  void fillPar(IOPar&) const;
90 
91  bool setDef(const char*); // Will add var- and constdefs
92  MathProperty* getProperty(const PropertyRef* pr=0) const;
93 
94 };
95 
96 
98 {
99 public:
101 
102  int getIndexOf(const char*) const;
104  BufferStringSet&) const;
105 
106  const Formula* getByName( const char* nm ) const
107  {
108  const int idxof = getIndexOf( nm );
109  return idxof<0 ? 0 : (*this)[idxof];
110  }
111 
112  bool save(Repos::Source) const;
113 
115  bool writeTo(ascostream&) const;
116 
117 };
118 
119 
120 
121 } // namespace RockPhysics
122 
125 { return const_cast<RockPhysics::FormulaSet&>( ROCKPHYSFORMS() ); }
126 
127 
Repos::Source
Source
Definition: repos.h:24
RockPhysics::FormulaSet::getByName
const Formula * getByName(const char *nm) const
Definition: rockphysics.h:106
NamedObject
object with a name.
Definition: namedobj.h:42
RockPhysics::Formula::ConstDef
Definition: rockphysics.h:59
RockPhysics::Formula::constdefs_
ObjectSet< ConstDef > constdefs_
Definition: rockphysics.h:84
RockPhysics::FormulaSet::~FormulaSet
~FormulaSet()
RockPhysics::Formula::hasPropType
bool hasPropType(PropType t) const
Definition: rockphysics.h:55
RockPhysics::Formula::VarDef::type_
PropType type_
Definition: rockphysics.h:76
RockPhysics::Formula::type_
PropType type_
Definition: rockphysics.h:80
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
RockPhysics::Formula::usePar
bool usePar(const IOPar &)
mExpClass
#define mExpClass(module)
Definition: commondefs.h:177
RockPhysics::Formula::setDef
bool setDef(const char *)
RockPhysics::FormulaSet::getIndexOf
int getIndexOf(const char *) const
RockPhysics::Formula::def_
BufferString def_
Definition: rockphysics.h:81
operator==
bool operator==(const ArrayNDInfo &a1, const ArrayNDInfo &a2)
Definition: arrayndinfo.h:81
RockPhysics::FormulaSet
Definition: rockphysics.h:98
RockPhysics::Formula::Formula
Formula(PropType t, const char *nm=0)
Definition: rockphysics.h:42
NamedObject::name
virtual const name_type & name() const
Definition: namedobj.h:54
ascostream
OpendTect standard ascii format file writing.
Definition: ascstream.h:32
RockPhysics::Formula::Formula
Formula(const Formula &f)
Definition: rockphysics.h:48
RockPhysics::Formula::get
static Formula * get(const IOPar &)
returns null if bad IOPar
RockPhysics::Formula::unit_
BufferString unit_
Definition: rockphysics.h:83
RockPhysics::Formula::VarDef::unit_
BufferString unit_
Definition: rockphysics.h:77
RockPhysics::FormulaSet::readFrom
void readFrom(ascistream &)
eROCKPHYSFORMS
RockPhysics::FormulaSet & eROCKPHYSFORMS()
Definition: rockphysics.h:124
RockPhysics::Formula::src_
Repos::Source src_
Definition: rockphysics.h:86
operator!=
bool operator!=(const ArrayNDInfo &a1, const ArrayNDInfo &a2)
Definition: arrayndinfo.h:90
RockPhysics::Formula::ConstDef::typicalrg_
Interval< float > typicalrg_
Definition: rockphysics.h:66
RockPhysics::Formula::VarDef::desc_
BufferString desc_
Definition: rockphysics.h:75
RockPhysics::Formula::fillPar
void fillPar(IOPar &) const
RockPhysics::Formula::ConstDef::ConstDef
ConstDef(const char *nm)
Definition: rockphysics.h:61
RockPhysics::Formula::~Formula
~Formula()
RockPhysics::Formula::ConstDef::desc_
BufferString desc_
Definition: rockphysics.h:65
ROCKPHYSFORMS
const RockPhysics::FormulaSet & ROCKPHYSFORMS()
propertyref.h
RockPhysics::Formula::vardefs_
ObjectSet< VarDef > vardefs_
Definition: rockphysics.h:85
RockPhysics::FormulaSet::getRelevant
void getRelevant(PropertyRef::StdType, BufferStringSet &) const
BufferString
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size.
Definition: bufstring.h:40
PropertyRef
Ref Data for a (usually petrophysical) property.
Definition: propertyref.h:43
RockPhysics::Formula::PropType
PropertyRef::StdType PropType
Definition: rockphysics.h:40
RockPhysics::FormulaSet::writeTo
bool writeTo(ascostream &) const
MathProperty
Calculated property.
Definition: mathproperty.h:32
PropertyRef::StdType
StdType
Definition: propertyref.h:46
RockPhysics::FormulaSet::save
bool save(Repos::Source) const
mUdf
#define mUdf(type)
Use this macro to get the undefined for simple types.
Definition: undefval.h:274
repos.h
ascistream
OpendTect standard ascii format file reading.
Definition: ascstream.h:83
RockPhysics::Formula::desc_
BufferString desc_
Definition: rockphysics.h:82
RockPhysics::Formula::getProperty
MathProperty * getProperty(const PropertyRef *pr=0) const
Interval< float >
RockPhysics::Formula::VarDef::VarDef
VarDef(const char *nm, PropType t)
Definition: rockphysics.h:72
RockPhysics::Formula::VarDef
Definition: rockphysics.h:70
RockPhysics::Formula::ConstDef::defaultval_
float defaultval_
Definition: rockphysics.h:67
RockPhysics::Formula
Definition: rockphysics.h:37
IOPar
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:55
RockPhysics
Ref Data for a (usually petrophysical) property.
Definition: rockphysics.h:34

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