[NUI] Remove ValueCheck function (#1131)
authorhuiyueun <35286162+huiyueun@users.noreply.github.com>
Wed, 20 Nov 2019 01:49:33 +0000 (10:49 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Wed, 20 Nov 2019 01:49:33 +0000 (10:49 +0900)
Signed-off-by: huiyu.eun <huiyu.eun@samsung.com>
src/Tizen.NUI/src/public/RelativeVector2.cs
src/Tizen.NUI/src/public/RelativeVector3.cs
src/Tizen.NUI/src/public/RelativeVector4.cs

index e283c54..ccb89e8 100755 (executable)
@@ -43,7 +43,7 @@ namespace Tizen.NUI
         /// <param name="x">The x component.</param>
         /// <param name="y">The y component.</param>
         /// <since_tizen> 3 </since_tizen>
-        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;
         }
 
         /// <summary>
@@ -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;
         }
 
         /// <summary>
@@ -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;
         }
 
         /// <summary>
@@ -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;
         }
 
         /// <summary>
@@ -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;
         }
 
         /// <summary>
@@ -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;
         }
 
         /// <summary>
@@ -206,7 +206,7 @@ namespace Tizen.NUI
         /// <since_tizen> 3 </since_tizen>
         public static implicit operator RelativeVector2(Vector2 vec)
         {
-            return new RelativeVector2(ValueCheck(vec.X), ValueCheck(vec.Y));
+            return new RelativeVector2(vec.X, vec.Y);
         }
 
         /// <summary>
@@ -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)
index 2a702e2..f749e6f 100755 (executable)
@@ -45,7 +45,7 @@ namespace Tizen.NUI
         /// <param name="y">The y component.</param>
         /// <param name="z">The z component.</param>
         /// <since_tizen> 3 </since_tizen>
-        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;
         }
 
         /// <summary>
@@ -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;
         }
 
         /// <summary>
@@ -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;
         }
 
         /// <summary>
@@ -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;
         }
 
         /// <summary>
@@ -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;
         }
 
         /// <summary>
@@ -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;
         }
 
         /// <summary>
@@ -218,7 +218,7 @@ namespace Tizen.NUI
         /// <since_tizen> 3 </since_tizen>
         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);
         }
 
         /// <summary>
@@ -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;
-        }
-
         /// <summary>
         /// </summary>
         internal static RelativeVector3 GetRelativeVector3FromPtr(global::System.IntPtr cPtr)
index ed4ef76..d7e637b 100755 (executable)
@@ -45,7 +45,7 @@ namespace Tizen.NUI
         /// <param name="z">The z component.</param>
         /// <param name="w">The w component.</param>
         /// <since_tizen> 3 </since_tizen>
-        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;
         }
 
         /// <summary>
@@ -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;
         }
 
         /// <summary>
@@ -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;
         }
 
         /// <summary>
@@ -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;
         }
 
         /// <summary>
@@ -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;
         }
 
         /// <summary>
@@ -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;
         }
 
         /// <summary>
@@ -253,7 +253,7 @@ namespace Tizen.NUI
         /// <since_tizen> 3 </since_tizen>
         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);
         }
 
         /// <summary>
@@ -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;