OpendTect  6.6
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  RCS: $Id$
10 ________________________________________________________________________
11 
12 -*/
13 
14 #include "basicmod.h"
15 #include "trckeysampling.h"
16 #include "enums.h"
17 
18 
35 {
36 public:
37 
40  TrcKeyZSampling(bool settoSI);
41 
42  enum Dir { Inl=0, Crl=1, Z=2 };
44  bool is2D() const { return hsamp_.is2D(); }
45  Dir defaultDir() const;
48  void getDefaultNormal(Coord3&) const;
49  bool isFlat() const;
50 
51  void init(bool settoSI=true);
53  inline void setEmpty() { init(false); }
54  void set2DDef();
56  void normalize();
58  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;
76  TrcKeyZSampling&) const;
78  void include(const TrcKey&,float z);
79  void include(const TrcKeyZSampling&);
80  void limitTo(const TrcKeyZSampling&,bool ignoresteps=false);
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;
93 
94  bool usePar(const IOPar&);
95  void fillPar(IOPar&) const;
96  static void removeInfo(IOPar&);
97  void fillJSON(OD::JSON::Object&) const;
98  bool useJSON(const OD::JSON::Object&);
99 
100 //Legacy, don't use
101  inline int inlIdx( int inl ) const { return lineIdx(inl); }
102  inline int crlIdx( int crl ) const { return trcIdx(crl); }
103  void include(const BinID& bid,float z);
104 
105  inline int nrInl() const { return nrLines(); }
106  inline int nrCrl() const { return nrTrcs(); }
107 
108  mDeprecated("Use hsamp_ instead") TrcKeySampling& hrg;
109  mDeprecated("Use zsamp_ instead") StepInterval<float>& zrg;
110 
111  void shrinkTo(const TrcKeyZSampling& innertkzs,
112  float releps=1e-4);
116  void growTo(const TrcKeyZSampling& outertkzs,
117  float releps=1e-4);
120  bool adjustTo(const TrcKeyZSampling& availabletkzs,
121  bool falsereturnsdummy=false);
125  bool makeCompatibleWith(const TrcKeyZSampling& othertkzs);
129  bool isEqual(const TrcKeyZSampling&,
130  float zeps=mUdf(float)) const;
131 };
132 
133 
134 
136 {
137 
138 };
139 
140 
142 {
143  if ( dimnr == 0 )
144  return slctype;
145  else if ( dimnr == 1 )
146  return slctype == TrcKeyZSampling::Inl ? TrcKeyZSampling::Crl
148  else
149  return slctype == TrcKeyZSampling::Z
152 }
153 
154 
155 inline int dimension( TrcKeyZSampling::Dir slctype,
157 {
158  if ( slctype == direction )
159  return 0;
160 
161  else if ( direction == TrcKeyZSampling::Z )
162  return 2;
163  else if ( direction == TrcKeyZSampling::Inl )
164  return 1;
165 
166  return slctype == TrcKeyZSampling::Z ? 2 : 1;
167 }
168 
169 
171 
172 namespace Pos
173 {
174 
176  const StepInterval<int>&,
179  const StepInterval<float>&,
181 
182 }
183 
sKey::Z
FixedString Z()
Definition: keystrs.h:200
TrcKeySampling
Horizontal sampling (inline and crossline range and steps).
Definition: trckeysampling.h:35
Coord3
A cartesian coordinate in 3D space.
Definition: coord.h:72
TrcKeyZSampling::nrTrcs
int nrTrcs() const
Strat::init
void init()
TrcKeyZSampling::Inl
@ Inl
Definition: trckeyzsampling.h:42
TrcKeyZSampling::hsamp_
TrcKeySampling hsamp_
Definition: trckeyzsampling.h:60
TrcKeyZSamplingSet
Definition: trckeyzsampling.h:136
TrcKeyZSampling::trcIdx
int trcIdx(Pos::TraceID) const
Pos
Position.
Definition: commontypes.h:78
TrcKeyZSampling::limitToWithUdf
void limitToWithUdf(const TrcKeyZSampling &)
mGlobal
#define mGlobal(module)
Definition: commondefs.h:180
TrcKeyZSampling::removeInfo
static void removeInfo(IOPar &)
TrcKeyZSampling::include
void include(const BinID &bid, float z)
TrcKeyZSampling::usePar
bool usePar(const IOPar &)
TrcKeyZSampling::isFlat
bool isFlat() const
is one of directions size 1?
TrcKeyZSampling::crlIdx
int crlIdx(int crl) const
Definition: trckeyzsampling.h:102
TrcKeyZSampling::normalize
void normalize()
Makes sure start<stop and steps are non-zero.
direction
TrcKeyZSampling::Dir direction(TrcKeyZSampling::Dir slctype, int dimnr)
Definition: trckeyzsampling.h:141
od_int64
#define od_int64
Definition: plftypes.h:35
mExpClass
#define mExpClass(module)
Definition: commondefs.h:177
TrcKeyZSampling::Crl
@ Crl
Definition: trckeyzsampling.h:42
TrcKeyZSampling::snapToSurvey
void snapToSurvey()
mDeclareEnumUtils
#define mDeclareEnumUtils(enm)
Some utilities surrounding the often needed enum <-> string table.
Definition: enums.h:257
TrcKeyZSampling::nrLines
int nrLines() const
TrcKeyZSampling::TrcKeyZSampling
TrcKeyZSampling()
TrcKeyZSampling::size
int size(Dir d) const
TrcKeyZSampling::lineIdx
int lineIdx(Pos::LineID) const
TrcKeyZSampling::defaultDir
Dir defaultDir() const
TrcKeyZSampling
Hor+Vert sampling in 3D surveys.
Definition: trckeyzsampling.h:35
Pos::LineID
Index_Type LineID
Definition: commontypes.h:85
TrcKeyZSampling::zsamp_
StepInterval< float > zsamp_
Definition: trckeyzsampling.h:61
TrcKeyZSampling::Dir
Dir
Definition: trckeyzsampling.h:42
TrcKeyZSampling::nrInl
int nrInl() const
Definition: trckeyzsampling.h:105
BinID
Positioning in a seismic survey: inline/crossline or lineNr/trcNr.
Definition: binid.h:31
StepInterval< float >
dimension
int dimension(TrcKeyZSampling::Dir slctype, TrcKeyZSampling::Dir direction)
Definition: trckeyzsampling.h:155
TrcKeyZSampling::isDefined
bool isDefined() const
TrcKeyZSampling::operator=
TrcKeyZSampling & operator=(const TrcKeyZSampling &)
Pos::TraceID
Index_Type TraceID
Definition: commontypes.h:86
TrcKeyZSampling::normalise
void normalise()
TrcKeyZSampling::Z
@ Z
Definition: trckeyzsampling.h:42
TrcKeyZSampling::init
void init(bool settoSI=true)
Sets hrg_.init and zrg_ to survey values or zeros.
TrcKeyZSampling::isEmpty
bool isEmpty() const
TrcKeyZSampling::set2DDef
void set2DDef()
Sets to survey zrange and.
TrcKeyZSampling::nrZ
int nrZ() const
TrcKeyZSampling::operator!=
bool operator!=(const TrcKeyZSampling &) const
TrcKeyZSampling::fillJSON
void fillJSON(OD::JSON::Object &) const
mDeprecated
#define mDeprecated(msg)
Definition: plfdefs.h:215
CubeSampling
TrcKeyZSampling CubeSampling
Definition: trckeyzsampling.h:170
TrcKeyZSampling::TrcKeyZSampling
TrcKeyZSampling(const TrcKeyZSampling &)
TrcKeyZSampling::operator==
bool operator==(const TrcKeyZSampling &) const
TrcKeyZSampling::getDefaultNormal
void getDefaultNormal(Coord3 &) const
TrcKeyZSampling::setEmpty
void setEmpty()
Definition: trckeyzsampling.h:53
TrcKeyZSampling::getIntersection
bool getIntersection(const TrcKeyZSampling &, TrcKeyZSampling &) const
Returns false if intersection is empty.
TrcKeyZSampling::expand
void expand(int nrlines, int nrtrcs, int nrz)
TrcKeyZSampling::limitTo
void limitTo(const TrcKeyZSampling &, bool ignoresteps=false)
TrcKeyZSampling::zAtIndex
float zAtIndex(int idx) const
TrcKeyZSampling::fillPar
void fillPar(IOPar &) const
TrcKeyZSampling::include
void include(const TrcKeyZSampling &)
TrcKey
Represents a unique trace position in one of the surveys that OpendTect is managing.
Definition: trckey.h:28
TrcKeyZSampling::inlIdx
int inlIdx(int inl) const
Definition: trckeyzsampling.h:101
TrcKeyZSampling::include
void include(const TrcKey &, float z)
enums.h
Pos::intersectF
bool intersectF(const StepInterval< float > &, const StepInterval< float > &, StepInterval< float > &)
TrcKeyZSampling::zIdx
int zIdx(float z) const
mUdf
#define mUdf(type)
Use this macro to get the undefined for simple types.
Definition: undefval.h:274
Pick::is2D
bool is2D(const PicksType &picks)
ObjectSet of Pick::Location's. Does not manage.
Definition: pickset.h:163
trckeysampling.h
TrcKeyZSampling::totalNr
int64_t totalNr() const
TrcKeyZSampling::useJSON
bool useJSON(const OD::JSON::Object &)
TrcKeyZSampling::includes
bool includes(const TrcKeyZSampling &) const
IOPar
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:55
OD::JSON::Object
ValueSet where the values and subsets have a key.
Definition: odjson.h:283
TrcKeyZSampling::TrcKeyZSampling
TrcKeyZSampling(bool settoSI)
Pos::intersect
bool intersect(const StepInterval< int > &, const StepInterval< int > &, StepInterval< int > &)
TypeSet
Sets of (small) copyable elements.
Definition: commontypes.h:29
TrcKeyZSampling::nrCrl
int nrCrl() const
Definition: trckeyzsampling.h:106

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