Merge "[ElmSharp] Fix typo AnimatorMotionMapper.Calculate" preview1-00327
authorWonYoung Choi <wy80.choi@samsung.com>
Mon, 23 Oct 2017 03:01:11 +0000 (03:01 +0000)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Mon, 23 Oct 2017 03:01:11 +0000 (03:01 +0000)
src/ElmSharp/ElmSharp/IAnimatorMotionMapper.cs [moved from src/ElmSharp/ElmSharp/AnimatorMotionMapper.cs with 82% similarity, mode: 0644]
test/ElmSharp.Test/TC/EcoreTimelineAnimatorTest1.cs
test/ElmSharp.Test/TC/Wearable/EcoreTimelineAnimatorTest1.cs

old mode 100755 (executable)
new mode 100644 (file)
similarity index 82%
rename from src/ElmSharp/ElmSharp/AnimatorMotionMapper.cs
rename to src/ElmSharp/ElmSharp/IAnimatorMotionMapper.cs
index 22db0c5..8ed3d37
@@ -7,23 +7,23 @@ namespace ElmSharp
     /// <summary>
     /// The AnimatorMotionMapper interface
     /// </summary>
-    public interface AnimatorMotionMapper
+    public interface IAnimatorMotionMapper
     {
         /// <summary>
         /// Maps an input position from 0.0 to 1.0 along a timeline to a position in a different curve
         /// </summary>
-        double Caculate(double position);
+        double Calculate(double position);
     }
 
     /// <summary>
     /// The LinearMotionMapper class
     /// </summary>
