Rogue Wave Views 5.5.1 |
Rogue Wave Views |
Rogue Wave Views Documentation Home |
Class for data sets described by a callback function. More...
#include <ilviews/charts/data.h>
Public Member Functions | |
IlvCallbackChartFunction (const IlvCoordInterval &xRange, IlUInt count, IlvDoubleFunction f, const char *name=0, IlvPointInfoCollection *ptInfoCollection=0) | |
Constructor. | |
IlvCallbackChartFunction (const char *name=0, IlvPointInfoCollection *ptInfoCollection=0) | |
Constructor. | |
IlvDoubleFunction | getFunction () const |
Returns the function used to describe the data points. | |
virtual void | getPoint (IlUInt i, IlvDoublePoint &point) const |
Returns a data point. | |
virtual IlBoolean | isFunctionDefined () const |
Indicates whether the function describing the data is defined. | |
void | setFunction (IlvDoubleFunction function) |
Sets the function used to describe the data points. |
Class for data sets described by a callback function.
Library: ilvcharts
This class is a subclass of IlvAbstractChartFunction
for which the data points are described by a function of the type y = f(x) defined by a callback. The used callback must be of the type IlvDoubleFunction
.
The abscissa of the nth data point of the data set is obtained by the following formula:
x = ((_xMax - _xMin) / (_dataCount -1)) * i + _xMin,
where _xMin
and _xMax
are the minimum and the maximum values considered for the abscissa and _dataCount
is the number of considered data points. The ordinate is equal to f(x)
.
IlvCallbackChartFunction::IlvCallbackChartFunction | ( | const char * | name = 0 , |
|
IlvPointInfoCollection * | ptInfoCollection = 0 | |||
) |
Constructor.
Initializes a new IlvCallbackChartFunction
object. The function and the data count are set by default to 0
.
name | If not 0 , this string becomes the name of the created data set. The name passed as a parameter is copied. | |
ptInfoCollection | The object used to manage the point information for the created data set. |
IlvCallbackChartFunction::IlvCallbackChartFunction | ( | const IlvCoordInterval & | xRange, | |
IlUInt | count, | |||
IlvDoubleFunction | f, | |||
const char * | name = 0 , |
|||
IlvPointInfoCollection * | ptInfoCollection = 0 | |||
) |
Constructor.
Initializes a new IlvCallbackChartFunction
object.
xRange | The values interval considered for the abscissa. | |
count | The data count. | |
f | The function used to define the data points. | |
name | If not 0 , this string becomes the name of the created data set. The name passed as a parameter is copied. | |
ptInfoCollection | The object used to manage the point information of the created data set. |
IlvDoubleFunction IlvCallbackChartFunction::getFunction | ( | ) | const |
Returns the function used to describe the data points.
IlvDoubleFunction
. virtual void IlvCallbackChartFunction::getPoint | ( | IlUInt | i, | |
IlvDoublePoint & | point | |||
) | const [virtual] |
Returns a data point.
Returns in point the point of index i for the current data set. This point is defined as follows:
IlDouble x = ((_xMax - _xMin) / ( _dataCount -1)) * i + _xMin; IlDouble y = _function ? _function(x) : _yMin; point.x(x); point.y(y);
where _xMin
and _xMax
are the minimum and the maximum values considered for the abscissa, _dataCount
is the number of considered data points, _function
the defined function, and _yMin
the minimum value of the ordinate for all the considered data.
i | The index of the returned data point. | |
point | The returned data point. |
Implements IlvChartDataSet.
virtual IlBoolean IlvCallbackChartFunction::isFunctionDefined | ( | ) | const [virtual] |
Indicates whether the function describing the data is defined.
IlTrue
if the function describing the data is defined and IlFalse
otherwise. Reimplemented from IlvAbstractChartFunction.
void IlvCallbackChartFunction::setFunction | ( | IlvDoubleFunction | function | ) |
Sets the function used to describe the data points.
function | The new function used to describe the data points of the current data set. This function should be a callback of the type IlvDoubleFunction . |
© Copyright 2012, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.