From e5c86c047151e3115a7cba58c75b2361601d0ed1 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Thu, 24 Apr 2008 14:06:53 +0000 Subject: INTEGRATION: CWS aw055 (1.16.28); FILE MERGED 2008/02/29 04:32:01 aw 1.16.28.1: removed op equal at polygons, added to tooling. Done for 2D and 3D --- basegfx/source/polygon/b2dpolypolygontools.cxx | 30 +++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'basegfx/source/polygon') diff --git a/basegfx/source/polygon/b2dpolypolygontools.cxx b/basegfx/source/polygon/b2dpolypolygontools.cxx index 77b10100ab57..df37532ec66c 100644 --- a/basegfx/source/polygon/b2dpolypolygontools.cxx +++ b/basegfx/source/polygon/b2dpolypolygontools.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: b2dpolypolygontools.cxx,v $ - * $Revision: 1.17 $ + * $Revision: 1.18 $ * * This file is part of OpenOffice.org. * @@ -513,6 +513,34 @@ namespace basegfx } } + ////////////////////////////////////////////////////////////////////// + // comparators with tolerance for 2D PolyPolygons + + bool equal(const B2DPolyPolygon& rCandidateA, const B2DPolyPolygon& rCandidateB, const double& rfSmallValue) + { + const sal_uInt32 nPolygonCount(rCandidateA.count()); + + if(nPolygonCount != rCandidateB.count()) + return false; + + for(sal_uInt32 a(0); a < nPolygonCount; a++) + { + const B2DPolygon aCandidate(rCandidateA.getB2DPolygon(a)); + + if(!equal(aCandidate, rCandidateB.getB2DPolygon(a), rfSmallValue)) + return false; + } + + return true; + } + + bool equal(const B2DPolyPolygon& rCandidateA, const B2DPolyPolygon& rCandidateB) + { + const double fSmallValue(fTools::getSmallValue()); + + return equal(rCandidateA, rCandidateB, fSmallValue); + } + } // end of namespace tools } // end of namespace basegfx -- cgit v1.2.3