[NUI.Scene3D] Add AddLight API
authorEunki, Hong <eunkiki.hong@samsung.com>
Tue, 2 Jan 2024 09:09:36 +0000 (18:09 +0900)
committerEunki Hong <h.pichulia@gmail.com>
Tue, 2 Jan 2024 10:03:42 +0000 (19:03 +0900)
Let we make new API for Light class for SceneView.

Note : To avoid the changness of native side code minimalize, let we use
internal API of NUI.

Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
src/Tizen.NUI.Scene3D/src/internal/Interop/Interop.Libraries.cs
src/Tizen.NUI.Scene3D/src/internal/Interop/Interop.SceneView.cs
src/Tizen.NUI.Scene3D/src/public/Controls/SceneView.cs

index 06caee4..32d9762 100755 (executable)
@@ -19,6 +19,7 @@ namespace Tizen.NUI.Scene3D
     {
         internal static partial class Libraries
         {
+            public const string Lib = "libdali2-csharp-binder.so";
             public const string Scene3D = "libdali2-csharp-binder-scene3d.so";
         }
     }
index 59e4f86..8f5fd31 100755 (executable)
@@ -72,6 +72,14 @@ namespace Tizen.NUI.Scene3D
             [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_SceneView_GetImageBasedLightScaleFactor")]
             public static extern float GetImageBasedLightScaleFactor(global::System.Runtime.InteropServices.HandleRef sceneView);
 
+            // TODO : Implement AddLight API at native SceneView in future. Currently, let we just call Actor.Add
+            [global::System.Runtime.InteropServices.DllImport(Libraries.Lib, EntryPoint = "CSharp_Dali_Actor_Add")]
+            public static extern void AddLight(global::System.Runtime.InteropServices.HandleRef sceneView, global::System.Runtime.InteropServices.HandleRef light);
+
+            // TODO : Implement RemoveLight API at native SceneView in future. Currently, let we just call Actor.Remove
+            [global::System.Runtime.InteropServices.DllImport(Libraries.Lib, EntryPoint = "CSharp_Dali_Actor_Remove")]
+            public static extern void RemoveLight(global::System.Runtime.InteropServices.HandleRef sceneView, global::System.Runtime.InteropServices.HandleRef light);
+
             [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_SceneView_UseFramebuffer")]
             public static extern void UseFramebuffer(global::System.Runtime.InteropServices.HandleRef sceneView, bool useFramebuffer);
 
index 217a7a1..61ceb2a 100755 (executable)
@@ -474,6 +474,30 @@ namespace Tizen.NUI.Scene3D
         }
 
         /// <summary>
+        /// Add Lights to this SceneView.
+        /// </summary>
+        /// <param name="light">The light what we want to add</param>
+        // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void AddLight(Light light)
+        {
+            Interop.SceneView.AddLight(SwigCPtr, Light.getCPtr(light));
+            NDalicPINVOKE.ThrowExceptionIfExists();
+        }
+
+        /// <summary>
+        /// Remove Lights from this SceneView.
+        /// </summary>
+        /// <param name="light">The light what we want to remove</param>
+        // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void RemoveLight(Light light)
+        {
+            Interop.SceneView.RemoveLight(SwigCPtr, Light.getCPtr(light));
+            NDalicPINVOKE.ThrowExceptionIfExists();
+        }
+
+        /// <summary>
         /// Sets SceneView's resolution manually.
         /// </summary>
         /// <param name="width">The input width.</param>