nui 0.2.32 manual merge, mapping to dali 1.2.32
[platform/core/csapi/tizenfx.git] / NUISamples / Tizen.NUI / src / public / Path.cs
1 /** Copyright (c) 2017 Samsung Electronics Co., Ltd.
2 *
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
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
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.
14 *
15 */
16 // This File has been auto-generated by SWIG and then modified using DALi Ruby Scripts
17 //------------------------------------------------------------------------------
18 // <auto-generated />
19 //
20 // This file was automatically generated by SWIG (http://www.swig.org).
21 // Version 3.0.9
22 //
23 // Do not make changes to this file unless you know what you are doing--modify
24 // the SWIG interface file instead.
25 //------------------------------------------------------------------------------
26
27 namespace Tizen.NUI
28 {
29
30     /// <summary>
31     /// A 3D parametric curve.
32     /// Paths can be used to animate position and orientation of actors.
33     /// </summary> 
34     public class Path : Handle
35     {
36         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
37
38         internal Path(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Path_SWIGUpcast(cPtr), cMemoryOwn)
39         {
40             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
41         }
42
43         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Path obj)
44         {
45             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
46         }
47
48         ~Path()
49         {
50             DisposeQueue.Instance.Add(this);
51         }
52
53         public override void Dispose()
54         {
55             if (!Stage.IsInstalled())
56             {
57                 DisposeQueue.Instance.Add(this);
58                 return;
59             }
60
61             lock (this)
62             {
63                 if (swigCPtr.Handle != global::System.IntPtr.Zero)
64                 {
65                     if (swigCMemOwn)
66                     {
67                         swigCMemOwn = false;
68                         NDalicPINVOKE.delete_Path(swigCPtr);
69                     }
70                     swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
71                 }
72                 global::System.GC.SuppressFinalize(this);
73                 base.Dispose();
74             }
75         }
76
77
78         internal class Property : global::System.IDisposable
79         {
80             private global::System.Runtime.InteropServices.HandleRef swigCPtr;
81             protected bool swigCMemOwn;
82
83             internal Property(global::System.IntPtr cPtr, bool cMemoryOwn)
84             {
85                 swigCMemOwn = cMemoryOwn;
86                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
87             }
88
89             internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Property obj)
90             {
91                 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
92             }
93
94             ~Property()
95             {
96                 Dispose();
97             }
98
99             public virtual void Dispose()
100             {
101                 lock (this)
102                 {
103                     if (swigCPtr.Handle != global::System.IntPtr.Zero)
104                     {
105                         if (swigCMemOwn)
106                         {
107                             swigCMemOwn = false;
108                             NDalicPINVOKE.delete_Path_Property(swigCPtr);
109                         }
110                         swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
111                     }
112                     global::System.GC.SuppressFinalize(this);
113                 }
114             }
115
116             internal Property() : this(NDalicPINVOKE.new_Path_Property(), true)
117             {
118                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
119             }
120
121             internal static readonly int POINTS = NDalicPINVOKE.Path_Property_POINTS_get();
122             internal static readonly int CONTROL_POINTS = NDalicPINVOKE.Path_Property_CONTROL_POINTS_get();
123
124         }
125
126         /// <summary>
127         /// Creates an initialized Path handle.
128         /// </summary>
129         public Path() : this(NDalicPINVOKE.Path_New(), true)
130         {
131             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
132
133         }
134         /// <summary>
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.
138         /// </summary>
139         /// <param name="handle">Handle to an object</param>
140         public new static Path DownCast(BaseHandle handle)
141         {
142             Path ret = new Path(NDalicPINVOKE.Path_DownCast(BaseHandle.getCPtr(handle)), true);
143             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
144             return ret;
145         }
146
147         internal Path(Path handle) : this(NDalicPINVOKE.new_Path__SWIG_1(Path.getCPtr(handle)), true)
148         {
149             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
150         }
151
152         internal Path Assign(Path rhs)
153         {
154             Path ret = new Path(NDalicPINVOKE.Path_Assign(swigCPtr, Path.getCPtr(rhs)), false);
155             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
156             return ret;
157         }
158
159         /// <summary>
160         /// Adds an interpolation point.
161         /// </summary>
162         /// <param name="point">The new interpolation point to be added</param>
163         public void AddPoint(Position point)
164         {
165             NDalicPINVOKE.Path_AddPoint(swigCPtr, Position.getCPtr(point));
166             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
167         }
168
169         /// <summary>
170         /// Adds a control point.
171         /// </summary>
172         /// <param name="point">The new control point to be added</param>
173         public void AddControlPoint(Vector3 point)
174         {
175             NDalicPINVOKE.Path_AddControlPoint(swigCPtr, Vector3.getCPtr(point));
176             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
177         }
178
179         /// <summary>
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.
186         /// </summary>
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)
189         {
190             NDalicPINVOKE.Path_GenerateControlPoints(swigCPtr, curvature);
191             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
192         }
193
194         /// <summary>
195         /// Sample path at a given progress. Calculates position and tangent at that point of the curve.
196         /// </summary>
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)
201         {
202             NDalicPINVOKE.Path_Sample(swigCPtr, progress, Vector3.getCPtr(position), Vector3.getCPtr(tangent));
203             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
204         }
205
206         /// <summary>
207         /// Accessor for the interpolation points.
208         /// </summary>
209         /// <param name="index">The index of the interpolation point</param>
210         public Vector3 GetPoint(uint index)
211         {
212             Vector3 ret = new Vector3(NDalicPINVOKE.Path_GetPoint(swigCPtr, index), false);
213             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
214             return ret;
215         }
216
217         /// <summary>
218         /// Accessor for the control points.
219         /// </summary>
220         /// <param name="index">The index of the control point</param>  
221         public Vector3 GetControlPoint(uint index)
222         {
223             Vector3 ret = new Vector3(NDalicPINVOKE.Path_GetControlPoint(swigCPtr, index), false);
224             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
225             return ret;
226         }
227
228         /// <summary>
229         /// Gets the number of interpolation points in the path.
230         /// </summary>
231         /// <returns>The number of interpolation points in the path</returns>
232         public uint GetPointCount()
233         {
234             uint ret = NDalicPINVOKE.Path_GetPointCount(swigCPtr);
235             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
236             return ret;
237         }
238
239         /// <summary>
240         /// Enumeration for Points
241         /// </summary>
242         public PropertyArray Points
243         {
244             get
245             {
246                 Tizen.NUI.PropertyArray temp = new Tizen.NUI.PropertyArray();
247                 GetProperty(Path.Property.POINTS).Get(temp);
248                 return temp;
249             }
250             set
251             {
252                 SetProperty(Path.Property.POINTS, new Tizen.NUI.PropertyValue(value));
253             }
254         }
255
256         /// <summary>
257         /// Enumeration for ControlPoints
258         /// </summary>
259         public PropertyArray ControlPoints
260         {
261             get
262             {
263                 Tizen.NUI.PropertyArray temp = new Tizen.NUI.PropertyArray();
264                 GetProperty(Path.Property.CONTROL_POINTS).Get(temp);
265                 return temp;
266             }
267             set
268             {
269                 SetProperty(Path.Property.CONTROL_POINTS, new Tizen.NUI.PropertyValue(value));
270             }
271         }
272
273     }
274
275 }