Edit

Share via


CAnimationPoint class

Implements the functionality of a point whose coordinates can be animated.

Syntax

class CAnimationPoint : public CAnimationBaseObject;

Members

Public Constructors

Name Description
CAnimationPoint::CAnimationPoint Overloaded. Constructs CAnimationPoint object.

Public Methods

Name Description
CAnimationPoint::AddTransition Adds transitions for X and Y coordinates.
CAnimationPoint::GetDefaultValue Returns the default values for X and Y coordinates.
CAnimationPoint::GetValue Returns current value.
CAnimationPoint::GetX Provides access to the CAnimationVariable X coordinate.
CAnimationPoint::GetY Provides access to the CAnimationVariable Y coordinate.
CAnimationPoint::SetDefaultValue Sets the default value.

Protected Methods

Name Description
CAnimationPoint::GetAnimationVariableList Puts the encapsulated animation variables into a list. Overrides CAnimationBaseObject::GetAnimationVariableList

Public Operators

Name Description
CAnimationPoint::operator CPoint Converts a CAnimationPoint to a CPoint.
CAnimationPoint::operator= Assigns ptSrc to CAnimationPoint.

Protected Data Members

Name Description
CAnimationPoint::m_xValue The encapsulated animation variable that represents the X coordinate of the animation point.
CAnimationPoint::m_yValue The encapsulated animation variable that represents the Y coordinate of the animation point.

Remarks

The CAnimationPoint class encapsulates two CAnimationVariable objects and can represent in applications a point. For example, you can use this class to animate a position of any object on the screen such as a text string, circle, point, and so on. To use this class in an application, just instantiate an object of this class, add it to animation controller using CAnimationController::AddAnimationObject, and call AddTransition for each transition to be applied to X and/or Y coordinates.

Inheritance Hierarchy

CObject
CAnimationBaseObject
CAnimationPoint

Requirements

Header: afxanimationcontroller.h

CAnimationPoint::AddTransition

Adds transitions for X and Y coordinates.

void AddTransition(
    CBaseTransition* pXTransition,
    CBaseTransition* pYTransition);

Parameters

pXTransition
A pointer to transition for X coordinates.

pYTransition
A pointer to transition for Y coordinate.

Remarks

Call this function to add the specified transitions to the internal list of transitions to be applied to animation variables for X and Y coordinates. When you add transitions, they aren't applied immediately and stored in an internal list. Transitions are applied (added to a storyboard for a particular value) when you call CAnimationController::AnimateGroup. If you don't need to apply a transition to one of coordinates, you can pass NULL.

CAnimationPoint::CAnimationPoint

Constructs a CAnimationPoint object.

CAnimationPoint();

CAnimationPoint(
    const CPoint& ptDefault,
    UINT32 nGroupID,
    UINT32 nObjectID = (UINT32)-1,
    DWORD dwUserData = 0);

Parameters

ptDefault
Specifies default point coordinates.

nGroupID
Specifies Group ID.

nObjectID
Specifies Object ID.

dwUserData
Specifies user-defined data.

Remarks

Constructs a CAnimationPoint object with default properties. The default point coordinates, Group ID and Object ID, are set to zero.

CAnimationPoint::GetAnimationVariableList

Puts the encapsulated animation variables into a list.

virtual void GetAnimationVariableList(CList<CAnimationVariable*, CAnimationVariable*>& lst);

Parameters

lst
When the function returns, it contains pointers to two CAnimationVariable objects representing the X and Y coordinates.

CAnimationPoint::GetDefaultValue

Returns the default values for X and Y coordinates.

CPoint GetDefaultValue();

Return Value

A point containing default value.

Remarks

Call this function to retrieve default value, which was previously set by constructor or SetDefaultValue.

CAnimationPoint::GetValue

Returns current value.

BOOL GetValue(CPoint& ptValue);

Parameters

ptValue
Output. Contains the current value when this method returns.

Return Value

TRUE, if the current value was successfully retrieved; otherwise FALSE.

Remarks

Call this function to retrieve the current value of the animation point. If this method fails or underlying COM objects for X and Y coordinates haven't been initialized, ptValue contains the default value previously set in the constructor or by SetDefaultValue.

CAnimationPoint::GetX

Provides access to CAnimationVariable for the X coordinate.

CAnimationVariable& GetX();

Return Value

A reference to encapsulated CAnimationVariable representing X coordinate.

Remarks

You can call this method to get direct access to underlying CAnimationVariable representing X coordinate.

CAnimationPoint::GetY

Provides access to CAnimationVariable for the Y coordinate.

CAnimationVariable& GetY();

Return Value

A reference to the encapsulated CAnimationVariable representing the Y coordinate.

Remarks

You can call this method to get direct access to the underlying CAnimationVariable representing the Y coordinate.

CAnimationPoint::m_xValue

The encapsulated animation variable that represents the X coordinate of the animation point.

CAnimationVariable m_xValue;

CAnimationPoint::m_yValue

The encapsulated animation variable that represents the Y coordinate of the animation point.

CAnimationVariable m_yValue;

CAnimationPoint::operator CPoint

Converts a CAnimationPoint to a CPoint.

operator CPoint();

Return Value

Current value of CAnimationPoint as CPoint.

Remarks

This function internally calls GetValue. If GetValue fails, the returned point will contain default values for the X and Y coordinates.

CAnimationPoint::operator=

Assigns ptSrc to CAnimationPoint.

void operator=(const CPoint& ptSrc);

Parameters

ptSrc
Refers to CPoint or POINT.

Remarks

Assigns ptSrc to CAnimationPoint. It's recommended to do that before animation start, because this operator calls SetDefaultValue, which recreates the underlying COM objects for the X and Y coordinates if they've been created. If you subscribed this animation object to events (ValueChanged or IntegerValueChanged), re-enable these events.

CAnimationPoint::SetDefaultValue

Sets the default value.

void SetDefaultValue(const POINT& ptDefault);

Parameters

ptDefault
Specifies the default point value.

Remarks

Use this function to set a default value to animation object. This method assigns default values to X and Y coordinates of animation point. It also recreates underlying COM objects if they've been created. If you subscribed this animation object to events (ValueChanged or IntegerValueChanged), re-enable these events.

See also

Classes