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;
double high() const
Returns the maximum of the range object.
BinnerAxisLinear()
The default constructor.
virtual bool hasEqualWidths() const
Returns true.
virtual double calcOffset(int parm, bool dragging) const
Calculates and returns a double corresponding to a bin offset when dragging a slider control...
virtual void setConstWid()
Sets the constant width parameter.
void setStartRange(bool dragging) const
Sets the starting Range.
Range m_range
The range of the bins.
virtual double getCoordinate(int i) const
Returns the coordinate.
virtual int getNob(double wid) const
Returns the number of bins given the width parameter width.
virtual int axisBinNumber(double x) const
Returns the number of the bin in which the x value is situated.
virtual double getBinWidth() const
Returns the bin 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.
double m_width
The width parameter for the binning.
virtual double calcWidthParm(int number) const
Calculates the bin width parameter given the number of bins.
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.
virtual double getOffset() const
Returns the offset.
virtual const void setOffset(double offset)
Sets the offset and adjusts the range accordingly.
virtual double axisBinWidth(int i) const
Returns the width of each bin.
virtual double getConstWid() const
Returns the constant width parameter.
double low() const
Returns the minimum of the range object.
double m_offset
The offset.
hippodraw::BinnerAxisLinear class interface
BinnerAxis * clone()
The clone function returns an object of its own kind which is a copy of this object at this moment...
Expresses a range of values.
virtual double scaleFactorWid()
Returns the bin width associated with the scale factor - in the case of linear binning, this is the const.
virtual const Range & setRange(const Range &, bool hold_width=true)
int m_num_bins
The number of bins.
int numberOfBins(double width) const
Returns the number of bins of width width required to fill the range.
virtual ~BinnerAxisLinear()
The destructor.
The class for the constant width bins.