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 );
double pos() const
Returns the first positive element in range.
AxisModelLinear(AxisLoc label, AxisLoc scale)
The constructor sets the location of the ticks, labels, and scale.
Range m_start_range
The starting range before start of dragging events.
virtual const Range & adjustLogValues()
Adjusts the range for nice logging.
double high() const
Returns the maximum of the range object.
Expresses a range of values.
Range m_range
The current range of the axis.
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.
virtual Range calcHigh(int parm, bool dragging=false)
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.
bool m_use_pmag
A flag to indicate that one will using scientific notation.
AxisTick class interface.
void setIntersectRange(const Range &, const Range &)
Sets the Range to overlap of the two ranges.
virtual const Range & adjustValues(const Range &)
Sets the number of minor ticks that are between the major ones.
hippodraw::AxisModelLinear class interface
~AxisModelLinear()
The destructor.
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 length() const
Returns the length of the range object.
double low() const
Returns the minimum of the range object.
virtual AxisModelBase * clone() const
The clone function returns an object of its own kind which is a copy of this object at this moment...
virtual Range calcLow(int parm, bool dragging=false)
The AxisModelBase class maintains the Range and scaling of an axis.