rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Charts Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IlvChartDisplayerPoints Class Reference

Utility class for displaying data points. More...

#include <ilviews/charts/display.h>

Inheritance diagram for IlvChartDisplayerPoints:
IlvChartPointsFilter

List of all members.

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 IlvChartDisplayerPointscopy () const
 Virtual copy constructor.
const IlvChartGraphicgetChartGraphic () 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 IlvSingleChartDisplayergetDisplayer () const
 Returns the associated displayer.
const IlUIntgetInternalPointIndexes (IlUInt &count) const
 Returns the data point indexes stored in this object.
const IlvPointgetInternalPoints (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 IlvPalettegetPointPalette (IlUInt index, IlBoolean usePointInfo=IlTrue, IlvPalette *defaultPalette=0) const
 Returns the palette that must be used to draw a projected point.
IlvPointgetPoints (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.

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:
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.
See also:
IlvSingleChartDisplayer::allocDisplayerPoints.
IlvChartDisplayerPoints::IlvChartDisplayerPoints ( const IlvChartDisplayerPoints displayerPoints  ) 

Constructor.

Initializes a new IlvChartDisplayerPoints instance as a copy of displayerPoints.

Parameters:
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.


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:
point The projected point to add.
dataPtIdx The 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:
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.

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:
index The index of the data point to return.
point The returned data point.
IlUInt IlvChartDisplayerPoints::getDataPointIndex ( IlUInt  index  )  const

Returns the corresponding data point index of a projected point.

Parameters:
index The 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:
count The 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:
count The 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 
) const

Returns a data point.

Parameters:
index The index of the data point to return.
point The returned data point.
void IlvChartDisplayerPoints::getPoint ( IlUInt  index,
IlvPoint point,
IlUInt dataPtIdx 
) const

Returns a projected point and its corresponding data point index.

Parameters:
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.

Parameters:
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:
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:
count The 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:
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.

Parameters:
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.

Parameters:
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).

Parameters:
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.

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:
index The 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  )  [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.

Parameters:
t The transformer applied to the chart graphic.
virtual IlBoolean IlvChartDisplayerPoints::removePoint ( IlUInt  index  )  [virtual]

Removes a projected point.

Parameters:
index The 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:
chart The new associated chart.
See also:
IlvChartGraphic.
void IlvChartDisplayerPoints::setDisplayer ( const IlvSingleChartDisplayer displayer  ) 

Sets the associated displayer.

Parameters:
displayer The 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:
index The index of the projected point to modify.
point The new value of the projected point.
dataPtIdx The 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:
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.
See also:
isHandlingOutOfRangePoints.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

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