rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Charts Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IlvCircularGridDisplayer Class Reference

Grid displayer subclass for ordinate scales of polar charts. More...

#include <ilviews/charts/grid.h>

Inheritance diagram for IlvCircularGridDisplayer:
IlvAbstractGridDisplayer IlvRadarGridDisplayer

List of all members.

Public Member Functions

 IlvCircularGridDisplayer (IlvCircularScaleDisplayer *ref, IlvPalette *major=0, IlvPalette *minor=0)
 Constructor.
virtual ~IlvCircularGridDisplayer ()
 Destructor.
virtual
IlvRectangularGridDisplayer
createRectangularGrid () const
 Creates and returns a rectangular grid instantiated with the current grid parameters.
virtual void drawTick (IlUInt tickIdx, const IlvPoint &tickPoint, IlDouble tickAngle, IlBoolean major, IlvPort *dst, const IlvRegion *givenClip) const
 Draws the grid line for a given tick of the scale with which the grid is associated.
const IlvCircularScaleDisplayergetReferenceScale () const
 Returns the reference scale.
void setReferenceScale (const IlvCircularScaleDisplayer *scale)
 Sets the reference scale.

Detailed Description

Grid displayer subclass for ordinate scales of polar charts.

Library: ilvcharts

This class is a subclass of IlvAbstractGridDisplayer that allows you to define a circular grid composed of circular lines. This kind of grid is used only for polar charts. A polar chart displays data expressed in polar coordinates with an abscissa scale that is circular and ordinate scales that are radial. In a polar chart, the circular grid is used to draw the grid lines for the ticks of the radial scales, which means that it is used for the ordinate scales. If you want to set a grid on the abscissa scale of a polar chart, you must use a radial grid, which is represented by an instance of the IlvRadialGridDisplayer class.

In a polar chart, the abscissa scale is drawn by using an instance of the IlvCircularScaleDisplayer class and the ordinate scales are drawn by using instances of the IlvRectangularScaleDisplayer class. Therefore, a circular grid can only be used with an IlvRectangularScaleDisplayer object and when the projector used to project the data is an IlvPolarProjector object.

The IlvCircularGridDisplayer class stores a pointer to the abscissa scale in addition to the pointer to the ordinate scale with which it is associated. The pointer to the abscissa scale, called reference scale, is needed to know where the grid lines stop: the grid lines are drawn by using the same range as the abscissa scale that is circular.

You can see an example of a circular grid on the figure below where a grid is set for the ordinate scale of the displayed chart. You can notice that the grid lines are drawn by using the same range as the circular abscissa scale.

img_circular_grid.gif
See also:
IlvAbstractGridDisplayer, IlvCircularScaleDisplayer, IlvRadialGridDisplayer.

Constructor & Destructor Documentation

IlvCircularGridDisplayer::IlvCircularGridDisplayer ( IlvCircularScaleDisplayer ref,
IlvPalette major = 0,
IlvPalette minor = 0 
)

Constructor.

Initializes a new IlvCircularGridDisplayer object. By default, the scale with which the current grid is associated is set to 0. The Boolean indicating that the grid is visible is set to IlTrue. The Boolean indicating that the minor lines are drawn is set to IlFalse, meaning that by default only the major lines will be drawn. The drawing order is set to IlvDrawAbove, specifying that the grid is drawn above the graphic representations of data in the chart.

Parameters:
ref The circular scale used as the reference scale to bound the grid lines.
major The new palette that will be used to draw the major lines of the current grid.
minor The new palette that will be used to draw the minor lines of the current grid.
virtual IlvCircularGridDisplayer::~IlvCircularGridDisplayer (  )  [virtual]

Destructor.

This destructor sets the pointer to the reference scale to 0.


Member Function Documentation

virtual IlvRectangularGridDisplayer* IlvCircularGridDisplayer::createRectangularGrid (  )  const [virtual]

Creates and returns a rectangular grid instantiated with the current grid parameters.

Returns:
The rectangular grid that is created.
virtual void IlvCircularGridDisplayer::drawTick ( IlUInt  tickIdx,
const IlvPoint tickPoint,
IlDouble  tickAngle,
IlBoolean  major,
IlvPort dst,
const IlvRegion clip 
) const [virtual]

Draws the grid line for a given tick of the scale with which the grid is associated.

Draws the grid line for the scale tick of index tickIdx, defined by the point tickPoint, which is its position in pixels, and by its angle tickAngle.

The grid line is drawn in the given port named dst using the clipping region clip.

Parameters:
tickIdx The index of the tick on the scale to which the grid is attached.
tickPoint The position in pixels of the scale tick for which the grid line is drawn. This point is already transformed.
tickAngle The angle of the scale tick for which the grid line is drawn.
major A Boolean value indicating whether the tick is a major step or a substep.
dst The port where the grid line is drawn.
clip The clipping region.
Warning:
[note] This method is called inside the IlvSingleScaleDisplayer::drawTick method. Therefore, the grid line is drawn when the scale tick is drawn.
[note] The data display area is automatically set by the scale with the IlvAbstractGridDisplayer::setDataDisplayArea method before the grid lines are drawn. This area can therefore be fetched with the IlvAbstractGridDisplayer::getDataDisplayArea method.

Implements IlvAbstractGridDisplayer.

Reimplemented in IlvRadarGridDisplayer.

const IlvCircularScaleDisplayer* IlvCircularGridDisplayer::getReferenceScale (  )  const

Returns the reference scale.

The reference scale is a circular scale that determines the boundaries for the grid lines while drawing: the grid lines are drawn by using the same range as this scale.

Returns:
A pointer to the reference scale defined for the current grid.
void IlvCircularGridDisplayer::setReferenceScale ( const IlvCircularScaleDisplayer scale  ) 

Sets the reference scale.

The reference scale is a circular scale that determines the boundaries for the grid lines while drawing: the grid lines are drawn by using the same range as this scale.

Parameters:
scale The new scale used as the reference scale by the current grid.
 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.