rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Charts Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

Ilv3dBarChartDisplayer Class Reference

Class for 3D bar displayers. More...

#include <ilviews/charts/bar.h>

Inheritance diagram for Ilv3dBarChartDisplayer:
IlvBarChartDisplayer IlvSingleChartDisplayer IlvAbstractChartDisplayer

List of all members.

Public Member Functions

 Ilv3dBarChartDisplayer (IlvDim width=IlvChartDisplayerWidth, IlvDim depth=IlvChartDisplayerDepth, IlvPalette *palette=0)
 Constructor.
virtual ~Ilv3dBarChartDisplayer ()
 Destructor.
void drawTopFace (IlBoolean b)
 Specifies whether the top face of the 3D bars is drawn.
virtual void getClipArea (IlvRect &area, const IlvTransformer *t) const
 Returns the clipping region that is used for the drawing.
IlvDim getDepth () const
 Returns the depth of the 3D bars used to represent the data.
virtual IlvDim getWidth () const
 Returns the width of the 3D bars used to represent the data.
IlBoolean isDrawingTopFace () const
 Indicates whether the top face of the 3D bars is drawn.
void setDepth (IlvDim depth)
 Sets the depth of the 3D bars used to represent the data.
virtual void setMode (IlvDrawMode mode)
 Sets the drawing mode.
virtual void setOverwrite (IlBoolean o)
 Sets the overwrite mode.
virtual void setPalette (IlvPalette *pal, IlUInt index=0)
 Sets the palette used by the current displayer.
virtual void setWidth (IlvDim width)
 Sets the width of the3D bars used to represent the data.

Protected Member Functions

virtual void boundingBoxOfPoints (IlvChartDisplayerPoints *displayerPoints, IlvRect &bbox, IlBoolean takeInfoIntoAccount, const IlvTransformer *t=0) const
 Computes the bounding box of the graphical representation from points in screen coordinates corresponding to the data points to display.
