rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Charts Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IlvScatterChartDisplayer Class Reference

Class for scatter displayers. More...

#include <ilviews/charts/scatter.h>

Inheritance diagram for IlvScatterChartDisplayer:
IlvSingleChartDisplayer IlvAbstractChartDisplayer

List of all members.

Public Member Functions

 IlvScatterChartDisplayer (IlvMarkerType marker=IlvMarkerFilledSquare, IlvDim markerSize=IlvDefaultMarkerSize, 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.
IlvMarkerType getMarker () const
 Returns the type of the markers used to represent the data.
IlvDim getMarkerSize () const
 Returns the size of the markers used to represent the data.
virtual IlvDim getSizeAlongBase () const
 Returns the size along the base for the graphical representation of a given data point.
void setMarker (IlvMarkerType marker)
 Sets the type of the markers used to represent the data.
void setMarkerSize (IlvDim size)
 Sets the size of the markers used to represent the data.
virtual void write (IlvOutputFile &) const
 Writes the attributes of the current object in a file.

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
 Returns 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=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 *displayerPoints, IlUInt pointIndex, IlUInt &usedPoints, 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, 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.

Detailed Description

Class for scatter displayers.

Library: ilvcharts

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

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

img_scatter.gif
img_scatter_polar.gif
See also:
IlvSingleChartDisplayer.

Constructor & Destructor Documentation

IlvScatterChartDisplayer::IlvScatterChartDisplayer ( IlvMarkerType  marker = IlvMarkerFilledSquare,
IlvDim  markerSize = IlvDefaultMarkerSize,
IlvPalette palette = 0 
)

Constructor.

Initializes a new IlvScatterChartDisplayer object.

Parameters:
marker The type of the markers that will be used to represent the data.
markerSize The size of the markers.
palette The palette that will be used to display the markers.

Member Function Documentation

virtual void IlvScatterChartDisplayer::boundingBoxOfItem ( const IlvChartDisplayerPoints displayerPoints,
IlUInt  pointIndex,
IlUInt  pointCount,
IlvPoint points,
IlvRect bbox,
IlBoolean  takeInfoIntoAccount = IlTrue,
const IlvTransformer t = 0 
) const [protected, virtual]

Returns 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 just returns the bounding box of the marker centered on the screen point stored in points, since the item that is drawn for a given screen point corresponding to a data point to display is a marker.

Reimplemented from IlvSingleChartDisplayer.

virtual void IlvScatterChartDisplayer::boundingBoxOfPoints ( IlvChartDisplayerPoints displayerPoints,
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 just calls the IlvSingleChartDisplayer::boundingBoxOfPoints method and expands the computed bounding box by the size of the markers.

Reimplemented from IlvSingleChartDisplayer.

virtual void IlvScatterChartDisplayer::computeItem ( const IlvChartDisplayerPoints displayerPoints,
IlUInt  pointIndex,
IlUInt usedPoints,
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 marker centered on this screen point.

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

Implements IlvSingleChartDisplayer.

virtual IlvAbstractChartDisplayer* IlvScatterChartDisplayer::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 IlvScatterChartDisplayer::drawItem ( const IlvChartDisplayerPoints displayerPoints,
IlUInt  pointIndex,
IlUInt  pointCount,
IlvPoint points,
IlvPalette itemPalette,
IlvPort dst,
const IlvTransformer t,
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 just draws a marker centered on the screen point stored in points since the item that is drawn for a given screen point corresponding to a data point to display is a marker. The marker is drawn with the palette itemPalette.

Implements IlvSingleChartDisplayer.

virtual void IlvScatterChartDisplayer::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 a marker.

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 IlvScatterChartDisplayer::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 by the size of the marker (obtained by the IlvScatterChartDisplayer::getMarkerSize method).

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 IlvScatterChartDisplayer::getItemPointsCount ( const IlvChartDisplayerPoints displayerPoints  )  const [protected, virtual]

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

(See the IlvScatterChartDisplayer::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:
1.

Reimplemented from IlvSingleChartDisplayer.

IlvMarkerType IlvScatterChartDisplayer::getMarker (  )  const

Returns the type of the markers used to represent the data.

Returns:
The type of the markers used to represent the data.
IlvDim IlvScatterChartDisplayer::getMarkerSize (  )  const

Returns the size of the markers used to represent the data.

Returns:
The size of the markers used to represent the data.
virtual IlvDim IlvScatterChartDisplayer::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 size of the markers used to represent the data.

Reimplemented from IlvSingleChartDisplayer.

void IlvScatterChartDisplayer::setMarker ( IlvMarkerType  marker  ) 

Sets the type of the markers used to represent the data.

Parameters:
marker The new type of the markers used to represent the data.
void IlvScatterChartDisplayer::setMarkerSize ( IlvDim  size  ) 

Sets the size of the markers used to represent the data.

Parameters:
size The new size of the markers used to represent the data.
virtual void IlvScatterChartDisplayer::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.

 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.