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)
voidAppendTransform(const TGfxAffineTransform &)
voidConcatenate(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()
voidPrint()
voidRotate(TReal32)
voidRotate(TReal32, const TFloatFixPt &, const TFloatFixPt &)
voidScale(TReal32, TReal32)
TReal32 ScaleX()
TReal32 ScaleY()
TFloatFixPt ScalingFactor()
voidSetTransform(TReal32, TReal32, TReal32, TReal32, TReal32, TReal32)
voidShear(TReal32, TReal32)
TReal32 ShearX()
TReal32 ShearY()
voidTransform(TGfxPoint2D *, TGfxPoint2D *, TInt32)
voidTransform(TFloatFixPt *, TFloatFixPt *, TInt32)
voidTransform(TFloatFixPt *, TInt32)
TUint32 TransformType()
voidTranslate(const TFloatFixPt &, const TFloatFixPt &)
TReal32 TranslateX()
TReal32 TranslateY()
voidUserPan(const TFloatFixPt &, const TFloatFixPt &)
voidUserRotate(TReal32, const TFloatFixPt &, const TFloatFixPt &)
voidUserZoom(TReal32, const TFloatFixPt &, const TFloatFixPt &)
Private Member Functions
TGfxAffineTransform(TReal32, TReal32, TReal32, TReal32, TReal32, TReal32, TGfxTransformType)
voidSetToRotate(TReal32)
voidUpdateState()
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(TReal32aM00,
TReal32aM10,
TReal32aM01,
TReal32aM11,
TReal32aM02,
TReal32aM12
)

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(TReal32aM00,
TReal32aM10,
TReal32aM01,
TReal32aM11,
TReal32aM02,
TReal32aM12,
TGfxTransformTypeaType
)[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 &)

voidAppendTransform(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 &)

voidConcatenate(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(TReal32aTheta)[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(TReal32aTheta,
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(TReal32aSx,
TReal32aSy
)[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(TReal32aShx,
TReal32aShy
)[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(TReal32aScaleFactor,
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()

voidPrint()

Rotate(TReal32)

voidRotate(TReal32aTheta)

Apply the given rotation angle to this matrix.

Since
1.0

Parameters

TReal32 aTheta: angle of rotation

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

voidRotate(TReal32aTheta,
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)

voidScale(TReal32aSx,
TReal32aSy
)

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)

voidSetToRotate(TReal32aTheta)[private]

The the the rotation info to the give angle.

Since
1.0

Parameters

TReal32 aTheta

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

voidSetTransform(TReal32aM00,
TReal32aM10,
TReal32aM01,
TReal32aM11,
TReal32aM02,
TReal32aM12
)

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)

voidShear(TReal32aShX,
TReal32aShY
)

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)

voidTransform(TGfxPoint2D *aSrcPts,
TGfxPoint2D *aDstPts,
TInt32aNumPts
)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)

voidTransform(TFloatFixPt *aSrcPts,
TFloatFixPt *aDstPts,
TInt32aNumPts
)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)

voidTransform(TFloatFixPt *aSrcDstPts,
TInt32aNumPts
)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 &)

voidTranslate(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()

voidUpdateState()[private]

Update this matrix.

Since
1.0

UserPan(const TFloatFixPt &, const TFloatFixPt &)

voidUserPan(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 &)

voidUserRotate(TReal32aTheta,
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 &)

voidUserZoom(TReal32aScaleFactor,
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