Rogue Wave Views Charts Package API Reference Guide |
Rogue Wave Views Documentation Home |
Class for data sets described by a script function. More...
#include <ilviews/charts/scriptft.h>
Public Member Functions | |
IlvScriptChartFunction (const char *name=0, IlvPointInfoCollection *ptInfoCollection=0) | |
Constructor. More... | |
IlvScriptChartFunction (const IlvCoordInterval &xRange, IlUInt count, const char *scriptFunctionName, IlvGraphicHolder *holder, const IlSymbol *scriptLanguageName=0, const char *name=0, IlvPointInfoCollection *ptInfoCollection=0) | |
Constructor. More... | |
virtual | ~IlvScriptChartFunction () |
Destructor. More... | |
IlBoolean | callScriptFunction (IlDouble x, IlDouble &y) const |
Computes the ordinate value of a data point from the abscissa value. More... | |
IlvGraphicHolder * | getHolder () const |
Returns the holder in which the script function is defined. More... | |
virtual void | getPoint (IlUInt i, IlvDoublePoint &point) const |
Returns a data point. More... | |
IlvScriptContext * | getScriptContext () const |
Returns the script context in which the script function is defined. More... | |
const char * | getScriptFunctionName () const |
Returns the script function name. More... | |
const IlSymbol * | getScriptLanguageName () const |
Returns the name of the scripting language used to write the script function. More... | |
virtual IlBoolean | isFunctionDefined () const |
Indicates whether the script function describing the data is defined. More... | |
void | setHolder (IlvGraphicHolder *holder) |
Sets the holder in which the script function is defined. More... | |
void | setScriptFunctionName (const char *name) |
Sets the script function name. More... | |
void | setScriptLanguageName (const IlSymbol *name) |
Sets the name of the scripting language used to write the script function. More... | |
Public Member Functions inherited from IlvAbstractChartFunction | |
virtual IlUInt | getDataCount () const |
Returns the number of defined data items. More... | |
IlDouble | getXMax () const |
Returns the maximum value considered for the abscissa. More... | |
IlDouble | getXMin () const |
Returns the minimum value considered for the abscissa. More... | |
virtual IlBoolean | isIncreasingOnX () const |
Indicates whether the managed data has increasing abscissa values. More... | |
void | setDataCount (IlUInt count) |
Sets the number of considered data points. More... | |
void | setXMax (IlDouble max) |
Sets the maximum value considered for the abscissa. More... | |
void | setXMin (IlDouble min) |
Sets the minimum value considered for the abscissa. More... | |
virtual void | write (IlvOutputFile &) const |
Writes the attributes of the current object in a file. More... | |
Public Member Functions inherited from IlvChartDataSet | |
virtual | ~IlvChartDataSet () |
Destructor. More... | |
void | addListener (IlvChartDataSetListener *listener) |
Adds a listener. More... | |
IlBoolean | addPoint (const IlvDoublePoint &point, IlvChartDataPointInfo *pointInfo=0, IlBoolean copyPointInfo=IlFalse) |
Adds a represented data point (and its associated point information object if any). More... | |
IlBoolean | areListenersEnabled () const |
Indicates whether the listeners are enabled. More... | |
virtual IlvChartDataSet * | copy () const =0 |
Creates and returns a copy of the current object. More... | |
virtual void | dataAllPointsRemoved () |
Performs the necessary updates when all data points are removed. More... | |
virtual void | dataPointAdded (IlUInt position) |
Performs the necessary updates when a new data point is added. More... | |
virtual void | dataPointChanged (IlUInt ptidx, IlBoolean beforeChange) |
Performs the necessary updates when a data point is changed. More... | |
virtual void | dataPointRemoved (IlUInt ptidx) |
Performs the necessary updates when a data point is removed. More... | |
void | enableListeners (IlBoolean b) |
Specifies whether the listeners should be enabled. More... | |
virtual void | endBatch () |
Specifies the end of a set of modifications. More... | |
IlUInt | getAddMaxIdx () const |
Returns the maximum index of the data points that have been added between the first call of the startBatch() method and the last call of the endBatch() method. More... | |
IlUInt | getAddMinIdx () const |
Returns the minimum index of the data points that have been added between the first call of the startBatch() method and the last call of the endBatch() method. More... | |
void | getBoundingValues (IlvCoordInterval &xRange, IlvCoordInterval &yRange) const |
Returns the bounding values of the managed data. More... | |
IlvChartDataSetListener *const * | getListeners (IlUInt &count) const |
Returns all the listeners. More... | |
IlUInt | getMaxCount () const |
Returns the maximum number of data items that can be managed. More... | |
const char * | getName () const |
Returns the name of the current data set. More... | |
IlvChartDataPointInfo * | getPointInfo (IlUInt ptidx) const |
Returns the point information associated with a data item. More... | |
IlvPointInfoCollection * | getPointInfoCollection () const |
Returns the object used to manage the point information. More... | |
IlUInt | getPointInfoCount () const |
Returns the number of defined point information items. More... | |
IlvDoublePoint * | getPoints (IlUInt &count) const |
Returns all the represented data points. More... | |
virtual IlvDoublePoint * | getPointsBetween (IlUInt indexMin, IlUInt indexMax, IlUInt &count) const |
Returns some of the data points represented by the current data set. More... | |
virtual IlvDoublePoint * | getPointsInRange (IlUInt &count, IlUInt *&dataPointIndexes, const IlvCoordInterval &xRange, const IlvCoordInterval &yRange, IlBoolean needContinuity) const |
Returns a range of data points represented by the current data set. More... | |
virtual const IlvCoordInterval & | getXRange () const |
Returns the abscissa bounding values of the managed data. More... | |
virtual const IlvCoordInterval & | getYRange () const |
Returns the ordinate bounding values of the managed data. More... | |
virtual IlBoolean | insertPoint (const IlvDoublePoint &point, IlUInt ptidx, IlvChartDataPointInfo *pointInfo=0, IlBoolean copyPointInfo=IlFalse) |
Inserts a represented data point (and its associated point information object if any). More... | |
virtual IlBoolean | insertPoints (IlUInt count, const IlvDoublePoint *points, IlUInt position=IlvLastPositionIndex, IlvChartDataPointInfo *const *pInfos=0, IlBoolean copyPointInfo=IlFalse) |
Inserts several represented data points (and their associated point information objects if any). More... | |
IlBoolean | isLimited () const |
Indicates whether the number of managed data items is limited. More... | |
virtual IlBoolean | isRemovalAllowed () const |
Indicates whether managed data can be removed. More... | |
virtual IlBoolean | isWritable () const |
Indicates whether managed data can be modified. More... | |
void | lock () |
Locks the current IlvChartDataSet object. More... | |
void | removeAllPointInfo () |
Removes all the defined point information. More... | |
virtual void | removeAllPoints () |
Removes all the represented data points (and their associated point information objects if any). More... | |
IlvChartDataSetListener * | removeListener (IlvChartDataSetListener *l) |
Removes a listener. More... | |
void | removeListeners () |
Removes all the listeners. | |
virtual IlBoolean | removePointAndInfo (IlUInt ptidx) |
Removes a represented data point (and its associated point information object if any). More... | |
IlBoolean | removePointInfo (IlUInt ptidx) |
Removes the point information associated with a data item. More... | |
virtual void | removePointsAndInfo () |
Removes all the represented data points (and their associated point information objects if any). More... | |
IlvOutputFile & | save (IlvOutputFile &file) const |
Writes a complete description of the current object in a file. More... | |
void | setMaxCount (IlUInt maxCount) |
Sets the maximum number of managed data items. More... | |
void | setName (const char *name) |
Sets the name of the current data set. More... | |
virtual IlBoolean | setPoint (IlUInt ptidx, const IlvDoublePoint &point) |
Sets a represented data point. More... | |
IlBoolean | setPointInfo (IlUInt ptidx, IlvChartDataPointInfo *pointInfo, IlBoolean copyPointInfo=IlFalse) |
Sets the point information associated with a data item. More... | |
void | setPointInfoCollection (IlvPointInfoCollection *ptic) |
Sets the object used to manage the point information. More... | |
virtual void | startBatch () |
Specifies the beginning of a set of modifications. More... | |
void | unLock () |
Unlocks the current IlvChartDataSet object. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from IlvChartDataSet | |
static IlvChartDataSet * | Load (IlvInputFile &file) |
Reads a data set object from a file. More... | |
Protected Member Functions inherited from IlvAbstractChartFunction | |
IlvAbstractChartFunction (const char *name=0, IlvPointInfoCollection *ptInfoCollection=0) | |
Initializes a new IlvAbstractChartFunction object. More... | |
IlvAbstractChartFunction (const IlvCoordInterval &xRange, IlUInt count, const char *name=0, IlvPointInfoCollection *ptInfoCollection=0) | |
Initializes a new IlvAbstractChartFunction object. More... | |
IlvAbstractChartFunction (IlvInputFile &file) | |
Initializes a new IlvAbstractChartFunction object from an input file. More... | |
IlvAbstractChartFunction (const IlvAbstractChartFunction &dataSet) | |
Initializes a new IlvAbstractChartFunction object as a copy of another IlvAbstractChartFunction . More... | |
Protected Member Functions inherited from IlvChartDataSet | |
IlvChartDataSet (const char *name=0, IlvPointInfoCollection *pointInfoCollection=0) | |
Initializes a new IlvChartDataSet object. More... | |
IlvChartDataSet (const IlvChartDataSet &dataSet) | |
Initializes a new IlvChartDataSet object as a copy of another IlvChartDataSet . More... | |
IlvChartDataSet (IlvInputFile &file) | |
Initializes a new IlvChartDataSet object from an input file. More... | |
void | computeBoundingValues () |
Computes the bounding values of the managed data. More... | |
virtual void | computeMinMaxValues (IlvCoordInterval &xRange, IlvCoordInterval &yRange) const |
Computes the abscissa and ordinate bounding values of the managed data. More... | |
Class for data sets described by a script function.
Library: ilvcharts
This is a subclass of IlvAbstractChartFunction
for which the data points are described by a function of the type y = f(x) defined by a script. The script function is retrieved by using its name and the holder of the script context in which the script function is written.
The abscissa of the nth data point of this data set is obtained by the following formula:
where _xMin
and _xMax
are the minimum and the maximum values for the abscissa, and _dataCount
is the number of data. The ordinate is equal to f(x)
.
IlvScriptChartFunction::IlvScriptChartFunction | ( | const char * | name = 0 , |
IlvPointInfoCollection * | ptInfoCollection = 0 |
||
) |
Constructor.
Initializes a new IlvScriptChartFunction
object. The script function name, the holder, and the data count are set to 0
.
The name of the scripting language used to write the script function is also set to 0
. In this case, the scripting language that will be used is the default one. This default language can be obtained by the IlvScriptLanguage::GetDefault
method.
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. |
IlvScriptChartFunction::IlvScriptChartFunction | ( | const IlvCoordInterval & | xRange, |
IlUInt | count, | ||
const char * | scriptFunctionName, | ||
IlvGraphicHolder * | holder, | ||
const IlSymbol * | scriptLanguageName = 0 , |
||
const char * | name = 0 , |
||
IlvPointInfoCollection * | ptInfoCollection = 0 |
||
) |
Constructor.
Initializes a new IlvScriptChartFunction
object.
xRange | The interval of values considered for the abscissa. |
count | The number of considered data points. |
scriptFunctionName | The name of the script function used to define the data points. |
holder | The holder that the script context in which the script function is written is associated with. If no holder is specified, the script context that will be used is the global script context. |
scriptLanguageName | The name of the scripting language used to write the script function. If no name is specified (that means that scriptFunctionName is equal to 0 ), the scripting language that will be used is the default one. This default language can be obtained by the IlvScriptLanguage::GetDefault method. |
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. |
|
virtual |
Destructor.
The destructor deletes the name of the script function and sets the pointer to the holder stored by the current object to 0
.
Computes the ordinate value of a data point from the abscissa value.
This method calls the defined script function with the parameter x and returns the result of the function in y.
x | The abscissa value of a given data point. |
y | The computed ordinate of the data point. |
IlTrue
if the call of the script function is successful. Otherwise, it returns IlFalse
. IlvGraphicHolder* IlvScriptChartFunction::getHolder | ( | ) | const |
Returns the holder in which the script function is defined.
The script function is defined in a given script context. This method returns the holder with which this script context is associated. The holder is used to retrieve the definition of the script function.
|
virtual |
Returns a data point.
Returns in point the point of index i for the current data set. This point is defined as follows:
where _xMin
and _xMax
are the minimum and the maximum values for the abscissa, _dataCount
is the number of data considered, 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.
IlvScriptContext* IlvScriptChartFunction::getScriptContext | ( | ) | const |
Returns the script context in which the script function is defined.
IlvScriptChartFunction::getScriptLanguageName
method or the default scripting language if no name is defined.IlvScriptContext::GetGlobal
method. const char* IlvScriptChartFunction::getScriptFunctionName | ( | ) | const |
Returns the script function name.
const IlSymbol* IlvScriptChartFunction::getScriptLanguageName | ( | ) | const |
Returns the name of the scripting language used to write the script function.
0
if no name is defined.IlvScriptLanguage::GetDefault()
method.
|
virtual |
Indicates whether the script function describing the data is defined.
IlTrue
if the script function describing the data is defined and IlFalse
otherwise. Reimplemented from IlvAbstractChartFunction.
void IlvScriptChartFunction::setHolder | ( | IlvGraphicHolder * | holder | ) |
Sets the holder in which the script function is defined.
The script function is defined in a given script context. This method sets the holder with which this script context is associated. The stored holder allows you to retrieve the definition of the script function.
holder | The new holder in which the script function is defined. |
void IlvScriptChartFunction::setScriptFunctionName | ( | const char * | name | ) |
Sets the script function name.
name | The name of the script function used to describe the data points for the considered data set. |
void IlvScriptChartFunction::setScriptLanguageName | ( | const IlSymbol * | name | ) |
Sets the name of the scripting language used to write the script function.
name | The new name of the scripting language used to write the script function. If name is equal to 0 , the scripting language that will be used is the default one. This default language can be obtained by the IlvScriptLanguage::GetDefault method. |
© Copyright 2018, 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.