OpendTect-6_4  6.4
picklocation.h
Go to the documentation of this file.
1 #ifndef picklocation_h
2 #define picklocation_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: Bert
9  Date: May 2001 / Mar 2016
10 ________________________________________________________________________
11 
12 -*/
13 
14 #include "generalmod.h"
15 #include "coord.h"
16 #include "trckey.h"
17 #include "trigonometry.h"
18 #include "coordsystem.h"
19 
20 
21 namespace Pick
22 {
23 
47 {
48 public:
49  Location(double x=0,double y=0,double z=0);
50  Location(const Coord&,float z=0);
51  Location(const Coord3&);
52  Location(const Coord3& pos,const Coord3& dir);
53  Location(const Coord3& pos,const Sphere& dir);
54  Location(const Location&);
55  ~Location();
56 
57  inline bool operator ==( const Location& oth ) const
58  { return pos_ == oth.pos_ && dir_ == oth.dir_; }
59  inline bool operator !=( const Location& oth ) const
60  { return !(*this == oth); }
61  void operator =(const Location&);
62 
63  inline bool hasPos() const { return pos_.isDefined(); }
64  bool hasTrcKey() const;
65  inline bool hasDir() const { return !dir_.isNull(); }
66  bool hasText() const;
67 
68  inline const Coord3& pos() const { return pos_; }
69  inline float z() const { return (float)pos_.z; }
70  bool is2D() const;
71  Pos::SurvID survID() const;
72  Pos::GeomID geomID() const;
73  const TrcKey& trcKey() const;
74  Pos::LineID lineNr() const;
75  Pos::TraceID trcNr() const;
76  const BinID& binID() const;
77  const Sphere& dir() const;
78  const BufferString& text() const;
79 
80  inline Location& setPos( const Coord3& c )
81  { pos_ = c; return *this; }
82  inline Location& setPos( const Coord& c )
83  { pos_.x = c.x; pos_.y = c.y; return *this; }
84  inline Location& setPos( double x, double y, double zval )
85  { setPos( Coord3(x,y,zval) ); return *this; }
86  inline Location& setPos( const Coord& c, float zval )
87  { setPos( c.x, c.y, zval ); return *this; }
88  template <class FT>
89  inline Location& setZ( FT zval )
90  { pos_.z = zval; return *this; }
91 
92  Location& setTrcKey(const TrcKey&);
93  Location& setDir(const Sphere&);
94  Location& setDir(const Coord&);
95  Location& setLineNr(Pos::LineID);
96  Location& setTrcNr(Pos::LineID);
97  Location& setGeomID(Pos::GeomID);
98  Location& setBinID(const BinID&,bool updcoord=false);
99  Location& setSurvID(Pos::SurvID,bool updfromcoord=true);
100 
101  bool hasTextKey(const char* key) const;
102  bool getKeyedText(const char* key,BufferString&) const;
103  void setKeyedText(const char* key,const char* txt);
104  void removeTextKey(const char* key);
105  Location& setText(const char*);
107 
108  bool fromString(const char*);
109  void toString(BufferString&,bool forexport=false,
110  const Coords::CoordSystem* crs=0) const;
111 
112  // renamed to 'Keyed' in post-6.0
113  /* mDeprecated */ void setText(const char* key,const char* txt);
114  /* mDeprecated */ void unSetText(const char* key);
115  /* mDeprecated */ bool getText(const char* key,BufferString&) const;
116 
117  // will go away post-6.0
118  /* mDeprecated */ void setDip(float,float);
119  /* mDeprecated */ float inlDip() const;
120  /* mDeprecated */ float crlDip() const;
121 
122  // become protected in post-6.0
123  /* mDeprecated */ Coord3 pos_;
124  /* mDeprecated */ TrcKey trckey_;
125  /* mDeprecated */ Sphere dir_;
126  /* mDeprecated */ BufferString* text_;
127 
128 protected:
129 
130  bool fndKeyTxt(const char*,BufferString*) const;
131 
132 };
133 
134 } // namespace Pick
135 
136 #endif
#define mExpClass(module)
Definition: commondefs.h:160
Location & setPos(const Coord &c, float zval)
Definition: picklocation.h:86
Index_Type LineID
Definition: commontypes.h:50
Location & setPos(double x, double y, double zval)
Definition: picklocation.h:84
bool operator==(const ArrayNDInfo &a1, const ArrayNDInfo &a2)
Definition: arrayndinfo.h:53
Location & setPos(const Coord &c)
Definition: picklocation.h:82
Index_Type TraceID
Definition: commontypes.h:51
Pick location in space,.
Definition: picklocation.h:46
float z() const
Definition: picklocation.h:69
Coord3 pos_
Definition: picklocation.h:123
A cartesian coordinate in 2D space.
Definition: coord.h:25
Definition: coordsystem.h:31
bool hasDir() const
Definition: picklocation.h:65
TrcKey trckey_
Definition: picklocation.h:124
Sphere dir_
Definition: picklocation.h:125
Index_Type SurvID
Definition: commontypes.h:49
T y
Definition: geometry.h:67
Location & setZ(FT zval)
Definition: picklocation.h:89
bool operator!=(const ArrayNDInfo &a1, const ArrayNDInfo &a2)
Definition: arrayndinfo.h:62
A cartesian coordinate in 3D space.
Definition: coord.h:72
Index_Type GeomID
Definition: commontypes.h:52
bool hasPos() const
Definition: picklocation.h:63
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:40
Positioning in a seismic survey: inline/crossline or lineNr/trcNr.
Definition: binid.h:30
T x
Definition: geometry.h:66
bool is2D(const PicksType &picks)
Definition: pickset.h:142
Definition: picklocation.h:21
Represents a point in spherical coordinates. The angle phi lies in the horizontal plane...
Definition: trigonometry.h:582
Represents a unique trace position in one of the surveys that OpendTect is managing.
Definition: trckey.h:28
BufferString * text_
Definition: picklocation.h:126
const Coord3 & pos() const
Definition: picklocation.h:68
Export_Basic const char * toString(ViewStyle)
Location & setPos(const Coord3 &c)
Definition: picklocation.h:80

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