rwlogo
Rogue Wave Views 5.5.1

Rogue Wave Views
Charts Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IlvFixedStepChartDisplayer Class Reference

Class for fixed step displayers. More...

#include <ilviews/charts/polyline.h>

Inheritance diagram for IlvFixedStepChartDisplayer:
IlvSingleChartDisplayer IlvAbstractChartDisplayer

List of all members.

Public Member Functions

 IlvFixedStepChartDisplayer (IlvDim width=8, 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 void getClipArea (IlvRect &area, const IlvTransformer *t) const
 Returns the clipping region that is used for the drawing.
IlvDim getSize () const
 Returns the size of the fixed steps.
virtual IlvDim getSizeAlongBase () const
 Returns the size along the base for the graphical representation of a given data point.
IlvDim getWidth () const
 Returns the width of the fixed steps.
void setWidth (IlvDim width)
 Sets the width of the fixed steps.
virtual void write (IlvOutputFile &) const
 Writes the attributes of the current object in a file.

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.

Detailed Description

Class for fixed step displayers.

Library: ilvcharts

This class is a subclass of IlvSingleChartDisplayer that allows you to represent data with fixed steps centered on the data.

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

img_fixedstep.gif
img_fixedstep_polar.gif
See also:
IlvSingleChartDisplayer.

Constructor & Destructor Documentation

IlvFixedStepChartDisplayer::IlvFixedStepChartDisplayer ( IlvDim  width = 8,
IlvPalette palette = 0 
)

Constructor.

Initializes a new IlvFixedStepChartDisplayer object.

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

Member Function Documentation

virtual void IlvFixedStepChartDisplayer::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 calls the IlvSingleChartDisplayer::boundingBoxOfPoints method. Then, the computed bounding box is expanded along the base by the size of the fixed steps. The term base of a chart refers to the abscissa scale of this chart.

Reimplemented from IlvSingleChartDisplayer.

virtual void IlvFixedStepChartDisplayer::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 centered on the screen point. The two points defining this segment are obtained by shifting a distance of -size for the first point and +size for the second point, where size is the size of the fixed steps.

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

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

Implements IlvSingleChartDisplayer.

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

virtual void IlvFixedStepChartDisplayer::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 displayerPoints 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 fixed step defined by the points stored in points. The item that is drawn is simply a segment. This segment is displayed with the foreground color of the palette itemPalette. (See the IlvFixedStepChartDisplayer::computeItem method for more details.)

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

Implements IlvSingleChartDisplayer.

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

virtual void IlvFixedStepChartDisplayer::getClipArea ( IlvRect area,
const IlvTransformer t 
) const [virtual]

Returns the clipping region that is used for the drawing.

The current implementation of the method returns in area the area obtained by the IlvSingleChartDisplayer::getClipArea method expanded along the base by the size of the fixed steps. (The size is obtained by the IlvFixedStepChartDisplayer::getSize method.) The term base of a chart refers to the abscissa scale of this chart.

Parameters:
area The clipping region that is used to clip the graphical representation of data drawn by the current displayer.
t The transformer that is applied to the returned clipping region.

Reimplemented from IlvSingleChartDisplayer.

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

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

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

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

Reimplemented from IlvSingleChartDisplayer.

IlvDim IlvFixedStepChartDisplayer::getSize (  )  const

Returns the size of the fixed steps.

Returns:
The size of the high-low items.
Warning:
[note] This size corresponds to half the width of a fixed step.
virtual IlvDim IlvFixedStepChartDisplayer::getSizeAlongBase (  )  const [virtual]

Returns the size along the base for the graphical representation of a given data point.

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

Returns:
The width of a fixed step.
Warning:
[note] This size corresponds to twice the value returned by the IlvFixedStepChartDisplayer::getSize method.

Reimplemented from IlvSingleChartDisplayer.

IlvDim IlvFixedStepChartDisplayer::getWidth (  )  const

Returns the width of the fixed steps.

Returns:
The width of the fixed steps.
void IlvFixedStepChartDisplayer::setWidth ( IlvDim  width  ) 

Sets the width of the fixed steps.

Parameters:
The new width of the fixed steps.
virtual void IlvFixedStepChartDisplayer::write ( IlvOutputFile file  )  const [virtual]

Writes the attributes of the current object in a file.

Called by the IlvAbstractChartDisplayer::save method. This method can be overloaded in subclasses that define new attributes. The information written by the write method is read by the IO constructor, which takes an IlvInputFile as its only argument. Both this method and the IO constructor can be automatically declared by using the DeclareChartDisplayerTypeInfo macro within the class declaration.

Parameters:
file The file where the attributes of the current object are written.

Reimplemented from IlvSingleChartDisplayer.


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