Mathematics 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(CATMathLine2D&)
- Constructs a reflection.
- o
CATMathTransformation2D(double[],double[])
-
- o
CATMathTransformation2D(CATMathVector2D&)
- Constructs a translation.
- o
CATMathTransformation2D(CATMathTransformation2D&)
- Copy constructor.
- o
CATMathTransformation2D(CATMathAxis2D&,CATMathAxis2D&)
- Constructs a tranformation of axes systems.
- o
CATMathTransformation2D(CATMath2x2Matrix&,CATMathVector2D&)
- Constructs from a CATMath2x2Matrix and a CATMathVector2D.
- o
CATMathTransformation2D(double,CATMathPoint2D&,CATMathTransfoType)
- Constructs a CATMathTansformation2D from a scalar and a CATMathPoint2D.
Method Index
- o
ApplyTo(CATMathLine2D&,CATMathLine2D&)
-
- o
ApplyTo(CATMathAxis2D&,CATMathAxis2D&)
-
- o
ApplyToAxis(CATMathAxis2D&,CATMathAxis2D&)
- Computes the CATMathAxis transformation.
- o
ApplyToLine(CATMathLine2D&,CATMathLine2D&)
- Computes the CATMathLine2D transformation.
- 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
Set(double[],double[])
- Modifies the CATMathTransformation2D that transforms 3 2D points
into 3 new 2D points.
- 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 | iReflectLine) |
-
Constructs a reflection.
o CATMathTransformation2D
public CATMathTransformation2D( | const | iFrom, |
| const | iTo) |
-
- Deprecated:
- V5R20 Set
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.
o CATMathTransformation2D
public CATMathTransformation2D( | const | iTranslation) |
-
Constructs a translation.
o CATMathTransformation2D
public CATMathTransformation2D( | const | iTransfoToCopy) |
-
Copy constructor.
o CATMathTransformation2D
public CATMathTransformation2D( | const | iFromAxis, |
| const | iToAxis) |
-
Constructs a tranformation of axes systems.
o CATMathTransformation2D
public CATMathTransformation2D( | const | iMatrix, |
| const | iVector) |
-
Constructs from a CATMath2x2Matrix and a CATMathVector2D.
o CATMathTransformation2D
public CATMathTransformation2D( | const | iA, |
| const | iCenter, |
| const | iType | = CATMathScaling) |
-
Constructs a CATMathTansformation2D from a scalar and a CATMathPoint2D.
- Returns:
- If iType== CATMathScaling
If iType== CATMathRotation, iA is in radians.
Matrix= | cos(iA) | -sin(iA) |
| sin(iA) | cos(iA) |
Methods
o ApplyTo
public ApplyTo( | const | iLineToTransfo, |
| | oLine) |
-
- Deprecated:
- V5R21 ApplyToLine
Computes the CATMathLine2D transformation.
- Parameters:
-
- iLineToTransfo
- The CATMathLine2D of origin
- oLine
- The transformed CATMathLine2D
Note that it could change the length if the transformation is not an isometry.
- Returns:
- E_FAIL if an error occurs, S_OK otherwise.
o ApplyTo
public ApplyTo( | const | iAxisToTransfo, |
| | oAxis) |
-
- Deprecated:
- V5R21 ApplyToAxis
Computes the CATMathAxis transformation.
- Parameters:
-
- iAxisToTransfo
- The CATMathAxis2D of origin
- oAxis
- The transformed CATMathAxis2D
Note that the directions of the transformated axis are re-orthonormalized.
- Returns:
- E_FAIL if an error occurs, S_OK otherwise.
o ApplyToAxis
public ApplyToAxis( | const | p, |
| | oAxis) |
-
Computes the CATMathAxis transformation.
- Parameters:
-
- iAxisToTransfo
- The CATMathAxis2D of origin
- oAxis
- The transformed CATMathAxis2D
Note that the directions of the transformated axis are re-orthonormalized.
- Returns:
- E_FAIL if an error occurs, S_OK otherwise.
o ApplyToLine
public ApplyToLine( | const | l, |
| | oLine) |
-
Computes the CATMathLine2D transformation.
- Parameters:
-
- iLineToTransfo
- The CATMathLine2D of origin
- oLine
- The transformed CATMathLine2D
Note that it could change the length if the transformation is not an isometry.
- Returns:
- E_FAIL if an error occurs, S_OK otherwise.
o GetCoef
-
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 GetMatrix( | | ioMatrix) |
-
Returns the CATMath2x2Matrix associated with this CATMathTransformation2D.
o GetVector
public GetVector( | | ioVector) |
-
Returns the CATMathVector2D associated with this CATMathTransformation2D.
o Inverse
public Inverse( | | ioInverse) |
-
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
-
Tests whether this transformation is direct.
- Returns:
-
- FALSE
- if it is indirect.
- TRUE
- if it is direct.
o IsIsometry
-
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 IsRotation( | | ioAngle, |
| | ioCenter) |
-
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 IsScaling( | | oOrigin, |
| | oScale) |
-
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
-
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 IsSimilitude( | | oScale) |
-
Retrieves the scale of this CATMathTransformation2D.
- Returns:
-
- FALSE
- if it is not an similitude.
- TRUE
- if it is a similitude.
o Set
public Set( | const | iFrom, |
| const | iTo) |
-
Modifies the CATMathTransformation2D 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.
- Returns:
- E_FAIL if an error occurs, S_OK otherwise.
o SetCoef
public SetCoef( | const | 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 SetMatrix( | const | iMatrix) |
-
Sets the matrix of this CATMathTransformation2D.
o SetVector
public SetVector( | const | 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 © 1999-2014, Dassault Systèmes. All rights reserved.