OpendTect  6.3
segyfiledata.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: Bert
8  Date: Sep 2008
9 ________________________________________________________________________
10 
11 -*/
12 
13 #include "seisposkey.h"
14 #include "bufstring.h"
15 #include "bufstringset.h"
16 #include "iopar.h"
17 #include "manobjectset.h"
18 #include "coord.h"
19 #include "samplingdata.h"
20 #include "sortedtable.h"
21 #include "threadlock.h"
22 #include "od_iosfwd.h"
23 
24 class ascostream;
26 template <class T> class DataInterpreter;
28 namespace Seis { class PosIndexer; }
29 
30 
31 namespace SEGY
32 {
33 
37 {
38 public:
39 
40  struct TrcIdx
41  {
42  TrcIdx( int fnr=-1, od_int64 tnr=0 )
43  : filenr_(fnr), trcidx_(tnr) {}
44  bool isValid() const { return filenr_>=0; }
45  void toNextFile() { filenr_++; trcidx_ = 0; }
46  bool operator ==( const TrcIdx& oth ) const
47  { return filenr_ == oth.filenr_
48  && trcidx_ == oth.trcidx_; }
49  bool operator !=( const TrcIdx& oth ) const
50  { return filenr_ != oth.filenr_
51  || trcidx_ != oth.trcidx_; }
52 
53  int filenr_;
55  };
56 
57  FileDataSet(const IOPar& iop, ascistream& );
59  FileDataSet(const IOPar& iop);
62  ~FileDataSet();
63 
64  FileDataSet(const IOPar&,const char* filename,
65  od_stream_Pos start,
66  const DataCharacteristics& int32 );
69  FileDataSet(const FileDataSet& fd);
71 
72  void save2DCoords(bool yn);
73 
74  bool setOutputStream(od_ostream&);
77  void setAuxData(const Seis::GeomType&,
78  const SEGYSeisTrcTranslator&);
79 
80  void addFile(const char* fnm);
81  bool addTrace(int fileidx,const Seis::PosKey&,const Coord&,
82  bool usable);
83 
84  const SamplingData<float>& getSampling() const { return sampling_; }
85  int getTrcSz() const { return trcsz_; }
86 
87  //Auxdata
88  int nrFiles() const;
89  FixedString fileName(int) const;
90  bool isEmpty() const { return totalsz_<2; }
91  od_int64 size() const { return totalsz_; }
92  bool isRev0() const { return isrev0_; }
93  Seis::GeomType geomType() const { return geom_; }
94  const IOPar& segyPars() const { return segypars_;}
95 
96  //TraceData
97  bool getDetails(od_int64,Seis::PosKey&,
98  bool& usable) const;
99  Coord get2DCoord(int trcnr) const;
100  TrcIdx getFileIndex(od_int64) const;
101 
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
#define mExpClass(module)
Definition: commondefs.h:157
bool isEmpty() const
Definition: segyfiledata.h:90
Seismics.
Definition: segydirectdef.h:20
Definition: segyfiledata.h:40
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:25
bool isValid() const
Definition: segyfiledata.h:44
od_int64 size() const
Definition: segyfiledata.h:91
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:51
bool operator==(const ArrayNDInfo &a1, const ArrayNDInfo &a2)
Definition: arrayndinfo.h:51
BufferStringSet filenames_
Definition: segyfiledata.h:149
OD::String that holds an existing text string.
Definition: fixedstring.h:27
void usePar(const IOPar &iop, ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:200
bool isRev0() const
Definition: segyfiledata.h:92
#define od_int64
Definition: plftypes.h:34
od_int64 od_stream_Pos
Definition: od_iosfwd.h:19
OpendTect standard ascii format file writing.
Definition: ascstream.h:30
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:45
int getTrcSz() const
Definition: segyfiledata.h:85
Seis::GeomType geom_
Definition: segyfiledata.h:144
Definition: segytr.h:28
A SortedTable keeps track of ids and their corresponding values. Each id can only be present once...
Definition: sortedtable.h:23
int filenr_
Definition: segyfiledata.h:53
void toNextFile()
Definition: segyfiledata.h:45
Set of BufferString objects.
Definition: bufstringset.h:25
Definition: segyfiledata.h:36
Definition: seisposkey.h:20
OD class for stream read.
Definition: od_istream.h:23
bool isrev0_
Definition: segyfiledata.h:145
IOPar segypars_
Definition: segyfiledata.h:143
Byte-level data interpreter.
Definition: cbvswriter.h:20
GeomType
Definition: seistype.h:31
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:53
byte-level data characteristics of stored data.
Definition: datachar.h:35
Seis::PosIndexer * indexer_
Definition: segyfiledata.h:160
od_int64 trcidx_
Definition: segyfiledata.h:54
od_ostream * ostrm_
Definition: segyfiledata.h:136
StoredData * storeddata_
Definition: segyfiledata.h:157
bool operator!=(const ArrayNDInfo &a1, const ArrayNDInfo &a2)
Definition: arrayndinfo.h:60
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:187
OpendTect standard ascii format file reading.
Definition: ascstream.h:81
Seis::GeomType geomType() const
Definition: segyfiledata.h:93
const IOPar & segyPars() const
Definition: segyfiledata.h:94
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:18
TypeSet< Seis::PosKey > keys_
Definition: segyfiledata.h:155
DataInterpreter< int > * int32di_
Definition: segyfiledata.h:130
2D point or vector class.
Definition: commontypes.h:58
const SamplingData< float > & getSampling() const
Definition: segyfiledata.h:84
od_istream * istrm_
Definition: segyfiledata.h:133
TrcIdx(int fnr=-1, od_int64 tnr=0)
Definition: segyfiledata.h:42
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. 2017