rwlogo
Rogue Wave Views 5.5.1

Rogue Wave Views
Foundation Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IlvTransformer Class Reference

Geometric transformation class. More...

#include <ilviews/ilv.h>

List of all members.

Public Member Functions

 IlvTransformer (const IlvPoint &delta)
 Constructor.
 IlvTransformer (const IlvRect &src, const IlvRect &dst)
 Constructor.
 IlvTransformer (IlvTransfoParam sx, IlvTransfoParam sy, IlvPoint *point=0)
 Constructor.
 IlvTransformer (const IlvPoint &center, IlvTransfoParam angle)
 Constructor.
 IlvTransformer (IlvTransfoParam m11, IlvTransfoParam m12, IlvTransfoParam m21, IlvTransfoParam m22, IlvTransfoParam x0, IlvTransfoParam y0)
 Constructor.
 IlvTransformer ()
 Constructor.
void apply (IlUInt count, IlvPoint *points) const
 Applies the transformer to a point set.
void apply (IlvRect &rect) const
 Applies the transformer to a rectangle.
void apply (IlvFloatPoint &p) const
 Applies the transformer to a point.
void apply (IlvPoint &p) const
 Applies the transformer.
void applyAndFill (IlvRect &rect) const
 Applies the transformer.
void compose (const IlvTransformer &t)
 Computes the composition of two transformers.
IlBoolean compute (const IlvRect &src, const IlvRect &dst)
 Stores the scaling and translation factors.
IlBoolean computeInverse (IlvTransformer &t) const
 Stores the inverse transformation values.
void deltaApply (IlvPoint &p) const
 Applies the transformer without the translation.
IlDouble getDeterminant () const
 Gets the determinant of the matrix.
void getValues (IlvTransfoParam &m11, IlvTransfoParam &m12, IlvTransfoParam &m21, IlvTransfoParam &m22, IlvTransfoParam &x0, IlvTransfoParam &y0) const
void getValues (IlvTransfoParam &x0, IlvTransfoParam &y0) const
IlBoolean inverse (IlvRect &rect) const
 Applies the inverse transformation.
IlBoolean inverse (IlvFloatPoint &p) const
 Applies the inverse transformation.
IlBoolean inverse (IlvPoint &p) const
 Applies the inverse transformation.
IlBoolean isBad () const
 Indicates whether the transformer is reversible.
IlBoolean isIdentity () const
 Indicates whether the current object represents the identity transformation.
IlBoolean isScale () const
 Indicates whether the current object is a scaling transformation.
IlBoolean isTranslation () const
 Indicates whether the current object is a translation transformation.
void rotate (IlvTransfoParam centerx, IlvTransfoParam centery, IlvTransfoParam angle)
 Composes the transformer with a rotation.
void scale (IlvTransfoParam fixedx, IlvTransfoParam fixedy, IlvTransfoParam sx, IlvTransfoParam sy)
 Composes the transformer with a scaling operation.
void setValues (IlvTransfoParam m11, IlvTransfoParam m12, IlvTransfoParam m21, IlvTransfoParam m22, IlvTransfoParam x0, IlvTransfoParam y0)
 Sets the values that define the current IlvTransformer object.
void setValues (IlvTransfoParam x0, IlvTransfoParam y0)
 Sets the values that define the current IlvTransformer object.
void translate (IlvTransfoParam dx, IlvTransfoParam dy)
 Composes the transformer with a translation.

Detailed Description

Geometric transformation class.

Library: display

The IlvTransformer class internally computes two-dimensional affine transformations, thus allowing geometrical transformations of graphic objects. The IlvTransformer API is based on the IlvTransfoParam type.


Constructor & Destructor Documentation

IlvTransformer::IlvTransformer (  ) 

Constructor.

This constructor sets the values of the object so that the geometric transformation is the identity transformation; that is, a transformation that does not change its operands.

IlvTransformer::IlvTransformer ( IlvTransfoParam  m11,
IlvTransfoParam  m12,
IlvTransfoParam  m21,
IlvTransfoParam  m22,
IlvTransfoParam  x0,
IlvTransfoParam  y0 
)

Constructor.

This constructor sets the values of the object so that the represented transformation will be applied by transforming the coordinates of a point p at (x, y) to a transformed point tp at (tx, ty) according to the following formula:

IlvTransformera.gif

which leads to:

IlvTransformer2.gif

