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 /// Basic <see cref="MotionIndex"/> to control Dali's Property.
27 /// It can control more general case.
31 /// MotionPropertyIndex color = new MotionPropertyIndex(new PropertyKey("nodeName"), new PropertyKey("color"));
33 /// // We can change the property later.
34 /// MotionPropertyIndex custom = newMotionPropertyIndex();
35 /// orientation.ModelNodeId = new PropertyKey("nodeName");
36 /// orientation.PropertyId = new PropertyKey("some_custom_property");
38 /// // Note that all cases of MotionTransformIndex can be controled by MotionPropertyIndex
39 /// // Both position0 and position1 can control the node's Position.
40 /// MotionTransformIndex position0 = new MotionTransformIndex(new PropertyKey("nodeName"), MotionTransformIndex.TransformTypes.Position);
41 /// MotionPropertyIndex position1 = new MotionPropertyIndex(new PropertyKey("nodeName"), new PropertyKey("position"));
45 [EditorBrowsable(EditorBrowsableState.Never)]
46 public class MotionPropertyIndex : MotionIndex
49 /// Create an initialized blend shape index.
51 [EditorBrowsable(EditorBrowsableState.Never)]
52 public MotionPropertyIndex() : this(Interop.MotionIndex.MotionPropertyIndexNew(), true)
54 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
58 /// Create an initialized blend shape index with input node id, and property id.
60 [EditorBrowsable(EditorBrowsableState.Never)]
61 public MotionPropertyIndex(PropertyKey modelNodeId, PropertyKey propertyId) : this(Interop.MotionIndex.MotionPropertyIndexNew(PropertyKey.getCPtr(modelNodeId), PropertyKey.getCPtr(propertyId)), true)
63 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
69 /// <param name="motionPropertyIndex">Source object to copy.</param>
70 [EditorBrowsable(EditorBrowsableState.Never)]
71 public MotionPropertyIndex(MotionPropertyIndex motionPropertyIndex) : this(Interop.MotionIndex.NewMotionPropertyIndex(MotionPropertyIndex.getCPtr(motionPropertyIndex)), true)
73 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
77 /// Assignment operator.
79 /// <param name="motionPropertyIndex">Source object to be assigned.</param>
80 /// <returns>Reference to this.</returns>
81 internal MotionPropertyIndex Assign(MotionPropertyIndex motionPropertyIndex)
83 MotionPropertyIndex ret = new MotionPropertyIndex(Interop.MotionIndex.MotionPropertyIndexAssign(SwigCPtr, MotionPropertyIndex.getCPtr(motionPropertyIndex)), false);
84 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
88 internal MotionPropertyIndex(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
93 /// The key of property
95 [EditorBrowsable(EditorBrowsableState.Never)]
96 public PropertyKey PropertyId
100 return GetPropertyId();
104 SetPropertyId(value);
108 internal void SetPropertyId(PropertyKey propertyId)
110 Interop.MotionIndex.SetPropertyId(SwigCPtr, Property.getCPtr(propertyId));
111 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
114 internal PropertyKey GetPropertyId()
116 IntPtr cPtr = Interop.MotionIndex.GetPropertyId(SwigCPtr);
117 PropertyKey ret = new PropertyKey(cPtr, true);
118 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
123 /// Release swigCPtr.
125 // This will be public opened.
126 [EditorBrowsable(EditorBrowsableState.Never)]
127 protected override void ReleaseSwigCPtr(global::System.Runtime.InteropServices.HandleRef swigCPtr)
129 Interop.MotionIndex.DeleteMotionPropertyIndex(swigCPtr);