Rogue Wave Views 5.5.1 |
Rogue Wave Views |
Rogue Wave Views Documentation Home |
Class for bubble displayers. More...
#include <ilviews/charts/bubble.h>
Public Types | |
enum | BubbleSizeMode { MinMax, Scaling } |
This enumeration type defines how the size of the bubbles is computed. More... | |
Public Member Functions | |
IlvBubbleChartDisplayer (IlvGraphic *graphic, IlDouble scaling, IlvPalette *palette=0) | |
Constructor. | |
IlvBubbleChartDisplayer (IlvGraphic *graphic, IlvDim maxSize=40, IlvDim minSize=0, IlvPalette *palette=0) | |
Constructor. | |
virtual | ~IlvBubbleChartDisplayer () |
Destructor. | |
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 | 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 void | getClipArea (IlvRect &area, const IlvTransformer *t) const |
Returns the clipping region that is used for the drawing. | |
IlvGraphic * | getGraphicModel () const |
Returns the graphic object that is used as bubbles. | |
IlvDim | getGraphicSize (IlUInt pointIndex) const |
Returns the size of the graphic object that will be displayed as bubble for the data point at a given index. | |
IlvDim | getMaxSize () const |
Returns the maximum size that the bubbles will have on the screen. | |
IlvDim | getMinSize () const |
Returns the minimum size that the bubbles will have on the screen. | |
IlDouble | getScaling () const |
Retrieves the scaling factor used to compute the bubble size. | |
virtual IlvDim | getSizeAlongBase () const |
Returns the size along the base for the graphical representation of a given data point. | |
IlvChartDataSet * | getSizeDataSet () const |
Returns the data set that indicates the size of the bubbles. | |
virtual IlBoolean | isViewable () const |
Indicates whether the graphical representation can be viewed. | |
IlvGraphic * | setGraphicModel (IlvGraphic *graphic) |
Sets the graphic object that is used as bubbles. | |
void | setMaxSize (IlvDim maxSize) |
Sets the maximum size that the bubbles will have on the screen. | |
void | setMinSize (IlvDim minSize) |
Sets the minimum size that the bubbles will have on the screen. | |
void | setScaling (IlDouble scaling) |
Sets the scaling factor used to compute the bubble size. | |
Protected Member Functions | |
virtual void | boundingBoxOfItem (const IlvChartDisplayerPoints *displayerPoints, IlUInt pointIndex, IlUInt pointCount, IlvPoint *points, IlvRect &bbox, IlBoolean takeInfoIntoAccount=IlTrue, const IlvTransformer *t=0) const |
Computes the bounding box of the item drawn for a given point in screen coordinates corresponding to a data point to display. | |
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 | 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 IlUInt | getItemPointsCount (const IlvChartDisplayerPoints *displayerPoints) const |
Returns the maximum number of points needed to define an item for the current displayer. | |
virtual void | update () |
Performs the updates needed when modifications are made to the real data sets. |
Class for bubble displayers.
Library: ilvcharts
This class is a subclass of IlvSingleChartDisplayer
which allows you to represent data with bubbles.
The bubble displayer displays two data sets. The first data set indicates the location of the bubbles and the second data set indicates the size of the bubbles.
Any graphic object can be used as bubbles.
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 a bubble displayer in a Cartesian chart (on the left) and a polar chart (on the right).
IlvSingleChartDisplayer
. IlvBubbleChartDisplayer::IlvBubbleChartDisplayer | ( | IlvGraphic * | graphic, | |
IlvDim | maxSize = 40 , |
|||
IlvDim | minSize = 0 , |
|||
IlvPalette * | palette = 0 | |||
) |
Constructor.
Initializes a new IlvBubbleChartDisplayer
object.
graphic | The graphic object that will be used to display the bubbles. | |
maxSize | The maximum size that the bubbles will have on the screen. | |
minSize | The minimum size that the bubbles will have on the screen. | |
palette | The palette that will be used to display the bubbles. |
IlvBubbleChartDisplayer::IlvBubbleChartDisplayer | ( | IlvGraphic * | graphic, | |
IlDouble | scaling, | |||
IlvPalette * | palette = 0 | |||
) |
Constructor.
Initializes a new IlvBubbleChartDisplayer
object.
graphic | The graphic object that will be used to display the bubbles. | |
scaling | The scaling factor that is applied to the data values to compute the size of the bubbles. | |
palette | The palette that will be used to display the bubbles. |
virtual IlvBubbleChartDisplayer::~IlvBubbleChartDisplayer | ( | ) | [virtual] |
Destructor.
The destructor deletes the graphic object that is used to display the bubbles.
virtual void IlvBubbleChartDisplayer::boundingBoxOfItem | ( | const IlvChartDisplayerPoints * | displayerPoints, | |
IlUInt | pointIndex, | |||
IlUInt | pointCount, | |||
IlvPoint * | points, | |||
IlvRect & | bbox, | |||
IlBoolean | takeInfoIntoAccount = IlTrue , |
|||
const IlvTransformer * | t = 0 | |||
) | const [protected, virtual] |
Computes the bounding box of the item drawn for a given point in screen coordinates corresponding to a data point to display.
Computes the bounding box of the item drawn for the point in screen coordinates that is stored at the index pointIndex in the displayerPoints object. (See the IlvSingleChartDisplayer::boundingBoxOfItem
method for more details.)
This method returns the bounding box of the bubble centered on the screen point stored in points.
Reimplemented from IlvSingleChartDisplayer.
virtual void IlvBubbleChartDisplayer::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 calls the IlvSingleChartDisplayer::boundingBoxOfPoints
method. Then, the computed bounding box is expanded of the maximum size of the displayed bubbles divided by 2
.
IlvRect
objects. Reimplemented from IlvSingleChartDisplayer.
virtual void IlvBubbleChartDisplayer::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.)
This method just returns in points the point at the index pointIndex since the item that will be displayed for a given screen point corresponding to a data point to display is a bubble centered on this screen point.
The number of computed points defining the item (that is, 1
) is returned in usedPointsCount.
Implements IlvSingleChartDisplayer.
virtual void IlvBubbleChartDisplayer::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 graphic object defined to be used as bubbles centered on the screen point stored in points. The size of the graphic object is given by the IlvBubbleChartDisplayer::getGraphicSize
method. The graphic object is drawn with the palette itemPalette.
Implements IlvSingleChartDisplayer.
virtual void IlvBubbleChartDisplayer::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 implementation of this method draws the graphic object used to display the bubbles.
dst | The port used for the drawing. | |
legendArea | The area where the graphic object is drawn. | |
itemPal | The legend item palette associated with the current displayer. | |
clip | The clipping region. | |
clientData | The client data for the legend item associated with the current displayer. |
Reimplemented from IlvSingleChartDisplayer.
virtual void IlvBubbleChartDisplayer::drawPoints | ( | IlvChartDisplayerPoints * | displayerPoints, | |
IlvPort * | dst, | |||
const IlvTransformer * | t = 0 , |
|||
const IlvRegion * | clip = 0 | |||
) | const [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:
IlvSingleChartDisplayer::computeItem
method to compute the item that will be displayed for this screen point. IlvSingleChartDisplayer::drawItem
method to draw the item for this screen point. At the end, it uses the IlvSingleChartDisplayer::drawPointInfos
method to draw the point information (if any).
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.
virtual void IlvBubbleChartDisplayer::getClipArea | ( | IlvRect & | area, | |
const IlvTransformer * | t | |||
) | const [virtual] |
Returns the clipping region that is used for the drawing.
Returns in area the area obtained by the IlvSingleChartDisplayer::getClipArea
method expanded by the maximum size that the bubbles will have on the screen.
area | The returned clipping region. | |
t | The transformer applied to the returned clipping region. |
Reimplemented from IlvSingleChartDisplayer.
IlvGraphic* IlvBubbleChartDisplayer::getGraphicModel | ( | ) | const |
Returns the graphic object that is used as bubbles.
0
otherwise. Returns the size of the graphic object that will be displayed as bubble for the data point at a given index.
pointIndex | The index of the data point for which we want to get the size of the drawn bubble. |
virtual IlUInt IlvBubbleChartDisplayer::getItemPointsCount | ( | const IlvChartDisplayerPoints * | displayerPoints | ) | const [protected, virtual] |
Returns the maximum number of points needed to define an item for the current displayer.
(See the IlvBubbleChartDisplayer::computeItem
method for more details).
displayerPoints | The object that stores the points in screen coordinates to be displayed by the current displayer. |
1
. Reimplemented from IlvSingleChartDisplayer.
IlvDim IlvBubbleChartDisplayer::getMaxSize | ( | ) | const |
Returns the maximum size that the bubbles will have on the screen.
IlvDim IlvBubbleChartDisplayer::getMinSize | ( | ) | const |
Returns the minimum size that the bubbles will have on the screen.
IlDouble IlvBubbleChartDisplayer::getScaling | ( | ) | const |
Retrieves the scaling factor used to compute the bubble size.
virtual IlvDim IlvBubbleChartDisplayer::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.
Reimplemented from IlvSingleChartDisplayer.
IlvChartDataSet* IlvBubbleChartDisplayer::getSizeDataSet | ( | ) | const |
Returns the data set that indicates the size of the bubbles.
virtual IlBoolean IlvBubbleChartDisplayer::isViewable | ( | ) | const [virtual] |
Indicates whether the graphical representation can be viewed.
Returns a Boolean indicating whether the graphical representation displayed by the current displayer is viewable. The graphical representation displayed by the current displayer is viewable if and only if all the elements required to be able to display this graphical representation are verified. It is viewable if the method IlvSingleChartDisplayer::isViewable
returns IlTrue
, if a graphic object to be used as bubbles is defined and if the number of data sets to display is equal to 2
.
IlTrue
if the graphical representation displayed by the current displayer is viewable and IlFalse
otherwise. Reimplemented from IlvAbstractChartDisplayer.
IlvGraphic* IlvBubbleChartDisplayer::setGraphicModel | ( | IlvGraphic * | graphic | ) |
Sets the graphic object that is used as bubbles.
graphic | The new graphic object that is used as bubbles. |
void IlvBubbleChartDisplayer::setMaxSize | ( | IlvDim | maxSize | ) |
Sets the maximum size that the bubbles will have on the screen.
maxSize | The new maximum size that the bubbles will have on the screen. |
void IlvBubbleChartDisplayer::setMinSize | ( | IlvDim | minSize | ) |
Sets the minimum size that the bubbles will have on the screen.
minSize | The new minimum size that the bubbles will have on the screen. |
void IlvBubbleChartDisplayer::setScaling | ( | IlDouble | scaling | ) |
Sets the scaling factor used to compute the bubble size.
scaling | The new scaling factor that is applied to the data values to compute the size of the bubbles. |
virtual void IlvBubbleChartDisplayer::update | ( | ) | [protected, virtual] |
Performs the updates needed when modifications are made to the real data sets.
Performs the updates needed when modifications (removing, adding, or replacing data sets) are made to the real data sets to be displayed by the current displayer.
The current implementation of the method sets a dedicated listener on the data set indicating the size of the bubbles. This listener will allow the size of the bubbles on the screen to be updated when modifications are made to the data set indicating the size of the bubbles.
Reimplemented from IlvAbstractChartDisplayer.
© 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.