Add ScriptUI to support XAML file (#320)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / Vector3.cs
1 /*
2  * Copyright(c) 2017 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         /// Returns the length of the vector.
554         /// </summary>
555         /// <returns>The length of the vector.</returns>
556         /// <since_tizen> 3 </since_tizen>
557         public float Length()
558         {
559             float ret = NDalicPINVOKE.Vector3_Length(swigCPtr);
560             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
561             return ret;
562         }
563
564         /// <summary>
565         /// Returns the length of the vector squared.<br />
566         /// This is more efficient than Length() for threshold
567         /// testing as it avoids the use of a square root.<br />
568         /// </summary>
569         /// <returns>The length of the vector squared.</returns>
570         /// <since_tizen> 3 </since_tizen>
571         public float LengthSquared()
572         {
573             float ret = NDalicPINVOKE.Vector3_LengthSquared(swigCPtr);
574             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
575             return ret;
576         }
577
578         /// <summary>
579         /// Sets the vector to be unit length, whilst maintaining its direction.
580         /// </summary>
581         /// <since_tizen> 3 </since_tizen>
582         public void Normalize()
583         {
584             NDalicPINVOKE.Vector3_Normalize(swigCPtr);
585             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
586         }
587
588         /// <summary>
589         /// Clamps the vector between minimum and maximum vectors.
590         /// </summary>
591         /// <param name="min">The minimum vector.</param>
592         /// <param name="max">The maximum vector.</param>
593         /// <since_tizen> 3 </since_tizen>
594         public void Clamp(Vector3 min, Vector3 max)
595         {
596             NDalicPINVOKE.Vector3_Clamp(swigCPtr, Vector3.getCPtr(min), Vector3.getCPtr(max));
597             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
598         }
599
600         internal SWIGTYPE_p_float AsFloat()
601         {
602             global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_AsFloat__SWIG_0(swigCPtr);
603             SWIGTYPE_p_float ret = (cPtr == global::System.IntPtr.Zero) ? null : new SWIGTYPE_p_float(cPtr, false);
604             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
605             return ret;
606         }
607
608         /// <summary>
609         /// Returns the x and y components (or width and height, or r and g) as a Vector2.
610         /// </summary>
611         /// <returns>The partial vector contents as Vector2 (x,y).</returns>
612         /// <since_tizen> 3 </since_tizen>
613         public Vector2 GetVectorXY()
614         {
615             Vector2 ret = new Vector2(NDalicPINVOKE.Vector3_GetVectorXY__SWIG_0(swigCPtr), false);
616             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
617             return ret;
618         }
619
620         /// <summary>
621         /// Returns the y and z components (or height and depth, or g and b) as a Vector2.
622         /// </summary>
623         /// <returns>The partial vector contents as Vector2 (y,z).</returns>
624         /// <since_tizen> 3 </since_tizen>
625         public Vector2 GetVectorYZ()
626         {
627             Vector2 ret = new Vector2(NDalicPINVOKE.Vector3_GetVectorYZ__SWIG_0(swigCPtr), false);
628             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
629             return ret;
630         }
631
632         /// <summary>
633         /// The x component.
634         /// </summary>
635         /// <since_tizen> 3 </since_tizen>
636         public float X
637         {
638             set
639             {
640                 NDalicPINVOKE.Vector3_X_set(swigCPtr, value);
641                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
642             }
643             get
644             {
645                 float ret = NDalicPINVOKE.Vector3_X_get(swigCPtr);
646                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
647                 return ret;
648             }
649         }
650
651         /// <summary>
652         /// The width component.
653         /// </summary>
654         /// <since_tizen> 3 </since_tizen>
655         public float Width
656         {
657             set
658             {
659                 NDalicPINVOKE.Vector3_Width_set(swigCPtr, value);
660                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
661             }
662             get
663             {
664                 float ret = NDalicPINVOKE.Vector3_Width_get(swigCPtr);
665                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
666                 return ret;
667             }
668         }
669
670         /// <summary>
671         /// The red component.
672         /// </summary>
673         /// <since_tizen> 3 </since_tizen>
674         public float R
675         {
676             set
677             {
678                 NDalicPINVOKE.Vector3_r_set(swigCPtr, value);
679                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
680             }
681             get
682             {
683                 float ret = NDalicPINVOKE.Vector3_r_get(swigCPtr);
684                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
685                 return ret;
686             }
687         }
688
689         /// <summary>
690         /// The y component.
691         /// </summary>
692         /// <since_tizen> 3 </since_tizen>
693         public float Y
694         {
695             set
696             {
697                 NDalicPINVOKE.Vector3_Y_set(swigCPtr, value);
698                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
699             }
700             get
701             {
702                 float ret = NDalicPINVOKE.Vector3_Y_get(swigCPtr);
703                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
704                 return ret;
705             }
706         }
707
708         /// <summary>
709         /// The height component.
710         /// </summary>
711         /// <since_tizen> 3 </since_tizen>
712         public float Height
713         {
714             set
715             {
716                 NDalicPINVOKE.Vector3_Height_set(swigCPtr, value);
717                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
718             }
719             get
720             {
721                 float ret = NDalicPINVOKE.Vector3_Height_get(swigCPtr);
722                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
723                 return ret;
724             }
725         }
726
727         /// <summary>
728         /// The green component.
729         /// </summary>
730         /// <since_tizen> 3 </since_tizen>
731         public float G
732         {
733             set
734             {
735                 NDalicPINVOKE.Vector3_g_set(swigCPtr, value);
736                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
737             }
738             get
739             {
740                 float ret = NDalicPINVOKE.Vector3_g_get(swigCPtr);
741                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
742                 return ret;
743             }
744         }
745
746         /// <summary>
747         /// The z component.
748         /// </summary>
749         /// <since_tizen> 3 </since_tizen>
750         public float Z
751         {
752             set
753             {
754                 NDalicPINVOKE.Vector3_Z_set(swigCPtr, value);
755                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
756             }
757             get
758             {
759                 float ret = NDalicPINVOKE.Vector3_Z_get(swigCPtr);
760                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
761                 return ret;
762             }
763         }
764
765         /// <summary>
766         /// The depth component.
767         /// </summary>
768         /// <since_tizen> 3 </since_tizen>
769         public float Depth
770         {
771             set
772             {
773                 NDalicPINVOKE.Vector3_Depth_set(swigCPtr, value);
774                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
775             }
776             get
777             {
778                 float ret = NDalicPINVOKE.Vector3_Depth_get(swigCPtr);
779                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
780                 return ret;
781             }
782         }
783
784         /// <summary>
785         /// The blue component.
786         /// </summary>
787         /// <since_tizen> 3 </since_tizen>
788         public float B
789         {
790             set
791             {
792                 NDalicPINVOKE.Vector3_b_set(swigCPtr, value);
793                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
794             }
795             get
796             {
797                 float ret = NDalicPINVOKE.Vector3_b_get(swigCPtr);
798                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
799                 return ret;
800             }
801         }
802
803     }
804
805 }