[NUI] Clean NUI codes from Adaptor.cs to Window.cs (#652)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / Vector3.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 three-dimensional vector.
25     /// </summary>
26     /// <since_tizen> 3 </since_tizen>
27     [TypeConverter(typeof(Vector3TypeConverter))]
28     public class Vector3 : global::System.IDisposable
29     {
30         /// <summary>
31         /// swigCMemOwn.
32         /// </summary>
33         /// <since_tizen> 3 </since_tizen>
34         protected bool swigCMemOwn;
35         /// <summary>
36         /// A Flat to check if it is already disposed.
37         /// </summary>
38         /// <since_tizen> 3 </since_tizen>
39         protected bool disposed = false;
40         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
41         //A Flag to check who called Dispose(). (By User or DisposeQueue)
42         private bool isDisposeQueued = false;
43
44         /// <summary>
45         /// The constructor.
46         /// </summary>
47         /// <since_tizen> 3 </since_tizen>
48         public Vector3() : this(NDalicPINVOKE.new_Vector3__SWIG_0(), true)
49         {
50             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
51         }
52
53         /// <summary>
54         /// The default constructor initializes the vector to 0.
55         /// </summary>
56         /// <param name="x">The x (or width) component.</param>
57         /// <param name="y">The y (or height) component.</param>
58         /// <param name="z">The z (or depth) component.</param>
59         /// <since_tizen> 3 </since_tizen>
60         public Vector3(float x, float y, float z) : this(NDalicPINVOKE.new_Vector3__SWIG_1(x, y, z), true)
61         {
62             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
63         }
64
65         /// <summary>
66         /// Conversion constructor from an array of three floats.
67         /// </summary>
68         /// <param name="array">An array of xyz.</param>
69         /// <since_tizen> 3 </since_tizen>
70         public Vector3(float[] array) : this(NDalicPINVOKE.new_Vector3__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="vec2">Vector2 to create this vector from.</param>
79         /// <since_tizen> 3 </since_tizen>
80         public Vector3(Vector2 vec2) : this(NDalicPINVOKE.new_Vector3__SWIG_3(Vector2.getCPtr(vec2)), 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 Vector3(Vector4 vec4) : this(NDalicPINVOKE.new_Vector3__SWIG_4(Vector4.getCPtr(vec4)), true)
91         {
92             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
93         }
94
95         internal Vector3(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         ~Vector3()
106         {
107             if(!isDisposeQueued)
108             {
109                 isDisposeQueued = true;
110                 DisposeQueue.Instance.Add(this);
111             }
112         }
113
114         /// <summary>
115         /// (1.0f,1.0f,1.0f).
116         /// </summary>
117         /// <since_tizen> 3 </since_tizen>
118         public static Vector3 One
119         {
120             get
121             {
122                 global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_ONE_get();
123                 Vector3 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector3(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 Vector3 XAxis
134         {
135             get
136             {
137                 global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_XAXIS_get();
138                 Vector3 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector3(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 Vector3 YAxis
149         {
150             get
151             {
152                 global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_YAXIS_get();
153                 Vector3 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector3(cPtr, false);
154                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
155                 return ret;
156             }
157         }
158
159         /// <summary>
160         /// The vector representing the z-axis.
161         /// </summary>
162         /// <since_tizen> 3 </since_tizen>
163         public static Vector3 ZAxis
164         {
165             get
166             {
167                 global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_ZAXIS_get();
168                 Vector3 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector3(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 x-axis.
176         /// </summary>
177         /// <since_tizen> 3 </since_tizen>
178         public static Vector3 NegativeXAxis
179         {
180             get
181             {
182                 global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_NEGATIVE_XAXIS_get();
183                 Vector3 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector3(cPtr, false);
184                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
185                 return ret;
186             }
187         }
188
189         /// <summary>
190         /// Th vector representing the negative y-axis.
191         /// </summary>
192         /// <since_tizen> 3 </since_tizen>
193         public static Vector3 NegativeYAxis
194         {
195             get
196             {
197                 global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_NEGATIVE_YAXIS_get();
198                 Vector3 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector3(cPtr, false);
199                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
200                 return ret;
201             }
202         }
203
204         /// <summary>
205         /// The vector representing the negative z-axis.
206         /// </summary>
207         /// <since_tizen> 3 </since_tizen>
208         public static Vector3 NegativeZAxis
209         {
210             get
211             {
212                 global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_NEGATIVE_ZAXIS_get();
213                 Vector3 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector3(cPtr, false);
214                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
215                 return ret;
216             }
217         }
218
219         /// <summary>
220         /// (0.0f, 0.0f, 0.0f).
221         /// </summary>
222         /// <since_tizen> 3 </since_tizen>
223         public static Vector3 Zero
224         {
225             get
226             {
227                 global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_ZERO_get();
228                 Vector3 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector3(cPtr, false);
229                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
230                 return ret;
231             }
232         }
233
234         /// <summary>
235         /// The x component.
236         /// </summary>
237         /// <since_tizen> 3 </since_tizen>
238         public float X
239         {
240             set
241             {
242                 NDalicPINVOKE.Vector3_X_set(swigCPtr, value);
243                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
244             }
245             get
246             {
247                 float ret = NDalicPINVOKE.Vector3_X_get(swigCPtr);
248                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
249                 return ret;
250             }
251         }
252
253         /// <summary>
254         /// The width component.
255         /// </summary>
256         /// <since_tizen> 3 </since_tizen>
257         public float Width
258         {
259             set
260             {
261                 NDalicPINVOKE.Vector3_Width_set(swigCPtr, value);
262                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
263             }
264             get
265             {
266                 float ret = NDalicPINVOKE.Vector3_Width_get(swigCPtr);
267                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
268                 return ret;
269             }
270         }
271
272         /// <summary>
273         /// The red component.
274         /// </summary>
275         /// <since_tizen> 3 </since_tizen>
276         public float R
277         {
278             set
279             {
280                 NDalicPINVOKE.Vector3_r_set(swigCPtr, value);
281                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
282             }
283             get
284             {
285                 float ret = NDalicPINVOKE.Vector3_r_get(swigCPtr);
286                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
287                 return ret;
288             }
289         }
290
291         /// <summary>
292         /// The y component.
293         /// </summary>
294         /// <since_tizen> 3 </since_tizen>
295         public float Y
296         {
297             set
298             {
299                 NDalicPINVOKE.Vector3_Y_set(swigCPtr, value);
300                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
301             }
302             get
303             {
304                 float ret = NDalicPINVOKE.Vector3_Y_get(swigCPtr);
305                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
306                 return ret;
307             }
308         }
309
310         /// <summary>
311         /// The height component.
312         /// </summary>
313         /// <since_tizen> 3 </since_tizen>
314         public float Height
315         {
316             set
317             {
318                 NDalicPINVOKE.Vector3_Height_set(swigCPtr, value);
319                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
320             }
321             get
322             {
323                 float ret = NDalicPINVOKE.Vector3_Height_get(swigCPtr);
324                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
325                 return ret;
326             }
327         }
328
329         /// <summary>
330         /// The green component.
331         /// </summary>
332         /// <since_tizen> 3 </since_tizen>
333         public float G
334         {
335             set
336             {
337                 NDalicPINVOKE.Vector3_g_set(swigCPtr, value);
338                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
339             }
340             get
341             {
342                 float ret = NDalicPINVOKE.Vector3_g_get(swigCPtr);
343                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
344                 return ret;
345             }
346         }
347
348         /// <summary>
349         /// The z component.
350         /// </summary>
351         /// <since_tizen> 3 </since_tizen>
352         public float Z
353         {
354             set
355             {
356                 NDalicPINVOKE.Vector3_Z_set(swigCPtr, value);
357                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
358             }
359             get
360             {
361                 float ret = NDalicPINVOKE.Vector3_Z_get(swigCPtr);
362                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
363                 return ret;
364             }
365         }
366
367         /// <summary>
368         /// The depth component.
369         /// </summary>
370         /// <since_tizen> 3 </since_tizen>
371         public float Depth
372         {
373             set
374             {
375                 NDalicPINVOKE.Vector3_Depth_set(swigCPtr, value);
376                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
377             }
378             get
379             {
380                 float ret = NDalicPINVOKE.Vector3_Depth_get(swigCPtr);
381                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
382                 return ret;
383             }
384         }
385
386         /// <summary>
387         /// The blue component.
388         /// </summary>
389         /// <since_tizen> 3 </since_tizen>
390         public float B
391         {
392             set
393             {
394                 NDalicPINVOKE.Vector3_b_set(swigCPtr, value);
395                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
396             }
397             get
398             {
399                 float ret = NDalicPINVOKE.Vector3_b_get(swigCPtr);
400                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
401                 return ret;
402             }
403         }
404
405         /// <summary>
406         /// An array subscript operator overload.
407         /// </summary>
408         /// <param name="index">The subscript index.</param>
409         /// <returns>The float at the given index.</returns>
410         /// <since_tizen> 3 </since_tizen>
411         public float this[uint index]
412         {
413             get
414             {
415                 return ValueOfIndex(index);
416             }
417         }
418
419         /// <summary>
420         /// The addition operator.
421         /// </summary>
422         /// <param name="arg1">The first value.</param>
423         /// <param name="arg2">The second value.</param>
424         /// <returns>The vector containing the result of the addition.</returns>
425         /// <since_tizen> 3 </since_tizen>
426         public static Vector3 operator +(Vector3 arg1, Vector3 arg2)
427         {
428             return arg1.Add(arg2);
429         }
430
431         /// <summary>
432         /// The subtraction operator.
433         /// </summary>
434         /// <param name="arg1">The first value.</param>
435         /// <param name="arg2">The second value.</param>
436         /// <returns>The vector containing the result of the subtraction.</returns>
437         /// <since_tizen> 3 </since_tizen>
438         public static Vector3 operator -(Vector3 arg1, Vector3 arg2)
439         {
440             return arg1.Subtract(arg2);
441         }
442
443         /// <summary>
444         /// The unary negation operator.
445         /// </summary>
446         /// <param name="arg1">The target value.</param>
447         /// <returns>The vector containg the negation.</returns>
448         /// <since_tizen> 3 </since_tizen>
449         public static Vector3 operator -(Vector3 arg1)
450         {
451             return arg1.Subtract();
452         }
453
454         /// <summary>
455         /// The multiplication operator.
456         /// </summary>
457         /// <param name="arg1">The first value.</param>
458         /// <param name="arg2">The second value.</param>
459         /// <returns>The vector containing the result of the multiplication.</returns>
460         /// <since_tizen> 3 </since_tizen>
461         public static Vector3 operator *(Vector3 arg1, Vector3 arg2)
462         {
463             return arg1.Multiply(arg2);
464         }
465
466         /// <summary>
467         /// The multiplication operator.
468         /// </summary>
469         /// <param name="arg1">The first value.</param>
470         /// <param name="arg2">The float value to scale the vector.</param>
471         /// <returns>The vector containing the result of the scaling.</returns>
472         /// <since_tizen> 3 </since_tizen>
473         public static Vector3 operator *(Vector3 arg1, float arg2)
474         {
475             return arg1.Multiply(arg2);
476         }
477
478         /// <summary>
479         /// The division operator.
480         /// </summary>
481         /// <param name="arg1">The first value.</param>
482         /// <param name="arg2">The second value.</param>
483         /// <returns>The vector containing the result of the division.</returns>
484         /// <since_tizen> 3 </since_tizen>
485         public static Vector3 operator /(Vector3 arg1, Vector3 arg2)
486         {
487             return arg1.Divide(arg2);
488         }
489
490         /// <summary>
491         /// The division operator.
492         /// </summary>
493         /// <param name="arg1">The first value.</param>
494         /// <param name="arg2">The float value to scale the vector by.</param>
495         /// <returns>The vector containing the result of the scaling.</returns>
496         /// <since_tizen> 3 </since_tizen>
497         public static Vector3 operator /(Vector3 arg1, float arg2)
498         {
499             return arg1.Divide(arg2);
500         }
501
502         /// <summary>
503         /// Determines whether the specified object is equal to the current object.
504         /// </summary>
505         /// <param name="obj">The object to compare with the current object.</param>
506         /// <returns>true if the specified object is equal to the current object; otherwise, false.</returns>
507         public override bool Equals(System.Object obj)
508         {
509             Vector3 vector3 = obj as Vector3;
510             bool equal = false;
511             if (X == vector3?.X && Y == vector3?.Y && Z == vector3?.Z)
512             {
513                 equal = true;
514             }
515             return equal;
516         }
517
518         /// <summary>
519         /// Gets the the hash code of this Vector3.
520         /// </summary>
521         /// <returns>The Hash Code.</returns>
522         /// <since_tizen> 5 </since_tizen>
523         public override int GetHashCode()
524         {
525             return X.GetHashCode();
526         }
527
528         /// <summary>
529         /// Returns the length of the vector.
530         /// </summary>
531         /// <returns>The length of the vector.</returns>
532         /// <since_tizen> 3 </since_tizen>
533         public float Length()
534         {
535             float ret = NDalicPINVOKE.Vector3_Length(swigCPtr);
536             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
537             return ret;
538         }
539
540         /// <summary>
541         /// Returns the length of the vector squared.<br />
542         /// This is more efficient than Length() for threshold
543         /// testing as it avoids the use of a square root.<br />
544         /// </summary>
545         /// <returns>The length of the vector squared.</returns>
546         /// <since_tizen> 3 </since_tizen>
547         public float LengthSquared()
548         {
549             float ret = NDalicPINVOKE.Vector3_LengthSquared(swigCPtr);
550             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
551             return ret;
552         }
553
554         /// <summary>
555         /// Sets the vector to be unit length, whilst maintaining its direction.
556         /// </summary>
557         /// <since_tizen> 3 </since_tizen>
558         public void Normalize()
559         {
560             NDalicPINVOKE.Vector3_Normalize(swigCPtr);
561             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
562         }
563
564         /// <summary>
565         /// Clamps the vector between minimum and maximum vectors.
566         /// </summary>
567         /// <param name="min">The minimum vector.</param>
568         /// <param name="max">The maximum vector.</param>
569         /// <since_tizen> 3 </since_tizen>
570         public void Clamp(Vector3 min, Vector3 max)
571         {
572             NDalicPINVOKE.Vector3_Clamp(swigCPtr, Vector3.getCPtr(min), Vector3.getCPtr(max));
573             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
574         }
575
576         /// <summary>
577         /// Returns the x and y components (or width and height, or r and g) as a Vector2.
578         /// </summary>
579         /// <returns>The partial vector contents as Vector2 (x,y).</returns>
580         /// <since_tizen> 3 </since_tizen>
581         public Vector2 GetVectorXY()
582         {
583             Vector2 ret = new Vector2(NDalicPINVOKE.Vector3_GetVectorXY__SWIG_0(swigCPtr), false);
584             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
585             return ret;
586         }
587
588         /// <summary>
589         /// Returns the y and z components (or height and depth, or g and b) as a Vector2.
590         /// </summary>
591         /// <returns>The partial vector contents as Vector2 (y,z).</returns>
592         /// <since_tizen> 3 </since_tizen>
593         public Vector2 GetVectorYZ()
594         {
595             Vector2 ret = new Vector2(NDalicPINVOKE.Vector3_GetVectorYZ__SWIG_0(swigCPtr), false);
596             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
597             return ret;
598         }
599
600         /// <summary>
601         /// Dispose.
602         /// </summary>
603         /// <since_tizen> 3 </since_tizen>
604         public void Dispose()
605         {
606             //Throw excpetion if Dispose() is called in separate thread.
607             if (!Window.IsInstalled())
608             {
609                 throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
610             }
611
612             if (isDisposeQueued)
613             {
614                 Dispose(DisposeTypes.Implicit);
615             }
616             else
617             {
618                 Dispose(DisposeTypes.Explicit);
619                 System.GC.SuppressFinalize(this);
620             }
621         }
622
623         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Vector3 obj)
624         {
625             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
626         }
627
628         internal static Vector3 GetVector3FromPtr(global::System.IntPtr cPtr)
629         {
630             Vector3 ret = new Vector3(cPtr, false);
631             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
632             return ret;
633         }
634
635         internal SWIGTYPE_p_float AsFloat()
636         {
637             global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_AsFloat__SWIG_0(swigCPtr);
638             SWIGTYPE_p_float ret = (cPtr == global::System.IntPtr.Zero) ? null : new SWIGTYPE_p_float(cPtr, false);
639             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
640             return ret;
641         }
642
643         /// <summary>
644         /// Dispose.
645         /// </summary>
646         /// <param name="type">The dispose type</param>
647         /// <since_tizen> 3 </since_tizen>
648         protected virtual void Dispose(DisposeTypes type)
649         {
650             if (disposed)
651             {
652                 return;
653             }
654
655             if (type == DisposeTypes.Explicit)
656             {
657                 //Called by User
658                 //Release your own managed resources here.
659                 //You should release all of your own disposable objects here.
660             }
661
662             //Release your own unmanaged resources here.
663             //You should not access any managed member here except static instance.
664             //because the execution order of Finalizes is non-deterministic.
665
666             if (swigCPtr.Handle != global::System.IntPtr.Zero)
667             {
668                 if (swigCMemOwn)
669                 {
670                     swigCMemOwn = false;
671                     NDalicPINVOKE.delete_Vector3(swigCPtr);
672                 }
673                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
674             }
675             disposed = true;
676         }
677
678         private Vector3 Add(Vector3 rhs)
679         {
680             Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_Add(swigCPtr, Vector3.getCPtr(rhs)), true);
681             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
682             return ret;
683         }
684
685         private Vector3 AddAssign(Vector3 rhs)
686         {
687             Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_AddAssign(swigCPtr, Vector3.getCPtr(rhs)), false);
688             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
689             return ret;
690         }
691
692         private Vector3 Subtract(Vector3 rhs)
693         {
694             Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_Subtract__SWIG_0(swigCPtr, Vector3.getCPtr(rhs)), true);
695             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
696             return ret;
697         }
698
699         private Vector3 SubtractAssign(Vector3 rhs)
700         {
701             Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_SubtractAssign(swigCPtr, Vector3.getCPtr(rhs)), false);
702             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
703             return ret;
704         }
705
706         private Vector3 Multiply(Vector3 rhs)
707         {
708             Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_Multiply__SWIG_0(swigCPtr, Vector3.getCPtr(rhs)), true);
709             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
710             return ret;
711         }
712
713         private Vector3 Multiply(float rhs)
714         {
715             Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_Multiply__SWIG_1(swigCPtr, rhs), true);
716             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
717             return ret;
718         }
719
720         private Vector3 MultiplyAssign(Vector3 rhs)
721         {
722             Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_MultiplyAssign__SWIG_0(swigCPtr, Vector3.getCPtr(rhs)), false);
723             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
724             return ret;
725         }
726
727         private Vector3 MultiplyAssign(float rhs)
728         {
729             Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_MultiplyAssign__SWIG_1(swigCPtr, rhs), false);
730             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
731             return ret;
732         }
733
734         private Vector3 MultiplyAssign(Rotation rhs)
735         {
736             Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_MultiplyAssign__SWIG_2(swigCPtr, Rotation.getCPtr(rhs)), false);
737             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
738             return ret;
739         }
740
741         private Vector3 Divide(Vector3 rhs)
742         {
743             Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_Divide__SWIG_0(swigCPtr, Vector3.getCPtr(rhs)), true);
744             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
745             return ret;
746         }
747
748         private Vector3 Divide(float rhs)
749         {
750             Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_Divide__SWIG_1(swigCPtr, rhs), true);
751             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
752             return ret;
753         }
754
755         private Vector3 DivideAssign(Vector3 rhs)
756         {
757             Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_DivideAssign__SWIG_0(swigCPtr, Vector3.getCPtr(rhs)), false);
758             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
759             return ret;
760         }
761
762         private Vector3 DivideAssign(float rhs)
763         {
764             Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_DivideAssign__SWIG_1(swigCPtr, rhs), false);
765             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
766             return ret;
767         }
768
769         private Vector3 Subtract()
770         {
771             Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_Subtract__SWIG_1(swigCPtr), true);
772             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
773             return ret;
774         }
775
776         private bool EqualTo(Vector3 rhs)
777         {
778             bool ret = NDalicPINVOKE.Vector3_EqualTo(swigCPtr, Vector3.getCPtr(rhs));
779             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
780             return ret;
781         }
782
783         private bool NotEqualTo(Vector3 rhs)
784         {
785             bool ret = NDalicPINVOKE.Vector3_NotEqualTo(swigCPtr, Vector3.getCPtr(rhs));
786             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
787             return ret;
788         }
789
790         private float ValueOfIndex(uint index)
791         {
792             float ret = NDalicPINVOKE.Vector3_ValueOfIndex__SWIG_0(swigCPtr, index);
793             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
794             return ret;
795         }
796
797         internal float Dot(Vector3 other)
798         {
799             float ret = NDalicPINVOKE.Vector3_Dot(swigCPtr, Vector3.getCPtr(other));
800             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
801             return ret;
802         }
803
804         internal Vector3 Cross(Vector3 other)
805         {
806             Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_Cross(swigCPtr, Vector3.getCPtr(other)), true);
807             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
808             return ret;
809         }
810
811     }
812
813 }