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