From 47138fce2f5926124325138aed9d9a0ee9717664 Mon Sep 17 00:00:00 2001 From: cignoni Date: Tue, 21 Sep 2010 22:00:39 +0000 Subject: [PATCH] WARNING: important change. Removed the useless vcg::math::Max(a,b) that mimicked the std::max, and changed into a three argument Max(a,b,c) (quite useful in a lot of context and missing in std::. --- vcg/math/base.h | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/vcg/math/base.h b/vcg/math/base.h index 96329195..9c003fc1 100644 --- a/vcg/math/base.h +++ b/vcg/math/base.h @@ -138,12 +138,24 @@ namespace math { template inline static T Sqr(T a) { return a*a; } - template inline const T & Min(const T &a, const T &b){ - if (a inline const T & Max(const T &a, const T &b){ - if (a inline const T & Min(const T &a, const T &b,const T &c){ + if (a inline const T & Max(const T &a, const T &b, const T &c){ + if (a>b) { + if(a>c) return a; + else return c; // if cc) return b; + else return c; + } + } template inline void Swap(T &a, T &b){ T tmp=a; a=b; b=tmp;