All Frameworks  Class Hierarchy  This Framework  Previous  Next  Indexes

Mathematics Class CATMathTransformation2D

CATMathTransformation2D
 

Usage: you must use this class as is. You should never derive it.


public class CATMathTransformation2D

Class representing a transformation in dimension 2.

It is composed of a matrix Matrix, and of a translation Vector.
Matrix= a11 a12 Vector= u1
a21 a22 u2

Apply transformations by using the * operator.
Available transformations are scaling, translation, reflection, rotation.


Constructor and Destructor Index


o CATMathTransformation2D()
Constructs an Identity transformation.
o CATMathTransformation2D(CATMath2x2Matrix&,CATMathVector2D&)
Constructs from a CATMath2x2Matrix and a CATMathVector2D.
o CATMathTransformation2D(CATMathAxis2D&,CATMathAxis2D&)
Constructs a tranformation of axes systems.
o CATMathTransformation2D(CATMathLine2D&)
Constructs a reflection.
o CATMathTransformation2D(CATMathTransformation2D&)
Copy constructor.
o CATMathTransformation2D(CATMathVector2D&)
Constructs a translation.
o CATMathTransformation2D(double,CATMathPoint2D&,CATMathTransfoType)
Constructs a CATMathTansformation2D from a scalar and a CATMathPoint2D.
o CATMathTransformation2D(double[],double[])
Constructs theCATMathTransformation2D that transforms 3 2D points into 3 new 2D points.

Method Index


o GetCoef(double[])
Retrieves the coefficients of this CATMathTransformation2D in an array[] of doubles.
o GetMatrix(CATMath2x2Matrix&)
Returns the CATMath2x2Matrix associated with this CATMathTransformation2D.
o GetVector(CATMathVector2D&)
Returns the CATMathVector2D associated with this CATMathTransformation2D.
o Inverse(CATMathTransformation2D&)
Retrieves the inverse of this CATMathTransformation2D.
o IsDirect()
Tests whether this transformation is direct.
o IsIsometry()
Tests whether this transformation is an isometry (keeps the distances).
o IsRotation(CATAngle&,CATMathPoint2D&)
Tests whether this transformation is a rotation and retrieves the center and the angle in radians.
o IsScaling(CATMathPoint2D&,double&)
Tests whether this transformation is a scaling and retrieves the Origin and the Scale.
o IsSimilitude()
Tests whether this transformation is a similitude (keeps the angles).
o IsSimilitude(double&)
Retrieves the scale of this CATMathTransformation2D.
o SetCoef(double[])
Retrieves the coefficients of this CATMathTransformation2D in an array[] of doubles.
o SetMatrix(CATMath2x2Matrix&)
Sets the matrix of this CATMathTransformation2D.
o SetVector(CATMathVector2D&)
Sets the vector of this CATMathTransformation2D.

Constructor and Destructor


o CATMathTransformation2D
public CATMathTransformation2D()
Constructs an Identity transformation.
Matrix= Identity, Vector = (0,0)
o CATMathTransformation2D
public CATMathTransformation2D( const CATMath2x2Matrix& iMatrix,
const CATMathVector2D& iVector)
Constructs from a CATMath2x2Matrix and a CATMathVector2D.
o CATMathTransformation2D
public CATMathTransformation2D( const CATMathAxis2D& iFromAxis,
const CATMathAxis2D& iToAxis)
Constructs a tranformation of axes systems.
o CATMathTransformation2D
public CATMathTransformation2D( const CATMathLine2D& iReflectLine)
Constructs a reflection.
o CATMathTransformation2D
public CATMathTransformation2D( const CATMathTransformation2D& iTransfoToCopy)
Copy constructor.
o CATMathTransformation2D
public CATMathTransformation2D( const CATMathVector2D& iTranslation)
Constructs a translation.
o CATMathTransformation2D
public CATMathTransformation2D( const double iA,
const CATMathPoint2D& iCenter,
const CATMathTransfoType iType= CATMathScaling)
Constructs a CATMathTansformation2D from a scalar and a CATMathPoint2D.
Returns:
If iType== CATMathScaling
Matrix= iA 0
0 iA
If iType== CATMathRotation, iA is in radians.
Matrix= cos(iA) -sin(iA)
sin(iA) cos(iA)
o CATMathTransformation2D
public CATMathTransformation2D( const double[] iFrom,
const double[] iTo)
Constructs theCATMathTransformation2D that transforms 3 2D points into 3 new 2D points.
The points must be different.
Parameters:
iFrom[]
The array of the six coordinates (Point1.x, Point1.y, Point2.x, Point2.y, Point3.x, Point3.y) of the initial points.
iTo[]
The array of the six coordinates: (Result1.x, Result1.y, Result2.x, Result2.y, Result3.x, Result3.y)of the resulting points.

