OpendTect-6_4  6.4
volprocstep.h
Go to the documentation of this file.
1 #ifndef volprocstep_h
2 #define volprocstep_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: K. Tingdahl
9  Date: October 2006
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 
14 -*/
15 
16 #include "volumeprocessingmod.h"
17 #include "factory.h"
18 #include "survgeom.h"
19 #include "trckeysampling.h"
20 #include "uistrings.h"
21 
22 class Task;
23 class VelocityDesc;
24 class ProgressMeter;
25 class TrcKeyZSampling;
27 
28 
29 namespace VolProc
30 {
31 
32 class Chain;
33 
34 
42 mExpClass(VolumeProcessing) Step
43 {
44 public:
45  typedef int ID;
46  typedef int InputSlotID;
47  typedef int OutputSlotID;
48  static ID cUndefID() { return mUdf(int); }
49  static int cUndefSlotID() { return mUdf(int); }
50 
51  mDefineFactoryInClass( Step, factory );
52  virtual ~Step();
53 
54  ID getID() const { return id_; }
55  Chain& getChain();
56  const Chain& getChain() const;
57  virtual const char* userName() const;
58  virtual void setUserName(const char* nm);
59 
60  void resetInput();
61  virtual bool needsInput() const = 0;
62  virtual int getNrInputs() const;
63  virtual InputSlotID getInputSlotID(int idx) const;
64  virtual void getInputSlotName(InputSlotID,
65  BufferString&) const;
66  virtual bool isInputPrevStep() const { return needsInput(); }
67 
68  virtual int getNrOutputs() const { return 1; }
69  virtual OutputSlotID getOutputSlotID(int idx) const;
70  bool validInputSlotID(InputSlotID) const;
71  bool validOutputSlotID(OutputSlotID) const;
72 
73  virtual TrcKeySampling getInputHRg(const TrcKeySampling&) const;
76  virtual StepInterval<int> getInputZRg(const StepInterval<int>&) const;
77  virtual StepInterval<int> getInputZRgWithGeom(const StepInterval<int>&,
78  Survey::Geometry::ID) const;
82  virtual void setInput(InputSlotID,
83  const RegularSeisDataPack*);
84  const RegularSeisDataPack* getInput(InputSlotID) const;
85  virtual void setOutput(OutputSlotID,RegularSeisDataPack*,
86  const TrcKeySampling&,
87  const StepInterval<int>&);
88  const RegularSeisDataPack* getOutput(OutputSlotID) const;
89  RegularSeisDataPack* getOutput(OutputSlotID);
90 
91  int getOutputIdx(OutputSlotID) const;
92  void enableOutput(OutputSlotID);
93 
94  virtual bool canInputAndOutputBeSame() const { return false;}
95  virtual bool needsFullVolume() const { return true; }
96  virtual bool canHandle2D() const { return false; }
97 
98  const RegularSeisDataPack* getOutput() const { return output_; }
99  RegularSeisDataPack* getOutput() { return output_; }
100 
101  virtual const VelocityDesc* getVelDesc() const { return 0; } // old
102 
103  virtual bool areSamplesIndependent() const { return true; }
107  virtual Task* createTask();
108  virtual Task* createTaskWithProgMeter(ProgressMeter*);
109  virtual bool needReportProgress() { return false; }
110 
111  virtual void fillPar(IOPar&) const;
112  virtual bool usePar(const IOPar&);
113 
114  virtual void releaseData();
115  TrcKeyZSampling getInputSampling(const TrcKeyZSampling&) const;
116  /* Given a target sampling, return the ideal sampling for the
117  input datapack(s) */
118 
119  virtual uiString errMsg() const
120  { return uiString::emptyString(); }
121 
122 protected:
123 
124  Step();
125 
126  virtual bool prefersBinIDWise() const { return false;}
127  virtual bool computeBinID(const BinID&,int threadid) { return false;}
128  virtual bool prepareComp(int nrthreads) { return true;}
129 
131 
132  // The memory needed on top of the 'base' memory usage. Can be 0.
133  virtual od_int64 extraMemoryUsage(OutputSlotID,const TrcKeySampling&,
134  const StepInterval<int>&) const
135  { return 0; }
136 
139 
141  ID id_;
143 
145 
146  const StepInterval<float>& getZSampling() const;
147  void setHStep(const BinID&);
148  void setVStep(int);
149  void setInpNrComps(InputSlotID,int);
150  void setOutputNrComps(int);
151 
152  int getNrInputComponents(InputSlotID) const;
153  int getNrOutComponents() const;
154 
155 private:
156 
158 
159  void setChain(Chain&);
160 
161  friend class Chain;
162  friend class ChainExecutor;
163  friend class BinIDWiseTask;
164 
165  static od_uint64 getBaseMemoryUsage(const TrcKeyZSampling&);
166 
167  StepInterval<float> getInputZSamp(const StepInterval<float>&) const;
168 
169 
170  //For 6.2 only (HiddenParam set):
171 public:
172 
173  mDeprecated virtual od_int64 getOuputMemSize(int) const;
174  mDeprecated virtual od_int64 getProcTimeExtraMemory() const { return 0; }
175 
176  mDeprecated static od_int64 getBaseMemoryUsage(const TrcKeySampling&,
177  const StepInterval<int>&);
178 protected:
179  od_uint64 getComponentMemory(const TrcKeySampling&,
180  bool input) const;
181 
182  /*mDeprecated*/ TrcKeySampling tks_;
183  /*mDeprecated*/ StepInterval<int> zrg_;
184 
185 private:
186  od_uint64 extraMemoryUsage(OutputSlotID,
187  const TrcKeyZSampling&) const;
188  od_uint64 getComponentMemory(const TrcKeyZSampling&,
189  bool input) const;
190 
191 };
192 
193 } // namespace VolProc
194 
195 #endif
uiString errmsg_
Definition: volprocstep.h:142
#define mExpClass(module)
Definition: commondefs.h:160
RegularSeisDataPack * output_
Definition: volprocstep.h:157
is an interface where processes can report their progress.
Definition: progressmeter.h:21
virtual uiString errMsg() const
Definition: volprocstep.h:119
Definition: veldesc.h:38
void usePar(const IOPar &iop, ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:188
#define od_int64
Definition: plftypes.h:36
TypeSet< InputSlotID > inputslotids_
Definition: volprocstep.h:138
virtual bool prepareComp(int nrthreads)
Definition: volprocstep.h:128
static const uiString & emptyString()
Definition: uistring.h:109
SeisDataPack for 2D and 3D seismic data.
Definition: seisdatapack.h:28
Definition: uistring.h:89
int InputSlotID
Definition: volprocstep.h:46
static int cUndefSlotID()
Definition: volprocstep.h:49
virtual bool areSamplesIndependent() const
Definition: volprocstep.h:103
virtual mDeprecated od_int64 getProcTimeExtraMemory() const
Definition: volprocstep.h:174
StepInterval< int > zrg_
Definition: volprocstep.h:183
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:47
A chain of Steps that can be applied to a volume of scalars.
Definition: volprocchain.h:29
Horizontal sampling (inline and crossline range and steps).
Definition: trckeysampling.h:27
ObjectSet< const RegularSeisDataPack > inputs_
Definition: volprocstep.h:137
virtual bool computeBinID(const BinID &, int threadid)
Definition: volprocstep.h:127
Adapter for a VolProc chain to external attribute calculation.
Definition: seisdatapackwriter.h:25
#define mUdf(type)
Use this macro to get the undefined for simple types.
Definition: undefval.h:272
Hor+Vert sampling in 3D surveys.
Definition: trckeyzsampling.h:35
int OutputSlotID
Definition: volprocstep.h:47
int ID
Definition: volprocstep.h:45
static ID cUndefID()
Definition: volprocstep.h:48
#define mDefineFactoryInClass(T, funcname)
Definition: factory.h:426
void fillPar(IOPar &iop, const ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:175
virtual int getNrOutputs() const
Definition: volprocstep.h:68
virtual bool isInputPrevStep() const
Definition: volprocstep.h:66
executes the work for a single VolProc::Chain.
Definition: volprocchainexec.h:27
TypeSet< OutputSlotID > outputslotids_
Definition: volprocstep.h:144
#define od_uint64
Definition: plftypes.h:37
An algorithm/calculation/transformation that takes one scalar volume as input, processes it...
Definition: volprocstep.h:42
#define mDeprecated
Definition: plfdefs.h:233
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:40
Positioning in a seismic survey: inline/crossline or lineNr/trcNr.
Definition: binid.h:30
Pos::GeomID ID
Definition: survgeom.h:44
virtual bool needReportProgress()
Definition: volprocstep.h:109
virtual bool prefersBinIDWise() const
Definition: volprocstep.h:126
virtual bool canHandle2D() const
Definition: volprocstep.h:96
virtual const VelocityDesc * getVelDesc() const
Definition: volprocstep.h:101
FixedString Chain()
Definition: keystrs.h:45
TrcKeySampling tks_
Definition: volprocstep.h:182
BufferString username_
Definition: volprocstep.h:140
virtual bool needsFullVolume() const
Definition: volprocstep.h:95
RegularSeisDataPack * getOutput()
Definition: volprocstep.h:99
virtual bool canInputAndOutputBeSame() const
Definition: volprocstep.h:94
Generalization of something (e.g. a computation) that needs to be done in multiple steps...
Definition: task.h:28
const RegularSeisDataPack * getOutput() const
Definition: volprocstep.h:98
virtual od_int64 extraMemoryUsage(OutputSlotID, const TrcKeySampling &, const StepInterval< int > &) const
Definition: volprocstep.h:133
ID getID() const
Definition: volprocstep.h:54
Chain * chain_
Definition: volprocstep.h:130
ID id_
Definition: volprocstep.h:141

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