rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Charts Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

List of all members | Public Member Functions | Protected Member Functions
IlvChartYValueSet Class Reference

Class for data sets described by a set of values. More...

#include <ilviews/charts/data.h>

Inheritance diagram for IlvChartYValueSet:
IlvChartDataSet

Public Member Functions

 IlvChartYValueSet (const char *name=0, IlvPointInfoCollection *ptInfoCollection=0)
 Constructor. More...
 
virtual ~IlvChartYValueSet ()
 Destructor. More...
 
IlBoolean addValue (IlDouble yValue, IlvChartDataPointInfo *pointInfo=0, IlBoolean copyPointInfo=IlFalse)
 Adds a data value (and its associated point information object if any). More...
 
virtual IlUInt getDataCount () const
 Returns the number of defined data items. More...
 
virtual void getPoint (IlUInt i, IlvDoublePoint &point) const
 Returns a represented data point. More...
 
virtual IlvDoublePointgetPointsBetween (IlUInt indexMin, IlUInt indexMax, IlUInt &count) const
 Returns some of the data points represented by the current data set. More...
 
void getValue (IlUInt i, IlDouble &yValue) const
 Returns a data value. 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...
 
IlBoolean insertValue (IlDouble yValue, IlUInt valueIndex, IlvChartDataPointInfo *pointInfo=0, IlBoolean copyPointInfo=IlFalse)
 Inserts a data value (and its associated point information object if any). More...
 
IlBoolean insertValues (IlUInt count, const IlDouble *yValues, IlUInt position=IlvLastPositionIndex, IlvChartDataPointInfo *const *pInfos=0, IlBoolean copyPointInfo=IlFalse)
 Inserts several values (and their associated point information objects if any). More...
 
virtual IlBoolean isIncreasingOnX () const
 Indicates whether the managed data has increasing abscissa values. More...
 
virtual IlBoolean removePointAndInfo (IlUInt ptidx)
 Removes a represented data point (and its associated point information if any). More...
 
virtual void removePointsAndInfo ()
 Removes all the represented data points (and their associated point information objects if any). More...
 
IlBoolean removeValueAndInfo (IlUInt valueIndex)
 Removes a data value (and their associated point information objects if any). More...
 
virtual void removeValuesAndInfo ()
 Removes all the data values (and their associated point information objects if any). More...
 
virtual IlBoolean setPoint (IlUInt ptidx, const IlvDoublePoint &point)
 Sets a represented data point. More...
 
IlBoolean setValue (IlUInt valueIndex, IlDouble yValue)
 Sets a data value. 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 IlvChartDataSetcopy () const =0
 Virtual copy constructor. 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...
 
IlvChartDataPointInfogetPointInfo (IlUInt ptidx) const
 Returns the point information associated with a data item. More...
 
IlvPointInfoCollectiongetPointInfoCollection () const
 Returns the object used to manage the point information. More...
 
IlUInt getPointInfoCount () const
 Returns the number of defined point information items. More...
 
IlvDoublePointgetPoints (IlUInt &count) const
 Returns all the represented data points. More...
 
