Rogue Wave Views 5.5.1 |
Rogue Wave Views |
Rogue Wave Views Documentation Home |
Base class for scales. More...
#include <ilviews/charts/scaledis.h>
Public Types | |
enum | LabelLayout { LabelInside, LabelOutside } |
This enumeration type defines the label layout on the scale axis. More... | |
enum | TickLayout { TickInside, TickOutside, TickCross } |
This enumeration type defines the tick layout on the scale axis. More... | |
Public Member Functions | |
virtual | ~IlvAbstractScaleDisplayer () |
Destructor. | |
virtual IlvAbstractScaleDisplayer * | copy () const =0 |
Virtual copy constructor. | |
virtual void | drawLabelOnCrossings (IlBoolean b)=0 |
Indicates whether the labels should be drawn where the axes intersect. | |
virtual void | drawOverlappingLabels (IlBoolean b)=0 |
Sets whether overlapping labels are allowed. | |
virtual IlvCoordinateInfo * | getCoordinateInfo (IlUInt index=0) const =0 |
Deprecated Returns the coordinate information associated with the scale. | |
virtual IlvCoordinateType | getCoordinateType () const =0 |
Returns the type of the coordinate represented by the current scale. | |
IlBoolean | getCrossingValue (IlDouble &dataValue) const |
Returns the data value to which the scale is actually fixed. | |
IlvDrawOrder | getDrawOrder () const |
Returns the drawing order for the current scale. | |
IlvCoordinateInfo * | getInfoForCrossingValue () const |
Returns the coordinate information used to position the scale. | |
const char * | getName () const |
Returns the name of the scale. | |
IlBoolean | getRelativePosition (IlvAxisPosition &relPos, IlvPos &offset) const |
Returns the relative position to which the scale is fixed. | |
IlDouble | getStoredCrossingValue () const |
Returns the stored value to which the scale is fixed. | |
IlBoolean | isAlwaysVisible () const |
Indicates whether the current scale must always appear on the screen. | |
IlBoolean | isFixedToPosition () const |
Indicates whether the scale is fixed to a position. | |
IlBoolean | isInVisibleDataArea () const |
Indicates whether the scale is in the visible data area. | |
virtual IlBoolean | isOnAbscissa () const =0 |
Indicates whether the scale is connected to the abscissa coordinate system. | |
virtual IlBoolean | isOnOrdinate () const =0 |
Indicates whether the scale is connected to an ordinate coordinate system. | |
IlBoolean | isVisible () const |
Indicates whether the scale is visible. | |
IlvOutputFile & | save (IlvOutputFile &file) const |
Writes a complete description of the current object in a file. | |
virtual void | setAlwaysVisible (IlBoolean b) |
Specifies whether the current scale must always appear on the screen. | |
virtual void | setArrowLength (IlvDim length)=0 |
Sets the arrow length. | |
virtual void | setArrowWidth (IlvDim width)=0 |
Sets the arrow width. | |
virtual void | setAxisLabelOffset (IlvDim offset)=0 |
Sets the offset between the scale axis and its label. | |
virtual void | setAxisLabelPalette (IlvPalette *pal)=0 |
Sets the palette used to draw the axis label. | |
virtual void | setAxisOriented (IlBoolean oriented)=0 |
Indicates whether the scale should be oriented. | |
virtual void | setAxisPalette (IlvPalette *pal)=0 |
Sets the palette used to draw the axis. | |
virtual IlBoolean | setCrossingValue (IlDouble dataValue, const IlvSingleScaleDisplayer *refScale) |
Sets the data value to which this scale is fixed. | |
virtual void | setDrawOrder (IlvDrawOrder drawOrder) |
Sets the drawing order for the current scale. | |
virtual void | setGridDrawOrder (IlvDrawOrder drawOrder)=0 |
Sets the drawing order for the associated grid. | |
virtual void | setLabelLayout (LabelLayout layout)=0 |
Sets the label layout on the scale axis. | |
virtual void | setLabelZoomFactor (IlDouble scale)=0 |
Sets the label scale factor. | |
virtual void | setMajorTickSize (IlvDim size)=0 |
Sets the size of the major ticks. | |
virtual void | setMinorTickSize (IlvDim val)=0 |
Sets the size of the minor ticks. | |
void | setName (const char *name) |
Sets the name of the scale. | |
virtual void | setOffset (IlvDim dim)=0 |
Sets the offset between the ticks and the step labels. | |
virtual void | setRelativePosition (IlvAxisPosition relPos, IlvPos offset=0) |
Sets the position to which this scale is fixed. | |
virtual void | setStepLabel (IlUInt labelIndex, const char *label)=0 |
Sets the label for a given step by hand. | |
virtual void | setStepLabelAngle (IlDouble angle)=0 |
Sets the angle of the step labels. | |
virtual void | setStepLabelFormat (const char *format, IlBoolean invalidate=IlTrue)=0 |
Sets the format used to translate data values into step labels. | |
virtual void | setStepLabels (IlUInt count, const char *const *labels=0)=0 |
Sets the step labels by hand. | |
virtual void | setStepLabelsPalette (IlvPalette *pal)=0 |
Sets the palette used to draw the step labels. | |
virtual void | setTickLayout (TickLayout layout)=0 |
Sets the tick layout on the scale axis. | |
virtual void | setValueToLabelCB (IlvValueToLabelCB cb, IlAny cbData=0)=0 |
Sets a conversion callback between data values and step labels. | |
void | setVisible (IlBoolean visible) |
Sets the visibility of the scale. | |
virtual void | write (IlvOutputFile &file) const |
Writes the attributes of the current object in a file. | |
Static Public Member Functions | |
static IlvAbstractScaleDisplayer * | Load (IlvInputFile &file) |
Reads a scale object from a file. | |
Protected Member Functions | |
IlvAbstractScaleDisplayer (IlvInputFile &file) | |
Constructor. | |
IlvAbstractScaleDisplayer (const IlvAbstractScaleDisplayer &scaleDisplayer) | |
Constructor. | |
IlvAbstractScaleDisplayer () | |
Constructor. | |
Friends | |
class | IlvAbscissaAxisElement |
class | IlvAxisElement |
Base class for scales.
Library: ilvcharts
IlvAbstractScaleDisplayer
is an abstract base class that allows you to display a scale. It provides an API for customizing the general scale layout and its appearance.
This class consists mostly of pure virtual methods. In single-scale subclasses, these methods are implemented to handle the various requests for scales representing a single coordinate.
IlvSingleScaleDisplayer
. This enumeration type defines the tick layout on the scale axis.
Ticks along the scales can have several aspects. This type indicates which aspect you want to use.
virtual IlvAbstractScaleDisplayer::~IlvAbstractScaleDisplayer | ( | ) | [virtual] |
Destructor.
If the scale is fixed to the value of another coordinate, the associated coordinate information is unlocked.
IlvAbstractScaleDisplayer::IlvAbstractScaleDisplayer | ( | ) | [protected] |
Constructor.
Initializes a new IlvAbstractScaleDisplayer
object. By default, the created scale is visible and fixed relatively to the position where the minimum data is displayed, with a relative offset equal to 0
. The Boolean value indicating whether the scale must be always visible is set to IlFalse
(see the IlvAbstractScaleDisplayer::setAlwaysVisible
method) and the drawing order is set to IlvDrawAbove
(see the IlvAbstractScaleDisplayer::setDrawOrder
method).
IlvAbstractScaleDisplayer::IlvAbstractScaleDisplayer | ( | const IlvAbstractScaleDisplayer & | scaleDisplayer | ) | [protected] |
Constructor.
Initializes a new IlvAbstractScaleDisplayer
object as a copy of scaleDisplayer.
scaleDisplayer | The object used to initialize the current one. |
IlvAbstractScaleDisplayer::IlvAbstractScaleDisplayer | ( | IlvInputFile & | file | ) | [protected] |
Constructor.
Initializes a new IlvAbstractScaleDisplayer
object from the description read in the input file named file.
file | The file used to initialize the current scale displayer. |
virtual IlvAbstractScaleDisplayer* IlvAbstractScaleDisplayer::copy | ( | ) | const [pure 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 DeclareScaleDisplayerTypeInfo
macro. The IlvPredefinedScaleDisplayerIOMembers
macro lets you define a default implementation, which returns an instance initialized with the copy constructor.
Implemented in IlvRectangularScaleDisplayer, and IlvCircularScaleDisplayer.
virtual void IlvAbstractScaleDisplayer::drawLabelOnCrossings | ( | IlBoolean | b | ) | [pure virtual] |
Indicates whether the labels should be drawn where the axes intersect.
b | The new value of the Boolean indicating whether the labels should be drawn where the axes intersect. This Boolean is equal to IlTrue if the labels should be drawn where the axes intersect and IlFalse otherwise. |
Implemented in IlvSingleScaleDisplayer.
virtual void IlvAbstractScaleDisplayer::drawOverlappingLabels | ( | IlBoolean | b | ) | [pure virtual] |
Sets whether overlapping labels are allowed.
If labels are not allowed to overlap (b is equal to IlFalse
), the IlvSingleScaleDisplayer::getNumberOfSkippedSteps
method will be called to compute the number of steps to skip when drawing the labels.
b | The new value of the Boolean indicating whether the labels can be overlapped. This Boolean is equal to IlTrue if overlapping labels are allowed and IlFalse otherwise. |
Implemented in IlvSingleScaleDisplayer.
virtual IlvCoordinateInfo* IlvAbstractScaleDisplayer::getCoordinateInfo | ( | IlUInt | index = 0 |
) | const [pure virtual] |
Deprecated Returns the coordinate information associated with the scale.
index | The index of the returned coordinate information object among the coordinate information objects associated with the scale. |
0
by default since only one coordinate information object is associated with a scale by default. Implemented in IlvSingleScaleDisplayer.
virtual IlvCoordinateType IlvAbstractScaleDisplayer::getCoordinateType | ( | ) | const [pure virtual] |
Returns the type of the coordinate represented by the current scale.
IlvAbscissaCoordinate
if the coordinate represented by the current scale is the abscissa coordinate and IlvOrdinateCoordinate
if the coordinate represented by the current scale is an ordinate coordinate. Implemented in IlvSingleScaleDisplayer.
Returns the data value to which the scale is actually fixed.
The returned value can be different from the one specified by the IlvAbstractScaleDisplayer::setCrossingValue
method, as it takes into account the actual coordinate range of the other scale.
To retrieve the specified crossing value, use the IlvAbstractScaleDisplayer::getStoredCrossingValue
method.
dataValue | The data value to which the scale is actually fixed. |
IlTrue
if the scale is fixed to a data value and IlFalse
otherwise.IlvAbstractScaleDisplayer::isFixedToPosition
method). IlvDrawOrder IlvAbstractScaleDisplayer::getDrawOrder | ( | ) | const |
Returns the drawing order for the current scale.
The drawing order enables the scale to be drawn either above (IlvDrawAbove
) or below (IlvDrawBelow
) other graphical representations.
IlvCoordinateInfo* IlvAbstractScaleDisplayer::getInfoForCrossingValue | ( | ) | const |
Returns the coordinate information used to position the scale.
const char* IlvAbstractScaleDisplayer::getName | ( | ) | const |
Returns the name of the scale.
IlBoolean IlvAbstractScaleDisplayer::getRelativePosition | ( | IlvAxisPosition & | relPos, | |
IlvPos & | offset | |||
) | const |
Returns the relative position to which the scale is fixed.
relPos | The parameter used to return the position relative to which the scale is fixed. | |
offset | The parameter used to return the offset from the position relPos to which the scale is fixed. |
IlTrue
if the scale is fixed to a position and IlFalse
otherwise. isFixedToPosition
.IlvAbstractScaleDisplayer::isFixedToPosition
method). IlDouble IlvAbstractScaleDisplayer::getStoredCrossingValue | ( | ) | const |
Returns the stored value to which the scale is fixed.
This value is the one that has been set with the IlvAbstractScaleDisplayer::setCrossingValue
method.
getCrossingValue
.IlvAbstractScaleDisplayer::isFixedToPosition
method). IlBoolean IlvAbstractScaleDisplayer::isAlwaysVisible | ( | ) | const |
Indicates whether the current scale must always appear on the screen.
IlTrue
if the current scale must always appear on the screen and IlFalse
otherwise. If this method returns IlTrue
and if the current scale is fixed to a data value that does not belong to the range of visible data, this range will be modified so that the scale can appear on the screen. IlBoolean IlvAbstractScaleDisplayer::isFixedToPosition | ( | ) | const |
Indicates whether the scale is fixed to a position.
A scale can be either fixed to a position (see the IlvAbstractScaleDisplayer::setRelativePosition
method) or to a value from another scale (see the IlvAbstractScaleDisplayer::setCrossingValue
method).
IlTrue
if the scale is fixed to a position and IlFalse
if it is fixed to a data value. IlBoolean IlvAbstractScaleDisplayer::isInVisibleDataArea | ( | ) | const |
Indicates whether the scale is in the visible data area.
If the current scale is fixed to the data value of another scale, this method indicates whether this value belongs to the range of visible data. If this is not the case, the current scale does not appear and the method returns IlFalse
.
IlTrue
if the scale appears in the visible data area and IlFalse
otherwise. virtual IlBoolean IlvAbstractScaleDisplayer::isOnAbscissa | ( | ) | const [pure virtual] |
Indicates whether the scale is connected to the abscissa coordinate system.
IlTrue
if the scale represents the abscissa coordinate and IlFalse
if it represents an ordinate coordinate. Implemented in IlvSingleScaleDisplayer.
virtual IlBoolean IlvAbstractScaleDisplayer::isOnOrdinate | ( | ) | const [pure virtual] |
Indicates whether the scale is connected to an ordinate coordinate system.
IlTrue
if the scale represents an ordinate coordinate and IlFalse
if it represents the abscissa coordinate. Implemented in IlvSingleScaleDisplayer.
IlBoolean IlvAbstractScaleDisplayer::isVisible | ( | ) | const |
Indicates whether the scale is visible.
IlTrue
if the scale is visible and IlFalse
if it is hidden. static IlvAbstractScaleDisplayer* IlvAbstractScaleDisplayer::Load | ( | IlvInputFile & | file | ) | [static] |
Reads a scale object from a file.
Creates a scale instance from the description stored in the file file. The object description must have been written with the IlvAbstractScaleDisplayer::save
method.
file | The file where the object description is stored. |
IlvOutputFile& IlvAbstractScaleDisplayer::save | ( | IlvOutputFile & | file | ) | const |
Writes a complete description of the current object in a file.
Writes the complete object description in a file. This description contains all the information necessary to read back this object with the IlvAbstractScaleDisplayer::Load
member function. This method first writes information regarding the type of the object and calls the IlvAbstractScaleDisplayer::write
method.
file | The file where the complete object description is written. |
virtual void IlvAbstractScaleDisplayer::setAlwaysVisible | ( | IlBoolean | b | ) | [virtual] |
Specifies whether the current scale must always appear on the screen.
b | The new value of the Boolean indicating whether the current scale must always appear on the screen. If this Boolean is set to IlTrue and if the current scale is fixed to a data value that does not belong to the range of visible data, this range will be modified so that the scale can appear on the screen. |
virtual void IlvAbstractScaleDisplayer::setArrowLength | ( | IlvDim | length | ) | [pure virtual] |
Sets the arrow length.
length | The new length of the arrow. |
setAxisOriented
. Implemented in IlvSingleScaleDisplayer.
virtual void IlvAbstractScaleDisplayer::setArrowWidth | ( | IlvDim | width | ) | [pure virtual] |
Sets the arrow width.
width | The new width of the arrow. |
setAxisOriented
. Implemented in IlvSingleScaleDisplayer.
virtual void IlvAbstractScaleDisplayer::setAxisLabelOffset | ( | IlvDim | offset | ) | [pure virtual] |
Sets the offset between the scale axis and its label.
offset | The new offset between the scale axis and its label. |
Implemented in IlvSingleScaleDisplayer.
virtual void IlvAbstractScaleDisplayer::setAxisLabelPalette | ( | IlvPalette * | pal | ) | [pure virtual] |
Sets the palette used to draw the axis label.
This method locks the new palette and unlocks the previous one.
pal | The new palette. |
Implemented in IlvSingleScaleDisplayer.
virtual void IlvAbstractScaleDisplayer::setAxisOriented | ( | IlBoolean | oriented | ) | [pure virtual] |
Indicates whether the scale should be oriented.
An oriented scale is drawn with an arrow at the end.
oriented | The new value of the Boolean indicating whether the scale should be oriented. |
setArrowWidth
, setArrowLength
. Implemented in IlvSingleScaleDisplayer.
virtual void IlvAbstractScaleDisplayer::setAxisPalette | ( | IlvPalette * | pal | ) | [pure virtual] |
Sets the palette used to draw the axis.
This method locks the new palette and unlocks the previous one.
pal | The new palette. |
Implemented in IlvSingleScaleDisplayer.
virtual IlBoolean IlvAbstractScaleDisplayer::setCrossingValue | ( | IlDouble | dataValue, | |
const IlvSingleScaleDisplayer * | refScale | |||
) | [virtual] |
Sets the data value to which this scale is fixed.
This method is used to attach the current scale to another one defined by refScale. The dataValue parameter is used to specify the data value on refScale to which the current scale is fixed.
1
and if a logarithmic transformer is applied to the corresponding coordinate, the value that will be actually stored will be 1
. Otherwise, the stored value will be dataValue.dataValue | The new data value to which the scale is fixed. | |
refScale | The new scale to which the current scale is attached. |
IlTrue
if the scale was successfully fixed IlFalse
otherwise. virtual void IlvAbstractScaleDisplayer::setDrawOrder | ( | IlvDrawOrder | drawOrder | ) | [virtual] |
Sets the drawing order for the current scale.
drawOrder | The new drawing order. |
getDrawOrder
. virtual void IlvAbstractScaleDisplayer::setGridDrawOrder | ( | IlvDrawOrder | drawOrder | ) | [pure virtual] |
Sets the drawing order for the associated grid.
The drawing order enables the grid to be drawn either above (IlvDrawAbove
) or below (IlvDrawBelow
) other graphical representations. The grid and the scale can have different drawing orders. If no associated grid is defined, this method has no effect.
drawOrder | The new drawing order for the associated grid. |
Implemented in IlvSingleScaleDisplayer.
virtual void IlvAbstractScaleDisplayer::setLabelLayout | ( | LabelLayout | layout | ) | [pure virtual] |
Sets the label layout on the scale axis.
This layout applies to the step labels and the axis label. The actual result on the screen depends on the projector used and on the position of the axis.
layout | The new layout of the labels. |
virtual void IlvAbstractScaleDisplayer::setLabelZoomFactor | ( | IlDouble | scale | ) | [pure virtual] |
virtual void IlvAbstractScaleDisplayer::setMajorTickSize | ( | IlvDim | size | ) | [pure virtual] |
Sets the size of the major ticks.
size | The new size of the major ticks. |
Implemented in IlvSingleScaleDisplayer.
virtual void IlvAbstractScaleDisplayer::setMinorTickSize | ( | IlvDim | val | ) | [pure virtual] |
Sets the size of the minor ticks.
size | The new size of the minor ticks. |
Implemented in IlvSingleScaleDisplayer.
void IlvAbstractScaleDisplayer::setName | ( | const char * | name | ) |
Sets the name of the scale.
name | The new name of the scale. The name passed as a parameter is copied. |
virtual void IlvAbstractScaleDisplayer::setOffset | ( | IlvDim | dim | ) | [pure virtual] |
Sets the offset between the ticks and the step labels.
dim | The new offset between the ticks and the step labels. |
Implemented in IlvSingleScaleDisplayer.
virtual void IlvAbstractScaleDisplayer::setRelativePosition | ( | IlvAxisPosition | relPos, | |
IlvPos | offset = 0 | |||
) | [virtual] |
Sets the position to which this scale is fixed.
The scale is fixed at the offset offset relative to the position relPos. The resulting position in screen coordinates depends on the projector used and on the data display area.
offset | The new offset of the scale. | |
relPos | The new position relative to which the scale is fixed. |
virtual void IlvAbstractScaleDisplayer::setStepLabel | ( | IlUInt | labelIndex, | |
const char * | label | |||
) | [pure virtual] |
Sets the label for a given step by hand.
labelIndex | The step index. If the index is invalid, the method does nothing. | |
label | The new label for the step. This label is copied before being set and the old one is freed. |
Implemented in IlvSingleScaleDisplayer.
virtual void IlvAbstractScaleDisplayer::setStepLabelAngle | ( | IlDouble | angle | ) | [pure virtual] |
Sets the angle of the step labels.
angle | The new angle of the step labels. |
Implemented in IlvSingleScaleDisplayer.
virtual void IlvAbstractScaleDisplayer::setStepLabelFormat | ( | const char * | format, | |
IlBoolean | invalidate = IlTrue | |||
) | [pure virtual] |
Sets the format used to translate data values into step labels.
format | The new format. The format parameter is copied and follows the same convention as the string formats used by the C primitives, such as printf . | |
invalidate | A Boolean value indicating whether the layout of the scale should be recomputed. |
IlvSingleScaleDisplayer::computeStepLabel
method. Implemented in IlvSingleScaleDisplayer.
virtual void IlvAbstractScaleDisplayer::setStepLabels | ( | IlUInt | count, | |
const char *const * | labels = 0 | |||
) | [pure virtual] |
Sets the step labels by hand.
The step labels can either be computed from their associated data values or manually specified by this method. The number of steps drawn by the scale is modified to match the count parameter.
count | The number of labels. | |
labels | The new labels. Each label of this array is copied before being set. Each label previously defined is freed. |
computeStepLabel
. Implemented in IlvSingleScaleDisplayer.
virtual void IlvAbstractScaleDisplayer::setStepLabelsPalette | ( | IlvPalette * | pal | ) | [pure virtual] |
Sets the palette used to draw the step labels.
This method locks the new palette and unlocks the previous one.
pal | The new palette. |
Implemented in IlvSingleScaleDisplayer.
virtual void IlvAbstractScaleDisplayer::setTickLayout | ( | TickLayout | layout | ) | [pure virtual] |
Sets the tick layout on the scale axis.
This layout applies to both major and minor ticks. The actual result on the screen depends on the projector used and on the position of the axis.
layout | The new layout of the ticks. |
Implemented in IlvSingleScaleDisplayer.
virtual void IlvAbstractScaleDisplayer::setValueToLabelCB | ( | IlvValueToLabelCB | cb, | |
IlAny | cbData = 0 | |||
) | [pure virtual] |
Sets a conversion callback between data values and step labels.
This method lets you specify a function that gives for a data value associated with a step the actual label that will be displayed for this step. The conversion callback is used by the IlvSingleScaleDisplayer::computeStepLabel
method.
cb | The conversion callback. | |
cbData | An optional parameter used to pass additional information to the callback. |
Implemented in IlvSingleScaleDisplayer.
void IlvAbstractScaleDisplayer::setVisible | ( | IlBoolean | visible | ) |
Sets the visibility of the scale.
visible | The new value of the Boolean indicating whether the scale is visible (IlTrue ) or hidden (IlFalse ). |
virtual void IlvAbstractScaleDisplayer::write | ( | IlvOutputFile & | file | ) | const [virtual] |
Writes the attributes of the current object in a file.
Called by the IlvAbstractScaleDisplayer::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 DeclareScaleDisplayerTypeInfo
macro within the class declaration.
file | The file where the attributes of the current object are written. |
Reimplemented in IlvSingleScaleDisplayer.
© 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.