Remove constraint interpolator 41/36541/9
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Mon, 9 Mar 2015 17:34:50 +0000 (17:34 +0000)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Tue, 10 Mar 2015 10:41:30 +0000 (03:41 -0700)
Submitting small changes to tizen branch so all demos don't break straight away.

Change-Id: I2b381ec30528f44dedb437ebfd65ac4497ccc229

dali/internal/event/animation/active-constraint-impl.h
dali/internal/event/animation/constraint-impl.cpp
dali/internal/event/animation/constraint-impl.h
dali/internal/file.list
dali/internal/update/animation/interpolator-functions.cpp [moved from dali/public-api/animation/interpolator-functions.cpp with 73% similarity]
dali/internal/update/animation/interpolator-functions.h [moved from dali/public-api/animation/interpolator-functions.h with 74% similarity]
dali/internal/update/animation/scene-graph-constraint.h
dali/public-api/animation/constraint.cpp
dali/public-api/animation/constraint.h
dali/public-api/dali-core.h
dali/public-api/file.list

index 605eac1..9d73ae4 100644 (file)
@@ -69,24 +69,21 @@ public:
   typedef SceneGraph::Constraint< PropertyType, PropertyAccessor<PropertyType> > SceneGraphConstraint;
   typedef const SceneGraph::AnimatableProperty<PropertyType>* ScenePropertyPtr;
   typedef typename PropertyConstraintPtr<PropertyType>::Type ConstraintFunctionPtr;
