OpendTect-6_4  6.4
segydirecttr.h
Go to the documentation of this file.
1 #ifndef segydirecttr_h
2 #define segydirecttr_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: Bert
9  Date: Nov 2008
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 -*/
14 
15 #include "seismod.h"
16 #include "seispsread.h"
17 #include "seispsioprov.h"
18 #include "seistrctr.h"
19 #include "uistring.h"
20 
21 namespace SEGY { class DirectDef; }
22 namespace PosInfo { class CubeData; }
24 class StreamConn;
25 
26 #define mSEGYDirectTranslNm "SEGYDirect"
27 
28 
31 namespace SEGY
32 {
33 class FileDataSet;
34 
35 
37 { mODTextTranslationClass(DirectReader);
38 public:
39 
41  : tr_(0), curfilenr_(-1) {}
42  virtual ~DirectReader();
43 
44  virtual DirectDef* getDef() = 0;
45  virtual uiString errMsg() const = 0;
46  virtual SEGYSeisTrcTranslator* getTranslator() { return tr_; }
47  virtual bool goTo(const BinID&) = 0;
48 
49 protected:
50 
52  mutable int curfilenr_;
53 
54 };
55 
56 }
57 
58 
62  , public SEGY::DirectReader
64 public:
65 
66  SEGYDirect3DPSReader(const char* fnm);
67  // Check errMsg() to see failure
69 
70  SeisTrc* getTrace(const BinID&,int) const;
71  bool getGather(const BinID&,SeisTrcBuf&) const;
72  uiString errMsg() const { return errmsg_; }
73 
74  const PosInfo::CubeData& posData() const;
75 
76  virtual SEGY::DirectDef* getDef() { return &def_; }
77  virtual bool goTo(const BinID&);
78 
79 protected:
80 
82  mutable uiString errmsg_;
83 
84  SeisTrc* getTrace(int,int,const BinID&) const;
85  bool goTo(int,int) const;
86 
87 };
88 
89 
93  , public SEGY::DirectReader
95 public:
96 
97  SEGYDirect2DPSReader(const char* dirnm,Pos::GeomID);
98  SEGYDirect2DPSReader(const char* dirnm,const char* lnm);
99  // Check errMsg() to see failure
101 
102  SeisTrc* getTrace(const BinID&,int) const;
103  bool getGather(const BinID&,SeisTrcBuf&) const;
104  uiString errMsg() const { return errmsg_; }
105 
106  const PosInfo::Line2DData& posData() const;
107 
108  virtual SEGY::DirectDef* getDef() { return &def_; }
109  virtual bool goTo(const BinID&);
110 
111 protected:
112 
114  mutable uiString errmsg_;
115 
116  SeisTrc* getTrace(int,int,int) const;
117  bool goTo(int,int) const;
118 };
119 
120 
121 
124  isTranslator(SEGYDirect,SeisPS3D)
125 public:
126  mDefEmptyTranslatorConstructor(SEGYDirect,SeisPS3D)
127 
128  virtual bool isUserSelectable( bool fr ) const { return fr; }
129  virtual const char* iconName() const { return "segy"; }
130  virtual const char* defExtension() const { return fileExt(); }
131  static const char* fileExt() { return "sgydef"; }
132 
133  static const char* sKeyNrInlPerFile()
134  { return "Number of inlines per file"; }
135 
136 };
137 
138 
141  isTranslator(SEGYDirect,SeisPS2D)
142 public:
143  mDefEmptyTranslatorConstructor(SEGYDirect,SeisPS2D)
144 
145  virtual bool isUserSelectable( bool fr ) const { return fr; }
146 
147 };
148 
149 
151  , public SEGY::DirectReader
153  isTranslator(SEGYDirect,SeisTrc)
154 public:
155 
156  SEGYDirectSeisTrcTranslator(const char*,const char*);
158  virtual const char* defExtension() const { return "sgydef"; }
159 
160  virtual bool readInfo(SeisTrcInfo&);
161  virtual bool read(SeisTrc&);
162  virtual bool skip(int);
163  virtual bool supportsGoTo() const { return true; }
164  virtual bool isUserSelectable( bool fr ) const { return true; }
165  virtual Conn* curConn();
166  virtual BinID curBinID() const;
167  virtual bool forRead() const { return forread_; }
168 
169  virtual void toSupported(DataCharacteristics&) const;
170  virtual bool write(const SeisTrc&); // no buffer/resort needed
171 
172  virtual void usePar(const IOPar&);
173 
174  virtual bool implRemove(const IOObj*) const;
175  virtual bool close();
176  virtual void cleanUp();
177  virtual IOObj* createWriteIOObj(const IOObjContext&,
178  const MultiID&) const;
179  virtual const char* iconName() const { return "segy"; }
180 
181  virtual bool getGeometryInfo(PosInfo::CubeData&) const;
182  virtual SEGY::DirectDef* getDef() { return def_; }
183  virtual bool goTo(const BinID&);
184  virtual uiString errMsg() const { return SeisTrcTranslator::errMsg(); }
185 
186  static SEGYSeisTrcTranslator* createTranslator(const SEGY::DirectDef& def,
187  int filenr);
188 protected:
189 
190  bool commitSelections_();
191  virtual bool initRead_();
192  virtual bool initWrite_(const SeisTrc&);
193 
196  bool headerread_; //Will be removed after 6.2
197  int ild_;
198  int iseg_;
199  int itrc_;
200  bool forread_;
204 
205  void initVars(bool for_read=true);
206  const PosInfo::CubeData& cubeData() const;
207  bool toNextTrace();
208  bool positionTranslator();
209 
210 private:
211 
212  void setCompDataFromInput();
213  virtual bool readData(TraceData* externalbuf);
214 
215 };
216 
217 
218 #endif
BufferString segyfilename_
Definition: segydirecttr.h:202
#define mExpClass(module)
Definition: commondefs.h:160
Definition: seispsioprov.h:171
Summary for a Seismic object.
Definition: segydirectdef.h:23
SEGYSeisTrcTranslator * tr_
Definition: segydirecttr.h:51
Definition: ioobj.h:58
int curfilenr_
Definition: segydirecttr.h:52
virtual SEGY::DirectDef * getDef()
Definition: segydirecttr.h:108
int itrc_
Definition: segydirecttr.h:199
#define mODTextTranslationClass(clss)
Definition: uistring.h:38
Definition: segydirectdef.h:35
virtual bool forRead() const
Definition: segydirecttr.h:167
SEGY::DirectDef * def_
Definition: segydirecttr.h:194
void usePar(const IOPar &iop, ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:188
IOPar segypars_
Definition: segydirecttr.h:201
DirectReader()
Definition: segydirecttr.h:40
virtual const char * iconName() const
Definition: segydirecttr.h:179
Definition: segytr.h:32
Position info for a 2D line.
Definition: posinfo2d.h:65
Definition: uistring.h:89
uiString errMsg() const
Definition: segydirecttr.h:104
Definition: segyfiledata.h:39
int iseg_
Definition: segydirecttr.h:198
#define mDefEmptyTranslatorConstructor(spec, clss)
Definition: transl.h:267
uiString errMsg() const
Definition: segydirecttr.h:72
reads from a 3D prestack seismic data store.
Definition: seispsread.h:56
Definition: seispsioprov.h:196
SEGY::FileDataSet * fds_
Definition: segydirecttr.h:195
bool forread_
Definition: segydirecttr.h:200
Definition: segydirecttr.h:150
static const char * sKeyNrInlPerFile()
Definition: segydirecttr.h:133
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:47
Definition: seistrctr.h:90
virtual bool isUserSelectable(bool fr) const
Definition: segydirecttr.h:164
byte-level data characteristics of stored data.
Definition: datachar.h:37
virtual bool supportsGoTo() const
Definition: segydirecttr.h:163
Information for a seismic trace, AKA trace header info.
Definition: seisinfo.h:27
virtual SEGY::DirectDef * getDef()
Definition: segydirecttr.h:76
isTranslator(SEGYDirect, SeisPS3D) public
Definition: segydirecttr.h:124
Index_Type GeomID
Definition: commontypes.h:52
SEGY::DirectDef & def_
Definition: segydirecttr.h:113
virtual const char * defExtension() const
Definition: segydirecttr.h:158
Data connection.
Definition: conn.h:30
Position info, often segmented.
Definition: posinfo.h:40
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:40
BufferString segydeffilename_
Definition: segydirecttr.h:203
virtual SEGYSeisTrcTranslator * getTranslator()
Definition: segydirecttr.h:46
Positioning in a seismic survey: inline/crossline or lineNr/trcNr.
Definition: binid.h:30
Seismic trace.
Definition: seistrc.h:34
BufferString errmsg_
Definition: horizontracker.h:119
Definition: segydirecttr.h:122
uiString errMsg() const
Definition: seistrctr.h:187
set of seismic traces.
Definition: seisbuf.h:31
Definition: segydirecttr.h:139
Definition: segydirecttr.h:36
Keys that should be used with od_process_segyio.cc.
Definition: segybatchio.h:22
virtual SEGY::DirectDef * getDef()
Definition: segydirecttr.h:182
const char * errMsg() const
Definition: horizontracker.h:61
Connection with an underlying iostream.
Definition: streamconn.h:26
bool headerread_
Definition: segydirecttr.h:196
SEGY::DirectDef & def_
Definition: segydirecttr.h:81
uiString errmsg_
Definition: segydirecttr.h:82
A set of data buffers and their interpreters.
Definition: tracedata.h:32
uiString errmsg_
Definition: segydirecttr.h:114
reads from a 2D prestack seismic data store.
Definition: seispsread.h:69
Position info for an entire 3D cube. The LineData&#39;s are not sorted.
Definition: posinfo.h:95
const SeisTrc * getTrace(EM::SubID) const
virtual uiString errMsg() const
Definition: segydirecttr.h:184
Compound key consisting of ints.
Definition: multiid.h:25
reads from 2D PS data store reader based on SEG-Y files
Definition: segydirecttr.h:92
int ild_
Definition: segydirecttr.h:197
#define isTranslator(spec, clss)
Definition: transl.h:230
Holds the context for selecting and/or creating IOObjs.
Definition: ctxtioobj.h:62
reads from 3D PS data store reader based on SEG-Y files
Definition: segydirecttr.h:61

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