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
IlvChartDisplayerPoints Class Reference

Utility class for displaying data points. More...

#include <ilviews/charts/display.h>

Inheritance diagram for IlvChartDisplayerPoints:
IlvChartPointsFilter

Public Member Functions

 IlvChartDisplayerPoints (const IlvChartGraphic *chart, const IlvSingleChartDisplayer *displayer, IlBoolean outOfRange=IlTrue)
 Constructor. More...
 
 IlvChartDisplayerPoints (const IlvChartDisplayerPoints &displayerPoints)
 Constructor. More...
 
virtual ~IlvChartDisplayerPoints ()
 Destructor. More...
 
void addPoint (const IlvPoint &point, IlUInt dataPtIdx=IlvBadIndex)
 Adds a projected point and its corresponding data point index. More...
 
IlDouble averageSpaceBetweenDataPoints () const
 Returns the average space between points. More...
 
void boundingBoxOfPoints (IlvRect &bbox) const
 Returns the bounding box of the projected points stored in this object. More...
 
virtual IlvChartDisplayerPointscopy () const
 Virtual copy constructor. More...
 
const IlvChartGraphicgetChartGraphic () const
 Returns the associated chart. More...
 
void getDataPoint (IlUInt index, IlvDoublePoint &point) const
 Returns a data point. More...
 
IlUInt getDataPointIndex (IlUInt index) const
 Returns the corresponding data point index of a projected point. More...
 
const IlvSingleChartDisplayergetDisplayer () const
 Returns the associated displayer. More...
 
const IlUIntgetInternalPointIndexes (IlUInt &count) const
 Returns the data point indexes stored in this object. More...
 
const IlvPointgetInternalPoints (IlUInt &count) const
 Returns the projected points stored in this object. More...
 
void getPoint (IlUInt index, IlvPoint &point, IlUInt &dataPtIdx) const
 Returns a projected point and its corresponding data point index. More...
 
void getPoint (IlUInt index, IlvPoint &point) const
 Returns a data point. More...
 
virtual IlvPalettegetPointPalette (IlUInt index, IlBoolean usePointInfo=IlTrue, IlvPalette *defaultPalette=0) const
 Returns the palette that must be used to draw a projected point. More...
 
IlvPointgetPoints (IlUInt &count) const
 Returns a copy of the projected points. More...
 
IlUInt getPointsCount () const
 Returns the number of projected points stored in this object. More...
 
void handleOutOfRangePoints (IlBoolean b)
 Specifies whether specific computations are done for out-of-range points. More...
 
virtual IlBoolean init (IlUInt count, const IlvDoublePoint *dataPoints, const IlUInt *dataPtIdxes, const IlvCoordInterval &abscissaRange, IlBoolean shiftOfCycleLength, const IlvTransformer *t)
 Initializes the current object with a set of data points to project. More...
 
void insertPoint (const IlvPoint &point, IlUInt dataPtIdx=IlvBadIndex, IlUInt position=0)
 Inserts a projected point and its corresponding data point index. More...
 
virtual void insertPoints (IlUInt count, const IlvPoint *points, const IlUInt *dataPtIdxes=0, IlUInt position=0)
 Inserts an array of projected points and their corresponding data point indexes. More...
 
IlBoolean isCyclic () const
 Indicates whether specific computations are done for out-of-range points.
 
IlBoolean isHandlingOutOfRangePoints () const
 Indicates whether specific computations are done for out-of-range points. More...
 
IlBoolean isProjectedOnLimits (IlUInt index) const
 Indicates whether a projected point has been projected on the boundary of the data display area. More...
 
virtual IlBoolean removePoint (IlUInt index)
 Removes a projected point. More...
 
virtual void removePoints ()
 Removes all the projected points stored in this object. More...
 
void setChartGraphic (const IlvChartGraphic *chart)
 Sets the associated chart. More...
 
void setDisplayer (const IlvSingleChartDisplayer *displayer)
 Sets the associated displayer. More...
 
virtual void setPoint (IlUInt index, const IlvPoint &point, IlUInt dataPtIdx=IlvBadIndex)
 Modifies a projected point and its corresponding data point index. More...
 
void setProjectedOnLimits (IlUInt index, IlBoolean flag)
 Specifies whether a projected point has been projected on the boundary of the data display area. More...
 

Protected Member Functions

virtual void projectOutOfBoundOnLimits (const IlvTransformer *t=0)
 Projects the projected points on the boundary when these points are out-of-bounds. More...
 

Detailed Description

Utility class for displaying data points.

Library: ilvcharts

This class maintains all the information needed by displayers to render data within a chart. Instances of this class are fed with data points and perform the projection into screen coordinates. They also maintain the relationship between each projected point and the corresponding data point.

Each instance of this class is connected to a displayer (an instance of the IlvSingleChartDisplayer class) and a chart graphic (an instance of the IlvChartGraphic class).

See Also
IlvSingleChartDisplayer, IlvChartGraphic.

Constructor & Destructor Documentation

IlvChartDisplayerPoints::IlvChartDisplayerPoints ( const IlvChartGraphic chart,
const IlvSingleChartDisplayer displayer,
IlBoolean  outOfRange = IlTrue 
)

