OpendTect  6.6
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  RCS: $Id$
10 ________________________________________________________________________
11 
12 -*/
13 
14 #include "seismod.h"
15 #include "bufstring.h"
16 #include "bufstringset.h"
17 #include "iopar.h"
18 #include "manobjectset.h"
19 #include "coord.h"
20 #include "samplingdata.h"
21 #include "seisposkey.h"
22 #include "sortedtable.h"
23 #include "threadlock.h"
24 #include "od_iosfwd.h"
25 
26 class ascostream;
28 template <class T> class DataInterpreter;
30 namespace Seis { class PosIndexer; }
31 
32 
33 namespace SEGY
34 {
35 
39 {
40 public:
41 
42  struct TrcIdx
43  {
44  TrcIdx( int fnr=-1, od_int64 tnr=0 )
45  : filenr_(fnr), trcidx_(tnr) {}
46  bool isValid() const { return filenr_>=0; }
47  void toNextFile() { filenr_++; trcidx_ = 0; }
48 
49  int filenr_;
51  };
52 
53  FileDataSet(const IOPar& iop, ascistream& );
55  FileDataSet(const IOPar& iop);
59 
60  FileDataSet(const IOPar&,const char* filename,
61  od_stream_Pos start,
62  const DataCharacteristics& int32 );
67 
68  void save2DCoords(bool yn);
69 
74  const SEGYSeisTrcTranslator&);
75 
76  void addFile(const char* fnm);
77  bool addTrace(int fileidx,const Seis::PosKey&,const Coord&,
78  bool usable);
79 
80  const SamplingData<float>& getSampling() const { return sampling_; }
81  int getTrcSz() const { return trcsz_; }
82 
83  //Auxdata
84  int nrFiles() const;
85  FixedString fileName(int) const;
86  bool isEmpty() const { return totalsz_<2; }
87  od_int64 size() const { return totalsz_; }
88  bool isRev0() const { return isrev0_; }
89  Seis::GeomType geomType() const { return geom_; }
90  const IOPar& segyPars() const { return segypars_;}
91  void setDiscardNull( bool yn ) { discardnull_ = yn; }
92 
93  //TraceData
95  bool& usable) const;
96  Coord get2DCoord(int trcnr) const;
98 
99 
100  //bool toNext(TrcIdx&,bool allownull=true,
101  //bool allownotusable=false) const;
102 
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);
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 
141 
142  //Auxdata
145  bool isrev0_;
147  int trcsz_;
154 
155  //TraceData
159  SortedTable<int,Coord>* coords_; //trcnr vs coord
160 
162 };
163 
164 } // namespace
165 
166 
SEGY::FileDataSet::setOutputStream
bool setOutputStream(od_ostream &)
SEGY::FileDataSet::~FileDataSet
~FileDataSet()
SEGY::FileDataSet::StoredData::start_
od_stream_Pos start_
Definition: segyfiledata.h:134
SEGY::FileDataSet::readVersion1File
bool readVersion1File(ascistream &)
Seis::PosIndexer
builds an index of a list of positions, making it easy to find a specific position.
Definition: seisposindexer.h:48
SEGY::FileDataSet::coords_
SortedTable< int, Coord > * coords_
Definition: segyfiledata.h:159
SEGY::FileDataSet::keys_
TypeSet< Seis::PosKey > keys_
Definition: segyfiledata.h:156
SEGY::FileDataSet::StoredData::add
bool add(const Seis::PosKey &, bool)
BufferStringSet
Set of BufferString objects.
Definition: bufstringset.h:26
Seis
Summary for a Seismic object.
Definition: segydirectdef.h:22
SEGY::FileDataSet::FileDataSet
FileDataSet(const IOPar &iop)
od_int64
#define od_int64
Definition: plftypes.h:35
SEGY::FileDataSet::storeddata_
StoredData * storeddata_
Definition: segyfiledata.h:158
SEGY::FileDataSet
Definition: segyfiledata.h:39
mExpClass
#define mExpClass(module)
Definition: commondefs.h:177
SEGY::FileDataSet::fileName
FixedString fileName(int) const
od_istream
OD class for stream read common access to the std::cin.
Definition: od_istream.h:24
SEGY::FileDataSet::FileDataSet
FileDataSet(const FileDataSet &fd)
Not implemented, just to make linker complain.
seisposkey.h
SEGY::FileDataSet::geomType
Seis::GeomType geomType() const
Definition: segyfiledata.h:89
samplingdata.h
SEGY::FileDataSet::cumsizes_
TypeSet< od_int64 > cumsizes_
Definition: segyfiledata.h:150
SEGY::FileDataSet::addFile
void addFile(const char *fnm)
SEGY::FileDataSet::TrcIdx
Definition: segyfiledata.h:43
SEGY::FileDataSet::StoredData::StoredData
StoredData(const char *filename, od_stream_Pos start, const DataCharacteristics &int32)
SEGY::FileDataSet::StoredData::lock_
Threads::Lock lock_
Definition: segyfiledata.h:132
SEGYSeisTrcTranslator
Definition: segytr.h:32
SEGY::FileDataSet::FileDataSet
FileDataSet(const IOPar &iop, ascistream &)
Reads old version of file into memory.
od_stream_Pos
od_int64 od_stream_Pos
Definition: od_iosfwd.h:20
DataInterpreter
Byte-level data interpreter.
Definition: cbvswriter.h:21
bufstring.h
SEGY::FileDataSet::nrstanzas_
int nrstanzas_
Definition: segyfiledata.h:148
SEGY::FileDataSet::isRev0
bool isRev0() const
Definition: segyfiledata.h:88
SEGY::FileDataSet::FileDataSet
FileDataSet(const IOPar &, const char *filename, od_stream_Pos start, const DataCharacteristics &int32)
ascostream
OpendTect standard ascii format file writing.
Definition: ascstream.h:32
Coord
A cartesian coordinate in 2D space.
Definition: coord.h:25
SEGY::FileDataSet::StoredData
Definition: segyfiledata.h:119
SEGY::FileDataSet::segyPars
const IOPar & segyPars() const
Definition: segyfiledata.h:90
SEGY::FileDataSet::getReport
void getReport(IOPar &) const
SEGY::FileDataSet::StoredData::ostrm_
od_ostream * ostrm_
Definition: segyfiledata.h:136
SEGY::FileDataSet::TrcIdx::filenr_
int filenr_
Definition: segyfiledata.h:49
SEGY::FileDataSet::sampling_
SamplingData< float > sampling_
Definition: segyfiledata.h:146
SEGY::FileDataSet::isrev0_
bool isrev0_
Definition: segyfiledata.h:145
SEGY::FileDataSet::TrcIdx::TrcIdx
TrcIdx(int fnr=-1, od_int64 tnr=0)
Definition: segyfiledata.h:44
SEGY::FileDataSet::StoredData::StoredData
StoredData(od_ostream &)
SamplingData< float >
SEGY::FileDataSet::totalsz_
od_int64 totalsz_
Definition: segyfiledata.h:151
SEGY::FileDataSet::getFileIndex
TrcIdx getFileIndex(od_int64) const
SEGY::FileDataSet::getTrcSz
int getTrcSz() const
Definition: segyfiledata.h:81
SEGY::FileDataSet::geom_
Seis::GeomType geom_
Definition: segyfiledata.h:144
SEGY::FileDataSet::setDiscardNull
void setDiscardNull(bool yn)
Definition: segyfiledata.h:91
FixedString
OD::String that holds an existing text string.
Definition: fixedstring.h:29
SEGY::FileDataSet::StoredData::~StoredData
~StoredData()
SEGY::FileDataSet::save2DCoords
void save2DCoords(bool yn)
sortedtable.h
SortedTable< int, Coord >
SEGY::FileDataSet::setAuxData
void setAuxData(const Seis::GeomType &, const SEGYSeisTrcTranslator &)
SEGY::FileDataSet::trcsz_
int trcsz_
Definition: segyfiledata.h:147
bufstringset.h
SEGY::FileDataSet::getDetails
bool getDetails(od_int64, Seis::PosKey &, bool &usable) const
SEGY::FileDataSet::StoredData::int32di_
DataInterpreter< int > * int32di_
Definition: segyfiledata.h:130
SEGY::FileDataSet::isEmpty
bool isEmpty() const
Definition: segyfiledata.h:86
SEGY::FileDataSet::get2DCoord
Coord get2DCoord(int trcnr) const
SEGY::FileDataSet::usable_
BoolTypeSet usable_
Definition: segyfiledata.h:157
SEGY::FileDataSet::readVersion1
bool readVersion1(ascistream &)
SEGY::FileDataSet::addTrace
bool addTrace(int fileidx, const Seis::PosKey &, const Coord &, bool usable)
od_iosfwd.h
threadlock.h
SEGY
Keys that should be used with od_process_segyio.cc.
Definition: segybatchio.h:22
Seis::PosKey
Definition: seisposkey.h:23
SEGY::FileDataSet::indexer_
Seis::PosIndexer * indexer_
Definition: segyfiledata.h:161
SEGY::FileDataSet::TrcIdx::toNextFile
void toNextFile()
Definition: segyfiledata.h:47
SEGY::FileDataSet::dump
void dump(od_ostream &) const
SEGY::FileDataSet::usePar
bool usePar(const IOPar &iop)
Read auxdata from storage.
manobjectset.h
SEGY::FileDataSet::filenames_
BufferStringSet filenames_
Definition: segyfiledata.h:149
SEGY::FileDataSet::nrFiles
int nrFiles() const
ascistream
OpendTect standard ascii format file reading.
Definition: ascstream.h:83
iopar.h
SEGY::FileDataSet::nrusable_
int nrusable_
Definition: segyfiledata.h:152
SEGY::FileDataSet::segypars_
IOPar segypars_
Definition: segyfiledata.h:143
SEGY::FileDataSet::TrcIdx::isValid
bool isValid() const
Definition: segyfiledata.h:46
SEGY::FileDataSet::StoredData::getKey
bool getKey(od_int64, Seis::PosKey &, bool &) const
Seis::GeomType
GeomType
Definition: seistype.h:32
od_ostream
OD class for stream write common access to the user log file, or std::cout in other than od_main.
Definition: od_ostream.h:26
SEGY::FileDataSet::fillPar
void fillPar(IOPar &iop) const
Write auxdata.
SEGY::FileDataSet::discardnull_
bool discardnull_
Definition: segyfiledata.h:153
SEGY::FileDataSet::size
od_int64 size() const
Definition: segyfiledata.h:87
Threads::Lock
A lock of a type that (hopefully) suits your needs. To use it, you need the Locker class.
Definition: threadlock.h:53
SEGY::FileDataSet::TrcIdx::trcidx_
od_int64 trcidx_
Definition: segyfiledata.h:50
IOPar
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:55
DataCharacteristics
byte-level data characteristics of stored data.
Definition: datachar.h:37
SEGY::FileDataSet::StoredData::istrm_
od_istream * istrm_
Definition: segyfiledata.h:133
TypeSet< od_int64 >
SEGY::FileDataSet::setIndexer
void setIndexer(Seis::PosIndexer *n)
SEGY::FileDataSet::getSampling
const SamplingData< float > & getSampling() const
Definition: segyfiledata.h:80
coord.h

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