OpendTect-6_4  6.4
trckeyzsampling.h
Go to the documentation of this file.
1 #ifndef trckeyzsampling_h
2 #define trckeyzsampling_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: Bert
9  Date: Feb 2002
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 -*/
14 
15 #include "basicmod.h"
16 #include "trckeysampling.h"
17 #include "enums.h"
18 
19 
36 {
37 public:
38 
39  TrcKeyZSampling();
40  TrcKeyZSampling(const TrcKeyZSampling&);
41  TrcKeyZSampling(bool settoSI);
42 
43  enum Dir { Inl=0, Crl=1, Z=2 };
45  bool is2D() const { return hsamp_.is2D(); }
46  Dir defaultDir() const;
49  void getDefaultNormal(Coord3&) const;
50  bool isFlat() const;
51 
52  void init(bool settoSI=true);
54  inline void setEmpty() { init(false); }
55  void set2DDef();
57  void normalise();
59 
62 
63  int lineIdx(Pos::LineID) const;
64  int trcIdx(Pos::TraceID) const;
65  int zIdx(float z) const;
66  int nrLines() const;
67  int nrTrcs() const;
68  int nrZ() const;
69  od_int64 totalNr() const;
70  int size(Dir d) const;
71  float zAtIndex( int idx ) const;
72  bool isEmpty() const;
73  bool isDefined() const;
74  bool includes(const TrcKeyZSampling&) const;
75  bool getIntersection(const TrcKeyZSampling&,
76  TrcKeyZSampling&) const;
78  void include(const TrcKey&,float z);
79  void include(const TrcKeyZSampling&);
80  void limitTo(const TrcKeyZSampling&,bool ignoresteps=false);
81  void limitToWithUdf(const TrcKeyZSampling&);
84  void expand(int nrlines,int nrtrcs,int nrz);
85 
86  void snapToSurvey();
90  bool operator==(const TrcKeyZSampling&) const;
91  bool operator!=(const TrcKeyZSampling&) const;
92  TrcKeyZSampling& operator=(const TrcKeyZSampling&);
93 
94  bool usePar(const IOPar&);
95  void fillPar(IOPar&) const;
96  static void removeInfo(IOPar&);
97 
98 //Legacy, don't use
99  inline int inlIdx( int inl ) const { return lineIdx(inl); }
100  inline int crlIdx( int crl ) const { return trcIdx(crl); }
101  void include(const BinID& bid,float z);
102 
103  inline int nrInl() const { return nrLines(); }
104  inline int nrCrl() const { return nrTrcs(); }
105 
108 
109  void shrinkTo(const TrcKeyZSampling& innertkzs,
110  float releps=1e-4);
114  void growTo(const TrcKeyZSampling& outertkzs,
115  float releps=1e-4);
118  bool adjustTo(const TrcKeyZSampling& availabletkzs,
119  bool falsereturnsdummy=false);
123  bool makeCompatibleWith(const TrcKeyZSampling& othertkzs);
127  bool isEqual(const TrcKeyZSampling&,
128  float zeps=mUdf(float)) const;
129 };
130 
131 
132 
133 mExpClass(Basic) TrcKeyZSamplingSet : public TypeSet<TrcKeyZSampling>
134 {
135 
136 };
137 
138 
140 {
141  if ( dimnr == 0 )
142  return slctype;
143  else if ( dimnr == 1 )
144  return slctype == TrcKeyZSampling::Inl ? TrcKeyZSampling::Crl
146  else
147  return slctype == TrcKeyZSampling::Z
150 }
151 
152 
153 inline int dimension( TrcKeyZSampling::Dir slctype,
155 {
156  if ( slctype == direction )
157  return 0;
158 
159  else if ( direction == TrcKeyZSampling::Z )
160  return 2;
161  else if ( direction == TrcKeyZSampling::Inl )
162  return 1;
163 
164  return slctype == TrcKeyZSampling::Z ? 2 : 1;
165 }
166 
167 
168 typedef TrcKeyZSampling CubeSampling;
169 
170 
171 #endif
#define mExpClass(module)
Definition: commondefs.h:160
Index_Type LineID
Definition: commontypes.h:50
bool operator==(const ArrayNDInfo &a1, const ArrayNDInfo &a2)
Definition: arrayndinfo.h:53
Index_Type TraceID
Definition: commontypes.h:51
StepInterval< float > & zrg
Definition: trckeyzsampling.h:107
void usePar(const IOPar &iop, ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:188
#define od_int64
Definition: plftypes.h:36
bool init()
Definition: trckeyzsampling.h:43
Definition: trckeyzsampling.h:43
Definition: trckeyzsampling.h:133
#define mDeclareEnumUtils(enm)
Some utilities surrounding the often needed enum <-> string table.
Definition: enums.h:258
int crlIdx(int crl) const
Definition: trckeyzsampling.h:100
int inlIdx(int inl) const
Definition: trckeyzsampling.h:99
Definition: trckeyzsampling.h:43
Set of (small) copyable elements.
Definition: commontypes.h:30
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:47
Horizontal sampling (inline and crossline range and steps).
Definition: trckeysampling.h:27
TrcKeySampling & hrg
Definition: trckeyzsampling.h:106
#define mUdf(type)
Use this macro to get the undefined for simple types.
Definition: undefval.h:272
Hor+Vert sampling in 3D surveys.
Definition: trckeyzsampling.h:35
void setEmpty()
Definition: trckeyzsampling.h:54
Dir
Definition: trckeyzsampling.h:43
bool operator!=(const ArrayNDInfo &a1, const ArrayNDInfo &a2)
Definition: arrayndinfo.h:62
void fillPar(IOPar &iop, const ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:175
bool is2D() const
Definition: trckeyzsampling.h:45
A cartesian coordinate in 3D space.
Definition: coord.h:72
int nrInl() const
Definition: trckeyzsampling.h:103
StepInterval< float > zsamp_
Definition: trckeyzsampling.h:61
#define mDeprecated
Definition: plfdefs.h:233
int dimension(TrcKeyZSampling::Dir slctype, TrcKeyZSampling::Dir direction)
Definition: trckeyzsampling.h:153
Positioning in a seismic survey: inline/crossline or lineNr/trcNr.
Definition: binid.h:30
int nrCrl() const
Definition: trckeyzsampling.h:104
TrcKeyZSampling::Dir direction(TrcKeyZSampling::Dir slctype, int dimnr)
Definition: trckeyzsampling.h:139
Represents a unique trace position in one of the surveys that OpendTect is managing.
Definition: trckey.h:28
bool isEmpty(const NLAModel *mdl)
TrcKeyZSampling CubeSampling
Definition: trckeyzsampling.h:168
TrcKeySampling hsamp_
Definition: trckeyzsampling.h:60

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