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

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