From a1a1131c16227327d17bcf5ad2a5209ddc0f01a1 Mon Sep 17 00:00:00 2001 From: Elton Chung Date: Sun, 4 Mar 2012 15:27:27 +0800 Subject: Remove unused code --- basegfx/source/polygon/b3dpolygonclipper.cxx | 172 --------------------------- 1 file changed, 172 deletions(-) (limited to 'basegfx/source') diff --git a/basegfx/source/polygon/b3dpolygonclipper.cxx b/basegfx/source/polygon/b3dpolygonclipper.cxx index 8130d00eced2..728fc46092cf 100644 --- a/basegfx/source/polygon/b3dpolygonclipper.cxx +++ b/basegfx/source/polygon/b3dpolygonclipper.cxx @@ -127,178 +127,6 @@ namespace basegfx ////////////////////////////////////////////////////////////////////////////// -namespace basegfx -{ - namespace tools - { - B3DPolyPolygon clipPolygonOnOrthogonalPlane(const B3DPolygon& rCandidate, B3DOrientation ePlaneOrthogonal, bool bClipPositive, double fPlaneOffset, bool bStroke) - { - B3DPolyPolygon aRetval; - - if(rCandidate.count()) - { - const B3DRange aCandidateRange(getRange(rCandidate)); - - if(B3DORIENTATION_X == ePlaneOrthogonal && fTools::moreOrEqual(aCandidateRange.getMinX(), fPlaneOffset)) - { - // completely above and on the clip plane. - if(bClipPositive) - { - // add completely - aRetval.append(rCandidate); - } - } - else if(B3DORIENTATION_X == ePlaneOrthogonal && fTools::lessOrEqual(aCandidateRange.getMaxX(), fPlaneOffset)) - { - // completely below and on the clip plane. - if(!bClipPositive) - { - // add completely - aRetval.append(rCandidate); - } - } - else if(B3DORIENTATION_Y == ePlaneOrthogonal && fTools::moreOrEqual(aCandidateRange.getMinY(), fPlaneOffset)) - { - // completely above and on the clip plane. - if(bClipPositive) - { - // add completely - aRetval.append(rCandidate); - } - } - else if(B3DORIENTATION_Y == ePlaneOrthogonal && fTools::lessOrEqual(aCandidateRange.getMaxY(), fPlaneOffset)) - { - // completely below and on the clip plane. - if(!bClipPositive) - { - // add completely - aRetval.append(rCandidate); - } - } - else if(B3DORIENTATION_Z == ePlaneOrthogonal && fTools::moreOrEqual(aCandidateRange.getMinZ(), fPlaneOffset)) - { - // completely above and on the clip plane. - if(bClipPositive) - { - // add completely - aRetval.append(rCandidate); - } - } - else if(B3DORIENTATION_Z == ePlaneOrthogonal && fTools::lessOrEqual(aCandidateRange.getMaxZ(), fPlaneOffset)) - { - // completely below and on the clip plane. - if(!bClipPositive) - { - // add completely - aRetval.append(rCandidate); - } - } - else - { - // prepare loop(s) - B3DPolygon aNewPolygon; - B3DPoint aCurrent(rCandidate.getB3DPoint(0L)); - const sal_uInt32 nPointCount(rCandidate.count()); - const sal_uInt32 nEdgeCount(rCandidate.isClosed() ? nPointCount : nPointCount - 1L); - bool bCurrentInside(impIsInside(aCurrent, fPlaneOffset, ePlaneOrthogonal) == bClipPositive); - - if(bCurrentInside) - { - impAppendCopy(aNewPolygon, rCandidate, 0L); - } - - if(bStroke) - { - // open polygon, create clipped line snippets. - for(sal_uInt32 a(0L); a < nEdgeCount; a++) - { - // get next point data - const sal_uInt32 nNextIndex((a + 1L == nPointCount) ? 0L : a + 1L); - const B3DPoint aNext(rCandidate.getB3DPoint(nNextIndex)); - const bool bNextInside(impIsInside(aNext, fPlaneOffset, ePlaneOrthogonal) == bClipPositive); - - if(bCurrentInside != bNextInside) - { - // change inside/outside - if(bNextInside) - { - // entering, finish existing and start new line polygon - if(aNewPolygon.count() > 1L) - { - aRetval.append(aNewPolygon); - } - - aNewPolygon.clear(); - } - - // calculate and add cut point - const double fCut(impGetCut(aCurrent, aNext, fPlaneOffset, ePlaneOrthogonal)); - impAppendInterpolate(aNewPolygon, rCandidate, a, nNextIndex, fCut); - - // pepare next step - bCurrentInside = bNextInside; - } - - if(bNextInside) - { - impAppendCopy(aNewPolygon, rCandidate, nNextIndex); - } - - // pepare next step - aCurrent = aNext; - } - - if(aNewPolygon.count() > 1L) - { - aRetval.append(aNewPolygon); - } - } - else - { - // closed polygon, create single clipped closed polygon - for(sal_uInt32 a(0L); a < nEdgeCount; a++) - { - // get next point data, use offset - const sal_uInt32 nNextIndex((a + 1L == nPointCount) ? 0L : a + 1L); - const B3DPoint aNext(rCandidate.getB3DPoint(nNextIndex)); - const bool bNextInside(impIsInside(aNext, fPlaneOffset, ePlaneOrthogonal) == bClipPositive); - - if(bCurrentInside != bNextInside) - { - // calculate and add cut point - const double fCut(impGetCut(aCurrent, aNext, fPlaneOffset, ePlaneOrthogonal)); - impAppendInterpolate(aNewPolygon, rCandidate, a, nNextIndex, fCut); - - // pepare next step - bCurrentInside = bNextInside; - } - - if(bNextInside && nNextIndex) - { - impAppendCopy(aNewPolygon, rCandidate, nNextIndex); - } - - // pepare next step - aCurrent = aNext; - } - - if(aNewPolygon.count() > 2L) - { - aNewPolygon.setClosed(true); - aRetval.append(aNewPolygon); - } - } - } - } - - return aRetval; - } - - } // end of namespace tools -} // end of namespace basegfx - -////////////////////////////////////////////////////////////////////////////// - // eof /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit