OpendTect-6_4  6.4
prestackprocessor.h
Go to the documentation of this file.
1 #ifndef prestackprocessor_h
2 #define prestackprocessor_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: K. Tingdahl
9  Date: April 2005
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 
14 -*/
15 
16 #include "prestackprocessingmod.h"
17 #include "bufstringset.h"
18 #include "datapack.h"
19 #include "factory.h"
20 #include "keystrs.h"
21 #include "paralleltask.h"
22 #include "position.h"
23 #include "sets.h"
24 #include "trckeysampling.h"
25 
26 namespace PreStack
27 {
28 
29 class Gather;
30 
36 mExpClass(PreStackProcessing) Processor : public ParallelTask
37 {
38 public:
39  mDefineFactoryInClass( Processor, factory );
40 
41  virtual bool reset(bool force=true);
42 
43  virtual const BinID& getInputStepout() const;
44  virtual bool wantsInput(const BinID& relbid) const;
45  void setInput(const BinID& relbid,DataPack::ID);
46 
47  const BinID& getOutputStepout() const;
48  virtual bool setOutputInterest(const BinID& relbid,bool);
49  bool getOutputInterest(const BinID& relbid) const;
50  DataPack::ID getOutput(const BinID& relbid) const;
51 
52  virtual bool prepareWork();
53  virtual uiString errMsg() const
54  { return uiString::emptyString(); }
55 
56  virtual void fillPar(IOPar&) const = 0;
57  virtual bool usePar(const IOPar&) = 0;
58  virtual bool doWork(od_int64 start,od_int64 stop,int)= 0;
63  int nrOffsets() const;
64  virtual od_int64 nrIterations() const { return nrOffsets(); }
73  virtual ~Processor();
74  virtual bool usesPreStackInput() const { return true; }
75  virtual void adjustPossibleCompArea(TrcKeySampling&){return;}
76  virtual void retainCurBID( const BinID& ) {};
77  virtual bool mustHaveUserInput() { return true; }
78 
79 protected:
80  Processor( const char* nm );
81  virtual Gather* createOutputArray(const Gather& input) const;
82  static int getRelBidOffset(const BinID& relbid,
83  const BinID& stepout);
84  static void freeArray(ObjectSet<Gather>&);
85 
89 
91 };
92 
93 
140 mExpClass(PreStackProcessing) ProcessManager : public CallBacker
142 public:
143  ProcessManager();
144  ~ProcessManager();
145 
146  //Setup
147  int nrProcessors() const;
148  Processor* getProcessor(int);
149  const Processor* getProcessor(int) const;
150  bool needsPreStackInput() const;
151 
152 
153  void addProcessor(Processor*);
154  void removeProcessor(int);
155  void swapProcessors(int,int);
156  int indexOf(const Processor*) const;
157 
158  void removeAllProcessors();
159 
160  void notifyChange() { setupChange.trigger(); }
162 
163  //Runtime
164  bool reset(bool force=true);
166  bool prepareWork();
167  BinID getInputStepout() const;
169  virtual bool wantsInput(const BinID& relbid) const;
171  void setInput(const BinID& relbid,DataPack::ID);
172 
173  bool process();
174 
175  DataPack::ID getOutput() const;
176 
177  void fillPar(IOPar&) const;
178  bool usePar(const IOPar&);
179 
180  uiString errMsg() const { return errmsg_; }
181 
182  //Keys for od_process_prestack
183  static const char* sKeyLineKey() { return sKey::LineKey(); }
184  static const char* sKeySetup(){ return "Processing Setup"; }
185  static const char* sKeyCDPRange(){ return "CDP Range"; }
186  static const char* sKeyInputData() { return "Input"; }
187  static const char* sKeyOutputData(){ return "Output"; }
188 
189 
190 protected:
191 
192  static const char* sKeyNrProcessors() { return "Nr processors"; }
193 
196 };
197 
198 
199 #define mPSProcAddStepoutStep( array, arrtype, oldstepout, newstepout ) \
200 { \
201  arrtype arrcopy( array ); \
202  array.erase(); \
203 \
204  for ( int idx=-newstepout.inl(); idx<=newstepout.inl(); idx++ ) \
205  { \
206  for ( int idy=-newstepout.crl(); idy<=newstepout.crl(); idy++ ) \
207  { \
208  const BinID curpos( idx, idy ); \
209 \
210  if ( idy<-oldstepout.crl() || idy>oldstepout.crl() || \
211  idx<-oldstepout.inl() || idx>oldstepout.inl() ) \
212  { \
213  array += 0; \
214  } \
215  else \
216  { \
217  const int oldoffset=getRelBidOffset(curpos,oldstepout);\
218  array += arrcopy[oldoffset]; \
219  } \
220  } \
221  } \
222 }
223 
224 } // namespace PreStack
225 
226 #endif
#define mExpClass(module)
Definition: commondefs.h:160
To be able to send and/or receive CallBacks, inherit from this class.
Definition: callback.h:272
#define mODTextTranslationClass(clss)
Definition: uistring.h:38
PreStack gather.
Definition: prestackgather.h:36
Processes PreStack data at one cdp location. The algorithm is implemented in subclasses, and can be created by the PreStack::PF() factory.
Definition: prestackprocessor.h:36
void usePar(const IOPar &iop, ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:188
#define od_int64
Definition: plftypes.h:36
Notifier< ProcessManager > setupChange
Definition: prestackprocessor.h:161
Definition: synthseis.h:36
virtual od_int64 nrIterations() const
Definition: prestackprocessor.h:64
virtual uiString errMsg() const
Definition: prestackprocessor.h:53
static const uiString & emptyString()
Definition: uistring.h:109
ObjectSet< Gather > inputs_
Definition: prestackprocessor.h:90
Definition: uistring.h:89
ObjectSet< T >::size_type indexOf(const ObjectSet< T > &os, const S &val)
Locate object in set.
Definition: objectset.h:169
static const char * sKeyInputData()
Definition: prestackprocessor.h:186
int ID
Definition: datapack.h:38
Generalization of a task that can be run in parallel.
Definition: paralleltask.h:66
virtual bool usesPreStackInput() const
Definition: prestackprocessor.h:74
Definition: callback.h:254
Set of pointers to objects.
Definition: commontypes.h:32
virtual void adjustPossibleCompArea(TrcKeySampling &)
Definition: prestackprocessor.h:75
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:47
Horizontal sampling (inline and crossline range and steps).
Definition: trckeysampling.h:27
BoolTypeSet outputinterest_
Definition: prestackprocessor.h:88
static const char * sKeyNrProcessors()
Definition: prestackprocessor.h:192
uiString errmsg_
Definition: prestackprocessor.h:195
static const char * sKeySetup()
Definition: prestackprocessor.h:184
static const char * sKeyLineKey()
Definition: prestackprocessor.h:183
uiString errMsg() const
Definition: prestackprocessor.h:180
virtual bool mustHaveUserInput()
Definition: prestackprocessor.h:77
virtual void retainCurBID(const BinID &)
Definition: prestackprocessor.h:76
#define mDefineFactoryInClass(T, funcname)
Definition: factory.h:426
void fillPar(IOPar &iop, const ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:175
ObjectSet< Gather > outputs_
Definition: prestackprocessor.h:87
ObjectSet< Processor > processors_
Definition: prestackprocessor.h:194
Positioning in a seismic survey: inline/crossline or lineNr/trcNr.
Definition: binid.h:30
BufferString errmsg_
Definition: horizontracker.h:119
void notifyChange()
Definition: prestackprocessor.h:160
static const char * sKeyCDPRange()
Definition: prestackprocessor.h:185
Orgainizes a number of PreStack::Processors into a chain which can be processed.
Definition: prestackprocessor.h:140
BinID outputstepout_
Definition: prestackprocessor.h:86
FixedString LineKey()
Definition: keystrs.h:82
static const char * sKeyOutputData()
Definition: prestackprocessor.h:187

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