Mathematics CATMathTransformation

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


public class CATMathTransformation

Class representing a transformation in dimension 3.

It is composed of a matrix Matrix, and of a translation Vector.
Matrix= a11 a12 a13 Vector= u1
a21 a22 a23 u2
a31 a32 a33 u3

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


Constructor and Destructor Index


o CATMathTransformation()
Constructs an Identity transformation.
o CATMathTransformation(double[],CATLONG32)
o CATMathTransformation(CATMathPlane&)
Constructs a reflection on a plane.
o CATMathTransformation(CATMathVector&)
Constructs a translation.
o CATMathTransformation(CATMathPlane&,double)
Constructs an affinity with respect to a plane.
o CATMathTransformation(CATMathPoint&,double)
Constructs a scaling.
o CATMathTransformation(CATMathAxis&,double[])
Constructs an affinity with respect to a given ratio for each direction of a CATMathAxis.
o CATMathTransformation(CATMathTransformation&)
Copy constructor.
o CATMathTransformation(CATAngle&,CATMathLine&)
Constructs a rotation (radians).
o CATMathTransformation(CATMathAxis&,CATMathAxis&)
o CATMathTransformation(CATMathPoint&,CATMathVector&)
Constructs a reflection from a CATMathPoint and a CATMathVector.
o CATMathTransformation(CATMath3x3Matrix&,CATMathVector&)
Constructs a CATMathTransformation from a CATMath3x3Matrix and a CATMathVector.
o CATMathTransformation(double,CATMathTransformation&,CATMathTransformation&)

Method Index


o ApplyTo(CATMathLine&,CATMathLine&)
o ApplyTo(CATMathAxis&,CATMathAxis&)
o ApplyTo(CATMathPlane&,CATMathPlane&)
o ApplyToAxis(CATMathAxis&,CATMathAxis&)
Computes the CATMathAxis transformation.
o ApplyToLine(CATMathLine&,CATMathLine&)
Computes the CATMathLine transformation.
o ApplyToPlane(CATMathPlane&,CATMathPlane&)
Computes the CATMathPlane transformation.
o ComputeInverse(CATMathTransformation&)
Retrieves the inverse of this CATMathTransformation.
o Dump(ostream*)
Dumps this CATMathTransformation.
o GetCoef(double[],CATLONG32)
o GetCoefficients(double[],CATLONG32)
Retrieves the coefficients of this CATMathTransformation in an array[] of doubles.
o GetMatrix(CATMath3x3Matrix&)
Retrieves the CATMath3x3Matrix associated with this CATMathTransformation.
o GetVector(CATMathVector&)
Retrieves the CATMathVector associated with this CATMathTransformation.
o Inverse(CATMathTransformation&)
o IsIdentity()
Tests if the matrix of this CATMathTransformation is the identity (invariant).
o IsIsometry()
Tests if the matrix of this CATMathTransformation is an isometry (keeps the distances).
o IsReflection(CATMathPlane&)
Tests if this CATMathTransformation is a reflection and retrieves the reflect plane.
o IsRotation(CATAngle&,CATMathLine&,double)
Tests if the matrix of this CATMathTransformation is a rotation and retrieves the axis and the angle in radian.
o IsScaling(CATMathPoint&,double&)
Tests if this CATMathTransformation is a scaling and retrieves the Origin and the Scale.
o IsSimilitude(double&)
Tests if the matrix of this CATMathTransformation is a similitude and retrieves the scale.
o Set(CATMathAxis&,CATMathAxis&)
Set an transformation of axis systems.
o Set(double,CATMathTransformation&,CATMathTransformation&)
Set an interpolation of an isometry.
o SetCoef(double[],CATLONG32)
o SetCoefficients(double[],CATLONG32)
Modifies the coefficients of this CATMathTransformation from an array[] of doubles.
o SetFromAxisToOIJK(CATMathAxis&)
Set an transformation of axis systems.
o SetFromOIJKToAxis(CATMathAxis&)
Set an transformation of axis systems.
o SetMatrix(CATMath3x3Matrix&)
Sets the matrix of this CATMathTransformation.
o SetVector(CATMathVector&)
Sets the vector of this CATMathTransformation.

