Rogue Wave Views
Charts Package API Reference Guide
Product Documentation:

Rogue Wave Views
Documentation Home
List of all members | Public Member Functions | Protected Member Functions
IlvPieChartDisplayer Class Reference

Class for pie displayers. More...

#include <ilviews/charts/pie.h>

Inheritance diagram for IlvPieChartDisplayer:
IlvSingleChartDisplayer IlvAbstractChartDisplayer IlvValueInterface

Public Member Functions

 IlvPieChartDisplayer (IlDouble radius, IlDouble startingAngle=0.0, IlDouble range=360.0, IlvDim tearOffDelta=20, IlvPalette *palette=0)
 Constructor. More...
 
virtual ~IlvPieChartDisplayer ()
 Destructor. More...
 
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. More...
 
virtual void getClipArea (IlvRect &area, const IlvTransformer *t) const
 Returns the clipping region that is used for the drawing. More...
 
const IlvDoublePointgetOffset () const
 Returns the offset between the added graphic objects and all the slices. More...
 
IlvPieChartDataSetgetPieDataSet () const
 Returns the virtual data set used by the current displayer. More...
 
IlDouble getRadius () const
 Returns the radius of the pie. More...
 
IlDouble getRange () const
 Returns the range of the pie. More...
 
virtual IlBoolean getSliceGeometry (IlUInt sliceIndex, IlvRect &sliceRect, IlDouble &startAngle, IlDouble &range, const IlvTransformer *t=0) const
 Returns the geometric parameters defining a given slice. More...
 
IlvGraphicgetSliceGraphic (IlUInt sliceIndex) const
 Returns the graphic object that is drawn along with a given slice. More...
 
virtual void getSliceGraphicPosition (IlUInt sliceIndex, const IlvRect &sliceRect, IlDouble startAngle, IlDouble range, IlvPoint &position, const IlvTransformer *t=0) const
 Returns the position at which the added graphic object will be drawn for a given slice. More...
 
IlvPieSliceInfogetSliceInfo (IlUInt sliceIndex) const
 Returns the slice information object for a given slice. More...
 
IlvPointInfoCollectiongetSliceInfoCollection () const
 Returns the object managing the slice information objects defined for the current displayer. More...
 
IlUInt getSliceInfoCount () const
 Returns the number of slice information objects defined for the current displayer. More...
 
const char * getSliceLegendText (IlUInt sliceIndex) const
 Returns the text that will be used in a legend for a given slice. More...
 
IlvPalettegetSlicePalette (IlUInt sliceIndex) const
 Returns the palette used to display a given slice. More...
 
IlDouble getStartingAngle () const
 Returns the angle at which the first slice is drawn. More...
 
IlvDim getTearOffDelta () const
 Returns the offset applied to torn-off slices. More...
 
virtual IlBoolean isContinuous () const
 Indicates whether the graphical representation is continuous. More...
 
IlBoolean isSliceTornOff (IlUInt sliceIndex) const
 Indicates whether a given slice is torn off. More...
 
void removeAllSliceInfo ()
 Removes all the slice information objects defined for the current displayer.
 
void removeSliceInfo (IlUInt sliceIndex)
 Removes the slice information defined for a given slice. More...
 
virtual void setChartGraphic (IlvChartGraphic *chart)
 Sets the chart graphic which uses the current displayer. More...
 
virtual void setLegendItems (IlvChartLegend *legend) const
 Sets the legend items associated with the current displayer. More...
 
virtual void setMode (IlvDrawMode mode)
 Sets the drawing mode. More...
 
void setOffset (IlDouble theta, IlvPos rho)
 Sets the offset between the added graphic objects and all the slices. More...
 
void setOffset (const IlvDoublePoint &offset)
 Sets the offset between the added graphic objects and all the slices. More...
 
virtual void setOverwrite (IlBoolean o)
 Sets the overwrite mode. More...
 
void setRadius (IlDouble radius)
 Sets the radius of the pie. More...
 
void setRange (IlDouble range)
 Sets the angle range of the pie. More...
 
void setSliceGraphic (IlUInt sliceIndex, IlvGraphic *graphic)
 Sets the graphic object that is drawn along with a given slice. More...
 
void setSliceInfo (IlUInt sliceIndex, IlvPieSliceInfo *sliceInfo)
 Sets the slice information defined for a given slice. More...
 
virtual void setSliceLegendText (IlUInt sliceIndex, const char *legendText)
 Sets the text that will be used in a legend for a given slice. More...
 
void setSlicePalette (IlUInt sliceIndex, IlvPalette *palette)
 Sets the palette used to display a given slice. More...
 
void setStartingAngle (IlDouble angle)
 Sets the angle at which the first slice is drawn. More...
 
void setTearOffDelta (IlvDim delta)
 Sets the offset applied to torn-off slices. More...
 
virtual IlBoolean sliceBBox (IlUInt sliceIndex, IlvRect &bbox, const IlvTransformer *t=0) const
 Returns the bounding box of a given slice. More...
 
virtual IlBoolean sliceContains (IlUInt sliceIndex, const IlvPoint &viewPoint, const IlvTransformer *t=0) const
 Indicates whether a given slice contains a given screen point. More...
 
void tearOffSlice (IlUInt sliceIndex, IlBoolean flag=IlTrue)
 Specifies whether a given slice is torn off. More...
 
virtual IlBoolean useVirtualDataSets () const
 Indicates whether the current displayer uses virtual data sets. More...
 
IlUInt whichSlice (const IlvPoint &viewPoint, const IlvTransformer *t=0) const
 Returns the slice containing a given screen point. More...
 
