OpendTect-6_4  6.4
stratlaygen.h
Go to the documentation of this file.
1 #ifndef stratlaygen_h
2 #define stratlaygen_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: Bert
9  Date: June 2011
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 
14 -*/
15 
16 #include "stratmod.h"
17 #include "property.h"
18 
19 
20 namespace Strat
21 {
22 class RefTree;
23 class LayerSequence;
24 class LayerSequenceGenDesc;
25 
36 {
37 public:
38 
39  virtual ~LayerGenerator() {}
40 
41  virtual LayerGenerator* clone() const
42  { return canBeCloned() ? createClone() : 0; }
43  virtual bool canBeCloned() const = 0;
44  virtual const char* name() const = 0;
45  virtual float dispThickness(bool max=false) const = 0;
46 
47  virtual bool usePar(const IOPar&,const RefTree&);
48  virtual void fillPar(IOPar&) const;
49 
50  static LayerGenerator* get(const IOPar&,const RefTree&);
51  mDefineFactoryInClass(LayerGenerator,factory);
52 
53  bool generateMaterial(LayerSequence&,
55 
56  virtual bool reset() const { return true; }
57  virtual uiString errMsg() const { return uiString::emptyString(); }
58  virtual void syncProps(const PropertyRefSelection&) = 0;
59  virtual void updateUsedProps(PropertyRefSelection&) const = 0;
60 
61  void setGenDesc( LayerSequenceGenDesc* gd ) { gendesc_=gd; }
62 
63 protected:
64 
65  virtual LayerGenerator* createClone() const { return 0; }
66  virtual bool genMaterial(LayerSequence&,Property::EvalOpts) const
67  = 0;
68  virtual bool postProcess(LayerSequence&,float pos) const
69  { return true; }
70 
72  friend class LayerSequenceGenDesc;
73 
74 };
75 
76 
77 #define mDefLayerGeneratorFns(clss,typstr) \
78 protected: \
79  virtual bool genMaterial(Strat::LayerSequence&, \
80  Property::EvalOpts eo=Property::EvalOpts()) const; \
81 public: \
82  static const char* typeStr() { return typstr; } \
83  virtual const char* factoryKeyword() const { return typeStr(); } \
84  static Strat::LayerGenerator* create() { return new clss; } \
85  static void initClass() { factory().addCreator(create,typeStr());} \
86  virtual const char* name() const; \
87  virtual float dispThickness(bool max=true) const; \
88  virtual bool usePar(const IOPar&,const Strat::RefTree&); \
89  virtual void fillPar(IOPar&) const; \
90  virtual void syncProps(const PropertyRefSelection&); \
91  virtual void updateUsedProps(PropertyRefSelection&) const
92 
93 
94 
95 }; // namespace Strat
96 
97 #endif
#define mExpClass(module)
Definition: commondefs.h:160
virtual uiString errMsg() const
Definition: stratlaygen.h:57
Definition: propertyref.h:176
A sequence of layers.
Definition: stratlayersequence.h:36
Collection of LayerGenerator's that can generate a full LayerSequence.
Definition: stratlayseqgendesc.h:39
void usePar(const IOPar &iop, ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:188
static const uiString & emptyString()
Definition: uistring.h:109
Definition: uistring.h:89
virtual LayerGenerator * clone() const
Definition: stratlaygen.h:41
virtual bool reset() const
Definition: stratlaygen.h:56
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:47
const LayerSequenceGenDesc * gendesc_
set before generation
Definition: stratlaygen.h:71
#define mDefineFactoryInClass(T, funcname)
Definition: factory.h:426
void fillPar(IOPar &iop, const ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:175
Stratigraphy.
Definition: stratlevel.h:26
Tree of UnitRef&#39;s.
Definition: stratreftree.h:29
virtual ~LayerGenerator()
Definition: stratlaygen.h:39
Description that can generate layers and add these to a sequence.
Definition: stratlaygen.h:35
void setGenDesc(LayerSequenceGenDesc *gd)
Definition: stratlaygen.h:61
virtual bool postProcess(LayerSequence &, float pos) const
Definition: stratlaygen.h:68
Definition: property.h:65
virtual LayerGenerator * createClone() const
Definition: stratlaygen.h:65

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