-  typedef boost::function< PropertyType (const PropertyType&, const PropertyType&, float) > InterpolatorFunction;
 
   /**
    * Construct a new active-constraint.
    * @param[in] targetIndex The index of the property to constrain.
    * @param[in] sources The sources of the input properties passed to func.
    * @param[in] func The constraint function.
-   * @param[in] interpolator The interpolator function.
    * @return A newly allocated active-constraint.
    */
   static ActiveConstraintBase* New( Property::Index targetIndex,
                                     SourceContainer& sources,
-                                    ConstraintFunctionPtr func,
-                                    InterpolatorFunction interpolator )
+                                    ConstraintFunctionPtr func )
   {
     ThreadLocalStorage& tls = ThreadLocalStorage::Get();
 
-    return new ActiveConstraint< PropertyType >( tls.GetEventToUpdate(), targetIndex, sources, sources.size(), func, interpolator );
+    return new ActiveConstraint< PropertyType >( tls.GetEventToUpdate(), targetIndex, sources, sources.size(), func );
   }
 
   /**
@@ -110,8 +107,7 @@ public:
                                                   mTargetIndex,
                                                   mSources,
                                                   mSourceCount,
-                                                  funcPtr,
-                                                  mInterpolatorFunction );
+                                                  funcPtr );
 
     clone->SetAlphaFunction(mAlphaFunction);
     clone->SetRemoveAction(mRemoveAction);
@@ -129,12 +125,10 @@ private:
                     Property::Index targetIndex,
                     SourceContainer& sources,
                     unsigned int sourceCount,
-                    ConstraintFunctionPtr& func,
-                    InterpolatorFunction& interpolator )
+                    ConstraintFunctionPtr& func )
   : ActiveConstraintBase( eventToUpdate, targetIndex, sources, sourceCount ),
     mTargetIndex( targetIndex ),
-    mUserFunction( func ),
-    mInterpolatorFunction( interpolator )
+    mUserFunction( func )
   {
   }
 
@@ -183,7 +177,6 @@ private:
       SceneGraph::ConstraintBase* sceneGraphConstraint = SceneGraphConstraint::New( *targetProperty,
                                                                                      propertyOwners,
                                                                                      func,
-                                                                                     mInterpolatorFunction,
                                                                                      mCustomWeight );
       DALI_ASSERT_DEBUG( NULL != sceneGraphConstraint );
       sceneGraphConstraint->SetInitialWeight( mOffstageWeight );
@@ -304,7 +297,6 @@ protected:
   Property::Index mTargetIndex;
 
   ConstraintFunctionPtr mUserFunction;
-  InterpolatorFunction mInterpolatorFunction;
 };
 
 /**
@@ -316,24 +308,21 @@ class ActiveConstraint<float> : public ActiveConstraintBase
 public:
 
   typedef typename PropertyConstraintPtr<float>::Type ConstraintFunctionPtr;
-  typedef boost::function< float (const float&, const float&, float) > InterpolatorFunction;
 
   /**
    * Construct a new active-constraint.
    * @param[in] targetIndex The index of the property to constrain.
    * @param[in] sources The sources of the input properties passed to func.
    * @param[in] func The constraint function.
-   * @param[in] interpolator The interpolator function.
    * @return A newly allocated active-constraint.
    */
   static ActiveConstraintBase* New( Property::Index targetIndex,
                                     SourceContainer& sources,
-                                    ConstraintFunctionPtr func,
-                                    InterpolatorFunction interpolator )
+                                    ConstraintFunctionPtr func )
   {
     ThreadLocalStorage& tls = ThreadLocalStorage::Get();
 
-    return new ActiveConstraint< float >( tls.GetEventToUpdate(), targetIndex, sources, sources.size(), func, interpolator );
+    return new ActiveConstraint< float >( tls.GetEventToUpdate(), targetIndex, sources, sources.size(), func );
   }
 
   /**
@@ -357,8 +346,7 @@ public:
                                            mTargetIndex,
                                            mSources,
                                            mSourceCount,
-                                           funcPtr,
-                                           mInterpolatorFunction );
+                                           funcPtr );
 
     clone->SetAlphaFunction(mAlphaFunction);
     clone->SetRemoveAction(mRemoveAction);
@@ -376,12 +364,10 @@ private:
                     Property::Index targetIndex,
                     SourceContainer& sources,
                     unsigned int sourceCount,
-                    ConstraintFunctionPtr& func,
-                    InterpolatorFunction& interpolator )
+                    ConstraintFunctionPtr& func )
   : ActiveConstraintBase( eventToUpdate, targetIndex, sources, sourceCount ),
     mTargetIndex( targetIndex ),
-    mUserFunction( func ),
-    mInterpolatorFunction( interpolator )
+    mUserFunction( func )
   {
   }
 
@@ -440,7 +426,6 @@ private:
         sceneGraphConstraint = SceneGraphConstraint::New( *targetProperty,
                                                            propertyOwners,
                                                            func,
-                                                           mInterpolatorFunction,
                                                            mCustomWeight );
       }
       else
@@ -454,17 +439,17 @@ private:
           if ( 0 == componentIndex )
           {
             typedef SceneGraph::Constraint< float, PropertyComponentAccessorX<Vector3> > SceneGraphConstraint;
-            sceneGraphConstraint = SceneGraphConstraint::New( *targetProperty, propertyOwners, func, mInterpolatorFunction, mCustomWeight );
+            sceneGraphConstraint = SceneGraphConstraint::New( *targetProperty, propertyOwners, func, mCustomWeight );
           }
           else if ( 1 == componentIndex )
           {
             typedef SceneGraph::Constraint< float, PropertyComponentAccessorY<Vector3> > SceneGraphConstraint;
-            sceneGraphConstraint = SceneGraphConstraint::New( *targetProperty, propertyOwners, func, mInterpolatorFunction, mCustomWeight );
+            sceneGraphConstraint = SceneGraphConstraint::New( *targetProperty, propertyOwners, func, mCustomWeight );
           }
           else if ( 2 == componentIndex )
           {
             typedef SceneGraph::Constraint< float, PropertyComponentAccessorZ<Vector3> > SceneGraphConstraint;
-            sceneGraphConstraint = SceneGraphConstraint::New( *targetProperty, propertyOwners, func, mInterpolatorFunction, mCustomWeight );
+            sceneGraphConstraint = SceneGraphConstraint::New( *targetProperty, propertyOwners, func, mCustomWeight );
           }
         }
         else if ( PropertyTypes::Get< Vector4 >() == targetProperty->GetType() )
@@ -474,22 +459,22 @@ private:
           if ( 0 == componentIndex )
           {
             typedef SceneGraph::Constraint< float, PropertyComponentAccessorX<Vector4> > SceneGraphConstraint;
-            sceneGraphConstraint = SceneGraphConstraint::New( *targetProperty, propertyOwners, func, mInterpolatorFunction, mCustomWeight );
+            sceneGraphConstraint = SceneGraphConstraint::New( *targetProperty, propertyOwners, func, mCustomWeight );
           }
           else if ( 1 == componentIndex )
           {
             typedef SceneGraph::Constraint< float, PropertyComponentAccessorY<Vector4> > SceneGraphConstraint;
-            sceneGraphConstraint = SceneGraphConstraint::New( *targetProperty, propertyOwners, func, mInterpolatorFunction, mCustomWeight );
+            sceneGraphConstraint = SceneGraphConstraint::New( *targetProperty, propertyOwners, func, mCustomWeight );
           }
           else if ( 2 == componentIndex )
           {
             typedef SceneGraph::Constraint< float, PropertyComponentAccessorZ<Vector4> > SceneGraphConstraint;
-            sceneGraphConstraint = SceneGraphConstraint::New( *targetProperty, propertyOwners, func, mInterpolatorFunction, mCustomWeight );
+            sceneGraphConstraint = SceneGraphConstraint::New( *targetProperty, propertyOwners, func, mCustomWeight );
           }
           else if ( 3 == componentIndex )
           {
             typedef SceneGraph::Constraint< float, PropertyComponentAccessorW<Vector4> > SceneGraphConstraint;
-            sceneGraphConstraint = SceneGraphConstraint::New( *targetProperty, propertyOwners, func, mInterpolatorFunction, mCustomWeight );
+            sceneGraphConstraint = SceneGraphConstraint::New( *targetProperty, propertyOwners, func, mCustomWeight );
           }
         }
       }
@@ -613,7 +598,6 @@ protected:
   Property::Index mTargetIndex;
 
   ConstraintFunctionPtr mUserFunction;
-  InterpolatorFunction mInterpolatorFunction;
 };
 
 } // namespace Internal
index 1f0569e..ece2366 100644 (file)
 #include <dali/public-api/math/matrix.h>
 #include <dali/public-api/math/matrix3.h>
 
-namespace
-{
-// Constraint Interpolation function prototypes
-typedef boost::function<bool (const bool& start, const bool& target, float progress)> BoolInterpolator;
-typedef boost::function<float (const float& start, const float& target, float progress)> FloatInterpolator;
-typedef boost::function<int (const int& start, const int& target, float progress)> IntegerInterpolator;
-typedef boost::function<Dali::Vector2 (const Dali::Vector2& current, const Dali::Vector2& target, float progress)> Vector2Interpolator;
-typedef boost::function<Dali::Vector3 (const Dali::Vector3& current, const Dali::Vector3& target, float progress)> Vector3Interpolator;
-typedef boost::function<Dali::Vector4 (const Dali::Vector4& current, const Dali::Vector4& target, float progress)> Vector4Interpolator;
-typedef boost::function<Dali::Quaternion (const Dali::Quaternion& current, const Dali::Quaternion& target, float progress)> QuaternionInterpolator;
-typedef boost::function<Dali::Matrix3 (const Dali::Matrix3& current, const Dali::Matrix3& target, float progress)> Matrix3Interpolator;
-typedef boost::function<Dali::Matrix (const Dali::Matrix& current, const Dali::Matrix& target, float progress)> MatrixInterpolator;
-
-}
-
 namespace Dali
 {
 
@@ -144,8 +129,7 @@ PropertyConstraintBase<P>* CreatePropertyConstraint( Constraint::AnyFunction& fu
 Constraint::Constraint( Property::Index targetIndex,
                         Property::Type targetType,
                         SourceContainer& sources,
-                        AnyFunction& func,
-                        AnyFunction& interpolator )
+                        AnyFunction& func )
 : mApplyTime( 0.0f )
 {
   switch ( targetType )
@@ -156,8 +140,7 @@ Constraint::Constraint( Property::Index targetIndex,
 
       mActiveConstraintTemplate = Dali::ActiveConstraint( ActiveConstraint<bool>::New( targetIndex,
                                                                                        sources,
-                                                                                       funcPtr,
-                                                                                       AnyCast< BoolInterpolator >( interpolator ) ) );
+                                                                                       funcPtr ) );
       break;
     }
 
@@ -167,8 +150,7 @@ Constraint::Constraint( Property::Index targetIndex,
 
       mActiveConstraintTemplate = Dali::ActiveConstraint( ActiveConstraint<float>::New( targetIndex,
                                                                                         sources,
-                                                                                        funcPtr,
-                                                                                        AnyCast< FloatInterpolator >( interpolator ) ) );
+                                                                                        funcPtr ) );
       break;
     }
 
@@ -178,8 +160,7 @@ Constraint::Constraint( Property::Index targetIndex,
 
       mActiveConstraintTemplate = Dali::ActiveConstraint( ActiveConstraint<int>::New( targetIndex,
                                                                                       sources,
-                                                                                      funcPtr,
-                                                                                      AnyCast< IntegerInterpolator >( interpolator ) ) );
+                                                                                      funcPtr ) );
       break;
     }
 
@@ -189,8 +170,7 @@ Constraint::Constraint( Property::Index targetIndex,
 
       mActiveConstraintTemplate = Dali::ActiveConstraint( ActiveConstraint<Vector2>::New( targetIndex,
                                                                                           sources,
-                                                                                          funcPtr,
-                                                                                          AnyCast< Vector2Interpolator >( interpolator ) ) );
+                                                                                          funcPtr ) );
       break;
     }
 
@@ -200,8 +180,7 @@ Constraint::Constraint( Property::Index targetIndex,
 
       mActiveConstraintTemplate = Dali::ActiveConstraint( ActiveConstraint<Vector3>::New( targetIndex,
                                                                                           sources,
-                                                                                          funcPtr,
-                                                                                          AnyCast< Vector3Interpolator >( interpolator ) ) );
+                                                                                          funcPtr ) );
       break;
     }
 
@@ -211,8 +190,7 @@ Constraint::Constraint( Property::Index targetIndex,
 
       mActiveConstraintTemplate = Dali::ActiveConstraint( ActiveConstraint<Vector4>::New( targetIndex,
                                                                                           sources,
-                                                                                          funcPtr,
-                                                                                          AnyCast< Vector4Interpolator >( interpolator ) ) );
+                                                                                          funcPtr ) );
       break;
     }
 
@@ -222,8 +200,7 @@ Constraint::Constraint( Property::Index targetIndex,
 
       mActiveConstraintTemplate = Dali::ActiveConstraint( ActiveConstraint<Quaternion>::New( targetIndex,
                                                                                              sources,
-                                                                                             funcPtr,
-                                                                                             AnyCast< QuaternionInterpolator >( interpolator ) ) );
+                                                                                             funcPtr ) );
       break;
     }
 
@@ -233,8 +210,7 @@ Constraint::Constraint( Property::Index targetIndex,
 
       mActiveConstraintTemplate = Dali::ActiveConstraint( ActiveConstraint<Matrix>::New( targetIndex,
                                                                                          sources,
-                                                                                         funcPtr,
-                                                                                         AnyCast< MatrixInterpolator >( interpolator ) ) );
+                                                                                         funcPtr ) );
       break;
     }
 
@@ -244,8 +220,7 @@ Constraint::Constraint( Property::Index targetIndex,
 
       mActiveConstraintTemplate = Dali::ActiveConstraint( ActiveConstraint<Matrix3>::New( targetIndex,
                                                                                           sources,
-                                                                                          funcPtr,
-                                                                                          AnyCast< Matrix3Interpolator >( interpolator ) ) );
+                                                                                          funcPtr ) );
       break;
     }
 
index 932ee65..d9b2d30 100644 (file)
@@ -50,13 +50,11 @@ public:
    * @param [in] targetType The type of the constrained property.
    * @param [in] sources The objects which provide parameters for func.
    * @param [in] func The constraint function.
-   * @param [in] interpolator A function used to interpolate between the start value, and the value returned by func.
    */
   Constraint( Property::Index target,
               Property::Type targetType,
               SourceContainer& sources,
-              AnyFunction& func,
-              AnyFunction& interpolator );
+              AnyFunction& func );
 
   /**
    * @copydoc Dali::Constraint::SetApplyTime()
index 5d1554c..1c75992 100644 (file)
@@ -152,6 +152,7 @@ internal_src_files = \
   $(internal_src_dir)/render/shaders/program-controller.cpp \
   $(internal_src_dir)/render/shaders/shader.cpp \
   \
+  $(internal_src_dir)/update/animation/interpolator-functions.cpp \
   $(internal_src_dir)/update/animation/scene-graph-animation.cpp \
   $(internal_src_dir)/update/animation/scene-graph-constraint-base.cpp \
   $(internal_src_dir)/update/common/discard-queue.cpp \
  *
  */
 