- Public Member Functions inherited from IlvSingleChartDisplayer
virtual ~IlvSingleChartDisplayer ()
 Destructor. More...
 
virtual IlvChartDisplayerPointsallocDisplayerPoints () const
 Allocates and returns an IlvChartDisplayerPoints object. More...
 
virtual IlBoolean boundingBox (IlvRect &bbox, const IlvTransformer *t=0) const
 Returns the bounding box of the graphical representation of data. More...
 
virtual IlBoolean dataPointBBox (IlUInt dataPtIdx, IlvRect &bbox, IlBoolean takeInfoIntoAccount=IlTrue, const IlvTransformer *t=0) const
 Returns the bounding box of the graphical representation of the data points at a given index. More...
 
virtual void draw (IlvPort *dst, const IlvTransformer *t=0, const IlvRegion *clip=0) const
 Draws the graphical representation of data. More...
 
virtual void drawDataPoint (IlUInt dataPtIdx, IlvPort *dst, const IlvTransformer *t=0, const IlvRegion *clip=0) const
 Draws the graphical representation of the data point(s) at a given index. More...
 
virtual void drawDataPoints (IlUInt iMin, IlUInt iMax, IlvPort *dst, const IlvTransformer *t=0, const IlvRegion *clip=0) const
 Draws the graphical representation of the data points between a given interval. More...
 
virtual void drawFill (IlBoolean b)
 Sets the filling mode of the displayer. More...
 
virtual IlvColorgetBackground (IlUInt index=0) const
 Returns the background color of a palette used by the current displayer to display data. More...
 
void getDataDisplayArea (IlvRect &dataDisplayArea, const IlvTransformer *t=0) const
 Returns the bounds of the data display area. More...
 
IlvChartDisplayerPointsFactorygetDisplayerPointsFactory () const
 Returns the factory used to create IlvChartDisplayerPoints instances. More...
 
virtual IlUInt getDisplayersCount () const
 Returns the number of displayers. More...
 
virtual IlUInt getDisplayItem (IlvChartDataSet *&dataSet, const IlvPoint &viewPoint, const IlvTransformer *t) const
 Returns the item to which a view point corresponds. More...
 
virtual IlBoolean getDisplayPoint (const IlvChartDataSet *dataSet, IlUInt dataPtIdx, IlvPoint &point, const IlvTransformer *t=0) const
 Returns the corresponding screen point for a data point. More...
 
virtual IlvColorgetForeground (IlUInt index=0) const
 Returns the foreground color of a palette used by the current displayer to display data. More...
 
virtual const char * getInternalLegendText (IlUInt index=0) const
 Returns the legend text stored in the current displayer. More...
 
virtual const char * getLegendText (IlUInt index=0) const
 Returns the text that will be used in a legend for the current displayer. More...
 
virtual IlUInt getNearestPoint (IlvChartDataSet *&dataSet, const IlvPoint &viewPoint, IlvDim distance, IlvPoint &point, const IlvTransformer *t=0) const
 Returns the nearest data point. More...
 
virtual IlvPalettegetPalette (IlUInt=0) const
 Returns a palette used by the current displayer to display data. More...
 
virtual IlvPointInfoCollectiongetPointInfoCollection (const IlvChartDataSet *dataSet) const
 Returns the point information collection defined to be used to display a given data set. More...
 
IlvPos getShiftOffset () const
 Returns the offset by which the graphical representation of data is shifted along the base of the chart. More...
 
virtual IlvDim getSizeAlongBase () const
 Returns the size along the base for the graphical representation of a given data point. More...
 
IlBoolean isDrawingFill () const
 Returns the filling mode for the current displayer. More...
 
virtual void releaseDisplayerPoints (IlvChartDisplayerPoints *dispPts) const
 Releases an IlvChartDisplayerPoints object used by the current displayer. More...
 
virtual void setBackground (IlvColor *color, IlUInt index=0)
 Sets the background color of a palette used by the current displayer to display data. More...
 
virtual IlBoolean setDataPoint (IlvChartDataSet *dataSet, IlUInt dataPtIdx, const IlvPoint &point, const IlvTransformer *t=0) const
 Sets the corresponding data point from a screen point. More...
 
IlvChartDisplayerPointsFactorysetDisplayerPointsFactory (IlvChartDisplayerPointsFactory *factory)
 Sets the factory used to create IlvChartDisplayerPoints instances. More...
 
virtual void setForeground (IlvColor *color, IlUInt index=0)
 Sets the foreground color of a palette used by the current displayer to display data. More...
 
virtual void setLegendText (const char *text, IlUInt index=0)
 Sets the text that will be used in a legend for the current displayer. More...
 
virtual void setPalette (IlvPalette *pal, IlUInt index=0)
 Sets a palette used by the current displayer to display data. More...
 
virtual void setPointInfoCollection (const IlvChartDataSet *dataSet, IlvPointInfoCollection *ptInfoCollection)
 Sets the point information collection that will be used to display a given data set. More...
 
void setShiftOffset (IlvPos offset)
 Sets the offset by which the graphical representation of data is shifted along the base of the chart. More...
 
virtual void treatPointsOutOfAbscissaLimits (const IlvRect &dataDisplayArea, IlvChartDisplayerPoints *displayerPoints, const IlvCoordInterval &abscissaRange, const IlvPoint &minLimit, const IlvPoint &maxLimit) const
 Treats the occurrence of points in screen coordinates that are outside the abscissa limits. More...
 
virtual IlBoolean usePointInfo () const
 Indicates whether point information collections are defined. More...
 
virtual void write (IlvOutputFile &file) const
 Writes the attributes of the current object in a file. More...
 
