TGfxAffineTransform Class Reference

class TGfxAffineTransform

This class implements operations of a 2D transform matrix.

Gfx2D.lib
Since
1.0
Public Member Functions
TGfxAffineTransform ()
TGfxAffineTransform ( TReal32 , TReal32 , TReal32 , TReal32 , TReal32 , TReal32 )
void AppendTransform (const TGfxAffineTransform &)
void Concatenate (const TGfxAffineTransform &)
TGfxAffineTransform CreateInverse ()
TReal32 Determinant ()
TGfxAffineTransform GetRotateInstance ( TReal32 )
TGfxAffineTransform GetRotateInstance ( TReal32 , const TFloatFixPt &, const TFloatFixPt &)
TGfxAffineTransform GetScaleInstance ( TReal32 , TReal32 )
TGfxAffineTransform GetShearInstance ( TReal32 , TReal32 )
TGfxAffineTransform GetTranslateInstance (const TFloatFixPt &, const TFloatFixPt &)
TGfxAffineTransform GetZoomInstance ( TReal32 , const TFloatFixPt &, const TFloatFixPt &)
TBool IsIdentity ()
void Print ()
void Rotate ( TReal32 )
void Rotate ( TReal32 , const TFloatFixPt &, const TFloatFixPt &)
void Scale ( TReal32 , TReal32 )
TReal32 ScaleX ()
TReal32 ScaleY ()
TFloatFixPt ScalingFactor ()
void SetTransform ( TReal32 , TReal32 , TReal32 , TReal32 , TReal32 , TReal32 )
void Shear ( TReal32 , TReal32 )
TReal32 ShearX ()
TReal32 ShearY ()
void Transform ( TGfxPoint2D *, TGfxPoint2D *, TInt32 )
void Transform ( TFloatFixPt *, TFloatFixPt *, TInt32 )
void Transform ( TFloatFixPt *, TInt32 )
TUint32 TransformType ()
void Translate (const TFloatFixPt &, const TFloatFixPt &)
TReal32 TranslateX ()
TReal32 TranslateY ()
void UserPan (const TFloatFixPt &, const TFloatFixPt &)
void UserRotate ( TReal32 , const TFloatFixPt &, const TFloatFixPt &)
void UserZoom ( TReal32 , const TFloatFixPt &, const TFloatFixPt &)
Private Member Functions
TGfxAffineTransform ( TReal32 , TReal32 , TReal32 , TReal32 , TReal32 , TReal32 , TGfxTransformType )
void SetToRotate ( TReal32 )
void UpdateState ()
Public Attributes
TFloatFixPt iM00
TFloatFixPt iM01
TFloatFixPt iM02
TFloatFixPt iM10
TFloatFixPt iM11
TFloatFixPt iM12
TGfxTransformType iTransType

Constructor & Destructor Documentation

TGfxAffineTransform()

TGfxAffineTransform ( )

Construct an identity matrix.

Since
1.0

TGfxAffineTransform(TReal32, TReal32, TReal32, TReal32, TReal32, TReal32)

TGfxAffineTransform ( TReal32 aM00,
TReal32 aM10,
TReal32 aM01,
TReal32 aM11,
TReal32 aM02,
TReal32 aM12
)

Constructor.

Since
1.0

Parameters

TReal32 aM00 : row 0, column 0 value of matrix.
TReal32 aM10 : row 1, column 0 value of matrix.
TReal32 aM01 : row 0, column 1 value of matrix.
TReal32 aM11 : row 1, column 1 value of matrix.
TReal32 aM02 : row 0, column 2 value of matrix.
TReal32 aM12 : row 1, column 2 value of matrix.

TGfxAffineTransform(TReal32, TReal32, TReal32, TReal32, TReal32, TReal32, TGfxTransformType)

TGfxAffineTransform ( TReal32 aM00,
TReal32 aM10,
TReal32 aM01,
TReal32 aM11,
TReal32 aM02,
TReal32 aM12,
TGfxTransformType aType
) [private]

Constructor.

Since
1.0

Parameters

TReal32 aM00 : row 0, column 0 value of matrix.
TReal32 aM10 : row 1, column 0 value of matrix.
TReal32 aM01 : row 0, column 1 value of matrix.
TReal32 aM11 : row 1, column 1 value of matrix.
TReal32 aM02 : row 0, column 2 value of matrix.
TReal32 aM12 : row 1, column 2 value of matrix.
TGfxTransformType aType : transform type.

Member Functions Documentation

AppendTransform(const TGfxAffineTransform &)

void AppendTransform ( const TGfxAffineTransform & aTransform )
Appends this transform with the existing transform Multiply in reverse order For Ex: In cases of zoom, rotate and pan of already transformed content. If T is the existing transform and zoom operation has to be applied to it the resultant transform would be Z*T.
Since
1.0

