2 * Copyright(c) 2023 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 using System.ComponentModel;
20 using System.Collections.Generic;
23 namespace Tizen.NUI.Scene3D
26 /// Index of motion value. It will be used to specify the target of motion applied.
27 /// There are three kinds of MotionIndex : <see cref="MotionPropertyIndex"/>, <see cref="MotionTransformIndex"/> and <see cref="BlendShapeIndex"/>.
28 /// MotionPropertyIndex will be used for control all kind of properties.
29 /// The <see cref="MotionData"/> loaded from files / buffer will have this kind of MotionIndex.
30 /// MotionTransformIndex will be used for control the <see cref="ModelNode"/>'s Position / Orientation / Scale, or each components.
31 /// BlendShapeIndex will be used for control some blend shape animation.
34 /// We can use below cases.
36 /// <tr><td>ModelNodeId KeyType</td><td>MotionIndex class </td><td>Description </td></tr>
37 /// <tr><td>KeyType.String </td><td>MotionTransformIndex </td><td>Target is ModelNode's transform property</td></tr>
38 /// <tr><td>KeyType.String </td><td>BlendShapeIndex (with BlendShapeId KeyType.Index) </td><td>Target is ModelNode's BlendShape </td></tr>
39 /// <tr><td>KeyType.String </td><td>BlendShapeIndex (with BlendShapeId KeyType.String)</td><td>Target is ModelNode's BlendShape </td></tr>
40 /// <tr><td>(null) </td><td>BlendShapeIndex (with BlendShapeId KeyType.String)</td><td>Target is all ModelNode's BlendShape </td></tr>
42 /// All other cases are invalid.
44 /// <since_tizen> 11 </since_tizen>
45 public class MotionIndex : BaseHandle
50 /// <param name="motionIndex">Source object to copy.</param>
51 /// <since_tizen> 11 </since_tizen>
52 public MotionIndex(MotionIndex motionIndex) : this(Interop.MotionIndex.NewMotionIndex(MotionIndex.getCPtr(motionIndex)), true)
54 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
58 /// Assignment operator.
60 /// <param name="motionIndex">Source object to be assigned.</param>
61 /// <returns>Reference to this.</returns>
62 internal MotionIndex Assign(MotionIndex motionIndex)
64 MotionIndex ret = new MotionIndex(Interop.MotionIndex.MotionIndexAssign(SwigCPtr, MotionIndex.getCPtr(motionIndex)), false);
65 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
69 internal MotionIndex(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
74 /// The ID of ModelNode. If you want to apply to all ModelNodes who has BlendShape string, assign null.
76 /// <since_tizen> 11 </since_tizen>
77 public PropertyKey ModelNodeId
81 return GetModelNodeId();
85 SetModelNodeId(value);
89 internal void SetModelNodeId(PropertyKey modelNodeId)
91 Interop.MotionIndex.SetModelNodeId(SwigCPtr, Property.getCPtr(modelNodeId));
92 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
95 internal PropertyKey GetModelNodeId()
97 IntPtr cPtr = Interop.MotionIndex.GetModelNodeId(SwigCPtr);
98 PropertyKey ret = new PropertyKey(cPtr, true);
99 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
104 /// Release swigCPtr.
106 // This will be public opened.
107 [EditorBrowsable(EditorBrowsableState.Never)]
108 protected override void ReleaseSwigCPtr(global::System.Runtime.InteropServices.HandleRef swigCPtr)
110 Interop.MotionIndex.DeleteMotionIndex(swigCPtr);