X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=ETL%2Ftrunk%2FETL%2F_angle.h;h=2ea372099a4b732fc7f9196425b13f1d5687938e;hb=9459638ad6797b8139f1e9f0715c96076dbf0890;hp=eb7710b2137be280ea485d9acc8a0a8bc44950fd;hpb=84a3dfe5cc1fafe126a639db7d233ac3a93883f1;p=synfig.git diff --git a/ETL/trunk/ETL/_angle.h b/ETL/trunk/ETL/_angle.h index eb7710b..2ea3720 100644 --- a/ETL/trunk/ETL/_angle.h +++ b/ETL/trunk/ETL/_angle.h @@ -1,4 +1,3 @@ -#include /* ======================================================================== ** Extended Template and Library ** Angle Abstraction Class Implementation @@ -26,11 +25,12 @@ /* === S T A R T =========================================================== */ -#ifndef __ETL_ANGLE_H -#define __ETL_ANGLE_H +#ifndef __ETL__ANGLE_H +#define __ETL__ANGLE_H /* === H E A D E R S ======================================================= */ +#include #include #include @@ -118,6 +118,7 @@ public: return ret; } +#ifdef ETL_NOT_USED //! 180 degree rotation operator /*! Returns the angle directly opposite of the given angle, and will yield a result @@ -129,6 +130,7 @@ public: ret.v = v+PI; return ret.mod(); } +#endif // ETL_NOT_USED #ifdef ETL_WRAP_ANGLES /*! Returns true if the shortest @@ -229,6 +231,7 @@ public: return ret; } +#ifdef ETL_WRAP_ANGLES //! Angle Difference Function /*! This function will return the shortest physical distance between @@ -253,6 +256,26 @@ public: ret.v-=rot_floor(ret.v); return ret; } +#else // ETL_WRAP_ANGLES + //! Angle Difference Function + /*! This function will return the + difference between + two angles, just like + \sa angle operator-(const angle &) */ + angle + dist(const angle &rhs)const + { return angle(*this)-=rhs; } + + //! Rotation Modulus + /*! This function will return the + value of the angle */ + angle + mod()const + { + angle ret(*this); + return ret; + } +#endif // ETL_WRAP_ANGLES //! Zero Rotation (0 degrees) static angle @@ -285,8 +308,10 @@ public: private: +#ifdef ETL_WRAP_ANGLES static value_type rot_floor(value_type x) { return static_cast(std::floor(x/(PI*2))*PI*2); } +#endif // ETL_WRAP_ANGLES public: /*