Public Member Functions
CTransformation Class Reference

Detailed Description

This object represents a transformation which is the result of the combination of a Scaling, a Rotation and a Translation, in the S.R.T order.

See also:
CMatrix3, CMatrix4, CQuaternion, CVector3, CRotation
Example:
        using namespace XSI;
        using namespace MATH;
        Application app;
        Model root = app.GetActiveSceneRoot();

        X3DObject myCube;
        root.AddGeometry( L"Cube", L"MeshSurface",L"",myCube );

        KinematicState  globalKinematicState = myCube.GetKinematics().GetGlobal();
        globalKinematicState.PutParameterValue(L"posy", 4.0);
        globalKinematicState.PutParameterValue(L"posx", 2.0);

        X3DObject myCube2;
        myCube.AddGeometry( L"Cube", L"MeshSurface",L"",myCube2);

        globalKinematicState = myCube2.GetKinematics().GetGlobal();
        globalKinematicState.PutParameterValue(L"posz",3.0);
        globalKinematicState.PutParameterValue(L"rotx",45.0);

        CTransformation localTransformation =
                                myCube.GetKinematics().GetLocal().GetTransform();
        CTransformation globalTransformation = globalKinematicState.GetTransform();

        CVector3 translation(localTransformation.GetTranslation());

        app.LogMessage(L"The translation of the cube relative to its parent: x " +
                        CValue(translation.GetX()).GetAsText() +
                        L" y " +
                        CValue(translation.GetY()).GetAsText() +
                        L" z " +
                        CValue(translation.GetZ()).GetAsText());

        MapObjectPoseToWorldSpace(  globalTransformation, localTransformation);

        translation = localTransformation.GetTranslation();

        app.LogMessage(L"The translation of the cube relative to the origin of the universe: x " +
                      CValue(translation.GetX()).GetAsText() +
                      L" y " + CValue(translation.GetY()).GetAsText() +
                      L" z " + CValue(translation.GetZ()).GetAsText());

#include <xsi_transformation.h>

List of all members.

Public Member Functions

 CTransformation ()
 CTransformation (const CTransformation &in_transformation)
 ~CTransformation ()
