rwlogo

Rogue Wave Views
Charts Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
List of all members | Public Member Functions | Protected Member Functions
IlvAbstractChartCursor Class Referenceabstract

Abstract base class for chart cursors. More...

#include <ilviews/charts/cursor.h>

Inheritance diagram for IlvAbstractChartCursor:
IlvCircularChartCursor IlvRadialChartCursor IlvRectangularChartCursor

Public Member Functions

virtual ~IlvAbstractChartCursor ()
 Destructor. More...
 
virtual void axisMarkBBox (const IlvSingleScaleDisplayer *scale, const IlvPoint &cursorPoint, IlDouble cursorAngle, IlvRect &bbox) const
 Returns the bounding box of the axis mark. More...
 
virtual void boundingBox (const IlvSingleScaleDisplayer *scale, const IlvPoint &cursorPoint, IlDouble cursorAngle, const IlvRect &scaleDataDisplayArea, IlvRect &bbox) const
 Returns the bounding box of the cursor. More...
 
virtual void delimiterBBox (const IlvSingleScaleDisplayer *scale, const IlvPoint &cursorPoint, IlDouble cursorAngle, const IlvRect &scaleDataDisplayArea, IlvRect &bbox) const =0
 Returns the bounding box of the delimiter. More...
 
virtual void draw (const IlvSingleScaleDisplayer *scale, const IlvPoint &cursorPoint, IlDouble cursorAngle, const IlvRect &scaleDataDisplayArea, IlvPort *dst, const IlvRegion *clip) const
 Draws the cursor. More...
 
void drawAxisMark (IlBoolean draw)
 Specifies whether the cursor draws an axis mark. More...
 
virtual void drawAxisMark (const IlvSingleScaleDisplayer *scale, const IlvPoint &cursorPoint, IlDouble cursorAngle, IlvPort *dst, const IlvRegion *clip) const
 Draws the axis mark. More...
 
void drawDelimiter (IlBoolean draw)
 Specifies whether the cursor draws a delimiter. More...
 
virtual void drawDelimiter (const IlvSingleScaleDisplayer *scale, const IlvPoint &cursorPoint, IlDouble cursorAngle, const IlvRect &scaleDataDisplayArea, IlvPort *dst, const IlvRegion *clip) const =0
 Draws the cursor delimiter. More...
 
void drawGhost (IlBoolean ghost)
 Specifies whether the delimiter is drawn is XOR mode. More...
 
IlvDrawOrder getDrawOrder () const
 Returns the drawing order of the cursor. More...
 
const char * getLabel () const
 Returns the label associated with the cursor. More...
 
const char * getName () const
 Returns the name of the cursor. More...
 
IlvPalettegetPalette () const
 Returns the palette used to draw the cursor. More...
 
IlDouble getValue () const
 Returns the value associated with the cursor. More...
 
IlBoolean isDrawingAxisMark () const
 Indicates whether the cursor draws an axis mark. More...
 
IlBoolean isDrawingDelimiter () const
 Indicates whether the cursor draws a delimiter. More...
 
IlBoolean isDrawingGhost () const
 Indicates whether the delimiter is drawn in XOR mode. More...
 
IlBoolean isVisible () const
 Returns the visibility state of the cursor. More...
 
void setDrawOrder (IlvDrawOrder drawOrder)
 Sets the drawing order of the cursor. More...
 
void setLabel (const char *label)
 Sets the label of the cursor. More...
 
void setName (const char *name)
 Sets the name of the cursor. More...
 
void setPalette (IlvPalette *palette)
 Sets the palette used to draw the cursor. More...
 
void setValue (IlDouble value)
 Sets the value of the cursor. More...
 
void setVisible (IlBoolean visible)
 Sets the visibility state of the cursor. More...
 

Protected Member Functions

 IlvAbstractChartCursor (IlDouble value, IlvPalette *palette=0)
 Constructor. More...
 
 IlvAbstractChartCursor (const IlvAbstractChartCursor &cursor)
 Constructor. More...
 
 IlvAbstractChartCursor (IlvInputFile &file)
 Constructor. More...
 

Detailed Description

Abstract base class for chart cursors.

Library: ilvcharts

A chart cursor is a graphical indicator of a data value. The chart cursor is associated with a given scale and indicates the value of a data item on this scale. It is composed of two distinct items:

The axis mark indicates the data value on the scale. The axis mark displays the defined cursor label if it exists (see the IlvAbstractChartCursor::setLabel method) or the data value.

In order to speed up the drawing process when the cursor is used as a dynamic mark (for example, a crosshair), you can specify that the delimiter is to be drawn in XOR mode by using the IlvAbstractChartCursor::drawGhost method.

See Also
IlvCircularChartCursor, IlvRadialChartCursor, IlvRectangularChartCursor.

Constructor & Destructor Documentation

virtual IlvAbstractChartCursor::~IlvAbstractChartCursor ( )
virtual