Constructor.

Initializes a new IlvChartDisplayerPoints instance.

Parameters
chartThe associated chart.
displayerThe associated displayer.
outOfRangeA Boolean value indicating whether this instance needs to perform specific computations for data points that are projected outside the visible area.
See Also
IlvSingleChartDisplayer::allocDisplayerPoints.
IlvChartDisplayerPoints::IlvChartDisplayerPoints ( const IlvChartDisplayerPoints displayerPoints)

Constructor.

Initializes a new IlvChartDisplayerPoints instance as a copy of displayerPoints.

Parameters
displayerPointsThe object used to initialize the current one.
virtual IlvChartDisplayerPoints::~IlvChartDisplayerPoints ( )
virtual

Destructor.

The destructor releases all the allocated memory used to store the projected points and their corresponding data point indexes.

Member Function Documentation

void IlvChartDisplayerPoints::addPoint ( const IlvPoint point,
IlUInt  dataPtIdx = IlvBadIndex 
)

Adds a projected point and its corresponding data point index.

This method is equivalent to insertPoint(point,dataPtIdx,IlvLastPositionIndex).

Parameters
pointThe projected point to add.
dataPtIdxThe corresponding data point index.
See Also
insertPoint.
IlDouble IlvChartDisplayerPoints::averageSpaceBetweenDataPoints ( ) const

Returns the average space between points.

Computes (lastDataPoint.x - firstDataPoint.x) / points_count

Returns
The average space between points.
void IlvChartDisplayerPoints::boundingBoxOfPoints ( IlvRect bbox) const

Returns the bounding box of the projected points stored in this object.

Parameters
bboxThe returned bounding box.
virtual IlvChartDisplayerPoints* IlvChartDisplayerPoints::copy ( ) const
virtual

Virtual copy constructor.

Creates and returns a copy of the current object. This method must be overloaded in subclasses.

Returns
A copy of the current object.
const IlvChartGraphic* IlvChartDisplayerPoints::getChartGraphic ( ) const

Returns the associated chart.

Returns
The associated chart.
See Also
IlvChartGraphic.
void IlvChartDisplayerPoints::getDataPoint ( IlUInt  index,
IlvDoublePoint point 
) const

Returns a data point.

Parameters
indexThe index of the data point to return.
pointThe returned data point.
IlUInt IlvChartDisplayerPoints::getDataPointIndex ( IlUInt  index) const

Returns the corresponding data point index of a projected point.

Parameters
indexThe index of the projected point.
Returns
The index in the data set of the corresponding data point.
const IlvSingleChartDisplayer* IlvChartDisplayerPoints::getDisplayer ( ) const

Returns the associated displayer.

Returns
The associated displayer.
See Also
IlvSingleChartDisplayer.
const IlUInt* IlvChartDisplayerPoints::getInternalPointIndexes ( IlUInt count) const

Returns the data point indexes stored in this object.

Parameters
countThe number of returned indexes.
Returns
The data point indexes associated with the projected points.
Warning
[note] The returned array must not be freed or modified as it is maintained internally.
const IlvPoint* IlvChartDisplayerPoints::getInternalPoints ( IlUInt count) const

Returns the projected points stored in this object.

Parameters
countThe number of returned points.
Returns
The projected points.
Warning
[note] The returned array must not be freed or modified as it is maintained internally.
void IlvChartDisplayerPoints::getPoint ( IlUInt  index,
IlvPoint point,
IlUInt dataPtIdx 
) const

Returns a projected point and its corresponding data point index.

Parameters
indexThe index of the projected point to return.
pointThe returned projected point.
dataPtIdxThe corresponding data point index.
void IlvChartDisplayerPoints::getPoint ( IlUInt  index,
IlvPoint point 
) const

Returns a data point.

Parameters
indexThe index of the data point to return.
pointThe returned data point.
virtual IlvPalette* IlvChartDisplayerPoints::getPointPalette ( IlUInt  index,
IlBoolean  usePointInfo = IlTrue,
IlvPalette defaultPalette = 0 
) const
virtual

Returns the palette that must be used to draw a projected point.

Parameters
indexThe index of the point for which the palette is requested.
usePointInfoWhether to use the point's point info to get the palette.
defaultPaletteThe palette to return if none was found.
Returns
The palette that must be used to draw a projected point.
IlvPoint* IlvChartDisplayerPoints::getPoints ( IlUInt count) const

Returns a copy of the projected points.

Parameters
countThe number of returned points.
Returns
A copy of the projected points stored internally in the current object. The returned array must be deleted by the caller.
IlUInt IlvChartDisplayerPoints::getPointsCount ( ) const

Returns the number of projected points stored in this object.

Returns
The number of projected points stored in this object.
void IlvChartDisplayerPoints::handleOutOfRangePoints ( IlBoolean  b)

Specifies whether specific computations are done for out-of-range points.

