18 #include "msdevstudio/MSconfig.h"
37 using namespace hippodraw;
69 double low = range.
low();
70 double high = range.
high();
71 double rangeMag = high / low;
74 m_rmag = floor( log10( rangeMag ) );
77 m_pmag = ceil( log10( low ) );
81 double m_tmag = floor(
m_rmag / 3.0 );
106 double low = init_range.
low();
107 double high = init_range.
high();
109 myhigh = mylow = pow( 10.0,
m_pmag );
119 while( myhigh <= high * m_scale_factor ) {
125 if( myhigh / mylow < 10.0 ) {
131 while( myhigh / mylow < 10.0 ) {
138 Range new_range ( mylow, myhigh, init_range.
pos() );
143 double new_width = new_range.
length();
144 double init_width = init_range.
length();
146 if ( new_width > init_width * 10 ){
162 Range newRange ( low, high, init_range.
pos() );
187 double low = r.
low();
188 double high = r.
high();
189 double pos = r.
pos();
191 if( low > 0.0 )
return r;
195 double l = pos / 10.0;
196 double h = pos * 10.0;
201 if( pos == DBL_MAX || pos <= 0.0 ) {
213 if( tick_step == 1.0 ) {
214 int base =
static_cast<int>( current /
215 pow( 10.0, floor( log10( current ) ) ) );
244 current *= tick_step;
254 if( tick_step == 1.0 ) {
255 int base =
static_cast<int>( current /
256 pow( 10.0, floor( log10( current ) ) ) );
282 current /= tick_step;
296 double k = log10 ( high / low );
298 double x = ( parm - 50 ) / 50.0;
300 double new_low = low * pow ( 10.0, k * x );
302 new_low = max ( new_low, 10.0 * DBL_EPSILON );
303 new_low = min ( new_low, high - 100.0 * DBL_EPSILON );
319 double k = log10 ( high / low );
321 double multiplier = ( parm - 50 ) / 50.0;
323 double new_high = high * pow ( 10.0, k * multiplier );
double pos() const
Returns the first positive element in range.
Range m_start_range
The starting range before start of dragging events.
double m_rmag
The value of the power of ten of the range to be used to determine how many decimal places are needed...
virtual Range calcHigh(int parm, bool dragging=false)
double prevStep(double cur)
This returns the previous step for the ticks.
virtual const Range & adjustLogValues()
This function makes log values logical on a logarithmic scale.
double high() const
Returns the maximum of the range object.
Expresses a range of values.
Range m_range
The current range of the axis.
double m_scale_factor
The scale factor.
~AxisModelLog()
The destructor.
bool isLog() const
Returns true because this class represents a log scale.
const Range & getRange(bool scaled) const
Returns the range represented by this AxisModel.
void startDragging(bool dragging)
Sets the member m_start_dragging to the current range if dragging is starting.
double m_pmag
The value of the power of ten to be used to multiply the tick labels.
AxisTick class interface.
void setIntersectRange(const Range &, const Range &)
Sets the Range to overlap of the two ranges.
double nextStep(double cur)
This returns the next step for the ticks.
AxisLoc
The base class for the binner hierarchy.
void setRange(double low, double high, double pos)
Sets the Range to the low and high values.
double m_tick_step
The distance between two consecutive ticks.
virtual const Range & adjustValues(const Range &)
Adjusts the range on the axis to nice values within the Range limit.
virtual Range calcLow(int parm, bool dragging=false)
double getTickStep() const
Returns the tick step in the true coordinate system.
AxisModelLog class interface.
double length() const
Returns the length of the range object.
double low() const
Returns the minimum of the range object.
virtual void setTickStep()
Sets the tick step, and the magnitude power magnitude (the greatest magnitude that either the maximum...
AxisModelLog(AxisLoc label, AxisLoc scale)
The constructor sets the location of the ticks, labels, and scale.
The AxisModelBase class maintains the Range and scaling of an axis.
virtual AxisModelBase * clone() const
The clone function returns an object of its own kind which is a copy of this object at this moment...