Remove unnecessary stream operators from radian and degree as well as unnecessary... 94/38494/4
authorKimmo Hoikka <kimmo.hoikka@samsung.com>
Tue, 21 Apr 2015 10:38:50 +0000 (11:38 +0100)
committerKimmo Hoikka <kimmo.hoikka@samsung.com>
Tue, 21 Apr 2015 14:20:14 +0000 (15:20 +0100)
Change-Id: Ia9fe5699e21b938786508ba63a9082dcbbc99523

automated-tests/src/dali/dali-test-suite-utils/dali-test-suite-utils.cpp
automated-tests/src/dali/dali-test-suite-utils/dali-test-suite-utils.h
dali/internal/event/events/pan-gesture-detector-impl.cpp
dali/public-api/math/angle-axis.h
dali/public-api/math/degree.h
dali/public-api/math/quaternion.cpp
dali/public-api/math/radian.h

index ee46961..6503314 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2015 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.
  *
  */
 
+// CLASS HEADER
+#include "dali-test-suite-utils.h"
+
+// EXTERNAL INCLUDES
+#include <ostream>
+
 // INTERNAL INCLUDES
 #include <dali/public-api/dali-core.h>
-#include <stdarg.h>
-
-#include "dali-test-suite-utils.h"
 
 using namespace Dali;
 
@@ -56,9 +59,21 @@ bool operator==(TimePeriod a, TimePeriod b)
   return Equals(a.durationSeconds, b.durationSeconds) && Equals(a.delaySeconds, b.delaySeconds) ;
 }
 
-std::ostream& operator<< (std::ostream& o, const TimePeriod value)
+std::ostream& operator<<( std::ostream& ostream, TimePeriod value )
+{
+  return ostream << "( Duration:" << value.durationSeconds << " Delay:" << value.delaySeconds << ")";
+}
+
+std::ostream& operator<<( std::ostream& ostream, Radian angle )
+{
+  ostream << angle.radian;
+  return ostream;
+}
+
+std::ostream& operator<<( std::ostream& ostream, Degree angle )
 {
-  return o << "( Duration:" << value.durationSeconds << " Delay:" << value.delaySeconds << ")";
+  ostream << angle.degree;
+  return ostream;
 }
 
 void DALI_TEST_EQUALS( const Matrix3& matrix1, const Matrix3& matrix2, const char* location)
index eecabce..ace09d4 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TEST_SUITE_UTILS_H__
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2015 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.
  *
  */
 
+// EXTERNAL INCLUDES
+#include <cstdarg>
+#include <iosfwd>
+
 // INTERNAL INCLUDES
 #include <dali/public-api/dali-core.h>
-#include <stdarg.h>
 
 void tet_infoline(const char*str);
 void tet_printf(const char *format, ...);
@@ -150,7 +153,9 @@ inline bool CompareType<Degree>(Degree q1, Degree q2, float epsilon)
 }
 
 bool operator==(TimePeriod a, TimePeriod b);
-std::ostream& operator<< (std::ostream& o, const TimePeriod value);
+std::ostream& operator<<( std::ostream& ostream, TimePeriod value );
+std::ostream& operator<<( std::ostream& ostream, Radian angle );
+std::ostream& operator<<( std::ostream& ostream, Degree angle );
 
 /**
  * Test whether two values are equal.
index 7c114d2..49028e6 100644 (file)
@@ -243,7 +243,7 @@ bool PanGestureDetector::CheckAngleAllowed( Radian angle ) const
 
       DALI_LOG_INFO( gLogFilter, Debug::General,
                      "AngleToCheck: %.2f, CompareWith: %.2f, Threshold: %.2f\n",
-                     Degree(angle.radian), Degree(angleAllowed), Degree(threshold) );
+                     Degree(angle), Degree(angleAllowed), Degree(threshold) );
 
       float relativeAngle( fabsf( WrapInDomain( angle - angleAllowed, -Math::PI, Math::PI ) ) );
       if ( relativeAngle <= threshold )
index c41ad53..0d7464c 100644 (file)
@@ -19,7 +19,6 @@
  */
 
 // INTERNAL INCLUDES
-#include <dali/public-api/math/degree.h>
 #include <dali/public-api/math/radian.h>
 #include <dali/public-api/math/vector3.h>
 
@@ -47,21 +46,10 @@ struct AngleAxis
   /**
    * @brief Create an angle-axis pair.
    *
-   * @param[in] initialAngle The initial angle in degrees.
-   * @param[in] initialAxis The initial axis.
-   */
-  AngleAxis( Degree initialAngle, Vector3 initialAxis )
-  : angle( initialAngle ),
-    axis( initialAxis )
-  { }
-
-  /**
-   * @brief Create an angle-axis pair.
-   *
    * @param[in] initialAngle The initial angle in radians.
    * @param[in] initialAxis The initial axis.
    */
-  AngleAxis( Radian initialAngle, Vector3 initialAxis )
+  AngleAxis( Radian initialAngle, const Vector3& initialAxis )
   : angle( initialAngle ),
     axis( initialAxis )
   { }
index 5cec5f1..292a01c 100644 (file)
@@ -18,9 +18,6 @@
  *
  */
 
-// EXTERNAL INCLUDES
-#include <ostream>
-
 // INTERNAL INCLUDES
 #include <dali/public-api/common/constants.h>
 #include <dali/public-api/common/dali-common.h>
@@ -106,18 +103,6 @@ inline Degree Clamp( Degree angle, float min, float max )
   return Degree( Clamp<float>( angle.degree, min, max ) );
 }
 
-/**
- * @brief Stream a degree value
- * @param [in] ostream The output stream to use.
- * @param [in] angle in Degree.
- * @return The output stream.
- */
-inline std::ostream& operator<<( std::ostream& ostream, Degree angle )
-{
-  ostream << angle.degree;
-  return ostream;
-}
-
 } // namespace Dali
 
 #endif // __DALI_DEGREE_H__
index daa8960..01afc00 100644 (file)
@@ -543,7 +543,7 @@ std::ostream& operator<<( std::ostream& o, const Quaternion& quaternion )
   Radian angleRadians;
 
   quaternion.ToAxisAngle( axis, angleRadians );
-  Degree degrees = Radian( angleRadians );
+  Degree degrees( angleRadians );
 
   return o << "[ Axis: [" << axis.x << ", " << axis.y << ", " << axis.z << "], Angle: " << degrees.degree << " degrees ]";
 }
index 586ca2d..6657851 100644 (file)
@@ -18,9 +18,6 @@
  *
  */
 
-// EXTERNAL INCLUDES
-#include <ostream>
-
 // INTERNAL INCLUDES
 #include <dali/public-api/common/constants.h>
 #include <dali/public-api/common/dali-common.h>
@@ -294,18 +291,6 @@ inline Radian Clamp( Radian angle, float min, float max )
   return Radian( Clamp<float>( angle.radian, min, max ) );
 }
 
-/**
- * @brief Stream a radian value
- * @param [in] ostream The output stream to use.
- * @param [in] angle in Radian.
- * @return The output stream.
- */
-inline std::ostream& operator<<( std::ostream& ostream, Radian angle )
-{
-  ostream << angle.radian;
-  return ostream;
-}
-
 } // namespace Dali
 
 #endif // __DALI_RADIAN_H__