rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Charts Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IlvStepChartDisplayer Class Reference

Class for step displayers. More...

#include <ilviews/charts/polyline.h>

Inheritance diagram for IlvStepChartDisplayer:
IlvSingleChartDisplayer IlvAbstractChartDisplayer IlvStairChartDisplayer

List of all members.

Public Member Functions

 IlvStepChartDisplayer (IlvPalette *palette=0)
 Constructor.
virtual IlvAbstractChartDisplayercopy () const
 Virtual copy constructor.
virtual void drawLegendItem (IlvPort *dst, const IlvRect &legendArea, IlvPalette *itemPal, const IlvRegion *clip, IlAny clientData=0) const
 Draws the graphic part of a legend item associated with the current displayer.
virtual IlBoolean graphicalRepresentationByDataPoint () const
 Indicates whether there is a graphical representation by data point.
virtual IlBoolean isContinuous () const
 Indicates whether the graphical representation is continuous.
virtual void treatPointsOutOfAbscissaLimits (const IlvRect &dataDisplayArea, IlvChartDisplayerPoints *dispPts, const IlvCoordInterval &abscissaRange, const IlvPoint &minLimit, const IlvPoint &maxLimit) const
 Treats the occurrence of the points in screen coordinates that are outside the abscissa limits.

Protected Member Functions

virtual void boundingBoxOfPoints (IlvChartDisplayerPoints *dispPts, IlvRect &bbox, IlBoolean takeInfoIntoAccount=IlTrue, const IlvTransformer *t=0) const
 Returns the bounding box of the graphical representation from points in screen coordinates corresponding to the data points to display.
virtual void computeItem (const IlvChartDisplayerPoints *dispPts, IlUInt pointIndex, IlUInt &usedPointsCount, IlvPoint *points, const IlvTransformer *t=0) const
 Computes the item that will be displayed for a given point in screen coordinates corresponding to a data point to display.
virtual void drawItem (const IlvChartDisplayerPoints *, IlUInt pointIndex, IlUInt pointCount, IlvPoint *points, IlvPalette *itemPalette, IlvPort *dst, const IlvTransformer *t=0, const IlvRegion *clip=0) const
 Draws the item for a given point in screen coordinates corresponding to a data point to display.
virtual IlUInt getItemPointsCount (const IlvChartDisplayerPoints *dispPts) const
 Returns the maximum number of points needed to define an item for the current displayer.
virtual IlvDoublePointselectDataPointsForPoint (IlUInt dataPointIndex, IlUInt &count, IlUInt *&dataPointIndexes) const
 Selects and returns the data points needed to display the graphical representation of the data points at a given index in the real data set to be displayed by the current displayer.

Detailed Description

Class for step displayers.

Library: ilvcharts

This class is a subclass of IlvSingleChartDisplayer which allows you to represent data with steps.

The step displayer displays a unique data set. This displayer can be used with any type of projection. (See the IlvAbstractProjector class for more details.)

The following images show data sets represented with step displayers in a Cartesian chart (on the left) and a polar chart (on the right).

img_step.gif
img_step_polar.gif
See also:
IlvSingleChartDisplayer.

Constructor & Destructor Documentation

IlvStepChartDisplayer::IlvStepChartDisplayer ( IlvPalette palette = 0  ) 

Constructor.

Initializes a new IlvStepChartDisplayer object.

Parameters:
palette The palette that will be used to display the steps.

Member Function Documentation

virtual void IlvStepChartDisplayer::boundingBoxOfPoints ( IlvChartDisplayerPoints dispPts,
IlvRect bbox,
IlBoolean  takeInfoIntoAccount = IlTrue,
const IlvTransformer t = 0 
) const [protected, virtual]

Returns the bounding box of the graphical representation from points in screen coordinates corresponding to the data points to display.

(See the IlvSingleChartDisplayer::boundingBoxOfPoints method for more details.)

The method calls the IlvStepChartDisplayer::computeItem method for each screen point stored in dispPts to compute the item that will be displayed for this screen point. The returned bounding box corresponds to the bounding box of all the points defining the items computed for all the points stored in dispPts.

Reimplemented from IlvSingleChartDisplayer.

Reimplemented in IlvStairChartDisplayer.

virtual void IlvStepChartDisplayer::computeItem ( const IlvChartDisplayerPoints dispPts,
IlUInt  pointIndex,
IlUInt usedPointsCount,
IlvPoint points,
const IlvTransformer t = 0 
) const [protected, virtual]

Computes the item that will be displayed for a given point in screen coordinates corresponding to a data point to display.

Computes the points defining the item that will be displayed for the point in screen coordinates that is stored at the index pointIndex in the dispPts object. This object stores the points in screen coordinates corresponding to the data points that have to be displayed by the current displayer. (See the IlvSingleChartDisplayer::computeItem method for more details.)

The item that will be displayed for a given screen point corresponding to a data point is a segment joining the current screen point and the point obtained by being shifted along the abscissa scale from the current screen point toward the following point stored in dispPts. This segment is defined by using two points: the point at the index pointIndex in the dispPts object and the point at the index pointIndex +1.

The number of points defining the item is returned in usedPointsCount.

Warning:
[note] This method is called inside the drawPoints method.

Implements IlvSingleChartDisplayer.

Reimplemented in IlvStairChartDisplayer.

