CCustomInterpolator Class
Implements a basic interpolator.
class CCustomInterpolator;
Name | Description |
---|---|
CCustomInterpolator::CCustomInterpolator | Overloaded. Constructs a custom interpolator object and initializes duration and velocity to specified values. |
Name | Description |
---|---|
CCustomInterpolator::GetDependencies | Gets the interpolator's dependencies. |
CCustomInterpolator::GetDuration | Gets the interpolator's duration. |
CCustomInterpolator::GetFinalValue | Gets the final value to which the interpolator leads. |
CCustomInterpolator::Init | Initializes duration and final value. |
CCustomInterpolator::InterpolateValue | Interpolates the value at a given offset. |
CCustomInterpolator::InterpolateVelocity | Interpolates the velocity at a given offset |
CCustomInterpolator::SetDuration | Sets the interpolator's duration. |
CCustomInterpolator::SetInitialValueAndVelocity | Sets the interpolator's initial value and velocity. |
Name | Description |
---|---|
CCustomInterpolator::m_currentValue | The interpolated value. |
CCustomInterpolator::m_currentVelocity | The interpolated velocity. |
CCustomInterpolator::m_duration | The duration of the transition. |
CCustomInterpolator::m_finalValue | The final value of a variable at the end of the transition. |
CCustomInterpolator::m_initialValue | The value of the variable at the start of the transition. |
CCustomInterpolator::m_initialVelocity | The velocity of the variable at the start of the transition. |
Derive a class from CCustomInterpolator and override all necessary methods in order to implement a custom interpolation algorithm. A pointer to this class should be passed as a parameter to CCustomTransition.
CCustomInterpolator
Header: afxanimationcontroller.h
Constructs a custom interpolator object and sets all values to default 0.
CCustomInterpolator();
CCustomInterpolator(
UI_ANIMATION_SECONDS duration,
DOUBLE finalValue);
duration
The duration of the transition.
finalValue
Use CCustomInterpolator::Init to initialize duration and final value later in the code.
Gets the interpolator's dependencies.
virtual BOOL GetDependencies(
UI_ANIMATION_DEPENDENCIES* initialValueDependencies,
UI_ANIMATION_DEPENDENCIES* initialVelocityDependencies,
UI_ANIMATION_DEPENDENCIES* durationDependencies);
initialValueDependencies
Output. Aspects of the interpolator that depend on the initial value passed to SetInitialValueAndVelocity.
initialVelocityDependencies
Output. Aspects of the interpolator that depend on the initial velocity passed to SetInitialValueAndVelocity.
durationDependencies
Output. Aspects of the interpolator that depend on the duration passed to SetDuration.
Basic implementation always returns TRUE. Return FALSE from overridden implementation if you wish to fail the event.
Gets the interpolator's duration.
virtual BOOL GetDuration(UI_ANIMATION_SECONDS* duration);
duration
Output. The duration of the transition, in seconds.
Basic implementation always returns TRUE. Return FALSE from overridden implementation if you wish to fail the event.
Gets the final value to which the interpolator leads.
virtual BOOL GetFinalValue(DOUBLE* value);
value
Output. The final value of a variable at the end of the transition.
Basic implementation always returns TRUE. Return FALSE from overridden implementation if you wish to fail the event.
Initializes duration and final value.
void Init(
UI_ANIMATION_SECONDS duration,
DOUBLE finalValue);
duration
The duration of the transition.
finalValue
The final value of a variable at the end of the transition.
Interpolates the value at a given offset.
virtual BOOL InterpolateValue(
UI_ANIMATION_SECONDS */,
DOUBLE* value);
value
Output. The interpolated value.
Basic implementation always returns TRUE. Return FALSE from overridden implementation if you wish to fail the event.
Interpolates the velocity at a given offset
virtual BOOL InterpolateVelocity(
UI_ANIMATION_SECONDS */,
DOUBLE* velocity);
velocity
Output. The velocity of the variable at the offset.
Basic implementation always returns TRUE. Return FALSE from overridden implementation if you wish to fail the event.
The interpolated value.
DOUBLE m_currentValue;
The interpolated velocity.
DOUBLE m_currentVelocity;
The duration of the transition.
UI_ANIMATION_SECONDS m_duration;
The final value of a variable at the end of the transition.
DOUBLE m_finalValue;
The value of the variable at the start of the transition.
DOUBLE m_initialValue;
The velocity of the variable at the start of the transition.
DOUBLE m_initialVelocity;
Sets the interpolator's duration.
virtual BOOL SetDuration(UI_ANIMATION_SECONDS duration);
duration
The duration of the transition.
Basic implementation always returns TRUE. Return FALSE from overridden implementation if you wish to fail the event.
Sets the interpolator's initial value and velocity.
virtual BOOL SetInitialValueAndVelocity(
DOUBLE initialValue,
DOUBLE initialVelocity);
initialValue
The value of the variable at the start of the transition.
initialVelocity
The velocity of the variable at the start of the transition.
The basic implementation always returns TRUE. Return FALSE from overridden implementation if you wish to fail the event.