25 using namespace hippodraw;
71 double f = 1.0 + ( x - lo ) / width;
72 int i = static_cast <
int > ( f );
73 i = std::max ( i, 0 );
98 assert ( width > 0.0 );
112 ( static_cast < double > ( number ) );
122 return ( parm - 50 ) / 50.0;
136 double change = offset - oldoff;
138 if( offset == 0.0 )
return;
205 = static_cast <
int > ( std::floor ( range.
length () / width + 0.5 ) );
208 = static_cast <
int > ( floor ( range.
length() / width + 0.5 ) );
211 return tmp ? tmp : 1;
218 return tmp ? tmp : 1;
Range m_range
The range of the bins.
virtual int axisBinNumber(double x) const
Returns the number of the bin in which the x value is situated.
virtual const Range & setRange(const Range &, bool hold_width=true)
double high() const
Returns the maximum of the range object.
double m_offset
The offset.
virtual double getConstWid() const
Returns the constant width parameter.
hippodraw::BinnerAxisLinear class interface
Expresses a range of values.
The class for the constant width bins.
virtual double getOffset() const
Returns the offset.
double m_width
The width parameter for the binning.
virtual double getBinWidth() const
Returns the bin width parameter.
virtual double axisBinWidth(int i) const
Returns the width of each bin.
BinnerAxis * clone()
The clone function returns an object of its own kind which is a copy of this object at this moment...
virtual double scaleFactorWid()
Returns the bin width associated with the scale factor - in the case of linear binning, this is the const.
BinnerAxisLinear()
The default constructor.
void setStartRange(bool dragging) const
Sets the starting Range.
virtual double calcOffset(int parm, bool dragging) const
Calculates and returns a double corresponding to a bin offset when dragging a slider control...
int m_num_bins
The number of bins.
virtual double getCoordinate(int i) const
Returns the coordinate.
virtual bool hasEqualWidths() const
Returns true.
virtual void setConstWid()
Sets the constant width parameter.
void setLength(double val, bool high_hold=false)
Sets the length of the range.
virtual const Range & setBinWidth(double width)
Sets the bin width and adjusts the range and number of bins accordingly.
virtual ~BinnerAxisLinear()
The destructor.
The base class for the BinnerAxis hierarchy.
virtual void axisSetNumberOfBins(int nb)
Sets m_num_bins.
double length() const
Returns the length of the range object.
double low() const
Returns the minimum of the range object.
virtual int getNob(double wid) const
Returns the number of bins given the width parameter width.
int numberOfBins(double width) const
Returns the number of bins of width width required to fill the range.
virtual const void setOffset(double offset)
Sets the offset and adjusts the range accordingly.
virtual double calcWidthParm(int number) const
Calculates the bin width parameter given the number of bins.