From: huiyueun <35286162+huiyueun@users.noreply.github.com> Date: Wed, 20 Nov 2019 01:49:33 +0000 (+0900) Subject: [NUI] Remove ValueCheck function (#1131) X-Git-Tag: accepted/tizen/unified/20210219.040944~946 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1d16735f15ce795dadfe06d18913340e5891be2a;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [NUI] Remove ValueCheck function (#1131) Signed-off-by: huiyu.eun --- diff --git a/src/Tizen.NUI/src/public/RelativeVector2.cs b/src/Tizen.NUI/src/public/RelativeVector2.cs index e283c54..ccb89e8 100755 --- a/src/Tizen.NUI/src/public/RelativeVector2.cs +++ b/src/Tizen.NUI/src/public/RelativeVector2.cs @@ -43,7 +43,7 @@ namespace Tizen.NUI /// The x component. /// The y component. /// 3 - public RelativeVector2(float x, float y) : this(Interop.Vector2.new_Vector2__SWIG_1(ValueCheck(x), ValueCheck(y)), true) + public RelativeVector2(float x, float y) : this(Interop.Vector2.new_Vector2__SWIG_1(x, y), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } @@ -80,7 +80,7 @@ namespace Tizen.NUI { set { - Interop.Vector2.Vector2_X_set(swigCPtr, ValueCheck(value)); + Interop.Vector2.Vector2_X_set(swigCPtr, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } get @@ -99,7 +99,7 @@ namespace Tizen.NUI { set { - Interop.Vector2.Vector2_Y_set(swigCPtr, ValueCheck(value)); + Interop.Vector2.Vector2_Y_set(swigCPtr, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } get @@ -125,7 +125,7 @@ namespace Tizen.NUI public static RelativeVector2 operator +(RelativeVector2 arg1, RelativeVector2 arg2) { RelativeVector2 result = arg1.Add(arg2); - return ValueCheck(result); + return result; } /// @@ -138,7 +138,7 @@ namespace Tizen.NUI public static RelativeVector2 operator -(RelativeVector2 arg1, RelativeVector2 arg2) { RelativeVector2 result = arg1.Subtract(arg2); - return ValueCheck(result); + return result; } /// @@ -151,7 +151,7 @@ namespace Tizen.NUI public static RelativeVector2 operator *(RelativeVector2 arg1, RelativeVector2 arg2) { RelativeVector2 result = arg1.Multiply(arg2); - return ValueCheck(result); + return result; } /// @@ -164,7 +164,7 @@ namespace Tizen.NUI public static RelativeVector2 operator *(RelativeVector2 arg1, float arg2) { RelativeVector2 result = arg1.Multiply(arg2); - return ValueCheck(result); + return result; } /// @@ -177,7 +177,7 @@ namespace Tizen.NUI public static RelativeVector2 operator /(RelativeVector2 arg1, RelativeVector2 arg2) { RelativeVector2 result = arg1.Divide(arg2); - return ValueCheck(result); + return result; } /// @@ -190,7 +190,7 @@ namespace Tizen.NUI public static RelativeVector2 operator /(RelativeVector2 arg1, float arg2) { RelativeVector2 result = arg1.Divide(arg2); - return ValueCheck(result); + return result; } /// @@ -206,7 +206,7 @@ namespace Tizen.NUI /// 3 public static implicit operator RelativeVector2(Vector2 vec) { - return new RelativeVector2(ValueCheck(vec.X), ValueCheck(vec.Y)); + return new RelativeVector2(vec.X, vec.Y); } /// @@ -284,46 +284,6 @@ namespace Tizen.NUI return ret; } - internal static RelativeVector2 ValueCheck(RelativeVector2 relativeVector2) - { - if (relativeVector2.X < 0.0f) - { - relativeVector2.X = 0.0f; - NUILog.Error("The value of Result is invalid! Should be between [0, 1]."); - } - else if (relativeVector2.X > 1.0f) - { - relativeVector2.X = 1.0f; - NUILog.Error("The value of Result is invalid! Should be between [0, 1]."); - } - if (relativeVector2.Y < 0.0f) - { - relativeVector2.Y = 0.0f; - NUILog.Error("The value of Result is invalid! Should be between [0, 1]."); - } - else if (relativeVector2.Y > 1.0f) - { - relativeVector2.Y = 1.0f; - NUILog.Error("The value of Result is invalid! Should be between [0, 1]."); - } - return relativeVector2; - } - - internal static float ValueCheck(float value) - { - if (value < 0.0f) - { - value = 0.0f; - NUILog.Error("The value of Parameters is invalid! Should be between [0, 1]."); - } - else if (value > 1.0f) - { - value = 1.0f; - NUILog.Error("The value of Parameters is invalid! Should be between [0, 1]."); - } - return value; - } - /// This will not be public opened. [EditorBrowsable(EditorBrowsableState.Never)] protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr) diff --git a/src/Tizen.NUI/src/public/RelativeVector3.cs b/src/Tizen.NUI/src/public/RelativeVector3.cs index 2a702e2..f749e6f 100755 --- a/src/Tizen.NUI/src/public/RelativeVector3.cs +++ b/src/Tizen.NUI/src/public/RelativeVector3.cs @@ -45,7 +45,7 @@ namespace Tizen.NUI /// The y component. /// The z component. /// 3 - public RelativeVector3(float x, float y, float z) : this(Interop.Vector3.new_Vector3__SWIG_1(ValueCheck(x), ValueCheck(y), ValueCheck(z)), true) + public RelativeVector3(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(); } @@ -78,7 +78,7 @@ namespace Tizen.NUI { set { - Interop.Vector3.Vector3_X_set(swigCPtr, ValueCheck(value)); + Interop.Vector3.Vector3_X_set(swigCPtr, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } get @@ -97,7 +97,7 @@ namespace Tizen.NUI { set { - Interop.Vector3.Vector3_Y_set(swigCPtr, ValueCheck(value)); + Interop.Vector3.Vector3_Y_set(swigCPtr, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } get @@ -116,7 +116,7 @@ namespace Tizen.NUI { set { - Interop.Vector3.Vector3_Z_set(swigCPtr, ValueCheck(value)); + Interop.Vector3.Vector3_Z_set(swigCPtr, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } get @@ -137,7 +137,7 @@ namespace Tizen.NUI public static RelativeVector3 operator +(RelativeVector3 arg1, RelativeVector3 arg2) { RelativeVector3 result = arg1.Add(arg2); - return ValueCheck(result); + return result; } /// @@ -150,7 +150,7 @@ namespace Tizen.NUI public static RelativeVector3 operator -(RelativeVector3 arg1, RelativeVector3 arg2) { RelativeVector3 result = arg1.Subtract(arg2); - return ValueCheck(result); + return result; } /// @@ -163,7 +163,7 @@ namespace Tizen.NUI public static RelativeVector3 operator *(RelativeVector3 arg1, RelativeVector3 arg2) { RelativeVector3 result = arg1.Multiply(arg2); - return ValueCheck(result); + return result; } /// @@ -176,7 +176,7 @@ namespace Tizen.NUI public static RelativeVector3 operator *(RelativeVector3 arg1, float arg2) { RelativeVector3 result = arg1.Multiply(arg2); - return ValueCheck(result); + return result; } /// @@ -189,7 +189,7 @@ namespace Tizen.NUI public static RelativeVector3 operator /(RelativeVector3 arg1, RelativeVector3 arg2) { RelativeVector3 result = arg1.Divide(arg2); - return ValueCheck(result); + return result; } /// @@ -202,7 +202,7 @@ namespace Tizen.NUI public static RelativeVector3 operator /(RelativeVector3 arg1, float arg2) { RelativeVector3 result = arg1.Divide(arg2); - return ValueCheck(result); + return result; } /// @@ -218,7 +218,7 @@ namespace Tizen.NUI /// 3 public static implicit operator RelativeVector3(Vector3 vec) { - return new RelativeVector3(ValueCheck(vec.X), ValueCheck(vec.Y), ValueCheck(vec.Z)); + return new RelativeVector3(vec.X, vec.Y, vec.Z); } /// @@ -287,56 +287,6 @@ namespace Tizen.NUI return ret; } - internal static RelativeVector3 ValueCheck(RelativeVector3 relativeVector3) - { - if (relativeVector3.X < 0.0f) - { - relativeVector3.X = 0.0f; - NUILog.Error("The value of Result is invalid! Should be between [0, 1]."); - } - else if (relativeVector3.X > 1.0f) - { - relativeVector3.X = 1.0f; - NUILog.Error("The value of Result is invalid! Should be between [0, 1]."); - } - if (relativeVector3.Y < 0.0f) - { - relativeVector3.Y = 0.0f; - NUILog.Error("The value of Result is invalid! Should be between [0, 1]."); - } - else if (relativeVector3.Y > 1.0f) - { - relativeVector3.Y = 1.0f; - NUILog.Error("The value of Result is invalid! Should be between [0, 1]."); - } - if (relativeVector3.Z < 0.0f) - { - relativeVector3.Z = 0.0f; - NUILog.Error("The value of Result is invalid! Should be between [0, 1]."); - } - else if (relativeVector3.Z > 1.0f) - { - relativeVector3.Z = 1.0f; - NUILog.Error("The value of Result is invalid! Should be between [0, 1]."); - } - return relativeVector3; - } - - internal static float ValueCheck(float value) - { - if (value < 0.0f) - { - value = 0.0f; - NUILog.Error("The value of Parameters is invalid! Should be between [0, 1]."); - } - else if (value > 1.0f) - { - value = 1.0f; - NUILog.Error("The value of Parameters is invalid! Should be between [0, 1]."); - } - return value; - } - /// /// internal static RelativeVector3 GetRelativeVector3FromPtr(global::System.IntPtr cPtr) diff --git a/src/Tizen.NUI/src/public/RelativeVector4.cs b/src/Tizen.NUI/src/public/RelativeVector4.cs index ed4ef76..d7e637b 100755 --- a/src/Tizen.NUI/src/public/RelativeVector4.cs +++ b/src/Tizen.NUI/src/public/RelativeVector4.cs @@ -45,7 +45,7 @@ namespace Tizen.NUI /// The z component. /// The w component. /// 3 - public RelativeVector4(float x, float y, float z, float w) : this(Interop.Vector4.new_Vector4__SWIG_1(ValueCheck(x), ValueCheck(y), ValueCheck(z), ValueCheck(w)), true) + public RelativeVector4(float x, float y, float z, float w) : this(Interop.Vector4.new_Vector4__SWIG_1(x, y, z, w), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } @@ -70,7 +70,7 @@ namespace Tizen.NUI if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - internal RelativeVector4(RelativeVector4ChangedCallback cb, float x, float y, float z, float w) : this(Interop.Vector4.new_Vector4__SWIG_1(ValueCheck(x), ValueCheck(y), ValueCheck(z), ValueCheck(w)), true) + internal RelativeVector4(RelativeVector4ChangedCallback cb, float x, float y, float z, float w) : this(Interop.Vector4.new_Vector4__SWIG_1(x, y, z, w), true) { callback = cb; if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -86,7 +86,7 @@ namespace Tizen.NUI { set { - Interop.Vector4.Vector4_X_set(swigCPtr, ValueCheck(value)); + Interop.Vector4.Vector4_X_set(swigCPtr, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); callback?.Invoke(X, Y, Z, W); @@ -107,7 +107,7 @@ namespace Tizen.NUI { set { - Interop.Vector4.Vector4_Y_set(swigCPtr, ValueCheck(value)); + Interop.Vector4.Vector4_Y_set(swigCPtr, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); callback?.Invoke(X, Y, Z, W); @@ -128,7 +128,7 @@ namespace Tizen.NUI { set { - Interop.Vector4.Vector4_Z_set(swigCPtr, ValueCheck(value)); + Interop.Vector4.Vector4_Z_set(swigCPtr, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); callback?.Invoke(X, Y, Z, W); @@ -149,7 +149,7 @@ namespace Tizen.NUI { set { - Interop.Vector4.Vector4_W_set(swigCPtr, ValueCheck(value)); + Interop.Vector4.Vector4_W_set(swigCPtr, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); callback?.Invoke(X, Y, Z, W); @@ -172,7 +172,7 @@ namespace Tizen.NUI public static RelativeVector4 operator +(RelativeVector4 arg1, RelativeVector4 arg2) { RelativeVector4 result = arg1.Add(arg2); - return ValueCheck(result); + return result; } /// @@ -185,7 +185,7 @@ namespace Tizen.NUI public static RelativeVector4 operator -(RelativeVector4 arg1, RelativeVector4 arg2) { RelativeVector4 result = arg1.Subtract(arg2); - return ValueCheck(result); + return result; } /// @@ -198,7 +198,7 @@ namespace Tizen.NUI public static RelativeVector4 operator *(RelativeVector4 arg1, RelativeVector4 arg2) { RelativeVector4 result = arg1.Multiply(arg2); - return ValueCheck(result); + return result; } /// @@ -211,7 +211,7 @@ namespace Tizen.NUI public static RelativeVector4 operator *(RelativeVector4 arg1, float arg2) { RelativeVector4 result = arg1.Multiply(arg2); - return ValueCheck(result); + return result; } /// @@ -224,7 +224,7 @@ namespace Tizen.NUI public static RelativeVector4 operator /(RelativeVector4 arg1, RelativeVector4 arg2) { RelativeVector4 result = arg1.Divide(arg2); - return ValueCheck(result); + return result; } /// @@ -237,7 +237,7 @@ namespace Tizen.NUI public static RelativeVector4 operator /(RelativeVector4 arg1, float arg2) { RelativeVector4 result = arg1.Divide(arg2); - return ValueCheck(result); + return result; } /// @@ -253,7 +253,7 @@ namespace Tizen.NUI /// 3 public static implicit operator RelativeVector4(Vector4 vec) { - return new RelativeVector4(ValueCheck(vec.X), ValueCheck(vec.Y), ValueCheck(vec.Z), ValueCheck(vec.W)); + return new RelativeVector4(vec.X, vec.Y, vec.Z, vec.W); } /// @@ -331,66 +331,6 @@ namespace Tizen.NUI return ret; } - internal static RelativeVector4 ValueCheck(RelativeVector4 relativeVector4) - { - if (relativeVector4.X < 0.0f) - { - relativeVector4.X = 0.0f; - NUILog.Error("The value of Result is invalid! Should be between [0, 1]."); - } - else if (relativeVector4.X > 1.0f) - { - relativeVector4.X = 1.0f; - NUILog.Error("The value of Result is invalid! Should be between [0, 1]."); - } - if (relativeVector4.Y < 0.0f) - { - relativeVector4.Y = 0.0f; - NUILog.Error("The value of Result is invalid! Should be between [0, 1]."); - } - else if (relativeVector4.Y > 1.0f) - { - relativeVector4.Y = 1.0f; - NUILog.Error("The value of Result is invalid! Should be between [0, 1]."); - } - if (relativeVector4.Z < 0.0f) - { - relativeVector4.Z = 0.0f; - NUILog.Error("The value of Result is invalid! Should be between [0, 1]."); - } - else if (relativeVector4.Z > 1.0f) - { - relativeVector4.Z = 1.0f; - NUILog.Error("The value of Result is invalid! Should be between [0, 1]."); - } - if (relativeVector4.W < 0.0f) - { - relativeVector4.W = 0.0f; - NUILog.Error("The value of Result is invalid! Should be between [0, 1]."); - } - else if (relativeVector4.W > 1.0f) - { - relativeVector4.W = 1.0f; - NUILog.Error("The value of Result is invalid! Should be between [0, 1]."); - } - return relativeVector4; - } - - internal static float ValueCheck(float value) - { - if (value < 0.0f) - { - value = 0.0f; - NUILog.Error("The value of Parameters is invalid! Should be between [0, 1]."); - } - else if (value > 1.0f) - { - value = 1.0f; - NUILog.Error("The value of Parameters is invalid! Should be between [0, 1]."); - } - return value; - } - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(RelativeVector4 obj) { return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;