/*
- * 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;
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)
#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, ...);
}
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.
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 )
*/
// INTERNAL INCLUDES
-#include <dali/public-api/math/degree.h>
#include <dali/public-api/math/radian.h>
#include <dali/public-api/math/vector3.h>
/**
* @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 )
{ }
*
*/
-// EXTERNAL INCLUDES
-#include <ostream>
-
// INTERNAL INCLUDES
#include <dali/public-api/common/constants.h>
#include <dali/public-api/common/dali-common.h>
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__
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 ]";
}
*
*/
-// EXTERNAL INCLUDES
-#include <ostream>
-
// INTERNAL INCLUDES
#include <dali/public-api/common/constants.h>
#include <dali/public-api/common/dali-common.h>
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__