xmake.repo/packages/n/noesis/latest/Include/NsGui/EasingThicknessKeyFrame.h
2024-12-22 19:15:02 +08:00

74 lines
2.3 KiB
C++

////////////////////////////////////////////////////////////////////////////////////////////////////
// NoesisGUI - http://www.noesisengine.com
// Copyright (c) 2013 Noesis Technologies S.L. All Rights Reserved.
////////////////////////////////////////////////////////////////////////////////////////////////////
#ifndef __GUI_EASINGTHICKNESSKEYFRAME_H__
#define __GUI_EASINGTHICKNESSKEYFRAME_H__
#include <NsCore/Noesis.h>
#include <NsCore/ReflectionDeclare.h>
#include <NsGui/ThicknessKeyFrame.h>
#include <NsGui/AnimationApi.h>
namespace Noesis
{
class EasingFunctionBase;
////////////////////////////////////////////////////////////////////////////////////////////////////
/// A class that enables you to associate easing functions with a ThicknessAnimationUsingKeyFrames
/// key frame animation.
///
/// For an example of using an object similar to this one, see EasingDoubleKeyFrame.
///
/// This class is used as part of a ThicknessKeyFrameCollection in conjunction with a
/// ThicknessAnimationUsingKeyFrames to animate a Thickness property value along a set of key
/// frames. This ThicknessKeyFrame interpolates between the Thickness value of the previous key
/// frame and its own value linearly with an easing function to produce its output value.
///
/// http://msdn.microsoft.com/en-us/library/system.windows.media.animation.easingthicknesskeyframe.aspx
////////////////////////////////////////////////////////////////////////////////////////////////////
class NS_GUI_ANIMATION_API EasingThicknessKeyFrame final: public ThicknessKeyFrame
{
public:
/// Gets or sets the easing function applied to the key frame
//@{
EasingFunctionBase* GetEasingFunction() const;
void SetEasingFunction(EasingFunctionBase* function);
//@}
// Hides Freezable methods for convenience
//@{
Ptr<EasingThicknessKeyFrame> Clone() const;
Ptr<EasingThicknessKeyFrame> CloneCurrentValue() const;
//@}
public:
/// Dependency properties
//@{
static const DependencyProperty* EasingFunctionProperty;
//@}
protected:
/// From Freezable
//@{
Ptr<Freezable> CreateInstanceCore() const override;
//@}
/// From KeyFrame
//@{
Thickness InterpolateValueCore(const Thickness& baseValue, float keyFrameProgress) override;
//@}
NS_DECLARE_REFLECTION(EasingThicknessKeyFrame, ThicknessKeyFrame)
};
}
#endif