These objects are used each time a geometrical transformation is computed.

IlvTransformer::IlvTransformer ( const IlvPoint center,
IlvTransfoParam  angle 
)

Constructor.

This constructor initializes a new IlvTransformer instance that corresponds to a rotation of angle degrees around the center point center.

Parameters:
center The center point of the rotation.
angle The angle of rotation in degrees.
IlvTransformer::IlvTransformer ( IlvTransfoParam  sx,
IlvTransfoParam  sy,
IlvPoint point = 0 
)

Constructor.

This constructor initializes a new IlvTransformer instance that corresponds to a scaling operation specified by the sx and sy parameters. This transformation will leave the point coordinates unchanged. If you do not specify this point, (0, 0) will remain fixed.

Parameters:
sx Scaling in the x direction.
sy Scaling in the y direction.
IlvTransformer::IlvTransformer ( const IlvRect src,
const IlvRect dst 
)

Constructor.

This constructor initializes a new IlvTransformer instance that stores the scaling and translation factors that transforms the rectangle src to dst, with no rotation.

Parameters:
src The initial rectangle.
dst The final rectangle, after transformation.
IlvTransformer::IlvTransformer ( const IlvPoint delta  ) 

Constructor.

This constructor initializes a new IlvTransformer instance that corresponds to the translation specified in the delta parameter.

Parameters:
delta The translation required.

Member Function Documentation

void IlvTransformer::apply ( IlUInt  count,
IlvPoint points 
) const

Applies the transformer to a point set.

Applies the transformer to the all points of the array points, replacing them by their transformed version.

Parameters:
count The number of points to transform.
points The array of at least count points to transform.
void IlvTransformer::apply ( IlvRect rect  )  const

Applies the transformer to a rectangle.

Applies the transformer to the rect parameter, which is modified by the function call.

Parameters:
rect The rectangle to transform.
void IlvTransformer::apply ( IlvFloatPoint p  )  const

Applies the transformer to a point.

Applies the transformer to the p parameter, which is modified by the function call.

Parameters:
p The point to transform.
void IlvTransformer::apply ( IlvPoint p  )  const

Applies the transformer.

Applies the transformer to the p parameter, which is modified by the function call.

Parameters:
p The point to transform.
void IlvTransformer::applyAndFill ( IlvRect rect  )  const

Applies the transformer.

Calls apply(IlvRect&) with the rect parameter. It ensures that the rectangle will not be returned empty once the transformer has been applied. It does so by setting to 1 any dimension previously set to 0.

Parameters:
rect The rectangle to transform.
void IlvTransformer::compose ( const IlvTransformer t  ) 

Computes the composition of two transformers.

Computes the composition of two transformers. It modifies the current IlvTransformer by composing it with the one given in the t parameter. Using a mixture of mathematical and C++ notation, one could define the composed transformer as T1.compose(T2) (x) = T2(T1(x)) = T2 o T1 (x) .

Parameters:
t The transformer to compose with.
IlBoolean IlvTransformer::compute ( const IlvRect src,
const IlvRect dst 
)

Stores the scaling and translation factors.

Stores, in the current object, the scaling and translation factors that transform the rectangle src to dst with no rotation. If this operation cannot be performed it leaves the current object unmodified.

Parameters:
src The initial rectangle.
dst The final rectangle, after transformation.
Returns:
IlTrue if successful, and IlFalse otherwise.
IlBoolean IlvTransformer::computeInverse ( IlvTransformer t  )  const

Stores the inverse transformation values.

Stores, in the inverse parameter, the inverse transformation values of the current object. If this operation cannot be performed it leaves inverse unmodified.

Returns:
IlTrue if successful, and IlFalse otherwise.
void IlvTransformer::deltaApply ( IlvPoint p  )  const

Applies the transformer without the translation.

Applies the current transformer to the p parameter but without the translation parameters. This lets you compute transformed vectors.

Parameters:
p The point to transform.
IlDouble IlvTransformer::getDeterminant (  )  const

Gets the determinant of the matrix.

IlvTransformer3.gif
Returns:
The determinant of the matrix.
void IlvTransformer::getValues ( IlvTransfoParam m11,
IlvTransfoParam m12,
IlvTransfoParam m21,
IlvTransfoParam m22,
IlvTransfoParam x0,
IlvTransfoParam y0 
) const

