rwlogo
Rogue Wave Views 5.5.1

Rogue Wave Views
Charts Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IlvCallbackChartFunction Class Reference

Class for data sets described by a callback function. More...

#include <ilviews/charts/data.h>

Inheritance diagram for IlvCallbackChartFunction:
IlvAbstractChartFunction IlvChartDataSet

List of all members.

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.

Detailed Description

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).

See also:
IlvAbstractChartFunction, IlvDoubleFunction, IlvPointInfoCollection.

Constructor & Destructor Documentation

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.

Parameters:
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.

Parameters:
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.

Member Function Documentation

IlvDoubleFunction IlvCallbackChartFunction::getFunction (  )  const

Returns the function used to describe the data points.

Returns:
The function used to describe the data points for the considered data set.
Warning:
[note] This function is a callback of the type 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.

Parameters:
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.

Returns:
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.

Parameters:
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.