OpendTect  6.6
zdomain.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: Nanne Hemstra & K. Tingdahl
8  Date: April 2009 / Aug 2010
9  RCS: $Id$
10 ________________________________________________________________________
11 
12 -*/
13 
14 #include "basicmod.h"
15 #include "bufstring.h"
16 #include "uistring.h"
17 
18 
19 namespace ZDomain
20 {
21 
22 class Def;
23 
24 mGlobal(Basic) const Def& SI();
25 mGlobal(Basic) const Def& Depth();
26 mGlobal(Basic) const Def& Time();
27 
28 mGlobal(Basic) bool isSI(const IOPar&);
29 mGlobal(Basic) bool isDepth(const IOPar&);
30 mGlobal(Basic) bool isTime(const IOPar&);
31 mGlobal(Basic) void setSI(IOPar&);
32 mGlobal(Basic) void setDepth(IOPar&);
33 mGlobal(Basic) void setTime(IOPar&);
34 
35 
40 mExpClass(Basic) Def
41 {
42 public:
43 
44  static const Def& get(const char*);
45  static const Def& get(const IOPar&);
46  void set(IOPar&) const;
47 
48  const char* key() const { return key_; }
49  uiString userName() const { return usrnm_; }
50  int userFactor() const { return usrfac_; }
51 
52  uiString getLabel() const;
54  uiString getRange() const;
56 
57  const char* unitStr(bool withparens=false) const;
58  //In case of depth, ft or m will come from SurvInfo
59  uiString uiUnitStr(bool withparens=false) const;
60 
61  bool isSI() const;
62  bool isTime() const;
63  bool isDepth() const;
64 
65  const char* entityStr() const { return isTime() ? "t" : "d"; }
66 
67  bool operator ==( const Def& def ) const
68  { return key_ == def.key_; }
69  bool operator !=( const Def& def ) const
70  { return key_ != def.key_; }
71 
72  // For plugins:
73  Def( const char* ky, const uiString& usrnm,
74  const char* defun, int usrfac=1 )
75  : key_(ky), usrnm_(usrnm)
76  , defunit_(defun), usrfac_(usrfac) {}
77  static bool add(Def*);
78 
79 protected:
80 
84  int usrfac_; // usually 1 or 1000, not FeetFac
85 };
86 
87 
93 {
94 public:
95  Info(const Def&);
96  Info(const Info&);
97  Info(const IOPar&);
98  ~Info();
99 
100  const Def& def_;
102 
103  bool hasID() const;
104  const char* getID() const;
105  void setID(const char*);
106 
107  bool isCompatibleWith(const IOPar&) const;
108 
109  // Convenience
110  const char* key() const { return def_.key(); }
111  uiString userName() const { return def_.userName(); }
112  const char* unitStr(bool wp=false) const
113  { return def_.unitStr(wp); }
114  uiString uiUnitStr(bool wp=false) const
115  { return def_.uiUnitStr(wp); }
116  uiString getLabel() const { return def_.getLabel(); }
117  int userFactor() const { return def_.userFactor(); }
118 
119 };
120 
121 mGlobal(Basic) const char* sKey();
122 mGlobal(Basic) const char* sKeyTime();
123 mGlobal(Basic) const char* sKeyDepth();
124 
125 } // namespace ZDomain
126 
ZDomain
Definition: zdomain.h:20
ZDomain::Info
Information of z-domain.
Definition: zdomain.h:93
ZDomain::Def::Def
Def(const char *ky, const uiString &usrnm, const char *defun, int usrfac=1)
Definition: zdomain.h:73
ZDomain::Info::unitStr
const char * unitStr(bool wp=false) const
Definition: zdomain.h:112
ZDomain::Info::setID
void setID(const char *)
ZDomain::Info::Info
Info(const IOPar &)
ZDomain::Def
Definition of z-domain.
Definition: zdomain.h:41
uistring.h
ZDomain::Def::isDepth
bool isDepth() const
mGlobal
#define mGlobal(module)
Definition: commondefs.h:180
ZDomain::Def::get
static const Def & get(const IOPar &)
ZDomain::Info::userName
uiString userName() const
Definition: zdomain.h:111
ZDomain::sKey
const char * sKey()
ZDomain::Info::uiUnitStr
uiString uiUnitStr(bool wp=false) const
Definition: zdomain.h:114
mExpClass
#define mExpClass(module)
Definition: commondefs.h:177
ZDomain::Def::key
const char * key() const
Definition: zdomain.h:48
ZDomain::Info::userFactor
int userFactor() const
Definition: zdomain.h:117
ZDomain::Depth
const Def & Depth()
ZDomain::setDepth
void setDepth(IOPar &)
ZDomain::Info::isCompatibleWith
bool isCompatibleWith(const IOPar &) const
ZDomain::Def::uiUnitStr
uiString uiUnitStr(bool withparens=false) const
operator==
bool operator==(const ArrayNDInfo &a1, const ArrayNDInfo &a2)
Definition: arrayndinfo.h:81
ZDomain::isSI
bool isSI(const IOPar &)
ZDomain::Def::defunit_
BufferString defunit_
Definition: zdomain.h:83
bufstring.h
ZDomain::isDepth
bool isDepth(const IOPar &)
ZDomain::Def::getRange
uiString getRange() const
<username> Range
ZDomain::Def::set
void set(IOPar &) const
Only key.
ZDomain::Info::getLabel
uiString getLabel() const
Definition: zdomain.h:116
ZDomain::setSI
void setSI(IOPar &)
ZDomain::Def::get
static const Def & get(const char *)
ZDomain::Time
const Def & Time()
ZDomain::Def::usrfac_
int usrfac_
Definition: zdomain.h:84
ZDomain::setTime
void setTime(IOPar &)
ZDomain::Info::Info
Info(const Info &)
ZDomain::sKeyTime
const char * sKeyTime()
operator!=
bool operator!=(const ArrayNDInfo &a1, const ArrayNDInfo &a2)
Definition: arrayndinfo.h:90
ZDomain::Info::def_
const Def & def_
Definition: zdomain.h:100
ZDomain::Def::usrnm_
uiString usrnm_
Definition: zdomain.h:82
ZDomain::Info::Info
Info(const Def &)
ZDomain::Def::userName
uiString userName() const
Definition: zdomain.h:49
ZDomain::sKeyDepth
const char * sKeyDepth()
ZDomain::Def::isSI
bool isSI() const
ZDomain::isTime
bool isTime(const IOPar &)
BufferString
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size.
Definition: bufstring.h:40
ZDomain::Def::userFactor
int userFactor() const
Definition: zdomain.h:50
ZDomain::Info::pars_
IOPar & pars_
Definition: zdomain.h:101
ZDomain::Def::isTime
bool isTime() const
ZDomain::Info::~Info
~Info()
ZDomain::Def::unitStr
const char * unitStr(bool withparens=false) const
uiString
String that is able to hold international (UTF-8) strings for the user interface.
Definition: uistring.h:121
ZDomain::Def::entityStr
const char * entityStr() const
Definition: zdomain.h:65
ZDomain::Info::hasID
bool hasID() const
ZDomain::Info::key
const char * key() const
Definition: zdomain.h:110
ZDomain::Def::getLabel
uiString getLabel() const
Username and unit.
ZDomain::SI
const Def & SI()
ZDomain::Def::key_
BufferString key_
Definition: zdomain.h:81
ZDomain::Info::getID
const char * getID() const
ZDomain::Def::add
static bool add(Def *)
IOPar
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:55

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