 |
OpendTect
6.6
|
Go to the documentation of this file.
33 , annotinsiderg_(inside)
34 { setDataRange( dr ); }
47 : sd_(start,step), stop_(st_op)
48 , annotinsiderg_(false)
49 , annotinint_(false) {}
52 : sd_(rg.start,rg.step)
54 , annotinsiderg_(false)
55 , annotinint_(false) {}
58 T findEnd(T datastop)
const;
62 template <
class T>
inline
67 template <
class T>
inline
71 sd_.start = intv.start;
72 const bool rev = intv.start > intv.stop;
73 if ( rev )
Swap( intv.start, intv.stop );
74 T wdth = intv.width();
78 T indic = intv.start + wdth;
79 T indic_start = intv.start;
81 indic = 1 - indic_start / indic;
84 sd_.start = intv.start - 1;
86 stop_ = intv.start + 1;
90 double scwdth = wdth < 1e-30 ? -30 : log10( (
double)wdth );
91 int tenpow = 1 - (int)scwdth;
if ( scwdth < 0 ) tenpow++;
93 scwdth = wdth * stepfac;
96 if ( scwdth < 15 ) scstep = annotinint_ ? 2. : 2.5;
97 else if ( scwdth < 30 ) scstep = 5;
98 else if ( scwdth < 50 ) scstep = 10;
101 sd_.step = (T) ( scstep / stepfac );
104 int istep =
mNINT32( sd_.step );
116 if ( annotinsiderg_ )
118 idx0 = rev ?
Math::Floor(intv.stop / sd_.step + 1e-6)
123 idx0 = rev ?
Math::Ceil(intv.stop / sd_.step + 1e-6)
127 sd_.start =
mNINT32( idx0 ) * sd_.step;
129 if ( rev ) sd_.step = -sd_.step;
131 stop_ = findEnd( rev ? intv.start : intv.stop );
135 template <
class T>
inline
139 const bool rev = worksd.
step < 0;
144 datastop = -datastop;
147 if ( worksd.
start + 10000 * worksd.
step < datastop )
150 const double dnrsteps = double(datastop-worksd.
start)/worksd.
step - 1e-6;
154 if ( nrsteps < 1 ) nrsteps = 1;
155 T wdth = nrsteps * worksd.
step;
156 return sd_.start + (rev ? -wdth : wdth);
void setDataRange(const Interval< T > &)
Definition: axislayout.h:68
void Swap(T &a, T &b)
Definition: commondefs.h:46
bool annotinsiderg_
Definition: axislayout.h:42
AxisLayout(const StepInterval< T > &rg)
Definition: axislayout.h:51
#define mDefEps
Definition: commondefs.h:71
T stop_
Definition: axislayout.h:40
if(!noudf_ &&(mIsUdf(inpval)))
Definition: arrayndalgo.h:1682
T findEnd(T datastop) const
Definition: axislayout.h:136
iT IntPowerOf(iT i, iPOW p)
Definition: math2.h:121
StepInterval< T > getSampling() const
Definition: axislayout.h:63
SamplingData< T > sd_
Definition: axislayout.h:39
AxisLayout(const Interval< T > &dr, bool asint=false, bool inside=false)
Definition: axislayout.h:30
Interval with step.
Definition: commontypes.h:32
AxisLayout(T start=0, T st_op=1, T step=1)
Definition: axislayout.h:45
#define mIsZero(x, eps)
Definition: commondefs.h:66
#define mClass(module)
Definition: commondefs.h:181
Holds the fundamental sampling info: start and interval.
Definition: samplingdata.h:22
T start
Definition: samplingdata.h:49
bool annotinint_
Definition: axislayout.h:41
Interval of values.
Definition: commontypes.h:30
T step
Definition: samplingdata.h:50
#define mNINT32(x)
Definition: commondefs.h:58
Helps making nice axes for graphs.
Definition: axislayout.h:27
Generated at
for the OpendTect
seismic interpretation project.
Copyright (C): dGB Beheer B.V. 1995-2021