Rogue Wave Views 5.6 |
Rogue Wave Views |
Rogue Wave Views Documentation Home |
Abstract base class for chart cursors. More...
#include <ilviews/charts/cursor.h>
Public Member Functions | |
virtual | ~IlvAbstractChartCursor () |
Destructor. | |
virtual void | axisMarkBBox (const IlvSingleScaleDisplayer *scale, const IlvPoint &cursorPoint, IlDouble cursorAngle, IlvRect &bbox) const |
Returns the bounding box of the axis mark. | |
virtual void | boundingBox (const IlvSingleScaleDisplayer *scale, const IlvPoint &cursorPoint, IlDouble cursorAngle, const IlvRect &scaleDataDisplayArea, IlvRect &bbox) const |
Returns the bounding box of the cursor. | |
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. | |
virtual void | draw (const IlvSingleScaleDisplayer *scale, const IlvPoint &cursorPoint, IlDouble cursorAngle, const IlvRect &scaleDataDisplayArea, IlvPort *dst, const IlvRegion *clip) const |
Draws the cursor. | |
virtual void | drawAxisMark (const IlvSingleScaleDisplayer *scale, const IlvPoint &cursorPoint, IlDouble cursorAngle, IlvPort *dst, const IlvRegion *clip) const |
Draws the axis mark. | |
void | drawAxisMark (IlBoolean draw) |
Specifies whether the cursor draws an axis mark. | |
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. | |
void | drawDelimiter (IlBoolean draw) |
Specifies whether the cursor draws a delimiter. | |
void | drawGhost (IlBoolean ghost) |
Specifies whether the delimiter is drawn is XOR mode. | |
IlvDrawOrder | getDrawOrder () const |
Returns the drawing order of the cursor. | |
const char * | getLabel () const |
Returns the label associated with the cursor. | |
const char * | getName () const |
Returns the name of the cursor. | |
IlvPalette * | getPalette () const |
Returns the palette used to draw the cursor. | |
IlDouble | getValue () const |
Returns the value associated with the cursor. | |
IlBoolean | isDrawingAxisMark () const |
Indicates whether the cursor draws an axis mark. | |
IlBoolean | isDrawingDelimiter () const |
Indicates whether the cursor draws a delimiter. | |
IlBoolean | isDrawingGhost () const |
Indicates whether the delimiter is drawn in XOR mode. | |
IlBoolean | isVisible () const |
Returns the visibility state of the cursor. | |
void | setDrawOrder (IlvDrawOrder drawOrder) |
Sets the drawing order of the cursor. | |
void | setLabel (const char *label) |
Sets the label of the cursor. | |
void | setName (const char *name) |
Sets the name of the cursor. | |
void | setPalette (IlvPalette *pal) |
Sets the palette used to draw the cursor. | |
void | setValue (IlDouble value) |
Sets the value of the cursor. | |
void | setVisible (IlBoolean visible) |
Sets the visibility state of the cursor. | |
Protected Member Functions | |
IlvAbstractChartCursor (IlvInputFile &file) | |
Constructor. | |
IlvAbstractChartCursor (const IlvAbstractChartCursor &cursor) | |
Constructor. | |
IlvAbstractChartCursor (IlDouble value, IlvPalette *palette=0) | |
Constructor. |
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.
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.
value | The cursor value. | |
palette | The palette used to draw the cursor. |
IlvAbstractChartCursor::IlvAbstractChartCursor | ( | const IlvAbstractChartCursor & | cursor | ) | [protected] |
Constructor.
Initializes a new IlvAbstractChartCursor
object as a copy of cursor.
cursor | The 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.
file | The file used to initialize the current cursor. |
virtual void IlvAbstractChartCursor::axisMarkBBox | ( | const IlvSingleScaleDisplayer * | scale, | |
const IlvPoint & | cursorPoint, | |||
IlDouble | cursorAngle, | |||
IlvRect & | bbox | |||
) | const [virtual] |
Returns the bounding box of the axis mark.
scale | The scale to which the cursor is attached. | |
cursorpoint | The point in view coordinates on the scale axis. | |
cursorAngle | The direction angle of the cursor from the scale axis. | |
bbox | The 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.
scale | The scale to which the cursor is attached. | |
cursorpoint | The point in view coordinates on the scale axis. | |
cursorAngle | The direction angle of the cursor from the scale axis. | |
scaleDataDisplayArea | The data display area of the corresponding scale. | |
bbox | The 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.
scale | The scale to which the cursor is attached. | |
cursorpoint | The point in view coordinates on the scale axis. | |
cursorAngle | The direction angle of the cursor from the scale axis. | |
scaleDataDisplayArea | The data display area of the corresponding scale. | |
bbox | The returned bounding box. |
Implemented in IlvRectangularChartCursor, IlvCircularChartCursor, and IlvRadialChartCursor.
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.
scale | The scale to which the cursor is attached. | |
cursorpoint | The point in view coordinates on the scale axis. | |
cursorAngle | The direction angle of the cursor from the scale axis. | |
scaleDataDisplayArea | The data display area of the corresponding scale. | |
dst | The drawing port. | |
clip | The drawing clip. |
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).
scale | The scale to which the cursor is attached. | |
cursorpoint | The point in view coordinates on the scale axis. | |
cursorAngle | The direction angle of the cursor from the scale axis. | |
dst | The drawing port. | |
clip | The drawing clip. |
void IlvAbstractChartCursor::drawAxisMark | ( | IlBoolean | draw | ) |
Specifies whether the cursor draws an axis mark.
draw | A Boolean value indicating whether the axis mark is drawn. |
isDrawingAxisMark
. 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).
scale | The scale to which the cursor is attached. | |
cursorpoint | The point in view coordinates on the scale axis. | |
cursorAngle | The direction angle of the cursor from the scale axis. | |
scaleDataDisplayArea | The data display area of the corresponding scale. | |
dst | The drawing port. | |
clip | The drawing clip. |
Implemented in IlvRectangularChartCursor, IlvCircularChartCursor, and IlvRadialChartCursor.
void IlvAbstractChartCursor::drawDelimiter | ( | IlBoolean | draw | ) |
Specifies whether the cursor draws a delimiter.
draw | A Boolean value indicating whether the delimiter is drawn. |
isDrawingDelimiter
. 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.
ghost | A Boolean value indicating whether the delimiter should be drawn in XOR mode. |
IlvChartGraphic::moveCursor
, isDrawingGhost
. IlvDrawOrder IlvAbstractChartCursor::getDrawOrder | ( | ) | const |
Returns the drawing order of the cursor.
IlvDrawBelow
if the cursor is drawn below the data and IlvDrawAbove
if it is drawn above. setDrawOrder
, IlvDrawOrder
. const char* IlvAbstractChartCursor::getLabel | ( | ) | const |
Returns the label associated with the cursor.
const char* IlvAbstractChartCursor::getName | ( | ) | const |
Returns the name of the cursor.
IlvPalette* IlvAbstractChartCursor::getPalette | ( | ) | const |
Returns the palette used to draw the cursor.
setPalette
. IlDouble IlvAbstractChartCursor::getValue | ( | ) | const |
Returns the value associated with the cursor.
IlBoolean IlvAbstractChartCursor::isDrawingAxisMark | ( | ) | const |
Indicates whether the cursor draws an axis mark.
IlTrue
if the cursor draws an axis mark and IlFalse
otherwise. drawAxisMark(IlBoolean)
. IlBoolean IlvAbstractChartCursor::isDrawingDelimiter | ( | ) | const |
Indicates whether the cursor draws a delimiter.
IlTrue
if the cursor draws a delimiter and IlFalse
otherwise. drawDelimiter(IlBoolean)
. IlBoolean IlvAbstractChartCursor::isDrawingGhost | ( | ) | const |
Indicates whether the delimiter is drawn in XOR mode.
IlTrue
if the delimiter is drawn in XOR mode and IlFalse
otherwise. drawGhost
. IlBoolean IlvAbstractChartCursor::isVisible | ( | ) | const |
Returns the visibility state of the cursor.
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.
drawOrder | The new drawing order. |
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.
label | The new label. The label passed as a parameter is copied. |
drawAxisMark
. void IlvAbstractChartCursor::setName | ( | const char * | name | ) |
Sets the name of the cursor.
name | The new name of the cursor. The name passed as a parameter is copied. |
void IlvAbstractChartCursor::setPalette | ( | IlvPalette * | pal | ) |
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.
palette | The 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.
value | The new value of the cursor. |
void IlvAbstractChartCursor::setVisible | ( | IlBoolean | visible | ) |
Sets the visibility state of the cursor.
visible | A Boolean indicating whether the cursor is visible (IlTrue ) or hidden (IlFalse ). |
© 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.