00001 #ifndef seissingtrcproc_h
00002 #define seissingtrcproc_h
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #include "executor.h"
00016 #include "cubesampling.h"
00017 class IOObj;
00018 class IOPar;
00019 class Scaler;
00020 class SeisTrc;
00021 class MultiID;
00022 class SeisTrcReader;
00023 class SeisTrcWriter;
00024 class SeisResampler;
00025
00026
00036 mClass SeisSingleTraceProc : public Executor
00037 {
00038 public:
00039
00040 SeisSingleTraceProc(const IOObj* in,const IOObj* out,
00041 const char* nm="Trace processor",
00042 const IOPar* iniopar=0,
00043 const char* msg="Processing");
00044 SeisSingleTraceProc(ObjectSet<IOObj>,const IOObj*,
00045 const char* nm="Trace processor",
00046 ObjectSet<IOPar>* iniopars=0,
00047 const char* msg="Processing");
00048 virtual ~SeisSingleTraceProc();
00049
00050 void setSelectionCB( const CallBack& cb ) { selcb_ = cb; }
00051 void setProcessingCB( const CallBack& cb ) { proccb_ = cb; }
00052 void skipCurTrc() { skipcurtrc_ = true; }
00054
00055 const SeisTrcReader* reader(int idx=0) const { return rdrset_[idx]; }
00056 const SeisTrcWriter* writer() const { return wrr_; }
00057 SeisTrc& getTrace() { return *worktrc_; }
00058
00059 void setTracesPerStep( int n ) { trcsperstep_ = n; }
00061
00062 virtual const char* message() const;
00063 virtual const char* nrDoneText() const;
00064 virtual od_int64 nrDone() const;
00065 virtual od_int64 totalNr() const;
00066 virtual int nextStep();
00067
00068 int nrSkipped() const { return nrskipped_; }
00069 int nrWritten() const { return nrwr_; }
00070 void setTotalNrIfUnknown( int nr )
00071 { if ( totnr_ < 0 ) totnr_ = nr; }
00072 void setScaler(Scaler*);
00074 void setResampler(SeisResampler*);
00075 void skipNullTraces( bool yn=true ) { skipnull_ = yn; }
00076 void fillNullTraces( bool yn=true ) { fillnull_ = yn; }
00077
00078 void setInput(const IOObj*,const IOObj*,const char*,
00079 const IOPar*,const char*);
00080 void setExtTrcToSI( bool yn ) { extendtrctosi_ = yn; }
00081
00082 protected:
00083
00084 ObjectSet<SeisTrcReader> rdrset_;
00085 SeisTrcWriter* wrr_;
00086 SeisTrc& intrc_;
00087 SeisTrc* worktrc_;
00088 SeisResampler* resampler_;
00089 CallBack selcb_;
00090 CallBack proccb_;
00091 BufferString msg_;
00092 BufferString curmsg_;
00093 bool skipcurtrc_;
00094 int nrwr_;
00095 int nrskipped_;
00096 int totnr_;
00097 MultiID& wrrkey_;
00098 int trcsperstep_;
00099 int currentobj_;
00100 int nrobjs_;
00101 Scaler* scaler_;
00102 bool skipnull_;
00103 bool is3d_;
00104 bool fillnull_;
00105 BinID fillbid_;
00106 HorSampling fillhs_;
00107 SeisTrc* filltrc_;
00108 bool extendtrctosi_;
00109
00110 bool mkWriter(const IOObj*);
00111 void nextObj();
00112 bool init(ObjectSet<IOObj>&,ObjectSet<IOPar>&);
00113 virtual void wrapUp();
00114
00115 int getNextTrc();
00116 int getFillTrc();
00117 bool prepareTrc();
00118 bool writeTrc();
00119 void prepareNullFilling();
00120 };
00121
00122
00123 #endif