Methods


o GetCoef
public void GetCoef(double[] iCoef) const
Retrieves the coefficients of this CATMathTransformation2D in an array[] of doubles.
The size of the array is 6. If the matrix is:
iCoeff a11 a12 u1
a21 a22 u2
the coefficients must be given COLUMN by COLUMN.
o GetMatrix
public void GetMatrix(CATMath2x2Matrix& ioMatrix) const
Returns the CATMath2x2Matrix associated with this CATMathTransformation2D.
o GetVector
public void GetVector(CATMathVector2D& ioVector) const
Returns the CATMathVector2D associated with this CATMathTransformation2D.
o Inverse
public CATBoolean Inverse(CATMathTransformation2D& ioInverse) const
Retrieves the inverse of this CATMathTransformation2D.
Returns:
TRUE if this CATMathTransformation2D is invertible, FALSE otherwise. In this last case, ioInverse is not modified.
o IsDirect
public CATBoolean IsDirect()const
Tests whether this transformation is direct.
Returns:
FALSE
if it is indirect.
TRUE
if it is direct.
o IsIsometry
public CATBoolean IsIsometry()const
Tests whether this transformation is an isometry (keeps the distances).
Returns:
FALSE
if it is not an isometry.
TRUE
if it is a direct isometry.
o IsRotation
public CATBoolean IsRotation(CATAngle& ioAngle,
CATMathPoint2D& ioCenter) const
Tests whether this transformation is a rotation and retrieves the center and the angle in radians.
Returns:
FALSE
if it is not a rotation.
TRUE
if it is a rotation.
o IsScaling
public CATBoolean IsScaling(CATMathPoint2D& oOrigin,
double& oScale) const
Tests whether this transformation is a scaling and retrieves the Origin and the Scale.
Returns:
FALSE
if it is not a scaling.
TRUE
if it is a scaling.
o IsSimilitude
public CATBoolean IsSimilitude()const
Tests whether this transformation is a similitude (keeps the angles).
Returns:
FALSE
if it is not an similitude.
TRUE
if it is a similitude.
o IsSimilitude
public CATBoolean IsSimilitude(double& oScale) const
Retrieves the scale of this CATMathTransformation2D.
Returns:
FALSE
if it is not an similitude.
TRUE
if it is a similitude.
o SetCoef
public void SetCoef( const double[] iCoeff)
Retrieves the coefficients of this CATMathTransformation2D in an array[] of doubles.
The size of the array is 6. If the matrix is:
iCoeff a11 a12 u1
a21 a22 u2
the coefficients must be given COLUMN by COLUMN.
o SetMatrix
public void SetMatrix( const CATMath2x2Matrix& iMatrix)
Sets the matrix of this CATMathTransformation2D.
o SetVector
public void SetVector( const CATMathVector2D& iVector)
Sets the vector of this CATMathTransformation2D.

This object is included in the file: CATMathTransformation2D.h
If needed, your Imakefile.mk should include the module: CATMathematics

Copyright © 2003, Dassault Systèmes. All rights reserved.