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
This commit is contained in:
parent
b5fcb4bc9e
commit
81f6a5d151
1 changed files with 35 additions and 1 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue