diff options
author | Gábor Stefanik <netrolller.3d@gmail.com> | 2012-04-14 01:10:24 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2012-04-14 12:18:48 +0200 |
commit | 7a9738f407c916d56090e9805632a5b29f96df18 (patch) | |
tree | cb8d6a06d36123b5ee62ec8a6666e96f5cfde58a /basegfx/source | |
parent | d8ff1a579ff5ac9250aa052ef1a17fce51959cb0 (diff) |
Clean up basegfx's polygon tools code
Diffstat (limited to 'basegfx/source')
-rw-r--r-- | basegfx/source/polygon/b2dpolypolygontools.cxx | 21 | ||||
-rw-r--r-- | basegfx/source/polygon/b3dpolygontools.cxx | 65 | ||||
-rw-r--r-- | basegfx/source/polygon/b3dpolypolygontools.cxx | 21 |
3 files changed, 0 insertions, 107 deletions
diff --git a/basegfx/source/polygon/b2dpolypolygontools.cxx b/basegfx/source/polygon/b2dpolypolygontools.cxx index 6434dc050075..e071b18b40c3 100644 --- a/basegfx/source/polygon/b2dpolypolygontools.cxx +++ b/basegfx/source/polygon/b2dpolypolygontools.cxx @@ -475,27 +475,6 @@ 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; - } - B2DPolyPolygon snapPointsOfHorizontalOrVerticalEdges(const B2DPolyPolygon& rCandidate) { B2DPolyPolygon aRetval; diff --git a/basegfx/source/polygon/b3dpolygontools.cxx b/basegfx/source/polygon/b3dpolygontools.cxx index 8bdfd132faa3..bcec7203e22a 100644 --- a/basegfx/source/polygon/b3dpolygontools.cxx +++ b/basegfx/source/polygon/b3dpolygontools.cxx @@ -88,71 +88,6 @@ namespace basegfx return rCandidate.getNormal(); } - double getSignedArea(const B3DPolygon& rCandidate) - { - double fRetval(0.0); - const sal_uInt32 nPointCount(rCandidate.count()); - - if(nPointCount > 2) - { - const B3DVector aAbsNormal(absolute(getNormal(rCandidate))); - sal_uInt16 nCase(3); // default: ignore z - - if(aAbsNormal.getX() > aAbsNormal.getY()) - { - if(aAbsNormal.getX() > aAbsNormal.getZ()) - { - nCase = 1; // ignore x - } - } - else if(aAbsNormal.getY() > aAbsNormal.getZ()) - { - nCase = 2; // ignore y - } - - B3DPoint aPreviousPoint(rCandidate.getB3DPoint(nPointCount - 1L)); - - for(sal_uInt32 a(0L); a < nPointCount; a++) - { - const B3DPoint aCurrentPoint(rCandidate.getB3DPoint(a)); - - switch(nCase) - { - case 1: // ignore x - fRetval += aPreviousPoint.getZ() * aCurrentPoint.getY(); - fRetval -= aPreviousPoint.getY() * aCurrentPoint.getZ(); - break; - case 2: // ignore y - fRetval += aPreviousPoint.getX() * aCurrentPoint.getZ(); - fRetval -= aPreviousPoint.getZ() * aCurrentPoint.getX(); - break; - case 3: // ignore z - fRetval += aPreviousPoint.getX() * aCurrentPoint.getY(); - fRetval -= aPreviousPoint.getY() * aCurrentPoint.getX(); - break; - } - - // prepare next step - aPreviousPoint = aCurrentPoint; - } - - switch(nCase) - { - case 1: // ignore x - fRetval /= 2.0 * aAbsNormal.getX(); - break; - case 2: // ignore y - fRetval /= 2.0 * aAbsNormal.getY(); - break; - case 3: // ignore z - fRetval /= 2.0 * aAbsNormal.getZ(); - break; - } - } - - return fRetval; - } - double getLength(const B3DPolygon& rCandidate) { double fRetval(0.0); diff --git a/basegfx/source/polygon/b3dpolypolygontools.cxx b/basegfx/source/polygon/b3dpolypolygontools.cxx index b229eaeecc45..6f24a815d880 100644 --- a/basegfx/source/polygon/b3dpolypolygontools.cxx +++ b/basegfx/source/polygon/b3dpolypolygontools.cxx @@ -483,27 +483,6 @@ namespace basegfx } } - ////////////////////////////////////////////////////////////////////// - // comparators with tolerance for 3D PolyPolygons - - bool equal(const B3DPolyPolygon& rCandidateA, const B3DPolyPolygon& 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 B3DPolygon aCandidate(rCandidateA.getB3DPolygon(a)); - - if(!equal(aCandidate, rCandidateB.getB3DPolygon(a), rfSmallValue)) - return false; - } - - return true; - } - } // end of namespace tools } // end of namespace basegfx |