virtual void computeItem (const IlvChartDisplayerPoints *displayerPoints, 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 computePalettes ()
 Computes the shadow palettes used to display the top and side faces of the 3D bars.
virtual void computeTopBottomShadows (IlvPalette *currentPalette, IlvPalette *&topShadow, IlvPalette *&bottomShadow) const
 Computes the shadow palettes from a given palette.
virtual void drawItem (const IlvChartDisplayerPoints *displayerPoints, 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 *displayerPoints, 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 *displayerPoints) const
 Returns the maximum number of points needed to define an item for the current displayer.

Detailed Description

Class for 3D bar displayers.

Library: ilvcharts

This class is a subclass of IlvBarChartDisplayer which allows you to represent data with 3D bars.

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

The images below show data sets represented with 3D bar displayers in a Cartesian chart (on the left) and a polar chart (on the right).

img_3dbar.gif
img_3dbar_polar.gif
See also:
IlvBarChartDisplayer.

Constructor & Destructor Documentation

Ilv3dBarChartDisplayer::Ilv3dBarChartDisplayer ( IlvDim  width = IlvChartDisplayerWidth,
IlvDim  depth = IlvChartDisplayerDepth,
IlvPalette palette = 0 
)

Constructor.

Initializes a new Ilv3dBarChartDisplayer object. The Boolean indicating whether the top face is drawn is set to IlTrue by default.

Parameters:
width The width of the 3D bars that will be used to represent the data.
depth The depth of the 3D bars that will be used to represent the data.
palette The palette that will be used to display the 3D bars.
3dbar.gif
virtual Ilv3dBarChartDisplayer::~Ilv3dBarChartDisplayer (  )  [virtual]

Destructor.

The destructor unlocks the shadow palettes computed from the palette set on the current displayer. The shadow palettes are used to display the top and side faces, whereas the front face is displayed with the palette set on the current displayer.


Member Function Documentation

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

Computes 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 just calls the IlvBarChartDisplayer::boundingBoxOfPoints method and expands the computed bounding box by the difference between the depth and the size of the bars if the depth is greater than the size.

Reimplemented from IlvBarChartDisplayer.

virtual void Ilv3dBarChartDisplayer::computeItem ( const IlvChartDisplayerPoints displayerPoints,
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 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::computeItem method for more details).

The item that will be displayed for a given screen point corresponding to a data point is a 3D bar. This 3D bar is defined by twelve points corresponding to the corners of the three faces of the 3D bar. The following figure shows these points. The indexes at which the points are stored in the array points that is used to return the points defining the item are displayed next to the points.

3dbar_item.gif

The number of computed points defining the item (that is, 12) is returned in usedPointsCount.

Reimplemented from IlvBarChartDisplayer.

virtual void Ilv3dBarChartDisplayer::computePalettes (  )  [protected, virtual]

Computes the shadow palettes used to display the top and side faces of the 3D bars.

Computes the shadow palettes used to display the top and side faces of the 3D bars from the palette set on the current displayer. (The palette set on the current displayer is used to display the front face).

virtual void Ilv3dBarChartDisplayer::computeTopBottomShadows ( IlvPalette currentPalette,
IlvPalette *&  topShadow,
IlvPalette *&  bottomShadow 
) const [protected, virtual]

Computes the shadow palettes from a given palette.

Parameters:
currentPalette The palette from which the shadow palettes are computed.
topShadow The computed shadow palette that will be used to display the top face of the 3D bars.
bottomShadow The computed shadow palette that will be used to display the side face of the 3D bars.
Warning:
[note] This method is used internally and should not be used directly by the user. It is called in the Ilv3dBarChartDisplayer::computePalettes method in order to compute the shadow palettes that will be used to display the top and the side faces of the 3D bars.
virtual void Ilv3dBarChartDisplayer::drawItem ( const IlvChartDisplayerPoints displayerPoints,
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 3D bar defined by the points stored in points. (See the Ilv3dBarChartDisplayer::computeItem method for more details.) A polyline is drawn around each face of the 3D bar with the foreground color of the palette itemPalette. The front face is filled with the background color of the palette if the method IlvSingleChartDisplayer::isDrawingFill returns IlTrue. The top and side faces are filled with the shadow colors computed from the background color if the method IlvSingleChartDisplayer::isDrawingFill returns IlTrue.

Reimplemented from IlvBarChartDisplayer.

virtual void Ilv3dBarChartDisplayer::drawPoints ( IlvChartDisplayerPoints displayerPoints,
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.

The drawing is performed in the given port dst using the transformer t and the clipping region clip.

The default implementation of this method uses the IlvSingleChartDisplayer::getClipArea method to obtain the clipping region to be used for the drawing. Then, for each point in screen coordinates stored in displayerPoints, it uses:

At the end, it uses the IlvSingleChartDisplayer::drawPointInfos method to draw the point information (if any).

Parameters:
displayerPoints The object that stores the points in screen coordinates that have to be displayed by the current displayer. These points are considered to be already transformed by t.
dst The port used for the drawing.
t The optional transformer.
clip The optional clipping region.

Reimplemented from IlvSingleChartDisplayer.

void Ilv3dBarChartDisplayer::drawTopFace ( IlBoolean  b  ) 

Specifies whether the top face of the 3D bars is drawn.

Parameters:
b The new value of the Boolean indicating whether the top face of the 3D bars is drawn.
Warning:
[note] This method is used internally and should not be used directly by the user. By default, the Boolean is set to IlTrue. This Boolean is used by the stacked 3D bar displayers to draw the top faces of the 3D bars only for the 3D bars at the top of the stack. In this case, the Boolean value is automatically set in the IlvStacked3dBarChartDisplayer::updateDisplayers method and so does not need to be set by hand.
virtual void Ilv3dBarChartDisplayer::getClipArea ( IlvRect area,
const IlvTransformer t 
) const [virtual]

Returns the clipping region that is used for the drawing.

This method returns in area the clipping region that is used to clip the graphical representation of data drawn by the current object. If a transformer t is specified, the returned clipping region is transformed by t. The current implementation of the method returns in area the area obtained by the IlvSingleChartDisplayer::getClipArea method expanded perpendicularly to the base by the depth of a 3D bar and along the base by the maximum between the the size and the depth of a 3D bar. The term base of a chart refers to the abscissa scale of this chart.

Parameters:
area The returned clipping region that is used by the current object for the drawing.
t The transformer that is applied to the returned clipping region.

Reimplemented from IlvBarChartDisplayer.

IlvDim Ilv3dBarChartDisplayer::getDepth (  )  const

Returns the depth of the 3D bars used to represent the data.

Returns:
The depth of the 3D bars used to represent data. (See the figure above.)
virtual IlUInt Ilv3dBarChartDisplayer::getItemPointsCount ( const IlvChartDisplayerPoints displayerPoints  )  const [protected, virtual]

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

See the Ilv3dBarChartDisplayer::computeItem method for more details.

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

Reimplemented from IlvBarChartDisplayer.

virtual IlvDim Ilv3dBarChartDisplayer::getWidth (  )  const [virtual]

Returns the width of the 3D bars used to represent the data.

Returns:
The width of the 3D bars used to represent the data.

Reimplemented from IlvBarChartDisplayer.

IlBoolean Ilv3dBarChartDisplayer::isDrawingTopFace (  )  const

Indicates whether the top face of the 3D bars is drawn.

Returns:
IlTrue if the top face is drawn and IlFalse otherwise.
See also:
Ilv3dBarChartDisplayer::drawTopFace.
void Ilv3dBarChartDisplayer::setDepth ( IlvDim  depth  ) 

Sets the depth of the 3D bars used to represent the data.

Parameters:
depth The new depth of the 3D bars used to represent the data.
virtual void Ilv3dBarChartDisplayer::setMode ( IlvDrawMode  mode  )  [virtual]

Sets the drawing mode.

Sets the drawing mode for the current object. The information is passed to all the palettes used by the current displayer to display data.

Parameters:
mode The new drawing mode for the current object.

Reimplemented from IlvSingleChartDisplayer.

virtual void Ilv3dBarChartDisplayer::setOverwrite ( IlBoolean  o  )  [virtual]

Sets the overwrite mode.

Modifies the way the drawing member functions of the current object operate when drawing on the root port. If the o parameter is set to IlFalse, the drawing operations are hidden by the windows stored on the top window. If the parameter is set to IlTrue, the drawing operations are performed on top of every window present on the screen, just as if the windows were part of the root window. The information is passed to all the palettes used by the current displayer to display data.

Parameters:
o The new value of the Boolean indicating the way the drawing member functions operate.

Reimplemented from IlvSingleChartDisplayer.

virtual void Ilv3dBarChartDisplayer::setPalette ( IlvPalette pal,
IlUInt  index = 0 
) [virtual]

Sets the palette used by the current displayer.

Sets the palette used by the current displayer to display data to palette and computes the shadow palettes from this palette. The shadow palettes are used to display the top and side faces, whereas the palette palette is used to display the front face.

Warning:
[note] The index index is not used since the current displayer is a single displayer. (See the IlvAbstractChartDisplayer::setPalette method for more details.)
Parameters:
palette The new palette used by the current displayer.
index If the current displayer is a composite displayer, this parameter indicates the index of the displayer within the displayers composing the current displayer. Otherwise, this parameter can be omitted.

Reimplemented from IlvSingleChartDisplayer.

virtual void Ilv3dBarChartDisplayer::setWidth ( IlvDim  width  )  [virtual]

Sets the width of the3D bars used to represent the data.

Parameters:
width The new width of the 3D bars used to represent the data.

Reimplemented from IlvBarChartDisplayer.

 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.