-// EXTERNAL INCLUDES
-#include <boost/function.hpp>
-
 // INTERNAL INCLUDES
-#include <dali/public-api/animation/interpolator-functions.h>
+#include <dali/internal/update/animation/interpolator-functions.h>
 #include <dali/public-api/math/vector2.h>
 #include <dali/public-api/math/vector3.h>
 #include <dali/public-api/math/vector4.h>
@@ -27,6 +24,7 @@
 #include <dali/public-api/math/matrix.h>
 #include <dali/public-api/math/matrix3.h>
 
+
 namespace
 {
 
@@ -96,63 +94,69 @@ Dali::Matrix3 LerpMatrix3( const Dali::Matrix3& current, const Dali::Matrix3& ta
 namespace Dali
 {
 
-AnyInterpolator GetDefaultInterpolator( Property::Type type )
+namespace Internal
+{
+
+namespace SceneGraph
 {
-  AnyInterpolator function;
+
+CallbackBase* GetDefaultInterpolator( Property::Type type )
+{
+  CallbackBase* function = NULL;
 
   switch ( type )
   {
     case Property::BOOLEAN:
     {
-      function = boost::function<bool (const bool&, const bool&, float)>( &LerpBoolean );
+      function = MakeCallback( LerpBoolean );
       break;
     }
 
     case Property::FLOAT:
     {
-      function = boost::function<float (const float&, const float&, float)>( &LerpFloat );
+      function = MakeCallback( LerpFloat );
       break;
     }
 
     case Property::INTEGER:
     {
-      function = boost::function<int (const int&, const int&, float)>( &LerpInteger );
+      function = MakeCallback( LerpInteger );
       break;
     }
 
     case Property::VECTOR2:
     {
-      function = boost::function<Vector2 (const Vector2&, const Vector2&, float)>( &LerpVector2 );
+      function = MakeCallback( LerpVector2 );
       break;
     }
 
     case Property::VECTOR3:
     {
-      function = boost::function<Vector3 (const Vector3&, const Vector3&, float)>( &LerpVector3 );
+      function = MakeCallback( LerpVector3 );
       break;
     }
 
     case Property::VECTOR4:
     {
-      function = boost::function<Vector4 (const Vector4&, const Vector4&, float)>( &LerpVector4 );
+      function = MakeCallback( LerpVector4 );
       break;
     }
 
     case Property::ROTATION:
     {
-      function = boost::function<Quaternion (const Quaternion&, const Quaternion&, float)>( &SlerpQuaternion );
+      function = MakeCallback( SlerpQuaternion );
       break;
     }
 
     case Property::MATRIX3:
     {
-      function = boost::function<Matrix3 (const Matrix3&, const Matrix3&, float)>(&LerpMatrix3);
+      function = MakeCallback( LerpMatrix3 );
       break;
     }
 
     case Property::MATRIX:
     {
-      function = boost::function<Matrix (const Matrix&, const Matrix&, float)>(&LerpMatrix);
+      function = MakeCallback( LerpMatrix );
       break;
     }
 
@@ -163,5 +167,8 @@ AnyInterpolator GetDefaultInterpolator( Property::Type type )
   return function;
 }
 
+} // namespace SceneGraph
+
+} // namespace Internal
 
 } // namespace Dali
@@ -2,7 +2,7 @@
 #define __DALI_INTERPOLATOR_FUNCTIONS_H__
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 // INTERNAL INCLUDES
 #include <dali/public-api/object/any.h>
 #include <dali/public-api/object/property.h>
+#include <dali/public-api/signals/callback.h>
 
 namespace Dali
 {
 
-/**
- * @brief Any interpolator function.
- */
-typedef Any AnyInterpolator;
+namespace Internal
+{
+
+namespace SceneGraph
+{
 
 /**
  * @brief Retrieve an interpolator function for a property.
  *
- * This can be cast to boost::function<P (const P&, const P&, float)> where P corresponds to the property type.
  * @param[in] type The property type for which to get an interpolator
  * @return The interpolator function.
+ *
+ * @note This returns dynamically allocated memory. The caller is responsible for deleting it.
  */
-AnyInterpolator DALI_IMPORT_API GetDefaultInterpolator(Property::Type type);
+CallbackBase* GetDefaultInterpolator( Property::Type type );
+
+} // namespace Internal
+
+} //namespace SceneGraph
 
 } // namespace Dali
 
index 4866d6a..d8fa34b 100644 (file)
 #include <dali/public-api/animation/active-constraint.h>
 #include <dali/public-api/animation/alpha-functions.h>
 #include <dali/public-api/common/dali-common.h>
+#include <dali/public-api/signals/callback.h>
 #include <dali/internal/event/animation/property-constraint-ptr.h>
 #include <dali/internal/update/common/animatable-property.h>
 #include <dali/internal/update/common/property-owner.h>
+#include <dali/internal/update/animation/interpolator-functions.h>
 #include <dali/internal/update/animation/scene-graph-constraint-base.h>
 #include <dali/internal/render/common/performance-monitor.h>
 
@@ -57,14 +59,12 @@ public:
    * @param[in] targetProperty The target property.
    * @param[in] ownerSet A set of property owners; func is connected to the properties provided by these objects.
    * @param[in] func The function to calculate the final constrained value.
-   * @param[in] interpolator The function to interpolate between start & final value.
    * @param[in] customWeight A custom weight property, or NULL if the constraint is using its own.
    * @return A smart-pointer to a newly allocated constraint.
    */
   static ConstraintBase* New( const PropertyBase& targetProperty,
                               PropertyOwnerContainer& ownerContainer,
                               ConstraintFunctionPtr func,
-                              InterpolatorFunc interpolator,
                               const AnimatableProperty<float>* customWeight )
   {
     // Scene-graph thread can edit these objects
@@ -73,7 +73,6 @@ public:
     return new Constraint< PropertyType, PropertyAccessorType >( property,
                                                                  ownerContainer,
                                                                  func,
-                                                                 interpolator,
                                                                  customWeight );
   }
 
@@ -82,6 +81,7 @@ public:
    */
   virtual ~Constraint()
   {
+    delete mInterpolator;
   }
 
   /**
@@ -129,8 +129,9 @@ public:
            ! Equals( Dali::ActiveConstraint::FINAL_WEIGHT, (*mWeightInput)[updateBufferIndex] ) )
       {
         // Constraint is not fully-applied; interpolation between start & final values
-        mTargetProperty.Set( updateBufferIndex,
-                             mInterpolator( current, mFunc->Apply( updateBufferIndex, current ), (*mWeightInput)[updateBufferIndex] ) );
+        mTargetProperty.Set(
+            updateBufferIndex,
+            CallbackBase::ExecuteReturn< PropertyType, const PropertyType&, const PropertyType&, float >( *mInterpolator, current, mFunc->Apply( updateBufferIndex, current ), (*mWeightInput)[updateBufferIndex] ));
       }
       else
       {
@@ -161,12 +162,11 @@ private:
   Constraint( PropertyBase& targetProperty,
               PropertyOwnerContainer& ownerContainer,
               ConstraintFunctionPtr func,
-              InterpolatorFunc interpolator,
               const AnimatableProperty<float>* customWeight )
   : ConstraintBase( ownerContainer ),
     mTargetProperty( &targetProperty ),
     mFunc( func ),
-    mInterpolator( interpolator ),
+    mInterpolator( GetDefaultInterpolator( PropertyTypes::Get< PropertyType >() ) ),
     mWeightInput( customWeight ? customWeight : &mWeight)
   {
   }
@@ -193,7 +193,7 @@ protected:
 
   ConstraintFunctionPtr mFunc;
 
-  InterpolatorFunc mInterpolator;
+  CallbackBase* mInterpolator;
 
   const AnimatableProperty<float>* mWeightInput;
 };
index faf703a..2174d6f 100644 (file)
@@ -99,23 +99,20 @@ unsigned int Constraint::GetTag() const
 
 Constraint Constraint::New( Property::Index target,
                             Property::Type targetType,
-                            AnyFunction func,
-                            AnyFunction interpolator )
+                            AnyFunction func )
 {
   Internal::SourceContainer sources; // empty
 
   return Constraint( new Internal::Constraint( target,
                                                targetType,
                                                sources,
-                                               func,
-                                               interpolator ) );
+                                               func ) );
 }
 
 Constraint Constraint::New( Property::Index target,
                             Property::Type targetType,
                             ConstraintSource source1,
-                            AnyFunction func,
-                            AnyFunction interpolator )
+                            AnyFunction func )
 {
   Internal::SourceContainer sources;
   sources.push_back( Internal::Source( source1 ) );
@@ -123,16 +120,14 @@ Constraint Constraint::New( Property::Index target,
   return Constraint( new Internal::Constraint( target,
                                                targetType,
                                                sources,
-                                               func,
-                                               interpolator ) );
+                                               func ) );
 }
 
 Constraint Constraint::New( Property::Index target,
                             Property::Type targetType,
                             ConstraintSource source1,
                             ConstraintSource source2,
-                            AnyFunction func,
-                            AnyFunction interpolator )
+                            AnyFunction func )
 {
   Internal::SourceContainer sources;
   sources.push_back( Internal::Source( source1 ) );
@@ -141,8 +136,7 @@ Constraint Constraint::New( Property::Index target,
   return Constraint( new Internal::Constraint( target,
                                                targetType,
                                                sources,
-                                               func,
-                                               interpolator ) );
+                                               func ) );
 }
 
 Constraint Constraint::New( Property::Index target,
@@ -150,8 +144,7 @@ Constraint Constraint::New( Property::Index target,
                             ConstraintSource source1,
                             ConstraintSource source2,
                             ConstraintSource source3,
-                            AnyFunction func,
-                            AnyFunction interpolator )
+                            AnyFunction func )
 {
   Internal::SourceContainer sources;
   sources.push_back( Internal::Source( source1 ) );
@@ -161,8 +154,7 @@ Constraint Constraint::New( Property::Index target,
   return Constraint( new Internal::Constraint( target,
                                                targetType,
                                                sources,
-                                               func,
-                                               interpolator ) );
+                                               func ) );
 }
 
 Constraint Constraint::New( Property::Index target,
@@ -171,8 +163,7 @@ Constraint Constraint::New( Property::Index target,
                             ConstraintSource source2,
                             ConstraintSource source3,
                             ConstraintSource source4,
-                            AnyFunction func,
-                            AnyFunction interpolator )
+                            AnyFunction func )
 {
   Internal::SourceContainer sources;
   sources.push_back( Internal::Source( source1 ) );
@@ -183,8 +174,7 @@ Constraint Constraint::New( Property::Index target,
   return Constraint( new Internal::Constraint( target,
                                                targetType,
                                                sources,
-                                               func,
-                                               interpolator ) );
+                                               func ) );
 }
 
 Constraint Constraint::New( Property::Index target,
@@ -194,8 +184,7 @@ Constraint Constraint::New( Property::Index target,
                             ConstraintSource source3,
                             ConstraintSource source4,
                             ConstraintSource source5,
-                            AnyFunction func,
-                            AnyFunction interpolator )
+                            AnyFunction func )
 {
   Internal::SourceContainer sources;
   sources.push_back( Internal::Source( source1 ) );
@@ -207,8 +196,7 @@ Constraint Constraint::New( Property::Index target,
   return Constraint( new Internal::Constraint( target,
                                                targetType,
                                                sources,
-                                               func,
-                                               interpolator ) );
+                                               func ) );
 }
 
 Constraint Constraint::New( Property::Index target,
@@ -219,8 +207,7 @@ Constraint Constraint::New( Property::Index target,
                             ConstraintSource source4,
                             ConstraintSource source5,
                             ConstraintSource source6,
-                            AnyFunction func,
-                            AnyFunction interpolator )
+                            AnyFunction func )
 {
   Internal::SourceContainer sources;
   sources.push_back( Internal::Source( source1 ) );
@@ -233,8 +220,7 @@ Constraint Constraint::New( Property::Index target,
   return Constraint( new Internal::Constraint( target,
                                                targetType,
                                                sources,
-                                               func,
-                                               interpolator ) );
+                                               func ) );
 }
 
 Constraint Constraint::DownCast( BaseHandle handle )
index e7bb48a..e849cd8 100644 (file)
@@ -24,7 +24,6 @@
 // INTERNAL INCLUDES
 #include <dali/public-api/animation/alpha-functions.h>
 #include <dali/public-api/animation/constraint-source.h>
-#include <dali/public-api/animation/interpolator-functions.h>
 #include <dali/public-api/object/any.h>
 #include <dali/public-api/object/handle.h>
 #include <dali/public-api/object/property.h>
@@ -51,7 +50,7 @@ class DALI_IMPORT_API Constraint : public BaseHandle
 {
 public:
 
-  typedef Any AnyFunction; ///< Generic function pointer for constraint and interpolator functions
+  typedef Any AnyFunction; ///< Generic function pointer for constraint
 
   /**
    * @brief The action that will happen when the constraint is removed.
@@ -80,7 +79,6 @@ public:
    * @brief Create a constraint which targets a property.
    *
    * The templated parameter P, is the type of the property to constrain.
-   * Animation will be performed using the default interpolator.
    * @param [in] target The index of the property to constrain.
    * @param [in] func A function which returns the constrained property value.
    * @return The new constraint.
@@ -91,8 +89,7 @@ public:
   {
     return New( target,
                 PropertyTypes::Get<P>(),
-                func,
-                GetDefaultInterpolator( PropertyTypes::Get<P>() ) );
+                func );
   }
 
   /**
@@ -100,27 +97,6 @@ public:
    *
    * The templated parameter P, is the type of the property to constrain.
    * @param [in] target The index of the property to constrain.
-   * @param [in] func A function which returns the constrained property value.
-   * @param [in] interpolator A function used to interpolate between the start value, and the value returned by func.
-   * @return The new constraint.
-   */
-  template <class P>
-  static Constraint NewWithInterpolator( Property::Index target,
-                                         boost::function<P (const P& current)> func,
-                                         boost::function<P (const P&, const P&, float)> interpolator )
-  {
-    return New( target,
-                PropertyTypes::Get<P>(),
-                func,
-                interpolator );
-  }
-
-  /**
-   * @brief Create a constraint which targets a property.
-   *
-   * The templated parameter P, is the type of the property to constrain.
-   * Animation will be performed using the default interpolator.
-   * @param [in] target The index of the property to constrain.
    * @param [in] source1 The source of a property; the current value will be passed as the 2nd parameter of func.
    * @param [in] func A function which returns the constrained property value.
    * @return The new constraint.
@@ -133,8 +109,7 @@ public:
     return New( target,
                 PropertyTypes::Get<P>(),
                 source1,
-                func,
-                GetDefaultInterpolator( PropertyTypes::Get<P>() ) );
+                func );
   }
 
   /**
@@ -143,30 +118,6 @@ public:
    * The templated parameter P, is the type of the property to constrain.
    * @param [in] target The index of the property to constrain.
    * @param [in] source1 The source of a property; the current value will be passed as the 2nd parameter of func.
-   * @param [in] func A function which returns the constrained property value.
-   * @param [in] interpolator A function used to interpolate between the start value, and the value returned by func.
-   * @return The new constraint.
-   */
-  template <class P>
-  static Constraint NewWithInterpolator( Property::Index target,
-                                         ConstraintSource source1,
-                                         boost::function<P (const P& current, const PropertyInput& input1)> func,
-                                         boost::function<P (const P&, const P&, float)> interpolator )
-  {
-    return New( target,
-                PropertyTypes::Get<P>(),
-                source1,
-                func,
-                interpolator );
-  }
-
-  /**
-   * @brief Create a constraint which targets a property.
-   *
-   * The templated parameter P, is the type of the property to constrain.
-   * Animation will be performed using the default interpolator.
-   * @param [in] target The index of the property to constrain.
-   * @param [in] source1 The source of a property; the current value will be passed as the 2nd parameter of func.
    * @param [in] source2 The source of a property; the current value will be passed as the 3rd parameter of func.
    * @param [in] func A function which returns the constrained property value.
    * @return The new constraint.
@@ -181,41 +132,13 @@ public:
                 PropertyTypes::Get<P>(),
                 source1,
                 source2,
-                func,
-                GetDefaultInterpolator(PropertyTypes::Get<P>()) );
-  }
-
-  /**
-   * @brief Create a constraint which targets a property.
-   *
-   * The templated parameter P, is the type of the property to constrain.
-   * @param [in] target The index of the property to constrain.
-   * @param [in] source1 The source of a property; the current value will be passed as the 2nd parameter of func.
-   * @param [in] source2 The source of a property; the current value will be passed as the 3rd parameter of func.
-   * @param [in] func A function which returns the constrained property value.
-   * @param [in] interpolator A function used to interpolate between the start value, and the value returned by func.
-   * @return The new constraint.
-   */
-  template <class P>
-  static Constraint NewWithInterpolator( Property::Index target,
-                                         ConstraintSource source1,
-                                         ConstraintSource source2,
-                                         boost::function<P (const P& current, const PropertyInput& input1, const PropertyInput& input2)> func,
-                                         boost::function<P (const P&, const P&, float)> interpolator )
-  {
-    return New( target,
-                PropertyTypes::Get<P>(),
-                source1,
-                source2,
-                func,
-                interpolator );
+                func );
   }
 
   /**
    * @brief Create a constraint which targets a property.
    *
    * The templated parameter P, is the type of the property to constrain.
-   * Animation will be performed using the default interpolator.
    * @param [in] target The index of the property to constrain.
    * @param [in] source1 The source of a property; the current value will be passed as the 2nd parameter of func.
    * @param [in] source2 The source of a property; the current value will be passed as the 3rd parameter of func.
@@ -235,8 +158,7 @@ public:
                 source1,
                 source2,
                 source3,
-                func,
-                GetDefaultInterpolator(PropertyTypes::Get<P>()) );
+                func );
   }
 
   /**
@@ -247,36 +169,6 @@ public:
    * @param [in] source1 The source of a property; the current value will be passed as the 2nd parameter of func.
    * @param [in] source2 The source of a property; the current value will be passed as the 3rd parameter of func.
    * @param [in] source3 The source of a property; the current value will be passed as the 4th parameter of func.
-   * @param [in] func A function which returns the constrained property value.
-   * @param [in] interpolator A function used to interpolate between the start value, and the value returned by func.
-   * @return The new constraint.
-   */
-  template <class P>
-  static Constraint NewWithInterpolator( Property::Index target,
-                                         ConstraintSource source1,
-                                         ConstraintSource source2,
-                                         ConstraintSource source3,
-                                         boost::function<P (const P& current, const PropertyInput& input1, const PropertyInput& input2, const PropertyInput& input3)> func,
-                                         boost::function<P (const P&, const P&, float)> interpolator )
-  {
-    return New( target,
-                PropertyTypes::Get<P>(),
-                source1,
-                source2,
-                source3,
-                func,
-                interpolator );
-  }
-
-  /**
-   * @brief Create a constraint which targets a property.
-   *
-   * The templated parameter P, is the type of the property to constrain.
-   * Animation will be performed using the default interpolator.
-   * @param [in] target The index of the property to constrain.
-   * @param [in] source1 The source of a property; the current value will be passed as the 2nd parameter of func.
-   * @param [in] source2 The source of a property; the current value will be passed as the 3rd parameter of func.
-   * @param [in] source3 The source of a property; the current value will be passed as the 4th parameter of func.
    * @param [in] source4 The source of a property; the current value will be passed as the 5th parameter of func.
    * @param [in] func A function which returns the constrained property value.
    * @return The new constraint.
@@ -299,51 +191,13 @@ public:
                 source2,
                 source3,
                 source4,
-                func,
-                GetDefaultInterpolator(PropertyTypes::Get<P>()) );
-  }
-
-  /**
-   * @brief Create a constraint which targets a property.
-   *
-   * The templated parameter P, is the type of the property to constrain.
-   * @param [in] target The index of the property to constrain.
-   * @param [in] source1 The source of a property; the current value will be passed as the 2nd parameter of func.
-   * @param [in] source2 The source of a property; the current value will be passed as the 3rd parameter of func.
-   * @param [in] source3 The source of a property; the current value will be passed as the 4th parameter of func.
-   * @param [in] source4 The source of a property; the current value will be passed as the 5th parameter of func.
-   * @param [in] func A function which returns the constrained property value.
-   * @param [in] interpolator A function used to interpolate between the start value, and the value returned by func.
-   * @return The new constraint.
-   */
-  template <class P>
-  static Constraint NewWithInterpolator( Property::Index target,
-                                         ConstraintSource source1,
-                                         ConstraintSource source2,
-                                         ConstraintSource source3,
-                                         ConstraintSource source4,
-                                         boost::function<P (const P& current,
-                                                            const PropertyInput& input1,
-                                                            const PropertyInput& input2,
-                                                            const PropertyInput& input3,
-                                                            const PropertyInput& input4)> func,
-                                         boost::function<P (const P&, const P&, float)> interpolator )
-  {
-    return New( target,
-                PropertyTypes::Get<P>(),
-                source1,
-                source2,
-                source3,
-                source4,
-                func,
-                interpolator );
+                func );
   }
 
   /**
    * @brief Create a constraint which targets a property.
    *
    * The templated parameter P, is the type of the property to constrain.
-   * Animation will be performed using the default interpolator.
    * @param [in] target The index of the property to constrain.
    * @param [in] source1 The source of a property; the current value will be passed as the 2nd parameter of func.
    * @param [in] source2 The source of a property; the current value will be passed as the 3rd parameter of func.
@@ -374,55 +228,13 @@ public:
                 source3,
                 source4,
                 source5,
-                func,
-                GetDefaultInterpolator(PropertyTypes::Get<P>()) );
-  }
-
-  /**
-   * @brief Create a constraint which targets a property.
-   *
-   * The templated parameter P, is the type of the property to constrain.
-   * @param [in] target The index of the property to constrain.
-   * @param [in] source1 The source of a property; the current value will be passed as the 2nd parameter of func.
-   * @param [in] source2 The source of a property; the current value will be passed as the 3rd parameter of func.
-   * @param [in] source3 The source of a property; the current value will be passed as the 4th parameter of func.
-   * @param [in] source4 The source of a property; the current value will be passed as the 5th parameter of func.
-   * @param [in] source5 The source of a property; the current value will be passed as the 6th parameter of func.
-   * @param [in] func A function which returns the constrained property value.
-   * @param [in] interpolator A function used to interpolate between the start value, and the value returned by func.
-   * @return The new constraint.
-   */
-  template <class P>
-  static Constraint NewWithInterpolator( Property::Index target,
-                                         ConstraintSource source1,
-                                         ConstraintSource source2,
-                                         ConstraintSource source3,
-                                         ConstraintSource source4,
-                                         ConstraintSource source5,
-                                         boost::function<P (const P& current,
-                                                            const PropertyInput& input1,
-                                                            const PropertyInput& input2,
-                                                            const PropertyInput& input3,
-                                                            const PropertyInput& input4,
-                                                            const PropertyInput& input5)> func,
-                                         boost::function<P (const P&, const P&, float)> interpolator )
-  {
-    return New( target,
-                PropertyTypes::Get<P>(),
-                source1,
-                source2,
-                source3,
-                source4,
-                source5,
-                func,
-                interpolator );
+                func );
   }
 
   /**
    * @brief Create a constraint which targets a property.
    *
    * The templated parameter P, is the type of the property to constrain.
-   * Animation will be performed using the default interpolator.
    * @param [in] target The index of the property to constrain.
    * @param [in] source1 The source of a property; the current value will be passed as the 2nd parameter of func.
    * @param [in] source2 The source of a property; the current value will be passed as the 3rd parameter of func.
@@ -457,52 +269,7 @@ public:
                 source4,
                 source5,
                 source6,
-                func,
-                GetDefaultInterpolator(PropertyTypes::Get<P>()) );
-  }
-
-  /**
-   * @brief Create a constraint which targets a property.
-   *
-   * The templated parameter P, is the type of the property to constrain.
-   * @param [in] target The index of the property to constrain.
-   * @param [in] source1 The source of a property; the current value will be passed as the 2nd parameter of func.
-   * @param [in] source2 The source of a property; the current value will be passed as the 3rd parameter of func.
-   * @param [in] source3 The source of a property; the current value will be passed as the 4th parameter of func.
-   * @param [in] source4 The source of a property; the current value will be passed as the 5th parameter of func.
-   * @param [in] source5 The source of a property; the current value will be passed as the 6th parameter of func.
-   * @param [in] source6 The source of a property; the current value will be passed as the 7th parameter of func.
-   * @param [in] func A function which returns the constrained property value.
-   * @param [in] interpolator A function used to interpolate between the start value, and the value returned by func.
-   * @return The new constraint.
-   */
-  template <class P>
-  static Constraint NewWithInterpolator( Property::Index target,
-                                         ConstraintSource source1,
-                                         ConstraintSource source2,
-                                         ConstraintSource source3,
-                                         ConstraintSource source4,
-                                         ConstraintSource source5,
-                                         ConstraintSource source6,
-                                         boost::function<P (const P& current,
-                                                            const PropertyInput& input1,
-                                                            const PropertyInput& input2,
-                                                            const PropertyInput& input3,
-                                                            const PropertyInput& input4,
-                                                            const PropertyInput& input5,
-                                                            const PropertyInput& input6)> func,
-                                         boost::function<P (const P&, const P&, float)> interpolator )
-  {
-    return New( target,
-                PropertyTypes::Get<P>(),
-                source1,
-                source2,
-                source3,
-                source4,
-                source5,
-                source6,
-                func,
-                interpolator );
+                func );
   }
 
   /**
@@ -613,13 +380,11 @@ private: // Not intended for use by Application developers
    * @param [in] target The index of the property to constrain.
    * @param [in] targetType The type of the constrained property.
    * @param [in] func The constraint function.
-   * @param [in] interpolator A function used to interpolate between the start value, and the value returned by func.
    * @return The new constraint.
    */
   static Constraint New( Property::Index target,
                          Property::Type targetType,
-                         AnyFunction func,
-                         AnyFunction interpolator );
+                         AnyFunction func );
 
   /**
    * @brief Construct a new constraint which targets a property.
@@ -628,14 +393,12 @@ private: // Not intended for use by Application developers
    * @param [in] targetType The type of the constrained property.
    * @param [in] source1 The source of a property; the current value will be passed as the 2nd parameter of func.
    * @param [in] func The constraint function.
-   * @param [in] interpolator A function used to interpolate between the start value, and the value returned by func.
    * @return The new constraint.
    */
   static Constraint New( Property::Index target,
                          Property::Type targetType,
                          ConstraintSource source1,
-                         AnyFunction func,
-                         AnyFunction interpolator );
+                         AnyFunction func );
 
   /**
    * @brief Construct a new constraint which targets a property.
@@ -645,15 +408,13 @@ private: // Not intended for use by Application developers
    * @param [in] source1 The source of a property; the current value will be passed as the 2nd parameter of func.
    * @param [in] source2 The source of a property; the current value will be passed as the 3rd parameter of func.
    * @param [in] func The constraint function.
-   * @param [in] interpolator A function used to interpolate between the start value, and the value returned by func.
    * @return The new constraint.
    */
   static Constraint New( Property::Index target,
                          Property::Type targetType,
                          ConstraintSource source1,
                          ConstraintSource source2,
-                         AnyFunction func,
-                         AnyFunction interpolator );
+                         AnyFunction func );
 
   /**
    * @brief Construct a new constraint which targets a property.
@@ -664,7 +425,6 @@ private: // Not intended for use by Application developers
    * @param [in] source2 The source of a property; the current value will be passed as the 3rd parameter of func.
    * @param [in] source3 The source of a property; the current value will be passed as the 4th parameter of func.
    * @param [in] func The constraint function.
-   * @param [in] interpolator A function used to interpolate between the start value, and the value returned by func.
    * @return The new constraint.
    */
   static Constraint New( Property::Index target,
@@ -672,8 +432,7 @@ private: // Not intended for use by Application developers
                          ConstraintSource source1,
                          ConstraintSource source2,
                          ConstraintSource source3,
-                         AnyFunction func,
-                         AnyFunction interpolator );
+                         AnyFunction func );
 
   /**
    * @brief Construct a new constraint which targets a property.
@@ -685,7 +444,6 @@ private: // Not intended for use by Application developers
    * @param [in] source3 The source of a property; the current value will be passed as the 4th parameter of func.
    * @param [in] source4 The source of a property; the current value will be passed as the 5th parameter of func.
    * @param [in] func The constraint function.
-   * @param [in] interpolator A function used to interpolate between the start value, and the value returned by func.
    * @return The new constraint.
    */
   static Constraint New( Property::Index target,
@@ -694,8 +452,7 @@ private: // Not intended for use by Application developers
                          ConstraintSource source2,
                          ConstraintSource source3,
                          ConstraintSource source4,
-                         AnyFunction func,
-                         AnyFunction interpolator );
+                         AnyFunction func );
 
   /**
    * @brief Construct a new constraint which targets a property.
@@ -708,7 +465,6 @@ private: // Not intended for use by Application developers
    * @param [in] source4 The source of a property; the current value will be passed as the 5th parameter of func.
    * @param [in] source5 The source of a property; the current value will be passed as the 6th parameter of func.
    * @param [in] func The constraint function.
-   * @param [in] interpolator A function used to interpolate between the start value, and the value returned by func.
    * @return The new constraint.
    */
   static Constraint New( Property::Index target,
@@ -718,8 +474,7 @@ private: // Not intended for use by Application developers
                          ConstraintSource source3,
                          ConstraintSource source4,
                          ConstraintSource source5,
-                         AnyFunction func,
-                         AnyFunction interpolator );
+                         AnyFunction func );
 
   /**
    * @brief Construct a new constraint which targets a property.
@@ -733,7 +488,6 @@ private: // Not intended for use by Application developers
    * @param [in] source5 The source of a property; the current value will be passed as the 6th parameter of func.
    * @param [in] source6 The source of a property; the current value will be passed as the 7th parameter of func.
    * @param [in] func The constraint function.
-   * @param [in] interpolator A function used to interpolate between the start value, and the value returned by func.
    * @return The new constraint.
    */
   static Constraint New( Property::Index target,
@@ -744,8 +498,7 @@ private: // Not intended for use by Application developers
                          ConstraintSource source4,
                          ConstraintSource source5,
                          ConstraintSource source6,
-                         AnyFunction func,
-                         AnyFunction interpolator );
+                         AnyFunction func );
 };
 
 } // namespace Dali
