Rogue Wave Views 5.5.1 |
Rogue Wave Views |
Rogue Wave Views Documentation Home |
Utility class for displaying data points. More...
#include <ilviews/charts/display.h>
Public Member Functions | |
IlvChartDisplayerPoints (const IlvChartDisplayerPoints &displayerPoints) | |
Constructor. | |
IlvChartDisplayerPoints (const IlvChartGraphic *chart, const IlvSingleChartDisplayer *displayer, IlBoolean outOfRange=IlTrue) | |
Constructor. | |
virtual | ~IlvChartDisplayerPoints () |
Destructor. | |
void | addPoint (const IlvPoint &point, IlUInt dataPtIdx=IlvBadIndex) |
Adds a projected point and its corresponding data point index. | |
IlDouble | averageSpaceBetweenDataPoints () const |
Returns the average space between points. | |
void | boundingBoxOfPoints (IlvRect &bbox) const |
Returns the bounding box of the projected points stored in this object. | |
virtual IlvChartDisplayerPoints * | copy () const |
Virtual copy constructor. | |
const IlvChartGraphic * | getChartGraphic () const |
Returns the associated chart. | |
void | getDataPoint (IlUInt index, IlvDoublePoint &point) const |
Returns a data point. | |
IlUInt | getDataPointIndex (IlUInt index) const |
Returns the corresponding data point index of a projected point. | |
const IlvSingleChartDisplayer * | getDisplayer () const |
Returns the associated displayer. | |
const IlUInt * | getInternalPointIndexes (IlUInt &count) const |
Returns the data point indexes stored in this object. | |
const IlvPoint * | getInternalPoints (IlUInt &count) const |
Returns the projected points stored in this object. | |
void | getPoint (IlUInt index, IlvPoint &point) const |
Returns a data point. | |
void | getPoint (IlUInt index, IlvPoint &point, IlUInt &dataPtIdx) const |
Returns a projected point and its corresponding data point index. | |
virtual IlvPalette * | getPointPalette (IlUInt index, IlBoolean usePointInfo=IlTrue, IlvPalette *defaultPalette=0) const |
Returns the palette that must be used to draw a projected point. | |
IlvPoint * | getPoints (IlUInt &count) const |
Returns a copy of the projected points. | |
IlUInt | getPointsCount () const |
Returns the number of projected points stored in this object. | |
void | handleOutOfRangePoints (IlBoolean b) |
Specifies whether specific computations are done for out-of-range points. | |
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. | |
void | insertPoint (const IlvPoint &point, IlUInt dataPtIdx=IlvBadIndex, IlUInt position=0) |
Inserts a projected point and its corresponding data point index. | |
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. | |
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. | |
IlBoolean | isProjectedOnLimits (IlUInt index) const |
Indicates whether a projected point has been projected on the boundary of the data display area. | |
virtual IlBoolean | removePoint (IlUInt index) |
Removes a projected point. | |
virtual void | removePoints () |
Removes all the projected points stored in this object. | |
void | setChartGraphic (const IlvChartGraphic *chart) |
Sets the associated chart. | |
void | setDisplayer (const IlvSingleChartDisplayer *displayer) |
Sets the associated displayer. | |
virtual void | setPoint (IlUInt index, const IlvPoint &point, IlUInt dataPtIdx=IlvBadIndex) |
Modifies a projected point and its corresponding data point index. | |
void | setProjectedOnLimits (IlUInt index, IlBoolean flag) |
Specifies whether a projected point has been projected on the boundary of the data display area. | |
Protected Member Functions | |
virtual void | projectOutOfBoundOnLimits (const IlvTransformer *t=0) |
Projects the projected points on the boundary when these points are out-of-bounds. |
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 IlvChartDisplayerPoints::~IlvChartDisplayerPoints | ( | ) | [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 IlvChartDisplayerPoints* IlvChartDisplayerPoints::copy | ( | ) | const [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 associated displayer.
IlvSingleChartDisplayer
. 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 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.
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 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.
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 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).
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
. virtual void IlvChartDisplayerPoints::projectOutOfBoundOnLimits | ( | const IlvTransformer * | t = 0 |
) | [protected, virtual] |
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 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 | ) |
void IlvChartDisplayerPoints::setDisplayer | ( | const IlvSingleChartDisplayer * | displayer | ) |
Sets the associated displayer.
displayer | The new associated displayer. |
IlvSingleChartDisplayer
. virtual void IlvChartDisplayerPoints::setPoint | ( | IlUInt | index, | |
const IlvPoint & | point, | |||
IlUInt | dataPtIdx = IlvBadIndex | |||
) | [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
. © 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.