CTransformation Class Reference
 
 
 
CTransformation Class Reference

#include <xsi_transformation.h>


Class 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());

List of all members.

Public Member Functions

  CTransformation ()
  CTransformation (const CTransformation &in_transformation)
  ~CTransformation ()
CTransformation operator= (const CTransformation &in_transformation)
CMatrix4  GetMatrix4 () const
void  SetMatrix4 (const CMatrix4 &in_matrix4)
CTransformation SetRotation (const CRotation &in_Rotation)
CRotation  GetRotation () const
CTransformation SetRotX (const double &in_dX)
double  GetRotX () const
CTransformation SetRotY (const double &in_dY)
double  GetRotY () const
CTransformation SetRotZ (const double &in_dZ)
double  GetRotZ () const
void  PutRotationOrder (CRotation::RotationOrder in_Order)
CRotation::RotationOrder  GetRotationOrder () const
CTransformation SetRotationFromXYZAnglesValues (double in_dX, double in_dY, double in_dZ, CRotation::RotationOrder in_Order)
CTransformation SetRotationFromXYZAnglesValues (double in_dX, double in_dY, double in_dZ)
void  GetRotationFromXYZAnglesValues (double &io_dX, double &io_dY, double &io_dZ) const
CTransformation MulInPlace (const CTransformation &in_transformation)
CTransformation Mul (const CTransformation &in_transformationA, const CTransformation &in_transformationB)
CTransformation AddParentTranslation (const CVector3 &in_vector3)
CTransformation AddLocalTranslation (const CVector3 &in_vector3)
CTransformation AddParentScaling (const CVector3 &in_vector3)
CTransformation AddLocalScaling (const CVector3 &in_vector3)
CTransformation SetRotationFromXYZAxes (const CVector3 &in_vector3X, const CVector3 &in_vector3Y, const CVector3 &in_vector3Z)
CTransformation SetTranslationFromValues (double in_dX, double in_dY, double in_dZ)
void  GetTranslationValues (double &io_dX, double &io_dY, double &io_dZ) const
CTransformation SetScalingFromValues (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
CTransformation SetScalingOrientationFromXYZAngles (double in_dX, double in_dY, double in_dZ)
bool  HasScalingOrientation () const
CTransformation SetIdentity ()
CTransformation SetTranslation (const CVector3 &in_vector3)
CVector3  GetTranslation () const
CTransformation SetPosX (const double &in_dX)
double  GetPosX () const
CTransformation SetPosY (const double &in_dY)
double  GetPosY () const
CTransformation SetPosZ (const double &in_dZ)
double  GetPosZ () const
CTransformation SetRotationFromAxisAngle (const CVector3 &in_vector3, double in_dAngle)
CTransformation SetRotationFromXYZAngles (const CVector3 &in_vector3)
double  GetRotationAxisAngle (CVector3 &io_vector3) const
CVector3  GetRotationXYZAngles () const
CTransformation SetScaling (const CVector3 &in_vector3)
CVector3  GetScaling () const
CTransformation SetSclX (const double &in_dX)
double  GetSclX () const
CTransformation SetSclY (const double &in_dY)
double  GetSclY () const
CTransformation SetSclZ (const double &in_dZ)
double  GetSclZ () const
CTransformation SetRotationFromMatrix3 (const CMatrix3 &in_matrix3)
CMatrix3  GetRotationMatrix3 () const
CTransformation SetRotationFromQuaternion (const CQuaternion &in_quaternion)
CQuaternion  GetRotationQuaternion (void) const
CTransformation InvertInPlace ()
CTransformation Invert (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_transformation constant class object.

Default destructor.


Member Function Documentation

CTransformation& operator= ( const CTransformation in_transformation )

Assignment operator.

Parameters:
in_transformation constant 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_matrix4 matrix operand.
CTransformation& SetRotation ( const CRotation in_Rotation )

Sets the rotation

Parameters:
in_Rotation Source 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_dX Rotation 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_dY Rotation 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_dZ Rotation 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 package using a different rotation order.

Parameters:
in_Order New 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 package 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_dX X euler angle value
in_dY Y euler angle value
in_dZ Z euler angle value
in_Order Rotation 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_dX X euler angle value
in_dY Y euler angle value
in_dZ Z 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_dX X euler angle value
io_dY Y euler angle value
io_dZ Z euler angle value
CTransformation& MulInPlace ( const CTransformation in_transformation )

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

Parameters:
in_transformation transformation 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_transformationA transformation operand
in_transformationB transformation 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_vector3 translation 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_vector3 translation 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_vector3 scaling 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_vector3 scaling 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_vector3X unitary X axis (orthogonal to Y and Z)
in_vector3Y unitary Y axis (orthogonal to X and Z)
in_vector3Z unitary 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_dX translation in X.
in_dY translation in Y.
in_dZ translation 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_dX translation in X.
io_dY translation in Y.
io_dZ translation in Z.
CTransformation& SetScalingFromValues ( double  in_dX,
double  in_dY,
double  in_dZ 
)

Sets the scaling of this transformation.

Parameters:
in_dX scaling in X.
in_dY scaling in Y.
in_dZ scaling 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_dX scaling in X.
io_dY scaling in Y.
io_dZ scaling in Z.
void GetScalingOrientationXYZAngles ( double &  io_dX,
double &  io_dY,
double &  io_dZ 
) const

Returns the scaling orientation values of this transformation.

Parameters:
io_dX scaling in X.
io_dY scaling in Y.
io_dZ scaling in Z.
CTransformation& SetScalingOrientationFromXYZAngles ( double  in_dX,
double  in_dY,
double  in_dZ 
)

Sets the scaling orientation angles of this transformation

Parameters:
in_dX scaling orientation X angle.
in_dY scaling orientation Y angle.
in_dZ scaling 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_vector3 vector 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_dX Position 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_dY Position 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_dZ Position 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_vector3 Axis of rotation.
in_dAngle Angle 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_vector3 vector 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_vector3 Axis 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_vector3 Vector 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_dX Scaling 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_dY Scaling 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_dZ Scaling 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_matrix3 3x3 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_quaternion quaternion 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 ( )
CTransformation& Invert ( const CTransformation in_transfo )

Inverts the given CTransformation object

Parameters:
in_transfo transformation 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_transformation Operand transformation.
in_dEpsilon Error 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_transformation Operand 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_transformation Operand 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_transformation Operand transformation.
Returns:
true if equal else false.
See also:
CTransformation::Equals

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