62 lines
		
	
	
		
			2.3 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			62 lines
		
	
	
		
			2.3 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
////////////////////////////////////////////////////////////////////////////////////////////////////
 | 
						|
// NoesisGUI - http://www.noesisengine.com
 | 
						|
// Copyright (c) 2013 Noesis Technologies S.L. All Rights Reserved.
 | 
						|
////////////////////////////////////////////////////////////////////////////////////////////////////
 | 
						|
 | 
						|
 | 
						|
#ifndef __GUI_POINTANIMATIONBASE_H__
 | 
						|
#define __GUI_POINTANIMATIONBASE_H__
 | 
						|
 | 
						|
 | 
						|
#include <NsCore/Noesis.h>
 | 
						|
#include <NsCore/ReflectionDeclare.h>
 | 
						|
#include <NsGui/AnimationTimeline.h>
 | 
						|
#include <NsGui/AnimationApi.h>
 | 
						|
 | 
						|
 | 
						|
namespace Noesis
 | 
						|
{
 | 
						|
 | 
						|
struct Point;
 | 
						|
 | 
						|
////////////////////////////////////////////////////////////////////////////////////////////////////
 | 
						|
/// Abstract class that, when implemented, animates a *Point* value.
 | 
						|
///
 | 
						|
/// Derive from a PointAnimationBase class and implement the *GetCurrentValueCore* method. The
 | 
						|
/// *GetCurrentValueCore* method returns the current value of the animation. It takes three
 | 
						|
/// parameters: a suggested starting value, a suggested ending value, and an AnimationClock, which
 | 
						|
/// you use to determine the progress of the animation.
 | 
						|
///
 | 
						|
/// Because PointAnimationBase class inherit from the Freezable class, you must also override
 | 
						|
/// *CreateInstanceCore* core to return a new instance of your class.
 | 
						|
///
 | 
						|
/// http://msdn.microsoft.com/en-us/library/system.windows.media.animation.pointanimationbase.aspx
 | 
						|
////////////////////////////////////////////////////////////////////////////////////////////////////
 | 
						|
class NS_GUI_ANIMATION_API PointAnimationBase: public AnimationTimeline
 | 
						|
{
 | 
						|
public:
 | 
						|
    /// Gets the current value of the animation
 | 
						|
    Point GetCurrentValue(const Point& defaultOrigin, const Point& defaultDestination,
 | 
						|
        AnimationClock* clock);
 | 
						|
 | 
						|
protected:
 | 
						|
    /// Calculates a value that represents the current value of the property being animated,
 | 
						|
    /// as determined by the host animation
 | 
						|
    virtual Point GetCurrentValueCore(const Point& defaultOrigin, const Point& defaultDestination,
 | 
						|
        AnimationClock* clock) = 0;
 | 
						|
 | 
						|
private:
 | 
						|
    /// From AnimationTimeline
 | 
						|
    //@{
 | 
						|
    const Type* GetTargetPropertyType() const final override;
 | 
						|
    Ptr<BaseComponent> GetCurrentValue(BaseComponent* defaultOrigin,
 | 
						|
        BaseComponent* defaultDestination, AnimationClock* clock) final override;
 | 
						|
    //@}
 | 
						|
 | 
						|
    NS_DECLARE_REFLECTION(PointAnimationBase, AnimationTimeline)
 | 
						|
};
 | 
						|
 | 
						|
}
 | 
						|
 | 
						|
#endif
 |