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