14 #include "msdevstudio/MSconfig.h" 30 : m_range( 0.0, 1.0 ),
31 m_start_range ( -1.0, 1.0 ),
32 m_is_dragging ( false ),
33 m_auto_range ( true ),
35 m_scale_factor ( 1.0 ),
36 m_scaling_on ( false ),
39 m_num_minor_ticks( 0 ),
40 m_label_location( label ),
41 m_scale_location( scale ),
44 m_ticks( m_max_ticks ),
45 m_ticks_in_range(m_max_ticks),
164 const vector<AxisTick> &
183 for (
unsigned int i = 0; i<
size; i++ ) {
184 if ((
m_ticks[i].value()< range_high ) &&
185 (
m_ticks[i].value()> range_low ))
193 if ( low > high ) std::swap ( low, high );
208 Range myrange = range;
274 Range range ( low, high );
void setTicks(const std::vector< AxisTick > &ticks)
Sets the ticks for plotting.
void setTickStep(const double &t_step)
Sets the tick step.
void setScaleFactor(double)
Sets the value of the scale factor.
double getTickStep() const
Returns the tick step in the true coordinate system.
bool m_use_pmag
A flag to indicate that one will using scientific notation.
bool isScaling() const
Returns true if the axis is being scaled.
bool isAutoRanging() const
Returns true if auto-ranging is enabled; otherwise, returns false.
bool isAutoTicks() const
Returns true if position of the ticks should be automatically generated.
AxisModelBase(AxisLoc label, AxisLoc scale)
The constructor sets the location of the ticks, labels, and scale.
hippodraw::AxisModelBase class interface
double getPMag() const
Returns the magnitude of the power of ten for the tick labels.
bool m_scaling_on
If true, the axis is being scaled.
virtual void setUsePMag(const bool &use_p_mag)
Use to set the value of the member variable m_use_pmag.
void setFirstTick(const double &first_tick)
Sets the value for first tick step.
void setPMag(const double &pmag)
Sets the magnitude of the power of ten for the tick labels.
AxisTick class interface.
void setRMag(const double &rmag)
Sets the magnitude of the range.
void setAutoRanging(bool flag)
Sets the auto-ranging flag to flag.
void setRangePos(double)
The function which changes the pos member of m_range.
bool m_is_dragging
The current dragging state.
void setPos(double x)
Sets the first positive element in range.
bool m_auto_ticks
A flag set to true if ticks are being automatically generated.
void setScaling(bool on=true)
Sets axis scaling on if on is true.
double high() const
Returns the maximum of the range object.
double m_rmag
The value of the power of ten of the range to be used to determine how many decimal places are needed...
double m_scale_factor
The scale factor.
std::vector< AxisTick > m_ticks_in_range
Only work for non auto_ticks.
void setIntersect(const Range &range)
Forms the intersect with the range in the argument.
double getMaxTicks() const
Returns the value for maximum number of ticks.
virtual ~AxisModelBase()
The virtual destructor.
virtual bool isLog() const =0
Returns a boolean describing the type of the scale of the axis.
const std::vector< AxisTick > & getTicks() const
Returns a reference of generated ticks.
const int m_max_ticks
The maximum number of ticks.
void startDragging(bool dragging)
Sets the member m_start_dragging to the current range if dragging is starting.
intp size(numeric::array arr)
void setIntersectRange(const Range &, const Range &)
Sets the Range to overlap of the two ranges.
double m_pmag
The value of the power of ten to be used to multiply the tick labels.
double low() const
Returns the minimum of the range object.
AxisLoc
The base class for the binner hierarchy.
bool m_empty
A flag to indicate whether the range is empty.
bool m_auto_range
The auto-range flag.
void setRange(double low, double high, double pos)
Changes the current Range.
Expresses a range of values.
AxisLoc getScaleLocation() const
void setEmpty(bool yes=true)
Sets the range to empty.
virtual bool needPMag() const
The following functions are used by the AxisRepBase * object.
Range m_scaled_range
The scaled range.
Range m_range
The current range of the axis.
void adjustTicks()
Adjust ticks in non_auto_tick mode.
double getScaleFactor() const
Returns the scale factor.
void setRange(double low, double high, double pos)
Sets the Range to the low and high values.
AxisLoc getLabelLocation() const
virtual const Range & adjustLogValues()=0
Adjust the range for nice logging.
Range m_start_range
The starting range before start of dragging events.
std::vector< AxisTick > m_ticks
The list of generated ticks.
double getRMag() const
Sets the magnitude of the range.
double m_tick_step
The distance between two consecutive ticks.
double pos() const
Returns the first positive element in range.
void setAutoTicks(bool yes)
Sets flag to determine if tick positions should be automatically generated or not.
void setUnionRange(const Range &range)
Sets the range to be the union of the existing range and range.
double getFirstTick() const
Returns the value for the first tick step.
void setEmpty()
Sets the range to empty.
double m_first_tick
The position of the first tick.
The AxisModelBase class maintains the Range and scaling of an axis.
void setUnion(const Range &range)
Forms the union with the range range.
const Range & getRange(bool scaled) const
Returns the range represented by this AxisModel.