#include <BinsFunction.h>
Collaboration diagram for BinsFunction:
Oded Wurman <oded@slac.stanford.edu>
Definition at line 39 of file BinsFunction.h.
Public Member Functions | |
BinsFunction (const BinsFunction &binner) | |
The copy constructor. | |
BinsFunction (int num_bins=10, double low=0.0, double high=50.0) | |
The constructor that creates the binner object with the number of bins = num_bins, low edge of first bin = low, and low edge of ( last bin + 1 ) = high (in other words, the high edge of the last bin). | |
virtual BinsFunction * | clone () const |
The clone function returns an object of its own kind which is a copy of this this object at this moment. | |
virtual void | createValuesArray (std::list< std::vector< double > > &array) |
Creates the array of projected values. | |
void | setFunction (FunctionBase *) |
Sets the function to be projected. | |
virtual void | setNumberOfBins (hippodraw::Axes::Type axis, int num_bins) |
virtual const Range & | setRange (hippodraw::Axes::Type axis, const Range &, bool hold_width=true) |
void | setRangeOn (hippodraw::Axes::Type axis, const Range &data, const Range &view) |
Sets the range over which the function will be plotted. | |
virtual | ~BinsFunction () |
The destructor. | |
Protected Member Functions | |
void | resize (unsigned int new_size, std::list< std::vector< double > > &values) |
Resizes the values list. | |
void | smoothCurve (std::list< std::vector< double > > &) |
Smoothes the appearance of the function line segments. | |
Protected Attributes | |
FunctionBase * | m_function |
The function to be projected. | |
int | m_num_bins |
The number of bins. | |
bool | m_values_dirty |
The dirty flag. | |
Range | m_x_range |
The range of the bins on the X axis. | |
Range | m_xv_range |
The range in the display device's coordinate system. | |
Range | m_y_range |
The range of values on the Y axis. | |
Range | m_yv_range |
The range in the display device's coordinate system. |
|
The constructor that creates the binner object with the number of bins = num_bins, low edge of first bin = low, and low edge of ( last bin + 1 ) = high (in other words, the high edge of the last bin). This is used as a starting point. Definition at line 46 of file BinsFunction.cxx. References m_values_dirty, setNumberOfBins(), and hippodraw::Axes::X. Referenced by clone(). |
|
The copy constructor.
Definition at line 53 of file BinsFunction.cxx. |
|
The destructor.
Definition at line 59 of file BinsFunction.cxx. |
|
The clone function returns an object of its own kind which is a copy of this this object at this moment.
Definition at line 63 of file BinsFunction.cxx. References BinsFunction(). |
|
Creates the array of projected values.
Definition at line 92 of file BinsFunction.cxx. References Range::length(), Range::low(), m_function, m_num_bins, m_values_dirty, m_x_range, resize(), smoothCurve(), hippodraw::Axes::X, and hippodraw::Axes::Y. Referenced by FunctionProjector::prepareValues(). |
|
Resizes the values list. The new size will be new_size. Definition at line 83 of file BinsFunction.cxx. References hippodraw::DataPoint2DTuple::SIZE. Referenced by createValuesArray(). |
|
Sets the function to be projected.
Definition at line 230 of file BinsFunction.cxx. References m_function, and m_values_dirty. Referenced by FunctionProjector::prepareValues(). |
|
Definition at line 70 of file BinsFunction.cxx. References m_num_bins, m_values_dirty, and hippodraw::Axes::X. Referenced by BinsFunction(), and FunctionProjector::setNumberOfBins(). |
|
Definition at line 215 of file BinsFunction.cxx. References m_values_dirty, m_x_range, m_y_range, hippodraw::Axes::X, and hippodraw::Axes::Y. Referenced by FunctionProjector::setAxisModel(), and FunctionProjector::setRange(). |
|
Sets the range over which the function will be plotted. The first range is in the coordinate system of the data. The second range is in the coordinate system of the display device. Definition at line 197 of file BinsFunction.cxx. References m_values_dirty, m_x_range, m_xv_range, m_y_range, m_yv_range, hippodraw::Axes::X, and hippodraw::Axes::Y. Referenced by FunctionProjector::prepareAxis(). |
|
Smoothes the appearance of the function line segments. Starting with the first point, the angle between the line segment from it and the next, and the line between the next and the one after it, is calculated. If this angle is smaller than the predetermined angle, which depends on the resolution of the display device, then one proceeds to the next point. If not, then a comparison is made between the length along the X axis of the two line segments. A point is inserted in the middle of the longer one and another iteration is performed until the angle is smaller than the predetermined angle. This algorithm was first implemented by Paul Rensing when he was at SLAC in 1993. Definition at line 133 of file BinsFunction.cxx. References std::abs(), Range::length(), m_function, M_PI, m_x_range, m_xv_range, m_y_range, m_yv_range, hippodraw::DataPoint2DTuple::SIZE, hippodraw::Axes::X, and hippodraw::Axes::Y. Referenced by createValuesArray(). |
|
The function to be projected.
Definition at line 63 of file BinsFunction.h. Referenced by createValuesArray(), setFunction(), and smoothCurve(). |
|
The number of bins.
Definition at line 44 of file BinsFunction.h. Referenced by createValuesArray(), and setNumberOfBins(). |
|
The dirty flag.
Definition at line 66 of file BinsFunction.h. Referenced by BinsFunction(), createValuesArray(), setFunction(), setNumberOfBins(), setRange(), and setRangeOn(). |
|
The range of the bins on the X axis. This controls the range over which the function is plotted. Definition at line 48 of file BinsFunction.h. Referenced by createValuesArray(), setRange(), setRangeOn(), and smoothCurve(). |
|
The range in the display device's coordinate system. This is used as part of the algorithm of the curved functions. Definition at line 56 of file BinsFunction.h. Referenced by setRangeOn(), and smoothCurve(). |
|
The range of values on the Y axis. The projected values are not generated outside of this range. Definition at line 52 of file BinsFunction.h. Referenced by setRange(), setRangeOn(), and smoothCurve(). |
|
The range in the display device's coordinate system. This is used as part of the algorithm of the curved functions. Definition at line 60 of file BinsFunction.h. Referenced by setRangeOn(), and smoothCurve(). |