[NUI] ModelView ACR
authorseungho <sbsh.baek@samsung.com>
Thu, 4 Aug 2022 05:18:15 +0000 (14:18 +0900)
committerJaehyun Cho <jaehyun0cho@gmail.com>
Tue, 6 Sep 2022 09:10:32 +0000 (18:10 +0900)
Signed-off-by: seungho <sbsh.baek@samsung.com>
src/Tizen.NUI.Scene3D/src/public/Controls/Model.cs

index e973144..ccbac7f 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -26,18 +26,23 @@ namespace Tizen.NUI.Scene3D
 {
     /// <summary>
     /// Model is a Class to show 3D mesh objects.
-    /// Model supports to load glTF 2.0 and DLI models for the input format
-    /// and also supports Physically Based Rendering with Image Based Lighting.
+    /// Model supports glTF 2.0 and DLI model formats.
+    /// Physically Based Rendering with Image Based Lighting is also supported.
+    /// </summary>
     ///
-    /// The Animations defined in the glTF or DLI are also loaded and can be retrieved by using GetAnimation() method.
+    /// <remarks>
+    /// The Animations defined in the glTF or DLI are also loaded and can be retrieved by using <see cref="GetAnimation(uint)"/> and <see cref="GetAnimation(string)"/> methods.
     /// The number of animation is also retrieved by GetAnimationCount() method.
     ///
-    /// By default, The loaded mesh has it's own size inferred from position of vertices.
+    /// By default, the loaded mesh has its own size and <see cref="PivotPoint"/> inferred from position of vertices.
     /// If user set size property, the mesh will be scaled to the input size.
+    /// Default value of <see cref="ParentOrigin"/> of the Model is Center.
     ///
-    /// Both of the default value of PivotPoint and ParentOrigin of the Model is Center.
+    /// The model starts to be loaded synchronously when the Model object is on Window.
+    /// So, <see cref="GetAnimation(uint)"/> and <see cref="GetAnimation(string)"/> methods should be called after the Model object is added on Window.
+    /// </remarks>
     ///
-    /// </summary>
+    /// <example>
     /// <code>
     /// Model model = new Model(modelUrl)
     /// {
@@ -49,11 +54,12 @@ namespace Tizen.NUI.Scene3D
     /// int animationCount = model.GetAnimationCount();
     /// if(animationCount > 0)
     /// {
+    ///     // Play an Animation of index 0.
     ///     model.GetAnimation(0).Play();
     /// }
     /// </code>
-    // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
-    [EditorBrowsable(EditorBrowsableState.Never)]
+    /// </example>
+    /// <since_tizen> 10 </since_tizen>
     public class Model : View
     {
         internal Model(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
@@ -63,27 +69,27 @@ namespace Tizen.NUI.Scene3D
         /// <summary>
         /// Create an initialized Model.
         /// </summary>
-        /// <param name="modelPath">model file path.(e.g., glTF, and DLI).</param>
-        /// <param name="resourcePath">resource file path that includes binary, image etc.</param>
-        /// <note> If resourcePath is empty, the parent directory path of modelPath is used for resource path. </note>
-        // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        public Model(string modelPath, string resourcePath = "") : this(Interop.Model.ModelNew(modelPath, resourcePath), true)
+        /// <param name="modelUrl">model file url.(e.g. glTF, and DLI).</param>
+        /// <param name="resourceDirectoryUrl"> The url to derectory containing resources: binary, image etc.</param>
+        /// <remarks>
+        /// If resourceDirectoryUrl is empty, the parent directory url of modelUrl is used for resource url.
+        ///
+        /// http://tizen.org/privilege/mediastorage for local files in media storage.
+        /// http://tizen.org/privilege/externalstorage for local files in external storage.
+        /// </remarks>
+        /// <since_tizen> 10 </since_tizen>
+        public Model(string modelUrl, string resourceDirectoryUrl = "") : this(Interop.Model.ModelNew(modelUrl, resourceDirectoryUrl), true)
         {
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-            Interop.Model.FitSize(SwigCPtr, true);
-            this.ParentOrigin = Tizen.NUI.ParentOrigin.Center;
-            this.PivotPoint = Tizen.NUI.PivotPoint.Center;
             this.PositionUsesAnchorPoint = true;
         }
 
         /// <summary>
         /// Copy constructor.
         /// </summary>
-        /// <param name="modelView">Handle to an object.</param>
-        // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        public Model(Model modelView) : this(Interop.Model.NewModel(Model.getCPtr(modelView)), true)
+        /// <param name="model">Source object to copy.</param>
+        /// <since_tizen> 10 </since_tizen>
+        public Model(Model model) : this(Interop.Model.NewModel(Model.getCPtr(model)), true)
         {
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
@@ -91,23 +97,26 @@ namespace Tizen.NUI.Scene3D
         /// <summary>
         /// Assignment operator.
         /// </summary>
-        /// <param name="modelView">Handle to an object.</param>
+        /// <param name="model">Source object to be assigned.</param>
         /// <returns>Reference to this.</returns>
-        internal Model Assign(Model modelView)
+        internal Model Assign(Model model)
         {
-            Model ret = new Model(Interop.Model.ModelAssign(SwigCPtr, Model.getCPtr(modelView)), false);
+            Model ret = new Model(Interop.Model.ModelAssign(SwigCPtr, Model.getCPtr(model)), false);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
 
         /// <summary>
-        /// Changes Image Based Light as the input textures.
+        /// Changes Image Based Light according to the given input textures.
         /// </summary>
-        /// <param name="diffuseUrl">The path of Cube map image that can be used as a diffuse IBL source.</param>
-        /// <param name="specularUrl">The path of Cube map image that can be used as a specular IBL source.</param>
+        /// <param name="diffuseUrl">The path of Cube map image that will be used as a diffuse IBL source.</param>
+        /// <param name="specularUrl">The path of Cube map image that will be used as a specular IBL source.</param>
         /// <param name="scaleFactor">Scale factor that controls light source intensity in [0.0f, 1.0f]. Default value is 1.0f.</param>
-        // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <remarks>
+        /// http://tizen.org/privilege/mediastorage for local files in media storage.
+        /// http://tizen.org/privilege/externalstorage for local files in external storage.
+        /// </remarks>
+        /// <since_tizen> 10 </since_tizen>
         public void SetImageBasedLightSource(string diffuseUrl, string specularUrl, float scaleFactor = 1.0f)
         {
             Interop.Model.SetImageBasedLightSource(SwigCPtr, diffuseUrl, specularUrl, scaleFactor);
@@ -115,12 +124,13 @@ namespace Tizen.NUI.Scene3D
         }
 
         /// <summary>
-        /// Gets number of animations those loaded from model file.
-        /// Note: This method should be called after Model load finished.
+        /// Gets number of animations that has been loaded from model file.
         /// </summary>
+        /// <remarks>
+        /// This method should be called after Model load has been finished.
+        /// </remarks>
         /// <returns>The number of loaded animations.</returns>
-        // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 10 </since_tizen>
         public uint GetAnimationCount()
         {
             uint ret = Interop.Model.GetAnimationCount(SwigCPtr);
@@ -130,12 +140,13 @@ namespace Tizen.NUI.Scene3D
 
         /// <summary>
         /// Gets animation at the index.
-        /// Note: This method should be called after Model load finished.
         /// </summary>
+        /// <remarks>
+        /// This method should be called after Model load has been finished.
+        /// </remarks>
         /// <param name="index">Index of animation to be retrieved.</param>
         /// <returns>Animation at the index.</returns>
-        // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 10 </since_tizen>
         public Animation GetAnimation(uint index)
         {
             Animation ret = new Animation(Interop.Model.GetAnimation(SwigCPtr, index), false);
@@ -149,8 +160,7 @@ namespace Tizen.NUI.Scene3D
         /// </summary>
         /// <param name="name">String name of animation to be retrieved.</param>
         /// <returns>Animation that has the given name.</returns>
-        // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 10 </since_tizen>
         public Animation GetAnimation(string name)
         {
             Animation ret = new Animation(Interop.Model.GetAnimation(SwigCPtr, name), false);