OpendTect  6.6
trckeyvalue.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: A.H.Bril
8  Date: 21-6-1996
9  Contents: Positions: Inline/crossline and Coordinate
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 -*/
14 
15 #include "basicmod.h"
16 
17 
18 #include "trckey.h"
19 
24 class BinIDValue;
25 
27 {
28 public:
29 
30  inline TrcKeyValue( const TrcKey& tk=TrcKey::udf(),
31  float v=mUdf(float) )
32  : tk_(tk)
33  , val_(v) {}
35 
36  // mDeprecated Pos::LineID& lineNr() { return tk_.lineNr(); }
37  Pos::LineID lineNr() const { return tk_.lineNr(); }
38  // mDeprecated Pos::TraceID& trcNr() { return tk_.trcNr(); }
39  Pos::TraceID trcNr() const { return tk_.trcNr(); }
40 
42  { tk_.setLineNr(nr); return *this; }
44  { tk_.setTrcNr(nr); return *this; }
45 
46  inline bool operator==( const TrcKeyValue& oth ) const
47  { return oth.tk_==tk_ && mIsEqual(oth.val_,val_,1e-5); }
48  inline bool operator!=( const TrcKeyValue& oth ) const
49  { return !(*this==oth); }
50 
51  inline bool isDefined() const;
52  inline bool isUdf() const { return !isDefined(); }
53  static const TrcKeyValue& udf();
54 
56  float val_;
57 };
58 
59 inline bool TrcKeyValue::isDefined() const
60 { return !tk_.isUdf() && !mIsUdf(val_); }
61 
TrcKey::isUdf
bool isUdf() const
Definition: trckey.h:56
Pos::ValueIdxPair::val_
FT val_
Definition: posidxpairvalue.h:63
TrcKey::udf
static const TrcKey & udf()
mIsEqual
#define mIsEqual(x, y, eps)
Definition: commondefs.h:67
mIsUdf
#define mIsUdf(val)
Use mIsUdf to check for undefinedness of simple types.
Definition: undefval.h:289
trckey.h
TrcKeyValue::TrcKeyValue
TrcKeyValue(const BinIDValue &)
mExpClass
#define mExpClass(module)
Definition: commondefs.h:177
TrcKeyValue::setLineNr
TrcKeyValue & setLineNr(Pos::LineID nr)
Definition: trckeyvalue.h:41
TrcKeyValue::udf
static const TrcKeyValue & udf()
TrcKeyValue::operator!=
bool operator!=(const TrcKeyValue &oth) const
Definition: trckeyvalue.h:48
Pos::LineID
Index_Type LineID
Definition: commontypes.h:85
TrcKeyValue::lineNr
Pos::LineID lineNr() const
Definition: trckeyvalue.h:37
Pos::TraceID
Index_Type TraceID
Definition: commontypes.h:86
TrcKeyValue
Definition: trckeyvalue.h:27
TrcKeyValue::isDefined
bool isDefined() const
Definition: trckeyvalue.h:59
TrcKeyValue::operator==
bool operator==(const TrcKeyValue &oth) const
Definition: trckeyvalue.h:46
TrcKey
Represents a unique trace position in one of the surveys that OpendTect is managing.
Definition: trckey.h:28
BinIDValue
BinID and a value.
Definition: binidvalue.h:31
mUdf
#define mUdf(type)
Use this macro to get the undefined for simple types.
Definition: undefval.h:274
TrcKeyValue::isUdf
bool isUdf() const
Definition: trckeyvalue.h:52
TrcKeyValue::TrcKeyValue
TrcKeyValue(const TrcKey &tk=TrcKey::udf(), float v=Values::Undef< float >::val())
Definition: trckeyvalue.h:30
TrcKeyValue::tk_
TrcKey tk_
Definition: trckeyvalue.h:55
TrcKeyValue::trcNr
Pos::TraceID trcNr() const
Definition: trckeyvalue.h:39
TrcKeyValue::val_
float val_
Definition: trckeyvalue.h:56
TrcKeyValue::setTrcNr
TrcKeyValue & setTrcNr(Pos::TraceID nr)
Definition: trckeyvalue.h:43

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