Parameters

const TGfxAffineTransform & aTransform

Concatenate(const TGfxAffineTransform &)

void Concatenate ( const TGfxAffineTransform & aTransform )

Muliply this given matrix with this matrix.

Since
1.0

Parameters

const TGfxAffineTransform & aTransform

CreateInverse()

TGfxAffineTransform CreateInverse ( )

Create the inverse tranformation matrix of this matrix.

Since
1.0

Determinant()

TReal32 Determinant ( ) const

Return the determinate value of this matrix.

Since
1.0

GetRotateInstance(TReal32)

TGfxAffineTransform GetRotateInstance ( TReal32 aTheta ) [static]

Return a TGfxAffineTransform object with the rotation info of the given angle applied.

Since
1.0

Parameters

TReal32 aTheta : angle to create a rotation affine transform.

GetRotateInstance(TReal32, const TFloatFixPt &, const TFloatFixPt &)

TGfxAffineTransform GetRotateInstance ( TReal32 aTheta,
const TFloatFixPt & aX,
const TFloatFixPt & aY
) [static]

Return a TGfxAffineTransform object with the rotation info of the given angle, rotated at the given point.

Since
1.0

Parameters

TReal32 aTheta : angle to create a rotation affine transform.
const TFloatFixPt & aX : x value of rotation center.
const TFloatFixPt & aY : x value of rotation center.

GetScaleInstance(TReal32, TReal32)

TGfxAffineTransform GetScaleInstance ( TReal32 aSx,
TReal32 aSy
) [static]

Return a TGfxAffineTransform object with the scaling info applied.

Since
1.0

Parameters

TReal32 aSx : scaling factor in the x axis.
TReal32 aSy : scaling factor in the y axis.

GetShearInstance(TReal32, TReal32)

TGfxAffineTransform GetShearInstance ( TReal32 aShx,
TReal32 aShy
) [static]

Return a TGfxAffineTransform object with the shearing info applied.

Since
1.0

Parameters

TReal32 aShx : shearing factor in the x axis.
TReal32 aShy : shearing factor in the y axis.

GetTranslateInstance(const TFloatFixPt &, const TFloatFixPt &)

TGfxAffineTransform GetTranslateInstance ( const TFloatFixPt & aTx,
const TFloatFixPt & aTy
) [static]

Return a TGfxAffineTransform object with the translation info applied.

Since
1.0

Parameters

const TFloatFixPt & aTx : translation value in the x axis.
const TFloatFixPt & aTy : translation value in the y axis.

GetZoomInstance(TReal32, const TFloatFixPt &, const TFloatFixPt &)

TGfxAffineTransform GetZoomInstance ( TReal32 aScaleFactor,
const TFloatFixPt & aX,
const TFloatFixPt & aY
) [static]

Return a TGfxAffineTransform object with the zoom info of the given scalefactor, scaled at the given point.

Since
1.0

Parameters

TReal32 aScaleFactor : scaling factor
const TFloatFixPt & aX : x value of scaling center.
const TFloatFixPt & aY : x value of scaling center.

IsIdentity()

TBool IsIdentity ( ) const

Return wether this matrix is an indentity matrix.

Since
1.0

Print()

void Print ( )

Rotate(TReal32)

void Rotate ( TReal32 aTheta )

Apply the given rotation angle to this matrix.

Since
1.0

Parameters

TReal32 aTheta : angle of rotation

Rotate(TReal32, const TFloatFixPt &, const TFloatFixPt &)

void Rotate ( TReal32 aTheta,
const TFloatFixPt & aX,
const TFloatFixPt & aY
)

Apply the given rotation angle about this given point to this matrix.

Since
1.0

Parameters

TReal32 aTheta : angle of rotation
const TFloatFixPt & aX : x coordinate for center of rotation.
const TFloatFixPt & aY : y coordinate for center of rotation.

Scale(TReal32, TReal32)

void Scale ( TReal32 aSx,
TReal32 aSy
)

Apply the given scale factors to this matrix.

Since
1.0

Parameters

TReal32 aSx : scaling factor in the x axis.
TReal32 aSy : scaling factor in the y axis.

ScaleX()

TReal32 ScaleX ( ) const

Return the scaling factor in the x axis.

Since
1.0

ScaleY()

TReal32 ScaleY ( ) const

Return the scaling factor in the y axis.

Since
1.0

ScalingFactor()

TFloatFixPt ScalingFactor ( ) const
Get the scaling factor set in this transform. This function returns correctly for a uniform scaling in both directions only.
Since
1.0

SetToRotate(TReal32)

void SetToRotate ( TReal32 aTheta ) [private]

The the the rotation info to the give angle.

Since
1.0

Parameters

TReal32 aTheta

SetTransform(TReal32, TReal32, TReal32, TReal32, TReal32, TReal32)

