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

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