OpendTect-6_4  6.4
seisposindexer.h
Go to the documentation of this file.
1 #ifndef seisposindexer_h
2 #define seisposindexer_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 
16 #include "seismod.h"
17 #include "seisposkey.h"
18 #include "threadlock.h"
19 #include "ranges.h"
20 #include "sets.h"
21 #include "od_iosfwd.h"
22 
23 
24 template <class T> class DataInterpreter;
25 
26 namespace Seis
27 {
28 
30 {
31 public:
32 
34 
35  virtual ~PosKeyList() {}
36  virtual od_int64 size() const = 0;
37  virtual bool key(od_int64,PosKey&) const = 0;
38 
39 };
40 
49 {
50 public:
51 
61 
62 
63  PosIndexer(const PosKeyList&,bool doindex,
64  bool excludeunreasonable);
67  virtual ~PosIndexer();
68 
69  od_int64 findFirst(const BinID&) const;
72  od_int64 findFirst(int) const;
75  od_int64 findFirst(const PosKey&,
76  bool chckoffs=true) const;
80  od_int64 findOcc(const PosKey&,int occ) const;
82  TypeSet<od_int64> findAll(const PosKey&) const;
84 
85  inline bool validIdx( od_int64 idx ) const
86  { return idx >= 0 && idx < maxidx_; }
87  inline od_int64 maxIdx() const { return maxidx_; }
88 
89  void reIndex();
90 
91  inline Seis::GeomType geomType() const
92  { return Seis::geomTypeOf(is2d_,isps_); }
93 
94  const Interval<int>& inlRange() const { return inlrg_; }
95  const Interval<int>& crlRange() const { return crlrg_; }
96  const Interval<int>& trcNrRange() const { return crlrg_; }
97  const Interval<float>& offsetRange() const { return offsrg_; }
98  od_int64 nrRejected() const { return nrrejected_; }
99 
100  bool ioCompressed() const
101  { return iocompressedmgr_; }
102  void setIOCompressed(bool yn=true)
103  { iocompressedmgr_ = yn; }
104  bool dumpTo(od_ostream& strm) const;
105  bool readFrom(const char* nm, od_int64 offset,
106  bool all,
110 
111  const TypeSet<int>& getInls() const { return inls_; }
112  void getCrls(int inl,TypeSet<int>&) const;
113 
114  void add(const Seis::PosKey&, od_int64 offset );
116 
117  /* mDeprecated */ void empty();
118  void setEmpty() { empty(); }
119 
120 protected:
121 
122  bool readHeader(DataInterpreter<int>*,
125  bool readLine(TypeSet<int>& crl,
128  DataInterpreter<od_int64>* ) const;
129 
134 
138  int curinl_;
139 
140  const PosKeyList& pkl_;
141  bool is2d_;
142  bool isps_;
148 
152 
157 
158  bool isReasonable(const BinID&) const;
159  int getFirstIdxs(const BinID&,int&,int&);
160  void dumpLineCompressed(od_ostream&,const KeyIdxSet&,
161  const FileIdxSet&) const;
162  bool readLineCompressed(KeyIdxSet&,
163  FileIdxSet&) const;
164 
165 };
166 
167 
168 
169 } // namespace
170 
171 #endif
#define mExpClass(module)
Definition: commondefs.h:160
Summary for a Seismic object.
Definition: segydirectdef.h:23
TypeSet< FileIdxType > FileIdxSet
Definition: seisposindexer.h:55
DataInterpreter< od_int64 > Int64Interpreter
Definition: seisposindexer.h:59
const TypeSet< int > & getInls() const
Definition: seisposindexer.h:111
OD class for stream write common access to the user log file, or std::cout in batch progs...
Definition: od_ostream.h:26
Seis::GeomType geomType() const
Definition: seisposindexer.h:91
Interval< int > goodcrlrg_
Definition: seisposindexer.h:154
bool readLine(std::istream &, BufferString *b=0, bool *newline_found=0)
A lock of a type that (hopefully) suits your needs. To use it, you need the Locker class...
Definition: threadlock.h:53
Definition: seisposindexer.h:29
od_int64 maxIdx() const
Definition: seisposindexer.h:87
void setEmpty()
Definition: seisposindexer.h:118
const Interval< int > & inlRange() const
Definition: seisposindexer.h:94
od_int64 maxidx_
Definition: seisposindexer.h:147
bool is2d_
Definition: seisposindexer.h:141
#define od_int64
Definition: plftypes.h:36
od_int64 od_stream_Pos
Definition: od_iosfwd.h:21
Definition: i_layout.h:35
DataInterpreter< int > Int32Interpreter
Definition: seisposindexer.h:58
builds an index of a list of positions, making it easy to find a specific position.
Definition: seisposindexer.h:48
DataInterpreter< od_int64 > * int64interp_
Definition: seisposindexer.h:132
od_stream_Pos FileOffsType
Definition: seisposindexer.h:56
PosKeyList::FileIdxType FileIdxType
Definition: seisposindexer.h:54
bool validIdx(od_int64 idx) const
Definition: seisposindexer.h:85
od_int32 Index_Type
Definition: commontypes.h:33
Index_Type KeyIdxType
Definition: seisposindexer.h:52
const PosKeyList & pkl_
Definition: seisposindexer.h:140
Definition: seisposkey.h:23
OD class for stream read.
Definition: od_istream.h:24
Interval< int > goodinlrg_
Definition: seisposindexer.h:153
Byte-level data interpreter.
Definition: cbvswriter.h:22
bool ioCompressed() const
Definition: seisposindexer.h:100
TypeSet< int > inls_
Definition: seisposindexer.h:144
Set of pointers to objects.
Definition: commontypes.h:32
GeomType
Definition: seistype.h:33
void setIOCompressed(bool yn=true)
Definition: seisposindexer.h:102
const Interval< int > & trcNrRange() const
Definition: seisposindexer.h:96
Set of (small) copyable elements.
Definition: commontypes.h:30
od_int64 FileIdxType
Definition: seisposindexer.h:33
Threads::Lock lock_
Definition: seisposindexer.h:135
od_istream * strm_
Definition: seisposindexer.h:130
bool excludeunreasonable_
Definition: seisposindexer.h:143
TypeSet< FileOffsType > FileOffsSet
Definition: seisposindexer.h:57
TypeSet< KeyIdxType > KeyIdxSet
Definition: seisposindexer.h:53
const Interval< float > & offsetRange() const
Definition: seisposindexer.h:97
Positioning in a seismic survey: inline/crossline or lineNr/trcNr.
Definition: binid.h:30
int curinl_
Definition: seisposindexer.h:138
od_int64 nrRejected() const
Definition: seisposindexer.h:98
DataInterpreter< int > * int32interp_
Definition: seisposindexer.h:131
Interval< float > offsrg_
Definition: seisposindexer.h:151
TypeSet< od_int64 > curidxset_
Definition: seisposindexer.h:136
virtual ~PosKeyList()
Definition: seisposindexer.h:35
bool iocompressedmgr_
Definition: seisposindexer.h:156
Interval< int > inlrg_
Definition: seisposindexer.h:149
ObjectSet< TypeSet< int > > crlsets_
Definition: seisposindexer.h:145
bool isps_
Definition: seisposindexer.h:142
Interval< int > crlrg_
Definition: seisposindexer.h:150
DataInterpreter< float > FloatInterpreter
Definition: seisposindexer.h:60
const Interval< int > & crlRange() const
Definition: seisposindexer.h:95
GeomType geomTypeOf(const char *)
ObjectSet< TypeSet< od_int64 > > idxsets_
Definition: seisposindexer.h:146
od_int64 nrrejected_
Definition: seisposindexer.h:155
TypeSet< od_int64 > inlfileoffsets_
Definition: seisposindexer.h:133
TypeSet< int > curcrlset_
Definition: seisposindexer.h:137

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