OpendTect  6.3
trckey.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: Kris/Bert/Salil
8  Date: 2013
9 ________________________________________________________________________
10 
11 -*/
12 
13 #include "basicmod.h"
14 #include "binid.h"
15 
27 {
28 public:
29 
32 
33  TrcKey() { *this = udf(); }
34 
35  //3D
36  TrcKey(const BinID&); // default 3D surv ID
37  TrcKey(SurvID,const BinID&);
38 
39  //2D
40  TrcKey(Pos::GeomID,Pos::TraceID);
41 
42  // Synthetic
43  static TrcKey getSynth(Pos::TraceID);
44 
45  bool is2D() const { return is2D(survid_); }
46  static bool is2D(SurvID);
47 
48  inline bool hasValidGeomID() const
49  { return survid_ != cUndefSurvID(); }
51  Pos::GeomID geomID() const;
52  static Pos::GeomID geomID(SurvID,const BinID&);
53  TrcKey& setGeomID(Pos::GeomID);
54 
55  bool operator==(const TrcKey&) const;
56  bool operator!=(const TrcKey& oth) const
57  { return !(*this == oth); }
58 
59  inline bool isUdf() const { return *this==udf(); }
60  static const TrcKey& udf();
61  static SurvID std2DSurvID();
62  static SurvID std3DSurvID();
63  static SurvID stdSynthSurvID();
64  static SurvID cUndefSurvID();
65 
66  float distTo(const TrcKey&) const;
67  SurvID survID() const { return survid_; }
68  inline TrcKey& setSurvID( SurvID id )
69  { survid_ = id; return *this; }
70 
71  const BinID& position() const { return pos_; }
72  IdxType lineNr() const { return pos_.row(); }
73  IdxType trcNr() const { return pos_.col(); }
74  const BinID& binID() const { return position(); }
75  IdxType inl() const { return lineNr(); }
76  IdxType crl() const { return trcNr(); }
77  inline TrcKey& setPosition( const BinID& bid )
78  { pos_ = bid; return *this; }
79  inline TrcKey& setLineNr( IdxType nr )
80  { pos_.row() = nr; return *this; }
81  inline TrcKey& setTrcNr( IdxType nr )
82  { pos_.col() = nr; return *this; }
83  inline TrcKey& setBinID( const BinID& bid )
84  { return setPosition(bid); }
85  inline TrcKey& setInl( IdxType nr )
86  { return setLineNr(nr); }
87  inline TrcKey& setCrl( IdxType nr )
88  { return setTrcNr(nr); }
89 
90  TrcKey& setFrom(const Coord&);
91  Coord getCoord() const;
92 
93 private:
94 
95  SurvID survid_;
97 
98 };
#define mExpClass(module)
Definition: commondefs.h:157
IdxType inl() const
Definition: trckey.h:75
TrcKey & setBinID(const BinID &bid)
Definition: trckey.h:83
bool operator==(const ArrayNDInfo &a1, const ArrayNDInfo &a2)
Definition: arrayndinfo.h:51
Index_Type TraceID
Definition: commontypes.h:47
bool is2D(GeomType gt)
Definition: seistype.h:32
IdxType lineNr() const
Definition: trckey.h:72
bool operator!=(const TrcKey &oth) const
Definition: trckey.h:56
TrcKey & setCrl(IdxType nr)
Definition: trckey.h:87
Pos::SurvID SurvID
Definition: trckey.h:30
const BinID & binID() const
Definition: trckey.h:74
SurvID survID() const
Definition: trckey.h:67
Index_Type SurvID
Definition: commontypes.h:45
TrcKey & setPosition(const BinID &bid)
Definition: trckey.h:77
TrcKey & setInl(IdxType nr)
Definition: trckey.h:85
Index_Type GeomID
Definition: commontypes.h:48
const BinID & position() const
Definition: trckey.h:71
IdxType crl() const
Definition: trckey.h:76
TrcKey & setTrcNr(IdxType nr)
Definition: trckey.h:81
Index_Type IdxType
Definition: idxpair.h:32
Positioning in a seismic survey: inline/crossline or lineNr/trcNr.
Definition: binid.h:28
bool isUdf() const
Definition: trckey.h:59
BinID pos_
Definition: trckey.h:96
IdxType trcNr() const
Definition: trckey.h:73
bool is2D() const
Definition: trckey.h:45
Represents a unique trace position in one of the surveys that OpendTect is managing.
Definition: trckey.h:26
2D point or vector class.
Definition: commontypes.h:58
TrcKey & setLineNr(IdxType nr)
Definition: trckey.h:79
SurvID survid_
Definition: trckey.h:95
IdxPair::IdxType IdxType
Definition: trckey.h:31
TrcKey & setSurvID(SurvID id)
Definition: trckey.h:68
bool hasValidGeomID() const
mind you, not 'hasExistingGeomID' ...
Definition: trckey.h:48
TrcKey()
Definition: trckey.h:33

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