Utility class for displaying data points. More...
#include <ilviews/charts/display.h>
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 IlvChartDisplayerPoints * | copy () const |
Virtual copy constructor. More... | |
const IlvChartGraphic * | getChartGraphic () 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 IlvSingleChartDisplayer * | getDisplayer () const |
Returns the associated displayer. More... | |
const IlUInt * | getInternalPointIndexes (IlUInt &count) const |
Returns the data point indexes stored in this object. More... | |
const IlvPoint * | getInternalPoints (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 IlvPalette * | getPointPalette (IlUInt index, IlBoolean usePointInfo=IlTrue, IlvPalette *defaultPalette=0) const |
Returns the palette that must be used to draw a projected point. More... | |
IlvPoint * | getPoints (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... | |
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).
IlvSingleChartDisplayer
, IlvChartGraphic
. IlvChartDisplayerPoints::IlvChartDisplayerPoints | ( | const IlvChartGraphic * | chart, |
const IlvSingleChartDisplayer * | displayer, | ||
IlBoolean | outOfRange = IlTrue |
||
) |
Constructor.
Initializes a new IlvChartDisplayerPoints
instance.
chart | The associated chart. |
displayer | The associated displayer. |
outOfRange | A Boolean value indicating whether this instance needs to perform specific computations for data points that are projected outside the visible area. |
IlvChartDisplayerPoints::IlvChartDisplayerPoints | ( | const IlvChartDisplayerPoints & | displayerPoints | ) |
Constructor.
Initializes a new IlvChartDisplayerPoints
instance as a copy of displayerPoints.
displayerPoints | The object used to initialize the current one. |
|
virtual |
Destructor.
The destructor releases all the allocated memory used to store the projected points and their corresponding data point indexes.
Adds a projected point and its corresponding data point index.
This method is equivalent to insertPoint(point,dataPtIdx,IlvLastPositionIndex)
.
point | The projected point to add. |
dataPtIdx | The corresponding data point index. |
insertPoint()
. IlDouble IlvChartDisplayerPoints::averageSpaceBetweenDataPoints | ( | ) | const |
Returns the average space between points.
Computes (lastDataPoint.x - firstDataPoint.x) / points_count
void IlvChartDisplayerPoints::boundingBoxOfPoints | ( | IlvRect & | bbox | ) | const |
Returns the bounding box of the projected points stored in this object.
bbox | The returned bounding box. |
|
virtual |
Virtual copy constructor.
Creates and returns a copy of the current object. This method must be overloaded in subclasses.
const IlvChartGraphic* IlvChartDisplayerPoints::getChartGraphic | ( | ) | const |
void IlvChartDisplayerPoints::getDataPoint | ( | IlUInt | index, |
IlvDoublePoint & | point | ||
) | const |
Returns a data point.
index | The index of the data point to return. |
point | The returned data point. |
Returns the corresponding data point index of a projected point.
index | The index of the projected point. |
const IlvSingleChartDisplayer* IlvChartDisplayerPoints::getDisplayer | ( | ) | const |
Returns the data point indexes stored in this object.
count | The number of returned indexes. |
Returns the projected points stored in this object.
count | The number of returned points. |
Returns a data point.
index | The index of the data point to return. |
point | The returned data point. |
Returns a projected point and its corresponding data point index.
index | The index of the projected point to return. |
point | The returned projected point. |
dataPtIdx | The corresponding data point index. |
|
virtual |
Returns the palette that must be used to draw a projected point.
index | The index of the point for which the palette is requested. |
usePointInfo | Whether to use the point's point info to get the palette. |
defaultPalette | The palette to return if none was found. |
Returns a copy of the projected points.
count | The number of returned points. |
IlUInt IlvChartDisplayerPoints::getPointsCount | ( | ) | const |
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.
b | The 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 |
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.
count | The number of data points. |
dataPoints | The data points to project. |
dataPtIdxes | The indexes of the data points in the data set. |
abscissaRange | The range of the abscissa coordinate that is currently used by the chart. |
shiftOfCycleLength | A Boolean value indicating whether the data points are shifted by the cycle length. |
t | The 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.
point | The projected point to insert. |
dataPtIdx | The corresponding data point index. |
position | The insertion position. |
|
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).
count | The number of points to insert. |
points | The projected points to insert. |
dataPtIdxes | The corresponding data point indexes. If this parameter is 0 , the indexes of the added points will be set to IlvBadIndex . |
position | The insertion position. |
IlBoolean IlvChartDisplayerPoints::isHandlingOutOfRangePoints | ( | ) | const |
Indicates whether specific computations are done for out-of-range points.
IlTrue
if the current instance performs specific computations for data points that are projected outside the visible data display area and IlFalse
otherwise. 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
.
index | The index of the projected point. |
IlTrue
if the projected point at the index index has been projected on the boundary of the data display area and IlFalse
otherwise. isHandlingOutOfRangePoints()
.
|
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
.
t | The transformer applied to the chart graphic. |
Removes a projected point.
index | The index of the projected point to remove. |
|
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 | ) |
void IlvChartDisplayerPoints::setDisplayer | ( | const IlvSingleChartDisplayer * | displayer | ) |
Sets the associated displayer.
displayer | The new associated displayer. |
IlvSingleChartDisplayer
.
|
virtual |
Modifies a projected point and its corresponding data point index.
index | The index of the projected point to modify. |
point | The new value of the projected point. |
dataPtIdx | The corresponding data point index. |
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.
index | The index of the projected point. |
flag | The 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. |
isHandlingOutOfRangePoints()
.