TAlfTransformationCommand Class Reference

class TAlfTransformationCommand : public TAlfObjectCommand

TAlfTransformationCommand is a command that operates on a transformation.

Transformation command can generate one of the following operations:
  • EAlfOpLoadIdentity - Loads an identity matrix to the transformation.

  • EAlfOpTranslate - Applies a translation to the object affected by the transformation.

  • EAlfOpScale - Applies scaling to the object affected by the transformation.

  • EAlfOpRotate - Applies a rotation to the object that is affected by the transformation.

  • EAlfOpReplaceStep - Replaces the whole transformation step values with the ones given as command parameters

If the transformation operation is rotation the default rotation is around z-axis. If the transformation operation is scaling the default scale factors are 1.0 on all axis. On any other transformation the x,y and z components are zero by default.
Usage:
 	
 	//Enable transformation
  iVisual->EnableTransformationL( );
 
 //Get transformation object
  CAlfTransformation* transformation = &iVisual->Transformation();
 
  //Set transformation properties
   const TInt rotateAngle = 23.67;
   transformation->Rotate( rotateAngle );
 
 //Create transformation command
 TAlfTransformationCommand command( iVisual,transformation, EAlfOpRotate, 0 );
 
 //Properties can also be set through command
  command.SetAngle( TAlfTimedValue( 56 ) );
 
 //Send command
  iEnv->Send( command, 1 );

Inherits from

Public Member Functions
TAlfTransformationCommand(TAny *, CAlfTransformation &, TAlfOp, TInt)
IMPORT_C voidExecuteL(CAlfEnv &)
IMPORT_C voidSetAngle(const TAlfTimedValue &)
IMPORT_C voidSetX(const TAlfTimedValue &)
IMPORT_C voidSetY(const TAlfTimedValue &)
IMPORT_C voidSetZ(const TAlfTimedValue &)
IMPORT_C TIntSize()
IMPORT_C TIntStep()
IMPORT_C CAlfTransformation &Transformation()
Protected Member Functions
IMPORT_C voidCommandExtension(const TUid &, TAny **)
Inherited Functions
TAlfCommand::TAlfCommand(TAlfCommandType)
TAlfCommand::Type()const
TAlfCommand::~TAlfCommand()
TAlfObjectCommand::Object()const
TAlfObjectCommand::ObjectCommand()const
TAlfObjectCommand::Operation()const
TAlfObjectCommand::TAlfObjectCommand(TAlfCommandType,TAny *,TAlfOp)
Public Member Enumerations
enumanonymous { EStepNone = -1 }
Private Attributes
TAlfTimedValue iAngle
TInt iSpare1
TInt iSpare2
TInt iStep
CAlfTransformation &iTransformation
TAlfTimedValue iX
TAlfTimedValue iY
TAlfTimedValue iZ

Constructor & Destructor Documentation

TAlfTransformationCommand(TAny *, CAlfTransformation &, TAlfOp, TInt)

IMPORT_CTAlfTransformationCommand(TAny *aOwner,
CAlfTransformation &aTransformation,
TAlfOpaOperation = EAlfOpLoadIdentity,
TIntaStep = EStepNone
)

Constructs a new transformation command.

Parameters

TAny * aOwnerOwner of the transformation. Allowed be NULL.
CAlfTransformation & aTransformationTransformation to operate on.
TAlfOp aOperation = EAlfOpLoadIdentityOperation to perform.
TInt aStep = EStepNoneStep index in the transformation.

Member Functions Documentation

CommandExtension(const TUid &, TAny **)

IMPORT_C voidCommandExtension(const TUid &aExtensionUid,
TAny **aExtensionParams
)[protected, virtual]

Parameters

const TUid & aExtensionUid
TAny ** aExtensionParams

ExecuteL(CAlfEnv &)

IMPORT_C voidExecuteL(CAlfEnv &aEnv)const [virtual]

Executes the command.

Parameters

CAlfEnv & aEnvThe environment in which the command is being executed.

SetAngle(const TAlfTimedValue &)

IMPORT_C voidSetAngle(const TAlfTimedValue &aValue)

Set the angle of rotation if the transformation is rotation.

Parameters

const TAlfTimedValue & aValue

SetX(const TAlfTimedValue &)

IMPORT_C voidSetX(const TAlfTimedValue &aValue)
Sets the X component.
  • If transformation is translation this sets the amount of translation on X axis.

  • If transformation is rotation this sets the X component of rotation axis vector.

  • If transformation is scaling this sets the scaling factor for the X axis.

Parameters

const TAlfTimedValue & aValueTimed value to set to the X component.

SetY(const TAlfTimedValue &)

IMPORT_C voidSetY(const TAlfTimedValue &aValue)
Sets the Y component.
  • If transformation is translation this sets the amount of translation on Y axis.

  • If transformation is rotation this sets the Y component of rotation axis vector.

  • If transformation is scaling this sets the scaling factor for the Y axis.

Parameters

const TAlfTimedValue & aValueTimed value to set to the Y component.

SetZ(const TAlfTimedValue &)

IMPORT_C voidSetZ(const TAlfTimedValue &aValue)
Sets the Z component.
  • If transformation is translation this sets the amount of translation on Z axis.

  • If transformation is rotation this sets the Z component of rotation axis vector.

  • If transformation is scaling this sets the scaling factor for the Z axis.

Parameters

const TAlfTimedValue & aValueTimed value to set to the Z component.

Size()

IMPORT_C TIntSize()const [virtual]

Returns the size of the command.

Step()

IMPORT_C TIntStep()const

Returns the transformation step index.

Transformation()

IMPORT_C CAlfTransformation &Transformation()const

Returns the transformation that the command operates on.

Member Enumerations Documentation

Enum anonymous

Enumerators

EStepNone = -1

Used in the aStep parameter to specify that no step index is specified.

Member Data Documentation

TAlfTimedValue iAngle

TAlfTimedValue iAngle[private]

Angle component. Suspended.

TInt iSpare1

TInt iSpare1[private]

TInt iSpare2

TInt iSpare2[private]

TInt iStep

TInt iStep[private]

Step index.

CAlfTransformation & iTransformation

CAlfTransformation &iTransformation[private]

Image of the command.

TAlfTimedValue iX

TAlfTimedValue iX[private]

X component. Suspended.

TAlfTimedValue iY

TAlfTimedValue iY[private]

Y component. Suspended.

TAlfTimedValue iZ

TAlfTimedValue iZ[private]

Z component. Suspended.