virtual IlvAbstractChartDisplayer* IlvStepChartDisplayer::copy (  )  const [virtual]

Virtual copy constructor.

Creates and returns a copy of the current object. This method must be overloaded in subclasses. It is automatically declared by the DeclareChartDisplayerTypeInfo macro. The IlvPredefinedChartDisplayerIOMembers macro lets you define a default implementation, which returns an instance initialized with the copy constructor.

Returns:
A copy of the current object.

Implements IlvAbstractChartDisplayer.

Reimplemented in IlvStairChartDisplayer.

virtual void IlvStepChartDisplayer::drawItem ( const IlvChartDisplayerPoints ,
IlUInt  pointIndex,
IlUInt  pointCount,
IlvPoint points,
IlvPalette itemPalette,
IlvPort dst,
const IlvTransformer t = 0,
const IlvRegion clip = 0 
) const [protected, virtual]

Draws the item for a given point in screen coordinates corresponding to a data point to display.

Draws the item for the point in screen coordinates that is stored at the index pointIndex in the dispPts object. This object stores the points in screen coordinates corresponding to the data points that have to be displayed by the current displayer. (See the IlvSingleChartDisplayer::drawItem method for more details.)

This method draws the step defined by the points stored in points. The step that is simply a line is drawn with the foreground color of the palette itemPalette. (See the IlvStepChartDisplayer::computeItem method for more details.)

Warning:
[note] This method is called inside the drawPoints method.

Implements IlvSingleChartDisplayer.

Reimplemented in IlvStairChartDisplayer.

virtual void IlvStepChartDisplayer::drawLegendItem ( IlvPort dst,
const IlvRect legendArea,
IlvPalette itemPal,
const IlvRegion clip,
IlAny  clientData = 0 
) const [virtual]

Draws the graphic part of a legend item associated with the current displayer.

The drawing is performed in the port dst using the clipping region clip. It is bounded by the rectangle legendArea.

The current implementation of the method simply draws an horizontal line passing through the center of legendArea and bounded by this area.

Parameters:
dst The port used for the drawing.
legendArea The area where the drawing is performed.
itemPal The palette of the legend item associated with the current displayer.
clip The optional clipping region.
clientData The client data defined for the legend item associated with the current displayer.

Reimplemented from IlvSingleChartDisplayer.

Reimplemented in IlvStairChartDisplayer.

virtual IlUInt IlvStepChartDisplayer::getItemPointsCount ( const IlvChartDisplayerPoints dispPts  )  const [protected, virtual]

Returns the maximum number of points needed to define an item for the current displayer.

(See the IlvStepChartDisplayer::computeItem method for more details.)

Parameters:
dispPts The object that stores the points in screen coordinates to be displayed by the current displayer.
Returns:
2.

Reimplemented from IlvSingleChartDisplayer.

Reimplemented in IlvStairChartDisplayer.

virtual IlBoolean IlvStepChartDisplayer::graphicalRepresentationByDataPoint (  )  const [virtual]

Indicates whether there is a graphical representation by data point.

Returns a Boolean indicating whether there is a graphical representation by data point.

Returns:
IlFalse by default. There is not a graphical representation by data point since the steps that are displayed links several data points together.

Reimplemented from IlvAbstractChartDisplayer.

virtual IlBoolean IlvStepChartDisplayer::isContinuous (  )  const [virtual]

Indicates whether the graphical representation is continuous.

The graphical representation of data displayed by a displayer is said continuous if the graphical representation displayed for a given data point extends to and relies on another data point. So it is continuous if a given data point is not sufficient to display the graphical representation for this data point.

Returns:
IlTrue by default, since the graphical representation displayed by the current displayer is made of steps that link the data points.

Reimplemented from IlvAbstractChartDisplayer.

virtual IlvDoublePoint* IlvStepChartDisplayer::selectDataPointsForPoint ( IlUInt  dataPointIndex,
IlUInt count,
IlUInt *&  dataPointIndexes 
) const [protected, virtual]

Selects and returns the data points needed to display the graphical representation of the data points at a given index in the real data set to be displayed by the current displayer.

(See the IlvSingleChartDisplayer::selectDataPointsForPoint method for more details.)

For a displayer displaying a data set with steps, the data points that are selected to be able to draw the graphical representation for a data point at a given index of the data set are the following: the data point at the index dataPointIndex plus the data point at the index before (if it exists), and the data point at the index after (if it exists). These selected data points allow the two steps going from the considered data point at the given index to be drawn.

Reimplemented from IlvSingleChartDisplayer.

virtual void IlvStepChartDisplayer::treatPointsOutOfAbscissaLimits ( const IlvRect dataDisplayArea,
IlvChartDisplayerPoints dispPts,
const IlvCoordInterval abscissaRange,
const IlvPoint minLimit,
const IlvPoint maxLimit 
) const [virtual]

Treats the occurrence of the points in screen coordinates that are outside the abscissa limits.

(See the IlvAbstractChartDisplayer::treatPointsOutOfAbscissaLimits method for more details.)

This method computes the intersections with the abscissa limits of the steps extending outside of these limits. The computed intersection points are added to the screen points stored in dispPts and the screen points that are outside the abscissa limits are removed from dispPts.

Reimplemented from IlvSingleChartDisplayer.

 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.