[ElmSharp] Add 2d rotation functions. 37/146737/2
authorpius.lee <pius.lee@samsung.com>
Wed, 30 Aug 2017 08:17:31 +0000 (17:17 +0900)
committerpius.lee <pius.lee@samsung.com>
Fri, 1 Sep 2017 01:34:21 +0000 (10:34 +0900)
Add evas 2D rotation mapping function
  - evas_map_util_rotate
Add evas map function for point populating with object
  - evas_map_util_points_populate_from_object

Change-Id: I5439b6c467a869c0878b8b3b200c10e241a20549

src/ElmSharp/ElmSharp/EvasMap.cs
src/ElmSharp/Interop/Interop.Evas.cs

index b67264e..cdf1410 100755 (executable)
@@ -77,6 +77,15 @@ namespace ElmSharp
         /// Populates source and destination map points to exactly match the object.
         /// </summary>
         /// <param name="obj">The object to use unmapped geometry to populate map coordinates</param>
+        public void PopulatePoints(EvasObject obj)
+        {
+            Interop.Evas.evas_map_util_points_populate_from_object_full(_evasMap, obj, 0);
+        }
+
+        /// <summary>
+        /// Populates source and destination map points to exactly match the object.
+        /// </summary>
+        /// <param name="obj">The object to use unmapped geometry to populate map coordinates</param>
         /// <param name="z">
         /// The point Z coordinate hint (pre-perspective transform)This value is used for all four points.
         /// </param>
@@ -96,6 +105,17 @@ namespace ElmSharp
         }
 
         /// <summary>
+        /// Rotate the map
+        /// </summary>
+        /// <param name="degrees">The abount of degrees from 0.0 to 360.0 to rotate</param>
+        /// <param name="cx">rotation's center horizontal position.</param>
+        /// <param name="cy">rotation's center vertical position.</param>
+        public void Rotate(double degrees, int cx, int cy)
+        {
+            Interop.Evas.evas_map_util_rotate(_evasMap, degrees, cx, cy);
+        }
+
+        /// <summary>
         /// Rotates the map around 3 axes in 3D.
         /// </summary>
         /// <param name="dx">The amount of degrees from 0.0 to 360.0 to rotate around X axis</param>
index 3dfd188..cd4d0b6 100644 (file)
@@ -322,6 +322,9 @@ internal static partial class Interop
         internal static extern void evas_map_util_points_populate_from_geometry(IntPtr map, int x, int y, int w, int h, int z);
 
         [DllImport(Libraries.Evas)]
+        internal static extern void evas_map_util_rotate(IntPtr map, double degree, int cx, int cy);
+
+        [DllImport(Libraries.Evas)]
         internal static extern void evas_map_util_3d_rotate(IntPtr map, double dx, double dy, double dz, int cx, int cy, int cz);
 
         [DllImport(Libraries.Evas)]