[Tizen] Remove multiple ...
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / Rotation.cs
1 //------------------------------------------------------------------------------
2 // <auto-generated />
3 //
4 // This file was automatically generated by SWIG (http://www.swig.org).
5 // Version 3.0.9
6 //
7 // Do not make changes to this file unless you know what you are doing--modify
8 // the SWIG interface file instead.
9 //------------------------------------------------------------------------------
10
11 namespace Tizen.NUI
12 {
13
14     /// <summary>
15     /// Rotation Class
16     /// </summary>
17     public class Rotation : global::System.IDisposable
18     {
19         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
20         protected bool swigCMemOwn;
21
22         internal Rotation(global::System.IntPtr cPtr, bool cMemoryOwn)
23         {
24             swigCMemOwn = cMemoryOwn;
25             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
26         }
27
28         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Rotation obj)
29         {
30             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
31         }
32
33         //A Flag to check who called Dispose(). (By User or DisposeQueue)
34         private bool isDisposeQueued = false;
35         //A Flat to check if it is already disposed.
36         protected bool disposed = false;
37
38         ~Rotation()
39         {
40             if(!isDisposeQueued)
41             {
42                 isDisposeQueued = true;
43                 DisposeQueue.Instance.Add(this);
44             }
45         }
46
47         /// <summary>
48         /// To make Rotation instance be disposed.
49         /// </summary>
50         public void Dispose()
51         {
52             //Throw excpetion if Dispose() is called in separate thread.
53             if (!Window.IsInstalled())
54             {
55                 throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
56             }
57
58             if (isDisposeQueued)
59             {
60                 Dispose(DisposeTypes.Implicit);
61             }
62             else
63             {
64                 Dispose(DisposeTypes.Explicit);
65                 System.GC.SuppressFinalize(this);
66             }
67         }
68
69         protected virtual void Dispose(DisposeTypes type)
70         {
71             if (disposed)
72             {
73                 return;
74             }
75
76             if(type == DisposeTypes.Explicit)
77             {
78                 //Called by User
79                 //Release your own managed resources here.
80                 //You should release all of your own disposable objects here.
81             }
82
83             //Release your own unmanaged resources here.
84             //You should not access any managed member here except static instance.
85             //because the execution order of Finalizes is non-deterministic.
86
87             if (swigCPtr.Handle != global::System.IntPtr.Zero)
88             {
89                 if (swigCMemOwn)
90                 {
91                     swigCMemOwn = false;
92                     NDalicPINVOKE.delete_Rotation(swigCPtr);
93                 }
94                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
95             }
96             disposed = true;
97         }
98
99         /// <summary>
100         /// Addition operator.
101         /// </summary>
102         /// <param name="arg1">First Rotation</param>
103         /// <param name="arg2">Second Rotation</param>
104         /// <returns>A Rotation containing the result of the Addition</returns>
105         public static Rotation operator +(Rotation arg1, Rotation arg2)
106         {
107             return arg1.Add(arg2);
108         }
109
110         /// <summary>
111         /// Subtraction operator.
112         /// </summary>
113         /// <param name="arg1">First Rotation</param>
114         /// <param name="arg2">Second Rotation</param>
115         /// <returns>A Rotation containing the result of the subtract</returns>
116         public static Rotation operator -(Rotation arg1, Rotation arg2)
117         {
118             return arg1.Subtract(arg2);
119         }
120
121         /// <summary>
122         /// Unary Negation operator.
123         /// </summary>
124         /// <param name="arg1">First Rotation</param>
125         /// <returns>A Rotation containing the negated result</returns>
126         public static Rotation operator -(Rotation arg1)
127         {
128             return arg1.Subtract();
129         }
130
131         /// <summary>
132         /// Multiplication operator.
133         /// </summary>
134         /// <param name="arg1">First Rotation</param>
135         /// <param name="arg2">Second Rotation</param>
136         /// <returns>A Rotation containing the result of the Multiplication</returns>
137         public static Rotation operator *(Rotation arg1, Rotation arg2)
138         {
139             return arg1.Multiply(arg2);
140         }
141
142         /// <summary>
143         /// Multiplication operator.
144         /// </summary>
145         /// <param name="arg1">Rotation</param>
146         /// <param name="arg2">The vector to multiply</param>
147         /// <returns>A Rotation containing the result of the multiplication</returns>
148         public static Vector3 operator *(Rotation arg1, Vector3 arg2)
149         {
150             return arg1.Multiply(arg2);
151         }
152
153         /// <summary>
154         /// Scale operator.
155         /// </summary>
156         /// <param name="arg1">Rotation</param>
157         /// <param name="arg2">A value to scale by</param>
158         /// <returns>A Rotation containing the result of the scaling</returns>
159         public static Rotation operator *(Rotation arg1, float arg2)
160         {
161             return arg1.Multiply(arg2);
162         }
163
164         /// <summary>
165         /// Division operator.
166         /// </summary>
167         /// <param name="arg1">First Rotation</param>
168         /// <param name="arg2">Second Rotation</param>
169         /// <returns>A Rotation containing the result of the scaling</returns>
170         public static Rotation operator /(Rotation arg1, Rotation arg2)
171         {
172             return arg1.Divide(arg2);
173         }
174
175         /// <summary>
176         /// Scale operator.
177         /// </summary>
178         /// <param name="arg1">Rotation</param>
179         /// <param name="arg2">A value to scale by</param>
180         /// <returns>A Rotation containing the result of the scaling</returns>
181         public static Rotation operator /(Rotation arg1, float arg2)
182         {
183             return arg1.Divide(arg2);
184         }
185
186         /// <summary>
187         /// Default Constructor.
188         /// </summary>
189         public Rotation() : this(NDalicPINVOKE.new_Rotation__SWIG_0(), true)
190         {
191             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
192         }
193
194         /// <summary>
195         /// Constructor from an axis and angle.
196         /// </summary>
197         /// <param name="angle">The angle around the axis</param>
198         /// <param name="axis">The vector of the axis</param>
199         public Rotation(Radian angle, Vector3 axis) : this(NDalicPINVOKE.new_Rotation__SWIG_1(Radian.getCPtr(angle), Vector3.getCPtr(axis)), true)
200         {
201             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
202         }
203
204         /// <summary>
205         /// (0.0f,0.0f,0.0f,1.0f)
206         /// </summary>
207         public static Rotation IDENTITY
208         {
209             get
210             {
211                 global::System.IntPtr cPtr = NDalicPINVOKE.Rotation_IDENTITY_get();
212                 Rotation ret = (cPtr == global::System.IntPtr.Zero) ? null : new Rotation(cPtr, false);
213                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
214                 return ret;
215             }
216         }
217
218         /// <summary>
219         /// Helper to check if this is an identity quaternion.
220         /// </summary>
221         /// <returns>True if this is identity quaternion</returns>
222         public bool IsIdentity()
223         {
224             bool ret = NDalicPINVOKE.Rotation_IsIdentity(swigCPtr);
225             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
226             return ret;
227         }
228
229         /// <summary>
230         /// Converts the quaternion to an axis/angle pair.
231         /// </summary>
232         /// <param name="axis">the result of axis</param>
233         /// <param name="angle">the result of angle Angle in radians</param>
234         /// <returns>True if converted correctly</returns>
235         public bool GetAxisAngle(Vector3 axis, Radian angle)
236         {
237             bool ret = NDalicPINVOKE.Rotation_GetAxisAngle(swigCPtr, Vector3.getCPtr(axis), Radian.getCPtr(angle));
238             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
239             return ret;
240         }
241
242         private Rotation Add(Rotation other)
243         {
244             Rotation ret = new Rotation(NDalicPINVOKE.Rotation_Add(swigCPtr, Rotation.getCPtr(other)), true);
245             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
246             return ret;
247         }
248
249         private Rotation Subtract(Rotation other)
250         {
251             Rotation ret = new Rotation(NDalicPINVOKE.Rotation_Subtract__SWIG_0(swigCPtr, Rotation.getCPtr(other)), true);
252             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
253             return ret;
254         }
255
256         private Rotation Multiply(Rotation other)
257         {
258             Rotation ret = new Rotation(NDalicPINVOKE.Rotation_Multiply__SWIG_0(swigCPtr, Rotation.getCPtr(other)), true);
259             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
260             return ret;
261         }
262
263         private Vector3 Multiply(Vector3 other)
264         {
265             Vector3 ret = new Vector3(NDalicPINVOKE.Rotation_Multiply__SWIG_1(swigCPtr, Vector3.getCPtr(other)), true);
266             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
267             return ret;
268         }
269
270         private Rotation Divide(Rotation other)
271         {
272             Rotation ret = new Rotation(NDalicPINVOKE.Rotation_Divide__SWIG_0(swigCPtr, Rotation.getCPtr(other)), true);
273             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
274             return ret;
275         }
276
277         private Rotation Multiply(float scale)
278         {
279             Rotation ret = new Rotation(NDalicPINVOKE.Rotation_Multiply__SWIG_2(swigCPtr, scale), true);
280             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
281             return ret;
282         }
283
284         private Rotation Divide(float scale)
285         {
286             Rotation ret = new Rotation(NDalicPINVOKE.Rotation_Divide__SWIG_1(swigCPtr, scale), true);
287             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
288             return ret;
289         }
290
291         private Rotation Subtract()
292         {
293             Rotation ret = new Rotation(NDalicPINVOKE.Rotation_Subtract__SWIG_1(swigCPtr), true);
294             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
295             return ret;
296         }
297
298         private Rotation AddAssign(Rotation other)
299         {
300             Rotation ret = new Rotation(NDalicPINVOKE.Rotation_AddAssign(swigCPtr, Rotation.getCPtr(other)), false);
301             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
302             return ret;
303         }
304
305         private Rotation SubtractAssign(Rotation other)
306         {
307             Rotation ret = new Rotation(NDalicPINVOKE.Rotation_SubtractAssign(swigCPtr, Rotation.getCPtr(other)), false);
308             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
309             return ret;
310         }
311
312         private Rotation MultiplyAssign(Rotation other)
313         {
314             Rotation ret = new Rotation(NDalicPINVOKE.Rotation_MultiplyAssign__SWIG_0(swigCPtr, Rotation.getCPtr(other)), false);
315             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
316             return ret;
317         }
318
319         private Rotation MultiplyAssign(float scale)
320         {
321             Rotation ret = new Rotation(NDalicPINVOKE.Rotation_MultiplyAssign__SWIG_1(swigCPtr, scale), false);
322             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
323             return ret;
324         }
325
326         private Rotation DivideAssign(float scale)
327         {
328             Rotation ret = new Rotation(NDalicPINVOKE.Rotation_DivideAssign(swigCPtr, scale), false);
329             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
330             return ret;
331         }
332
333         private bool EqualTo(Rotation rhs)
334         {
335             bool ret = NDalicPINVOKE.Rotation_EqualTo(swigCPtr, Rotation.getCPtr(rhs));
336             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
337             return ret;
338         }
339
340         private bool NotEqualTo(Rotation rhs)
341         {
342             bool ret = NDalicPINVOKE.Rotation_NotEqualTo(swigCPtr, Rotation.getCPtr(rhs));
343             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
344             return ret;
345         }
346
347         /// <summary>
348         /// Returns the length of the rotation
349         /// </summary>
350         /// <returns>The length of the rotation</returns>
351         public float Length()
352         {
353             float ret = NDalicPINVOKE.Rotation_Length(swigCPtr);
354             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
355             return ret;
356         }
357
358         /// <summary>
359         /// Returns the squared length of the rotation
360         /// </summary>
361         /// <returns>The squared length of the rotation</returns>
362         public float LengthSquared()
363         {
364             float ret = NDalicPINVOKE.Rotation_LengthSquared(swigCPtr);
365             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
366             return ret;
367         }
368
369         /// <summary>
370         /// Normalizes this to unit length.
371         /// </summary>
372         public void Normalize()
373         {
374             NDalicPINVOKE.Rotation_Normalize(swigCPtr);
375             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
376         }
377
378         /// <summary>
379         /// Normalized.
380         /// </summary>
381         /// <returns>A normalized version of this rotation</returns>
382         public Rotation Normalized()
383         {
384             Rotation ret = new Rotation(NDalicPINVOKE.Rotation_Normalized(swigCPtr), true);
385             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
386             return ret;
387         }
388
389         /// <summary>
390         /// Conjugates this rotation.
391         /// </summary>
392         public void Conjugate()
393         {
394             NDalicPINVOKE.Rotation_Conjugate(swigCPtr);
395             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
396         }
397
398         /// <summary>
399         /// Inverts this rotation.
400         /// </summary>
401         public void Invert()
402         {
403             NDalicPINVOKE.Rotation_Invert(swigCPtr);
404             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
405         }
406
407         /// <summary>
408         /// Performs the logarithm of a rotation
409         /// </summary>
410         /// <returns>A rotation representing the logarithm</returns>
411         public Rotation Log()
412         {
413             Rotation ret = new Rotation(NDalicPINVOKE.Rotation_Log(swigCPtr), true);
414             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
415             return ret;
416         }
417
418         /// <summary>
419         /// Performs an exponent
420         /// </summary>
421         /// <returns>A rotation representing the exponent</returns>
422         public Rotation Exp()
423         {
424             Rotation ret = new Rotation(NDalicPINVOKE.Rotation_Exp(swigCPtr), true);
425             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
426             return ret;
427         }
428
429         /// <summary>
430         /// Returns the dot product of two rotations.
431         /// </summary>
432         /// <param name="q1">The first rotation</param>
433         /// <param name="q2">The second rotation</param>
434         /// <returns>The dot product of the two rotations</returns>
435         public static float Dot(Rotation q1, Rotation q2)
436         {
437             float ret = NDalicPINVOKE.Rotation_Dot(Rotation.getCPtr(q1), Rotation.getCPtr(q2));
438             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
439             return ret;
440         }
441
442         /// <summary>
443         /// Linear Interpolation (using a straight line between the two rotations).
444         /// </summary>
445         /// <param name="q1">The start rotation</param>
446         /// <param name="q2">The end rotation</param>
447         /// <param name="t">A progress value between 0 and 1</param>
448         /// <returns>The interpolated rotation</returns>
449         public static Rotation Lerp(Rotation q1, Rotation q2, float t)
450         {
451             Rotation ret = new Rotation(NDalicPINVOKE.Rotation_Lerp(Rotation.getCPtr(q1), Rotation.getCPtr(q2), t), true);
452             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
453             return ret;
454         }
455
456         /// <summary>
457         /// Spherical Linear Interpolation (using the shortest arc of a great circle between the two rotations).
458         /// </summary>
459         /// <param name="q1">The start rotation</param>
460         /// <param name="q2">The end rotation</param>
461         /// <param name="progress">A progress value between 0 and 1</param>
462         /// <returns>The interpolated rotation</returns>
463         public static Rotation Slerp(Rotation q1, Rotation q2, float progress)
464         {
465             Rotation ret = new Rotation(NDalicPINVOKE.Rotation_Slerp(Rotation.getCPtr(q1), Rotation.getCPtr(q2), progress), true);
466             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
467             return ret;
468         }
469
470         /// <summary>
471         /// This version of Slerp, used by Squad, does not check for theta > 90.
472         /// </summary>
473         /// <param name="q1">The start rotation</param>
474         /// <param name="q2">The end rotation</param>
475         /// <param name="t">A progress value between 0 and 1</param>
476         /// <returns>The interpolated rotation</returns>
477         public static Rotation SlerpNoInvert(Rotation q1, Rotation q2, float t)
478         {
479             Rotation ret = new Rotation(NDalicPINVOKE.Rotation_SlerpNoInvert(Rotation.getCPtr(q1), Rotation.getCPtr(q2), t), true);
480             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
481             return ret;
482         }
483
484         /// <summary>
485         /// Spherical Cubic Interpolation.
486         /// </summary>
487         /// <param name="start">The start rotation</param>
488         /// <param name="end">The end rotation</param>
489         /// <param name="ctrl1">The control rotation for q1</param>
490         /// <param name="ctrl2">The control rotation for q2</param>
491         /// <param name="t">A progress value between 0 and 1</param>
492         /// <returns>The interpolated rotation</returns>
493         public static Rotation Squad(Rotation start, Rotation end, Rotation ctrl1, Rotation ctrl2, float t)
494         {
495             Rotation ret = new Rotation(NDalicPINVOKE.Rotation_Squad(Rotation.getCPtr(start), Rotation.getCPtr(end), Rotation.getCPtr(ctrl1), Rotation.getCPtr(ctrl2), t), true);
496             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
497             return ret;
498         }
499
500         /// <summary>
501         /// Returns the shortest angle between two rotations in Radians.
502         /// </summary>
503         /// <param name="q1">The first rotation</param>
504         /// <param name="q2">The second rotation</param>
505         /// <returns>The angle between the two rotation</returns>
506         public static float AngleBetween(Rotation q1, Rotation q2)
507         {
508             float ret = NDalicPINVOKE.Rotation_AngleBetween(Rotation.getCPtr(q1), Rotation.getCPtr(q2));
509             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
510             return ret;
511         }
512
513     }
514
515 }