CTransformationoperator= (const CTransformation &in_transformation)
CMatrix4 GetMatrix4 () const
void SetMatrix4 (const CMatrix4 &in_matrix4)
CTransformationSetRotation (const CRotation &in_Rotation)
CRotation GetRotation () const
CTransformationSetRotX (const double &in_dX)
double GetRotX () const
CTransformationSetRotY (const double &in_dY)
double GetRotY () const
CTransformationSetRotZ (const double &in_dZ)
double GetRotZ () const
void PutRotationOrder (CRotation::RotationOrder in_Order)
CRotation::RotationOrder GetRotationOrder () const
CTransformationSetRotationFromXYZAnglesValues (double in_dX, double in_dY, double in_dZ, CRotation::RotationOrder in_Order)
CTransformationSetRotationFromXYZAnglesValues (double in_dX, double in_dY, double in_dZ)
void GetRotationFromXYZAnglesValues (double &io_dX, double &io_dY, double &io_dZ) const
CTransformationMulInPlace (const CTransformation &in_transformation)
CTransformationMul (const CTransformation &in_transformationA, const CTransformation &in_transformationB)
CTransformationAddParentTranslation (const CVector3 &in_vector3)
CTransformationAddLocalTranslation (const CVector3 &in_vector3)
CTransformationAddParentScaling (const CVector3 &in_vector3)
CTransformationAddLocalScaling (const CVector3 &in_vector3)
CTransformationSetRotationFromXYZAxes (const CVector3 &in_vector3X, const CVector3 &in_vector3Y, const CVector3 &in_vector3Z)
CTransformationSetTranslationFromValues (double in_dX, double in_dY, double in_dZ)
void GetTranslationValues (double &io_dX, double &io_dY, double &io_dZ) const
CTransformationSetScalingFromValues (double in_dX, double in_dY, double in_dZ)
void GetScalingValues (double &io_dX, double &io_dY, double &io_dZ) const
void GetScalingOrientationXYZAngles (double &io_dX, double &io_dY, double &io_dZ) const
CTransformationSetScalingOrientationFromXYZAngles (double in_dX, double in_dY, double in_dZ)
bool HasScalingOrientation () const
CTransformationSetIdentity ()
CTransformationSetTranslation (const CVector3 &in_vector3)
CVector3 GetTranslation () const
CTransformationSetPosX (const double &in_dX)
double GetPosX () const
CTransformationSetPosY (const double &in_dY)
double GetPosY () const
CTransformationSetPosZ (const double &in_dZ)
double GetPosZ () const
CTransformationSetRotationFromAxisAngle (const CVector3 &in_vector3, double in_dAngle)
CTransformationSetRotationFromXYZAngles (const CVector3 &in_vector3)
double GetRotationAxisAngle (CVector3 &io_vector3) const
CVector3 GetRotationXYZAngles () const
CTransformationSetScaling (const CVector3 &in_vector3)
CVector3 GetScaling () const
CTransformationSetSclX (const double &in_dX)
double GetSclX () const
CTransformationSetSclY (const double &in_dY)
double GetSclY () const
CTransformationSetSclZ (const double &in_dZ)
double GetSclZ () const
CTransformationSetRotationFromMatrix3 (const CMatrix3 &in_matrix3)
CMatrix3 GetRotationMatrix3 () const
CTransformationSetRotationFromQuaternion (const CQuaternion &in_quaternion)
CQuaternion GetRotationQuaternion (void) const
CTransformationInvertInPlace ()
CTransformationInvert (const CTransformation &in_transfo)
bool EpsilonEquals (const CTransformation &in_transformation, double in_dEpsilon) const
bool Equals (const CTransformation &in_transformation) const
bool operator== (const CTransformation &in_transformation) const
bool operator!= (const CTransformation &in_transformation) const

Constructor & Destructor Documentation

Default constructor.

CTransformation ( const CTransformation in_transformation)

Copy constructor.

Parameters:
in_transformationconstant class object.

Default destructor.


Member Function Documentation

CTransformation& operator= ( const CTransformation in_transformation)

Assignment operator.

Parameters:
in_transformationconstant class object.
Returns:
A reference to this transformation.
CMatrix4 GetMatrix4 ( ) const

Returns the matrix representation values .

Returns:
The transformation values.
void SetMatrix4 ( const CMatrix4 in_matrix4)

Sets the matrix representation values of this transformation from the matrix in_matrix4.

Parameters:
in_matrix4matrix operand.
CTransformation& SetRotation ( const CRotation in_Rotation)

Sets the rotation

Parameters:
in_RotationSource rotation
Returns:
A reference to this transformation.
CRotation GetRotation ( ) const

Returns the rotation

Returns:
CRotation
CTransformation& SetRotX ( const double &  in_dX)

Sets the rotation angle (in degrees) around the X axis of this transformation.

Parameters:
in_dXRotation around X.
Returns:
A reference to this transformation.
Since:
5.1
double GetRotX ( ) const

Returns the rotation angle (in degrees) around the X axis of this transformation.

Returns:
A double containing the rotation angle around X.
Since:
5.1
CTransformation& SetRotY ( const double &  in_dY)

Sets the rotation angle (in degrees) around the Y axis of this transformation.

Parameters:
in_dYRotation around Y.
Returns:
A reference to this transformation.
Since:
5.1
double GetRotY ( ) const

Returns the rotation angle (in degrees) around the Y axis of this transformation.

Returns:
A double containing the rotation angle around Y.
Since:
5.1
CTransformation& SetRotZ ( const double &  in_dZ)

Sets the rotation angle (in degrees) around the Z axis of this transformation.

Parameters:
in_dZRotation around Z.
Returns:
A reference to this transformation.
Since:
5.1
double GetRotZ ( ) const