index 55a7b4d..e1578bc 100644 (file)
@@ -40,7 +40,6 @@
 #include <dali/public-api/animation/constraint-source.h>
 #include <dali/public-api/animation/constraint.h>
 #include <dali/public-api/animation/constraints.h>
-#include <dali/public-api/animation/interpolator-functions.h>
 #include <dali/public-api/animation/key-frames.h>
 #include <dali/public-api/animation/path.h>
 #include <dali/public-api/animation/time-period.h>
index 4346e5d..b31bee7 100644 (file)
@@ -16,7 +16,6 @@ public_api_src_files = \
   $(public_api_src_dir)/animation/alpha-functions.cpp \
   $(public_api_src_dir)/animation/constraint.cpp \
   $(public_api_src_dir)/animation/constraint-source.cpp \
-  $(public_api_src_dir)/animation/interpolator-functions.cpp \
   $(public_api_src_dir)/animation/key-frames.cpp \
   $(public_api_src_dir)/animation/path.cpp \
   $(public_api_src_dir)/animation/time-period.cpp \
@@ -144,7 +143,6 @@ public_api_core_animation_header_files = \
   $(public_api_src_dir)/animation/constraints.h \
   $(public_api_src_dir)/animation/constraint-functions.h \
   $(public_api_src_dir)/animation/constraint-source.h \
-  $(public_api_src_dir)/animation/interpolator-functions.h \
   $(public_api_src_dir)/animation/key-frames.h \
   $(public_api_src_dir)/animation/path.h \
   $(public_api_src_dir)/animation/time-period.h