[NUI] Fix NUI Svace issue (#2806)
[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             set
217             {
218                 Tizen.Log.Fatal("NUI", "Please do not use this setter, Deprecated in API8, will be removed in API10. please use new Vector2(...) constructor");
219
220                 Interop.Vector2.XSet(SwigCPtr, value);
221                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
222
223                 callback?.Invoke(X, Y);
224             }
225             get
226             {
227                 float ret = Interop.Vector2.XGet(SwigCPtr);
228                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
229                 return ret;
230             }
231         }
232
233         /// <summary>
234         /// The width.
235         /// </summary>
236         /// <remarks>
237         /// The setter is deprecated in API8 and will be removed in API10. Please use new Vector2(...) constructor.
238         /// </remarks>
239         /// <code>
240         /// // DO NOT use like the followings!
241         /// Vector2 vector2 = new Vector2();
242         /// vector2.Width = 1.0f; 
243         /// // Please USE like this
244         /// float width = 1.0f, height = 2.0f;
245         /// Vector2 vector2 = new Vector2(x, y);
246         /// </code>
247         /// <since_tizen> 3 </since_tizen>
248         public float Width
249         {
250             set
251             {
252                 Tizen.Log.Fatal("NUI", "Please do not use this setter, Deprecated in API8, will be removed in API10. please use new Vector2(...) constructor");
253
254                 Interop.Vector2.WidthSet(SwigCPtr, value);
255                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
256
257                 callback?.Invoke(X, Y);
258             }
259             get
260             {
261                 float ret = Interop.Vector2.WidthGet(SwigCPtr);
262                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
263                 return ret;
264             }
265         }
266
267         /// <summary>
268         /// The y component.
269         /// </summary>
270         /// <remarks>
271         /// The setter is deprecated in API8 and will be removed in API10. Please use new Vector2(...) constructor.
272         /// </remarks>
273         /// <code>
274         /// // DO NOT use like the followings!
275         /// Vector2 vector2 = new Vector2();
276         /// vector2.Y = 0.5f; 
277         /// // Please USE like this
278         /// float x = 0.1f, y = 0.5f;
279         /// Vector2 vector2 = new Vector2(x, y);
280         /// </code>
281         /// <since_tizen> 3 </since_tizen>
282         public float Y
283         {
284             set
285             {
286                 Tizen.Log.Fatal("NUI", "Please do not use this setter, Deprecated in API8, will be removed in API10. please use new Vector2(...) constructor");
287
288                 Interop.Vector2.YSet(SwigCPtr, value);
289                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
290
291                 callback?.Invoke(X, Y);
292             }
293             get
294             {
295                 float ret = Interop.Vector2.YGet(SwigCPtr);
296                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
297                 return ret;
298             }
299         }
300
301         /// <summary>
302         /// The height.
303         /// </summary>
304         /// <remarks>
305         /// The setter is deprecated in API8 and will be removed in API10. Please use new Vector2(...) constructor.
306         /// </remarks>
307         /// <code>
308         /// // DO NOT use like the followings!
309         /// Vector2 vector2 = new Vector2();
310         /// vector2.Height = 2.0f; 
311         /// // Please USE like this
312         /// float width = 1.0f, height = 2.0f;
313         /// Vector2 vector2 = new Vector2(x, y);
314         /// </code>
315         /// <since_tizen> 3 </since_tizen>
316         public float Height
317         {
318             set
319             {
320                 Tizen.Log.Fatal("NUI", "Please do not use this setter, Deprecated in API8, will be removed in API10. please use new Vector2(...) constructor");
321
322                 Interop.Vector2.HeightSet(SwigCPtr, value);
323                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
324
325                 callback?.Invoke(X, Y);
326             }
327             get
328             {
329                 float ret = Interop.Vector2.HeightGet(SwigCPtr);
330                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
331                 return ret;
332             }
333         }
334
335         /// <summary>
336         /// The array subscript operator overload.
337         /// </summary>
338         /// <param name="index">The subscript index.</param>
339         /// <returns>The float at the given index.</returns>
340         /// <since_tizen> 3 </since_tizen>
341         public float this[uint index]
342         {
343             get
344             {
345                 return ValueOfIndex(index);
346             }
347         }
348
349         /// <summary>
350         /// The addition operator.
351         /// </summary>
352         /// <param name="arg1">The first value.</param>
353         /// <param name="arg2">The second value.</param>
354         /// <returns>The vector containing the result of the addition.</returns>
355         /// <since_tizen> 3 </since_tizen>
356         public static Vector2 operator +(Vector2 arg1, Vector2 arg2)
357         {
358             return arg1?.Add(arg2);
359         }
360
361         /// <summary>
362         /// The subtraction operator.
363         /// </summary>
364         /// <param name="arg1">The first value.</param>
365         /// <param name="arg2">The second value.</param>
366         /// <returns>The vector containing the result of the subtraction.</returns>
367         /// <since_tizen> 3 </since_tizen>
368         public static Vector2 operator -(Vector2 arg1, Vector2 arg2)
369         {
370             return arg1?.Subtract(arg2);
371         }
372
373         /// <summary>
374         /// The unary negation operator.
375         /// </summary>
376         /// <param name="arg1">The target value.</param>
377         /// <returns>The vector containing the negation.</returns>
378         /// <since_tizen> 3 </since_tizen>
379         public static Vector2 operator -(Vector2 arg1)
380         {
381             return arg1?.Subtract();
382         }
383
384         /// <summary>
385         /// The multiplication operator.
386         /// </summary>
387         /// <param name="arg1">The first value.</param>
388         /// <param name="arg2">The second value.</param>
389         /// <returns>The vector containing the result of the multiplication.</returns>
390         /// <since_tizen> 3 </since_tizen>
391         public static Vector2 operator *(Vector2 arg1, Vector2 arg2)
392         {
393             return arg1?.Multiply(arg2);
394         }
395
396         /// <summary>
397         /// Th multiplication operator.
398         /// </summary>
399         /// <param name="arg1">The first value.</param>
400         /// <param name="arg2">The float value to scale the vector.</param>
401         /// <returns>The vector containing the result of the scaling.</returns>
402         /// <since_tizen> 3 </since_tizen>
403         public static Vector2 operator *(Vector2 arg1, float arg2)
404         {
405             return arg1?.Multiply(arg2);
406         }
407
408         /// <summary>
409         /// The division operator.
410         /// </summary>
411         /// <param name="arg1">The first value.</param>
412         /// <param name="arg2">The second value.</param>
413         /// <returns>The vector containing the result of the division.</returns>
414         /// <since_tizen> 3 </since_tizen>
415         public static Vector2 operator /(Vector2 arg1, Vector2 arg2)
416         {
417             return arg1?.Divide(arg2);
418         }
419
420         /// <summary>
421         /// Th division operator.
422         /// </summary>
423         /// <param name="arg1">The first value.</param>
424         /// <param name="arg2">The float value to scale the vector by.</param>
425         /// <returns>The vector containing the result of the scaling.</returns>
426         /// <since_tizen> 3 </since_tizen>
427         public static Vector2 operator /(Vector2 arg1, float arg2)
428         {
429             return arg1?.Divide(arg2);
430         }
431
432         /// <summary>
433         /// Determines whether the specified object is equal to the current object.
434         /// </summary>
435         /// <param name="obj">The object to compare with the current object.</param>
436         /// <returns>true if the specified object is equal to the current object; otherwise, false.</returns>
437         public override bool Equals(System.Object obj)
438         {
439             Vector2 vector2 = obj as Vector2;
440             bool equal = false;
441             if (X == vector2?.X && Y == vector2?.Y)
442             {
443                 equal = true;
444             }
445             return equal;
446         }
447
448         /// <summary>
449         /// Gets the hash code of this Vector2.
450         /// </summary>
451         /// <returns>The Hash Code.</returns>
452         /// <since_tizen> 6 </since_tizen>
453         public override int GetHashCode()
454         {
455             return SwigCPtr.Handle.GetHashCode();
456         }
457
458         /// <summary>
459         /// Returns the length of the vector.
460         /// </summary>
461         /// <returns>The length of the vector.</returns>
462         /// <since_tizen> 3 </since_tizen>
463         public float Length()
464         {
465             float ret = Interop.Vector2.Length(SwigCPtr);
466             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
467             return ret;
468         }
469
470         /// <summary>
471         /// Returns the length of the vector squared.<br />
472         /// This is more efficient than Length() for threshold
473         /// testing as it avoids the use of a square root.<br />
474         /// </summary>
475         /// <returns>The length of the vector squared</returns>
476         /// <since_tizen> 3 </since_tizen>
477         public float LengthSquared()
478         {
479             float ret = Interop.Vector2.LengthSquared(SwigCPtr);
480             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
481             return ret;
482         }
483
484         /// <summary>
485         /// Sets the vector to be the unit length, whilst maintaining its direction.
486         /// </summary>
487         /// <since_tizen> 3 </since_tizen>
488         public void Normalize()
489         {
490             Interop.Vector2.Normalize(SwigCPtr);
491             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
492         }
493
494         /// <inheritdoc/>
495         [EditorBrowsable(EditorBrowsableState.Never)]
496         public object Clone() => new Vector2(this);
497
498         /// <summary>
499         /// Clamps the vector between minimum and maximum vectors.
500         /// </summary>
501         /// <param name="min">The minimum vector.</param>
502         /// <param name="max">The maximum vector.</param>
503         /// <since_tizen> 3 </since_tizen>
504         public void Clamp(Vector2 min, Vector2 max)
505         {
506             Interop.Vector2.Clamp(SwigCPtr, Vector2.getCPtr(min), Vector2.getCPtr(max));
507             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
508         }
509
510         internal static Vector2 GetVector2FromPtr(global::System.IntPtr cPtr)
511         {
512             Vector2 ret = new Vector2(cPtr, false);
513             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
514             return ret;
515         }
516
517         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Vector2 obj)
518         {
519             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.SwigCPtr;
520         }
521
522         internal SWIGTYPE_p_float AsFloat()
523         {
524             global::System.IntPtr cPtr = Interop.Vector2.AsFloat(SwigCPtr);
525             SWIGTYPE_p_float ret = (cPtr == global::System.IntPtr.Zero) ? null : new SWIGTYPE_p_float(cPtr);
526             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
527             return ret;
528         }
529
530         /// This will not be public opened.
531         [EditorBrowsable(EditorBrowsableState.Never)]
532         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
533         {
534             Interop.Vector2.DeleteVector2(swigCPtr);
535         }
536
537         private Vector2 Add(Vector2 rhs)
538         {
539             Vector2 ret = new Vector2(Interop.Vector2.Add(SwigCPtr, Vector2.getCPtr(rhs)), true);
540             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
541             return ret;
542         }
543
544         private Vector2 AddAssign(Vector2 rhs)
545         {
546             Vector2 ret = new Vector2(Interop.Vector2.AddAssign(SwigCPtr, Vector2.getCPtr(rhs)), false);
547             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
548             return ret;
549         }
550
551         private Vector2 Subtract(Vector2 rhs)
552         {
553             Vector2 ret = new Vector2(Interop.Vector2.Subtract(SwigCPtr, Vector2.getCPtr(rhs)), true);
554             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
555             return ret;
556         }
557
558         private Vector2 SubtractAssign(Vector2 rhs)
559         {
560             Vector2 ret = new Vector2(Interop.Vector2.SubtractAssign(SwigCPtr, Vector2.getCPtr(rhs)), false);
561             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
562             return ret;
563         }
564
565         private Vector2 Multiply(Vector2 rhs)
566         {
567             Vector2 ret = new Vector2(Interop.Vector2.Multiply(SwigCPtr, Vector2.getCPtr(rhs)), true);
568             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
569             return ret;
570         }
571
572         private Vector2 Multiply(float rhs)
573         {
574             Vector2 ret = new Vector2(Interop.Vector2.Multiply(SwigCPtr, rhs), true);
575             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
576             return ret;
577         }
578
579         private Vector2 MultiplyAssign(Vector2 rhs)
580         {
581             Vector2 ret = new Vector2(Interop.Vector2.MultiplyAssign(SwigCPtr, Vector2.getCPtr(rhs)), false);
582             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
583             return ret;
584         }
585
586         private Vector2 MultiplyAssign(float rhs)
587         {
588             Vector2 ret = new Vector2(Interop.Vector2.MultiplyAssign(SwigCPtr, rhs), false);
589             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
590             return ret;
591         }
592
593         private Vector2 Divide(Vector2 rhs)
594         {
595             Vector2 ret = new Vector2(Interop.Vector2.Divide(SwigCPtr, Vector2.getCPtr(rhs)), true);
596             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
597             return ret;
598         }
599
600         private Vector2 Divide(float rhs)
601         {
602             Vector2 ret = new Vector2(Interop.Vector2.Divide(SwigCPtr, rhs), true);
603             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
604             return ret;
605         }
606
607         private Vector2 DivideAssign(Vector2 rhs)
608         {
609             Vector2 ret = new Vector2(Interop.Vector2.DivideAssign(SwigCPtr, Vector2.getCPtr(rhs)), false);
610             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
611             return ret;
612         }
613
614         private Vector2 DivideAssign(float rhs)
615         {
616             Vector2 ret = new Vector2(Interop.Vector2.DivideAssign(SwigCPtr, rhs), false);
617             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
618             return ret;
619         }
620
621         private Vector2 Subtract()
622         {
623             Vector2 ret = new Vector2(Interop.Vector2.Subtract(SwigCPtr), true);
624             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
625             return ret;
626         }
627
628         private bool EqualTo(Vector2 rhs)
629         {
630             bool ret = Interop.Vector2.EqualTo(SwigCPtr, Vector2.getCPtr(rhs));
631             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
632             return ret;
633         }
634
635         private bool NotEqualTo(Vector2 rhs)
636         {
637             bool ret = Interop.Vector2.NotEqualTo(SwigCPtr, Vector2.getCPtr(rhs));
638             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
639             return ret;
640         }
641
642         private float ValueOfIndex(uint index)
643         {
644             float ret = Interop.Vector2.ValueOfIndex(SwigCPtr, index);
645             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
646             return ret;
647         }
648
649     }
650
651 }