OpendTect-6_4  6.4
seiscubeprov.h
Go to the documentation of this file.
1 #ifndef seismscprov_h
2 #define seismscprov_h
3 
4 /*
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: A.H. Bril
9  Date: Jan 2007
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 */
14 
15 
16 #include "seismod.h"
17 #include "arraynd.h"
18 #include "trckeyzsampling.h"
19 #include "rowcol.h"
20 #include "objectset.h"
21 #include "uistring.h"
22 
23 template <class T> class Array2D;
24 class IOObj;
25 class LineKey;
26 class SeisTrc;
27 class SeisTrcBuf;
28 class SeisTrcReader;
29 namespace Seis { class SelData; }
30 class TaskRunner;
31 
32 
57 { mODTextTranslationClass(SeisMSCProvider);
58 public:
59 
60  SeisMSCProvider(const MultiID&);
62  SeisMSCProvider(const IOObj&);
64  SeisMSCProvider(const char* fnm);
66  virtual ~SeisMSCProvider();
67 
68  bool is2D() const;
69  bool prepareWork();
71 
72  // use the following after prepareWork
73  // but before the first next()
74  void forceFloatData( bool yn )
75  { intofloats_ = yn; }
76  void setStepout(int,int,bool required);
77  void setStepout(Array2D<bool>* mask);
79  void setStepoutStep( int i, int c )
80  { stepoutstep_.row() = i; stepoutstep_.col() = c; }
81  int inlStepout( bool req ) const
82  { return req ? reqstepout_.row() : desstepout_.row(); }
83  int crlStepout( bool req ) const
84  { return req ? reqstepout_.col() : desstepout_.col(); }
85  void setSelData(Seis::SelData*);
87 
88  enum AdvanceState { NewPosition, Buffering, EndReached, Error };
89  AdvanceState advance();
90  uiString errMsg() const { return errmsg_; }
91 
92  BinID getPos() const;
93  int getTrcNr() const;
94  SeisTrc* get(int deltainl,int deltacrl);
95  SeisTrc* get(const BinID&);
96  const SeisTrc* get( int i, int c ) const
97  { return const_cast<SeisMSCProvider*>(this)->get(i,c); }
98  const SeisTrc* get( const BinID& bid ) const
99  { return const_cast<SeisMSCProvider*>(this)->get(bid); }
100 
101  int comparePos(const SeisMSCProvider&) const;
103  int estimatedNrTraces() const;
104 
105  SeisTrcReader& reader() { return rdr_; }
106  const SeisTrcReader& reader() const { return rdr_; }
107 
108 protected:
109 
118  enum ReadState { NeedStart, ReadOK, ReadAtEnd, ReadErr };
120 
122  mutable int estnrtrcs_;
123 
124  // Indexes of new pos ready, equals -1 while buffering.
125  int bufidx_;
126  int trcidx_;
127  // Indexes of next position to be examined.
130 
131  void init();
132  bool startWork();
133  int readTrace(SeisTrc&);
134  bool isReqBoxFilled() const;
135  bool doAdvance();
136 };
137 
138 
140 { mODTextTranslationClass(SeisFixedCubeProvider);
141 public:
142  SeisFixedCubeProvider(const MultiID&);
143  ~SeisFixedCubeProvider();
144 
145  void clear();
146  bool isEmpty() const;
147  bool readData(const TrcKeyZSampling&,TaskRunner* tr=0);
148  bool readData(const TrcKeyZSampling&,
149  const Pos::GeomID geomid, TaskRunner* tr = 0);
150 
151  const SeisTrc* getTrace(const BinID&) const;
152  const SeisTrc* getTrace(int trcnr) const;
153  float getTrcDist() const { return trcdist_; }
154  uiString errMsg() const;
155 
156 protected:
157 
159 
163  float trcdist_;
164 
165  bool calcTrcDist(const Pos::GeomID);
166 };
167 
168 #endif
#define mExpClass(module)
Definition: commondefs.h:160
Summary for a Seismic object.
Definition: segydirectdef.h:23
int crlStepout(bool req) const
Definition: seiscubeprov.h:83
Definition: ioobj.h:58
Definition: seiscubeprov.h:88
#define mODTextTranslationClass(clss)
Definition: uistring.h:38
Array2D< bool > * reqmask_
Definition: seiscubeprov.h:115
bool is2D(GeomType gt)
Definition: seistype.h:34
ObjectSet< SeisTrcBuf > tbufs_
Definition: seiscubeprov.h:111
int pivotidx_
Definition: seiscubeprov.h:128
bool init()
void clear(std::ios &)
int bufidx_
Definition: seiscubeprov.h:125
Definition: uistring.h:89
uiString errmsg_
Definition: seiscubeprov.h:162
const SeisTrcReader & reader() const
Definition: seiscubeprov.h:106
TrcKeyZSampling tkzs_
Definition: seiscubeprov.h:160
int estnrtrcs_
Definition: seiscubeprov.h:122
Key for a line in a line set.
Definition: linekey.h:22
RowCol desstepout_
Definition: seiscubeprov.h:113
reads from a seismic data store.
Definition: seisread.h:50
SeisTrcReader & reader()
Definition: seiscubeprov.h:105
int trcidx_
Definition: seiscubeprov.h:126
Array2D ( Subclass of ArrayND ) is a two dimensional array.
Definition: arraynd.h:131
Class that can execute a task.
Definition: task.h:169
Hor+Vert sampling in 3D surveys.
Definition: trckeyzsampling.h:35
bool isEmpty(const SelData *sd)
Definition: seisselection.h:135
IOObj * ioobj_
Definition: seiscubeprov.h:161
ReadState
Definition: seiscubeprov.h:118
Definition: seiscubeprov.h:139
bool workstarted_
Definition: seiscubeprov.h:117
contains input (sub-)selection data from a cube or lineset
Definition: seisselection.h:82
Index_Type GeomID
Definition: commontypes.h:52
Array2D< SeisTrc * > * data_
Definition: seiscubeprov.h:158
IdxPair used for its row() and col().
Definition: rowcol.h:25
RowCol stepoutstep_
Definition: seiscubeprov.h:114
float getTrcDist() const
Definition: seiscubeprov.h:153
Positioning in a seismic survey: inline/crossline or lineNr/trcNr.
Definition: binid.h:30
AdvanceState
Definition: seiscubeprov.h:88
Seismic trace.
Definition: seistrc.h:34
BufferString errmsg_
Definition: horizontracker.h:119
SeisTrcReader & rdr_
Definition: seiscubeprov.h:110
int inlStepout(bool req) const
Definition: seiscubeprov.h:81
void forceFloatData(bool yn)
Definition: seiscubeprov.h:74
void setStepoutStep(int i, int c)
Definition: seiscubeprov.h:79
set of seismic traces.
Definition: seisbuf.h:31
RowCol reqstepout_
Definition: seiscubeprov.h:112
Reads seismic data into buffers providing a Moving Virtual Subcube of seismic data.
Definition: seiscubeprov.h:56
float trcdist_
Definition: seiscubeprov.h:163
uiString errmsg_
Definition: seiscubeprov.h:121
bool intofloats_
Definition: seiscubeprov.h:116
const char * errMsg() const
Definition: horizontracker.h:61
uiString errMsg() const
Definition: seiscubeprov.h:90
ReadState readstate_
Definition: seiscubeprov.h:119
int pivotidy_
Definition: seiscubeprov.h:129
const SeisTrc * getTrace(EM::SubID) const
Compound key consisting of ints.
Definition: multiid.h:25

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