CAnimationValue Class
Implements the functionality of animation object that has one value.
class CAnimationValue : public CAnimationBaseObject;
Name | Description |
---|---|
CAnimationValue::CAnimationValue | Overloaded. Constructs a CAnimationValue object. |
Name | Description |
---|---|
CAnimationValue::AddTransition | Adds a transition to be applied to a value. |
CAnimationValue::GetValue | Overloaded. Retrieves the current value. |
CAnimationValue::GetVariable | Provides access to encapsulated animation variable. |
CAnimationValue::SetDefaultValue | Sets default value. |
Name | Description |
---|---|
CAnimationValue::GetAnimationVariableList | Puts the encapsulated animation variable into a list. (Overrides CAnimationBaseObject::GetAnimationVariableList.) |
Name | Description |
---|---|
CAnimationValue::operator DOUBLE | Provides conversion between CAnimationValue and DOUBLE. |
CAnimationValue::operator INT32 | Provides conversion between CAnimationValue and INT32. |
CAnimationValue::operator= | Overloaded. Assigns an INT32 value to CAnimationValue. |
Name | Description |
---|---|
CAnimationValue::m_value | The encapsulated animation variable that represents animation value. |
The CAnimationValue class encapsulates a single CAnimationVariable object and can represent in applications a single animated value. For example, you can use this class for animated transparency (fade effect), angle (to rotate objects), or for any other case when you need to create an animation depending on a single animated value. 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 the value.
CAnimationValue
Header: afxanimationcontroller.h
Adds a transition to be applied to a value.
void AddTransition(CBaseTransition* pTransition);
pTransition
A pointer to transition object.
Call this function to add a transition to internal list of transitions to be applied to an animation variable. 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.
Constructs a CAnimationValue object.
CAnimationValue();
CAnimationValue(
DOUBLE dblDefaultValue,
UINT32 nGroupID,
UINT32 nObjectID = (UINT32)-1,
DWORD dwUserData = 0);
dblDefaultValue
Specifies default value.
nGroupID
Specifies Group ID.
nObjectID
Specifies Object ID.
dwUserData
specifies user-defined data.
Constructs CAnimationValue object with default properties: default value, Group ID and Object ID are set to 0.
Puts the encapsulated animation variable into a list.
virtual void GetAnimationVariableList(
CList<CAnimationVariable*,
CAnimationVariable*>& lst);
lst
When the function returns, it contains a pointer to CAnimationVariable representing the animated value.
Retrieves the current value.
BOOL GetValue(DOUBLE& dblValue);
BOOL GetValue(INT32& nValue);
dblValue
Output. When the function returns it contains a current value of animation variable.
nValue
Output. When the function returns it contains a current value of animation variable.
TRUE if the current value was retrieved successfully; otherwise FALSE.
Call this function to retrieve the current value. This implementation calls the encapsulated COM object, and if the call fails, this method returns the default value that was previously set in constructor or with SetDefaultValue.
Provides access to encapsulated animation variable.
CAnimationVariable& GetVariable();
A reference to encapsulated animation variable.
Use this method to access the encapsulated animation variable. From CAnimationVariable you get access to underlying IUIAnimationVariable object, whose pointer can be NULL if animation variable has not been created.
The encapsulated animation variable that represents animation value.
CAnimationVariable m_value;
Provides conversion between CAnimationValue and DOUBLE.
operator DOUBLE();
Current value of Animation Value.
Provides conversion between CAnimationValue and DOUBLE. This method internally calls GetValue and doesn't check for errors. If GetValue fails, the returned value will contain a default value previously set in constructor or with SetDefaultValue.
Provides conversion between CAnimationValue and INT32.
operator INT32();
Current value of Animation Value as integer.
Provides conversion between CAnimationValue and INT32. This method internally calls GetValue and doesn't check for errors. If GetValue fails, the returned value will contain a default value previously set in constructor or with SetDefaultValue.
Assigns a DOUBLE value to CAnimationValue.
void operator=(DOUBLE dblVal);
void operator=(INT32 nVal);
dblVal
Specifies the value to be assigned to Animation Value.
nVal
Specifies the value to be assigned to Animation Value.
Assigns a DOUBLE value to CAnimationValue. This value is set as a default value for encapsulated animation variable. If you subscribed this animation object to events (ValueChanged or IntegerValueChanged), you need to re-enable these events.
Sets default value.
void SetDefaultValue(DOUBLE dblDefaultValue);
dblDefaultValue
Specifies the default value.
Use this method to set a default value. A default value is returned to application when animation has not been started and/or underlying COM object has not been created. If the underlying COM object encapsulated in CAnimationVarible was already created, this method recreates it, therefore you might need to call EnableValueChanged/EnableIntegerValueChanged methods again.