void SetTransform ( TReal32 aM00,
TReal32 aM10,
TReal32 aM01,
TReal32 aM11,
TReal32 aM02,
TReal32 aM12
)

Set the transformation info of this matrix to the given values.

Since
1.0

Parameters

TReal32 aM00 : row 0, column 0 value of matrix.
TReal32 aM10 : row 1, column 0 value of matrix.
TReal32 aM01 : row 0, column 1 value of matrix.
TReal32 aM11 : row 1, column 1 value of matrix.
TReal32 aM02 : row 0, column 2 value of matrix.
TReal32 aM12 : row 1, column 2 value of matrix.

Shear(TReal32, TReal32)

void Shear ( TReal32 aShX,
TReal32 aShY
)

Apply the given shearing values to this matrix.

Since
1.0

Parameters

TReal32 aShX
TReal32 aShY

ShearX()

TReal32 ShearX ( ) const

Return the shearing factor in the x axis.

Since
1.0

ShearY()

TReal32 ShearY ( ) const

Return the shearing factor in the y axis.

Since
1.0

Transform(TGfxPoint2D *, TGfxPoint2D *, TInt32)

void Transform ( TGfxPoint2D * aSrcPts,
TGfxPoint2D * aDstPts,
TInt32 aNumPts
) const

Apply the transformation described by this matrix to the array of TGfxPoint2D .

Since
1.0

Parameters

TGfxPoint2D * aSrcPts : array of TGfxPoint2D values to transform.
TGfxPoint2D * aDstPts : array to store transformed points.
TInt32 aNumPts : number of points to transform.

Transform(TFloatFixPt *, TFloatFixPt *, TInt32)

void Transform ( TFloatFixPt * aSrcPts,
TFloatFixPt * aDstPts,
TInt32 aNumPts
) const

Apply the transformation described by this matrix to the array of TFloatFixPt .

Since
1.0

Parameters

TFloatFixPt * aSrcPts : array of TFloatFixPt values to transform.
TFloatFixPt * aDstPts : array to store transformed points.
TInt32 aNumPts : number of points to transform.

Transform(TFloatFixPt *, TInt32)

void Transform ( TFloatFixPt * aSrcDstPts,
TInt32 aNumPts
) const

Apply the transformation described by this matrix to the array of TFloatFixPt . Old values are replaced.

Since
1.0

Parameters

TFloatFixPt * aSrcDstPts
TInt32 aNumPts : number of points to transform.

TransformType()

TUint32 TransformType ( )

Return the transformation type of this matrix.

Since
1.0

Translate(const TFloatFixPt &, const TFloatFixPt &)

void Translate ( const TFloatFixPt & aTx,
const TFloatFixPt & aTy
)

Apply the given translation values to this matrix.

Since
1.0

Parameters

const TFloatFixPt & aTx : translation value in the x axis.
const TFloatFixPt & aTy : translation value in the y axis.

TranslateX()

TReal32 TranslateX ( ) const

Return the translation value in the x axis.

Since
1.0

TranslateY()

TReal32 TranslateY ( ) const

Return the translation value in the y axis.

Since
1.0

UpdateState()

void UpdateState ( ) [private]

Update this matrix.

Since
1.0

UserPan(const TFloatFixPt &, const TFloatFixPt &)

void UserPan ( const TFloatFixPt & aTx,
const TFloatFixPt & aTy
)

Apply the given translation values to this matrix.

Since
1.0

Parameters

const TFloatFixPt & aTx : translation value in the x axis.
const TFloatFixPt & aTy : translation value in the y axis.

UserRotate(TReal32, const TFloatFixPt &, const TFloatFixPt &)

void UserRotate ( TReal32 aTheta,
const TFloatFixPt & aX,
const TFloatFixPt & aY
)

Apply the given rotation angle about this given point to this matrix.

Since
1.0

Parameters

TReal32 aTheta : angle of rotation
const TFloatFixPt & aX : x coordinate for center of rotation.
const TFloatFixPt & aY : y coordinate for center of rotation.

UserZoom(TReal32, const TFloatFixPt &, const TFloatFixPt &)

void UserZoom ( TReal32 aScaleFactor,
const TFloatFixPt & aX,
const TFloatFixPt & aY
)

Parameters

TReal32 aScaleFactor
const TFloatFixPt & aX
const TFloatFixPt & aY

Member Data Documentation

TFloatFixPt iM00

TFloatFixPt iM00

TFloatFixPt iM01

TFloatFixPt iM01

TFloatFixPt iM02

TFloatFixPt iM02

TFloatFixPt iM10

TFloatFixPt iM10

TFloatFixPt iM11

TFloatFixPt iM11

TFloatFixPt iM12

TFloatFixPt iM12

TGfxTransformType iTransType

TGfxTransformType iTransType