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