- Public Member Functions inherited from IlvAbstractChartDisplayer
virtual ~IlvAbstractChartDisplayer ()
 Destructor. More...
 
void addDataSet (IlvChartDataSet *dataSet)
 Adds a real data set to be displayed by the current displayer. More...
 
virtual IlBoolean canBeProjectedIfOutOfBounds () const
 Indicates whether the graphical representation can be projected when it is out-of-bounds. More...
 
virtual IlvAbstractChartDisplayercopy () const =0
 Virtual copy constructor. More...
 
IlBoolean dataPointToDisplay (const IlvDoublePoint &dataPoint, IlvPoint &point, const IlvTransformer *t=0) const
 Projects a data point into screen coordinates. More...
 
virtual IlBoolean displayDataSet (const IlvChartDataSet *dataSet) const
 Indicates whether the current displayer displays a data set. More...
 
IlBoolean displayToDataPoint (const IlvPoint &point, IlvDoublePoint &dataPoint, const IlvTransformer *t=0) const
 Inversely projects a screen point to retrieve the corresponding data point. More...
 
IlvChartGraphicgetChartGraphic () const
 Returns the chart graphic which uses the current displayer. More...
 
IlvChartDataSetgetDataSet (IlUInt index=0) const
 Returns a data set used by the current displayer. More...
 
IlUInt getDataSetsCount () const
 Returns the number of data sets used by the current displayer. More...
 
IlUInt getMaxDataSetsCount () const
 Returns the maximum number of real data sets that the current displayer is allowed to display. More...
 
const char * getName () const
 Returns the name of the current displayer. More...
 
IlvCoordinateInfogetOrdinateInfo () const
 Deprecated Returns the coordinate information associated with the ordinate scale considered to display data. More...
 
const IlvCompositeChartDisplayergetParentDisplayer () const
 Returns the parent displayer. More...
 
virtual IlvChartDataPointInfogetPointInfo (IlUInt dataPtIdx, const IlvChartDataSet *dataSet=0) const
 Returns the point information associated with a given data point. More...
 
virtual IlvPalettegetProjectedPointsPalette () const
 Returns the palette used to display out-of-bounds values. More...
 
IlvChartDataSetgetRealDataSet (IlUInt index=0) const
 Returns a real data set to be displayed by the current displayer. More...
 
IlUInt getRealDataSetsCount () const
 Returns the number of real data sets. More...
 
virtual IlvCombinedChartDataSetgetVirtualDataSet (const IlvChartDataSet *dataSet, IlUInt &index) const
 Returns a virtual data set used by the current displayer. More...
 
virtual IlBoolean graphicalRepresentationByDataPoint () const
 Indicates whether there is a graphical representation by data point. More...
 
virtual void insertDataSet (IlvChartDataSet *dataSet, IlUInt index=IlvLastPositionIndex)
 Inserts a real data set to be displayed by the current displayer. More...
 
virtual IlBoolean isFilled () const
 Indicates whether the graphical representation is filled. More...
 
virtual IlBoolean isViewable () const
 Indicates whether the graphical representation can be viewed. More...
 
IlBoolean isVisible () const
 Indicates whether the graphical representation is visible. More...
 
virtual void removeDataSet (IlvChartDataSet *dataSet)
 Removes a real data set from the data sets to be displayed by the current displayer. More...
 
virtual void removeDataSets ()
 Removes all the real data sets to be displayed by the current displayer.
 
void removePointInfoCollection (const IlvChartDataSet *dataSet)
 Removes the point information collection defined to be used to display a given data set. More...
 
virtual IlBoolean replaceDataSet (IlvChartDataSet *oldDataSet, IlvChartDataSet *newDataSet)
 Replaces a real data set with another one. More...
 
IlvOutputFilesave (IlvOutputFile &file) const
 Writes a complete description of the current object in a file. More...
 
virtual void setDataSet (IlvChartDataSet *dataSet, IlUInt index=0)
 Sets a real data set to be displayed by the current displayer. More...
 
void setDataSet (IlvChartDataSet *dataSet, IlvPalette *palette, IlUInt index=0)
 Sets a real data set to be displayed by the current displayer. More...
 
virtual void setDataSets (IlUInt count, IlvChartDataSet *const *dataSets)
 Sets the real data sets to be displayed by the current displayer. More...
 
void setName (const char *name)
 Sets the name of the current displayer. More...
 
virtual void setOrdinateInfo (IlvCoordinateInfo *ordinateInfo)
 Sets the coordinate information associated with the ordinate scale considered to display data. More...
 
void setParentDisplayer (const IlvCompositeChartDisplayer *displayer)
 Sets the parent displayer. More...
 
void setVirtualDataSet (IlvCombinedChartDataSet *vDataSet, IlUInt index=0)
 Sets a virtual data set used by the current displayer. More...
 
void setVisible (IlBoolean visible)
 Specifies whether the graphical representation is visible. More...
 

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. More...
 
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. More...
 
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. More...
 
virtual IlvPieSliceInfocreateSliceInfo () const
 Creates and returns a new slice information object. More...
 
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. More...
 
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. More...
 
virtual IlUInt getItemPointsCount (const IlvChartDisplayerPoints *displayerPoints) const
 Returns the maximum number of points needed to define an item for the current displayer. More...
 
virtual IlvDoublePointselectDataPointsForPoint (IlUInt dataPointIndex, IlUInt &count, IlUInt *&dataPointIndexes) const
 Selects and returns the data points needed to display the graphical representation of the data points at a given index in the real data set(s) to be displayed by the current displayer. More...
 
