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