Accesses the values stored in the object.

void IlvTransformer::getValues ( IlvTransfoParam x0,
IlvTransfoParam y0 
) const

Accesses the values stored in the object.

IlBoolean IlvTransformer::inverse ( IlvRect rect  )  const

Applies the inverse transformation.

Applies the inverse transformation stored in this object to the rect parameter, which is modified by the function call. The argument is not modified if the transformation cannot be inverted.

Parameters:
rect The rectangle to transform.
Returns:
IlFalse if the transformation cannot be inverted. Otherwise, it returns IlTrue.
IlBoolean IlvTransformer::inverse ( IlvFloatPoint p  )  const

Applies the inverse transformation.

Applies the inverse transformation stored in this object to the p parameter, which is modified by the function call. The argument is not modified if the transformation cannot be inverted.

Parameters:
p The point to transform.
Returns:
IlFalse if the transformation cannot be inverted. Otherwise, it returns IlTrue.
IlBoolean IlvTransformer::inverse ( IlvPoint p  )  const

Applies the inverse transformation.

Applies the inverse transformation stored in this object to p, which is modified by the function call. The argument is not modified if the transformation cannot be inverted.

Parameters:
p The point to transform.
Returns:
IlFalse if the transformation cannot be inverted. Otherwise, it returns IlTrue.
IlBoolean IlvTransformer::isBad (  )  const

Indicates whether the transformer is reversible.

Returns an IlBoolean value that indicates whether the transformer is reversible. If it is not reversible, you cannot call inverse.

Returns:
An IlBoolean value that, if IlTrue, indicates that the transformer is not reversible.
IlBoolean IlvTransformer::isIdentity (  )  const

Indicates whether the current object represents the identity transformation.

Indicates whether the current object represents the identity transformation; that is, a transformation that does not change its operands.

Returns:
IlTrue if the current object represents the identity transformation. Otherwise, it returns IlFalse.
IlBoolean IlvTransformer::isScale (  )  const

Indicates whether the current object is a scaling transformation.

Indicates whether the current object is a scaling transformation; that is, a transformation that applies itself without changing the definition axis of the operands. If it returns IlFalse the transformer is more complex (for example, a rotation, or a shearing effect).

Returns:
IlTrue if the current object is a scaling transformation. Otherwise, it returns IlFalse.
IlBoolean IlvTransformer::isTranslation (  )  const

Indicates whether the current object is a translation transformation.

Indicates whether the current object is a translation transformation; that is, a transformation that applies itself without changing the direction and dimensions of its operands.

Returns:
IlTrue if the current object is a translation transformation. Otherwise, it returns IlFalse.
void IlvTransformer::rotate ( IlvTransfoParam  centerx,
IlvTransfoParam  centery,
IlvTransfoParam  angle 
)

Composes the transformer with a rotation.

Composes the current transformer with a rotation of angle degrees around the (centerx, centery) point.x

Parameters:
centerx Center of rotation in the x direction.
centery Center of rotation in the y direction.
angle Angle of rotation in degrees.
void IlvTransformer::scale ( IlvTransfoParam  fixedx,
IlvTransfoParam  fixedy,
IlvTransfoParam  sx,
IlvTransfoParam  sy 
)

Composes the transformer with a scaling operation.

Composes the current transformer with a scaling operation of sx by sy, leaving the point (fixedx, fixedy) unchanged.

Parameters:
fixedx x point to leave unchanged.
fixedy y point to leave unchanged.
sx Scaling in the x direction.
sy Scaling in the y direction.
void IlvTransformer::setValues ( IlvTransfoParam  m11,
IlvTransfoParam  m12,
IlvTransfoParam  m21,
IlvTransfoParam  m22,
IlvTransfoParam  x0,
IlvTransfoParam  y0 
)

Sets the values that define the current IlvTransformer object.

Changes the values that define the current IlvTransformer object.

void IlvTransformer::setValues ( IlvTransfoParam  x0,
IlvTransfoParam  y0 
)

Sets the values that define the current IlvTransformer object.

Changes the values that define the current IlvTransformer object.

void IlvTransformer::translate ( IlvTransfoParam  dx,
IlvTransfoParam  dy 
)

Composes the transformer with a translation.

Composes the current transformer with a (dx, dy) translation.

Parameters:
dx Distance to translate in the x direction.
dy Distance to translate in the y direction.

© 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.