[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 1865b3c6f45c94ae591bd86ca0ea21a3ccbb885a..717f1149a5d6ba88574349df27ffdc9d14978e9f 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 50cd9b2508acaca6e2963e5e43071e174f92c847..ac244a38445dea7adad5f7ded56a3f3338517523 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 0fad1fd19a3d96800de8a4dc799ae51dd0fdc6c5..b763fa2d97df381767f4539eb34520d9a7e11ef7 100755 (executable)
@@ -107,6 +107,24 @@ namespace Tizen.NUI.Scene3D
             return ret;
         }
 
+        /// <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>
@@ -182,6 +200,27 @@ namespace Tizen.NUI.Scene3D
             return ret;
         }
 
+        /// <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>
index bc6ce95667cf340cfdb1528034444a5ff0060575..d5244dcbd63ec80543808fafddf51cab891fab08 100755 (executable)
@@ -106,6 +106,24 @@ namespace Tizen.NUI.Scene3D
             return ret;
         }
 
+        /// <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.
@@ -320,6 +338,27 @@ namespace Tizen.NUI.Scene3D
             return result;
         }
 
+        /// <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>