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

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