 |
OpendTect
6.6
|
Go to the documentation of this file.
34 template <
class FT>
inline float getfIndex(FT)
const;
35 template <
class FT>
inline int nrSteps(FT)
const;
40 template <
class IT>
inline T
atIndex(IT)
const;
41 template <
class FT>
inline T
snap(FT)
const;
43 template <
class FT>
inline void set(FT,FT);
55 template <
class T>
inline
61 template <
class T>
inline
64 step = (y1-y0) / (x1-x0);
70 template <
class FT>
inline
72 : start(
mCast(T,sd.start) ), step(
mCast(T,sd.step) )
79 template <
class FT>
inline
81 : start(
mCast(T,intv.start)), step(
mCast(T,intv.step))
85 template <
class T>
inline
87 {
return start == sd.
start && step == sd.
step; }
94 if ( !
mIsZero(val,1e-6f) )
return false;
96 return val < 1e-6f && val > -1e-6f;
104 if ( !
mIsZero(val,1e-10) )
return false;
106 return val < 1e-10 && val > -1e-10;
110 template <
class T>
inline
112 {
return ! (sd == *
this); }
116 template <
class IT>
inline
125 template <
class FT>
inline
127 {
return mIsZero(step,
mDefEps) ? 0.f : (float) ((val-start) / step); }
131 template <
class FT>
inline
133 {
const float fidx = getfIndex(x);
return (
int)(fidx + 1e-6f); }
137 template <
class FT>
inline
139 {
const float fidx = getfIndex(x);
return mNINT32(fidx); }
143 template <
class FT>
inline
146 float fres = getfIndex( x );
147 int res = (int) getfIndex(x);
148 const float diff = fres-res;
157 template <
class FT>
inline
159 {
return start + step * nearestIndex(val); }
163 template <
class IT>
inline
165 {
return start + step * (T)idx; }
169 template <
class FT>
inline
171 { start = (T)sa; step = (T)se; }
175 template <
class FT>
inline
177 { start = (T)intv.start; step = (T)intv.
step; }
181 template <
class FT>
inline
183 { start = (T)sd.
start; step = (T)sd.
step; }
186 template <
class T>
inline
188 { start *= scl; step *= scl; }
191 template <
class T>
inline
void set(FT, FT)
Definition: samplingdata.h:170
#define mIsUdf(val)
Use mIsUdf to check for undefinedness of simple types.
Definition: undefval.h:289
SamplingData(T sa=0, T se=1)
Definition: samplingdata.h:56
bool operator!=(const SamplingData &) const
Definition: samplingdata.h:111
void set(const SamplingData< FT > &)
Definition: samplingdata.h:182
StepInterval< T > interval(IT nrsamples) const
Definition: samplingdata.h:117
#define mDefEps
Definition: commondefs.h:71
SamplingData(const SamplingData< FT > &)
Definition: samplingdata.h:71
bool operator==(const SamplingData &) const
Definition: samplingdata.h:86
Interval with step.
Definition: commontypes.h:32
T atIndex(IT) const
Definition: samplingdata.h:164
void scale(T)
Definition: samplingdata.h:187
#define mIsZero(x, eps)
Definition: commondefs.h:66
#define mClass(module)
Definition: commondefs.h:181
SamplingData(const StepInterval< FT > &)
Definition: samplingdata.h:80
Holds the fundamental sampling info: start and interval.
Definition: samplingdata.h:22
float getfIndex(FT) const
Definition: samplingdata.h:126
T snap(FT) const
Definition: samplingdata.h:158
T start
Definition: samplingdata.h:49
int nearestIndex(FT) const
Definition: samplingdata.h:138
#define mCast(tp, v)
Definition: commondefs.h:137
bool isUdf() const
Definition: samplingdata.h:192
void set(const StepInterval< FT > &)
Definition: samplingdata.h:176
int nrSteps(FT) const
Definition: samplingdata.h:132
int indexOnOrAfter(FT, float eps=(1e-10)) const
Definition: samplingdata.h:144
SamplingData(T x0, T y0, T x1, T y1)
Definition: samplingdata.h:62
T step
Definition: samplingdata.h:50
#define mNINT32(x)
Definition: commondefs.h:58
T step
Definition: ranges.h:200
Generated at
for the OpendTect
seismic interpretation project.
Copyright (C): dGB Beheer B.V. 1995-2021