virtual IlvDoublePointselectDataPointsForRange (const IlvCoordInterval &abscissaRange, IlUInt &pointCount, IlUInt *&dataPointIndexes, const IlvTransformer *t=0, const IlvRect *clip=0) const
 Selects and returns the data points to display that are within a given abscissa interval. More...
 
virtual void updateVirtualDataSets ()
 Updates the virtual data set. More...
 
- Protected Member Functions inherited from IlvSingleChartDisplayer
 IlvSingleChartDisplayer (IlvPalette *palette=0)
 Constructor. More...
 
 IlvSingleChartDisplayer (IlvInputFile &file)
 Constructor. More...
 
 IlvSingleChartDisplayer (const IlvSingleChartDisplayer &displayer)
 Constructor. More...
 
IlBoolean boundingBoxOfPart (const IlvCoordInterval &abscissaRange, IlBoolean shiftOfCycleLength, IlvRect &partBBox, IlBoolean takeInfoIntoAccount, const IlvTransformer *t=0) const
 Returns the bounding box of a part of the graphical representation of data. More...
 
virtual IlBoolean computeLimitsForDataSelection (const IlvRect &clipRect, const IlvCoordInterval &abscissaRange, const IlvCoordInterval &ordinateRange, IlvCoordInterval &abscissaSelectionRange, IlvCoordInterval &ordinateSelectionRange, IlBoolean &dataToSelect, const IlvTransformer *t=0) const
 Computes the abscissa and ordinate intervals used to select the data to be displayed in a given rectangle. More...
 
void drawPart (const IlvCoordInterval &abscissaRange, IlBoolean shiftOfCycleLength, IlvPort *dst, const IlvTransformer *t=0, const IlvRegion *clip=0) const
 Draws a part of the graphical representation of data. More...
 
virtual void drawPointInfos (const IlvChartDisplayerPoints *displayerPoints, IlvPort *dst, const IlvTransformer *t=0, const IlvRegion *clip=0, const IlvChartDataSet *dataSet=0) const
 Draws the point information defined for the data points to be displayed. More...
 
IlUInt getNearestPointInsidePart (const IlvCoordInterval &abscissaRange, IlBoolean shiftOfCycleLength, IlvChartDataSet *&dataSet, const IlvPoint &viewPoint, IlvDim distance, IlvPoint &point, const IlvTransformer *t=0) const
 Returns the nearest data point within a given abscissa range. More...
 
virtual IlUInt pointsContains (const IlvPoint &viewPoint, IlvChartDisplayerPoints *, const IlvTransformer *t=0) const
 Returns the index of the data point of which the corresponding displayer item holds viewPoint.
 
virtual IlvDoublePointselectDataPointsInRect (IlUInt &pointCount, IlUInt *&dataPtIndexes, IlvRect pickRect, const IlvTransformer *t=0) const
 Selects the data points that are rendered within a rectangle. More...
 
- Protected Member Functions inherited from IlvAbstractChartDisplayer
 IlvAbstractChartDisplayer ()
 Constructor. More...
 
 IlvAbstractChartDisplayer (const IlvAbstractChartDisplayer &displayer)
 Constructor. More...
 
 IlvAbstractChartDisplayer (IlvInputFile &file)
 Constructor. More...
 
virtual void dataSetAdded (IlUInt position=IlvLastPositionIndex)
 Performs the updates needed when a real data set is added. More...
 
virtual void dataSetRemoved (IlUInt index)
 Performs the updates needed when a real data set is removed. More...
 
virtual void update ()
 Performs the updates needed when modifications (removing, adding, replacing) are made to the real data sets.
 

Additional Inherited Members

- Static Public Member Functions inherited from IlvAbstractChartDisplayer
static IlvAbstractChartDisplayerLoad (IlvInputFile &file)
 Reads a displayer object from a file. More...
 

Detailed Description

Class for pie displayers.

Library: ilvcharts

This class is a subclass of IlvSingleChartDisplayer which allows you to represent data values with a pie chart.

The pie displayer displays a unique data set. Only the Y-values of the data points represented by the data set are considered. These values are represented in the form of slices of the pie. Therefore, it is better to use a Y-values data set (instance of the IlvChartYValueSet class) to store the data you want to display with a pie. However, it will also work if you use a data set of another type. Just remember that, in such a case, the values to be represented as slices of the pie are the Y-values of the data points represented by your data set.

The Y-values of the data points cannot be displayed directly by the pie displayer, since angle values are needed to be able to draw these values as slices. To display the real data set it has to display with slices, the pie displayer internally uses a specific virtual data set that is composed of data points expressed in polar coordinates (theta, rho) computed from the initial data points of the real data set. These computed data points lie on the extremities of the arcs of the slices. The virtual data set is an instance of the IlvPieChartDataSet class. (See this class for more details.) The virtual data set, constructed from the real data set that is set on the displayer, is the data set that is actually displayed by the displayer. (See the Detailed Description of the IlvAbstractChartDisplayer class for more information about virtual data sets).

Since the data points that are actually displayed by the pie displayer are expressed in polar coordinates, the pie displayer can only be used with a polar projection. (See the IlvPolarProjector class for more details.) Thus a pie displayer should only be added to a chart graphic using a polar projector.

A slice information object that stores specific information related to a slice can be added to each slice representing a data point in a pie displayer. This object should be an instance of the IlvPieSliceInfo class or one of its derived classes. The slice information objects defined for the current displayer are managed by an instance of the IlvPointInfoMap class.

The following image shows a data set represented with a pie displayer in a polar chart. A slice information object storing a label (instance of the IlvLabel class) has been added to each slice of the pie.

See also
IlvSingleChartDisplayer, IlvPieSliceInfo, IlvPolarProjector, IlvPieChartGraphic.

