description | title | ms.date | f1_keywords | helpviewer_keywords | ms.assetid | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Learn more about: CInterpolatorBase Class |
CInterpolatorBase Class |
11/04/2016 |
|
|
bbc3dce7-8398-47f9-b97e-e4fd2d737232 |
Implements a callback, which is called by the Animation API when it has to calculate a new value of an animation variable.
class CInterpolatorBase : public CUIAnimationInterpolatorBase<CInterpolatorBase>;
Name | Description |
---|---|
CInterpolatorBase::CInterpolatorBase | Constructs the CInterpolatorBase object. |
Name | Description |
---|---|
CInterpolatorBase::CreateInstance | Creates an instance of CInterpolatorBase and stores a pointer to custom interpolator, which will be handling events. |
CInterpolatorBase::GetDependencies | Gets the interpolator's dependencies. (Overrides CUIAnimationInterpolatorBase::GetDependencies .) |
CInterpolatorBase::GetDuration | Gets the interpolator's duration. (Overrides CUIAnimationInterpolatorBase::GetDuration .) |
CInterpolatorBase::GetFinalValue | Gets the final value to which the interpolator leads. (Overrides CUIAnimationInterpolatorBase::GetFinalValue .) |
CInterpolatorBase::InterpolateValue | Interpolates the value at a given offset (Overrides CUIAnimationInterpolatorBase::InterpolateValue .) |
CInterpolatorBase::InterpolateVelocity | Interpolates the velocity at a given offset (Overrides CUIAnimationInterpolatorBase::InterpolateVelocity .) |
CInterpolatorBase::SetCustomInterpolator | Stores a pointer to custom interpolator, which will be handling events. |
CInterpolatorBase::SetDuration | Sets the interpolator's duration (Overrides CUIAnimationInterpolatorBase::SetDuration .) |
CInterpolatorBase::SetInitialValueAndVelocity | Sets the interpolator's initial value and velocity. (Overrides CUIAnimationInterpolatorBase::SetInitialValueAndVelocity .) |
This handler is created and passed to IUIAnimationTransitionFactory::CreateTransition
when a CCustomTransition
object is being created as a part of animation initialization process (started by CAnimationController::AnimateGroup
). Usually you don't need to use this class directly, it just routs all events to a CCustomInterpolator
-derived class, whose pointer is passed to constructor of CCustomTransition
.
CUIAnimationCallbackBase
CUIAnimationInterpolatorBase
CInterpolatorBase
Header: afxanimationcontroller.h
Constructs the CInterpolatorBase object.
CInterpolatorBase();
Creates an instance of CInterpolatorBase and stores a pointer to custom interpolator, which will be handling events.
static COM_DECLSPEC_NOTHROW HRESULT CreateInstance(
CCustomInterpolator* pInterpolator,
IUIAnimationInterpolator** ppHandler);
pInterpolator
A pointer to custom interpolator.
ppHandler
Output. Contains a pointer to instance of CInterpolatorBase when the function returns.
Gets the interpolator's dependencies.
IFACEMETHOD(GetDependencies)(
__out UI_ANIMATION_DEPENDENCIES* initialValueDependencies,
__out UI_ANIMATION_DEPENDENCIES* initialVelocityDependencies,
__out 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.
If the method succeeds, it returns S_OK. It returns E_FAIL if CCustomInterpolator is not set, or custom implementation returns FALSE from the GetDependencies method.
Gets the interpolator's duration.
IFACEMETHOD(GetDuration)(__out UI_ANIMATION_SECONDS* duration);
duration
Output. The duration of the transition, in seconds.
If the method succeeds, it returns S_OK. It returns E_FAIL if CCustomInterpolator is not set, or custom implementation returns FALSE from the GetDuration method.
Gets the final value to which the interpolator leads.
IFACEMETHOD(GetFinalValue)(__out DOUBLE* value);
value
Output. The final value of a variable at the end of the transition.
If the method succeeds, it returns S_OK. It returns E_FAIL if CCustomInterpolator is not set, or custom implementation returns FALSE from the GetFinalValue method.
Interpolates the value at a given offset
IFACEMETHOD(InterpolateValue)(
__in UI_ANIMATION_SECONDS offset,
__out DOUBLE* value);
offset
The offset from the start of the transition. The offset is always greater than or equal to zero and less than the duration of the transition. This method is not called if the duration of the transition is zero.
value
Output. The interpolated value.
If the method succeeds, it returns S_OK. It returns E_FAIL if CCustomInterpolator is not set, or custom implementation returns FALSE from the InterpolateValue method.
Interpolates the velocity at a given offset
IFACEMETHOD(InterpolateVelocity)(
__in UI_ANIMATION_SECONDS offset,
__out DOUBLE* velocity);
offset
The offset from the start of the transition. The offset is always greater than or equal to zero and less than or equal to the duration of the transition. This method is not called if the duration of the transition is zero.
velocity
Output. The velocity of the variable at the offset.
If the method succeeds, it returns S_OK. It returns E_FAIL if CCustomInterpolator is not set, or custom implementation returns FALSE from the InterpolateVelocity method.
Stores a pointer to custom interpolator, which will be handling events.
void SetCustomInterpolator(CCustomInterpolator* pInterpolator);
pInterpolator
A pointer to custom interpolator.
Sets the interpolator's duration
IFACEMETHOD(SetDuration)(__in UI_ANIMATION_SECONDS duration);
duration
The duration of the transition.
If the method succeeds, it returns S_OK. It returns E_FAIL if CCustomInterpolator is not set, or custom implementation returns FALSE from the SetDuration method.
Sets the interpolator's initial value and velocity.
IFACEMETHOD(SetInitialValueAndVelocity)(
__in DOUBLE initialValue,
__in 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.
If the method succeeds, it returns S_OK. It returns E_FAIL if CCustomInterpolator is not set, or custom implementation returns FALSE from the SetInitialValueAndVelocity method.