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 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 /// <since_tizen> 11 </since_tizen>
46 public class MotionPropertyIndex : MotionIndex
49 /// Create an initialized motion property index.
51 /// <since_tizen> 11 </since_tizen>
52 public MotionPropertyIndex() : this(Interop.MotionIndex.MotionPropertyIndexNew(), true)
54 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
58 /// Create an initialized motion property index with given node ID and property ID.
60 /// <param name="modelNodeId">Node ID for this motion index</param>
61 /// <param name="propertyId">Property ID for this motion index</param>
62 /// <since_tizen> 11 </since_tizen>
63 public MotionPropertyIndex(PropertyKey modelNodeId, PropertyKey propertyId) : this(Interop.MotionIndex.MotionPropertyIndexNew(PropertyKey.getCPtr(modelNodeId), PropertyKey.getCPtr(propertyId)), true)
65 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
69 /// Create an initialized motion property index with given node string ID and property string ID.
71 /// <param name="modelNodeName">Node string ID for this motion index</param>
72 /// <param name="propertyName">Property string ID for this motion index</param>
73 /// <since_tizen> 11 </since_tizen>
74 public MotionPropertyIndex(string modelNodeName, string propertyName) : this(Interop.MotionIndex.MotionPropertyIndexNew(PropertyKey.getCPtr(new PropertyKey(modelNodeName)), PropertyKey.getCPtr(new PropertyKey(propertyName))), true)
76 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
82 /// <param name="motionPropertyIndex">Source object to copy.</param>
83 /// <since_tizen> 11 </since_tizen>
84 public MotionPropertyIndex(MotionPropertyIndex motionPropertyIndex) : this(Interop.MotionIndex.NewMotionPropertyIndex(MotionPropertyIndex.getCPtr(motionPropertyIndex)), true)
86 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
90 /// Assignment operator.
92 /// <param name="motionPropertyIndex">Source object to be assigned.</param>
93 /// <returns>Reference to this.</returns>
94 internal MotionPropertyIndex Assign(MotionPropertyIndex motionPropertyIndex)
96 MotionPropertyIndex ret = new MotionPropertyIndex(Interop.MotionIndex.MotionPropertyIndexAssign(SwigCPtr, MotionPropertyIndex.getCPtr(motionPropertyIndex)), false);
97 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
101 internal MotionPropertyIndex(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
106 /// The key of property
108 /// <since_tizen> 11 </since_tizen>
109 public PropertyKey PropertyId
113 return GetPropertyId();
117 SetPropertyId(value);
121 internal void SetPropertyId(PropertyKey propertyId)
123 Interop.MotionIndex.SetPropertyId(SwigCPtr, Property.getCPtr(propertyId));
124 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
127 internal PropertyKey GetPropertyId()
129 IntPtr cPtr = Interop.MotionIndex.GetPropertyId(SwigCPtr);
130 PropertyKey ret = new PropertyKey(cPtr, true);
131 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
136 /// Release swigCPtr.
138 // This will be public opened.
139 [EditorBrowsable(EditorBrowsableState.Never)]
140 protected override void ReleaseSwigCPtr(global::System.Runtime.InteropServices.HandleRef swigCPtr)
142 Interop.MotionIndex.DeleteMotionPropertyIndex(swigCPtr);