Constructor & Destructor Documentation

§ IlvPieChartDisplayer()

IlvPieChartDisplayer::IlvPieChartDisplayer ( IlDouble  radius,
IlDouble  startingAngle = 0.0,
IlDouble  range = 360.0,
IlvDim  tearOffDelta = 20,
IlvPalette palette = 0 
)

Constructor.

Initializes a new IlvPieChartDisplayer object.

Parameters
radiusThe radius of the pie. The radius is expressed with respect to the ordinate range of the chart graphic. The value of the radius should be within this range if you want the whole pie to appear. Otherwise the pie may be not visible or it may be truncated.
startingAngleThe angle at which the first slice is drawn.
rangeThe range of the angles covered by the slices of the pie. If range is equal to 360 degrees, the slices will cover a whole circle.
tearOffDeltaThe offset, in pixels, applied to torn-off slices.
paletteThe default palette that will be used to display the slices.

§ ~IlvPieChartDisplayer()

virtual IlvPieChartDisplayer::~IlvPieChartDisplayer ( )
virtual

Destructor.

The destructor removes and unlocks all the slice information objects.

Member Function Documentation

§ boundingBoxOfItem()

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

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 returns the bounding box of the slice defined by the points stored in points and of all the defined slice information objects (if any and if the Boolean takeInfoIntoAccount is equal to IlTrue).

Reimplemented from IlvSingleChartDisplayer.

§ boundingBoxOfPoints()

virtual void IlvPieChartDisplayer::boundingBoxOfPoints ( IlvChartDisplayerPoints displayerPoints,
IlvRect bbox,
IlBoolean  takeInfoIntoAccount = IlTrue,
const IlvTransformer t = 0 
) const
protectedvirtual

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

The method calls the IlvPieChartDisplayer::computeItem method for each screen point stored in displayerPoints to compute the item that will be displayed for the screen point. Then, the IlvPieChartDisplayer::boundingBoxOfItem is called for each item to compute the bounding box of each item. The returned bounding box corresponds to the bounding box of all the items displayed by the current displayer and of the defined point information objects (if any and if the Boolean takeInfoIntoAccount is equal to IlTrue).

Reimplemented from IlvSingleChartDisplayer.

§ computeItem()

virtual void IlvPieChartDisplayer::computeItem ( const IlvChartDisplayerPoints displayerPoints,
IlUInt  pointIndex,
IlUInt usedPointsCount,
IlvPoint points,
const IlvTransformer t = 0 
) const
protectedvirtual

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 data points that are displayed are those of the virtual data set that is constructed internally from the data set that is set on the current displayer. (See the Detailed Description for more details.) These data points are data points expressed in polar coordinates (theta, rho) that lie on the extremities of the arcs of the slices.

The item that will be displayed for a given screen point corresponding to one of these data points is a slice that is defined by three points: the two extremities of its arc (these points correspond to the points at the indexes pointIndex and pointIndex+1 in the displayerPoints object) and the point that lies at the pointed extremity of the slice.

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

Note
This method is called inside the drawPoints() method.

Implements IlvSingleChartDisplayer.

§ createSliceInfo()

virtual IlvPieSliceInfo* IlvPieChartDisplayer::createSliceInfo ( ) const
protectedvirtual

Creates and returns a new slice information object.

The slice information object created by default is an instance of the IlvPieSliceInfo class.

Note
This method is used internally and should not be used directly by the user. It is called to create a slice information object by default when one tries to set some information by the setSlicePalette(), setSliceGraphic(), tearOffSlice() or setSliceLegendText() methods on a slice that does not exist.

§ drawItem()

virtual void IlvPieChartDisplayer::drawItem ( const IlvChartDisplayerPoints displayerPoints,
IlUInt  pointIndex,
IlUInt  pointCount,
IlvPoint points,
IlvPalette itemPalette,
IlvPort dst,
const IlvTransformer t = 0,
const IlvRegion clip = 0 
) const
protectedvirtual

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 slice defined by the points stored in points. A polyline is drawn between these points with the foreground color of the palette used by the current displayer. An arc is drawn between the extremities of the polyline with the same color. The slice is filled with the foreground color of the palette itemPalette if the method IlvSingleChartDisplayer::isDrawingFill() returns IlTrue. (See the IlvPieChartDisplayer::computeItem() method for more details.) This method also draws all the slice information objects that are defined.

Note
This method is called inside the drawPoints() method.

Implements IlvSingleChartDisplayer.

§ drawLegendItem()

virtual void IlvPieChartDisplayer::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 filled rectangle on the boundaries of legendArea. The outline of the rectangle is drawn with the foreground color of the palette itemPal and the rectangle is filled with the foreground color of the palette defined for the slice with the index passed in the parameter clientData.

Parameters
dstThe port used for the drawing.
legendAreaThe area where the drawing is performed.
itemPalThe palette of the considered legend item associated with the current displayer.
clipThe optional clipping region.
clientDataThe client data defined for the considered legend item associated with the current displayer. This parameter contains the index of the slice for which the considered legend item is drawn.

Reimplemented from IlvSingleChartDisplayer.

§ drawPoints()

virtual void IlvPieChartDisplayer::drawPoints ( IlvChartDisplayerPoints displayerPoints,
IlvPort dst,
const IlvTransformer t = 0,
const IlvRegion clip = 0 
) const
protectedvirtual

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

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

The default implementation of this method uses the IlvPieChartDisplayer::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).

Note
The data points that are displayed are those of the virtual data set that is constructed internally from the data set that is set on the current displayer. (See the Detailed Description for more details.)

