[NUI] Add Set/Get IBL Scale Factor for SceneView and Model
authorseungho <sbsh.baek@samsung.com>
Wed, 14 Sep 2022 06:56:41 +0000 (15:56 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Wed, 21 Sep 2022 05:52:33 +0000 (14:52 +0900)
Signed-off-by: seungho <sbsh.baek@samsung.com>
src/Tizen.NUI.Scene3D/src/internal/Interop/Interop.Model.cs
src/Tizen.NUI.Scene3D/src/internal/Interop/Interop.SceneView.cs
src/Tizen.NUI.Scene3D/src/public/Controls/Model.cs
src/Tizen.NUI.Scene3D/src/public/Controls/SceneView.cs

index 1865b3c..717f114 100755 (executable)
@@ -22,43 +22,49 @@ namespace Tizen.NUI.Scene3D
         internal static partial class Model
         {
             [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_ModelView_New_SWIG_1")]
-            public static extern global::System.IntPtr ModelNew(string jarg1, string jarg2);
+            public static extern global::System.IntPtr ModelNew(string modelUrl, string resourcePasth);
 
             [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_new_ModelView_SWIG_0")]
             public static extern global::System.IntPtr NewModel();
 
             [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_new_ModelView_SWIG_1")]
-            public static extern global::System.IntPtr NewModel(global::System.Runtime.InteropServices.HandleRef jarg1);
+            public static extern global::System.IntPtr NewModel(global::System.Runtime.InteropServices.HandleRef model);
 
             [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_delete_ModelView")]
-            public static extern void DeleteModel(global::System.Runtime.InteropServices.HandleRef jarg1);
+            public static extern void DeleteModel(global::System.Runtime.InteropServices.HandleRef model);
 
             [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_ModelView_Assign")]
-            public static extern global::System.IntPtr ModelAssign(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+            public static extern global::System.IntPtr ModelAssign(global::System.Runtime.InteropServices.HandleRef model, global::System.Runtime.InteropServices.HandleRef sourceModel);
 
             [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_ModelView_DownCast")]
-            public static extern global::System.IntPtr ModelDownCast(global::System.Runtime.InteropServices.HandleRef jarg1);
+            public static extern global::System.IntPtr ModelDownCast(global::System.Runtime.InteropServices.HandleRef model);
 
             [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_ModelView_GetModelRoot")]
-            public static extern global::System.IntPtr GetModelRoot(global::System.Runtime.InteropServices.HandleRef jarg1);
+            public static extern global::System.IntPtr GetModelRoot(global::System.Runtime.InteropServices.HandleRef model);
 
             [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_ModelView_FitSize")]
-            public static extern global::System.IntPtr FitSize(global::System.Runtime.InteropServices.HandleRef jarg1, bool fit);
+            public static extern global::System.IntPtr FitSize(global::System.Runtime.InteropServices.HandleRef model, bool fit);
 
             [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_ModelView_FitCenter")]
-            public static extern global::System.IntPtr FitCenter(global::System.Runtime.InteropServices.HandleRef jarg1, bool fit);
+            public static extern global::System.IntPtr FitCenter(global::System.Runtime.InteropServices.HandleRef model, bool fit);
 
             [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_ModelView_SetImageBasedLightSource")]
-            public static extern global::System.IntPtr SetImageBasedLightSource(global::System.Runtime.InteropServices.HandleRef jarg1, string diffuse, string specular, float scaleFactor);
+            public static extern global::System.IntPtr SetImageBasedLightSource(global::System.Runtime.InteropServices.HandleRef model, string diffuse, string specular, float scaleFactor);
+
+            [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_ModelView_SetImageBasedLightScaleFactor")]
+            public static extern global::System.IntPtr SetImageBasedLightScaleFactor(global::System.Runtime.InteropServices.HandleRef model, float scaleFactor);
+
+            [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_ModelView_GetImageBasedLightScaleFactor")]
+            public static extern float GetImageBasedLightScaleFactor(global::System.Runtime.InteropServices.HandleRef model);
 
             [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_ModelView_GetAnimationCount")]
-            public static extern uint GetAnimationCount(global::System.Runtime.InteropServices.HandleRef jarg1);
+            public static extern uint GetAnimationCount(global::System.Runtime.InteropServices.HandleRef model);
 
             [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_ModelView_GetAnimation_1")]
-            public static extern global::System.IntPtr GetAnimation(global::System.Runtime.InteropServices.HandleRef jarg1, uint index);
+            public static extern global::System.IntPtr GetAnimation(global::System.Runtime.InteropServices.HandleRef model, uint index);
 
             [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_ModelView_GetAnimation_2")]
-            public static extern global::System.IntPtr GetAnimation(global::System.Runtime.InteropServices.HandleRef jarg1, string name);
+            public static extern global::System.IntPtr GetAnimation(global::System.Runtime.InteropServices.HandleRef model, string name);
         }
     }
 }
index 50cd9b2..ac244a3 100755 (executable)
@@ -66,6 +66,12 @@ namespace Tizen.NUI.Scene3D
             [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_SceneView_SetImageBasedLightSource")]
             public static extern void SetImageBasedLightSource(global::System.Runtime.InteropServices.HandleRef sceneView, string diffuseUrl, string specularUrl, float scaleFactor);
 
+            [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_SceneView_SetImageBasedLightScaleFactor")]
+            public static extern global::System.IntPtr SetImageBasedLightScaleFactor(global::System.Runtime.InteropServices.HandleRef sceneView, float scaleFactor);
+
+            [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_SceneView_GetImageBasedLightScaleFactor")]
+            public static extern float GetImageBasedLightScaleFactor(global::System.Runtime.InteropServices.HandleRef sceneView);
+
             [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 0fad1fd..b763fa2 100755 (executable)
@@ -108,6 +108,24 @@ namespace Tizen.NUI.Scene3D
         }
 
         /// <summary>
+        /// Set/Get the ImageBasedLight ScaleFactor.
+        /// Scale factor controls light source intensity in [0.0f, 1.0f]
+        /// </summary>
+        // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public float ImageBasedLightScaleFactor
+        {
+            set
+            {
+                SetImageBasedLightScaleFactor(value);
+            }
+            get
+            {
+                return GetImageBasedLightScaleFactor();
+            }
+        }
+
+        /// <summary>
         /// Changes Image Based Light according to the given input textures.
         /// </summary>
         /// <param name="diffuseUrl">The path of Cube map image that will be used as a diffuse IBL source.</param>
@@ -183,6 +201,27 @@ namespace Tizen.NUI.Scene3D
         }
 
         /// <summary>
+        /// Set the ImageBasedLight ScaleFactor.
+        /// </summary>
+        /// <param name="scaleFactor">Scale factor that controls light source intensity in [0.0f, 1.0f].</param>
+        private void SetImageBasedLightScaleFactor(float scaleFactor)
+        {
+            Interop.Model.SetImageBasedLightScaleFactor(SwigCPtr, scaleFactor);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        /// Get the ImageBasedLight ScaleFactor.
+        /// </summary>
+        /// <returns>ImageBasedLightScaleFactor that controls light source intensity.</returns>
+        private float GetImageBasedLightScaleFactor()
+        {
+            float scaleFactor = Interop.Model.GetImageBasedLightScaleFactor(SwigCPtr);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return scaleFactor;
+        }
+
+        /// <summary>
         /// Release swigCPtr.
         /// </summary>
         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
index bc6ce95..d5244dc 100755 (executable)
@@ -107,6 +107,24 @@ namespace Tizen.NUI.Scene3D
         }
 
         /// <summary>
+        /// Set/Get the ImageBasedLight ScaleFactor.
+        /// Scale factor controls light source intensity in [0.0f, 1.0f]
+        /// </summary>
+        // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public float ImageBasedLightScaleFactor
+        {
+            set
+            {
+                SetImageBasedLightScaleFactor(value);
+            }
+            get
+            {
+                return GetImageBasedLightScaleFactor();
+            }
+        }
+
+        /// <summary>
         /// Set/Get the UseFramebuffer.
         /// If this property is true, rendering result of SceneView is drawn on FBO and it is mapping on this SceneView plane.
         /// If this property is false, each item in SceneView is rendered on window directly.
@@ -321,6 +339,27 @@ namespace Tizen.NUI.Scene3D
         }
 
         /// <summary>
+        /// Set the ImageBasedLight ScaleFactor.
+        /// </summary>
+        /// <param name="scaleFactor">Scale factor that controls light source intensity in [0.0f, 1.0f].</param>
+        private void SetImageBasedLightScaleFactor(float scaleFactor)
+        {
+            Interop.SceneView.SetImageBasedLightScaleFactor(SwigCPtr, scaleFactor);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        /// Get the ImageBasedLight ScaleFactor.
+        /// </summary>
+        /// <returns>ImageBasedLightScaleFactor that controls light source intensity.</returns>
+        private float GetImageBasedLightScaleFactor()
+        {
+            float scaleFactor = Interop.SceneView.GetImageBasedLightScaleFactor(SwigCPtr);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return scaleFactor;
+        }
+
+        /// <summary>
         /// Release swigCPtr.
         /// </summary>
         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)