OpendTect-6_4  6.4
stratlayer.h
Go to the documentation of this file.
1 #ifndef stratlayer_h
2 #define stratlayer_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: Bert
9  Date: Sep 2010
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 
14 -*/
15 
16 #include "stratmod.h"
17 #include "compoundkey.h"
18 #include "stratcontent.h"
19 #include "typeset.h"
20 #include "uistring.h"
21 
22 class PropertyRef;
24 namespace Math { class Formula; }
25 
26 namespace Strat
27 {
28 class LeafUnitRef;
29 class RefTree;
30 class Lithology;
31 class LayerValue;
32 
43 public:
44 
45  typedef CompoundKey ID;
46 
47  Layer(const LeafUnitRef&);
48  Layer(const Layer&);
49  ~Layer();
50  Layer& operator=(const Layer&);
51 
52  BufferString name() const;
53  const LeafUnitRef& unitRef() const { return *ref_; }
54  inline void setRef( const LeafUnitRef& r ) { ref_ = &r; }
55  const RefTree& refTree() const;
56  const Lithology& lithology() const;
57  const Content& content() const;
58 
59  inline float zTop() const { return ztop_; }
60  inline int nrValues() const { return vals_.size(); }
61  float thickness() const;
62  float value(int) const;
63  bool isMath(int) const;
64  const LayerValue* getLayerValue(int) const;
65  void getValues(TypeSet<float>&) const;
66  inline float zBot() const { return ztop_ + thickness(); }
67  inline float depth() const { return ztop_ + 0.5f * thickness(); }
68 
69  inline void setZTop( float v ) { ztop_ = v; }
70  void setThickness(float v);
71  void setValue(int,float);
72  void setValue(int,const Math::Formula&,
73  const PropertyRefSelection&,float xpos=0.5f);
74  void setValue(int,const IOPar&,const PropertyRefSelection&);
75  void setValue(int,LayerValue*);
76  void setContent( const Content& c ) { content_ = &c; }
77  void setXPos(float); // only affects Math lay vals
78 
79  ID id() const;
80  Color dispColor(bool lith_else_upnode) const;
81 
82  static const PropertyRef& thicknessRef();
83 
84 protected:
85 
86  const LeafUnitRef* ref_;
87  float ztop_;
89  const Content* content_;
90 
91  void setLV(int,LayerValue*);
92 };
93 
94 
96 { mODTextTranslationClass(LayerValue);
97 public:
98 
99  virtual LayerValue* clone(const Layer* l=0) const = 0;
100  virtual ~LayerValue() {}
101  virtual bool isSimple() const { return false; }
102  virtual float value() const = 0;
103 
104  BufferString dumpStr() const;
105  virtual void setXPos(float) {}
106 
107 };
108 
109 
112 public:
113  SimpleLayerValue( float val )
114  : val_ (val) {}
115  SimpleLayerValue* clone(const Layer* l=0) const
116  { return new SimpleLayerValue(val_); }
117 
118  virtual bool isSimple() const { return true; }
119  virtual float value() const { return val_; }
120  void setValue( float val ) { val_ = val; }
121 
122 protected:
123 
124  float val_;
125 
126 };
127 
128 
134 public:
135 
137  const Strat::Layer&,
138  const PropertyRefSelection&,
139  float xpos);
140  FormulaLayerValue(const IOPar&,const Strat::Layer&,
141  const PropertyRefSelection&);
143  FormulaLayerValue* clone(const Layer*) const;
144 
145  bool isBad() const { return !errmsg_.isEmpty(); }
146  uiString errMsg() const { return errmsg_; }
147  void fillPar(IOPar&) const;
148  virtual void setXPos(float);
149 
150  virtual float value() const;
151 
152 protected:
153 
155  const Strat::Layer&,float,bool c=false);
156 
158  const Layer& lay_;
159  const bool myform_;
160  float xpos_;
161 
164  mutable uiString errmsg_;
165 
166  void useForm(const PropertyRefSelection&);
167 
168 };
169 
170 
171 }; // namespace Strat
172 
173 #endif
returns a layer value based on Math::Formula. It does not copy the Formula, so keep the formula alive...
Definition: stratlayer.h:132
#define mExpClass(module)
Definition: commondefs.h:160
Definition: propertyref.h:176
#define mODTextTranslationClass(clss)
Definition: uistring.h:38
uiString errmsg_
Definition: stratlayer.h:164
ObjectSet< LayerValue > vals_
Definition: stratlayer.h:88
const Content * content_
Definition: stratlayer.h:89
Ref Data for a (usually petrophysical) property.
Definition: propertyref.h:42
data for a layer.
Definition: stratlayer.h:41
const Math::Formula & form_
Definition: stratlayer.h:157
const bool myform_
Definition: stratlayer.h:159
const LeafUnitRef * ref_
Definition: stratlayer.h:86
uiString errMsg() const
Definition: stratlayer.h:146
Definition: uistring.h:89
void setZTop(float v)
Definition: stratlayer.h:69
const LeafUnitRef & unitRef() const
Definition: stratlayer.h:53
void setRef(const LeafUnitRef &r)
Definition: stratlayer.h:54
float zBot() const
Definition: stratlayer.h:66
Set of pointers to objects.
Definition: commontypes.h:32
virtual bool isSimple() const
Definition: stratlayer.h:118
virtual void setXPos(float)
Definition: stratlayer.h:105
TypeSet< int > inpidxs_
Definition: stratlayer.h:162
float xpos_
Definition: stratlayer.h:160
SimpleLayerValue(float val)
Definition: stratlayer.h:113
Math formula: (expression, inputs, units, calculation, storage).
Definition: mathformula.h:65
Definition: stratlayer.h:110
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:47
a name and an ID.
Definition: stratlith.h:37
Definition: stratlayer.h:95
UnitRef for layers.
Definition: stratunitref.h:236
int nrValues() const
Definition: stratlayer.h:60
TypeSet< float > inpvals_
Definition: stratlayer.h:163
void fillPar(IOPar &iop, const ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:175
virtual float value() const
Definition: stratlayer.h:119
SimpleLayerValue * clone(const Layer *l=0) const
Definition: stratlayer.h:115
Stratigraphy.
Definition: stratlevel.h:26
float zTop() const
Definition: stratlayer.h:59
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:40
bool isEmpty() const
Definition: odstring.h:51
Tree of UnitRef&#39;s.
Definition: stratreftree.h:29
BufferString errmsg_
Definition: horizontracker.h:119
float val_
Definition: stratlayer.h:124
Concatenated short keys separated by dots. Used for Object identifiers in the Object Manager...
Definition: compoundkey.h:23
Definition: math2.h:29
stuff that can be inside porous layers
Definition: stratcontent.h:29
Color is an RGB color object, with a transparancy. The storage is in a 4-byte integer, similar to Qt.
Definition: color.h:26
const Layer & lay_
Definition: stratlayer.h:158
void setValue(float val)
Definition: stratlayer.h:120
virtual bool isSimple() const
Definition: stratlayer.h:101
void setContent(const Content &c)
Definition: stratlayer.h:76
bool isBad() const
Definition: stratlayer.h:145
CompoundKey ID
Definition: stratlayer.h:45
float depth() const
Definition: stratlayer.h:67
float ztop_
Definition: stratlayer.h:87
virtual ~LayerValue()
Definition: stratlayer.h:100

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