Reimplemented from IlvSingleChartDisplayer.

§ getClipArea()

virtual void IlvPieChartDisplayer::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 graph area obtained by the IlvChartGraphic::getGraphArea method.

Parameters
areaThe clipping region that is used to clip the graphical representation of data drawn by the current object.
tThe transformer that is applied to the returned clipping region.

Reimplemented from IlvSingleChartDisplayer.

§ getItemPointsCount()

virtual IlUInt IlvPieChartDisplayer::getItemPointsCount ( const IlvChartDisplayerPoints displayerPoints) const
protectedvirtual

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

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

Parameters
displayerPointsThe object that stores the points in screen coordinates to be displayed by the current displayer.
Returns
3.

Reimplemented from IlvSingleChartDisplayer.

§ getOffset()

const IlvDoublePoint& IlvPieChartDisplayer::getOffset ( ) const

Returns the offset between the added graphic objects and all the slices.

The offset is defined by an angle value expressed in degrees and a radial value expressed in pixels. The angle value is stored in the abscissa of the returned point and the radial value in the ordinate.

Returns
The offset between the added graphic objects and the slices displayed by the current displayer.

§ getPieDataSet()

IlvPieChartDataSet* IlvPieChartDisplayer::getPieDataSet ( ) const

Returns the virtual data set used by the current displayer.

Returns
A pointer to the virtual data set used by the current displayer. See the Detailed Description for more details.

§ getRadius()

IlDouble IlvPieChartDisplayer::getRadius ( ) const

Returns the radius of the pie.

Returns
The radius of the pie.
See also
setRadius.

§ getRange()

IlDouble IlvPieChartDisplayer::getRange ( ) const

Returns the range of the pie.

Returns
The angle range of the pie.
See also
setRange.

§ getSliceGeometry()

virtual IlBoolean IlvPieChartDisplayer::getSliceGeometry ( IlUInt  sliceIndex,
IlvRect sliceRect,
IlDouble startAngle,
IlDouble range,
const IlvTransformer t = 0 
) const
virtual

Returns the geometric parameters defining a given slice.

Parameters
sliceIndexThe index of the slice among the slices displayed by the current displayer.
sliceRectThe parameter used to return the rectangle used to display the slice.
startAngleThe parameter used to return the starting angle of the slice.
rangeThe parameter used to return the angle range of slice.
tThe transformer that is applied to the rectangle used to display the slice that is returned.

§ getSliceGraphic()

IlvGraphic* IlvPieChartDisplayer::getSliceGraphic ( IlUInt  sliceIndex) const

Returns the graphic object that is drawn along with a given slice.

Parameters
sliceIndexThe index of the slice among the slices displayed by the current displayer.
Returns
A pointer to the graphic object that is drawn along with the slice with the index sliceIndex.
Note
The graphic object that is drawn along with a slice is stored in the associated slice information object.

§ getSliceGraphicPosition()

virtual void IlvPieChartDisplayer::getSliceGraphicPosition ( IlUInt  sliceIndex,
const IlvRect sliceRect,
IlDouble  startAngle,
IlDouble  range,
IlvPoint position,
const IlvTransformer t = 0 
) const
virtual

Returns the position at which the added graphic object will be drawn for a given slice.

Parameters
sliceIndexThe index of the slice among the slices displayed by the current displayer.
sliceRectThe rectangle used to display the slice. This rectangle is considered to be already transformed by the transformer t.
startAngleThe starting angle of the slice.
rangeThe angle range of the slice.
positionThe parameter used to return the position at which the added graphic object will be drawn for the slice.
tThe transformer that will be applied to the returned position.

§ getSliceInfo()

IlvPieSliceInfo* IlvPieChartDisplayer::getSliceInfo ( IlUInt  sliceIndex) const

Returns the slice information object for a given slice.

Parameters
sliceIndexThe index of the slice with which the returned slice information is associated.
Returns
A pointer to the slice information associated with the slice with the index sliceIndex among the slices displayed by the current displayer.
Note
The returned slice information should not be deleted since it is maintained internally.

§ getSliceInfoCollection()

IlvPointInfoCollection* IlvPieChartDisplayer::getSliceInfoCollection ( ) const

Returns the object managing the slice information objects defined for the current displayer.

Returns
A pointer to the object that manages the slice information objects defined for the current displayer.
Note
The object that is created by default to manage the slice information object for the current displayer is an instance of the IlvPointInfoMap class.

§ getSliceInfoCount()

IlUInt IlvPieChartDisplayer::getSliceInfoCount ( ) const

Returns the number of slice information objects defined for the current displayer.

Returns
The number of slice information objects that are defined for the current displayer.

§ getSliceLegendText()

const char* IlvPieChartDisplayer::getSliceLegendText ( IlUInt  sliceIndex) const

Returns the text that will be used in a legend for a given slice.

Parameters
sliceIndexThe index of the slice among the slices displayed by the current displayer.
Returns
The text that will be used in a legend for the slice with the index sliceIndex.
Note
The legend text is stored in the associated slice information object.

§ getSlicePalette()

IlvPalette* IlvPieChartDisplayer::getSlicePalette ( IlUInt  sliceIndex) const

Returns the palette used to display a given slice.

Parameters
sliceIndexThe index of the slice among the slices displayed by the current displayer.
Returns
A pointer to the palette used to display the slice with the index sliceIndex.
Note
The palette is stored in the associated slice information.

§ getStartingAngle()

IlDouble IlvPieChartDisplayer::getStartingAngle ( ) const

Returns the angle at which the first slice is drawn.

Returns
The angle at which the first slice is drawn.
See also
setStartingAngle.