-    public class LinearMotionMapper : AnimatorMotionMapper
+    public class LinearMotionMapper : IAnimatorMotionMapper
     {
         /// <summary>
         /// Maps an input position from 0.0 to 1.0 along a timeline to a position in a different curve
         /// </summary>
-        public double Caculate(double position)
+        public double Calculate(double position)
         {
             return Interop.Ecore.ecore_animator_pos_map(position, Interop.Ecore.PositionMap.Linear, 0, 0);
         }
@@ -32,12 +32,12 @@ namespace ElmSharp
     /// <summary>
     /// The AccelerateMotionMapper class
     /// </summary>
-    public class AccelerateMotionMapper : AnimatorMotionMapper
+    public class AccelerateMotionMapper : IAnimatorMotionMapper
     {
         /// <summary>
         /// Maps an input position from 0.0 to 1.0 along a timeline to a position in a different curve
         /// </summary>
-        public double Caculate(double position)
+        public double Calculate(double position)
         {
             return Interop.Ecore.ecore_animator_pos_map(position, Interop.Ecore.PositionMap.Accelerate, 0, 0);
         }
@@ -46,12 +46,12 @@ namespace ElmSharp
     /// <summary>
     /// The DecelerateMotionMapper class
     /// </summary>
-    public class DecelerateMotionMapper : AnimatorMotionMapper
+    public class DecelerateMotionMapper : IAnimatorMotionMapper
     {
         /// <summary>
         /// Maps an input position from 0.0 to 1.0 along a timeline to a position in a different curve
         /// </summary>
-        public double Caculate(double position)
+        public double Calculate(double position)
         {
             return Interop.Ecore.ecore_animator_pos_map(position, Interop.Ecore.PositionMap.Decelerate, 0, 0);
         }
@@ -60,12 +60,12 @@ namespace ElmSharp
     /// <summary>
     /// The SinusoidalMotionMapper class
     /// </summary>
-    public class SinusoidalMotionMapper : AnimatorMotionMapper
+    public class SinusoidalMotionMapper : IAnimatorMotionMapper
     {
         /// <summary>
         /// Maps an input position from 0.0 to 1.0 along a timeline to a position in a different curve
         /// </summary>
-        public double Caculate(double position)
+        public double Calculate(double position)
         {
             return Interop.Ecore.ecore_animator_pos_map(position, Interop.Ecore.PositionMap.Sinusoidal, 0, 0);
         }
@@ -74,7 +74,7 @@ namespace ElmSharp
     /// <summary>
     /// The AccelerateFactorMotionMapper class
     /// </summary>
-    public class AccelerateFactorMotionMapper : AnimatorMotionMapper
+    public class AccelerateFactorMotionMapper : IAnimatorMotionMapper
     {
         /// <summary>
         /// The power factor of AccelerateFactorMotionMapper
@@ -84,7 +84,7 @@ namespace ElmSharp
         /// <summary>
         /// Maps an input position from 0.0 to 1.0 along a timeline to a position in a different curve
         /// </summary>
-        public double Caculate(double position)
+        public double Calculate(double position)
         {
             return Interop.Ecore.ecore_animator_pos_map(position, Interop.Ecore.PositionMap.AccelerateFactor, PowerFactor, 0);
         }
@@ -93,7 +93,7 @@ namespace ElmSharp
     /// <summary>
     /// The DecelerateFactorMotionMapper class
     /// </summary>
-    public class DecelerateFactorMotionMapper : AnimatorMotionMapper
+    public class DecelerateFactorMotionMapper : IAnimatorMotionMapper
     {
         /// <summary>
         /// The power factor of DecelerateFactorMotionMapper
@@ -103,7 +103,7 @@ namespace ElmSharp
         /// <summary>
         /// Maps an input position from 0.0 to 1.0 along a timeline to a position in a different curve
         /// </summary>
-        public double Caculate(double position)
+        public double Calculate(double position)
         {
             return Interop.Ecore.ecore_animator_pos_map(position, Interop.Ecore.PositionMap.DecelerateFactor, PowerFactor, 0);
         }
@@ -112,7 +112,7 @@ namespace ElmSharp
     /// <summary>
     /// The SinusoidalFactorMotionMapper class
     /// </summary>
-    public class SinusoidalFactorMotionMapper : AnimatorMotionMapper
+    public class SinusoidalFactorMotionMapper : IAnimatorMotionMapper
     {
         /// <summary>
         /// The power factor of SinusoidalFactorMotionMapper
@@ -122,7 +122,7 @@ namespace ElmSharp
         /// <summary>
         /// Maps an input position from 0.0 to 1.0 along a timeline to a position in a different curve
         /// </summary>
-        public double Caculate(double position)
+        public double Calculate(double position)
         {
             return Interop.Ecore.ecore_animator_pos_map(position, Interop.Ecore.PositionMap.SinusoidalFactor, PowerFactor, 0);
         }
@@ -131,7 +131,7 @@ namespace ElmSharp
     /// <summary>
     /// The DivisorInterpolatedMotionMapper class
     /// </summary>
-    public class DivisorInterpolatedMotionMapper : AnimatorMotionMapper
+    public class DivisorInterpolatedMotionMapper : IAnimatorMotionMapper
     {
         /// <summary>
         /// The Divisor of DivisorInterpolatedMotionMapper
@@ -146,7 +146,7 @@ namespace ElmSharp
         /// <summary>
         /// Maps an input position from 0.0 to 1.0 along a timeline to a position in a different curve
         /// </summary>
-        public double Caculate(double position)
+        public double Calculate(double position)
         {
             return Interop.Ecore.ecore_animator_pos_map(position, Interop.Ecore.PositionMap.DivisorInterp, Divisor, Power);
         }
@@ -155,7 +155,7 @@ namespace ElmSharp
     /// <summary>
     /// The BounceMotionMapper class
     /// </summary>
-    public class BounceMotionMapper : AnimatorMotionMapper
+    public class BounceMotionMapper : IAnimatorMotionMapper
     {
         /// <summary>
         /// The bounces of BounceMotionMapper
@@ -170,7 +170,7 @@ namespace ElmSharp
         /// <summary>
         /// Maps an input position from 0.0 to 1.0 along a timeline to a position in a different curve
         /// </summary>
-        public double Caculate(double position)
+        public double Calculate(double position)
         {
             return Interop.Ecore.ecore_animator_pos_map(position, Interop.Ecore.PositionMap.Bounce, DecayFactor, Bounces);
         }
@@ -179,7 +179,7 @@ namespace ElmSharp
     /// <summary>
     /// The SpringMotionMapper class
     /// </summary>
-    public class SpringMotionMapper : AnimatorMotionMapper
+    public class SpringMotionMapper : IAnimatorMotionMapper
     {
         /// <summary>
         /// The wobbles of SpringMotionMapper
@@ -194,7 +194,7 @@ namespace ElmSharp
         /// <summary>
         /// Maps an input position from 0.0 to 1.0 along a timeline to a position in a different curve
         /// </summary>
-        public double Caculate(double position)
+        public double Calculate(double position)
         {
             return Interop.Ecore.ecore_animator_pos_map(position, Interop.Ecore.PositionMap.Bounce, DecayFactor, Wobbles);
         }
@@ -203,7 +203,7 @@ namespace ElmSharp
     /// <summary>
     /// The CubicBezierMotionMapper class
     /// </summary>
-    public class CubicBezierMotionMapper : AnimatorMotionMapper
+    public class CubicBezierMotionMapper : IAnimatorMotionMapper
     {
         /// <summary>
         /// The X1 of CubicBezierMotionMapper
@@ -228,7 +228,7 @@ namespace ElmSharp
         /// <summary>
         /// Maps an input position from 0.0 to 1.0 along a timeline to a position in a different curve
         /// </summary>
-        public double Caculate(double position)
+        public double Calculate(double position)
         {
             double[] values = { X1, Y1, X2, Y2 };
             return Interop.Ecore.ecore_animator_pos_map_n(position, Interop.Ecore.PositionMap.Bounce, values.Length, values);
index e112cbb..6a09caf 100644 (file)
@@ -16,19 +16,19 @@ namespace ElmSharp.Test
 
         int X1, Y1, X2, Y2;
 
-        Tuple<string, AnimatorMotionMapper>[] mappers =
+        Tuple<string, IAnimatorMotionMapper>[] mappers =
         {
-            new Tuple<string, AnimatorMotionMapper>("Linear", new LinearMotionMapper()),
-            new Tuple<string, AnimatorMotionMapper>("Accelerate", new AccelerateMotionMapper()),
-            new Tuple<string, AnimatorMotionMapper>("Decelerate", new DecelerateMotionMapper()),
-            new Tuple<string, AnimatorMotionMapper>("Sinusoida", new SinusoidalMotionMapper()),
-            new Tuple<string, AnimatorMotionMapper>("Bounce", new BounceMotionMapper{ Bounces = 3, DecayFactor = 1.8 }),
-            new Tuple<string, AnimatorMotionMapper>("Spring", new SpringMotionMapper{ Wobbles = 3, DecayFactor = 1.8 }),
-            new Tuple<string, AnimatorMotionMapper>("AccelerateFactor", new AccelerateFactorMotionMapper{ PowerFactor = 1.5 }),
-            new Tuple<string, AnimatorMotionMapper>("DecelerateFactor", new DecelerateFactorMotionMapper{ PowerFactor = 1.5 }),
-            new Tuple<string, AnimatorMotionMapper>("SinusoidaFactor", new SinusoidalFactorMotionMapper{ PowerFactor = 1.5 }),
-            new Tuple<string, AnimatorMotionMapper>("DivisorInterpolate", new DivisorInterpolatedMotionMapper{ Divisor = 1.0, Power = 2.0 }),
-            new Tuple<string, AnimatorMotionMapper>("CubicBezier", new CubicBezierMotionMapper{ X1 = 0, X2 = 1, Y1 = 0, Y2 = 1})
+            new Tuple<string, IAnimatorMotionMapper>("Linear", new LinearMotionMapper()),
+            new Tuple<string, IAnimatorMotionMapper>("Accelerate", new AccelerateMotionMapper()),
+            new Tuple<string, IAnimatorMotionMapper>("Decelerate", new DecelerateMotionMapper()),
+            new Tuple<string, IAnimatorMotionMapper>("Sinusoida", new SinusoidalMotionMapper()),
+            new Tuple<string, IAnimatorMotionMapper>("Bounce", new BounceMotionMapper{ Bounces = 3, DecayFactor = 1.8 }),
+            new Tuple<string, IAnimatorMotionMapper>("Spring", new SpringMotionMapper{ Wobbles = 3, DecayFactor = 1.8 }),
+            new Tuple<string, IAnimatorMotionMapper>("AccelerateFactor", new AccelerateFactorMotionMapper{ PowerFactor = 1.5 }),
+            new Tuple<string, IAnimatorMotionMapper>("DecelerateFactor", new DecelerateFactorMotionMapper{ PowerFactor = 1.5 }),
+            new Tuple<string, IAnimatorMotionMapper>("SinusoidaFactor", new SinusoidalFactorMotionMapper{ PowerFactor = 1.5 }),
+            new Tuple<string, IAnimatorMotionMapper>("DivisorInterpolate", new DivisorInterpolatedMotionMapper{ Divisor = 1.0, Power = 2.0 }),
+            new Tuple<string, IAnimatorMotionMapper>("CubicBezier", new CubicBezierMotionMapper{ X1 = 0, X2 = 1, Y1 = 0, Y2 = 1})
         };
 
         int map_index = 0;
@@ -77,7 +77,7 @@ namespace ElmSharp.Test
 
         void OnTimeline()
         {
-            double o = mappers[map_index].Item2.Caculate(timelineAnimator.Position);
+            double o = mappers[map_index].Item2.Calculate(timelineAnimator.Position);
             int x = (int)((X2 * o) + (X1 * (1.0 - o)));
             int y = (int)((Y2 * o) + (Y1 * (1.0 - o)));
 
index 16e023f..0dc3228 100644 (file)
@@ -16,19 +16,19 @@ namespace ElmSharp.Test.Wearable
 
         int X1, Y1, X2, Y2;
 
-        Tuple<string, AnimatorMotionMapper>[] mappers =
+        Tuple<string, IAnimatorMotionMapper>[] mappers =
         {
-            new Tuple<string, AnimatorMotionMapper>("Linear", new LinearMotionMapper()),
-            new Tuple<string, AnimatorMotionMapper>("Accelerate", new AccelerateMotionMapper()),
-            new Tuple<string, AnimatorMotionMapper>("Decelerate", new DecelerateMotionMapper()),
-            new Tuple<string, AnimatorMotionMapper>("Sinusoida", new SinusoidalMotionMapper()),
-            new Tuple<string, AnimatorMotionMapper>("Bounce", new BounceMotionMapper{ Bounces = 3, DecayFactor = 1.8 }),
-            new Tuple<string, AnimatorMotionMapper>("Spring", new SpringMotionMapper{ Wobbles = 3, DecayFactor = 1.8 }),
-            new Tuple<string, AnimatorMotionMapper>("AccelerateFactor", new AccelerateFactorMotionMapper{ PowerFactor = 1.5 }),
-            new Tuple<string, AnimatorMotionMapper>("DecelerateFactor", new DecelerateFactorMotionMapper{ PowerFactor = 1.5 }),
-            new Tuple<string, AnimatorMotionMapper>("SinusoidaFactor", new SinusoidalFactorMotionMapper{ PowerFactor = 1.5 }),
-            new Tuple<string, AnimatorMotionMapper>("DivisorInterpolate", new DivisorInterpolatedMotionMapper{ Divisor = 1.0, Power = 2.0 }),
-            new Tuple<string, AnimatorMotionMapper>("CubicBezier", new CubicBezierMotionMapper{ X1 = 0, X2 = 1, Y1 = 0, Y2 = 1})
+            new Tuple<string, IAnimatorMotionMapper>("Linear", new LinearMotionMapper()),
+            new Tuple<string, IAnimatorMotionMapper>("Accelerate", new AccelerateMotionMapper()),
+            new Tuple<string, IAnimatorMotionMapper>("Decelerate", new DecelerateMotionMapper()),
+            new Tuple<string, IAnimatorMotionMapper>("Sinusoida", new SinusoidalMotionMapper()),
+            new Tuple<string, IAnimatorMotionMapper>("Bounce", new BounceMotionMapper{ Bounces = 3, DecayFactor = 1.8 }),
+            new Tuple<string, IAnimatorMotionMapper>("Spring", new SpringMotionMapper{ Wobbles = 3, DecayFactor = 1.8 }),
+            new Tuple<string, IAnimatorMotionMapper>("AccelerateFactor", new AccelerateFactorMotionMapper{ PowerFactor = 1.5 }),
+            new Tuple<string, IAnimatorMotionMapper>("DecelerateFactor", new DecelerateFactorMotionMapper{ PowerFactor = 1.5 }),
+            new Tuple<string, IAnimatorMotionMapper>("SinusoidaFactor", new SinusoidalFactorMotionMapper{ PowerFactor = 1.5 }),
+            new Tuple<string, IAnimatorMotionMapper>("DivisorInterpolate", new DivisorInterpolatedMotionMapper{ Divisor = 1.0, Power = 2.0 }),
+            new Tuple<string, IAnimatorMotionMapper>("CubicBezier", new CubicBezierMotionMapper{ X1 = 0, X2 = 1, Y1 = 0, Y2 = 1})
         };
 
         int map_index = 0;
@@ -77,7 +77,7 @@ namespace ElmSharp.Test.Wearable
 
         void OnTimeline()
         {
-            double o = mappers[map_index].Item2.Caculate(timelineAnimator.Position);
+            double o = mappers[map_index].Item2.Calculate(timelineAnimator.Position);
             int x = (int)((X2 * o) + (X1 * (1.0 - o)));
             int y = (int)((Y2 * o) + (Y1 * (1.0 - o)));