rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Charts Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IlvStairChartDisplayer Class Reference

Class for stair displayers. More...

#include <ilviews/charts/polyline.h>

Inheritance diagram for IlvStairChartDisplayer:
IlvStepChartDisplayer IlvSingleChartDisplayer IlvAbstractChartDisplayer

List of all members.

Public Member Functions

 IlvStairChartDisplayer (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 isFilled () const
 Indicates whether the graphical representation is filled.

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 *dispPts, 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 void drawPoints (IlvChartDisplayerPoints *dispPts, IlvPort *dst, const IlvTransformer *t=0, const IlvRegion *clip=0) const
 Draws the graphical representation from points in screen coordinates corresponding to the data points to display.
virtual IlUInt getItemPointsCount (const IlvChartDisplayerPoints *dispPts) const
 Returns the maximum number of points needed to define an item for the current displayer.

Detailed Description

Class for stair displayers.

Library: ilvcharts

This class is a subclass of IlvStepChartDisplayer that allows you to represent data with stairs.

The stair 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 stair displayers in a Cartesian chart (on the left) and a polar chart (on the right).

img_stair.gif
img_stair_polar.gif
See also:
IlvStepChartDisplayer.

Constructor & Destructor Documentation

IlvStairChartDisplayer::IlvStairChartDisplayer ( IlvPalette palette = 0  ) 

Constructor.

Initializes a new IlvStairChartDisplayer object.

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

Member Function Documentation

virtual void IlvStairChartDisplayer::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.)

This method first computes the two points that are added to the points in screen coordinates that correspond to the data points to display in order to close the stairs. (See the IlvStairChartDisplayer::drawPoints method for more details about this calculation.) These two points are added to the points stored in dispPts. The method then calls the IlvStairChartDisplayer::computeItem method for each screen point stored in dispPts to compute the item that will be displayed for this screen point. Finally, 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 IlvStepChartDisplayer.

virtual void IlvStairChartDisplayer::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.

Reimplemented from IlvStepChartDisplayer.

virtual IlvAbstractChartDisplayer* IlvStairChartDisplayer::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.

Reimplemented from IlvStepChartDisplayer.

virtual void IlvStairChartDisplayer::drawItem ( const IlvChartDisplayerPoints dispPts,
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 is used only one time (and not for each screen point) to draw the whole stairs. The points defining the stairs are stored in points. A polyline is drawn between these points with the foreground color of the palette itemPalette. The stairs are filled with the background color of the palette itemPalette if the method IlvSingleChartDisplayer::isDrawingFill returns IlTrue.

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

Reimplemented from IlvStepChartDisplayer.

virtual void IlvStairChartDisplayer::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 current method simply calls the IlvSingleChartDisplayer::drawLegendItem method. (See the IlvSingleChartDisplayer::drawLegendItem method for more details.)

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

virtual void IlvStairChartDisplayer::drawPoints ( IlvChartDisplayerPoints dispPts,
IlvPort dst,
const IlvTransformer t = 0,
const IlvRegion clip = 0 
) const [protected, virtual]

Draws the graphical representation from points in screen coordinates corresponding to the data points to display.

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

This method first computes the two points that are added to the points in screen coordinates that correspond to the data points to display in order to close the stairs. These two points are computed from the first and the last points stored in dispPts. They are located on the abscissa scale in Cartesian charts. Both points are on the center of the data display area in polar charts. Look at the preceding figure for an example. On this figure, the screen points corresponding to data points to display are marked by black squares. These points are stored in dispPts. The two points that are added to close the stairs are shown with white circles. Once they have been computed, these two points are added to the points stored in dispPts.

The method IlvStairChartDisplayer::computeItem is used for each point in screen coordinates that is in dispPts to compute the item that will be displayed for this screen point. The method IlvStairChartDisplayer::computeItem returns the current screen point and the point obtained by being shifted along the abscissa scale from the current screen point toward the next point stored in dispPts. These two points allow the definition of a segment bounding the stairs to display that is issued from the current screen point. (See the previous figure where such a segment is shown for the point 1 in bold.) To improve the drawing performance, the method drawItem is called only one time (and not for each screen point) to draw the complete set of segments bounding the stairs.

The IlvSingleChartDisplayer::drawPointInfos method is used to draw the point information (if any).

Reimplemented from IlvSingleChartDisplayer.

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

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

Parameters:
dispPts The object that stores the points in screen coordinates to be displayed by the current displayer.
Returns:
(N - 2) * 2, where N is the number of points stored in dispPts.
Warning:
[note] The returned number corresponds to the total number of points used to display the stairs, since the segments that make up the stairs are displayed at only one time. These points are computed by calling the IlvStairChartDisplayer::computeItem method for each screen point stored in dispPts. (See the IlvStairChartDisplayer::computeItem method for more information.) The following figure shows a simple example illustrating the points used to display the stairs.
nb_pts_stairs.gif

The screen points corresponding to data points to display are marked with black squares. The two points added to close the stairs are marked with white circles. All these points (black squares and white circles) are stored in the dispPts object that is considered for the drawing. The points defining the stairs that are computed from the points stored in dispPts are surrounded by white squares. The number of points defining the stairs is equal to (N - 2) * 2, where N is the number of points stored in dispPts.

Reimplemented from IlvStepChartDisplayer.

virtual IlBoolean IlvStairChartDisplayer::isFilled (  )  const [virtual]

Indicates whether the graphical representation is filled.

A graphical representation is filled for a given data point if it is not only located around this data point but also if it extends towards the origin. This is the case for displayers representing data with stairs. The stairs are bounded by the steps computed for the data points (see the IlvStepChartDisplayer class) and are drawn to the abscissa scale in Cartesian charts and to the center of the data display area in polar charts. The following figure shows an example. The screen points corresponding to data points to display are marked by black squares.

Returns:
IlTrue by default.
stairs.gif

Reimplemented from IlvAbstractChartDisplayer.

 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.