OpendTect-6_4  6.4
posimpexppars.h
Go to the documentation of this file.
1 #ifndef posimpexppars_h
2 #define posimpexppars_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: Bert
9  Date: Aug 2009
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 -*/
14 
15 #include "generalmod.h"
16 #include "position.h"
17 #include "callback.h"
18 
19 
20 /* Holds scale and shift(s) for Coord, BinID, TrcNr, Z and Offset;
21  to apply on import (add or multiply), and on export (subtract or divide).
22 
23  On import (i.e. `inward'), the 'scale' is applied before the 'offset', hence
24  offset must be in units of the scaled values. On export, the offset
25  is subtracted first (of course).
26 
27  */
28 
29 #define mPIEP PosImpExpPars::SVY()
30 #define mPIEPAdj(what,v,inw) PosImpExpPars::SVY().adjust##what(v,inw)
31 
32 
34 {
35 public:
36 
37  static const PosImpExpPars& SVY();
38  static void refresh() { getSVY().getFromSI(); }
39 
40  int binidScale() const { return binidscale_; }
41  BinID binidOffset() const { return binidoffs_; }
42  int trcnrScale() const { return trcnrscale_; }
43  int trcnrOffset() const { return trcnroffs_; }
44  double coordScale() const { return coordscale_; }
45  Coord coordOffset() const { return coordoffs_; }
46  float zScale() const { return zscale_; }
47  float zOffset() const { return zoffs_; }
48  float offsScale() const { return offsscale_; }
49  float offsOffset() const { return offsoffs_; }
50 
51  void adjustBinID(BinID&,bool inward) const;
52  void adjustTrcNr(int&,bool inward) const;
53  void adjustCoord(Coord&,bool inward) const;
54  void adjustZ(float&,bool inward) const;
55  void adjustOffset(float&,bool inward) const;
56 
57  void adjustInl(int&,bool inward) const;
58  void adjustCrl(int&,bool inward) const;
59  void adjustX(double&,bool inward) const;
60  void adjustY(double&,bool inward) const;
61 
62  bool haveBinIDChg() const;
63  bool haveTrcNrChg() const;
64  bool haveCoordChg() const;
65  bool haveZChg() const;
66  bool haveOffsetChg() const;
67 
68  bool haveInlChg() const;
69  bool haveCrlChg() const;
70  bool haveXChg() const;
71  bool haveYChg() const;
72 
73 protected:
74 
79  double coordscale_;
81  float zscale_;
82  float zoffs_;
83  float offsscale_;
84  float offsoffs_;
85 
86 public:
87 
89  void clear()
90  {
91  binidscale_ = 1; binidoffs_ = BinID(0,0);
92  trcnrscale_ = 1; trcnroffs_ = 0;
93  coordscale_ = 1; coordoffs_ = Coord(0,0);
94  zscale_ = 1; zoffs_ = 0;
95  offsscale_ = 1; offsoffs_ = 0;
96  }
97 
98  static PosImpExpPars& getSVY();
99  void usePar(const IOPar&);
100  void getFromSI();
101  void survChg( CallBacker* ) { getFromSI(); }
102 
103  static const char* sKeyBase() { return "ImpExp"; }
104  static const char* sKeyOffset(); // sKey::Offset()
105  static const char* sKeyScale(); // sKey::Scale()
106  static const char* sKeyBinID() { return "BinID"; }
107  static const char* sKeyTrcNr();
108  static const char* sKeyCoord() { return "Coord"; }
109  static const char* sKeyZ() { return "Z"; }
110 
111  static const char* fullKey(const char*,bool true_is_scale_else_offs);
112 
113 };
114 
115 
116 #endif
#define mExpClass(module)
Definition: commondefs.h:160
BinID binidOffset() const
Definition: posimpexppars.h:41
void clear()
Definition: posimpexppars.h:89
Definition: posimpexppars.h:33
To be able to send and/or receive CallBacks, inherit from this class.
Definition: callback.h:272
double coordscale_
Definition: posimpexppars.h:79
Coord coordOffset() const
Definition: posimpexppars.h:45
int trcnrscale_
Definition: posimpexppars.h:77
float offsscale_
Definition: posimpexppars.h:83
int binidScale() const
Definition: posimpexppars.h:40
void survChg(CallBacker *)
Definition: posimpexppars.h:101
void usePar(const IOPar &iop, ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:188
float zscale_
Definition: posimpexppars.h:81
void clear(std::ios &)
A cartesian coordinate in 2D space.
Definition: coord.h:25
BinID binidoffs_
Definition: posimpexppars.h:76
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:47
int trcnrScale() const
Definition: posimpexppars.h:42
static const char * sKeyZ()
Definition: posimpexppars.h:109
float offsOffset() const
Definition: posimpexppars.h:49
int trcnrOffset() const
Definition: posimpexppars.h:43
static const char * sKeyBase()
Definition: posimpexppars.h:103
int trcnroffs_
Definition: posimpexppars.h:78
PosImpExpPars()
Definition: posimpexppars.h:88
static void refresh()
Definition: posimpexppars.h:38
float zOffset() const
Definition: posimpexppars.h:47
float offsoffs_
Definition: posimpexppars.h:84
static const char * sKeyCoord()
Definition: posimpexppars.h:108
Positioning in a seismic survey: inline/crossline or lineNr/trcNr.
Definition: binid.h:30
float zScale() const
Definition: posimpexppars.h:46
int binidscale_
Definition: posimpexppars.h:75
double coordScale() const
Definition: posimpexppars.h:44
float offsScale() const
Definition: posimpexppars.h:48
static const char * sKeyBinID()
Definition: posimpexppars.h:106
float zoffs_
Definition: posimpexppars.h:82
Coord coordoffs_
Definition: posimpexppars.h:80

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