diff --git a/vcg/math/base.h b/vcg/math/base.h index 97d991e7..19ced76c 100644 --- a/vcg/math/base.h +++ b/vcg/math/base.h @@ -24,6 +24,11 @@ History $Log: not supported by cvs2svn $ +Revision 1.10 2004/03/10 16:54:57 tarini +Added Atan2. +Added common utilities: Max, Min, Swap, Sort(a,b), Sort(a,b,c). +Changed Max values syntax. example: Value::Max + Revision 1.7 2004/03/08 19:38:29 tarini aggiunti Min e Max, si usano cosi: Min::Value (tarini) @@ -86,7 +91,7 @@ namespace math { /// syntax: Max::Value template class Value { - public: static const SCALAR Min; static const SCALAR Min; + public: static const SCALAR Min; static const SCALAR Max; }; const char Value::Min = -128; @@ -114,19 +119,19 @@ namespace math { const double Value::Min = -1.7E308; const double Value::Max = +1.7E308; - inline template Min(const T &a, const T &b){ + template inline Min(const T &a, const T &b){ if (a Max(const T &a, const T &b){ + template inline Max(const T &a, const T &b){ if (a Swap(T &a, T &b){ + template inline Swap(T &a, T &b){ T tmp=a; a=b; b=tmp; }; - inline template Sort(T &a, T &b){ + template inline Sort(T &a, T &b){ if (a>b) Swap(a,b); }; - inline template Sort(T &a, T &b, T &c){ + template inline Sort(T &a, T &b, T &c){ if (a>b) Swap(a,b); if (b>c) {Swap(b,c); if (a>b) Swap(a,b);} };