Constructor and Destructor


o CATMathTransformation
public CATMathTransformation()
Constructs an Identity transformation.
Matrix= Identity, Vector = (0,0,0)
o CATMathTransformation
public CATMathTransformation( const iCoeff,
const iNbCoeff= 12)
Deprecated:
V5R20 SetCoefficients Throws an error if iNbCoeff value is not 12 or 16.
Constructs a transformation from an array[] of doubles.
If iNbCoeff=12, the array is:
iCoeff a11 a12 a13 u1
a21 a22 a23 u2
a31 a32 a33 u3
and the coefficients must be given COLUMN by COLUMN.
If iNbCoeff=16, DO NOT USE- the array is:
iCoeff a11 a12 a13 u1
a21 a22 a23 u2
a31 a32 a33 u3
0 0 0 1
and the coefficients must be given COLUMN by COLUMN.
o CATMathTransformation
public CATMathTransformation( const iReflectPlane)
Constructs a reflection on a plane.
o CATMathTransformation
public CATMathTransformation( const iTranslation)
Constructs a translation.
o CATMathTransformation
public CATMathTransformation( const iPlane,
const iScale)
Constructs an affinity with respect to a plane.
o CATMathTransformation
public CATMathTransformation( const iCenter,
const iScale)
Constructs a scaling.
o CATMathTransformation
public CATMathTransformation( const iAxis,
const iRatio)
Constructs an affinity with respect to a given ratio for each direction of a CATMathAxis.
Parameters:
iAxis
The three direction of the affinity.
iRatio
Array of 3 doubles, giving the ratio in each direction.
o CATMathTransformation
public CATMathTransformation( const iTransfoToCopy)
Copy constructor.
o CATMathTransformation
public CATMathTransformation( const iAngle,
const iAxis)
Constructs a rotation (radians).
Parameters:
iAngle
The angle in radians.
iAxis
The rotation axis.
o CATMathTransformation
public CATMathTransformation( const iFromAxis,
const iToAxis)
Deprecated:
V5R15 Set Constructs a transformation of axis systems.
This transformation transforms, in the global axis system CATMathOIJK, the coordinates of a point M into the coordinates of the point TM such that: M and TM have the same coordinate values in the axis iFromAxis and iToAxis.
Now, for defining the transformation from iFromAxis to iToAxis, you have to combine two transformations, in the following way: CATMathTransformation(iToAxis, CATMathOIJK) * CATMathTransformation(CATMathOIJK, iFromAxis)
o CATMathTransformation
public CATMathTransformation( const iReflectPlaneOrigin,
const iReflectPlaneNormal)
Constructs a reflection from a CATMathPoint and a CATMathVector.
o CATMathTransformation
public CATMathTransformation( const iMatrix,
const iTranslation)
Constructs a CATMathTransformation from a CATMath3x3Matrix and a CATMathVector.
o CATMathTransformation
public CATMathTransformation( const iFactor,
const iFromTansfo,
const iToTransfo)
Deprecated:
V5R15 Set Creates an interpolation of an isometry.
This can be used for simulating intermediate steps of a displacement.
Throws an error if the two transformations are not compatible.
Parameters:
iFactor
The ratio of the intermediate step: 0 < iFactor < 1.

Methods


