X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2FTizen.NUI%2Fsrc%2Fpublic%2FVector3.cs;h=1e5cb08f4e2619fef79b15a820ed8e789cf5f38f;hb=46b8a31f5c1c75a22b648ca394a4de8a50898513;hp=a828521c352ca62b1ced41491c2be7bcb73dc90e;hpb=067e823e47c9d3a61947a4ac4066916714e68189;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git diff --git a/src/Tizen.NUI/src/public/Vector3.cs b/src/Tizen.NUI/src/public/Vector3.cs index a828521..1e5cb08 100755 --- a/src/Tizen.NUI/src/public/Vector3.cs +++ b/src/Tizen.NUI/src/public/Vector3.cs @@ -1,5 +1,5 @@ /* - * Copyright(c) 2017 Samsung Electronics Co., Ltd. + * Copyright(c) 2018 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ * limitations under the License. * */ +using System; +using Tizen.NUI.Binding; namespace Tizen.NUI { @@ -22,215 +24,21 @@ namespace Tizen.NUI /// A three-dimensional vector. /// /// 3 - public class Vector3 : global::System.IDisposable + [TypeConverter(typeof(Vector3TypeConverter))] + public class Vector3 : Disposable { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; /// /// swigCMemOwn. /// /// 3 protected bool swigCMemOwn; - - internal Vector3(global::System.IntPtr cPtr, bool cMemoryOwn) - { - swigCMemOwn = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Vector3 obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - //A Flag to check who called Dispose(). (By User or DisposeQueue) - private bool isDisposeQueued = false; - - /// - /// A Flat to check if it is already disposed. - /// - /// 3 - protected bool disposed = false; - - /// - /// Destructor. - /// - /// 3 - ~Vector3() - { - if(!isDisposeQueued) - { - isDisposeQueued = true; - DisposeQueue.Instance.Add(this); - } - } - - /// - /// Dispose. - /// - /// 3 - public void Dispose() - { - //Throw excpetion if Dispose() is called in separate thread. - if (!Window.IsInstalled()) - { - throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); - } - - if (isDisposeQueued) - { - Dispose(DisposeTypes.Implicit); - } - else - { - Dispose(DisposeTypes.Explicit); - System.GC.SuppressFinalize(this); - } - } - - /// - /// Dispose. - /// - /// The dispose type - /// 3 - protected virtual void Dispose(DisposeTypes type) - { - if (disposed) - { - return; - } - - if(type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_Vector3(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - disposed = true; - } - - /// - /// The addition operator. - /// - /// The first value. - /// The second value. - /// The vector containing the result of the addition. - /// 3 - public static Vector3 operator +(Vector3 arg1, Vector3 arg2) - { - return arg1.Add(arg2); - } - - /// - /// The subtraction operator. - /// - /// The first value. - /// The second value. - /// The vector containing the result of the subtraction. - /// 3 - public static Vector3 operator -(Vector3 arg1, Vector3 arg2) - { - return arg1.Subtract(arg2); - } - - /// - /// The unary negation operator. - /// - /// The target value. - /// The vector containg the negation. - /// 3 - public static Vector3 operator -(Vector3 arg1) - { - return arg1.Subtract(); - } - - /// - /// The multiplication operator. - /// - /// The first value. - /// The second value. - /// The vector containing the result of the multiplication. - /// 3 - public static Vector3 operator *(Vector3 arg1, Vector3 arg2) - { - return arg1.Multiply(arg2); - } - - /// - /// The multiplication operator. - /// - /// The first value. - /// The float value to scale the vector. - /// The vector containing the result of the scaling. - /// 3 - public static Vector3 operator *(Vector3 arg1, float arg2) - { - return arg1.Multiply(arg2); - } - - /// - /// The division operator. - /// - /// The first value. - /// The second value. - /// The vector containing the result of the division. - /// 3 - public static Vector3 operator /(Vector3 arg1, Vector3 arg2) - { - return arg1.Divide(arg2); - } - - /// - /// The division operator. - /// - /// The first value. - /// The float value to scale the vector by. - /// The vector containing the result of the scaling. - /// 3 - public static Vector3 operator /(Vector3 arg1, float arg2) - { - return arg1.Divide(arg2); - } - - /// - /// An array subscript operator overload. - /// - /// The subscript index. - /// The float at the given index. - /// 3 - public float this[uint index] - { - get - { - return ValueOfIndex(index); - } - } - - internal static Vector3 GetVector3FromPtr(global::System.IntPtr cPtr) - { - Vector3 ret = new Vector3(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } + private global::System.Runtime.InteropServices.HandleRef swigCPtr; /// /// The constructor. /// /// 3 - public Vector3() : this(NDalicPINVOKE.new_Vector3__SWIG_0(), true) + public Vector3() : this(Interop.Vector3.new_Vector3__SWIG_0(), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } @@ -242,7 +50,7 @@ namespace Tizen.NUI /// The y (or height) component. /// The z (or depth) component. /// 3 - public Vector3(float x, float y, float z) : this(NDalicPINVOKE.new_Vector3__SWIG_1(x, y, z), true) + public Vector3(float x, float y, float z) : this(Interop.Vector3.new_Vector3__SWIG_1(x, y, z), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } @@ -252,7 +60,7 @@ namespace Tizen.NUI /// /// An array of xyz. /// 3 - public Vector3(float[] array) : this(NDalicPINVOKE.new_Vector3__SWIG_2(array), true) + public Vector3(float[] array) : this(Interop.Vector3.new_Vector3__SWIG_2(array), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } @@ -262,7 +70,7 @@ namespace Tizen.NUI /// /// Vector2 to create this vector from. /// 3 - public Vector3(Vector2 vec2) : this(NDalicPINVOKE.new_Vector3__SWIG_3(Vector2.getCPtr(vec2)), true) + public Vector3(Vector2 vec2) : this(Interop.Vector3.new_Vector3__SWIG_3(Vector2.getCPtr(vec2)), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } @@ -272,11 +80,17 @@ namespace Tizen.NUI /// /// Vector4 to create this vector from. /// 3 - public Vector3(Vector4 vec4) : this(NDalicPINVOKE.new_Vector3__SWIG_4(Vector4.getCPtr(vec4)), true) + public Vector3(Vector4 vec4) : this(Interop.Vector3.new_Vector3__SWIG_4(Vector4.getCPtr(vec4)), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } + internal Vector3(global::System.IntPtr cPtr, bool cMemoryOwn) + { + swigCMemOwn = cMemoryOwn; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + /// /// (1.0f,1.0f,1.0f). /// @@ -285,7 +99,7 @@ namespace Tizen.NUI { get { - global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_ONE_get(); + global::System.IntPtr cPtr = Interop.Vector3.Vector3_ONE_get(); Vector3 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector3(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; @@ -300,7 +114,7 @@ namespace Tizen.NUI { get { - global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_XAXIS_get(); + global::System.IntPtr cPtr = Interop.Vector3.Vector3_XAXIS_get(); Vector3 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector3(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; @@ -315,7 +129,7 @@ namespace Tizen.NUI { get { - global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_YAXIS_get(); + global::System.IntPtr cPtr = Interop.Vector3.Vector3_YAXIS_get(); Vector3 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector3(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; @@ -330,7 +144,7 @@ namespace Tizen.NUI { get { - global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_ZAXIS_get(); + global::System.IntPtr cPtr = Interop.Vector3.Vector3_ZAXIS_get(); Vector3 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector3(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; @@ -345,7 +159,7 @@ namespace Tizen.NUI { get { - global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_NEGATIVE_XAXIS_get(); + global::System.IntPtr cPtr = Interop.Vector3.Vector3_NEGATIVE_XAXIS_get(); Vector3 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector3(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; @@ -360,7 +174,7 @@ namespace Tizen.NUI { get { - global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_NEGATIVE_YAXIS_get(); + global::System.IntPtr cPtr = Interop.Vector3.Vector3_NEGATIVE_YAXIS_get(); Vector3 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector3(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; @@ -375,7 +189,7 @@ namespace Tizen.NUI { get { - global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_NEGATIVE_ZAXIS_get(); + global::System.IntPtr cPtr = Interop.Vector3.Vector3_NEGATIVE_ZAXIS_get(); Vector3 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector3(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; @@ -390,144 +204,305 @@ namespace Tizen.NUI { get { - global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_ZERO_get(); + global::System.IntPtr cPtr = Interop.Vector3.Vector3_ZERO_get(); Vector3 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector3(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } } - private Vector3 Add(Vector3 rhs) + /// + /// The x component. + /// + /// 3 + public float X { - Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_Add(swigCPtr, Vector3.getCPtr(rhs)), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + set + { + Interop.Vector3.Vector3_X_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + float ret = Interop.Vector3.Vector3_X_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } } - private Vector3 AddAssign(Vector3 rhs) + /// + /// The width component. + /// + /// 3 + public float Width { - Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_AddAssign(swigCPtr, Vector3.getCPtr(rhs)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + set + { + Interop.Vector3.Vector3_Width_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + float ret = Interop.Vector3.Vector3_Width_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } } - private Vector3 Subtract(Vector3 rhs) + /// + /// The red component. + /// + /// 3 + public float R { - Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_Subtract__SWIG_0(swigCPtr, Vector3.getCPtr(rhs)), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + set + { + Interop.Vector3.Vector3_r_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + float ret = Interop.Vector3.Vector3_r_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } } - private Vector3 SubtractAssign(Vector3 rhs) + /// + /// The y component. + /// + /// 3 + public float Y { - Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_SubtractAssign(swigCPtr, Vector3.getCPtr(rhs)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + set + { + Interop.Vector3.Vector3_Y_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + float ret = Interop.Vector3.Vector3_Y_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } } - private Vector3 Multiply(Vector3 rhs) + /// + /// The height component. + /// + /// 3 + public float Height { - Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_Multiply__SWIG_0(swigCPtr, Vector3.getCPtr(rhs)), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private Vector3 Multiply(float rhs) + set + { + Interop.Vector3.Vector3_Height_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + float ret = Interop.Vector3.Vector3_Height_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + + /// + /// The green component. + /// + /// 3 + public float G { - Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_Multiply__SWIG_1(swigCPtr, rhs), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + set + { + Interop.Vector3.Vector3_g_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + float ret = Interop.Vector3.Vector3_g_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } } - private Vector3 MultiplyAssign(Vector3 rhs) + /// + /// The z component. + /// + /// 3 + public float Z { - Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_MultiplyAssign__SWIG_0(swigCPtr, Vector3.getCPtr(rhs)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + set + { + Interop.Vector3.Vector3_Z_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + float ret = Interop.Vector3.Vector3_Z_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } } - private Vector3 MultiplyAssign(float rhs) + /// + /// The depth component. + /// + /// 3 + public float Depth { - Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_MultiplyAssign__SWIG_1(swigCPtr, rhs), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + set + { + Interop.Vector3.Vector3_Depth_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + float ret = Interop.Vector3.Vector3_Depth_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } } - private Vector3 MultiplyAssign(Rotation rhs) + /// + /// The blue component. + /// + /// 3 + public float B { - Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_MultiplyAssign__SWIG_2(swigCPtr, Rotation.getCPtr(rhs)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + set + { + Interop.Vector3.Vector3_b_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + float ret = Interop.Vector3.Vector3_b_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } } - private Vector3 Divide(Vector3 rhs) + /// + /// An array subscript operator overload. + /// + /// The subscript index. + /// The float at the given index. + /// 3 + public float this[uint index] { - Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_Divide__SWIG_0(swigCPtr, Vector3.getCPtr(rhs)), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + get + { + return ValueOfIndex(index); + } } - private Vector3 Divide(float rhs) + /// + /// The addition operator. + /// + /// The first value. + /// The second value. + /// The vector containing the result of the addition. + /// 3 + public static Vector3 operator +(Vector3 arg1, Vector3 arg2) { - Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_Divide__SWIG_1(swigCPtr, rhs), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + return arg1.Add(arg2); } - private Vector3 DivideAssign(Vector3 rhs) + /// + /// The subtraction operator. + /// + /// The first value. + /// The second value. + /// The vector containing the result of the subtraction. + /// 3 + public static Vector3 operator -(Vector3 arg1, Vector3 arg2) { - Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_DivideAssign__SWIG_0(swigCPtr, Vector3.getCPtr(rhs)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + return arg1.Subtract(arg2); } - private Vector3 DivideAssign(float rhs) + /// + /// The unary negation operator. + /// + /// The target value. + /// The vector containg the negation. + /// 3 + public static Vector3 operator -(Vector3 arg1) { - Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_DivideAssign__SWIG_1(swigCPtr, rhs), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + return arg1.Subtract(); } - private Vector3 Subtract() + /// + /// The multiplication operator. + /// + /// The first value. + /// The second value. + /// The vector containing the result of the multiplication. + /// 3 + public static Vector3 operator *(Vector3 arg1, Vector3 arg2) { - Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_Subtract__SWIG_1(swigCPtr), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + return arg1.Multiply(arg2); } - private bool EqualTo(Vector3 rhs) + /// + /// The multiplication operator. + /// + /// The first value. + /// The float value to scale the vector. + /// The vector containing the result of the scaling. + /// 3 + public static Vector3 operator *(Vector3 arg1, float arg2) { - bool ret = NDalicPINVOKE.Vector3_EqualTo(swigCPtr, Vector3.getCPtr(rhs)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + return arg1.Multiply(arg2); } - private bool NotEqualTo(Vector3 rhs) + /// + /// The division operator. + /// + /// The first value. + /// The second value. + /// The vector containing the result of the division. + /// 3 + public static Vector3 operator /(Vector3 arg1, Vector3 arg2) { - bool ret = NDalicPINVOKE.Vector3_NotEqualTo(swigCPtr, Vector3.getCPtr(rhs)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + return arg1.Divide(arg2); } - private float ValueOfIndex(uint index) + /// + /// The division operator. + /// + /// The first value. + /// The float value to scale the vector by. + /// The vector containing the result of the scaling. + /// 3 + public static Vector3 operator /(Vector3 arg1, float arg2) { - float ret = NDalicPINVOKE.Vector3_ValueOfIndex__SWIG_0(swigCPtr, index); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + return arg1.Divide(arg2); } - internal float Dot(Vector3 other) + /// + /// Determines whether the specified object is equal to the current object. + /// + /// The object to compare with the current object. + /// true if the specified object is equal to the current object; otherwise, false. + public override bool Equals(System.Object obj) { - float ret = NDalicPINVOKE.Vector3_Dot(swigCPtr, Vector3.getCPtr(other)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + Vector3 vector3 = obj as Vector3; + bool equal = false; + if (X == vector3?.X && Y == vector3?.Y && Z == vector3?.Z) + { + equal = true; + } + return equal; } - internal Vector3 Cross(Vector3 other) + /// + /// Gets the the hash code of this Vector3. + /// + /// The Hash Code. + /// 6 + public override int GetHashCode() { - Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_Cross(swigCPtr, Vector3.getCPtr(other)), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + return swigCPtr.Handle.GetHashCode(); } /// @@ -537,7 +512,7 @@ namespace Tizen.NUI /// 3 public float Length() { - float ret = NDalicPINVOKE.Vector3_Length(swigCPtr); + float ret = Interop.Vector3.Vector3_Length(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } @@ -551,7 +526,7 @@ namespace Tizen.NUI /// 3 public float LengthSquared() { - float ret = NDalicPINVOKE.Vector3_LengthSquared(swigCPtr); + float ret = Interop.Vector3.Vector3_LengthSquared(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } @@ -562,7 +537,7 @@ namespace Tizen.NUI /// 3 public void Normalize() { - NDalicPINVOKE.Vector3_Normalize(swigCPtr); + Interop.Vector3.Vector3_Normalize(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } @@ -574,16 +549,8 @@ namespace Tizen.NUI /// 3 public void Clamp(Vector3 min, Vector3 max) { - NDalicPINVOKE.Vector3_Clamp(swigCPtr, Vector3.getCPtr(min), Vector3.getCPtr(max)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal SWIGTYPE_p_float AsFloat() - { - global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_AsFloat__SWIG_0(swigCPtr); - SWIGTYPE_p_float ret = (cPtr == global::System.IntPtr.Zero) ? null : new SWIGTYPE_p_float(cPtr, false); + Interop.Vector3.Vector3_Clamp(swigCPtr, Vector3.getCPtr(min), Vector3.getCPtr(max)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; } /// @@ -593,7 +560,7 @@ namespace Tizen.NUI /// 3 public Vector2 GetVectorXY() { - Vector2 ret = new Vector2(NDalicPINVOKE.Vector3_GetVectorXY__SWIG_0(swigCPtr), false); + Vector2 ret = new Vector2(Interop.Vector3.Vector3_GetVectorXY__SWIG_0(swigCPtr), false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } @@ -605,180 +572,190 @@ namespace Tizen.NUI /// 3 public Vector2 GetVectorYZ() { - Vector2 ret = new Vector2(NDalicPINVOKE.Vector3_GetVectorYZ__SWIG_0(swigCPtr), false); + Vector2 ret = new Vector2(Interop.Vector3.Vector3_GetVectorYZ__SWIG_0(swigCPtr), false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } - /// - /// The x component. - /// - /// 3 - public float X + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Vector3 obj) { - set - { - NDalicPINVOKE.Vector3_X_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - float ret = NDalicPINVOKE.Vector3_X_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; } - /// - /// The width component. - /// - /// 3 - public float Width + internal static Vector3 GetVector3FromPtr(global::System.IntPtr cPtr) { - set - { - NDalicPINVOKE.Vector3_Width_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - float ret = NDalicPINVOKE.Vector3_Width_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } + Vector3 ret = new Vector3(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - /// - /// The red component. - /// - /// 3 - public float R + internal SWIGTYPE_p_float AsFloat() { - set - { - NDalicPINVOKE.Vector3_r_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - float ret = NDalicPINVOKE.Vector3_r_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } + global::System.IntPtr cPtr = Interop.Vector3.Vector3_AsFloat__SWIG_0(swigCPtr); + SWIGTYPE_p_float ret = (cPtr == global::System.IntPtr.Zero) ? null : new SWIGTYPE_p_float(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } /// - /// The y component. + /// Dispose. /// + /// The dispose type /// 3 - public float Y + protected override void Dispose(DisposeTypes type) { - set + if (disposed) { - NDalicPINVOKE.Vector3_Y_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return; } - get + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (swigCPtr.Handle != global::System.IntPtr.Zero) { - float ret = NDalicPINVOKE.Vector3_Y_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + if (swigCMemOwn) + { + swigCMemOwn = false; + Interop.Vector3.delete_Vector3(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); } + base.Dispose(type); } - /// - /// The height component. - /// - /// 3 - public float Height + private Vector3 Add(Vector3 rhs) { - set - { - NDalicPINVOKE.Vector3_Height_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - float ret = NDalicPINVOKE.Vector3_Height_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } + Vector3 ret = new Vector3(Interop.Vector3.Vector3_Add(swigCPtr, Vector3.getCPtr(rhs)), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - /// - /// The green component. - /// - /// 3 - public float G + private Vector3 AddAssign(Vector3 rhs) { - set - { - NDalicPINVOKE.Vector3_g_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - float ret = NDalicPINVOKE.Vector3_g_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } + Vector3 ret = new Vector3(Interop.Vector3.Vector3_AddAssign(swigCPtr, Vector3.getCPtr(rhs)), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - /// - /// The z component. - /// - /// 3 - public float Z + private Vector3 Subtract(Vector3 rhs) { - set - { - NDalicPINVOKE.Vector3_Z_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - float ret = NDalicPINVOKE.Vector3_Z_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } + Vector3 ret = new Vector3(Interop.Vector3.Vector3_Subtract__SWIG_0(swigCPtr, Vector3.getCPtr(rhs)), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - /// - /// The depth component. - /// - /// 3 - public float Depth + private Vector3 SubtractAssign(Vector3 rhs) { - set - { - NDalicPINVOKE.Vector3_Depth_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - float ret = NDalicPINVOKE.Vector3_Depth_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } + Vector3 ret = new Vector3(Interop.Vector3.Vector3_SubtractAssign(swigCPtr, Vector3.getCPtr(rhs)), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - /// - /// The blue component. - /// - /// 3 - public float B + private Vector3 Multiply(Vector3 rhs) { - set - { - NDalicPINVOKE.Vector3_b_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - float ret = NDalicPINVOKE.Vector3_b_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } + Vector3 ret = new Vector3(Interop.Vector3.Vector3_Multiply__SWIG_0(swigCPtr, Vector3.getCPtr(rhs)), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private Vector3 Multiply(float rhs) + { + Vector3 ret = new Vector3(Interop.Vector3.Vector3_Multiply__SWIG_1(swigCPtr, rhs), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private Vector3 MultiplyAssign(Vector3 rhs) + { + Vector3 ret = new Vector3(Interop.Vector3.Vector3_MultiplyAssign__SWIG_0(swigCPtr, Vector3.getCPtr(rhs)), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private Vector3 MultiplyAssign(float rhs) + { + Vector3 ret = new Vector3(Interop.Vector3.Vector3_MultiplyAssign__SWIG_1(swigCPtr, rhs), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private Vector3 MultiplyAssign(Rotation rhs) + { + Vector3 ret = new Vector3(Interop.Vector3.Vector3_MultiplyAssign__SWIG_2(swigCPtr, Rotation.getCPtr(rhs)), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private Vector3 Divide(Vector3 rhs) + { + Vector3 ret = new Vector3(Interop.Vector3.Vector3_Divide__SWIG_0(swigCPtr, Vector3.getCPtr(rhs)), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private Vector3 Divide(float rhs) + { + Vector3 ret = new Vector3(Interop.Vector3.Vector3_Divide__SWIG_1(swigCPtr, rhs), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private Vector3 DivideAssign(Vector3 rhs) + { + Vector3 ret = new Vector3(Interop.Vector3.Vector3_DivideAssign__SWIG_0(swigCPtr, Vector3.getCPtr(rhs)), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private Vector3 DivideAssign(float rhs) + { + Vector3 ret = new Vector3(Interop.Vector3.Vector3_DivideAssign__SWIG_1(swigCPtr, rhs), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private Vector3 Subtract() + { + Vector3 ret = new Vector3(Interop.Vector3.Vector3_Subtract__SWIG_1(swigCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private bool EqualTo(Vector3 rhs) + { + bool ret = Interop.Vector3.Vector3_EqualTo(swigCPtr, Vector3.getCPtr(rhs)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private bool NotEqualTo(Vector3 rhs) + { + bool ret = Interop.Vector3.Vector3_NotEqualTo(swigCPtr, Vector3.getCPtr(rhs)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private float ValueOfIndex(uint index) + { + float ret = Interop.Vector3.Vector3_ValueOfIndex__SWIG_0(swigCPtr, index); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal float Dot(Vector3 other) + { + float ret = Interop.Vector3.Vector3_Dot(swigCPtr, Vector3.getCPtr(other)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal Vector3 Cross(Vector3 other) + { + Vector3 ret = new Vector3(Interop.Vector3.Vector3_Cross(swigCPtr, Vector3.getCPtr(other)), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } }