summaryrefslogtreecommitdiff
path: root/basegfx/source
diff options
context:
space:
mode:
authorIvo Hinkelmann <ihi@openoffice.org>2008-04-24 14:07:42 +0000
committerIvo Hinkelmann <ihi@openoffice.org>2008-04-24 14:07:42 +0000
commit81f6a5d151e9d1677f5e78f8abb9421491a5603b (patch)
tree8fdb901ee5effbe8d0cd76e3946e7f13a7452add /basegfx/source
parentb5fcb4bc9e1e4b23e9c34598c19dc7cba75e03e4 (diff)
INTEGRATION: CWS aw055 (1.8.54); FILE MERGED
2008/02/29 04:32:01 aw 1.8.54.1: removed op equal at polygons, added to tooling. Done for 2D and 3D
Diffstat (limited to 'basegfx/source')
-rw-r--r--basegfx/source/polygon/b3dpolygontools.cxx36
1 files changed, 35 insertions, 1 deletions
diff --git a/basegfx/source/polygon/b3dpolygontools.cxx b/basegfx/source/polygon/b3dpolygontools.cxx
index 1433b9fdaa0d..6c925579477f 100644
--- a/basegfx/source/polygon/b3dpolygontools.cxx
+++ b/basegfx/source/polygon/b3dpolygontools.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: b3dpolygontools.cxx,v $
- * $Revision: 1.9 $
+ * $Revision: 1.10 $
*
* This file is part of OpenOffice.org.
*
@@ -449,6 +449,40 @@ namespace basegfx
return aRetval;
}
+
+ //////////////////////////////////////////////////////////////////////
+ // comparators with tolerance for 3D Polygons
+
+ bool equal(const B3DPolygon& rCandidateA, const B3DPolygon& rCandidateB, const double& rfSmallValue)
+ {
+ const sal_uInt32 nPointCount(rCandidateA.count());
+
+ if(nPointCount != rCandidateB.count())
+ return false;
+
+ const bool bClosed(rCandidateA.isClosed());
+
+ if(bClosed != rCandidateB.isClosed())
+ return false;
+
+ for(sal_uInt32 a(0); a < nPointCount; a++)
+ {
+ const B3DPoint aPoint(rCandidateA.getB3DPoint(a));
+
+ if(!aPoint.equal(rCandidateB.getB3DPoint(a), rfSmallValue))
+ return false;
+ }
+
+ return true;
+ }
+
+ bool equal(const B3DPolygon& rCandidateA, const B3DPolygon& rCandidateB)
+ {
+ const double fSmallValue(fTools::getSmallValue());
+
+ return equal(rCandidateA, rCandidateB, fSmallValue);
+ }
+
} // end of namespace tools
} // end of namespace basegfx