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

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