From a8227df267f16be209363842dabca73193e06e49 Mon Sep 17 00:00:00 2001 From: Luigi Malomo Date: Tue, 9 Jan 2018 20:12:50 +0100 Subject: [PATCH] MaxDim and MinDim added to box2 --- vcg/space/box2.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/vcg/space/box2.h b/vcg/space/box2.h index 5096386b..651c903c 100644 --- a/vcg/space/box2.h +++ b/vcg/space/box2.h @@ -272,6 +272,22 @@ public: max = c + PointType(radius, radius); min = c - PointType(radius, radius); } + + inline unsigned char MaxDim() const { + int i=1; + PointType diag = max-min; + if (diag[0] > diag[1]) + i=0; + return i; + } + + inline unsigned char MinDim() const { + int i=1; + PointType diag = max-min; + if (diag[0] < diag[1]) + i=0; + return i; + } }; // end class definition