 |
OpendTect
6.6
|
Go to the documentation of this file.
24 template <
class RT,
class T>
29 : periodic( periodic_ ) {}
33 virtual float getDx()
const = 0;
34 virtual float getX0()
const = 0;
36 virtual int size()
const = 0;
42 {
return (x-getX0()) / getDx(); }
45 {
return mNINT32(getIndex( x )); }
49 if ( !doInterpolate() )
51 const int smpl =
mNINT32( getIndex(x) );
52 if ( smpl<0 || smpl>=size() )
62 getIndex(x), period(),
76 {
return getValue(*x); }
83 virtual bool hasUdfs()
const {
return false; }
92 template <
class RT,
class T>
97 float x0=0,
float dx=1 )
102 , period_ (
mUdf(float) )
104 , interpolate_( true )
112 int size()
const {
return sz_; }
SampledFunctionImpl(const T &idxabl, int sz, float x0=0, float dx=1)
Definition: samplfunc.h:96
virtual float getDx() const =0
void setInterpolate(bool yn)
Definition: samplfunc.h:121
int sz_
Definition: samplfunc.h:126
virtual int size() const =0
virtual bool doInterpolate() const
Definition: samplfunc.h:84
void setHasUdfs(bool yn)
Definition: samplfunc.h:118
int firstidx_
Definition: samplfunc.h:127
#define od_int64
Definition: plftypes.h:35
void setPeriod(float np)
Definition: samplfunc.h:115
const T & idxabl_
Definition: samplfunc.h:125
float x0_
Definition: samplfunc.h:130
float dx_
Definition: samplfunc.h:129
RT getValue(RT x) const
Definition: samplfunc.h:47
float getDx() const
Definition: samplfunc.h:109
virtual bool extrapolate() const
Definition: samplfunc.h:82
bool periodic
Definition: samplfunc.h:79
RT getValue(const RT *x) const
Definition: samplfunc.h:75
bool hasudfs_
Definition: samplfunc.h:133
float period() const
Definition: samplfunc.h:114
void interpolateYPeriodicReg(const T &idxabl, int sz, float pos, RT &ret, RT period, bool extrapolate=false)
Definition: periodicvalue.h:126
#define mClass(module)
Definition: commondefs.h:181
int size() const
Definition: samplfunc.h:112
bool interpolate_
Definition: samplfunc.h:134
float getX0() const
Definition: samplfunc.h:110
bool doInterpolate() const
Definition: samplfunc.h:120
Implementation for array-type of SampledFunction.
Definition: samplfunc.h:94
bool interpolateRegWithUdf(const T &idxabl, int sz, float pos, RT &ret, bool extrapolate=false, float snapdist=mDefEps)
Definition: idxable.h:313
RT operator[](od_int64 idx) const
Definition: samplfunc.h:107
void setPeriodic(bool np)
Definition: samplfunc.h:39
SampledFunction(bool periodic_=false)
Definition: samplfunc.h:28
#define mUdf(type)
Use this macro to get the undefined for simple types.
Definition: undefval.h:274
virtual float getX0() const =0
int getNearestIndex(float x) const
Definition: samplfunc.h:44
virtual RT operator[](od_int64) const =0
float period_
Definition: samplfunc.h:132
float getIndex(float x) const
Definition: samplfunc.h:41
#define mNINT32(x)
Definition: commondefs.h:58
bool hasUdfs() const
Definition: samplfunc.h:117
virtual float period() const
Definition: samplfunc.h:38
virtual bool hasUdfs() const
Definition: samplfunc.h:83
Make any sampled series comply with MathFunction.
Definition: samplfunc.h:26
bool interpolateReg(const T &idxabl, int sz, float pos, RT &ret, bool extrapolate=false, float snapdist=mDefEps)
Definition: idxable.h:272
Generated at
for the OpendTect
seismic interpretation project.
Copyright (C): dGB Beheer B.V. 1995-2021