OpendTect  6.3
trckeyzsampling.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: Feb 2002
9 ________________________________________________________________________
10 
11 -*/
12 
13 #include "basicmod.h"
14 #include "trckeysampling.h"
15 
16 
33 {
34 public:
35 
36  TrcKeyZSampling();
37  TrcKeyZSampling(const TrcKeyZSampling&);
38  TrcKeyZSampling(bool settoSI);
39 
40  bool is2D() const { return hsamp_.is2D(); }
41 
42  enum Dir { Inl=0, Crl=1, Z=2 };
43  Dir defaultDir() const;
46  void getDefaultNormal(Coord3&) const;
47  bool isFlat() const;
48 
49  void init(bool settoSI=true);
51  inline void setEmpty() { init(false); }
52  void set2DDef();
54  void normalise();
56 
59 
60  int lineIdx(Pos::LineID) const;
61  int trcIdx(Pos::TraceID) const;
62  int zIdx(float z) const;
63  int nrLines() const;
64  int nrTrcs() const;
65  int nrZ() const;
66  od_int64 totalNr() const;
67  int size(Dir d) const;
68  float zAtIndex( int idx ) const;
69  bool isEmpty() const;
70  bool isDefined() const;
71  bool includes(const TrcKeyZSampling&) const;
72  bool getIntersection(const TrcKeyZSampling&,
73  TrcKeyZSampling&) const;
75  void include(const TrcKey&,float z);
76  void include(const TrcKeyZSampling&);
77  void limitTo(const TrcKeyZSampling&,bool ignoresteps=false);
78  void limitToWithUdf(const TrcKeyZSampling&);
81  void shrinkTo(const TrcKeyZSampling& innertkzs,
82  float releps=1e-4);
86  void growTo(const TrcKeyZSampling& outertkzs,
87  float releps=1e-4);
90  bool adjustTo(const TrcKeyZSampling& availabletkzs,
91  bool falsereturnsdummy=false);
95  bool makeCompatibleWith(const TrcKeyZSampling& othertkzs);
98  void expand(int nrlines,int nrtrcs,int nrz);
99 
100  void snapToSurvey();
104  bool isEqual(const TrcKeyZSampling&,
105  float zeps=mUdf(float)) const;
106 
107  bool operator==(const TrcKeyZSampling&) const;
108  bool operator!=(const TrcKeyZSampling&) const;
109  TrcKeyZSampling& operator=(const TrcKeyZSampling&);
110 
111  bool usePar(const IOPar&);
112  void fillPar(IOPar&) const;
113  static void removeInfo(IOPar&);
114 
115 //Legacy, don't use
116  inline int inlIdx( int inl ) const { return lineIdx(inl); }
117  inline int crlIdx( int crl ) const { return trcIdx(crl); }
118  void include(const BinID& bid,float z);
119 
120  inline int nrInl() const { return nrLines(); }
121  inline int nrCrl() const { return nrTrcs(); }
122 
125 };
126 
127 
128 
130 {
131  if ( dimnr == 0 )
132  return slctype;
133  else if ( dimnr == 1 )
134  return slctype == TrcKeyZSampling::Inl ? TrcKeyZSampling::Crl
136  else
137  return slctype == TrcKeyZSampling::Z
140 }
141 
142 
143 inline int dimension( TrcKeyZSampling::Dir slctype,
145 {
146  if ( slctype == direction )
147  return 0;
148 
149  else if ( direction == TrcKeyZSampling::Z )
150  return 2;
151  else if ( direction == TrcKeyZSampling::Inl )
152  return 1;
153 
154  return slctype == TrcKeyZSampling::Z ? 2 : 1;
155 }
156 
157 
158 typedef TrcKeyZSampling CubeSampling;
#define mExpClass(module)
Definition: commondefs.h:157
Index_Type LineID
Definition: commontypes.h:46
ZSampling zsamp_
Definition: trckeyzsampling.h:58
bool operator==(const ArrayNDInfo &a1, const ArrayNDInfo &a2)
Definition: arrayndinfo.h:51
Index_Type TraceID
Definition: commontypes.h:47
void usePar(const IOPar &iop, ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:200
#define od_int64
Definition: plftypes.h:34
bool init()
Definition: trckeyzsampling.h:42
Definition: trckeyzsampling.h:42
int crlIdx(int crl) const
Definition: trckeyzsampling.h:117
int inlIdx(int inl) const
Definition: trckeyzsampling.h:116
Definition: trckeyzsampling.h:42
3D point or vector
Definition: commontypes.h:57
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:53
Horizontal sampling (inline and crossline range and steps).
Definition: trckeysampling.h:25
TrcKeySampling & hrg
Definition: trckeyzsampling.h:123
ZSampling & zrg
Definition: trckeyzsampling.h:124
#define mUdf(type)
Use this macro to get the undefined for simple types.
Definition: undefval.h:270
Hor+Vert sampling in 3D surveys.
Definition: trckeyzsampling.h:32
void setEmpty()
Definition: trckeyzsampling.h:51
Dir
Definition: trckeyzsampling.h:42
bool operator!=(const ArrayNDInfo &a1, const ArrayNDInfo &a2)
Definition: arrayndinfo.h:60
void fillPar(IOPar &iop, const ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:187
bool is2D() const
Definition: trckeyzsampling.h:40
int nrInl() const
Definition: trckeyzsampling.h:120
#define mDeprecated
Definition: plfdefs.h:213
bool isEmpty(const char *)
int dimension(TrcKeyZSampling::Dir slctype, TrcKeyZSampling::Dir direction)
Definition: trckeyzsampling.h:143
Positioning in a seismic survey: inline/crossline or lineNr/trcNr.
Definition: binid.h:28
int nrCrl() const
Definition: trckeyzsampling.h:121
TrcKeyZSampling::Dir direction(TrcKeyZSampling::Dir slctype, int dimnr)
Definition: trckeyzsampling.h:129
Represents a unique trace position in one of the surveys that OpendTect is managing.
Definition: trckey.h:26
TrcKeyZSampling CubeSampling
Definition: trckeyzsampling.h:158
TrcKeySampling hsamp_
Definition: trckeyzsampling.h:57

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