1 /** Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
16 // This File has been auto-generated by SWIG and then modified using DALi Ruby Scripts
17 //------------------------------------------------------------------------------
20 // This file was automatically generated by SWIG (http://www.swig.org).
23 // Do not make changes to this file unless you know what you are doing--modify
24 // the SWIG interface file instead.
25 //------------------------------------------------------------------------------
31 /// A 3D parametric curve.
32 /// Paths can be used to animate position and orientation of actors.
34 public class Path : Handle
36 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
38 internal Path(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Path_SWIGUpcast(cPtr), cMemoryOwn)
40 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
43 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Path obj)
45 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
50 DisposeQueue.Instance.Add(this);
53 public override void Dispose()
55 if (!Stage.IsInstalled())
57 DisposeQueue.Instance.Add(this);
63 if (swigCPtr.Handle != global::System.IntPtr.Zero)
68 NDalicPINVOKE.delete_Path(swigCPtr);
70 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
72 global::System.GC.SuppressFinalize(this);
78 internal class Property : global::System.IDisposable
80 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
81 protected bool swigCMemOwn;
83 internal Property(global::System.IntPtr cPtr, bool cMemoryOwn)
85 swigCMemOwn = cMemoryOwn;
86 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
89 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Property obj)
91 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
99 public virtual void Dispose()
103 if (swigCPtr.Handle != global::System.IntPtr.Zero)
108 NDalicPINVOKE.delete_Path_Property(swigCPtr);
110 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
112 global::System.GC.SuppressFinalize(this);
116 internal Property() : this(NDalicPINVOKE.new_Path_Property(), true)
118 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
121 internal static readonly int POINTS = NDalicPINVOKE.Path_Property_POINTS_get();
122 internal static readonly int CONTROL_POINTS = NDalicPINVOKE.Path_Property_CONTROL_POINTS_get();
127 /// Creates an initialized Path handle.
129 public Path() : this(NDalicPINVOKE.Path_New(), true)
131 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
135 /// Downcasts a handle to Path handle.
136 /// If handle points to a Path object, the downcast produces valid handle.
137 /// If not, the returned handle is left uninitialized.
139 /// <param name="handle">Handle to an object</param>
140 public new static Path DownCast(BaseHandle handle)
142 Path ret = new Path(NDalicPINVOKE.Path_DownCast(BaseHandle.getCPtr(handle)), true);
143 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
147 internal Path(Path handle) : this(NDalicPINVOKE.new_Path__SWIG_1(Path.getCPtr(handle)), true)
149 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
152 internal Path Assign(Path rhs)
154 Path ret = new Path(NDalicPINVOKE.Path_Assign(swigCPtr, Path.getCPtr(rhs)), false);
155 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
160 /// Adds an interpolation point.
162 /// <param name="point">The new interpolation point to be added</param>
163 public void AddPoint(Position point)
165 NDalicPINVOKE.Path_AddPoint(swigCPtr, Position.getCPtr(point));
166 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
170 /// Adds a control point.
172 /// <param name="point">The new control point to be added</param>
173 public void AddControlPoint(Vector3 point)
175 NDalicPINVOKE.Path_AddControlPoint(swigCPtr, Vector3.getCPtr(point));
176 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
180 /// Automatic generation of control points. Generated control points which result in a smooth join between the splines of each segment.
181 /// The generating algorithm is as follows:
182 /// For a given knot point K[N], find the vector that bisects K[N-1],[N] and [N],[N+1].
183 /// Calculate the tangent vector by taking the normal of this bisector.
184 /// The in control point is the length of the preceding segment back along this bisector multiplied by the curvature.
185 /// The out control point is the length of the succeeding segment forward along this bisector multiplied by the curvature.
187 /// <param name="curvature">The curvature of the spline. 0 gives straight lines between the knots, negative values means the spline contains loops, positive values up to 0.5 result in a smooth curve, positive values between 0.5 and 1 result in looped curves where the loops are not distinct (i.e. the curve appears to be non-continuous), positive values higher than 1 result in looped curves</param>
188 public void GenerateControlPoints(float curvature)
190 NDalicPINVOKE.Path_GenerateControlPoints(swigCPtr, curvature);
191 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
195 /// Sample path at a given progress. Calculates position and tangent at that point of the curve.
197 /// <param name="progress">A floating point value between 0.0 and 1.0</param>
198 /// <param name="position">The interpolated position at that progress</param>
199 /// <param name="tangent">The interpolated tangent at that progress</param>
200 public void Sample(float progress, Vector3 position, Vector3 tangent)
202 NDalicPINVOKE.Path_Sample(swigCPtr, progress, Vector3.getCPtr(position), Vector3.getCPtr(tangent));
203 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
207 /// Accessor for the interpolation points.
209 /// <param name="index">The index of the interpolation point</param>
210 public Vector3 GetPoint(uint index)
212 Vector3 ret = new Vector3(NDalicPINVOKE.Path_GetPoint(swigCPtr, index), false);
213 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
218 /// Accessor for the control points.
220 /// <param name="index">The index of the control point</param>
221 public Vector3 GetControlPoint(uint index)
223 Vector3 ret = new Vector3(NDalicPINVOKE.Path_GetControlPoint(swigCPtr, index), false);
224 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
229 /// Gets the number of interpolation points in the path.
231 /// <returns>The number of interpolation points in the path</returns>
232 public uint GetPointCount()
234 uint ret = NDalicPINVOKE.Path_GetPointCount(swigCPtr);
235 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
240 /// Enumeration for Points
242 public PropertyArray Points
246 Tizen.NUI.PropertyArray temp = new Tizen.NUI.PropertyArray();
247 GetProperty(Path.Property.POINTS).Get(temp);
252 SetProperty(Path.Property.POINTS, new Tizen.NUI.PropertyValue(value));
257 /// Enumeration for ControlPoints
259 public PropertyArray ControlPoints
263 Tizen.NUI.PropertyArray temp = new Tizen.NUI.PropertyArray();
264 GetProperty(Path.Property.CONTROL_POINTS).Get(temp);
269 SetProperty(Path.Property.CONTROL_POINTS, new Tizen.NUI.PropertyValue(value));