OpendTect  6.6
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 #include "trckey.h"
16 #include "trigonometry.h"
17 #include "coordsystem.h"
18 
19 
20 namespace Pick
21 {
22 
46 {
47 public:
48  Location(double x=0,double y=0,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&);
55 
56  inline bool operator ==( const Location& oth ) const
57  { return pos_ == oth.pos_ && dir_ == oth.dir_; }
58  inline bool operator !=( const Location& oth ) const
59  { return !(*this == oth); }
60  void operator =(const Location&);
61 
62  inline bool hasPos() const { return pos_.isDefined(); }
63  bool hasTrcKey() const;
64  inline bool hasDir() const { return !dir_.isNull(); }
65  bool hasText() const;
66 
67  inline const Coord3& pos() const { return pos_; }
68  inline float z() const { return (float)pos_.z; }
69  bool is2D() const;
72  const TrcKey& trcKey() const;
75  const BinID& binID() const;
76  const Sphere& dir() const;
77  const BufferString& text() const;
78 
79  inline Location& setPos( const Coord3& c )
80  { pos_ = c; return *this; }
81  inline Location& setPos( const Coord& c )
82  { pos_.x = c.x; pos_.y = c.y; return *this; }
83  inline Location& setPos( double x, double y, double zval )
84  { setPos( Coord3(x,y,zval) ); return *this; }
85  inline Location& setPos( const Coord& c, float zval )
86  { setPos( c.x, c.y, zval ); return *this; }
87  template <class FT>
88  inline Location& setZ( FT zval )
89  { pos_.z = zval; return *this; }
90 
93  Location& setDir(const Coord&);
97  Location& setBinID(const BinID&,bool updcoord=false);
98  Location& setSurvID(Pos::SurvID,bool updfromcoord=true);
99 
100  bool hasTextKey(const char* key) const;
101  bool getKeyedText(const char* key,BufferString&) const;
102  void setKeyedText(const char* key,const char* txt);
103  void removeTextKey(const char* key);
104  Location& setText(const char*);
106 
107  bool fromString(const char*);
108  void toString(BufferString&,bool forexport=false,
109  const Coords::CoordSystem* crs=0) const;
110 
111  // renamed to 'Keyed' in post-6.0
112  /* mDeprecated */ void setText(const char* key,const char* txt);
113  /* mDeprecated */ void unSetText(const char* key);
114  /* mDeprecated */ bool getText(const char* key,BufferString&) const;
115 
116  // will go away post-6.0
117  /* mDeprecated */ void setDip(float,float);
118  /* mDeprecated */ float inlDip() const;
119  /* mDeprecated */ float crlDip() const;
120 
121  // become protected in post-6.0
122  /* mDeprecated */ Coord3 pos_;
123  /* mDeprecated */ TrcKey trckey_;
124  /* mDeprecated */ Sphere dir_;
125  /* mDeprecated */ BufferString* text_;
126 
127 protected:
128 
129  bool fndKeyTxt(const char*,BufferString*) const;
130 
131 };
132 
133 } // namespace Pick
134 
Pick::Location::Location
Location(const Coord &, float z=0)
Pick::Location::setDir
Location & setDir(const Coord &)
Coord3
A cartesian coordinate in 3D space.
Definition: coord.h:72
Pick::Location::text_
BufferString * text_
Definition: picklocation.h:125
Pick::Location::setText
void setText(const char *key, const char *txt)
Pick::Location::fromString
bool fromString(const char *)
Pick::Location::setText
Location & setText(const char *)
make sure it's compatible with the keying system
Pick::Location::trcNr
Pos::TraceID trcNr() const
Pick::Location::Location
Location(double x=0, double y=0, double z=0)
coordsystem.h
Pick::Location::setSurvID
Location & setSurvID(Pos::SurvID, bool updfromcoord=true)
Pick::Location::setLineNr
Location & setLineNr(Pos::LineID)
trckey.h
Pick::Location::trcKey
const TrcKey & trcKey() const
Pick::Location::setZ
Location & setZ(FT zval)
Definition: picklocation.h:88
Pick::Location::setDir
Location & setDir(const Sphere &)
Pick
Definition: picklocation.h:21
mExpClass
#define mExpClass(module)
Definition: commondefs.h:177
Pick::Location::crlDip
float crlDip() const
Pos::SurvID
Index_Type SurvID
Definition: commontypes.h:84
Pick::Location::setDip
void setDip(float, float)
Pick::Location::trckey_
TrcKey trckey_
Definition: picklocation.h:123
Pick::Location::~Location
~Location()
Pick::Location::fndKeyTxt
bool fndKeyTxt(const char *, BufferString *) const
Pick::Location::Location
Location(const Location &)
operator==
bool operator==(const ArrayNDInfo &a1, const ArrayNDInfo &a2)
Definition: arrayndinfo.h:81
Pos::LineID
Index_Type LineID
Definition: commontypes.h:85
Pick::Location::dir
const Sphere & dir() const
Pick::Location::setPos
Location & setPos(const Coord3 &c)
Definition: picklocation.h:79
BinID
Positioning in a seismic survey: inline/crossline or lineNr/trcNr.
Definition: binid.h:31
Coord
A cartesian coordinate in 2D space.
Definition: coord.h:25
Pick::Location::toString
void toString(BufferString &, bool forexport=false, const Coords::CoordSystem *crs=0) const
Pick::Location::setPos
Location & setPos(double x, double y, double zval)
Definition: picklocation.h:83
Pick::Location::inlDip
float inlDip() const
Pos::TraceID
Index_Type TraceID
Definition: commontypes.h:86
Pick::Location::survID
Pos::SurvID survID() const
operator!=
bool operator!=(const ArrayNDInfo &a1, const ArrayNDInfo &a2)
Definition: arrayndinfo.h:90
Pick::Location::lineNr
Pos::LineID lineNr() const
Pick::Location::getKeyedText
bool getKeyedText(const char *key, BufferString &) const
Pick::Location::hasTrcKey
bool hasTrcKey() const
Pick::Location::z
float z() const
Definition: picklocation.h:68
Coords::CoordSystem
Definition: coordsystem.h:31
Pick::Location::setGeomID
Location & setGeomID(Pos::GeomID)
Pick::Location::pos_
Coord3 pos_
Definition: picklocation.h:122
Pick::Location::setTrcKey
Location & setTrcKey(const TrcKey &)
Pick::Location
Pick location in space,.
Definition: picklocation.h:46
Pick::Location::hasTextKey
bool hasTextKey(const char *key) const
Pick::Location::setTrcNr
Location & setTrcNr(Pos::LineID)
Pick::Location::hasDir
bool hasDir() const
Definition: picklocation.h:64
Pick::Location::hasText
bool hasText() const
Pick::Location::setKeyedText
void setKeyedText(const char *key, const char *txt)
Pick::Location::Location
Location(const Coord3 &pos, const Sphere &dir)
BufferString
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size.
Definition: bufstring.h:40
Pick::Location::setPos
Location & setPos(const Coord &c, float zval)
Definition: picklocation.h:85
TrcKey
Represents a unique trace position in one of the surveys that OpendTect is managing.
Definition: trckey.h:28
Pick::Location::Location
Location(const Coord3 &pos, const Coord3 &dir)
Pick::Location::geomID
Pos::GeomID geomID() const
trigonometry.h
Pick::Location::setBinID
Location & setBinID(const BinID &, bool updcoord=false)
Geom::Point2D::y
T y
Definition: geometry.h:68
Pick::Location::removeTextKey
void removeTextKey(const char *key)
Pick::Location::binID
const BinID & binID() const
Pick::Location::dir_
Sphere dir_
Definition: picklocation.h:124
Geom::Point2D::x
T x
Definition: geometry.h:67
Pick::Location::hasPos
bool hasPos() const
Definition: picklocation.h:62
Pick::Location::is2D
bool is2D() const
Pick::Location::pos
const Coord3 & pos() const
Definition: picklocation.h:67
Sphere
Represents a point in spherical coordinates. The angle phi lies in the horizontal plane,...
Definition: trigonometry.h:582
Pick::Location::getText
bool getText(const char *key, BufferString &) const
Pick::Location::text
const BufferString & text() const
Pick::Location::Location
Location(const Coord3 &)
Pick::Location::unSetText
void unSetText(const char *key)
Pos::GeomID
Index_Type GeomID
Definition: commontypes.h:87
Pick::Location::setPos
Location & setPos(const Coord &c)
Definition: picklocation.h:81
coord.h

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