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

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