18 #include "msdevstudio/MSconfig.h"
88 double step, magnitude;
95 float nice[N_NICE] = { 1.0, 2.0, 2.5,
99 double low = init_range.
low ();
100 double high = init_range.
high ();
102 if ( low > 0.0 ) low *= 0.95;
105 if ( high > 0.0 ) high *= 1.05;
122 mylow = low - 0.05*(high-low);
123 myhigh = high + 0.05*(high-low);
125 range_length = myhigh - mylow;
131 if( low >= 0.0 && range_length > ( 1.05 * high ) ) {
132 Range range ( 0.0, range_length );
136 if( high <= 0.0 && -range_length < ( 1.05 * low ) ) {
137 Range range ( -range_length, 0.0 );
146 magnitude = ceil( log10( abs( myhigh ) ) );
148 magnitude = ceil( log10( abs( mylow ) ) );
154 step = nice[
i] * pow( 10.0, magnitude );
155 mylow = floor( low / step ) * step;
156 myhigh = mylow + 1.05 * range_length;
162 }
while( myhigh < high );
164 Range range ( mylow, myhigh, init_range.
pos() );
188 double multiplier = ( parm - 50 ) / 50.0;
189 double new_low = min ( low + length * multiplier, high );
206 double multiplier = ( parm - 50 ) / 50.0;
207 double new_high = max ( high + length * multiplier, low );
virtual Range calcHigh(int parm, bool dragging=false)
double high() const
Returns the maximum of the range object.
virtual const Range & adjustLogValues()
Adjusts the range for nice logging.
hippodraw::AxisModelLinear class interface
virtual bool needPMag() const
The following functions are used by the AxisRepBase * object.
virtual bool isLog() const
Returns false because this class represents a linear scale.
Range m_start_range
The starting range before start of dragging events.
~AxisModelLinear()
The destructor.
void setRange(double low, double high, double pos)
Sets the Range to the low and high values.
AxisLoc
The base class for the binner hierarchy.
The AxisModelBase class maintains the Range and scaling of an axis.
double length() const
Returns the length of the range object.
void startDragging(bool dragging)
Sets the member m_start_dragging to the current range if dragging is starting.
virtual const Range & adjustValues(const Range &)
Sets the number of minor ticks that are between the major ones.
virtual Range calcLow(int parm, bool dragging=false)
bool m_use_pmag
A flag to indicate that one will using scientific notation.
const Range & getRange(bool scaled) const
Returns the range represented by this AxisModel.
double low() const
Returns the minimum of the range object.
Expresses a range of values.
Range m_range
The current range of the axis.
void setIntersectRange(const Range &, const Range &)
Sets the Range to overlap of the two ranges.
double pos() const
Returns the first positive element in range.
virtual AxisModelBase * clone() const
The clone function returns an object of its own kind which is a copy of this object at this moment...
AxisModelLinear(AxisLoc label, AxisLoc scale)
The constructor sets the location of the ticks, labels, and scale.
AxisTick class interface.