5bf3228dcff71cca5bc2f08d8b0bf9745dba39b1
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / Vector2.cs
1 /*
2  * Copyright(c) 2018 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  *
16  */
17 using System;
18 using Tizen.NUI.Binding;
19
20 namespace Tizen.NUI
21 {
22
23     /// <summary>
24     /// A two-dimensional vector.
25     /// </summary>
26     /// <since_tizen> 3 </since_tizen>
27     [TypeConverter(typeof(Vector2TypeConverter))]
28     public class Vector2 : global::System.IDisposable
29     {
30         /// <summary>
31         /// swigCMemOwn.
32         /// </summary>
33         /// <since_tizen> 3 </since_tizen>
34         protected bool swigCMemOwn;
35
36         /// <summary>
37         /// A Flat to check if it is already disposed.
38         /// </summary>
39         /// <since_tizen> 3 </since_tizen>
40         protected bool disposed = false;
41         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
42         //A Flag to check who called Dispose(). (By User or DisposeQueue)
43         private bool isDisposeQueued = false;
44
45         /// <summary>
46         /// The default constructor initializes the vector to 0.
47         /// </summary>
48         /// <since_tizen> 3 </since_tizen>
49         public Vector2() : this(NDalicPINVOKE.new_Vector2__SWIG_0(), true)
50         {
51             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
52         }
53
54         /// <summary>
55         /// The constructor.
56         /// </summary>
57         /// <param name="x">The x or width component.</param>
58         /// <param name="y">The y or height component.</param>
59         /// <since_tizen> 3 </since_tizen>
60         public Vector2(float x, float y) : this(NDalicPINVOKE.new_Vector2__SWIG_1(x, y), true)
61         {
62             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
63         }
64
65         /// <summary>
66         /// The conversion constructor from an array of two floats.
67         /// </summary>
68         /// <param name="array">The array of xy.</param>
69         /// <since_tizen> 3 </since_tizen>
70         public Vector2(float[] array) : this(NDalicPINVOKE.new_Vector2__SWIG_2(array), true)
71         {
72             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
73         }
74
75         /// <summary>
76         /// The constructor.
77         /// </summary>
78         /// <param name="vec3">Vector3 to create this vector from.</param>
79         /// <since_tizen> 3 </since_tizen>
80         public Vector2(Vector3 vec3) : this(NDalicPINVOKE.new_Vector2__SWIG_3(Vector3.getCPtr(vec3)), true)
81         {
82             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
83         }
84
85         /// <summary>
86         /// The constructor.
87         /// </summary>
88         /// <param name="vec4">Vector4 to create this vector from.</param>
89         /// <since_tizen> 3 </since_tizen>
90         public Vector2(Vector4 vec4) : this(NDalicPINVOKE.new_Vector2__SWIG_4(Vector4.getCPtr(vec4)), true)
91         {
92             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
93         }
94
95         internal Vector2(global::System.IntPtr cPtr, bool cMemoryOwn)
96         {
97             swigCMemOwn = cMemoryOwn;
98             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
99         }
100
101         /// <summary>
102         /// Destructor.
103         /// </summary>
104         /// <since_tizen> 3 </since_tizen>
105         ~Vector2()
106         {
107             if(!isDisposeQueued)
108             {
109                 isDisposeQueued = true;
110                 DisposeQueue.Instance.Add(this);
111             }
112         }
113
114         /// <summary>
115         /// (1.0f,1.0f).
116         /// </summary>
117         /// <since_tizen> 3 </since_tizen>
118         public static Vector2 One
119         {
120             get
121             {
122                 global::System.IntPtr cPtr = NDalicPINVOKE.Vector2_ONE_get();
123                 Vector2 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector2(cPtr, false);
124                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
125                 return ret;
126             }
127         }
128
129         /// <summary>
130         /// The vector representing the x-axis.
131         /// </summary>
132         /// <since_tizen> 3 </since_tizen>
133         public static Vector2 XAxis
134         {
135             get
136             {
137                 global::System.IntPtr cPtr = NDalicPINVOKE.Vector2_XAXIS_get();
138                 Vector2 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector2(cPtr, false);
139                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
140                 return ret;
141             }
142         }
143
144         /// <summary>
145         /// The vector representing the y-axis.
146         /// </summary>
147         /// <since_tizen> 3 </since_tizen>
148         public static Vector2 YAxis
149         {
150             get
151             {
152                 global::System.IntPtr cPtr = NDalicPINVOKE.Vector2_YAXIS_get();
153                 Vector2 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector2(cPtr, false);
154                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
155                 return ret;
156             }
157         }
158
159         /// <summary>
160         /// The vector representing the negative x-axis.
161         /// </summary>
162         /// <since_tizen> 3 </since_tizen>
163         public static Vector2 NegativeXAxis
164         {
165             get
166             {
167                 global::System.IntPtr cPtr = NDalicPINVOKE.Vector2_NEGATIVE_XAXIS_get();
168                 Vector2 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector2(cPtr, false);
169                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
170                 return ret;
171             }
172         }
173
174         /// <summary>
175         /// The vector representing the negative y-axis.
176         /// </summary>
177         /// <since_tizen> 3 </since_tizen>
178         public static Vector2 NegativeYAxis
179         {
180             get
181             {
182                 global::System.IntPtr cPtr = NDalicPINVOKE.Vector2_NEGATIVE_YAXIS_get();
183                 Vector2 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector2(cPtr, false);
184                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
185                 return ret;
186             }
187         }
188
189         /// <summary>
190         /// (0.0f, 0.0f).
191         /// </summary>
192         /// <since_tizen> 3 </since_tizen>
193         public static Vector2 Zero
194         {
195             get
196             {
197                 global::System.IntPtr cPtr = NDalicPINVOKE.Vector2_ZERO_get();
198                 Vector2 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector2(cPtr, false);
199                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
200                 return ret;
201             }
202         }
203
204         /// <summary>
205         /// The x component.
206         /// </summary>
207         /// <since_tizen> 3 </since_tizen>
208         public float X
209         {
210             set
211             {
212                 NDalicPINVOKE.Vector2_X_set(swigCPtr, value);
213                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
214             }
215             get
216             {
217                 float ret = NDalicPINVOKE.Vector2_X_get(swigCPtr);
218                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
219                 return ret;
220             }
221         }
222
223         /// <summary>
224         /// The width.
225         /// </summary>
226         /// <since_tizen> 3 </since_tizen>
227         public float Width
228         {
229             set
230             {
231                 NDalicPINVOKE.Vector2_Width_set(swigCPtr, value);
232                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
233             }
234             get
235             {
236                 float ret = NDalicPINVOKE.Vector2_Width_get(swigCPtr);
237                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
238                 return ret;
239             }
240         }
241
242         /// <summary>
243         /// The y component.
244         /// </summary>
245         /// <since_tizen> 3 </since_tizen>
246         public float Y
247         {
248             set
249             {
250                 NDalicPINVOKE.Vector2_Y_set(swigCPtr, value);
251                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
252             }
253             get
254             {
255                 float ret = NDalicPINVOKE.Vector2_Y_get(swigCPtr);
256                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
257                 return ret;
258             }
259         }
260
261         /// <summary>
262         /// The height.
263         /// </summary>
264         /// <since_tizen> 3 </since_tizen>
265         public float Height
266         {
267             set
268             {
269                 NDalicPINVOKE.Vector2_Height_set(swigCPtr, value);
270                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
271             }
272             get
273             {
274                 float ret = NDalicPINVOKE.Vector2_Height_get(swigCPtr);
275                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
276                 return ret;
277             }
278         }
279
280         /// <summary>
281         /// The array subscript operator overload.
282         /// </summary>
283         /// <param name="index">The subscript index.</param>
284         /// <returns>The float at the given index.</returns>
285         /// <since_tizen> 3 </since_tizen>
286         public float this[uint index]
287         {
288             get
289             {
290                 return ValueOfIndex(index);
291             }
292         }
293
294         /// <summary>
295         /// The addition operator.
296         /// </summary>
297         /// <param name="arg1">The first value.</param>
298         /// <param name="arg2">The second value.</param>
299         /// <returns>The vector containing the result of the addition.</returns>
300         /// <since_tizen> 3 </since_tizen>
301         public static Vector2 operator +(Vector2 arg1, Vector2 arg2)
302         {
303             return arg1.Add(arg2);
304         }
305
306         /// <summary>
307         /// The subtraction operator.
308         /// </summary>
309         /// <param name="arg1">The first value.</param>
310         /// <param name="arg2">The second value.</param>
311         /// <returns>The vector containing the result of the subtraction.</returns>
312         /// <since_tizen> 3 </since_tizen>
313         public static Vector2 operator -(Vector2 arg1, Vector2 arg2)
314         {
315             return arg1.Subtract(arg2);
316         }
317
318         /// <summary>
319         /// The unary negation operator.
320         /// </summary>
321         /// <param name="arg1">The target value.</param>
322         /// <returns>The vector containing the negation.</returns>
323         /// <since_tizen> 3 </since_tizen>
324         public static Vector2 operator -(Vector2 arg1)
325         {
326             return arg1.Subtract();
327         }
328
329         /// <summary>
330         /// The multiplication operator.
331         /// </summary>
332         /// <param name="arg1">The first value.</param>
333         /// <param name="arg2">The second value.</param>
334         /// <returns>The vector containing the result of the multiplication.</returns>
335         /// <since_tizen> 3 </since_tizen>
336         public static Vector2 operator *(Vector2 arg1, Vector2 arg2)
337         {
338             return arg1.Multiply(arg2);
339         }
340
341         /// <summary>
342         /// Th multiplication operator.
343         /// </summary>
344         /// <param name="arg1">The first value.</param>
345         /// <param name="arg2">The float value to scale the vector.</param>
346         /// <returns>The vector containing the result of the scaling.</returns>
347         /// <since_tizen> 3 </since_tizen>
348         public static Vector2 operator *(Vector2 arg1, float arg2)
349         {
350             return arg1.Multiply(arg2);
351         }
352
353         /// <summary>
354         /// The division operator.
355         /// </summary>
356         /// <param name="arg1">The first value.</param>
357         /// <param name="arg2">The second value.</param>
358         /// <returns>The vector containing the result of the division.</returns>
359         /// <since_tizen> 3 </since_tizen>
360         public static Vector2 operator /(Vector2 arg1, Vector2 arg2)
361         {
362             return arg1.Divide(arg2);
363         }
364
365         /// <summary>
366         /// Th division operator.
367         /// </summary>
368         /// <param name="arg1">The first value.</param>
369         /// <param name="arg2">The float value to scale the vector by.</param>
370         /// <returns>The vector containing the result of the scaling.</returns>
371         /// <since_tizen> 3 </since_tizen>
372         public static Vector2 operator /(Vector2 arg1, float arg2)
373         {
374             return arg1.Divide(arg2);
375         }
376
377         /// <summary>
378         /// Determines whether the specified object is equal to the current object.
379         /// </summary>
380         /// <param name="obj">The object to compare with the current object.</param>
381         /// <returns>true if the specified object is equal to the current object; otherwise, false.</returns>
382         public override bool Equals(System.Object obj)
383         {
384             Vector2 vector2 = obj as Vector2;
385             bool equal = false;
386             if (X == vector2?.X && Y == vector2?.Y)
387             {
388                 equal = true;
389             }
390             return equal;
391         }
392
393         /// <summary>
394         /// Gets the the hash code of this Vector2.
395         /// </summary>
396         /// <returns>The Hash Code.</returns>
397         /// <since_tizen> 5 </since_tizen>
398         public override int GetHashCode()
399         {
400             return base.GetHashCode();
401         }
402
403         /// <summary>
404         /// Returns the length of the vector.
405         /// </summary>
406         /// <returns>The length of the vector.</returns>
407         /// <since_tizen> 3 </since_tizen>
408         public float Length()
409         {
410             float ret = NDalicPINVOKE.Vector2_Length(swigCPtr);
411             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
412             return ret;
413         }
414
415         /// <summary>
416         /// Returns the length of the vector squared.<br />
417         /// This is more efficient than Length() for threshold
418         /// testing as it avoids the use of a square root.<br />
419         /// </summary>
420         /// <returns>The length of the vector squared</returns>
421         /// <since_tizen> 3 </since_tizen>
422         public float LengthSquared()
423         {
424             float ret = NDalicPINVOKE.Vector2_LengthSquared(swigCPtr);
425             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
426             return ret;
427         }
428
429         /// <summary>
430         /// Sets the vector to be the unit length, whilst maintaining its direction.
431         /// </summary>
432         /// <since_tizen> 3 </since_tizen>
433         public void Normalize()
434         {
435             NDalicPINVOKE.Vector2_Normalize(swigCPtr);
436             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
437         }
438
439         /// <summary>
440         /// Clamps the vector between minimum and maximum vectors.
441         /// </summary>
442         /// <param name="min">The minimum vector.</param>
443         /// <param name="max">The maximum vector.</param>
444         /// <since_tizen> 3 </since_tizen>
445         public void Clamp(Vector2 min, Vector2 max)
446         {
447             NDalicPINVOKE.Vector2_Clamp(swigCPtr, Vector2.getCPtr(min), Vector2.getCPtr(max));
448             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
449         }
450
451         /// <summary>
452         /// Dispose.
453         /// </summary>
454         /// <since_tizen> 3 </since_tizen>
455         public void Dispose()
456         {
457             //Throw excpetion if Dispose() is called in separate thread.
458             if (!Window.IsInstalled())
459             {
460                 throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
461             }
462
463             if (isDisposeQueued)
464             {
465                 Dispose(DisposeTypes.Implicit);
466             }
467             else
468             {
469                 Dispose(DisposeTypes.Explicit);
470                 System.GC.SuppressFinalize(this);
471             }
472         }
473
474         internal static Vector2 GetVector2FromPtr(global::System.IntPtr cPtr)
475         {
476             Vector2 ret = new Vector2(cPtr, false);
477             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
478             return ret;
479         }
480
481         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Vector2 obj)
482         {
483             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
484         }
485
486         internal SWIGTYPE_p_float AsFloat()
487         {
488             global::System.IntPtr cPtr = NDalicPINVOKE.Vector2_AsFloat__SWIG_0(swigCPtr);
489             SWIGTYPE_p_float ret = (cPtr == global::System.IntPtr.Zero) ? null : new SWIGTYPE_p_float(cPtr, false);
490             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
491             return ret;
492         }
493
494         /// <summary>
495         /// Dispose.
496         /// </summary>
497         /// <param name="type">The dispose type</param>
498         /// <since_tizen> 3 </since_tizen>
499         protected virtual void Dispose(DisposeTypes type)
500         {
501             if (disposed)
502             {
503                 return;
504             }
505
506             if (type == DisposeTypes.Explicit)
507             {
508                 //Called by User
509                 //Release your own managed resources here.
510                 //You should release all of your own disposable objects here.
511             }
512
513             //Release your own unmanaged resources here.
514             //You should not access any managed member here except static instance.
515             //because the execution order of Finalizes is non-deterministic.
516
517             if (swigCPtr.Handle != global::System.IntPtr.Zero)
518             {
519                 if (swigCMemOwn)
520                 {
521                     swigCMemOwn = false;
522                     NDalicPINVOKE.delete_Vector2(swigCPtr);
523                 }
524                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
525             }
526             disposed = true;
527         }
528
529         private Vector2 Add(Vector2 rhs)
530         {
531             Vector2 ret = new Vector2(NDalicPINVOKE.Vector2_Add(swigCPtr, Vector2.getCPtr(rhs)), true);
532             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
533             return ret;
534         }
535
536         private Vector2 AddAssign(Vector2 rhs)
537         {
538             Vector2 ret = new Vector2(NDalicPINVOKE.Vector2_AddAssign(swigCPtr, Vector2.getCPtr(rhs)), false);
539             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
540             return ret;
541         }
542
543         private Vector2 Subtract(Vector2 rhs)
544         {
545             Vector2 ret = new Vector2(NDalicPINVOKE.Vector2_Subtract__SWIG_0(swigCPtr, Vector2.getCPtr(rhs)), true);
546             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
547             return ret;
548         }
549
550         private Vector2 SubtractAssign(Vector2 rhs)
551         {
552             Vector2 ret = new Vector2(NDalicPINVOKE.Vector2_SubtractAssign(swigCPtr, Vector2.getCPtr(rhs)), false);
553             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
554             return ret;
555         }
556
557         private Vector2 Multiply(Vector2 rhs)
558         {
559             Vector2 ret = new Vector2(NDalicPINVOKE.Vector2_Multiply__SWIG_0(swigCPtr, Vector2.getCPtr(rhs)), true);
560             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
561             return ret;
562         }
563
564         private Vector2 Multiply(float rhs)
565         {
566             Vector2 ret = new Vector2(NDalicPINVOKE.Vector2_Multiply__SWIG_1(swigCPtr, rhs), true);
567             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
568             return ret;
569         }
570
571         private Vector2 MultiplyAssign(Vector2 rhs)
572         {
573             Vector2 ret = new Vector2(NDalicPINVOKE.Vector2_MultiplyAssign__SWIG_0(swigCPtr, Vector2.getCPtr(rhs)), false);
574             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
575             return ret;
576         }
577
578         private Vector2 MultiplyAssign(float rhs)
579         {
580             Vector2 ret = new Vector2(NDalicPINVOKE.Vector2_MultiplyAssign__SWIG_1(swigCPtr, rhs), false);
581             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
582             return ret;
583         }
584
585         private Vector2 Divide(Vector2 rhs)
586         {
587             Vector2 ret = new Vector2(NDalicPINVOKE.Vector2_Divide__SWIG_0(swigCPtr, Vector2.getCPtr(rhs)), true);
588             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
589             return ret;
590         }
591
592         private Vector2 Divide(float rhs)
593         {
594             Vector2 ret = new Vector2(NDalicPINVOKE.Vector2_Divide__SWIG_1(swigCPtr, rhs), true);
595             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
596             return ret;
597         }
598
599         private Vector2 DivideAssign(Vector2 rhs)
600         {
601             Vector2 ret = new Vector2(NDalicPINVOKE.Vector2_DivideAssign__SWIG_0(swigCPtr, Vector2.getCPtr(rhs)), false);
602             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
603             return ret;
604         }
605
606         private Vector2 DivideAssign(float rhs)
607         {
608             Vector2 ret = new Vector2(NDalicPINVOKE.Vector2_DivideAssign__SWIG_1(swigCPtr, rhs), false);
609             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
610             return ret;
611         }
612
613         private Vector2 Subtract()
614         {
615             Vector2 ret = new Vector2(NDalicPINVOKE.Vector2_Subtract__SWIG_1(swigCPtr), true);
616             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
617             return ret;
618         }
619
620         private bool EqualTo(Vector2 rhs)
621         {
622             bool ret = NDalicPINVOKE.Vector2_EqualTo(swigCPtr, Vector2.getCPtr(rhs));
623             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
624             return ret;
625         }
626
627         private bool NotEqualTo(Vector2 rhs)
628         {
629             bool ret = NDalicPINVOKE.Vector2_NotEqualTo(swigCPtr, Vector2.getCPtr(rhs));
630             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
631             return ret;
632         }
633
634         private float ValueOfIndex(uint index)
635         {
636             float ret = NDalicPINVOKE.Vector2_ValueOfIndex__SWIG_0(swigCPtr, index);
637             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
638             return ret;
639         }
640
641     }
642
643 }