OpendTect-6_4  6.4
trckeyvalue.h
Go to the documentation of this file.
1 #ifndef trckeyvalue_h
2 #define trckeyvalue_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: A.H.Bril
9  Date: 21-6-1996
10  Contents: Positions: Inline/crossline and Coordinate
11  RCS: $Id$
12 ________________________________________________________________________
13 
14 -*/
15 
16 #include "basicmod.h"
17 
18 
19 #include "trckey.h"
20 
25 class BinIDValue;
26 
28 {
29 public:
30 
31  inline TrcKeyValue( const TrcKey& tk=TrcKey::udf(),
32  float v=mUdf(float) )
33  : tk_(tk)
34  , val_(v) {}
35  TrcKeyValue(const BinIDValue&);
36 
37  // mDeprecated Pos::LineID& lineNr() { return tk_.lineNr(); }
38  Pos::LineID lineNr() const { return tk_.lineNr(); }
39  // mDeprecated Pos::TraceID& trcNr() { return tk_.trcNr(); }
40  Pos::TraceID trcNr() const { return tk_.trcNr(); }
41 
42  TrcKeyValue& setLineNr( Pos::LineID nr )
43  { tk_.setLineNr(nr); return *this; }
44  TrcKeyValue& setTrcNr( Pos::TraceID nr )
45  { tk_.setTrcNr(nr); return *this; }
46 
47  inline bool operator==( const TrcKeyValue& oth ) const
48  { return oth.tk_==tk_ && mIsEqual(oth.val_,val_,1e-5); }
49  inline bool operator!=( const TrcKeyValue& oth ) const
50  { return !(*this==oth); }
51 
52  inline bool isDefined() const;
53  inline bool isUdf() const { return !isDefined(); }
54  static const TrcKeyValue& udf();
55 
57  float val_;
58 };
59 
60 inline bool TrcKeyValue::isDefined() const
61 { return !tk_.isUdf() && !mIsUdf(val_); }
62 
63 #endif
#define mExpClass(module)
Definition: commondefs.h:160
Definition: trckeyvalue.h:27
TrcKey tk_
Definition: trckeyvalue.h:56
#define mIsUdf(val)
Use mIsUdf to check for undefinedness of simple types.
Definition: undefval.h:287
Index_Type LineID
Definition: commontypes.h:50
TrcKeyValue & setTrcNr(Pos::TraceID nr)
Definition: trckeyvalue.h:44
Index_Type TraceID
Definition: commontypes.h:51
#define mIsEqual(x, y, eps)
Definition: commondefs.h:54
TrcKeyValue & setLineNr(Pos::LineID nr)
Definition: trckeyvalue.h:42
bool operator==(const TrcKeyValue &oth) const
Definition: trckeyvalue.h:47
#define mUdf(type)
Use this macro to get the undefined for simple types.
Definition: undefval.h:272
Pos::LineID lineNr() const
Definition: trckeyvalue.h:38
BinID and a value.
Definition: binidvalue.h:31
bool operator!=(const TrcKeyValue &oth) const
Definition: trckeyvalue.h:49
FT val_
Definition: posidxpairvalue.h:64
static const TrcKey & udf()
Pos::TraceID trcNr() const
Definition: trckeyvalue.h:40
float val_
Definition: trckeyvalue.h:57
bool isUdf() const
Definition: trckey.h:54
bool isDefined() const
Definition: trckeyvalue.h:60
Represents a unique trace position in one of the surveys that OpendTect is managing.
Definition: trckey.h:28
bool isUdf() const
Definition: trckeyvalue.h:53
TrcKeyValue(const TrcKey &tk=TrcKey::udf(), float v=Values::Undef< float >::val())
Definition: trckeyvalue.h:31

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