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