/*
- * 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.
{
/// <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)
/// {
/// 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)
/// <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();
}
/// <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);
}
/// <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);
/// <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);
/// </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);