14 #include "msdevstudio/MSconfig.h"
22 using namespace hippodraw;
30 m_num_bins ( s_num_bins ),
38 : m_name ( binner.m_name ),
40 m_num_bins( binner.m_num_bins ),
41 m_range ( binner.m_range ),
42 m_offset ( binner.m_offset ),
43 m_width ( binner.m_width )
134 double multiplier = ( 50 - parm ) / 50.0;
136 if ( num_start == 1 ) {
139 double num_new = num_start + num_start * multiplier;
141 num_new = std::max ( 1.0, num_new );
virtual bool hasEqualWidths() const
Returns true if all the bins have the same width.
BinnerAxis(const BinnerAxis &binner)
The copy constructor.
double high() const
Returns the maximum of the range object.
virtual int getNob(double width) const =0
Returns the number of bins given the width parameter width.
void setStartWidth(bool dragging) const
Sets the starting width parameter.
const Range & getRange() const
Returns the range.
virtual ~BinnerAxis()
The destructor.
const std::string m_name
The name of the binner.
Range m_range_start
The Range at the start of dragging.
virtual const std::vector< double > & binEdges()
Returns the vector of coordinates of the bin edges i.e returns the member m_edges.
virtual double axisBinWidth(int i) const =0
Returns the width of each bin.
static int s_num_bins
The default number of bins.
static double s_bin_factor
The scale factor used to calculate new bin width from slider.
int axisNumberOfBins() const
Returns the number of bins.
std::vector< double > m_bin_edges
The coordinates of the edges of bins.
void setStartRange(bool dragging) const
Sets the starting Range.
double axisGetLow() const
Returns the lower edge of the first bin.
Range m_range
The range of the bins.
double m_width
The width parameter for the binning.
The base class for the BinnerAxis hierarchy.
double low() const
Returns the minimum of the range object.
double m_width_start
The width parameter at the start of dragging.
Expresses a range of values.
double axisGetHigh() const
Returns the lower edge of the last + 1 bin.
int m_num_bins
The number of bins.
virtual double calcWidthParm(int number) const =0
Calculates the bin width parameter given the number of bins.
bool m_dragging
The status of dragging.
hippodraw::BinnerAxis class interface
const std::string & name() const
Returns the name of this binner.
double calcBinWidth(int parm, bool dragging) const
Calculates the bin width parameter when dragging a slider control.