Returns the rotation angle (in degrees) around the Z axis of this transformation.

Returns:
A double containing the rotation angle around Z.
Since:
5.1
void PutRotationOrder ( CRotation::RotationOrder  in_Order)

Sets the rotation order. Softimage uses the CRotation::siXYZ order by default. The rotation order is usually changed in order to fix Gimbal locks or to reuse data from a module using a different rotation order.

Parameters:
in_OrderNew rotation order to use
See also:
CTransformation::GetRotationOrder
CRotation::RotationOrder GetRotationOrder ( ) const

Returns the current rotation order.

Returns:
The rotation order
See also:
CTransformation::PutRotationOrder
CTransformation& SetRotationFromXYZAnglesValues ( double  in_dX,
double  in_dY,
double  in_dZ,
CRotation::RotationOrder  in_Order 
)

Sets the Euler angles of the rotation and rotation order. Softimage uses the CRotation::siXYZ order by default. The rotation order is usually changed in order to fix Gimbal locks or to reuse data from a module using a different rotation order. Most users can use the overloaded function without the rotation order parameter if they work exclusively with Softimage.

Parameters:
in_dXX euler angle value
in_dYY euler angle value
in_dZZ euler angle value
in_OrderRotation order
Returns:
A reference to this transformation.
See also:
CTransformation::PutRotationOrder, CTransformation::GetRotationOrder
CTransformation& SetRotationFromXYZAnglesValues ( double  in_dX,
double  in_dY,
double  in_dZ 
)

Sets the Euler angles of the rotation

Note:
This function does not change the rotation order. You can use the overloaded version of this function to set the rotation order
Parameters:
in_dXX euler angle value
in_dYY euler angle value
in_dZZ euler angle value
Returns:
A reference to this transformation.
void GetRotationFromXYZAnglesValues ( double &  io_dX,
double &  io_dY,
double &  io_dZ 
) const

Returns the Euler angle values of the rotation.

Parameters:
io_dXX euler angle value
io_dYY euler angle value
io_dZZ euler angle value
CTransformation& MulInPlace ( const CTransformation in_transformation)

Combines this transformations with in_transformation then stores the result in this transformation

Parameters:
in_transformationtransformation operand
Returns:
A reference to this transformation.
CTransformation& Mul ( const CTransformation in_transformationA,
const CTransformation in_transformationB 
)

Combines the transformations A and B then stores the result in this transformation.

Parameters:
in_transformationAtransformation operand
in_transformationBtransformation operand
Returns:
A reference to this transformation.
CTransformation& AddParentTranslation ( const CVector3 in_vector3)

Applies a translation defined in the parent space of this transformation.

Parameters:
in_vector3translation vector.
Returns:
A reference to this transformation.
CTransformation& AddLocalTranslation ( const CVector3 in_vector3)

Applies a translation defined in the local space of this transformation.

Parameters:
in_vector3translation vector.
Returns:
A reference to this transformation.
CTransformation& AddParentScaling ( const CVector3 in_vector3)

Applies a scaling defined in the parent space of this transformation.

Parameters:
in_vector3scaling vector.
Returns:
A reference to this transformation.
CTransformation& AddLocalScaling ( const CVector3 in_vector3)

Applies a scaling defined in the local space of this transformation.

Parameters:
in_vector3scaling vector.
Returns:
A reference to this transformation.
CTransformation& SetRotationFromXYZAxes ( const CVector3 in_vector3X,
const CVector3 in_vector3Y,
const CVector3 in_vector3Z 
)

Sets the rotation part of this transformation from three orthonormal axes. No verification is performed about their orthonormality.

Parameters:
in_vector3Xunitary X axis (orthogonal to Y and Z)
in_vector3Yunitary Y axis (orthogonal to X and Z)
in_vector3Zunitary Z axis (orthogonal to X and Y)
Returns:
A reference to this transformation.
CTransformation& SetTranslationFromValues ( double  in_dX,
double  in_dY,
double  in_dZ 
)

