OpendTect-6_4  6.4
posinfodetector.h
Go to the documentation of this file.
1 #ifndef posinfodetector_h
2 #define posinfodetector_h
3 /*
4 ________________________________________________________________________
5 
6  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
7  Author: Bert Bril
8  Date: Oct 2008
9  RCS: $Id$
10 ________________________________________________________________________
11 
12 */
13 
14 #include "generalmod.h"
15 #include "posinfo.h"
16 #include "coord.h"
17 #include "bufstring.h"
18 #include "uistring.h"
19 class TrcKeySampling;
20 class BinIDSorting;
22 
23 
24 namespace PosInfo
25 {
26 
30 { mODTextTranslationClass(CrdBidOffs);
31 public:
33  : coord_(0,0), binid_(1,0), offset_(0) {}
34  CrdBidOffs( const Coord& c, int nr, float o=0 )
35  : coord_(c), binid_(1,nr), offset_(o) {}
36  CrdBidOffs( const Coord& c, const BinID& b, float o=0 )
37  : coord_(c), binid_(b), offset_(o) {}
38  bool operator ==( const CrdBidOffs& cbo ) const
39  { return binid_ == cbo.binid_
40  && mIsEqual(offset_,cbo.offset_,mDefEps); }
41 
44  float offset_;
45  float azimuth_;
46 };
47 
48 
54 { mODTextTranslationClass(Detector);
55 public:
56 
57  struct Setup
58  {
59  Setup( bool istwod )
60  : is2d_(istwod), isps_(false)
61  , reqsorting_(false) {}
62  mDefSetupMemb(bool,is2d)
63  mDefSetupMemb(bool,isps)
64  mDefSetupMemb(bool,reqsorting)
65  };
66 
67  Detector(const Setup&);
68  Detector(const Detector&);
69  Detector& operator =(const Detector&);
70  ~Detector();
71 
72  bool is2D() const { return setup_.is2d_; }
73  bool isPS() const { return setup_.isps_; }
74  void reInit();
75 
76  bool add(const Coord&,const BinID&);
77  bool add(const Coord&,const BinID&,float offs);
78  bool add(const Coord&,int nr);
79  bool add(const Coord&,int nr,float offs);
80  bool add(const Coord&,const BinID&,int nr,float offs);
81  bool add(const Coord&,const BinID&,int nr,
82  float offs,float azi);
83  bool add(const CrdBidOffs&);
84 
85 
86  bool finish();
87  bool usable() const { return errmsg_.isEmpty(); }
88  uiString errMsg() const { return errmsg_; }
89  void appendResults(const Detector&); // after finish only
90  void mergeResults(const Detector&); // after finish only
91 
92  int nrPositions( bool uniq=true ) const
93  { return uniq ? nruniquepos_ : nrpos_; }
94 
95  // available after finish()
96  Coord minCoord() const { return mincoord_; }
97  Coord maxCoord() const { return maxcoord_; }
98  BinID start() const { return start_; }
99  BinID stop() const { return stop_; }
100  BinID step() const { return step_; }
101  void getTrcKeySampling(TrcKeySampling&) const;
102  Interval<float> offsRg() const { return offsrg_; }
103  Interval<float> azimuthRg() const { return azimuthrg_; }
104  float avgDist() const { return avgdist_; }
105  CrdBidOffs firstPosition() const { return userCBO(firstcbo_); }
106  CrdBidOffs lastPosition() const { return userCBO(lastcbo_); }
107  bool haveGaps( bool inldir=false ) const
108  { return inldir ? inlirreg_ : crlirreg_; }
109 
110  void report(IOPar&) const;
111 
112  const BinIDSorting& sorting() const { return sorting_; }
113  bool inlSorted() const;
114  bool crlSorted() const;
115  void getCubeData(CubeData&) const;
117  const char* getSurvInfo(TrcKeySampling&,Coord crd[3]) const;
118 
119  StepInterval<int> getRange(bool inldir=false) const;
120  bool haveStep(bool) const; // to check during detection
121 
122 protected:
123 
128  int nrpos_;
134  bool allstd_;
138  bool inlirreg_, crlirreg_;
140  float avgdist_;
147 
150  int curline_;
151  int curseg_;
159 
160  bool applySortAnal();
161  void addFirst(const PosInfo::CrdBidOffs&);
162  bool addNext(const PosInfo::CrdBidOffs&);
163  void addLine();
164  void addPos();
165  void setCur(const PosInfo::CrdBidOffs&);
166  void getBinIDRanges();
167  int getStep(bool inl) const;
168  int getRawStep(bool,bool) const;
169  uiString createPositionString(const CrdBidOffs&) const;
170 
171  CrdBidOffs workCBO(const CrdBidOffs&) const;
172  CrdBidOffs userCBO(const CrdBidOffs&) const;
173 
174 };
175 
176 
177 } // namespace PosInfo
178 
179 #endif
int curseg_
Definition: posinfodetector.h:151
#define mExpClass(module)
Definition: commondefs.h:160
TypeSet< CrdBidOffs > cbobuf_
Definition: posinfodetector.h:149
int nroffsthispos_
Definition: posinfodetector.h:157
Setup(bool istwod)
Definition: posinfodetector.h:59
BinID start() const
Definition: posinfodetector.h:98
Coord minCoord() const
Definition: posinfodetector.h:96
BinIDSortingAnalyser * sortanal_
Definition: posinfodetector.h:148
CrdBidOffs curcbo_
Definition: posinfodetector.h:152
bool operator==(const ArrayNDInfo &a1, const ArrayNDInfo &a2)
Definition: arrayndinfo.h:53
CrdBidOffs prevcbo_
Definition: posinfodetector.h:153
CrdBidOffs curlnstart_
Definition: posinfodetector.h:156
#define mODTextTranslationClass(clss)
Definition: uistring.h:38
BinID sorting parameters.
Definition: binidsorting.h:27
Coord mincoord_
Definition: posinfodetector.h:129
Interval< float > distrg_
2D
Definition: posinfodetector.h:139
Interval< float > offsrg_
Definition: posinfodetector.h:131
CrdBidOffs curusrcbo_
Definition: posinfodetector.h:154
BinID start_
Definition: posinfodetector.h:135
RowCol step_
Definition: horizontracker.h:141
Coord maxcoord_
Definition: posinfodetector.h:130
Definition: uistring.h:89
A cartesian coordinate in 2D space.
Definition: coord.h:25
Coord coord_
Definition: posinfodetector.h:42
const BinIDSorting & sorting() const
Definition: posinfodetector.h:112
float avgdist_
2D
Definition: posinfodetector.h:140
bool is2D() const
Definition: posinfodetector.h:72
CrdBidOffs firstduppos_
Definition: posinfodetector.h:145
int nrpos_
Definition: posinfodetector.h:128
CrdBidOffs firstPosition() const
Definition: posinfodetector.h:105
BinID step() const
Definition: posinfodetector.h:100
#define mIsEqual(x, y, eps)
Definition: commondefs.h:54
BinID stop_
Definition: posinfodetector.h:136
Coord maxCoord() const
Definition: posinfodetector.h:97
CrdBidOffs lastcbo_
Definition: posinfodetector.h:142
CrdBidOffs lastPosition() const
Definition: posinfodetector.h:106
Set of (small) copyable elements.
Definition: commontypes.h:30
bool inlirreg_
Definition: posinfodetector.h:138
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:47
bool usable() const
Definition: posinfodetector.h:87
Horizontal sampling (inline and crossline range and steps).
Definition: trckeysampling.h:27
Just hold inl, crl, x, y and offs. For 2D, crl=nr.
Definition: posinfodetector.h:29
Interval< float > azimuthRg() const
Definition: posinfodetector.h:103
CrdBidOffs llnstop_
in 3D, of longest line
Definition: posinfodetector.h:144
int nroffsperpos_
Definition: posinfodetector.h:132
uiString errmsg_
Definition: posinfodetector.h:158
#define mDefSetupMemb(typ, memb)
Definition: commondefs.h:137
float offset_
Definition: posinfodetector.h:44
CrdBidOffs llnstart_
in 3D, of longest line
Definition: posinfodetector.h:143
ObjectSet< LineData > lds_
Definition: posinfodetector.h:126
CrdBidOffs(const Coord &c, int nr, float o=0)
Definition: posinfodetector.h:34
int nrPositions(bool uniq=true) const
Definition: posinfodetector.h:92
#define mDefEps
Definition: commondefs.h:58
BinID stop() const
Definition: posinfodetector.h:99
Analyses whether input BinIDs are sorted.
Definition: binidsorting.h:68
Position info, often segmented.
Definition: posinfo.h:40
bool allstd_
Definition: posinfodetector.h:134
bool isEmpty() const
Definition: odstring.h:51
CrdBidOffs firstaltnroffs_
Definition: posinfodetector.h:146
CrdBidOffs prevusrcbo_
Definition: posinfodetector.h:155
BinID binid_
Definition: posinfodetector.h:43
Positioning in a seismic survey: inline/crossline or lineNr/trcNr.
Definition: binid.h:30
BinIDSorting & sorting_
Definition: posinfodetector.h:125
BufferString errmsg_
Definition: horizontracker.h:119
bool isPS() const
Definition: posinfodetector.h:73
Determines many geometry parameters from a series of Coords with corresponding BinID or trace numbers...
Definition: posinfodetector.h:53
CrdBidOffs()
Definition: posinfodetector.h:32
int curline_
Definition: posinfodetector.h:150
CrdBidOffs(const Coord &c, const BinID &b, float o=0)
Definition: posinfodetector.h:36
Interval< float > azimuthrg_
Definition: posinfodetector.h:133
bool haveGaps(bool inldir=false) const
Definition: posinfodetector.h:107
BinID step_
Definition: posinfodetector.h:137
CrdBidOffs firstcbo_
Definition: posinfodetector.h:141
int nruniquepos_
Definition: posinfodetector.h:127
Setup setup_
Definition: posinfodetector.h:124
Position info for an entire 3D cube. The LineData&#39;s are not sorted.
Definition: posinfo.h:95
float azimuth_
Definition: posinfodetector.h:45
Interval< float > offsRg() const
Definition: posinfodetector.h:102
uiString errMsg() const
Definition: posinfodetector.h:88
Definition: posinfodetector.h:57
float avgDist() const
Definition: posinfodetector.h:104

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