OpendTect  6.3
picklocation.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: May 2001 / Mar 2016
9 ________________________________________________________________________
10 
11 -*/
12 
13 #include "generalmod.h"
14 #include "coord.h"
15 class TrcKey;
16 class Sphere;
17 
18 
19 namespace Pick
20 {
21 
45 {
46 public:
47  Location();
48  Location(double x,double y,double z=0);
49  Location(const Coord&,float z=0);
50  Location(const Coord3&);
51  Location(const Coord3& pos,const Coord3& dir);
52  Location(const Coord3& pos,const Sphere& dir);
53  Location(const Location&);
54  ~Location();
55 
56  bool operator ==(const Location&) const;
57  inline bool operator !=( const Location& oth ) const
58  { return !(*this == oth); }
59  Location& operator =(const Location&);
60 
61  inline bool hasPos() const { return pos_.isDefined(); }
62  bool hasTrcKey() const;
63  bool hasDir() const;
64  bool hasText() const;
65 
66  inline const Coord3& pos() const { return pos_; }
67  inline float z() const { return (float)pos_.z_; }
68  bool is2D() const;
69  Pos::SurvID survID() const;
70  Pos::GeomID geomID() const;
71  const TrcKey& trcKey() const;
72  Pos::LineID lineNr() const;
73  Pos::TraceID trcNr() const;
74  const BinID& binID() const;
75  const Sphere& dir() const;
76  const BufferString& text() const;
77 
78  inline Location& setPos( const Coord3& c )
79  { pos_ = c; return *this; }
80  inline Location& setPos( const Coord& c )
81  { pos_.x_ = c.x_; pos_.y_ = c.y_; return *this; }
82  inline Location& setPos( double x, double y, double zval )
83  { setPos( Coord3(x,y,zval) ); return *this; }
84  inline Location& setPos( const Coord& c, float zval )
85  { setPos( c.x_, c.y_, zval ); return *this; }
86  template <class FT>
87  inline Location& setZ( FT zval )
88  { pos_.z_ = zval; return *this; }
89 
90  Location& setTrcKey(const TrcKey&);
91  Location& setDir(const Sphere&);
92  Location& setDir(const Coord&);
93  Location& setLineNr(Pos::LineID);
94  Location& setTrcNr(Pos::LineID);
95  Location& setGeomID(Pos::GeomID);
96  Location& setBinID(const BinID&,bool updcoord=false);
97  Location& setSurvID(Pos::SurvID,bool updfromcoord=true);
98 
99  bool hasTextKey(const char* key) const;
100  bool getKeyedText(const char* key,BufferString&) const;
101  void setKeyedText(const char* key,const char* txt);
102  void removeTextKey(const char* key);
103  Location& setText(const char*);
105 
106  bool fromString(const char*);
107  void toString(BufferString&,bool forexport=false) const;
108 
109  static const Location& udf();
110  static Location& dummy();
111  bool isUdf() const { return *this == udf(); }
112 
113 protected:
114 
119 
120  void setTK(const TrcKey*);
121  void setD(const Sphere*);
122  bool fndKeyTxt(const char*,BufferString*) const;
123 
124 };
125 
126 
127 } // namespace Pick
#define mExpClass(module)
Definition: commondefs.h:157
bool isUdf() const
Definition: picklocation.h:111
Location & setPos(const Coord &c, float zval)
Definition: picklocation.h:84
Index_Type LineID
Definition: commontypes.h:46
Location & setPos(double x, double y, double zval)
Definition: picklocation.h:82
bool operator==(const ArrayNDInfo &a1, const ArrayNDInfo &a2)
Definition: arrayndinfo.h:51
Location & setPos(const Coord &c)
Definition: picklocation.h:80
Index_Type TraceID
Definition: commontypes.h:47
Pick location in space,.
Definition: picklocation.h:44
bool is2D(GeomType gt)
Definition: seistype.h:32
Sphere * dir_
Definition: picklocation.h:117
float z() const
Definition: picklocation.h:67
Coord3 pos_
Definition: picklocation.h:115
TrcKey * trckey_
Definition: picklocation.h:116
3D point or vector
Definition: commontypes.h:57
Index_Type SurvID
Definition: commontypes.h:45
Location & setZ(FT zval)
Definition: picklocation.h:87
T x_
Definition: geometry.h:80
bool operator!=(const ArrayNDInfo &a1, const ArrayNDInfo &a2)
Definition: arrayndinfo.h:60
BufferString toString(const DBKey &ky)
Definition: dbkey.h:115
Index_Type GeomID
Definition: commontypes.h:48
Coord3d Coord3
Definition: commontypes.h:84
bool hasPos() const
Definition: picklocation.h:61
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:38
Positioning in a seismic survey: inline/crossline or lineNr/trcNr.
Definition: binid.h:28
Definition: picklocation.h:19
Represents a point in spherical coordinates. The angle phi lies in the horizontal plane...
Definition: trigonometry.h:547
Represents a unique trace position in one of the surveys that OpendTect is managing.
Definition: trckey.h:26
BufferString * text_
Definition: picklocation.h:118
2D point or vector class.
Definition: commontypes.h:58
T y_
Definition: geometry.h:81
const Coord3 & pos() const
Definition: picklocation.h:66
Location & setPos(const Coord3 &c)
Definition: picklocation.h:78

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