o ApplyTo
public ApplyTo( const iLineToTransfo,
oLine)
Deprecated:
V5R21 ApplyToLine Computes the CATMathLine transformation.
Parameters:
iLineToTransfo
The CATMathLine of origin
oLine
The transformed CATMathLine 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 CATMathAxis of origin
oAxis
The transformed CATMathAxis Note that the second and third directions of the transformated axis are re-orthonormalized.
Returns:
E_FAIL if an error occurs, S_OK otherwise.
o ApplyTo
public ApplyTo( const iPlaneToTransfo,
oPlane)
Deprecated:
V5R21 ApplyToPlane Computes the CATMathPlane transformation.
Parameters:
iPlaneToTransfo
The CATMathPlane of origin
oPlane
The transformed planed Note that the second direction of the transformated plane is re-orthonormalized.
Returns:
E_FAIL if an error occurs, S_OK otherwise.
o ApplyToAxis
public ApplyToAxis( const iAxisToTransfo,
oAxis)
Computes the CATMathAxis transformation.
Parameters:
iAxisToTransfo
The CATMathAxis of origin
oAxis
The transformed CATMathAxis Note that the second and third directions of the transformated axis are re-orthonormalized.
Returns:
E_FAIL if an error occurs, S_OK otherwise.
o ApplyToLine
public ApplyToLine( const iLineToTransfo,
oLine)
Computes the CATMathLine transformation.
Parameters:
iLineToTransfo
The CATMathLine of origin
oLine
The transformed CATMathLine 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 ApplyToPlane
public ApplyToPlane( const iPlaneToTransfo,
oPlane)
Computes the CATMathPlane transformation.
Parameters:
iPlaneToTransfo
The CATMathPlane of origin
oPlane
The transformed planed Note that the second direction of the transformated plane is re-orthonormalized.
Returns:
E_FAIL if an error occurs, S_OK otherwise.
o ComputeInverse
public ComputeInverse( ioInverse)
Retrieves the inverse of this CATMathTransformation.
Returns:
S_OK if this CATMathTransformation is invertible, E_FAIL otherwise. In this last case, oInverse is not modified.
o Dump
public Dump( iStream=0L)
Dumps this CATMathTransformation.
This writes the following lines on the ostream:
Matrix= | iA11 iA12 iA13 |
| iA21 iA22 iA23 |
| iA31 iA32 iA33 |
Translation= ( FirstCoord,SecondCoord, ThirdCoord)
Parameters:
iStream
A pointer to the output. If 0L, the method dumps on the cout output.
o GetCoef
public GetCoef( iCoeff,
const iNbCoeff= 12)
Deprecated:
V5R15 GetCoefficients Throws an error if iNbCoeff value is not 12 or 16.
Retrieves the coefficients of this CATMathTransformation in an array[] of doubles.
If iNbCoeff=12, the array is:
oCoeff a11 a12 a13 u1
a21 a22 a23 u2
a31 a32 a33 u3
and the coefficients are given COLUMN by COLUMN.
If iNbCoeff=16, DO NOT USE - and the array is:
oCoeff a11 a12 a13 u1
a21 a22 a23 u2
a31 a32 a33 u3
0 0 0 1
and the coefficients are given COLUMN by COLUMN.
o GetCoefficients
public GetCoefficients( iCoeff,
const iNbCoeff= 12)
Retrieves the coefficients of this CATMathTransformation in an array[] of doubles.
If iNbCoeff=12, the array is:
oCoeff a11 a12 a13 u1
a21 a22 a23 u2
a31 a32 a33 u3
and the coefficients are given COLUMN by COLUMN.
If iNbCoeff=16, DO NOT USE - and the array is:
oCoeff a11 a12 a13 u1
a21 a22 a23 u2
a31 a32 a33 u3
0 0 0 1
and the coefficients are given COLUMN by COLUMN.
Returns:
E_FAIL if iNbCoeff value is not 12 or 16, S_OK otherwise.
o GetMatrix
public GetMatrix( ioMatrix)
Retrieves the CATMath3x3Matrix associated with this CATMathTransformation.
o GetVector
public GetVector( ioVector)
Retrieves the CATMathVector associated with this CATMathTransformation.
o Inverse
public Inverse( ioInverse)
Deprecated:
V5R15 ComputeInverse Retrieves the inverse of this CATMathTransformation.
Returns:
TRUE if this CATMathTransformation is invertible, FALSE otherwise. In this last case, oInverse is not modified.
o IsIdentity
public IsIdentity()
Tests if the matrix of this CATMathTransformation is the identity (invariant).
Returns:
FALSE
if it is not the identity.
TRUE
if it is the identity.
o IsIsometry
public IsIsometry()
Tests if the matrix of this CATMathTransformation is an isometry (keeps the distances). return
FALSE
if it is not an isometry.
TRUE
if it is a direct isometry.
o IsReflection
public IsReflection( ioReflectPlane)
Tests if this CATMathTransformation is a reflection and retrieves the reflect plane.
Returns:
FALSE
if it is not a reflection.
TRUE
if it is a reflection.
o IsRotation
public IsRotation( ioAngle,
ioAxis,
const iTol= 0.)
Tests if the matrix of this CATMathTransformation is a rotation and retrieves the axis and the angle in radian.
Returns:
FALSE
if it is not a rotation.
TRUE
if it is a rotation.
o IsScaling
public IsScaling( ioOrigin,
ioScale)
Tests if this CATMathTransformation 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 IsSimilitude( ioScale)
Tests if the matrix of this CATMathTransformation is a similitude and retrieves the scale.
Returns:
FALSE
if it is not a similitude.
TRUE
if it is a similitude.
o Set
public Set( const iFromAxis,
const iToAxis)
Set an transformation of axis systems.
This transformation transforms, in the global axis system CATMathOIJK, the coordinates of a point M into the coordinates of the point TM such that: M and TM have the same coordinate values in the axis iFromAxis and iToAxis.
Now, for defining the transformation from iFromAxis to iToAxis, you have to combine two transformations, in the following way: CATMathTransformation(iToAxis, CATMathOIJK) * CATMathTransformation(CATMathOIJK, iFromAxis)
Returns:
E_FAIL if an error occurs, S_OK otherwise.
o Set
public Set( const iFactor,
const iFromTansfo,
const iToTransfo)
Set an interpolation of an isometry.
This can be used for simulating intermediate steps of a displacement.
Parameters:
iFactor
The ratio of the intermediate step: 0 < iFactor < 1.
Returns:
E_FAIL if the two transformations are not compatible, S_OK otherwise.
o SetCoef
public SetCoef( const iCoeff,
const iNbCoeff= 12)
Deprecated:
V5R15 SetCoefficients Throws an error if iNbCoeff value is not 12 or 16.
Modifies the coefficients of this CATMathTransformation from an array[] of doubles.
If iNbCoeff=12, the array is:
iCoeff a11 a12 a13 u1
a21 a22 a23 u2
a31 a32 a33 u3
and the coefficients must be given COLUMN by COLUMN.
If iNbCoeff=16, DO NOT USE - the array is:
iCoeff a11 a12 a13 u1
a21 a22 a23 u2
a31 a32 a33 u3
0 0 0 1
and the coefficients must be given COLUMN by COLUMN.
o SetCoefficients
public SetCoefficients( const iCoeff,
const iNbCoeff= 12)
Modifies the coefficients of this CATMathTransformation from an array[] of doubles.
If iNbCoeff=12, the array is:
iCoeff a11 a12 a13 u1
a21 a22 a23 u2
a31 a32 a33 u3
and the coefficients must be given COLUMN by COLUMN.
If iNbCoeff=16, DO NOT USE - the array is:
iCoeff a11 a12 a13 u1
a21 a22 a23 u2
a31 a32 a33 u3
0 0 0 1
and the coefficients must be given COLUMN by COLUMN.
Returns:
E_FAIL if iNbCoeff value is not 12 or 16, S_OK otherwise.
o SetFromAxisToOIJK
public SetFromAxisToOIJK( const iFromAxis)
Set an transformation of axis systems.
This transformation transforms the coordinates of a point M in the axis iFromAxis into the coordinates of the point TM in the global axis system CATMathOIJK.
Returns:
E_FAIL if an error occurs, S_OK otherwise.
o SetFromOIJKToAxis
public SetFromOIJKToAxis( const iToAxis)
Set an transformation of axis systems.
This transformation transforms the coordinates of a point M in the global axis system CATMathOIJK into the coordinates of the point TM in the axis iToAxis.
Returns:
E_FAIL if an error occurs, S_OK otherwise.
o SetMatrix
public SetMatrix( const iMatrix)
Sets the matrix of this CATMathTransformation.
o SetVector
public SetVector( const iVector)
Sets the vector of this CATMathTransformation.

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

Copyright © 1999-2014, Dassault Systèmes. All rights reserved.