Class defining a transformation made of a logarithmic transformation to be applied to a coordinate. More...
#include <ilviews/charts/common.h>
Public Member Functions | |
virtual void | applyElementaryTransfo (IlDouble &val) const =0 |
Applies the elementary transformation to a value. More... | |
virtual void | applyInverseElementaryTransfo (IlDouble &val) const =0 |
Applies the inverse of the elementary transformation to a value. More... | |
void | applyInverseLogTransfo (IlDouble &val) const |
Applies the inverse of the logarithmic transformation. More... | |
void | applyLogTransfo (IlDouble &val) const |
Applies the logarithmic transformation to a value. More... | |
virtual IlBoolean | condToApplyElementaryTransfo () const =0 |
Indicates whether the condition to apply the elementary transformation is verified. More... | |
virtual IlBoolean | condToApplyInverseElementaryTransfo () const =0 |
Indicates whether the condition to apply the inverse of the elementary transformation is verified. More... | |
IlUInt | getLogBase () const |
Returns the logarithmic base. More... | |
virtual IlBoolean | inverseTransformPoints (IlUInt pointsCount, IlvDoublePoint *points) const |
Applies the inverse transformation to points. More... | |
virtual IlBoolean | inverseTransformValue (IlDouble &val) const |
Applies the inverse transformation to a value. More... | |
virtual IlBoolean | inverseTransformValues (IlUInt valuesCount, IlDouble *values) const |
Applies the inverse transformation to values. More... | |
void | setLogBase (IlUInt base) |
Sets the logarithmic base. More... | |
virtual IlBoolean | transformPoints (IlUInt pointsCount, IlvDoublePoint *points) const |
Applies a transformation to data points. More... | |
virtual IlBoolean | transformValue (IlDouble &val) const |
Applies a transformation to a data value. More... | |
virtual IlBoolean | transformValues (IlUInt valuesCount, IlDouble *values) const |
Applies a transformation to data values. More... | |
virtual IlBoolean | validateInterval (IlvCoordInterval &interval) const |
Validates an interval. More... | |
virtual void | write (IlvOutputFile &file) const |
Writes the attributes of the current object in a file. More... | |
Public Member Functions inherited from IlvCoordinateTransformer | |
virtual | ~IlvCoordinateTransformer () |
Destructor. More... | |
virtual IlvCoordinateTransformer * | copy () const =0 |
Virtual copy constructor. More... | |
const IlvCoordinateInfo * | getOwner () const |
Returns the coordinate information that owns the current object. More... | |
virtual IlBoolean | inverseTransformInterval (IlvCoordInterval &itvl) const |
Applies the inverse transformation to an interval. More... | |
IlvOutputFile & | save (IlvOutputFile &file) const |
Writes a complete description of the current object in a file. More... | |
virtual IlBoolean | transformInterval (IlvCoordInterval &itvl) const |
Applies a transformation to an interval. More... | |
Protected Member Functions | |
IlvChartCoordinateTransformer (const IlvChartCoordinateTransformer &t) | |
Constructor. More... | |
IlvChartCoordinateTransformer (IlUInt logBase) | |
Constructor. More... | |
IlvChartCoordinateTransformer (IlvInputFile &file) | |
Constructor. More... | |
Protected Member Functions inherited from IlvCoordinateTransformer | |
IlvCoordinateTransformer () | |
Constructor. More... | |
IlvCoordinateTransformer (const IlvCoordinateTransformer &transfo) | |
Constructor. More... | |
IlvCoordinateTransformer (IlvInputFile &file) | |
Constructor. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from IlvCoordinateTransformer | |
static IlvCoordinateTransformer * | Load (IlvInputFile &file) |
Reads a coordinate transformer object from a file. More... | |
Class defining a transformation made of a logarithmic transformation to be applied to a coordinate.
Library: ilvcharts
This is an abstract subclass of IlvCoordinateTransformer
that allows you to define a transformation to apply to a given data coordinate (x, y, theta, or rho). This transformation is composed of an elementary transformation, possibly followed by a logarithmic transformation.
The applied logarithmic transformation depends on the defined logarithmic base. If the logarithmic base is equal to 0
or 1
, no logarithmic transformation is applied. Otherwise, the following transformation is applied:
where c
is the initial coordinate, base
is the logarithmic base, log
is the natural logarithm, and c_transformed
is the coordinate transformed using the logarithmic transformation.
IlvChartCoordinateTransformer
is an abstract class. Its constructors are defined as protected since it is not possible to create an instance of this class directly.
|
protected |
Constructor.
Initializes a new IlvChartCoordinateTransformer
object.
logBase | The logarithmic base set for the current object. |
|
protected |
Constructor.
Initializes a new IlvChartCoordinateTransformer
object which is a copy of transfo.
t | The object used to initialize the current one. |
|
protected |
Constructor.
Initializes a new IlvChartCoordinateTransformer
object from the description read in the input file named file.
file | The file used to initialize the current object. |
|
pure virtual |
Applies the elementary transformation to a value.
val | This parameter stores the value to transform and is also used to return the transformed value. |
Implemented in IlvAffineChartTransformer, and IlvSimpleChartTransformer.
|
pure virtual |
Applies the inverse of the elementary transformation to a value.
val | This parameter stores the value to transform inversely and is also used to return the value once it has been inversely transformed. |
Implemented in IlvAffineChartTransformer, and IlvSimpleChartTransformer.
void IlvChartCoordinateTransformer::applyInverseLogTransfo | ( | IlDouble & | val | ) | const |
Applies the inverse of the logarithmic transformation.
val | This parameter stores the value to transform inversely and is also used to return the value once it has been inversely transformed. |
The applied inverse transformation is the following:
where c_transformed
is the transformed coordinate, base
is the logarithmic base, log
is the natural logarithm, exp
the exponential function, and c
is the inversely transformed coordinate (that is, the value before the logarithmic transformation).
1
. void IlvChartCoordinateTransformer::applyLogTransfo | ( | IlDouble & | val | ) | const |
Applies the logarithmic transformation to a value.
val | This parameter stores the value to transform and is also used to return the transformed value. |
The applied transformation is the following:
where c
is the initial coordinate, base
is the logarithmic base, log
is the natural logarithm, and c_transformed
is the coordinate transformed using the logarithmic transformation.
1
.
|
pure virtual |
Indicates whether the condition to apply the elementary transformation is verified.
IlTrue
if the condition needed to apply the elementary transformation is verified and IlFalse
otherwise. Implemented in IlvAffineChartTransformer, and IlvSimpleChartTransformer.
|
pure virtual |
Indicates whether the condition to apply the inverse of the elementary transformation is verified.
IlTrue
if the condition needed to apply the inverse of the elementary transformation is verified and IlFalse
otherwise. Implemented in IlvAffineChartTransformer, and IlvSimpleChartTransformer.
IlUInt IlvChartCoordinateTransformer::getLogBase | ( | ) | const |
Returns the logarithmic base.
|
virtual |
Applies the inverse transformation to points.
The inverse of the logarithmic transformation is applied first if the logarithmic base is greater than 1
, followed by the inverse of the elementary transformation.
pointsCount | The number of points to which the inverse transformation is applied. |
points | This parameter stores the points to transform inversely and is also used to return the points once they have been inversely transformed. |
IlTrue
if the inverse transformation has been successfully applied to all the points and IlFalse
otherwise.Reimplemented from IlvCoordinateTransformer.
|
virtual |
Applies the inverse transformation to a value.
The inverse of the logarithmic transformation is applied first if the logarithmic base is greater than 1
, followed by the inverse of the elementary transformation.
val | This parameter stores the value to transform inversely and is also used to return the value once it has been inversely transformed. |
IlTrue
if the inverse transformation has been successfully applied to the value and IlFalse
otherwise. Implements IlvCoordinateTransformer.
|
virtual |
Applies the inverse transformation to values.
The inverse of the logarithmic transformation is applied first if the logarithmic base is greater than 1
, followed by the inverse of the elementary transformation.
valuesCount | The number of values to which the inverse transformation is applied. |
values | This parameter stores the values to transform inversely and is also used to return the values once they have been inversely transformed. |
IlTrue
if the inverse transformation has been successfully applied to all the values and IlFalse
otherwise. Reimplemented from IlvCoordinateTransformer.
void IlvChartCoordinateTransformer::setLogBase | ( | IlUInt | base | ) |
Sets the logarithmic base.
base | The new logarithmic base. If base is equal to 0 or 1 , no logarithmic transformation will be applied. Otherwise, the following transformation is applied: c_transformed = log(c) / log(base),
c is the initial coordinate, base is the logarithmic base, log is the natural logarithm, and c_transformed is the coordinate transformed using the logarithmic transformation. |
|
virtual |
Applies a transformation to data points.
The elementary transformation is applied first, followed by the logarithmic transformation if the logarithmic base is greater than 1
.
pointsCount | The number of points to which the transformation is applied. |
points | This parameter stores the points to transform and is also used to return the transformed points. |
IlTrue
if all the data points have been successfully transformed and IlFalse
otherwise.Reimplemented from IlvCoordinateTransformer.
Applies a transformation to a data value.
The elementary transformation is applied first, followed by the logarithmic transformation if the logarithmic base is greater than 1
.
val | This parameter stores the value to transform and is also used to return the transformed value. |
IlTrue
if the data value has been successfully transformed and IlFalse
otherwise. Implements IlvCoordinateTransformer.
|
virtual |
Applies a transformation to data values.
The elementary transformation is applied first, followed by the logarithmic transformation if the logarithmic base is greater than 1
.
valuesCount | The number of values to which the transformation is applied. |
values | This parameter stores the values to transform and is also used to return the transformed values. |
IlTrue
if the all the data values have been successfully transformed and IlFalse
otherwise. Reimplemented from IlvCoordinateTransformer.
|
virtual |
Validates an interval.
Changes the interval interval so that it becomes consistent with the definition domain of the transformer. The default implementation does nothing and returns IlFalse
, which indicates that the interval has not been modified.
interval | The interval to validate. |
Reimplemented from IlvCoordinateTransformer.
|
virtual |
Writes the attributes of the current object in a file.
Called by the IlvCoordinateTransformer::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 DeclareCoordinateTransformerTypeInfo
macro within the class declaration.
file | The file where the attributes of the current object are written. |
Reimplemented from IlvCoordinateTransformer.