OpendTect-6_4  6.4
elasticprop.h
Go to the documentation of this file.
1 #ifndef elasticprop_h
2 #define elasticprop_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: Bruno
9  Date: July 2011
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 -*/
14 
15 #include "generalmod.h"
16 #include "enums.h"
17 #include "bufstringset.h"
18 #include "repos.h"
19 #include "propertyref.h"
20 
26 {
27 public:
28 
29  enum Type { Den, PVel, SVel };
31 
32  ElasticFormula(const char* nm,const char* expr,Type tp)
33  : NamedObject( nm )
34  , expression_(expr ? expr : "")
35  , type_(tp) {}
36 
38  { *this = fm; }
39 
40  ElasticFormula& operator =(const ElasticFormula&);
41  inline bool operator ==( const ElasticFormula& pr ) const
42  { return name() == pr.name(); }
43  inline bool operator !=( const ElasticFormula& pr ) const
44  { return name() != pr.name(); }
45 
46  void setExpression( const char* expr) { expression_ = expr; }
47  const char* expression() const { return expression_.str();}
48 
49  inline Type type() const { return type_; }
50  inline bool hasType( Type t ) const { return type_ == t;}
51 
52  BufferStringSet& variables() { return variables_; }
53  const BufferStringSet& variables() const { return variables_; }
54  BufferStringSet& units() { return units_; }
55  const BufferStringSet& units() const { return units_; }
56  const char* parseVariable(int idx,float&) const;
57 
58  void fillPar(IOPar&) const;
59  void usePar(const IOPar&);
60 
61 protected:
62 
66 
68 };
69 
70 
76 {
77 public:
78 
79  void addFormula(const ElasticFormula&);
80  void addFormula(const char* nm, const char* expr,
82  const BufferStringSet& vars);
83 
84  void getByType(ElasticFormula::Type,
86 
87  void clear() { formulas_.erase(); }
88 
89  bool write(Repos::Source) const;
90 
91 protected:
92 
94 
95  void addRockPhysicsFormulas();
96  void addPreDefinedFormulas();
97 
98  mGlobal(General) friend ElasticFormulaRepository& ElFR();
99 };
100 
101 mGlobal(General) ElasticFormulaRepository& ElFR();
102 
103 
109 {
110 public:
111  ElasticPropertyRef(const char* nm,
112  const ElasticFormula& f)
113  : PropertyRef(nm)
114  , formula_(f)
115  { stdtype_ = elasticToStdType(formula_.type()); }
116 
117 
118  static PropertyRef::StdType elasticToStdType(ElasticFormula::Type);
119 
120  ElasticFormula& formula() { return formula_; }
121  const ElasticFormula& formula() const { return formula_; }
122 
123  ElasticFormula::Type elasticType() { return formula_.type(); }
124  ElasticFormula::Type elasticType() const { return formula_.type(); }
125 
126 protected:
127 
129 
130 };
131 
132 
133 #endif
#define mExpClass(module)
Definition: commondefs.h:160
BufferStringSet & variables()
Definition: elasticprop.h:52
ElasticFormula repository.
Definition: elasticprop.h:75
void setExpression(const char *expr)
Definition: elasticprop.h:46
ElasticPropertyRef(const char *nm, const ElasticFormula &f)
Definition: elasticprop.h:111
bool operator==(const ArrayNDInfo &a1, const ArrayNDInfo &a2)
Definition: arrayndinfo.h:53
Elastic formula def to generate elastic layers.
Definition: elasticprop.h:25
#define mGlobal(module)
Definition: commondefs.h:163
Type type_
Definition: elasticprop.h:67
void usePar(const IOPar &iop, ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:188
const BufferStringSet & units() const
Definition: elasticprop.h:55
Type
Definition: elasticprop.h:29
Ref Data for a (usually petrophysical) property.
Definition: propertyref.h:42
ElasticFormula & formula()
Definition: elasticprop.h:120
const BufferStringSet & variables() const
Definition: elasticprop.h:53
ElasticFormulaRepository & ElFR()
ElasticFormula formula_
Definition: elasticprop.h:128
Set of BufferString objects.
Definition: bufstringset.h:28
Type type() const
Definition: elasticprop.h:49
#define mDeclareEnumUtils(enm)
Some utilities surrounding the often needed enum <-> string table.
Definition: enums.h:258
BufferStringSet & units()
Definition: elasticprop.h:54
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:47
BufferString expression_
Definition: elasticprop.h:63
Source
Definition: repos.h:25
TypeSet< ElasticFormula > formulas_
Definition: elasticprop.h:93
bool operator!=(const ArrayNDInfo &a1, const ArrayNDInfo &a2)
Definition: arrayndinfo.h:62
void fillPar(IOPar &iop, const ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:175
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:40
void clear()
Definition: elasticprop.h:87
Object with a name.
Definition: namedobj.h:35
ElasticFormula::Type elasticType() const
Definition: elasticprop.h:124
const ElasticFormula & formula() const
Definition: elasticprop.h:121
StdType
Definition: propertyref.h:46
BufferStringSet variables_
Definition: elasticprop.h:64
ElasticFormula::Type elasticType()
Definition: elasticprop.h:123
BufferStringSet units_
Definition: elasticprop.h:65
Elastic property reference data.
Definition: elasticprop.h:108
virtual const OD::String & name() const
Definition: namedobj.h:47
const char * expression() const
Definition: elasticprop.h:47
bool hasType(Type t) const
Definition: elasticprop.h:50
ElasticFormula(const ElasticFormula &fm)
Definition: elasticprop.h:37

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