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. More... | |
virtual IlvAbstractScaleDisplayer * | copy () const =0 |
Virtual copy constructor. More... | |
virtual void | drawLabelOnCrossings (IlBoolean b)=0 |
Indicates whether the labels should be drawn where the axes intersect. More... | |
virtual void | drawOverlappingLabels (IlBoolean b)=0 |
Sets whether overlapping labels are allowed. More... | |
virtual IlvCoordinateInfo * | getCoordinateInfo (IlUInt index=0) const =0 |
Deprecated Returns the coordinate information associated with the scale. More... | |
virtual IlvCoordinateType | getCoordinateType () const =0 |
Returns the type of the coordinate represented by the current scale. More... | |
IlBoolean | getCrossingValue (IlDouble &dataValue) const |
Returns the data value to which the scale is actually fixed. More... | |
IlvDrawOrder | getDrawOrder () const |
Returns the drawing order for the current scale. More... | |
IlvCoordinateInfo * | getInfoForCrossingValue () const |
Returns the coordinate information used to position the scale. More... | |
const char * | getName () const |
Returns the name of the scale. More... | |
IlBoolean | getRelativePosition (IlvAxisPosition &relPos, IlvPos &offset) const |
Returns the relative position to which the scale is fixed. More... | |
IlDouble | getStoredCrossingValue () const |
Returns the stored value to which the scale is fixed. More... | |
IlBoolean | isAlwaysVisible () const |
Indicates whether the current scale must always appear on the screen. More... | |
IlBoolean | isFixedToPosition () const |
Indicates whether the scale is fixed to a position. More... | |
IlBoolean | isInVisibleDataArea () const |
Indicates whether the scale is in the visible data area. More... | |
virtual IlBoolean | isOnAbscissa () const =0 |
Indicates whether the scale is connected to the abscissa coordinate system. More... | |
virtual IlBoolean | isOnOrdinate () const =0 |
Indicates whether the scale is connected to an ordinate coordinate system. More... | |
IlBoolean | isVisible () const |
Indicates whether the scale is visible. More... | |
IlvOutputFile & | save (IlvOutputFile &file) const |
Writes a complete description of the current object in a file. More... | |
virtual void | setAlwaysVisible (IlBoolean b) |
Specifies whether the current scale must always appear on the screen. More... | |
virtual void | setArrowLength (IlvDim length)=0 |
Sets the arrow length. More... | |
virtual void | setArrowWidth (IlvDim width)=0 |
Sets the arrow width. More... | |
virtual void | setAxisLabelOffset (IlvDim offset)=0 |
Sets the offset between the scale axis and its label. More... | |
virtual void | setAxisLabelPalette (IlvPalette *pal)=0 |
Sets the palette used to draw the axis label. More... | |
virtual void | setAxisOriented (IlBoolean oriented)=0 |
Indicates whether the scale should be oriented. More... | |
virtual void | setAxisPalette (IlvPalette *pal)=0 |
Sets the palette used to draw the axis. More... | |
virtual IlBoolean | setCrossingValue (IlDouble dataValue, const IlvSingleScaleDisplayer *ref) |
Sets the data value to which this scale is fixed. More... | |
virtual void | setDrawOrder (IlvDrawOrder drawOrder) |
Sets the drawing order for the current scale. More... | |
virtual void | setGridDrawOrder (IlvDrawOrder drawOrder)=0 |
Sets the drawing order for the associated grid. More... | |
virtual void | setLabelLayout (LabelLayout layout)=0 |
Sets the label layout on the scale axis. More... | |
virtual void | setLabelZoomFactor (IlDouble scale)=0 |
Sets the label scale factor. More... | |
virtual void | setMajorTickSize (IlvDim size)=0 |
Sets the size of the major ticks. More... | |
virtual void | setMinorTickSize (IlvDim size)=0 |
Sets the size of the minor ticks. More... | |
void | setName (const char *name) |
Sets the name of the scale. More... | |
virtual void | setOffset (IlvDim dim)=0 |
Sets the offset between the ticks and the step labels. More... | |
virtual void | setRelativePosition (IlvAxisPosition relPos, IlvPos offset=0) |
Sets the position to which this scale is fixed. More... | |
virtual void | setStepLabel (IlUInt labelIndex, const char *label)=0 |
Sets the label for a given step by hand. More... | |
virtual void | setStepLabelAngle (IlDouble angle)=0 |
Sets the angle of the step labels. More... | |
virtual void | setStepLabelFormat (const char *format, IlBoolean invalidate=IlTrue)=0 |
Sets the format used to translate data values into step labels. More... | |
virtual void | setStepLabels (IlUInt count, const char *const *labels=0)=0 |
Sets the step labels by hand. More... | |
virtual void | setStepLabelsPalette (IlvPalette *pal)=0 |
Sets the palette used to draw the step labels. More... | |
virtual void | setTickLayout (TickLayout layout)=0 |
Sets the tick layout on the scale axis. More... | |
virtual void | setValueToLabelCB (IlvValueToLabelCB cb, IlAny cbData=0)=0 |
Sets a conversion callback between data values and step labels. More... | |
void | setVisible (IlBoolean visible) |
Sets the visibility of the scale. More... | |
virtual void | write (IlvOutputFile &file) const |
Writes the attributes of the current object in a file. More... | |
Static Public Member Functions | |
static IlvAbstractScaleDisplayer * | Load (IlvInputFile &file) |
Reads a scale object from a file. More... | |
Protected Member Functions | |
IlvAbstractScaleDisplayer () | |
Constructor. More... | |
IlvAbstractScaleDisplayer (const IlvAbstractScaleDisplayer &scaleDisplayer) | |
Constructor. More... | |
IlvAbstractScaleDisplayer (IlvInputFile &file) | |
Constructor. More... | |
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 |
Destructor.
If the scale is fixed to the value of another coordinate, the associated coordinate information is unlocked.
|
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).
|
protected |
Constructor.
Initializes a new IlvAbstractScaleDisplayer
object as a copy of scaleDisplayer.
scaleDisplayer | The object used to initialize the current one. |
|
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. |
|
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.
|
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<code/code> if the labels should be drawn where the axes intersect and IlFalse otherwise. |
Implemented in IlvSingleScaleDisplayer.
|
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.
|
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.
|
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).
<code/code>
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.
|
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.
|
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 |
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 |
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. |
|
pure virtual |
Sets the arrow length.
length | The new length of the arrow. |
setAxisOriented()
. Implemented in IlvSingleScaleDisplayer.
|
pure virtual |
Sets the arrow width.
width | The new width of the arrow. |
setAxisOriented()
. Implemented in IlvSingleScaleDisplayer.
|
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.
|
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.
|
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.
|
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 |
Sets the data value to which this scale is fixed.
This method is used to attach the current scale to another one defined by ref. The dataValue parameter is used to specify the data value on ref 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. |
ref | The new scale to which the current scale is attached. |
IlTrue
if the scale was successfully fixed IlFalse
otherwise.
|
virtual |
Sets the drawing order for the current scale.
drawOrder | The new drawing order. |
getDrawOrder()
.
|
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.
|
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. |
|
pure virtual |
|
pure virtual |
Sets the size of the major ticks.
size | The new size of the major ticks. |
Implemented in IlvSingleScaleDisplayer.
|
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. |
|
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 |
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. |
|
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.
|
pure virtual |
Sets the angle of the step labels.
angle | The new angle of the step labels. |
Implemented in IlvSingleScaleDisplayer.
|
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 | Indicates whether the layout of the scale should be recomputed. |
IlvSingleScaleDisplayer::computeStepLabel()
method. Implemented in IlvSingleScaleDisplayer.
|
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.
|
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.
|
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.
|
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 |
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 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.