§ getTearOffDelta()

IlvDim IlvPieChartDisplayer::getTearOffDelta ( ) const

Returns the offset applied to torn-off slices.

Returns
The offset, in pixels, that is applied to torn-off slices.
See also
setTearOffDelta.

§ isContinuous()

virtual IlBoolean IlvPieChartDisplayer::isContinuous ( ) const
virtual

Indicates whether the graphical representation is continuous.

The graphical representation of data displayed by a displayer is said continuous if the graphical representation displayed for a given data point extends to and relies on another data point. So it is continuous if a given data point is not sufficient to display the graphical representation for this data point.

Returns
IlTrue by default, since the graphical representation displayed by the current displayer is made up of slices for which the angle depends on the other slices.

Reimplemented from IlvAbstractChartDisplayer.

§ isSliceTornOff()

IlBoolean IlvPieChartDisplayer::isSliceTornOff ( IlUInt  sliceIndex) const

Indicates whether a given slice is torn off.

Parameters
sliceIndexThe index of the slice among the slices displayed by the current displayer.
Returns
IlTrue if the slice with the index sliceIndex is torn off and IlFalse otherwise.
Note
The flag whether a slice is torn off is stored in the associated slice information object.

§ removeSliceInfo()

void IlvPieChartDisplayer::removeSliceInfo ( IlUInt  sliceIndex)

Removes the slice information defined for a given slice.

Parameters
sliceIndexThe index of the slice for which the slice information is removed.

§ selectDataPointsForPoint()

virtual IlvDoublePoint* IlvPieChartDisplayer::selectDataPointsForPoint ( IlUInt  dataPointIndex,
IlUInt count,
IlUInt *&  dataPointIndexes 
) const
protectedvirtual

Selects and returns the data points needed to display the graphical representation of the data points at a given index in the real data set(s) to be displayed by the current displayer.

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

The data points are selected in the virtual data set that is constructed internally from the data set that is set on the current displayer, since it is the data points of this virtual data set that are finally displayed. (See the Detailed Description for more details.)

For a pie displayer, the data points that are selected to be able to draw the slice for the data point at a given index in the real data set that is set on this displayer are: the data points at the index dataPointIndex and at the index dataPointIndex +1 in the virtual data set. These data points correspond to the extremities of the arc of the slice.

Reimplemented from IlvSingleChartDisplayer.

§ selectDataPointsForRange()

virtual IlvDoublePoint* IlvPieChartDisplayer::selectDataPointsForRange ( const IlvCoordInterval abscissaRange,
IlUInt pointCount,
IlUInt *&  dataPointIndexes,
const IlvTransformer t = 0,
const IlvRect clip = 0 
) const
protectedvirtual

Selects and returns the data points to display that are within a given abscissa interval.

Selects and returns the data points to display that are within the abscissa interval defined by abscissaRange. The indexes of the selected data points are returned in the array dataPointIndexes. The number of selected data points is returned in pointCount.

The current implementation of the method does not take the clipping region into account to select the data points. All the data points to display that are within abscissaRange will be selected.

Parameters
abscissaRangeThe abscissa interval used to select the data points.
pointCountThe number of selected data points.
dataPointIndexesAn array of the indexes of the selected data points.
tThe transformer (if any) that is used for drawing the data points by the current displayer.
clipThe clipping region (if any) that is used for drawing the data points by the current displayer.
Returns
An array of the selected data points.
Note
The allocated arrays of data points and data points indexes that are returned by this method must not be deleted since they are maintained internally.

Reimplemented from IlvSingleChartDisplayer.

§ setChartGraphic()

virtual void IlvPieChartDisplayer::setChartGraphic ( IlvChartGraphic chart)
virtual

Sets the chart graphic which uses the current displayer.

Parameters
chartThe chart graphic which uses the current displayer.
Note
This method is for internal use only and should not be used directly by the user. The chart graphic that uses the current displayer is automatically set when the displayer is added to this chart graphic. Therefore, the chart graphic does not need to be set by hand.

Reimplemented from IlvAbstractChartDisplayer.

§ setLegendItems()

virtual void IlvPieChartDisplayer::setLegendItems ( IlvChartLegend legend) const
virtual

Sets the legend items associated with the current displayer.

Sets the legend items associated with the current displayer on the legend legend.

The current implementation calls the IlvChartLegend::addLegendItem method for each slice that is drawn by the current displayer. The slice index is passed as client data in the called method.

See the IlvSingleChartDisplayer::setLegendItems method for more details.

Parameters
legendThe legend that will display the legend items associated with the current displayer.

Reimplemented from IlvSingleChartDisplayer.

§ setMode()

virtual void IlvPieChartDisplayer::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
modeThe new drawing mode for the current object.

Reimplemented from IlvSingleChartDisplayer.

§ setOffset() [1/2]

void IlvPieChartDisplayer::setOffset ( IlDouble  theta,
IlvPos  rho 
)

Sets the offset between the added graphic objects and all the slices.

The offset is defined by an angle value expressed in degrees and a radial value expressed in pixels.

Parameters
thetaThe new angle value defining the offset between the added graphic objects and all the slices. This value must be expressed in degrees.
rhoThe new radial value defining the offset between the added graphic objects and all the slices.

§ setOffset() [2/2]

void IlvPieChartDisplayer::setOffset ( const IlvDoublePoint offset)

Sets the offset between the added graphic objects and all the slices.

The offset is defined by an angle value expressed in degrees and a radial value expressed in pixels. The angle value should be stored in the abscissa of offset and the radial value in the ordinate.

Parameters
offsetThe new offset between the added graphic objects and all the slices.

§ setOverwrite()