Parameters
bThe new value of the Boolean indicating whether the current instance performs specific computations for data points that are projected outside the visible data display area.
virtual IlBoolean IlvChartDisplayerPoints::init ( IlUInt  count,
const IlvDoublePoint dataPoints,
const IlUInt dataPtIdxes,
const IlvCoordInterval abscissaRange,
IlBoolean  shiftOfCycleLength,
const IlvTransformer t 
)
virtual

Initializes the current object with a set of data points to project.

This method performs the projection of the data points dataPoints and stores in the current object the resulting points and their corresponding data point indexes given by dataPtIdxes.

Parameters
countThe number of data points.
dataPointsThe data points to project.
dataPtIdxesThe indexes of the data points in the data set.
abscissaRangeThe range of the abscissa coordinate that is currently used by the chart.
shiftOfCycleLengthA Boolean value indicating whether the data points are shifted by the cycle length.
tThe transformer applied to the chart graphic.

Reimplemented in IlvChartPointsFilter.

void IlvChartDisplayerPoints::insertPoint ( const IlvPoint point,
IlUInt  dataPtIdx = IlvBadIndex,
IlUInt  position = 0 
)

Inserts a projected point and its corresponding data point index.

This method calls the IlvChartDisplayerPoints::insertPoints virtual method.

Parameters
pointThe projected point to insert.
dataPtIdxThe corresponding data point index.
positionThe insertion position.
virtual void IlvChartDisplayerPoints::insertPoints ( IlUInt  count,
const IlvPoint points,
const IlUInt dataPtIdxes = 0,
IlUInt  position = 0 
)
virtual

Inserts an array of projected points and their corresponding data point indexes.

This method is called by the IlvChartDisplayerPoints::insertPoint and IlvChartDisplayerPoints::addPoint methods. It can be overloaded to perform processing tasks on the projected points (for example, filtering based on the points coordinates).

Parameters
countThe number of points to insert.
pointsThe projected points to insert.
dataPtIdxesThe corresponding data point indexes. If this parameter is 0, the indexes of the added points will be set to IlvBadIndex.
positionThe insertion position.
IlBoolean IlvChartDisplayerPoints::isHandlingOutOfRangePoints ( ) const

Indicates whether specific computations are done for out-of-range points.

Returns
IlTrue if the current instance performs specific computations for data points that are projected outside the visible data display area and IlFalse otherwise.
IlBoolean IlvChartDisplayerPoints::isProjectedOnLimits ( IlUInt  index) const

Indicates whether a projected point has been projected on the boundary of the data display area.

Returns a Boolean value indicating whether the projected point at the index index has been projected on the boundary of the data display area. If the current instance does not handle out-of-range points, the method returns IlFalse.

Parameters
indexThe index of the projected point.
Returns
IlTrue if the projected point at the index index has been projected on the boundary of the data display area and IlFalse otherwise.
See Also
isHandlingOutOfRangePoints.
virtual void IlvChartDisplayerPoints::projectOutOfBoundOnLimits ( const IlvTransformer t = 0)
protectedvirtual

Projects the projected points on the boundary when these points are out-of-bounds.

This method projects the projected points on the boundary of the area where the data are displayed if the projected points are outside of this area. This method is called at the end of the IlvChartDisplayerPoints::init method to project out-of-bound points if the method IlvSingleChartDisplayer::canBeProjectedIfOutOfBounds of the associated displayer returns IlTrue.

Parameters
tThe transformer applied to the chart graphic.
virtual IlBoolean IlvChartDisplayerPoints::removePoint ( IlUInt  index)
virtual

Removes a projected point.

Parameters
indexThe index of the projected point to remove.
Warning
[note] The data point index corresponding to this projected point is also removed.
virtual void IlvChartDisplayerPoints::removePoints ( )
virtual

Removes all the projected points stored in this object.

This method removes all the projected points and their corresponding data point indexes stored in this object. It also frees the space needed to store the points and their corresponding data point indexes.

void IlvChartDisplayerPoints::setChartGraphic ( const IlvChartGraphic chart)

Sets the associated chart.

Parameters
chartThe new associated chart.
See Also
IlvChartGraphic.
void IlvChartDisplayerPoints::setDisplayer ( const IlvSingleChartDisplayer displayer)

Sets the associated displayer.

Parameters
displayerThe new associated displayer.
See Also
IlvSingleChartDisplayer.
virtual void IlvChartDisplayerPoints::setPoint ( IlUInt  index,
const IlvPoint point,
IlUInt  dataPtIdx = IlvBadIndex 
)
virtual

Modifies a projected point and its corresponding data point index.

Parameters
indexThe index of the projected point to modify.
pointThe new value of the projected point.
dataPtIdxThe corresponding data point index.
void IlvChartDisplayerPoints::setProjectedOnLimits ( IlUInt  index,
IlBoolean  flag 
)

Specifies whether a projected point has been projected on the boundary of the data display area.

Sets the Boolean value indicating whether the projected point at the index index has been projected on the boundary of the data display area. If the current instance does not handle out-of-range points, the method does nothing.

Parameters
indexThe index of the projected point.
flagThe new value of the Boolean indicating whether the projected point at the index index has been projected on the boundary of the data display area.
See Also
isHandlingOutOfRangePoints.

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