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