OpendTect  6.3
stratlaygen.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: June 2011
9 ________________________________________________________________________
10 
11 
12 -*/
13 
14 #include "stratmod.h"
15 #include "property.h"
16 
17 
18 namespace Strat
19 {
20 class RefTree;
21 class LayerSequence;
22 class LayerSequenceGenDesc;
23 
34 {
35 public:
36 
37  virtual ~LayerGenerator() {}
38 
39  virtual LayerGenerator* clone() const
40  { return canBeCloned() ? createClone() : 0; }
41  virtual bool canBeCloned() const = 0;
42  virtual const char* name() const = 0;
43  virtual float dispThickness(bool max=false) const = 0;
44 
45  virtual bool usePar(const IOPar&,const RefTree&);
46  virtual void fillPar(IOPar&) const;
47 
48  static LayerGenerator* get(const IOPar&,const RefTree&);
49  mDefineFactoryInClass(LayerGenerator,factory);
50 
51  bool generateMaterial(LayerSequence&,
53 
54  virtual bool reset() const { return true; }
55  virtual uiString errMsg() const { return uiString::emptyString(); }
56  virtual void syncProps(const PropertyRefSelection&) = 0;
57  virtual void updateUsedProps(PropertyRefSelection&) const = 0;
58 
59  void setGenDesc( LayerSequenceGenDesc* gd ) { gendesc_=gd; }
60 
61 protected:
62 
63  virtual LayerGenerator* createClone() const { return 0; }
64  virtual bool genMaterial(LayerSequence&,Property::EvalOpts) const
65  = 0;
66  virtual bool postProcess(LayerSequence&,float pos) const
67  { return true; }
68 
70  friend class LayerSequenceGenDesc;
71 
72 };
73 
74 
75 #define mDefLayerGeneratorFns(clss,typstr) \
76 protected: \
77  virtual bool genMaterial(Strat::LayerSequence&, \
78  Property::EvalOpts eo=Property::EvalOpts()) const; \
79 public: \
80  static const char* typeStr() { return typstr; } \
81  virtual const char* factoryKeyword() const { return typeStr(); } \
82  static Strat::LayerGenerator* create() { return new clss; } \
83  static void initClass() { factory().addCreator(create,typeStr());} \
84  virtual const char* name() const; \
85  virtual float dispThickness(bool max=true) const; \
86  virtual bool usePar(const IOPar&,const Strat::RefTree&); \
87  virtual void fillPar(IOPar&) const; \
88  virtual void syncProps(const PropertyRefSelection&); \
89  virtual void updateUsedProps(PropertyRefSelection&) const
90 
91 
92 
93 }; // namespace Strat
#define mExpClass(module)
Definition: commondefs.h:157
virtual uiString errMsg() const
Definition: stratlaygen.h:55
Definition: propertyref.h:174
A sequence of layers.
Definition: stratlayersequence.h:34
Collection of LayerGenerator's that can generate a full LayerSequence.
Definition: stratlayseqgendesc.h:37
void usePar(const IOPar &iop, ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:200
static const uiString & emptyString()
Definition: uistring.h:107
Definition: uistring.h:88
virtual LayerGenerator * clone() const
Definition: stratlaygen.h:39
virtual bool reset() const
Definition: stratlaygen.h:54
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:53
const LayerSequenceGenDesc * gendesc_
set before generation
Definition: stratlaygen.h:69
#define mDefineFactoryInClass(T, funcname)
Definition: factory.h:424
void fillPar(IOPar &iop, const ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:187
Stratigraphy.
Definition: stratlevel.h:25
Tree of UnitRef&#39;s.
Definition: stratreftree.h:27
virtual ~LayerGenerator()
Definition: stratlaygen.h:37
Description that can generate layers and add these to a sequence.
Definition: stratlaygen.h:33
void setGenDesc(LayerSequenceGenDesc *gd)
Definition: stratlaygen.h:59
virtual bool postProcess(LayerSequence &, float pos) const
Definition: stratlaygen.h:66
Definition: property.h:63
virtual LayerGenerator * createClone() const
Definition: stratlaygen.h:63

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