Sets the translation of this transformation.

Parameters:
in_dXtranslation in X.
in_dYtranslation in Y.
in_dZtranslation in Z.
Returns:
A reference to this transformation.
void GetTranslationValues ( double &  io_dX,
double &  io_dY,
double &  io_dZ 
) const

Returns the translation values of this transformation.

Parameters:
io_dXtranslation in X.
io_dYtranslation in Y.
io_dZtranslation in Z.
CTransformation& SetScalingFromValues ( double  in_dX,
double  in_dY,
double  in_dZ 
)

Sets the scaling of this transformation.

Parameters:
in_dXscaling in X.
in_dYscaling in Y.
in_dZscaling in Z.
Returns:
A reference to this transformation.
void GetScalingValues ( double &  io_dX,
double &  io_dY,
double &  io_dZ 
) const

Returns the scaling values of this transformation.

Parameters:
io_dXscaling in X.
io_dYscaling in Y.
io_dZscaling in Z.
void GetScalingOrientationXYZAngles ( double &  io_dX,
double &  io_dY,
double &  io_dZ 
) const

Returns the scaling orientation values of this transformation.

Parameters:
io_dXscaling in X.
io_dYscaling in Y.
io_dZscaling in Z.
CTransformation& SetScalingOrientationFromXYZAngles ( double  in_dX,
double  in_dY,
double  in_dZ 
)

Sets the scaling orientation angles of this transformation

Parameters:
in_dXscaling orientation X angle.
in_dYscaling orientation Y angle.
in_dZscaling orientation Z angle.
Returns:
A reference to this transformation.
bool HasScalingOrientation ( ) const

Returns whether this transformation has a valid scaling orientation.

Returns:
true if this transformation has a valid scaling orientation, else false.
CTransformation& SetIdentity ( )

Sets this transformation to identity.

Returns:
A reference to this transformation.
CTransformation& SetTranslation ( const CVector3 in_vector3)

Sets the translation of this transformation. The translation is defined by a CVector3.

Parameters:
in_vector3vector of translation.
Returns:
A reference to this transformation.
CVector3 GetTranslation ( ) const

Returns the translation vector of this transformation in a CVector3.

Returns:
The translation.
CTransformation& SetPosX ( const double &  in_dX)

Sets the X position of this transformation.

Parameters:
in_dXPosition in X.
Returns:
A reference to this transformation.
Since:
5.1
double GetPosX ( ) const

Returns the X position value of this transformation.

Returns:
A double containing the X position value.
Since:
5.1
CTransformation& SetPosY ( const double &  in_dY)

Sets the Y position of this transformation.

Parameters:
in_dYPosition in Y.
Returns:
A reference to this transformation.
Since:
5.1
double GetPosY ( ) const

Returns the Y position value of this transformation.

Returns:
A double containing the Y position value.
Since:
5.1
CTransformation& SetPosZ ( const double &  in_dZ)

Sets the Z position of this transformation.

Parameters:
in_dZPosition in Z.
Returns:
A reference to this transformation.
Since:
5.1
double GetPosZ ( ) const

Returns the Z position value of this transformation.

Returns:
A double containing the Z position value.
Since:
5.1
CTransformation& SetRotationFromAxisAngle ( const CVector3 in_vector3,
double  in_dAngle 
)

Sets the rotation part of this transformation by using the axis/angle representation.

Parameters:
in_vector3Axis of rotation.
in_dAngleAngle of rotation (in radians).
Returns:
A reference to this transformation.
CTransformation& SetRotationFromXYZAngles ( const CVector3 in_vector3)

Sets the X, Y and Z angles (in radians) of the rotation part of this transformation.

Parameters:
in_vector3vector containing X,Y and Z angles values(in radians).
Returns:
A reference to this transformation.
double GetRotationAxisAngle ( CVector3 io_vector3) const

Extracts the axis and angle from the rotation part of this transformation.