virtual IlvDoublePointgetPointsInRange (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 IlvCoordIntervalgetXRange () const
 Returns the abscissa bounding values of the managed data. More...
 
virtual const IlvCoordIntervalgetYRange () const
 Returns the ordinate bounding values of the managed data. 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...
 
IlvChartDataSetListenerremoveListener (IlvChartDataSetListener *l)
 Removes a listener. More...
 
void removeListeners ()
 Removes all the listeners.
 
IlBoolean removePointInfo (IlUInt ptidx)
 Removes the point information associated with a data item. More...
 
IlvOutputFilesave (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...
 
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...
 
virtual void write (IlvOutputFile &file) const
 Writes the attributes of the current object in a file. More...
 

Protected Member Functions

virtual void computeMinMaxValues (IlvCoordInterval &xRange, IlvCoordInterval &yRange) const
 Computes the abscissa and ordinate bounding values of the managed data. More...
 
void updateBoundingValues (IlDouble newYValue)
 Updates the bounding values of the managed data. More...
 
- Protected Member Functions inherited from IlvChartDataSet
 IlvChartDataSet (const char *name=0, IlvPointInfoCollection *pointInfoCollection=0)
 Constructor. More...
 
 IlvChartDataSet (const IlvChartDataSet &dataSet)
 Constructor. More...
 
 IlvChartDataSet (IlvInputFile &file)
 Constructor. More...
 
void computeBoundingValues ()
 Computes the bounding values of the managed data. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from IlvChartDataSet
static IlvChartDataSetLoad (IlvInputFile &file)
 Reads a data set object from a file. More...
 

Detailed Description

Class for data sets described by a set of values.

Library: ilvcharts

This class is a subclass of IlvChartDataSet in which the data points are described by values of type IlDouble stored in an array. These values correspond to the ordinates of the data points. The abscissa of the data points are by definition the indexes of the stored data values.

Example of data that can be represented by an IlvChartYValueSet object:

X Y
0 1.2
1 3.1
2 4.6
Warning
[note] Each Y value is stored by using an IlDouble instance within the IlvChartYValueSet object. The X values are not stored, they correspond to the indexes of the stored Y values.
See Also
IlvChartDataSet, IlvPointInfoCollection, IlvChartDataPointInfo.

Constructor & Destructor Documentation

IlvChartYValueSet::IlvChartYValueSet ( const char *  name = 0,
IlvPointInfoCollection ptInfoCollection = 0 
)

Constructor.

Initializes a new IlvChartYValueSet object.

Parameters
nameIf not 0, this string becomes the name of the created data set. The name passed as a parameter is copied.
pointInfoCollectionThe object used to manage the point information for the created data set.
virtual IlvChartYValueSet::~IlvChartYValueSet ( )
virtual

Destructor.

The destructor removes all the data values managed by the current data set if the removal is allowed (see the IlvChartDataSet::isRemovalAllowed method).

Member Function Documentation

IlBoolean IlvChartYValueSet::addValue ( IlDouble  yValue,
IlvChartDataPointInfo pointInfo = 0,
IlBoolean  copyPointInfo = IlFalse 
)

Adds a data value (and its associated point information object if any).

Parameters
yValueThe new data value to add.
pointInfoThe point information associated with the new data value. This point information is locked.
copyPointInfoA Boolean value indicating whether the point information passed as a parameter must be copied. If copyPointInfo is IlTrue, the point information is copied. Otherwise, a pointer to the point information stored in pointInfo is kept and so its contents should not be deleted.
Returns
IlTrue if the value and its associated point information have been successfully added and IlFalse otherwise.
Warning
[note] The IlvChartDataSet::dataPointAdded method is called within this method after adding the value in order to perform the updates needed because of the change to the data set.
virtual void IlvChartYValueSet::computeMinMaxValues ( IlvCoordInterval xRange,
IlvCoordInterval yRange 
) const
protectedvirtual

Computes the abscissa and ordinate bounding values of the managed data.

Computes and returns in xRange and yRange the abscissa and ordinate bounding values of the data managed by the current data set.

Parameters
xRangeThe bounding values for the abscissa of the data managed by the current data set.
yRangeThe bounding values for the ordinate of the data managed by the current data set.
Warning
[note] This method is called in the IlvChartDataSet::computeBoundingValues method.

Reimplemented from IlvChartDataSet.

virtual IlUInt IlvChartYValueSet::getDataCount ( ) const
virtual

Returns the number of defined data items.

Returns
The number of data items (points or values) defined for the data set.

Implements IlvChartDataSet.

virtual void IlvChartYValueSet::getPoint ( IlUInt  i,
IlvDoublePoint point 
) const
virtual

Returns a represented data point.

Returns in point the point corresponding to the data value of index i for the current data set. The ordinate of point corresponds to the data value of index i stored in the data set. The abscissa of point corresponds to i which is the index of the data value.

Parameters
iThe index of the returned data point.
pointThe returned data point.

Implements IlvChartDataSet.

virtual IlvDoublePoint* IlvChartYValueSet::getPointsBetween ( IlUInt  indexMin,
IlUInt  indexMax,
IlUInt count 
) const
virtual

Returns some of the data points represented by the current data set.

Parameters
indexMinThe index of the first returned data point.
indexMaxThe index of the last returned data point.
countThe number of returned points.
Returns
An array of the data points represented by the current data set that are between the indexMin and the indexMax indexes. The array is stored in an IlPoolOf(Pointer) and should not be deleted or modified.

Reimplemented from IlvChartDataSet.

void IlvChartYValueSet::getValue ( IlUInt  i,
IlDouble yValue 
) const

Returns a data value.

Parameters
iThe index of the returned data value.
yValueThe returned data value.
virtual IlBoolean IlvChartYValueSet::insertPoint ( const IlvDoublePoint point,
IlUInt  ptidx,
IlvChartDataPointInfo pointInfo = 0,
IlBoolean  copyPointInfo = IlFalse 
)
virtual

Inserts a represented data point (and its associated point information object if any).

Inserts the ordinate of the point stored in point and its associated point information (if any) at the index ptidx of the data set. Only the ordinate of point is considered since the current data set stores only the ordinate (commonly called Y) values.

Parameters
pointThe new data point to insert.
ptidxThe index at which the new data point must be inserted.
pointInfoThe point information associated with the new data point. This point information is locked.
copyPointInfoA Boolean value indicating whether the point information passed as a parameter must be copied. If copyPointInfo is IlTrue, the point information is copied. Otherwise, a pointer to the point information stored in pointInfo is kept and so its contents should not be deleted.
Returns
IlTrue if the value and its associated point information have been successfully inserted and IlFalse otherwise.
Warning
[note] The IlvChartDataSet::dataPointAdded method is called within this method after inserting the value in order to perform the updates needed because of the change to the data set.
Before you insert the point information object associated with a data item of the current data set, you must set the object used to manage the point information objects for the current data set. (See the IlvChartDataSet::setPointInfoCollection method or the constructor IlvChartDataSet::IlvChartDataSet(const char*, IlvPointInfoCollection*).)

Reimplemented from IlvChartDataSet.

IlBoolean IlvChartYValueSet::insertValue ( IlDouble  yValue,
IlUInt  valueIndex,
IlvChartDataPointInfo pointInfo = 0,
IlBoolean  copyPointInfo = IlFalse 
)

Inserts a data value (and its associated point information object if any).

Parameters
yValueThe new data value to insert.
valueIndexThe index at which the new data value must be inserted.
pointInfoThe point information associated with the new data value. This point information is locked.
copyPointInfoA Boolean value indicating whether the point information passed as a parameter must be copied. If copyPointInfo is IlTrue, the point information is copied. Otherwise, a pointer to the point information stored in pointInfo is kept and so its contents should not be deleted.
Returns
IlTrue if the value and its associated point information have been successfully inserted and IlFalse otherwise.
Warning
[note] The IlvChartDataSet::dataPointAdded method is called within this method after inserting the value in order to perform the updates needed because of the change to the data set.
IlBoolean IlvChartYValueSet::insertValues ( IlUInt  count,
const IlDouble yValues,
IlUInt  position = IlvLastPositionIndex,
IlvChartDataPointInfo *const *  pInfos = 0,
IlBoolean  copyPointInfo = IlFalse 
)

Inserts several values (and their associated point information objects if any).

Inserts an array of values in the data set. This method uses the IlvChartDataSet::startBatch and IlvChartDataSet::endBatch methods to ensure that a single notification is sent.

Parameters
countThe number of values.
yValuesThe values to insert.
positionThe index at which the new values are inserted.
pInfosThe information associated with the new values.
copyPointInfoA Boolean value indicating whether the point information stored in pInfos must be copied.
Returns
A Boolean value indicating whether the values were successfully inserted.
virtual IlBoolean IlvChartYValueSet::isIncreasingOnX ( ) const
virtual

Indicates whether the managed data has increasing abscissa values.

Returns
IlTrue by default. The data has an abscissa that increases or stays the same by definition since the data abscissa correspond to the indexes of the values stored in the current data set.

Reimplemented from IlvChartDataSet.

virtual IlBoolean IlvChartYValueSet::removePointAndInfo ( IlUInt  ptidx)
virtual

Removes a represented data point (and its associated point information if any).

When you remove a point information object, the point information is not deleted but is unlocked (that is, the IlvChartDataPointInfo::unLock method is called). It will be deleted only when no objects reference it (see the IlvChartDataPointInfo::unLock method).

Parameters
ptidxThe index of the data value and of its associated point information (if any) that are removed.
Returns
IlTrue if the value and its associated point information (if any) have been removed and IlFalse otherwise.
Warning
[note] The IlvChartDataSet::dataPointRemoved method is called within this method after removing the value in order to perform the updates needed because of the change to the data set.

Reimplemented from IlvChartDataSet.

virtual void IlvChartYValueSet::removePointsAndInfo ( )
virtual

Removes all the represented data points (and their associated point information objects if any).

Warning
[note] When you remove a point information object, the point information is not deleted but is unlocked (that is, the IlvChartDataPointInfo::unLock method is called). It will be deleted only when no objects reference it (see the IlvChartDataPointInfo::unLock method).

Reimplemented from IlvChartDataSet.

IlBoolean IlvChartYValueSet::removeValueAndInfo ( IlUInt  valueIndex)

Removes a data value (and their associated point information objects if any).

When you remove a point information object, the point information is not deleted but unlocked (that is, the IlvChartDataPointInfo::unLock method is called). It will be deleted only when no objects reference it (see the IlvChartDataPointInfo::unLock method).

Parameters
valueIndexThe index of the data value and of its associated point information (if any) that are removed.
Returns
IlTrue if the value and its associated point information (if any) have been removed and IlFalse otherwise.
Warning
[note] The IlvChartDataSet::dataPointRemoved method is called within this method after removing the value in order to perform the updates needed because of the change to the data set.
virtual void IlvChartYValueSet::removeValuesAndInfo ( )
virtual

Removes all the data values (and their associated point information objects if any).

Warning
[note] When you remove a point information object, the point information is not deleted but unlocked (that is, the IlvChartDataPointInfo::unLock method is called). It will be deleted only when no objects reference it (see the IlvChartDataPointInfo::unLock method).
virtual IlBoolean IlvChartYValueSet::setPoint ( IlUInt  ptidx,
const IlvDoublePoint point 
)
virtual

Sets a represented data point.

Sets the ordinate of the point stored in point at the index ptidx for the data set. Only the ordinate of point is considered, since the current data set stores only the ordinate (commonly called Y) values. If a value already exists at this index, it is replaced by the new one. Otherwise, the value is added at the end.

Parameters
ptidxThe index at which the new data point must be set.
pointThe new data point to set.
Returns
IlTrue if the value has been successfully set and IlFalse otherwise.
Warning
[note] If a value already exists at the index ptidx, the IlvChartDataSet::dataPointChanged method is called within this method before and after changing the value in order to perform the updates needed because of the change to the data set.

Reimplemented from IlvChartDataSet.

IlBoolean IlvChartYValueSet::setValue ( IlUInt  valueIndex,
IlDouble  yValue 
)

Sets a data value.

If a value already exists at the index valueIndex, it is replaced by the new one. Otherwise, the value is added at the end.

Parameters
valueIndexThe index at which the new data value must be set.
yValueThe new data value to set.
Returns
IlTrue if the value has been successfully set and IlFalse otherwise.
Warning
[note] If a value already exists at the index, the IlvChartDataSet::dataPointChanged method is called within this method before and after changing the value in order to perform the updates needed because of the change to the data set.
void IlvChartYValueSet::updateBoundingValues ( IlDouble  newYValue)
protected

Updates the bounding values of the managed data.

Updates the minimum and maximum values of the abscissa and the ordinate for the data managed by the current data set, by taking into account a new data value that has been added.

Parameters
newYValueThe new value that has been added to the data set.
Warning
[note] This method is called when the bounding values have already been computed by using the IlvChartDataSet::computeBoundingValues method and only need to be updated in order to take into account a new added data value.

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