OpendTect-6_4  6.4
segyfiledata.h
Go to the documentation of this file.
1 #ifndef segyfiledata_h
2 #define segyfiledata_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: Bert
9  Date: Sep 2008
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 -*/
14 
15 #include "seismod.h"
16 #include "bufstring.h"
17 #include "bufstringset.h"
18 #include "iopar.h"
19 #include "manobjectset.h"
20 #include "coord.h"
21 #include "samplingdata.h"
22 #include "seisposkey.h"
23 #include "sortedtable.h"
24 #include "threadlock.h"
25 #include "od_iosfwd.h"
26 
27 class ascostream;
29 template <class T> class DataInterpreter;
31 namespace Seis { class PosIndexer; }
32 
33 
34 namespace SEGY
35 {
36 
40 {
41 public:
42 
43  struct TrcIdx
44  {
45  TrcIdx( int fnr=-1, od_int64 tnr=0 )
46  : filenr_(fnr), trcidx_(tnr) {}
47  bool isValid() const { return filenr_>=0; }
48  void toNextFile() { filenr_++; trcidx_ = 0; }
49 
50  int filenr_;
52  };
53 
54  FileDataSet(const IOPar& iop, ascistream& );
56  FileDataSet(const IOPar& iop);
59  ~FileDataSet();
60 
61  FileDataSet(const IOPar&,const char* filename,
62  od_stream_Pos start,
63  const DataCharacteristics& int32 );
66  FileDataSet(const FileDataSet& fd);
68 
69  void save2DCoords(bool yn);
70 
71  bool setOutputStream(od_ostream&);
74  void setAuxData(const Seis::GeomType&,
75  const SEGYSeisTrcTranslator&);
76 
77  void addFile(const char* fnm);
78  bool addTrace(int fileidx,const Seis::PosKey&,const Coord&,
79  bool usable);
80 
81  const SamplingData<float>& getSampling() const { return sampling_; }
82  int getTrcSz() const { return trcsz_; }
83 
84  //Auxdata
85  int nrFiles() const;
86  FixedString fileName(int) const;
87  bool isEmpty() const { return totalsz_<2; }
88  od_int64 size() const { return totalsz_; }
89  bool isRev0() const { return isrev0_; }
90  Seis::GeomType geomType() const { return geom_; }
91  const IOPar& segyPars() const { return segypars_;}
92 
93  //TraceData
94  bool getDetails(od_int64,Seis::PosKey&,
95  bool& usable) const;
96  Coord get2DCoord(int trcnr) const;
97  TrcIdx getFileIndex(od_int64) const;
98 
99 
100  //bool toNext(TrcIdx&,bool allownull=true,
101  //bool allownotusable=false) const;
102 
103  void setIndexer(Seis::PosIndexer* n);
108  void getReport(IOPar&) const;
109  void dump(od_ostream&) const;
110 
111  bool usePar(const IOPar& iop);
113  void fillPar(IOPar& iop) const;
115 
116 protected:
117 
118  struct StoredData
119  {
120  StoredData(const char* filename,od_stream_Pos start,
121  const DataCharacteristics& int32);
123  ~StoredData();
124 
125  bool getKey(od_int64, Seis::PosKey&, bool& ) const;
126  bool add(const Seis::PosKey&,bool);
127 
128  protected:
129 
131 
135 
137  };
138 
139  bool readVersion1( ascistream& );
140  bool readVersion1File( ascistream& );
141 
142  //Auxdata
145  bool isrev0_;
147  int trcsz_;
153 
154  //TraceData
158  SortedTable<int,Coord>* coords_; //trcnr vs coord
159 
161 };
162 
163 } // namespace
164 
165 
166 #endif
#define mExpClass(module)
Definition: commondefs.h:160
bool isEmpty() const
Definition: segyfiledata.h:87
Summary for a Seismic object.
Definition: segydirectdef.h:23
Definition: segyfiledata.h:43
od_int64 totalsz_
Definition: segyfiledata.h:151
OD class for stream write common access to the user log file, or std::cout in batch progs...
Definition: od_ostream.h:26
bool isValid() const
Definition: segyfiledata.h:47
od_int64 size() const
Definition: segyfiledata.h:88
Threads::Lock lock_
Definition: segyfiledata.h:132
A lock of a type that (hopefully) suits your needs. To use it, you need the Locker class...
Definition: threadlock.h:53
BufferStringSet filenames_
Definition: segyfiledata.h:149
OD::String that holds an existing text string.
Definition: fixedstring.h:29
void usePar(const IOPar &iop, ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:188
bool isRev0() const
Definition: segyfiledata.h:89
#define od_int64
Definition: plftypes.h:36
od_int64 od_stream_Pos
Definition: od_iosfwd.h:21
OpendTect standard ascii format file writing.
Definition: ascstream.h:32
int nrstanzas_
Definition: segyfiledata.h:148
builds an index of a list of positions, making it easy to find a specific position.
Definition: seisposindexer.h:48
int getTrcSz() const
Definition: segyfiledata.h:82
Seis::GeomType geom_
Definition: segyfiledata.h:144
Definition: segytr.h:32
int filenr_
Definition: segyfiledata.h:50
void toNextFile()
Definition: segyfiledata.h:48
A cartesian coordinate in 2D space.
Definition: coord.h:25
Set of BufferString objects.
Definition: bufstringset.h:28
Definition: segyfiledata.h:39
Definition: seisposkey.h:23
OD class for stream read.
Definition: od_istream.h:24
bool isrev0_
Definition: segyfiledata.h:145
IOPar segypars_
Definition: segyfiledata.h:143
Byte-level data interpreter.
Definition: cbvswriter.h:22
GeomType
Definition: seistype.h:33
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:47
byte-level data characteristics of stored data.
Definition: datachar.h:37
Seis::PosIndexer * indexer_
Definition: segyfiledata.h:160
od_int64 trcidx_
Definition: segyfiledata.h:51
od_ostream * ostrm_
Definition: segyfiledata.h:136
StoredData * storeddata_
Definition: segyfiledata.h:157
BoolTypeSet usable_
Definition: segyfiledata.h:156
Definition: segyfiledata.h:118
od_stream_Pos start_
Definition: segyfiledata.h:134
void fillPar(IOPar &iop, const ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:175
OpendTect standard ascii format file reading.
Definition: ascstream.h:83
Seis::GeomType geomType() const
Definition: segyfiledata.h:90
const IOPar & segyPars() const
Definition: segyfiledata.h:91
int nrusable_
Definition: segyfiledata.h:152
TypeSet< od_int64 > cumsizes_
Definition: segyfiledata.h:150
SortedTable< int, Coord > * coords_
Definition: segyfiledata.h:158
Keys that should be used with od_process_segyio.cc.
Definition: segybatchio.h:22
TypeSet< Seis::PosKey > keys_
Definition: segyfiledata.h:155
DataInterpreter< int > * int32di_
Definition: segyfiledata.h:130
const SamplingData< float > & getSampling() const
Definition: segyfiledata.h:81
od_istream * istrm_
Definition: segyfiledata.h:133
TrcIdx(int fnr=-1, od_int64 tnr=0)
Definition: segyfiledata.h:45
int trcsz_
Definition: segyfiledata.h:147
SamplingData< float > sampling_
Definition: segyfiledata.h:146

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