Destructor.

The destructor unlocks the drawing palette if it was defined.

IlvAbstractChartCursor::IlvAbstractChartCursor ( IlDouble  value,
IlvPalette palette = 0 
)
protected

Constructor.

Initializes a new IlvAbstractChartCursor object.

Parameters
valueThe cursor value.
paletteThe palette used to draw the cursor.
IlvAbstractChartCursor::IlvAbstractChartCursor ( const IlvAbstractChartCursor cursor)
protected

Constructor.

Initializes a new IlvAbstractChartCursor object as a copy of cursor.

Parameters
cursorThe object used to initialize the current one.
IlvAbstractChartCursor::IlvAbstractChartCursor ( IlvInputFile file)
protected

Constructor.

Initializes a new IlvAbstractChartCursor object from the description read in the input file named file.

Parameters
fileThe file used to initialize the current cursor.

Member Function Documentation

virtual void IlvAbstractChartCursor::axisMarkBBox ( const IlvSingleScaleDisplayer scale,
const IlvPoint cursorPoint,
IlDouble  cursorAngle,
IlvRect bbox 
) const
virtual

Returns the bounding box of the axis mark.

Parameters
scaleThe scale to which the cursor is attached.
cursorPointThe point in view coordinates on the scale axis.
cursorAngleThe direction angle of the cursor from the scale axis.
bboxThe returned bounding box.
virtual void IlvAbstractChartCursor::boundingBox ( const IlvSingleScaleDisplayer scale,
const IlvPoint cursorPoint,
IlDouble  cursorAngle,
const IlvRect scaleDataDisplayArea,
IlvRect bbox 
) const
virtual

Returns the bounding box of the cursor.

This method returns the bounding rectangle containing both the delimiter and the axis mark. If the delimiter is drawn in ghost mode (see IlvAbstractChartCursor::isDrawingGhost), the delimiter is not taken into account. Also, the visibility of the two items is considered for the computation.

Parameters
scaleThe scale to which the cursor is attached.
cursorPointThe point in view coordinates on the scale axis.
cursorAngleThe direction angle of the cursor from the scale axis.
scaleDataDisplayAreaThe data display area of the corresponding scale.
bboxThe returned bounding box.
virtual void IlvAbstractChartCursor::delimiterBBox ( const IlvSingleScaleDisplayer scale,
const IlvPoint cursorPoint,
IlDouble  cursorAngle,
const IlvRect scaleDataDisplayArea,
IlvRect bbox 
) const
pure virtual

Returns the bounding box of the delimiter.

This method must be defined in subclasses.

Parameters
scaleThe scale to which the cursor is attached.
cursorPointThe point in view coordinates on the scale axis.
cursorAngleThe direction angle of the cursor from the scale axis.
scaleDataDisplayAreaThe data display area of the corresponding scale.
bboxThe returned bounding box.

Implemented in IlvRadialChartCursor, IlvCircularChartCursor, and IlvRectangularChartCursor.

virtual void IlvAbstractChartCursor::draw ( const IlvSingleScaleDisplayer scale,
const IlvPoint cursorPoint,
IlDouble  cursorAngle,
const IlvRect scaleDataDisplayArea,
IlvPort dst,
const IlvRegion clip 
) const
virtual

Draws the cursor.

This method draws the cursor. To do this, it checks whether the delimiter and the axis mark should be drawn, and calls the IlvAbstractChartCursor::drawDelimiter and IlvAbstractChartCursor::drawAxisMark methods accordingly.

Parameters
scaleThe scale to which the cursor is attached.
cursorPointThe point in view coordinates on the scale axis.
cursorAngleThe direction angle of the cursor from the scale axis.
scaleDataDisplayAreaThe data display area of the corresponding scale.
dstThe drawing port.
clipThe drawing clip.
void IlvAbstractChartCursor::drawAxisMark ( IlBoolean  draw)

Specifies whether the cursor draws an axis mark.

Parameters
drawA Boolean value indicating whether the axis mark is drawn.
See Also
isDrawingAxisMark.
virtual void IlvAbstractChartCursor::drawAxisMark ( const IlvSingleScaleDisplayer scale,
const IlvPoint cursorPoint,
IlDouble  cursorAngle,
IlvPort dst,
const IlvRegion clip 
) const
virtual

Draws the axis mark.

The default implementation of this method draws an image string containing the cursor label if it is defined (see the IlvAbstractChartCursor::getLabel method) or the cursor value (see the IlvAbstractChartCursor::getValue method) with the format defined for the scale (see the IlvAbstractScaleDisplayer::setStepLabelFormat method).

Parameters
scaleThe scale to which the cursor is attached.
cursorPointThe point in view coordinates on the scale axis.
cursorAngleThe direction angle of the cursor from the scale axis.
dstThe drawing port.
clipThe drawing clip.
void IlvAbstractChartCursor::drawDelimiter ( IlBoolean  draw)