Parameters:
io_vector3Axis of rotation.
Returns:
Angle of rotation in radians as a double.
CVector3 GetRotationXYZAngles ( ) const

Extracts the X, Y and Z angles (in radians) from the rotation part of this transformation inside the CVector3.

Returns:
The rotation X,Y and Z angles (in radians) as a CVector3 object.
CTransformation& SetScaling ( const CVector3 in_vector3)

Sets the scaling of this transformation by getting the values from a CVector3.

Parameters:
in_vector3Vector containing X,Y and Z scaling values.
Returns:
A reference to this transformation.
CVector3 GetScaling ( ) const

Returns the scaling values of this transformation in a CVector3.

Returns:
A CVector3 containing the X,Y and Z scaling values.
CTransformation& SetSclX ( const double &  in_dX)

Sets the scaling in X of this transformation.

Parameters:
in_dXScaling in X.
Returns:
A reference to this transformation.
Since:
5.1
double GetSclX ( ) const

Returns the scaling value in X of this transformation.

Returns:
A double containing the X scaling value.
Since:
5.1
CTransformation& SetSclY ( const double &  in_dY)

Sets the scaling in Y of this transformation.

Parameters:
in_dYScaling in Y.
Returns:
A reference to this transformation.
Since:
5.1
double GetSclY ( ) const

Returns the scaling value in Y of this transformation.

Returns:
A double containing the Y scaling valus.
Since:
5.1
CTransformation& SetSclZ ( const double &  in_dZ)

Sets the scaling in Z of this transformation.

Parameters:
in_dZScaling in Z.
Returns:
A reference to this transformation.
Since:
5.1
double GetSclZ ( ) const

Returns the scaling value in Z of this transformation.

Returns:
A double containing the Z scaling value.
Since:
5.1
CTransformation& SetRotationFromMatrix3 ( const CMatrix3 in_matrix3)

Sets the rotation of this transformation by getting the values from a CMatrix3.

Parameters:
in_matrix33x3 matrix containing the rotation information to set this tranformation's rotation.
Returns:
A reference to this transformation.
CMatrix3 GetRotationMatrix3 ( ) const

Returns the 3x3 matrix representation of the rotation part of this transformation.

Returns:
A CMatrix3 object containing rotation of this transformation.
CTransformation& SetRotationFromQuaternion ( const CQuaternion in_quaternion)

Sets the rotation of this transformation by getting the values from a CQuaternion.

Parameters:
in_quaternionquaternion containing the rotation information to set this tranformation's rotation.
Returns:
A reference to this transformation.
CQuaternion GetRotationQuaternion ( void  ) const

Returns the rotation quaternion for this transformation.

Returns:
A CQuaternion containing rotation of this transformation.
CTransformation& InvertInPlace ( )

Inverts this CTransformation object

CTransformation& Invert ( const CTransformation in_transfo)

Inverts the given CTransformation object

Parameters:
in_transfotransformation to be inverted.
bool EpsilonEquals ( const CTransformation in_transformation,
double  in_dEpsilon 
) const

Tests the equality of this transformation with the specified transformation, with a tolerance of Epsilon.

Parameters:
in_transformationOperand transformation.
in_dEpsilonError margin Possible Values: [0, +INF[ should be a positive value
Returns:
true if equal else false.
bool Equals ( const CTransformation in_transformation) const

Tests the strict equality of this transformation with the specified transformation.

Parameters:
in_transformationOperand transformation.
Returns:
true if equal else false.
bool operator== ( const CTransformation in_transformation) const

Equality operator tests the strict equality of this transformation with the specified transformation.

Parameters:
in_transformationOperand transformation.
Returns:
true if equal else false.
See also:
CTransformation::Equals
bool operator!= ( const CTransformation in_transformation) const

Inequality operator tests the strict inequality of this matrix with the specified transform.

Parameters:
in_transformationOperand transformation.
Returns:
true if equal else false.
See also:
CTransformation::Equals

The documentation for this class was generated from the following file: