Views
Charts Package API Reference Guide
Product Documentation:
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 IlvChartDisplayerPoints &displayerPoints)
 Constructor. More...
 
 IlvChartDisplayerPoints (const IlvChartGraphic *chart, const IlvSingleChartDisplayer *displayer, IlBoolean outOfRange=IlTrue)
 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) const
 Returns a data point. More...
 
void getPoint (IlUInt index, IlvPoint &point, IlUInt &dataPtIdx) const
 Returns a projected point and its corresponding data point index. 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() [1/2]

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() [2/2]

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.

◆ ~IlvChartDisplayerPoints()

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

◆ addPoint()

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

◆ averageSpaceBetweenDataPoints()

IlDouble IlvChartDisplayerPoints::averageSpaceBetweenDataPoints ( ) const

Returns the average space between points.

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

Returns
The average space between points.

◆ boundingBoxOfPoints()

void IlvChartDisplayerPoints::boundingBoxOfPoints ( IlvRect bbox) const

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

Parameters
bboxThe returned bounding box.

◆ copy()

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.

◆ getChartGraphic()

const IlvChartGraphic* IlvChartDisplayerPoints::getChartGraphic ( ) const

Returns the associated chart.

Returns
The associated chart.
See also
IlvChartGraphic.

◆ getDataPoint()

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.

◆ getDataPointIndex()

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.

◆ getDisplayer()

const IlvSingleChartDisplayer* IlvChartDisplayerPoints::getDisplayer ( ) const

Returns the associated displayer.

Returns
The associated displayer.
See also
IlvSingleChartDisplayer.

◆ getInternalPointIndexes()

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.
Note
The returned array must not be freed or modified as it is maintained internally.

◆ getInternalPoints()

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.
Note
The returned array must not be freed or modified as it is maintained internally.

◆ getPoint() [1/2]

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.

◆ getPoint() [2/2]

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.

◆ getPointPalette()

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.

◆ getPoints()

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.

◆ getPointsCount()

IlUInt IlvChartDisplayerPoints::getPointsCount ( ) const

Returns the number of projected points stored in this object.

Returns
The number of projected points stored in this object.

◆ handleOutOfRangePoints()

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.

◆ init()

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.

◆ insertPoint()

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.

◆ insertPoints()

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.

◆ isHandlingOutOfRangePoints()

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.

◆ isProjectedOnLimits()

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

◆ projectOutOfBoundOnLimits()

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.

◆ removePoint()

virtual IlBoolean IlvChartDisplayerPoints::removePoint ( IlUInt  index)
virtual

Removes a projected point.

Parameters
indexThe index of the projected point to remove.
Note
The data point index corresponding to this projected point is also removed.

◆ removePoints()

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.

◆ setChartGraphic()

void IlvChartDisplayerPoints::setChartGraphic ( const IlvChartGraphic chart)

Sets the associated chart.

Parameters
chartThe new associated chart.
See also
IlvChartGraphic.

◆ setDisplayer()

void IlvChartDisplayerPoints::setDisplayer ( const IlvSingleChartDisplayer displayer)

Sets the associated displayer.

Parameters
displayerThe new associated displayer.
See also
IlvSingleChartDisplayer.

◆ setPoint()

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.

◆ setProjectedOnLimits()

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