virtual void IlvPieChartDisplayer::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
oThe new value of the Boolean indicating the way the drawing member functions operate.

Reimplemented from IlvSingleChartDisplayer.

§ setRadius()

void IlvPieChartDisplayer::setRadius ( IlDouble  radius)

Sets the radius of the pie.

The radius is expressed with respect to the ordinate range of the chart graphic. The value of the radius should be within this range if you want the whole pie to appear. Otherwise the pie may be not visible or it may be truncated.

Parameters
radiusThe new radius of the pie.

§ setRange()

void IlvPieChartDisplayer::setRange ( IlDouble  range)

Sets the angle range of the pie.

Parameters
rangeThe new angle range. The angle range must be expressed in degrees. This range corresponds to the sum of the angles of the slices. If range is equal to 360 degrees, the slices will cover a whole circle.

§ setSliceGraphic()

void IlvPieChartDisplayer::setSliceGraphic ( IlUInt  sliceIndex,
IlvGraphic graphic 
)

Sets the graphic object that is drawn along with a given slice.

Parameters
sliceIndexThe index of the slice among the slices displayed by the current displayer.
graphicThe new graphic object that will be drawn along with the slice with the index sliceIndex.
Note
The graphic object that is drawn in addition to a slice is stored in the associated slice information.

§ setSliceInfo()

void IlvPieChartDisplayer::setSliceInfo ( IlUInt  sliceIndex,
IlvPieSliceInfo sliceInfo 
)

Sets the slice information defined for a given slice.

Parameters
sliceIndexThe index of the slice for which the slice information is set.
sliceInfoThe new slice information.

§ setSliceLegendText()

virtual void IlvPieChartDisplayer::setSliceLegendText ( IlUInt  sliceIndex,
const char *  legendText 
)
virtual

Sets the text that will be used in a legend for a given slice.

Parameters
sliceIndexThe index of the slice among the slices displayed by the current displayer.
legendTextThe new text that will be used in a legend for the slice with the index sliceIndex.
Note
The legend text is stored in the associated slice information object.

§ setSlicePalette()

void IlvPieChartDisplayer::setSlicePalette ( IlUInt  sliceIndex,
IlvPalette palette 
)

Sets the palette used to display a given slice.

Parameters
sliceIndexThe index of the slice among the slices displayed by the current displayer.
paletteThe new palette that will be used to display the slice with the index sliceIndex.
Note
The palette is stored in the associated slice information object.

§ setStartingAngle()

void IlvPieChartDisplayer::setStartingAngle ( IlDouble  angle)

Sets the angle at which the first slice is drawn.

Parameters
angleThe new angle. This angle must be expressed in degrees.

§ setTearOffDelta()

void IlvPieChartDisplayer::setTearOffDelta ( IlvDim  delta)

Sets the offset applied to torn-off slices.

Parameters
deltaThe new offset applied to torn-off slices.

§ sliceBBox()

virtual IlBoolean IlvPieChartDisplayer::sliceBBox ( IlUInt  sliceIndex,
IlvRect bbox,
const IlvTransformer t = 0 
) const
virtual

Returns the bounding box of a given slice.

Parameters
sliceIndexThe index of the slice among the slices displayed by the current displayer.
bboxThe parameter used to return the bounding box of the slice.
tThe transformer that will be applied to the returned bounding box.

§ sliceContains()

virtual IlBoolean IlvPieChartDisplayer::sliceContains ( IlUInt  sliceIndex,
const IlvPoint viewPoint,
const IlvTransformer t = 0 
) const
virtual

Indicates whether a given slice contains a given screen point.

Parameters
sliceIndexThe index of the slice among the slices displayed by the current displayer.
viewPointThe screen point for which we want to know if it is contained in the slice.
tThe transformer that has been applied to viewPoint if any.
Returns
IlTrue if the considered slice contains the point viewPoint and IlFalse otherwise.

§ tearOffSlice()

void IlvPieChartDisplayer::tearOffSlice ( IlUInt  sliceIndex,
IlBoolean  flag = IlTrue 
)

Specifies whether a given slice is torn off.

Parameters
sliceIndexThe index of the slice among the slices displayed by the current displayer.
flagThe new value of the flag indicating whether the slice with the index sliceIndex is torn off.
Note
The flag indicating whether a slice is torn off is stored in the associated slice information object.

§ updateVirtualDataSets()

virtual void IlvPieChartDisplayer::updateVirtualDataSets ( )
protectedvirtual

Updates the virtual data set.

This method first removes the existing virtual data set and then constructs the new virtual data set of the IlvPieChartDataSet type used by the current displayer. This virtual data set is composed of only the real data set that has to be displayed by the current displayer.

Note
This method is used internally and should not be used directly by the user. It is called in the IlvAbstractChartDisplayer::update() method to update the virtual data sets when the real data sets have been modified.

Reimplemented from IlvAbstractChartDisplayer.

§ useVirtualDataSets()

virtual IlBoolean IlvPieChartDisplayer::useVirtualDataSets ( ) const
virtual

Indicates whether the current displayer uses virtual data sets.

Returns
Whether the current displayer uses virtual data sets. The default implementation returns IlTrue.

Reimplemented from IlvAbstractChartDisplayer.

§ whichSlice()

IlUInt IlvPieChartDisplayer::whichSlice ( const IlvPoint viewPoint,
const IlvTransformer t = 0 
) const

Returns the slice containing a given screen point.

Parameters
viewPointThe screen point contained in the slice to be retrieved.
tThe transformer that has been applied to viewPoint if any.
Returns
The index of the slice that contains the screen point viewPoint.

© Copyright 2018, 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.