OpendTect-6_4  6.4
zaxistransform.h
Go to the documentation of this file.
1 #ifndef zaxistransform_h
2 #define zaxistransform_h
3 /*+
4 ________________________________________________________________________
5 
6  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
7  Author: K. Tingdahl
8  Date: October 2006
9  RCS: $Id$
10 ________________________________________________________________________
11 
12 -*/
13 
14 #include "algomod.h"
15 #include "enums.h"
16 #include "factory.h"
17 #include "binid.h"
18 #include "ranges.h"
19 #include "refcount.h"
20 #include "samplingdata.h"
21 #include "survgeom.h"
22 
23 class BinIDValue;
24 class TrcKeyZSampling;
25 class TaskRunner;
26 
27 namespace ZDomain { class Def; class Info; }
28 
38 { mRefCountImpl(ZAxisTransform);
39 public:
40  mDefineFactoryInClass(ZAxisTransform,factory);
41 
42  static ZAxisTransform* create(const IOPar&);
46  virtual bool isOK() const { return true; }
47  virtual uiString errMsg() const { return errmsg_; }
48 
49  virtual bool needsVolumeOfInterest() const { return true; }
50  virtual int addVolumeOfInterest(const TrcKeyZSampling&,
51  bool zistrans=false);
53  virtual void setVolumeOfInterest(int volid,
54  const TrcKeyZSampling&,
55  bool zistrans=false);
56  virtual void removeVolumeOfInterest(int volid);
57 
58  virtual bool loadDataIfMissing(int volid,TaskRunner* =0);
59 
60  virtual bool canTransformSurv(Pos::SurvID) const = 0;
61 
62  //Generic 2D and 3D
63  virtual void transformTrc(const TrcKey&,
64  const SamplingData<float>&,
65  int sz,float* res) const = 0;
66  float transformTrc(const TrcKey&,float z) const;
67  virtual void transformTrcBack(const TrcKey&,
68  const SamplingData<float>&,
69  int sz,float* res) const = 0;
70  float transformTrcBack(const TrcKey&,float z) const;
71 
72  virtual Interval<float> getZInterval(bool from) const = 0;
75  virtual float getZIntervalCenter(bool from) const;
78  virtual float getGoodZStep() const;
84  ZDomain::Info& fromZDomainInfo() { return fromzdomaininfo_; }
85  ZDomain::Info& toZDomainInfo() { return tozdomaininfo_; }
86  const ZDomain::Info& fromZDomainInfo() const;
87  const ZDomain::Info& toZDomainInfo() const;
88  const char* fromZDomainKey() const;
89  const char* toZDomainKey() const;
90 
91  virtual float toZScale() const;
93  virtual float zScale() const { return toZScale(); }
96  virtual NotifierAccess* changeNotifier() { return 0; }
97  virtual void fillPar(IOPar&) const;
98  virtual bool usePar(const IOPar&);
99 
100 protected:
101  ZAxisTransform(const ZDomain::Def& from,
102  const ZDomain::Def& to);
103 
106  mutable uiString errmsg_;
107 
108 public: //Legacy stuff
109 
110  //3D
111  virtual void transform(const BinID&,
112  const SamplingData<float>&,
113  int sz,float* res) const;
114  float transform(const BinIDValue&) const;
115  float transform(const Coord3&) const;
116  virtual void transformBack(const BinID&,
117  const SamplingData<float>&,
118  int sz,float* res) const;
119  float transformBack(const BinIDValue&) const;
120  float transformBack(const Coord3&) const;
121  // 2D
122  virtual void transform2D(const char* linenm,int trcnr,
123  const SamplingData<float>&,
124  int sz,float* res) const;
125  float transform2D(const char* linenm,int trcnr,
126  float z) const;
127  virtual void transformBack2D(const char* linenm,int trcnr,
128  const SamplingData<float>&,
129  int sz,float* res) const;
130  float transformBack2D(const char* linenm,int trcnr,
131  float z) const;
132 };
133 
134 
140 {
141 public:
142  ZAxisTransformSampler(const ZAxisTransform&,
143  bool back,const SamplingData<double>&,
144  bool is2d);
145  virtual ~ZAxisTransformSampler();
146 
147  void setBinID(const BinID& bid);
148  void setTrcKey( const TrcKey& k ) { trckey_ = k ; }
149  void setLineName(const char*);
150  void setTrcNr(int);
151 
152  float operator[](int idx) const;
153  void computeCache(const Interval<int>& range);
154 
155 protected:
156 
158  bool back_;
159  bool is2d_;
162 
165 
166 };
167 
168 #endif
#define mRefCountImpl(ClassName)
Macro to setup a class with destructor for reference counting.
Definition: refcount.h:163
ZDomain::Info & fromZDomainInfo()
Definition: zaxistransform.h:84
Samples Z-axis transformed data.
Definition: zaxistransform.h:139
#define mExpClass(module)
Definition: commondefs.h:160
virtual float zScale() const
Definition: zaxistransform.h:93
TypeSet< float > cache_
Definition: zaxistransform.h:163
bool back_
Definition: zaxistransform.h:158
int firstcachesample_
Definition: zaxistransform.h:164
ZDomain::Info & toZDomainInfo()
Definition: zaxistransform.h:85
T to(const F &fr)
Definition: convert.h:33
const ZAxisTransform & transform_
Definition: zaxistransform.h:157
void setTrcKey(const TrcKey &k)
Definition: zaxistransform.h:148
Interface class for Notifier. See comments there.
Definition: callback.h:161
void usePar(const IOPar &iop, ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:188
Definition: uistring.h:89
virtual bool needsVolumeOfInterest() const
Definition: zaxistransform.h:49
uiString errmsg_
Definition: zaxistransform.h:106
TrcKey trckey_
Definition: zaxistransform.h:160
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:47
Index_Type SurvID
Definition: commontypes.h:49
Class that can execute a task.
Definition: task.h:169
ZDomain::Info & fromzdomaininfo_
Definition: zaxistransform.h:105
Hor+Vert sampling in 3D surveys.
Definition: trckeyzsampling.h:35
virtual NotifierAccess * changeNotifier()
Definition: zaxistransform.h:96
BinID and a value.
Definition: binidvalue.h:31
virtual bool isOK() const
Definition: zaxistransform.h:46
#define mDefineFactoryInClass(T, funcname)
Definition: factory.h:426
void fillPar(IOPar &iop, const ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:175
bool is2d_
Definition: zaxistransform.h:159
A cartesian coordinate in 3D space.
Definition: coord.h:72
virtual uiString errMsg() const
Definition: zaxistransform.h:47
static uiHor3DInterpol * create(uiParent *)
Positioning in a seismic survey: inline/crossline or lineNr/trcNr.
Definition: binid.h:30
BufferString errmsg_
Definition: horizontracker.h:119
const SamplingData< double > sd_
Definition: zaxistransform.h:161
Represents a unique trace position in one of the surveys that OpendTect is managing.
Definition: trckey.h:28
ZDomain::Info & tozdomaininfo_
Definition: zaxistransform.h:104
Base class for z-axis transforms.
Definition: zaxistransform.h:37
Definition of z-domain.
Definition: zdomain.h:41
Information of z-domain.
Definition: zdomain.h:91
Definition: zdomain.h:20

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