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