summaryrefslogtreecommitdiff
path: root/basegfx/source/polygon
diff options
context:
space:
mode:
authorIvo Hinkelmann <ihi@openoffice.org>2008-04-24 14:06:53 +0000
committerIvo Hinkelmann <ihi@openoffice.org>2008-04-24 14:06:53 +0000
commite5c86c047151e3115a7cba58c75b2361601d0ed1 (patch)
treed0d866a31614677e37ee72e19ccb974cfc70401d /basegfx/source/polygon
parent850cb10dc27e1c9b60393f207148df95395b9f2e (diff)
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
Diffstat (limited to 'basegfx/source/polygon')
-rw-r--r--basegfx/source/polygon/b2dpolypolygontools.cxx30
1 files changed, 29 insertions, 1 deletions
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