Specifies whether the cursor draws a delimiter.

Parameters
drawA Boolean value indicating whether the delimiter is drawn.
See Also
isDrawingDelimiter.
virtual void IlvAbstractChartCursor::drawDelimiter ( const IlvSingleScaleDisplayer scale,
const IlvPoint cursorPoint,
IlDouble  cursorAngle,
const IlvRect scaleDataDisplayArea,
IlvPort dst,
const IlvRegion clip 
) const
pure virtual

Draws the cursor delimiter.

This method must be defined in subclasses. The defined method should take into account the ghost drawing property of the delimiter (see the IlvAbstractChartCursor::isDrawingGhost method).

Parameters
scaleThe scale to which the cursor is attached.
cursorPointThe point in view coordinates on the scale axis.
cursorAngleThe direction angle of the cursor from the scale axis.
scaleDataDisplayAreaThe data display area of the corresponding scale.
dstThe drawing port.
clipThe drawing clip.

Implemented in IlvRadialChartCursor, IlvCircularChartCursor, and IlvRectangularChartCursor.

void IlvAbstractChartCursor::drawGhost ( IlBoolean  ghost)

Specifies whether the delimiter is drawn is XOR mode.

This method lets you specify that the delimiter must be drawn in XOR mode when ghost is equal to IlTrue. This is useful when the cursor value is updated frequently since it enables you to avoid expensive redraw operations.

Parameters
ghostA Boolean value indicating whether the delimiter should be drawn in XOR mode.
See Also
IlvChartGraphic::moveCursor, isDrawingGhost.
IlvDrawOrder IlvAbstractChartCursor::getDrawOrder ( ) const

Returns the drawing order of the cursor.

Returns
IlvDrawBelow if the cursor is drawn below the data and IlvDrawAbove if it is drawn above.
See Also
setDrawOrder, IlvDrawOrder.
const char* IlvAbstractChartCursor::getLabel ( ) const

Returns the label associated with the cursor.

Returns
The label associated with the cursor.
const char* IlvAbstractChartCursor::getName ( ) const

Returns the name of the cursor.

Returns
The name of the cursor.
IlvPalette* IlvAbstractChartCursor::getPalette ( ) const

Returns the palette used to draw the cursor.

Returns
The palette used to draw the cursor.
See Also
setPalette.
IlDouble IlvAbstractChartCursor::getValue ( ) const

Returns the value associated with the cursor.

Returns
The value associated with the cursor.
IlBoolean IlvAbstractChartCursor::isDrawingAxisMark ( ) const

Indicates whether the cursor draws an axis mark.

Returns
IlTrue if the cursor draws an axis mark and IlFalse otherwise.
See Also
drawAxisMark(IlBoolean).
IlBoolean IlvAbstractChartCursor::isDrawingDelimiter ( ) const

Indicates whether the cursor draws a delimiter.

Returns
IlTrue if the cursor draws a delimiter and IlFalse otherwise.
See Also
drawDelimiter(IlBoolean).
IlBoolean IlvAbstractChartCursor::isDrawingGhost ( ) const

Indicates whether the delimiter is drawn in XOR mode.

Returns
IlTrue if the delimiter is drawn in XOR mode and IlFalse otherwise.
See Also
drawGhost.
IlBoolean IlvAbstractChartCursor::isVisible ( ) const

Returns the visibility state of the cursor.

Returns
IlTrue if the cursor is visible and IlFalse otherwise.
void IlvAbstractChartCursor::setDrawOrder ( IlvDrawOrder  drawOrder)

Sets the drawing order of the cursor.

The drawing order determines whether the cursor is drawn above or below the displayed data.

Parameters
drawOrderThe new drawing order.
See Also
IlvDrawOrder.
void IlvAbstractChartCursor::setLabel ( const char *  label)

Sets the label of the cursor.

The label will be drawn on the axis if it is defined. Otherwise, the value associated with the cursor will be drawn.

Parameters
labelThe new label. The label passed as a parameter is copied.
See Also
drawAxisMark.
void IlvAbstractChartCursor::setName ( const char *  name)

Sets the name of the cursor.

Parameters
nameThe new name of the cursor. The name passed as a parameter is copied.
void IlvAbstractChartCursor::setPalette ( IlvPalette palette)

Sets the palette used to draw the cursor.

The new palette is locked. If the palette is 0, the cursor will use the axis palette of the scale to draw itself.

Parameters
paletteThe new palette used to draw the cursor.
void IlvAbstractChartCursor::setValue ( IlDouble  value)

Sets the value of the cursor.

This value is used to compute the position of the cursor on the scale.

Parameters
valueThe new value of the cursor.
void IlvAbstractChartCursor::setVisible ( IlBoolean  visible)

Sets the visibility state of the cursor.

Parameters
visibleA Boolean indicating whether the cursor is visible (IlTrue) or hidden (IlFalse).

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