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