From: seungho Date: Wed, 14 Sep 2022 06:56:41 +0000 (+0900) Subject: [NUI] Add Set/Get IBL Scale Factor for SceneView and Model X-Git-Tag: accepted/tizen/unified/20231205.024657~710 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=84c40a6f7f625e447f9e59d03989c675a7437aa4;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [NUI] Add Set/Get IBL Scale Factor for SceneView and Model Signed-off-by: seungho --- diff --git a/src/Tizen.NUI.Scene3D/src/internal/Interop/Interop.Model.cs b/src/Tizen.NUI.Scene3D/src/internal/Interop/Interop.Model.cs index 1865b3c..717f114 100755 --- a/src/Tizen.NUI.Scene3D/src/internal/Interop/Interop.Model.cs +++ b/src/Tizen.NUI.Scene3D/src/internal/Interop/Interop.Model.cs @@ -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); } } } diff --git a/src/Tizen.NUI.Scene3D/src/internal/Interop/Interop.SceneView.cs b/src/Tizen.NUI.Scene3D/src/internal/Interop/Interop.SceneView.cs index 50cd9b2..ac244a3 100755 --- a/src/Tizen.NUI.Scene3D/src/internal/Interop/Interop.SceneView.cs +++ b/src/Tizen.NUI.Scene3D/src/internal/Interop/Interop.SceneView.cs @@ -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); diff --git a/src/Tizen.NUI.Scene3D/src/public/Controls/Model.cs b/src/Tizen.NUI.Scene3D/src/public/Controls/Model.cs index 0fad1fd..b763fa2 100755 --- a/src/Tizen.NUI.Scene3D/src/public/Controls/Model.cs +++ b/src/Tizen.NUI.Scene3D/src/public/Controls/Model.cs @@ -108,6 +108,24 @@ namespace Tizen.NUI.Scene3D } /// + /// Set/Get the ImageBasedLight ScaleFactor. + /// Scale factor controls light source intensity in [0.0f, 1.0f] + /// + // 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(); + } + } + + /// /// Changes Image Based Light according to the given input textures. /// /// The path of Cube map image that will be used as a diffuse IBL source. @@ -183,6 +201,27 @@ namespace Tizen.NUI.Scene3D } /// + /// Set the ImageBasedLight ScaleFactor. + /// + /// Scale factor that controls light source intensity in [0.0f, 1.0f]. + private void SetImageBasedLightScaleFactor(float scaleFactor) + { + Interop.Model.SetImageBasedLightScaleFactor(SwigCPtr, scaleFactor); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Get the ImageBasedLight ScaleFactor. + /// + /// ImageBasedLightScaleFactor that controls light source intensity. + private float GetImageBasedLightScaleFactor() + { + float scaleFactor = Interop.Model.GetImageBasedLightScaleFactor(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return scaleFactor; + } + + /// /// Release swigCPtr. /// // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API) diff --git a/src/Tizen.NUI.Scene3D/src/public/Controls/SceneView.cs b/src/Tizen.NUI.Scene3D/src/public/Controls/SceneView.cs index bc6ce95..d5244dc 100755 --- a/src/Tizen.NUI.Scene3D/src/public/Controls/SceneView.cs +++ b/src/Tizen.NUI.Scene3D/src/public/Controls/SceneView.cs @@ -107,6 +107,24 @@ namespace Tizen.NUI.Scene3D } /// + /// Set/Get the ImageBasedLight ScaleFactor. + /// Scale factor controls light source intensity in [0.0f, 1.0f] + /// + // 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(); + } + } + + /// /// 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 } /// + /// Set the ImageBasedLight ScaleFactor. + /// + /// Scale factor that controls light source intensity in [0.0f, 1.0f]. + private void SetImageBasedLightScaleFactor(float scaleFactor) + { + Interop.SceneView.SetImageBasedLightScaleFactor(SwigCPtr, scaleFactor); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Get the ImageBasedLight ScaleFactor. + /// + /// ImageBasedLightScaleFactor that controls light source intensity. + private float GetImageBasedLightScaleFactor() + { + float scaleFactor = Interop.SceneView.GetImageBasedLightScaleFactor(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return scaleFactor; + } + + /// /// Release swigCPtr. /// // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)