Rogue Wave Views |
Rogue Wave Views Documentation Home |
Base class for coordinate information storage. More...
#include <ilviews/charts/common.h>
Inherits IlvValueInterface.
Public Member Functions | |
IlvCoordinateInfo (IlvCoordinateType coordinateType, IlvCoordinateTransformer *transfo=0) | |
Constructor. More... | |
IlvCoordinateInfo (IlvCoordinateType coordinateType, IlDouble dataMin, IlDouble dataMax, IlvCoordinateTransformer *transfo=0) | |
Constructor. More... | |
IlvCoordinateInfo (const IlvCoordinateInfo &coordinateInfo) | |
Constructor. More... | |
IlvCoordinateInfo (IlvInputFile &file) | |
Constructor. More... | |
virtual | ~IlvCoordinateInfo () |
Destructor. More... | |
void | addListener (IlvCoordinateInfoListener *listener) |
Adds a listener. More... | |
virtual IlvCoordinateInfo * | copy () const |
Virtual copy constructor. More... | |
IlDouble | getAutoDataMax () const |
Returns the maximum value automatically computed from the considered data. More... | |
IlDouble | getAutoDataMin () const |
Returns the minimum value automatically computed from the considered data. More... | |
const IlvCoordInterval & | getAutoDataRange () const |
Returns the values interval automatically computed from the considered data. More... | |
IlvCoordinateType | getCoordinateType () const |
Returns the type of the corresponding coordinate. More... | |
IlDouble | getDataMax () const |
Returns the maximum value used to select the data to display. More... | |
IlDouble | getDataMin () const |
Returns the minimum value used to select the data to display. More... | |
const IlvCoordInterval & | getDataRange () const |
Returns the values interval used to select the data to display. More... | |
void | getFirstCycleRange (IlvCoordInterval &range) const |
Returns the interval of values that are not shifted by the cycle length. More... | |
IlvCoordinateInfoListener *const * | getListeners (IlUInt &count) const |
Returns all the listeners. More... | |
IlDouble | getMaxPosData () const |
Returns the value positioned at the maximum position of the associated scale. More... | |
IlDouble | getMinPosData () const |
Returns the value positioned at the minimum position of the associated scale. More... | |
void | getSecondCycleRange (IlvCoordInterval &range) const |
Returns the interval of values that are shifted by the cycle length. More... | |
IlvCoordinateTransformer * | getTransformer () const |
Returns the applied transformation. More... | |
IlDouble | getUserDataMax () const |
Returns the maximum value specified by the user. More... | |
IlDouble | getUserDataMin () const |
Returns the minimum value specified by the user. More... | |
const IlvCoordInterval & | getUserDataRange () const |
Returns the values interval specified by the user. More... | |
IlBoolean | isInCyclicMode () const |
Indicates whether the coordinate is in cyclic mode. More... | |
IlBoolean | isOnAbscissa () const |
Indicates whether the current object is associated with the abscissa. More... | |
IlBoolean | isOnOrdinate () const |
Indicates whether the current object is associated with the ordinate. More... | |
IlBoolean | isUsingAutoDataRange () const |
Indicates whether the automatically computed minimum and maximum values are used to select the data to display. More... | |
void | lock () |
Locks the current IlvCoordinateInfo object. More... | |
IlvCoordinateInfoListener * | removeListener (IlvCoordinateInfoListener *l) |
Removes a listener. More... | |
void | removeListeners () |
Removes all the listeners. More... | |
void | resetAutoDataRange () |
Sets the minimum and maximum values automatically computed from the considered data to 0 . More... | |
void | resetDataRangeToAuto () |
Resets the minimum and maximum values to the automatically computed values. More... | |
void | resetDataRangeToUser () |
Resets the minimum and maximum values to the values specified by the user. More... | |
IlvOutputFile & | save (IlvOutputFile &file) const |
Writes a complete description of the current object in a file. More... | |
void | setAutoDataRange (const IlvCoordInterval &range) |
Sets the minimum and maximum values automatically computed from the data. More... | |
void | setCoordinateType (IlvCoordinateType coordinateType) |
Sets the type of the corresponding coordinate. More... | |
void | setDataMax (IlDouble value) |
Sets the maximum value used to select the data to display. More... | |
void | setDataMin (IlDouble value) |
Sets the minimum value used to select the data to display. More... | |
virtual void | setDataRange (const IlvCoordInterval &range) |
Sets the minimum and maximum values used to select the data to display. More... | |
virtual void | setMaxPosData (IlDouble value) |
Sets the value positioned at the maximum position of the associated scale. More... | |
virtual void | setMinPosData (IlDouble value) |
Sets the value positioned at the minimum position of the associated scale. More... | |
void | setTransformer (IlvCoordinateTransformer *transfo) |
Sets the applied transformation. More... | |
void | setUserDataMax (IlDouble value) |
Sets the maximum value specified by the user. More... | |
void | setUserDataMin (IlDouble value) |
Sets the minimum value specified by the user. More... | |
virtual void | setUserDataRange (const IlvCoordInterval &range) |
Sets the values interval specified by the user. More... | |
void | unLock () |
Unlocks the current IlvCoordinateInfo object. More... | |
void | updateAutoDataRange (const IlvCoordInterval &range) |
Updates the minimum and maximum values automatically computed from the data. More... | |
void | useAutoDataRange (IlBoolean b) |
Specifies whether the minimum and maximum values used to select the data are automatically computed. More... | |
virtual void | write (IlvOutputFile &file) const |
Writes the attributes of the current object in a file. More... | |
Static Public Member Functions | |
static IlvCoordinateInfo * | Load (IlvInputFile &file) |
Reads a coordinate information object from a file. More... | |
static IlvCoordinateInfo * | Read (IlvInputFile &file) |
Reads the attributes of a coordinate information object from a file. More... | |
Base class for coordinate information storage.
Library: ilvcharts
This class stores specific information related to a data coordinate (x, y, theta, or rho) that is represented by a given scale. It stores the minimum and maximum values for the coordinate that will be used to select the data to display. It also stores a pointer to an IlvCoordinateTransformer
object that specifies a transformation that will be applied to this coordinate.
The minimum and maximum values for a coordinate that will be used to select the data to display can be specified in two ways:
By hand by the means of the IlvCoordinateInfo::setUserDataMin
, IlvCoordinateInfo::setUserDataMax
or IlvCoordinateInfo::setUserDataRange
methods. In this case, the values set by the user will be used to select the data. This means that only the data within the specified interval for the coordinate will be displayed.
IlvCoordinateInfo::useAutoDataRange
with IlTrue
as a parameter. In this case, the minimum and maximum values for the coordinate are automatically computed from the data so that they include all the defined data. This means that all the data will be selected to be displayed. The minimum and maximum values that are set by the user are returned by the IlvCoordinateInfo::getUserDataMin
and IlvCoordinateInfo::getUserDataMax
methods, respectively. If no values are specified by the user, the returned values are both equal to 0
.
The minimum and maximum values that are automatically computed from the data are returned by the IlvCoordinateInfo::getAutoDataMin
and IlvCoordinateInfo::getAutoDataMax
methods, respectively.
The minimum and maximum values that are actually used to select the data to display are returned by the IlvCoordinateInfo::getDataMin
and IlvCoordinateInfo::getDataMax
methods. These values correspond to the values set by the user or to the automatically computed values if no values have been set by the user.
The values that are positioned at the minimum and maximum positions of the scale associated with the coordinate are obtained by the IlvCoordinateInfo::getMinPosData
and IlvCoordinateInfo::getMaxPosData
methods.
You can see an example on the figure below where two scales are represented: a normal scale and a cyclic scale. The values that are positioned at the minimum and maximum positions of both scales are 0
and 6
(see minPosData and maxPosData in the figure). The minimum and maximum values used to select the data are 0
and 6
for the normal scale, and 2
and 8
for the cyclic scale (see dataMin and dataMax in the figure).
A lock/unlock system is provided in order to share this object among the different objects that use it. The lock/unlock system ensures that the coordinate information object will not be deleted as long as an object needs it (see the IlvCoordinateInfo::lock
and IlvCoordinateInfo::unLock
methods for more details).
IlvChartCoordinateInfo
, IlvCoordinateTransformer
. IlvCoordinateInfo::IlvCoordinateInfo | ( | IlvCoordinateType | coordinateType, |
IlvCoordinateTransformer * | transfo = 0 |
||
) |
Constructor.
Initializes a new IlvCoordinateInfo
object for a given coordinate (x, y, theta, or rho). By default, the minimum and maximum values used to select the data to display and the values that will be positioned at the minimum and maximum positions of the associated scale are set to 0
. Since no minimum and maximum values used to select the data to display are specified, the flag indicating that the minimum and maximum values are automatically computed from the data is set to IlTrue
. At this point in time, these automatically computed values are equal to 0
, since the data that will be displayed is not yet known.
coordinateType | The type of the coordinate with which the current object is associated. This type is IlvAbscissaCoordinate if the current object is associated with the abscissa or IlvOrdinateCoordinate if it is associated with the ordinate. |
transfo | The transformation that will be applied to the considered coordinate. |
IlvCoordinateInfo::IlvCoordinateInfo | ( | IlvCoordinateType | coordinateType, |
IlDouble | dataMin, | ||
IlDouble | dataMax, | ||
IlvCoordinateTransformer * | transfo = 0 |
||
) |
Constructor.
Initializes a new IlvCoordinateInfo
object for a given coordinate (x, y, theta, or rho). The parameters dataMin and dataMax correspond to the minimum and maximum values set by the user. The minimum and maximum values used to select the data to display are set to these values. The values that will be positioned at the minimum and maximum positions of the associated scale are set to the minimum and maximum values that will be used to select the data to display. Therefore, they are also set to dataMin and dataMax. The flag indicating that the minimum and maximum values are automatically computed from the data is set to IlFalse
since the minimum and maximum values used to select the data to display are specified by hand.
coordinateType | The type of the coordinate with which the current object is associated. This type is IlvAbscissaCoordinate if the current object is associated with the abscissa or IlvOrdinateCoordinate if it is associated with the ordinate. |
dataMin | The minimum value of the coordinate used to select the data to display. |
dataMax | The maximum value of the coordinate used to select the data to display. |
transfo | The transformation that will be applied to the considered coordinate. |
IlvCoordinateInfo::IlvCoordinateInfo | ( | const IlvCoordinateInfo & | coordinateInfo | ) |
Constructor.
Initializes a new IlvCoordinateInfo
object as a copy of coordinateInfo.
coordinateInfo | The object used to initialize the current one. |
IlvCoordinateInfo::IlvCoordinateInfo | ( | IlvInputFile & | file | ) |
Constructor.
Initializes a new IlvCoordinateInfo
object from the description read in the input file named file.
file | The file used to initialize the current object. |
|
virtual |
Destructor.
The destructor deletes the object derived from the IlvCoordinateTransformer
class that specifies a transformation that will be applied to the coordinate.
void IlvCoordinateInfo::addListener | ( | IlvCoordinateInfoListener * | listener | ) |
Adds a listener.
listener | The new listener. |
|
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 DeclareCoordinateInfoTypeInfo
macro. The IlvPredefinedCoordinateInfoIOMembers
macro lets you define a default implementation, which returns an instance initialized with the copy constructor.
IlDouble IlvCoordinateInfo::getAutoDataMax | ( | ) | const |
Returns the maximum value automatically computed from the considered data.
IlTrue
(see the IlvCoordinateInfo::useAutoDataRange
and IlvCoordinateInfo::isUsingAutoDataRange
methods). IlDouble IlvCoordinateInfo::getAutoDataMin | ( | ) | const |
Returns the minimum value automatically computed from the considered data.
IlTrue
(see the IlvCoordinateInfo::useAutoDataRange
and IlvCoordinateInfo::isUsingAutoDataRange
methods). const IlvCoordInterval& IlvCoordinateInfo::getAutoDataRange | ( | ) | const |
Returns the values interval automatically computed from the considered data.
IlTrue
(see the IlvCoordinateInfo::useAutoDataRange
and IlvCoordinateInfo::isUsingAutoDataRange
methods). IlvCoordinateType IlvCoordinateInfo::getCoordinateType | ( | ) | const |
Returns the type of the corresponding coordinate.
IlvAbscissaCoordinate
if the current object is associated with the abscissa and IlvOrdinateCoordinate
if the current object is associated with the ordinate. IlDouble IlvCoordinateInfo::getDataMax | ( | ) | const |
Returns the maximum value used to select the data to display.
IlvCoordinateInfo::getAutoDataMax
method if the flag indicating that the automatically computed values are used to select the data to display is set to IlTrue
. Otherwise, it is equal to the value returned by the IlvCoordinateInfo::getUserDataMax
method. IlDouble IlvCoordinateInfo::getDataMin | ( | ) | const |
Returns the minimum value used to select the data to display.
IlvCoordinateInfo::getAutoDataMin
method if the flag indicating that the automatically computed values are used to select the data to display is set to IlTrue
. Otherwise, it is equal to the value returned by the IlvCoordinateInfo::getUserDataMin
method. const IlvCoordInterval& IlvCoordinateInfo::getDataRange | ( | ) | const |
Returns the values interval used to select the data to display.
IlvCoordinateInfo::getAutoDataRange
method if the flag indicating that the automatically computed values are used to select the data to display is set to IlTrue
. Otherwise, it is equal to the values interval returned by the IlvCoordinateInfo::getUserDataRange
method. void IlvCoordinateInfo::getFirstCycleRange | ( | IlvCoordInterval & | range | ) | const |
Returns the interval of values that are not shifted by the cycle length.
In the cyclic mode, the interval of the displayed values is divided into two parts. The first part is not shifted by the cycle length. The second one is shifted by the cycle length and is displayed from the minimum position where data are displayed. This minimum position corresponds to the left most position of the scale. (See the figure in the Detailed Description paragraph.)
The first part is delimited by the minimum value used to select the data to display (value returned by the IlvCoordinateInfo::getDataMin
method) and the data value positioned at the maximum position where data are displayed (value returned by the IlvCoordinateInfo::getMaxPosData
method). The second part is delimited by the data value positioned at the maximum position where data are displayed and the maximum value used to select the data to display (value returned by the IlvCoordinateInfo::getDataMax
method).
This method returns the bounding values of the first part.
range | The interval of values which are represented without being shifted by the cycle length in the cyclic mode. |
IlvCoordinateInfoListener* const* IlvCoordinateInfo::getListeners | ( | IlUInt & | count | ) | const |
Returns all the listeners.
count | The number of returned listeners. |
IlDouble IlvCoordinateInfo::getMaxPosData | ( | ) | const |
Returns the value positioned at the maximum position of the associated scale.
IlDouble IlvCoordinateInfo::getMinPosData | ( | ) | const |
Returns the value positioned at the minimum position of the associated scale.
void IlvCoordinateInfo::getSecondCycleRange | ( | IlvCoordInterval & | range | ) | const |
Returns the interval of values that are shifted by the cycle length.
In the cyclic mode, the interval of the displayed values is divided into two parts. The first part is not shifted by the cycle length. The second one is shifted by the cycle length and is displayed from the minimum position where data are displayed. This minimum position corresponds to the left most position of the scale. (See the figure in the Detailed Description paragraph.)
The first part is delimited by the minimum value used to select the data to display (value returned by the IlvCoordinateInfo::getDataMin
method) and the data value positioned at the maximum position where data are displayed (value returned by the IlvCoordinateInfo::getMaxPosData
method). The second part is delimited by the data value positioned at the maximum position where data are displayed and the maximum value used to select the data to display (value returned by the IlvCoordinateInfo::getDataMax
method).
This method returns the bounding values of the second part.
range | The interval of values which are represented as being shifted by the cycle length in the cyclic mode. |
IlvCoordinateTransformer* IlvCoordinateInfo::getTransformer | ( | ) | const |
Returns the applied transformation.
IlDouble IlvCoordinateInfo::getUserDataMax | ( | ) | const |
Returns the maximum value specified by the user.
IlFalse
(see the IlvCoordinateInfo::useAutoDataRange
and IlvCoordinateInfo::isUsingAutoDataRange
methods). IlDouble IlvCoordinateInfo::getUserDataMin | ( | ) | const |
Returns the minimum value specified by the user.
IlFalse
(see the IlvCoordinateInfo::useAutoDataRange
and IlvCoordinateInfo::isUsingAutoDataRange
methods). const IlvCoordInterval& IlvCoordinateInfo::getUserDataRange | ( | ) | const |
Returns the values interval specified by the user.
IlFalse
(see the IlvCoordinateInfo::useAutoDataRange
and IlvCoordinateInfo::isUsingAutoDataRange
methods). IlBoolean IlvCoordinateInfo::isInCyclicMode | ( | ) | const |
Indicates whether the coordinate is in cyclic mode.
IlTrue
if the coordinate is in cyclic mode and IlFalse
otherwise.IlvCoordinateInfo::getDataMin()
is different from the value returned by IlvCoordinateInfo::getMinPosData()
or when the value returned by IlvCoordinateInfo::getDataMax()
is different from the value returned by IlvCoordinateInfo::getMaxPosData()
. (See the Detailed Description paragraph and the accompanying figure for more information.) IlBoolean IlvCoordinateInfo::isOnAbscissa | ( | ) | const |
Indicates whether the current object is associated with the abscissa.
IlTrue
if the current object is associated with the abscissa and IlFalse
otherwise. IlBoolean IlvCoordinateInfo::isOnOrdinate | ( | ) | const |
Indicates whether the current object is associated with the ordinate.
IlTrue
if the current object is associated with the ordinate and IlFalse
otherwise. IlBoolean IlvCoordinateInfo::isUsingAutoDataRange | ( | ) | const |
Indicates whether the automatically computed minimum and maximum values are used to select the data to display.
IlTrue
if the automatically computed minimum and maximum values are used to select the data to display, and IlFalse
otherwise.
|
static |
Reads a coordinate information object from a file.
Creates a coordinate information instance from the description stored in the file file. The object description must have been written with the IlvCoordinateInfo::save
method.
file | The file where the object description is stored. |
void IlvCoordinateInfo::lock | ( | ) |
Locks the current IlvCoordinateInfo
object.
Ensures that the current IlvCoordinateInfo
object will not be destroyed before it is unlocked.
This method increments a reference count initially set to 0
.
When you keep a pointer to an IlvCoordinateInfo
object (because you store it in the field of an object or it is in a variable), you should lock it for the duration of its use so that it is not destroyed by some other object or component. When you do not need the IlvCoordinateInfo
any more, you should release it with a call to unLock
; if the lock you just removed was the last one, Rogue Wave Views will free the IlvCoordinateInfo
.
|
static |
Reads the attributes of a coordinate information object from a file.
Reads from a file the attributes specific to an object which have been written by the corresponding IlvCoordinateInfo::write
method and creates a copy of this object. The Read
method is called by the IlvCoordinateInfo::Load
method. The IlvCoordinateInfo::Load
method read the information indicating the type of the stored object before calling the Read
method. Therefore, you should use the Read
method directly only when you know the type of the stored object.
file | The file where the object attributes are stored. |
IlvCoordinateInfoListener* IlvCoordinateInfo::removeListener | ( | IlvCoordinateInfoListener * | l | ) |
Removes a listener.
l | The listener to remove. |
0
if l is not associated with the current object.void IlvCoordinateInfo::removeListeners | ( | ) |
Removes all the listeners.
All the listeners are deleted.
void IlvCoordinateInfo::resetAutoDataRange | ( | ) |
Sets the minimum and maximum values automatically computed from the considered data to 0
.
void IlvCoordinateInfo::resetDataRangeToAuto | ( | ) |
Resets the minimum and maximum values to the automatically computed values.
Resets the minimum and maximum values used to select the data to display for the considered coordinate to the minimum and maximum values automatically computed from the considered data.
void IlvCoordinateInfo::resetDataRangeToUser | ( | ) |
Resets the minimum and maximum values to the values specified by the user.
Resets the minimum and maximum values used to select the data to display for the considered coordinate to the minimum and maximum values specified by the user.
IlvOutputFile& IlvCoordinateInfo::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 IlvCoordinateInfo::Load
member function. This method first writes information regarding the type of the object and calls the IlvCoordinateInfo::write
method.
file | The file where the complete object description is written. |
void IlvCoordinateInfo::setAutoDataRange | ( | const IlvCoordInterval & | range | ) |
Sets the minimum and maximum values automatically computed from the data.
range | The new values interval that is automatically computed from the considered data. |
void IlvCoordinateInfo::setCoordinateType | ( | IlvCoordinateType | coordinateType | ) |
Sets the type of the corresponding coordinate.
coordinateType | The type of the coordinate with which the current object is associated. |
void IlvCoordinateInfo::setDataMax | ( | IlDouble | value | ) |
Sets the maximum value used to select the data to display.
Sets the maximum value used to select the data to display and the value that is positioned at the maximum position of the scale associated with the considered coordinate to value.
value | The new maximum value used to select the data to display. |
void IlvCoordinateInfo::setDataMin | ( | IlDouble | value | ) |
Sets the minimum value used to select the data to display.
Sets the minimum value used to select the data to display and the value that is positioned at the minimum position of the scale associated with the considered coordinate to value.
value | The new minimum value used to select the data to display. |
|
virtual |
Sets the minimum and maximum values used to select the data to display.
Sets the values interval used to select the data to display for the considered coordinate to range and the values that are positioned at the minimum and maximum positions of the scale associated with the considered coordinate to range.getMin() and range.getMax(), respectively.
range | The new values interval used to select the data to display. |
|
virtual |
Sets the value positioned at the maximum position of the associated scale.
value | The new data value that is positioned at the maximum position of the scale associated with the considered coordinate. |
|
virtual |
Sets the value positioned at the minimum position of the associated scale.
value | The new data value that is positioned at the minimum position of the scale associated with the considered coordinate. |
void IlvCoordinateInfo::setTransformer | ( | IlvCoordinateTransformer * | transfo | ) |
Sets the applied transformation.
transfo | The new transformation that will be applied to the considered coordinate. |
void IlvCoordinateInfo::setUserDataMax | ( | IlDouble | value | ) |
Sets the maximum value specified by the user.
Allows the user to define a maximum value that will be used to select the data to display for the considered coordinate.
value | The new maximum value specified by the user for the considered coordinate. |
void IlvCoordinateInfo::setUserDataMin | ( | IlDouble | value | ) |
Sets the minimum value specified by the user.
Allows the user to define a minimum value that will be used to select the data to display for the considered coordinate.
value | The new minimum value specified by the user for the considered coordinate. |
|
virtual |
Sets the values interval specified by the user.
Allows the user to define a values interval that will be used to select the data to display for the considered coordinate.
range | The new values interval specified by the user for the considered coordinate. |
void IlvCoordinateInfo::unLock | ( | ) |
Unlocks the current IlvCoordinateInfo
object.
Decrements the reference count of the object and deletes the object if this count drops to 0
.
void IlvCoordinateInfo::updateAutoDataRange | ( | const IlvCoordInterval & | range | ) |
Updates the minimum and maximum values automatically computed from the data.
This method is used to update the values interval that is automatically computed from the considered data.
If the old interval that is already stored has its minimum and maximum equal to 0
, the new automatically computed interval is set to range. Otherwise, it is set to the smaller interval that contains both the old interval that is already stored and the interval range.
range | The new values interval that is automatically computed from the considered data. |
void IlvCoordinateInfo::useAutoDataRange | ( | IlBoolean | b | ) |
Specifies whether the minimum and maximum values used to select the data are automatically computed.
b | The new value of the Boolean indicating whether the minimum and maximum values used to select the data to display are automatically computed from the considered data. |
|
virtual |
Writes the attributes of the current object in a file.
Called by the IlvCoordinateInfo::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 DeclareCoordinateInfoTypeInfo
macro within the class declaration.
file | The file where the attributes of the current object are written. |
© 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.