OpendTect  6.3
prestackprocessor.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: K. Tingdahl
8  Date: April 2005
9 ________________________________________________________________________
10 
11 
12 -*/
13 
14 #include "prestackprocessingmod.h"
15 #include "bufstringset.h"
16 #include "datapack.h"
17 #include "factory.h"
18 #include "keystrs.h"
19 #include "paralleltask.h"
20 #include "position.h"
21 #include "sets.h"
22 #include "trckeysampling.h"
23 
24 class Gather;
25 
26 namespace PreStack
27 {
28 
34 mExpClass(PreStackProcessing) Processor : public ParallelTask
35 {
36 public:
37  mDefineFactoryInClass( Processor, factory );
38 
39  virtual bool reset(bool force=true);
40 
41  virtual const BinID& getInputStepout() const;
42  virtual bool wantsInput(const BinID& relbid) const;
43  void setInput(const BinID& relbid,DataPack::ID);
44 
45  const BinID& getOutputStepout() const;
46  virtual bool setOutputInterest(const BinID& relbid,bool);
47  bool getOutputInterest(const BinID& relbid) const;
48  DataPack::ID getOutput(const BinID& relbid) const;
49 
50  virtual bool prepareWork();
51  virtual uiString errMsg() const
52  { return uiString::emptyString(); }
53 
54  virtual void fillPar(IOPar&) const = 0;
55  virtual bool usePar(const IOPar&) = 0;
56  virtual bool doWork(od_int64 start,od_int64 stop,int)= 0;
61  int nrOffsets() const;
62  virtual od_int64 nrIterations() const { return nrOffsets(); }
71  virtual ~Processor();
72  virtual bool usesPreStackInput() const { return true; }
73  virtual void adjustPossibleCompArea(TrcKeySampling&){return;}
74  virtual void retainCurBID( const BinID& ) {};
75 
76 protected:
77  Processor( const char* nm );
78  virtual Gather* createOutputArray(const Gather& input) const;
79  static int getRelBidOffset(const BinID& relbid,
80  const BinID& stepout);
81 
85 
87 };
88 
89 
136 mExpClass(PreStackProcessing) ProcessManager : public CallBacker
138 public:
139  ProcessManager();
140  ~ProcessManager();
141 
142  //Setup
143  int nrProcessors() const;
144  Processor* getProcessor(int);
145  const Processor* getProcessor(int) const;
146  bool needsPreStackInput() const;
147 
148 
149  void addProcessor(Processor*);
150  void removeProcessor(int);
151  void swapProcessors(int,int);
152  int indexOf(const Processor*) const;
153 
154  void removeAllProcessors();
155 
156  void notifyChange() { setupChange.trigger(); }
158 
159  //Runtime
160  bool reset(bool force=true);
162  bool prepareWork();
163  BinID getInputStepout() const;
165  virtual bool wantsInput(const BinID& relbid) const;
167  void setInput(const BinID& relbid,DataPack::ID);
168 
169  bool process();
170 
171  DataPack::ID getOutput() const;
172 
173  void fillPar(IOPar&) const;
174  bool usePar(const IOPar&);
175 
176  uiString errMsg() const { return errmsg_; }
177 
178  //Keys for od_process_prestack
179  static const char* sKeySetup(){ return "Processing Setup"; }
180  static const char* sKeyCDPRange(){ return "CDP Range"; }
181  static const char* sKeyInputData() { return "Input"; }
182  static const char* sKeyOutputData(){ return "Output"; }
183 
184 
185 protected:
186 
187  static const char* sKeyNrProcessors() { return "Nr processors"; }
188 
191 };
192 
193 
194 #define mPSProcAddStepoutStep( array, arrtype, oldstepout, newstepout ) \
195 { \
196  arrtype arrcopy( array ); \
197  array.erase(); \
198 \
199  for ( int idx=-newstepout.inl(); idx<=newstepout.inl(); idx++ ) \
200  { \
201  for ( int idy=-newstepout.crl(); idy<=newstepout.crl(); idy++ ) \
202  { \
203  const BinID curpos( idx, idy ); \
204 \
205  if ( idy<-oldstepout.crl() || idy>oldstepout.crl() || \
206  idx<-oldstepout.inl() || idx>oldstepout.inl() ) \
207  { \
208  array += 0; \
209  } \
210  else \
211  { \
212  const int oldoffset=getRelBidOffset(curpos,oldstepout);\
213  array += arrcopy[oldoffset]; \
214  } \
215  } \
216  } \
217 }
218 
219 } // namespace PreStack
#define mExpClass(module)
Definition: commondefs.h:157
Inherit from this class to be able to send and/or receive CallBacks.
Definition: callback.h:182
#define mODTextTranslationClass(clss)
Definition: uistring.h:37
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:34
PreStack gather.
Definition: prestackgather.h:28
void usePar(const IOPar &iop, ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:200
#define od_int64
Definition: plftypes.h:34
Notifier< ProcessManager > setupChange
Definition: prestackprocessor.h:157
Definition: prestackagc.h:18
virtual od_int64 nrIterations() const
Definition: prestackprocessor.h:62
virtual uiString errMsg() const
Definition: prestackprocessor.h:51
static const uiString & emptyString()
Definition: uistring.h:107
ObjectSet< Gather > inputs_
Definition: prestackprocessor.h:86
Definition: uistring.h:88
ObjectSet< T >::size_type indexOf(const ObjectSet< T > &os, const S &val)
Locate object in set.
Definition: objectset.h:173
static const char * sKeyInputData()
Definition: prestackprocessor.h:181
Generalization of a task that can be run in parallel.
Definition: paralleltask.h:64
virtual bool usesPreStackInput() const
Definition: prestackprocessor.h:72
Class to help setup a callback handling.
Definition: notify.h:121
virtual void adjustPossibleCompArea(TrcKeySampling &)
Definition: prestackprocessor.h:73
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:53
Horizontal sampling (inline and crossline range and steps).
Definition: trckeysampling.h:25
BoolTypeSet outputinterest_
Definition: prestackprocessor.h:84
static const char * sKeyNrProcessors()
Definition: prestackprocessor.h:187
uiString errmsg_
Definition: prestackprocessor.h:190
static const char * sKeySetup()
Definition: prestackprocessor.h:179
uiString errMsg() const
Definition: prestackprocessor.h:176
virtual void retainCurBID(const BinID &)
Definition: prestackprocessor.h:74
#define mDefineFactoryInClass(T, funcname)
Definition: factory.h:424
void fillPar(IOPar &iop, const ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:187
ObjectSet< Gather > outputs_
Definition: prestackprocessor.h:83
ObjectSet< Processor > processors_
Definition: prestackprocessor.h:189
Positioning in a seismic survey: inline/crossline or lineNr/trcNr.
Definition: binid.h:28
BufferString errmsg_
Definition: horizontracker.h:117
void notifyChange()
Definition: prestackprocessor.h:156
static const char * sKeyCDPRange()
Definition: prestackprocessor.h:180
Definition: groupedid.h:41
Orgainizes a number of PreStack::Processors into a chain which can be processed.
Definition: prestackprocessor.h:136
BinID outputstepout_
Definition: prestackprocessor.h:82
static const char * sKeyOutputData()
Definition: prestackprocessor.h:182

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