CAnimationPoint Class

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at CAnimationPoint Class.

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

class CAnimationPoint : public CAnimationBaseObject;  

Public Constructors

NameDescription
CAnimationPoint::CAnimationPointOverloaded. Constructs CAnimationPoint object.

Public Methods

NameDescription
CAnimationPoint::AddTransitionAdds transitions for X and Y coordinates.
CAnimationPoint::GetDefaultValueReturns the default values for X and Y coordinates.
CAnimationPoint::GetValueReturns current value.
CAnimationPoint::GetXProvides access to CAnimationVariable for X coordinate.
CAnimationPoint::GetYProvides access to CAnimationVariable for Y coordinate.
CAnimationPoint::SetDefaultValueSets default value.

Protected Methods

NameDescription
CAnimationPoint::GetAnimationVariableListPuts the encapsulated animation variables into a list. (Overrides CAnimationBaseObject::GetAnimationVariableList.)

Public Operators

NameDescription
CAnimationPoint::operator CPointConverts a CAnimationPoint to a CPoint.
CAnimationPoint::operator=Assigns ptSrc to CAnimationPoint.

Protected Data Members

NameDescription
CAnimationPoint::m_xValueThe encapsulated animation variable that represents X coordinate of animation point.
CAnimationPoint::m_yValueThe encapsulated animation variable that represents Y coordinate of animation point.

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 (like text string, circle, point etc). To use this class in 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.

CObject

CAnimationBaseObject

CAnimationPoint

Header: afxanimationcontroller.h

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 are not 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.

Constructs 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 CAnimationPoint object with default properties: default point coordinates, Group ID and Object ID are set to 0.

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.

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.

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 animation point. If this method fails or underlying COM objects for X and Y coordinates have not been initialized, ptValue contains default value, which was previously set in constructor or by SetDefaultValue.

Provides access to CAnimationVariable for 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.

Provides access to CAnimationVariable for Y coordinate.

CAnimationVariable& GetY();

Return Value

A reference to encapsulated CAnimationVariable representing Y coordinate.

Remarks

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

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

CAnimationVariable m_xValue;  

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

CAnimationVariable m_yValue;  

Converts a CAnimationPoint to a CPoint.

operator CPoint();

Return Value

Current value of CAnimationPoint as CPoint.

Remarks

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

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 X and Y coordinates if they have been created. If you subscribed this animation object to events (ValueChanged or IntegerValueChanged), you need to re-enable these events.

Sets 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 methods assigns default values to X and Y coordinates of animation point. It also recreates underlying COM objects if they have been created. If you subscribed this animation object to events (ValueChanged or IntegerValueChanged), you need to re-enable these events.

Classes

Show: