basegfx/inc/basegfx/polygon/b2dpolygonclipper.hxx | 7 - basegfx/inc/basegfx/polygon/b2dpolygoncutandtouch.hxx | 10 - basegfx/inc/basegfx/polygon/b3dpolygonclipper.hxx | 14 -- basegfx/source/polygon/b2dpolygonclipper.cxx | 66 ---------- basegfx/source/polygon/b2dpolygoncutandtouch.cxx | 112 ------------------ basegfx/source/polygon/b3dpolygonclipper.cxx | 102 ---------------- unusedcode.easy | 10 - 7 files changed, 321 deletions(-)
New commits: commit 92a87649a79de6013703d2344365ef86fc9788bd Author: Alexander Bergmann <myadd...@gmx.de> Date: Wed Jan 25 12:01:28 2012 +0530 Removing unused code (basegfx). diff --git a/basegfx/inc/basegfx/polygon/b2dpolygonclipper.hxx b/basegfx/inc/basegfx/polygon/b2dpolygonclipper.hxx index 172996a..2556b34 100644 --- a/basegfx/inc/basegfx/polygon/b2dpolygonclipper.hxx +++ b/basegfx/inc/basegfx/polygon/b2dpolygonclipper.hxx @@ -57,13 +57,6 @@ namespace basegfx BASEGFX_DLLPUBLIC B2DPolyPolygon clipPolyPolygonOnRange(const B2DPolyPolygon& rCandidate, const B2DRange& rRange, bool bInside, bool bStroke); BASEGFX_DLLPUBLIC B2DPolyPolygon clipPolygonOnRange(const B2DPolygon& rCandidate, const B2DRange& rRange, bool bInside, bool bStroke); - // Clip given PolyPolygon against the endless edge (ray) defined by the given two points. bAbove defines on which side - // of the edge the result will be together with the definition of the edge. If the edge is seen as a vector - // from A to B and bAbove is true, the result will contain the geometry left of the vector. - // The switch bStroke decides if the polygon is interpreted as area (false) or strokes (true). - BASEGFX_DLLPUBLIC B2DPolyPolygon clipPolyPolygonOnEdge(const B2DPolyPolygon& rCandidate, const B2DPoint& rPointA, const B2DPoint& rPointB, bool bAbove, bool bStroke); - BASEGFX_DLLPUBLIC B2DPolyPolygon clipPolygonOnEdge(const B2DPolygon& rCandidate, const B2DPoint& rPointA, const B2DPoint& rPointB, bool bAbove, bool bStroke); - // Clip given PolyPolygon against given clipping polygon. // The switch bStroke decides if the polygon is interpreted as area (false) or strokes (true). // With stroke polygons, You get all line snippets inside rCip. diff --git a/basegfx/inc/basegfx/polygon/b2dpolygoncutandtouch.hxx b/basegfx/inc/basegfx/polygon/b2dpolygoncutandtouch.hxx index 0c6296d..8997c54 100644 --- a/basegfx/inc/basegfx/polygon/b2dpolygoncutandtouch.hxx +++ b/basegfx/inc/basegfx/polygon/b2dpolygoncutandtouch.hxx @@ -53,28 +53,18 @@ namespace basegfx // not change or add points to rMask. BASEGFX_DLLPUBLIC B2DPolygon addPointsAtCutsAndTouches(const B2DPolyPolygon& rMask, const B2DPolygon& rCandidate); - // look for intersections of rCandidate with all polygons from rMask and add extra points there. Do - // not change or add points to rMask. - BASEGFX_DLLPUBLIC B2DPolyPolygon addPointsAtCutsAndTouches(const B2DPolyPolygon& rMask, const B2DPolyPolygon& rCandidate); - // look for intersections of rCandidate with the edge from rStart to rEnd and add extra points there. // Points are only added in the range of the edge, not on the endless vector. BASEGFX_DLLPUBLIC B2DPolygon addPointsAtCuts(const B2DPolygon& rCandidate, const B2DPoint& rStart, const B2DPoint& rEnd); - BASEGFX_DLLPUBLIC B2DPolyPolygon addPointsAtCuts(const B2DPolyPolygon& rCandidate, const B2DPoint& rStart, const B2DPoint& rEnd); // look for intersections of rCandidate with the mask Polygon and add extra points there. // The mask polygon is assumed to be closed, even when it's not explicitly. BASEGFX_DLLPUBLIC B2DPolygon addPointsAtCuts(const B2DPolygon& rCandidate, const B2DPolyPolygon& rMask); - BASEGFX_DLLPUBLIC B2DPolyPolygon addPointsAtCuts(const B2DPolyPolygon& rCandidate, const B2DPolyPolygon& rMask); // look for self-intersections in given polygon and add extra points there. Result will have no // intersections on an edge BASEGFX_DLLPUBLIC B2DPolygon addPointsAtCuts(const B2DPolygon& rCandidate); - // add points at all self-intersections of single polygons (depends on bSelfIntersections) - // and at polygon-polygon intersections - BASEGFX_DLLPUBLIC B2DPolyPolygon addPointsAtCuts(const B2DPolyPolygon& rCandidate, bool bSelfIntersections = true); - } // end of namespace tools } // end of namespace basegfx diff --git a/basegfx/inc/basegfx/polygon/b3dpolygonclipper.hxx b/basegfx/inc/basegfx/polygon/b3dpolygonclipper.hxx index 0c66967..f34effe 100644 --- a/basegfx/inc/basegfx/polygon/b3dpolygonclipper.hxx +++ b/basegfx/inc/basegfx/polygon/b3dpolygonclipper.hxx @@ -62,26 +62,12 @@ namespace basegfx // version for Polygons BASEGFX_DLLPUBLIC B3DPolyPolygon clipPolygonOnOrthogonalPlane(const B3DPolygon& rCandidate, B3DOrientation ePlaneOrthogonal, bool bClipPositive, double fPlaneOffset, bool bStroke); - // Clip the given PolyPolygon against the given range. bInside defines if the result will contain the - // parts which are contained in the range or vice versa. - // The switch bStroke decides if the polygon is interpreted as area (false) or strokes (true). - BASEGFX_DLLPUBLIC B3DPolyPolygon clipPolyPolygonOnRange(const B3DPolyPolygon& rCandidate, const B3DRange& rRange, bool bInside, bool bStroke); - // version for Polygons BASEGFX_DLLPUBLIC B3DPolyPolygon clipPolygonOnRange(const B3DPolygon& rCandidate, const B3DRange& rRange, bool bInside, bool bStroke); // versions for B2DRange, clips only against X,Y - BASEGFX_DLLPUBLIC B3DPolyPolygon clipPolyPolygonOnRange(const B3DPolyPolygon& rCandidate, const B2DRange& rRange, bool bInside, bool bStroke); BASEGFX_DLLPUBLIC B3DPolyPolygon clipPolygonOnRange(const B3DPolygon& rCandidate, const B2DRange& rRange, bool bInside, bool bStroke); - // Clip the given PolyPolygon against given plane in 3D. The plane is defined by a plane normal and a point on the plane. - // The value bClipPositive defines on which side the return value will be (true -> on positive side of plane). - // The switch bStroke decides if the polygon is interpreted as area (false) or strokes (true). - BASEGFX_DLLPUBLIC B3DPolyPolygon clipPolyPolygonOnPlane(const B3DPolyPolygon& rCandidate, const B3DPoint& rPointOnPlane, const B3DVector& rPlaneNormal, bool bClipPositive, bool bStroke); - - // version for Polygons - BASEGFX_DLLPUBLIC B3DPolyPolygon clipPolygonOnPlane(const B3DPolygon& rCandidate, const B3DPoint& rPointOnPlane, const B3DVector& rPlaneNormal, bool bClipPositive, bool bStroke); - } // end of namespace tools } // end of namespace basegfx diff --git a/basegfx/source/polygon/b2dpolygonclipper.cxx b/basegfx/source/polygon/b2dpolygonclipper.cxx index 8514fd0..9343c2e 100644 --- a/basegfx/source/polygon/b2dpolygonclipper.cxx +++ b/basegfx/source/polygon/b2dpolygonclipper.cxx @@ -346,72 +346,6 @@ namespace basegfx return aRetval; } - B2DPolyPolygon clipPolygonOnEdge(const B2DPolygon& rCandidate, const B2DPoint& rPointA, const B2DPoint& rPointB, bool bAbove, bool bStroke) - { - B2DPolyPolygon aRetval; - - if(rPointA.equal(rPointB)) - { - // edge has no length, return polygon - aRetval.append(rCandidate); - } - else if(rCandidate.count()) - { - const B2DVector aEdge(rPointB - rPointA); - B2DPolygon aCandidate(rCandidate); - - // translate and rotate polygon so that given edge is on x axis - B2DHomMatrix aMatrixTransform(basegfx::tools::createTranslateB2DHomMatrix(-rPointA.getX(), -rPointA.getY())); - aMatrixTransform.rotate(-atan2(aEdge.getY(), aEdge.getX())); - aCandidate.transform(aMatrixTransform); - - // call clip method on X-Axis - aRetval = clipPolygonOnParallelAxis(aCandidate, true, bAbove, 0.0, bStroke); - - if(aRetval.count()) - { - // if there is a result, it needs to be transformed back - aMatrixTransform.invert(); - aRetval.transform(aMatrixTransform); - } - } - - return aRetval; - } - - B2DPolyPolygon clipPolyPolygonOnEdge(const B2DPolyPolygon& rCandidate, const B2DPoint& rPointA, const B2DPoint& rPointB, bool bAbove, bool bStroke) - { - B2DPolyPolygon aRetval; - - if(rPointA.equal(rPointB)) - { - // edge has no length, return polygon - aRetval = rCandidate; - } - else if(rCandidate.count()) - { - const B2DVector aEdge(rPointB - rPointA); - B2DPolyPolygon aCandidate(rCandidate); - - // translate and rotate polygon so that given edge is on x axis - B2DHomMatrix aMatrixTransform(basegfx::tools::createTranslateB2DHomMatrix(-rPointA.getX(), -rPointA.getY())); - aMatrixTransform.rotate(-atan2(aEdge.getY(), aEdge.getX())); - aCandidate.transform(aMatrixTransform); - - // call clip method on X-Axis - aRetval = clipPolyPolygonOnParallelAxis(aCandidate, true, bAbove, 0.0, bStroke); - - if(aRetval.count()) - { - // if there is a result, it needs to be transformed back - aMatrixTransform.invert(); - aRetval.transform(aMatrixTransform); - } - } - - return aRetval; - } - ////////////////////////////////////////////////////////////////////////////// B2DPolyPolygon clipPolyPolygonOnPolyPolygon(const B2DPolyPolygon& rCandidate, const B2DPolyPolygon& rClip, bool bInside, bool bStroke) diff --git a/basegfx/source/polygon/b2dpolygoncutandtouch.cxx b/basegfx/source/polygon/b2dpolygoncutandtouch.cxx index d4d075b..385a5ac 100644 --- a/basegfx/source/polygon/b2dpolygoncutandtouch.cxx +++ b/basegfx/source/polygon/b2dpolygoncutandtouch.cxx @@ -1033,20 +1033,6 @@ namespace basegfx //////////////////////////////////////////////////////////////////////////////// - B2DPolyPolygon addPointsAtCutsAndTouches(const B2DPolyPolygon& rMask, const B2DPolyPolygon& rCandidate) - { - B2DPolyPolygon aRetval; - - for(sal_uInt32 a(0L); a < rCandidate.count(); a++) - { - aRetval.append(addPointsAtCutsAndTouches(rMask, rCandidate.getB2DPolygon(a))); - } - - return aRetval; - } - - //////////////////////////////////////////////////////////////////////////////// - B2DPolygon addPointsAtCuts(const B2DPolygon& rCandidate, const B2DPoint& rStart, const B2DPoint& rEnd) { const sal_uInt32 nCount(rCandidate.count()); @@ -1094,18 +1080,6 @@ namespace basegfx return rCandidate; } - B2DPolyPolygon addPointsAtCuts(const B2DPolyPolygon& rCandidate, const B2DPoint& rStart, const B2DPoint& rEnd) - { - B2DPolyPolygon aRetval; - - for(sal_uInt32 a(0); a < rCandidate.count(); a++) - { - aRetval.append(addPointsAtCuts(rCandidate.getB2DPolygon(a), rStart, rEnd)); - } - - return aRetval; - } - //////////////////////////////////////////////////////////////////////////////// B2DPolygon addPointsAtCuts(const B2DPolygon& rCandidate, const B2DPolyPolygon& rPolyMask) @@ -1189,18 +1163,6 @@ namespace basegfx return rCandidate; } - B2DPolyPolygon addPointsAtCuts(const B2DPolyPolygon& rCandidate, const B2DPolyPolygon& rMask) - { - B2DPolyPolygon aRetval; - - for(sal_uInt32 a(0); a < rCandidate.count(); a++) - { - aRetval.append(addPointsAtCuts(rCandidate.getB2DPolygon(a), rMask)); - } - - return aRetval; - } - B2DPolygon addPointsAtCuts(const B2DPolygon& rCandidate) { if(rCandidate.count()) @@ -1217,80 +1179,6 @@ namespace basegfx } } - B2DPolyPolygon addPointsAtCuts(const B2DPolyPolygon& rCandidate, bool bSelfIntersections) - { - const sal_uInt32 nCount(rCandidate.count()); - - if(nCount) - { - B2DPolyPolygon aRetval; - - if(1 == nCount) - { - if(bSelfIntersections) - { - // remove self intersections - aRetval.append(addPointsAtCuts(rCandidate.getB2DPolygon(0))); - } - else - { - // copy source - aRetval = rCandidate; - } - } - else - { - // first solve self cuts for all contained single polygons - temporaryPolygonData *pTempData = new temporaryPolygonData[nCount]; - sal_uInt32 a, b; - - for(a = 0; a < nCount; a++) - { - if(bSelfIntersections) - { - // use polygons with solved self intersections - pTempData[a].setPolygon(addPointsAtCuts(rCandidate.getB2DPolygon(a))); - } - else - { - // copy given polygons - pTempData[a].setPolygon(rCandidate.getB2DPolygon(a)); - } - } - - // now cuts and touches between the polygons - for(a = 0; a < nCount; a++) - { - for(b = 0; b < nCount; b++) - { - if(a < b) - { - // look for cuts, compare each edge polygon to following ones - if(pTempData[a].getRange().overlaps(pTempData[b].getRange())) - { - findCuts(pTempData[a].getPolygon(), pTempData[b].getPolygon(), pTempData[a].getTemporaryPointVector(), pTempData[b].getTemporaryPointVector()); - } - } - } - } - - // consolidate the result - for(a = 0L; a < nCount; a++) - { - aRetval.append(mergeTemporaryPointsAndPolygon(pTempData[a].getPolygon(), pTempData[a].getTemporaryPointVector())); - } - - delete[] pTempData; - } - - return aRetval; - } - else - { - return rCandidate; - } - } - //////////////////////////////////////////////////////////////////////////////// } // end of namespace tools diff --git a/basegfx/source/polygon/b3dpolygonclipper.cxx b/basegfx/source/polygon/b3dpolygonclipper.cxx index 70e4e17..d1c9043 100644 --- a/basegfx/source/polygon/b3dpolygonclipper.cxx +++ b/basegfx/source/polygon/b3dpolygonclipper.cxx @@ -306,18 +306,6 @@ namespace basegfx return aRetval; } - B3DPolyPolygon clipPolyPolygonOnRange(const B3DPolyPolygon& rCandidate, const B2DRange& rRange, bool bInside, bool bStroke) - { - B3DPolyPolygon aRetval; - - for(sal_uInt32 a(0L); a < rCandidate.count(); a++) - { - aRetval.append(clipPolygonOnRange(rCandidate.getB3DPolygon(a), rRange, bInside, bStroke)); - } - - return aRetval; - } - B3DPolyPolygon clipPolygonOnRange(const B3DPolygon& rCandidate, const B2DRange& rRange, bool bInside, bool bStroke) { B3DPolyPolygon aRetval; @@ -404,18 +392,6 @@ namespace basegfx return aRetval; } - B3DPolyPolygon clipPolyPolygonOnRange(const B3DPolyPolygon& rCandidate, const B3DRange& rRange, bool bInside, bool bStroke) - { - B3DPolyPolygon aRetval; - - for(sal_uInt32 a(0L); a < rCandidate.count(); a++) - { - aRetval.append(clipPolygonOnRange(rCandidate.getB3DPolygon(a), rRange, bInside, bStroke)); - } - - return aRetval; - } - B3DPolyPolygon clipPolygonOnRange(const B3DPolygon& rCandidate, const B3DRange& rRange, bool bInside, bool bStroke) { B3DPolyPolygon aRetval; @@ -486,84 +462,6 @@ namespace basegfx return aRetval; } - B3DPolyPolygon clipPolygonOnPlane(const B3DPolygon& rCandidate, const B3DPoint& rPointOnPlane, const B3DVector& rPlaneNormal, bool bClipPositive, bool bStroke) - { - B3DPolyPolygon aRetval; - - if(rPlaneNormal.equalZero()) - { - // not really a plane definition, return polygon - aRetval.append(rCandidate); - } - else if(rCandidate.count()) - { - // build transform to project planeNormal on X-Axis and pointOnPlane to null point - B3DHomMatrix aMatrixTransform; - aMatrixTransform.translate(-rPointOnPlane.getX(), -rPointOnPlane.getY(), -rPointOnPlane.getZ()); - const double fRotInXY(atan2(rPlaneNormal.getY(), rPlaneNormal.getX())); - const double fRotInXZ(atan2(-rPlaneNormal.getZ(), rPlaneNormal.getXYLength())); - if(!fTools::equalZero(fRotInXY) || !fTools::equalZero(fRotInXZ)) - { - aMatrixTransform.rotate(0.0, fRotInXZ, fRotInXY); - } - - // transform polygon to clip scenario - B3DPolygon aCandidate(rCandidate); - aCandidate.transform(aMatrixTransform); - - // clip on YZ plane - aRetval = clipPolygonOnOrthogonalPlane(aCandidate, tools::B3DORIENTATION_X, bClipPositive, 0.0, bStroke); - - if(aRetval.count()) - { - // if there is a result, it needs to be transformed back - aMatrixTransform.invert(); - aRetval.transform(aMatrixTransform); - } - } - - return aRetval; - } - - B3DPolyPolygon clipPolyPolygonOnPlane(const B3DPolyPolygon& rCandidate, const B3DPoint& rPointOnPlane, const B3DVector& rPlaneNormal, bool bClipPositive, bool bStroke) - { - B3DPolyPolygon aRetval; - - if(rPlaneNormal.equalZero()) - { - // not really a plane definition, return polygon - aRetval = rCandidate; - } - else if(rCandidate.count()) - { - // build transform to project planeNormal on X-Axis and pointOnPlane to null point - B3DHomMatrix aMatrixTransform; - aMatrixTransform.translate(-rPointOnPlane.getX(), -rPointOnPlane.getY(), -rPointOnPlane.getZ()); - const double fRotInXY(atan2(rPlaneNormal.getY(), rPlaneNormal.getX())); - const double fRotInXZ(atan2(-rPlaneNormal.getZ(), rPlaneNormal.getXYLength())); - if(!fTools::equalZero(fRotInXY) || !fTools::equalZero(fRotInXZ)) - { - aMatrixTransform.rotate(0.0, fRotInXZ, fRotInXY); - } - - // transform polygon to clip scenario - aRetval = rCandidate; - aRetval.transform(aMatrixTransform); - - // clip on YZ plane - aRetval = clipPolyPolygonOnOrthogonalPlane(aRetval, tools::B3DORIENTATION_X, bClipPositive, 0.0, bStroke); - - if(aRetval.count()) - { - // if there is a result, it needs to be transformed back - aMatrixTransform.invert(); - aRetval.transform(aMatrixTransform); - } - } - - return aRetval; - } - } // end of namespace tools } // end of namespace basegfx diff --git a/unusedcode.easy b/unusedcode.easy index 65c14b6..a9e5a1a 100644 --- a/unusedcode.easy +++ b/unusedcode.easy @@ -898,18 +898,8 @@ basegfx::maximum(basegfx::B2DHomPoint const&, basegfx::B2DHomPoint const&) basegfx::maximum(basegfx::B2ITuple const&, basegfx::B2ITuple const&) basegfx::minimum(basegfx::B2DHomPoint const&, basegfx::B2DHomPoint const&) basegfx::minimum(basegfx::B2ITuple const&, basegfx::B2ITuple const&) -basegfx::tools::addPointsAtCuts(basegfx::B2DPolyPolygon const&, basegfx::B2DPoint const&, basegfx::B2DPoint const&) -basegfx::tools::addPointsAtCuts(basegfx::B2DPolyPolygon const&, basegfx::B2DPolyPolygon const&) -basegfx::tools::addPointsAtCuts(basegfx::B2DPolyPolygon const&, bool) -basegfx::tools::addPointsAtCutsAndTouches(basegfx::B2DPolyPolygon const&, basegfx::B2DPolyPolygon const&) basegfx::tools::applyLineDashing(basegfx::B3DPolyPolygon const&, std::__debug::vector<double, std::allocator<double> > const&, basegfx::B3DPolyPolygon*, basegfx::B3DPolyPolygon*, double) basegfx::tools::ciexyz2rgb(basegfx::BColor const&) -basegfx::tools::clipPolyPolygonOnEdge(basegfx::B2DPolyPolygon const&, basegfx::B2DPoint const&, basegfx::B2DPoint const&, bool, bool) -basegfx::tools::clipPolyPolygonOnPlane(basegfx::B3DPolyPolygon const&, basegfx::B3DPoint const&, basegfx::B3DVector const&, bool, bool) -basegfx::tools::clipPolyPolygonOnRange(basegfx::B3DPolyPolygon const&, basegfx::B2DRange const&, bool, bool) -basegfx::tools::clipPolyPolygonOnRange(basegfx::B3DPolyPolygon const&, basegfx::B3DRange const&, bool, bool) -basegfx::tools::clipPolygonOnEdge(basegfx::B2DPolygon const&, basegfx::B2DPoint const&, basegfx::B2DPoint const&, bool, bool) -basegfx::tools::clipPolygonOnPlane(basegfx::B3DPolygon const&, basegfx::B3DPoint const&, basegfx::B3DVector const&, bool, bool) basegfx::tools::createPolygonFromRect(basegfx::B2DRange const&, double) basegfx::tools::createShearXB2DHomMatrix(double) basegfx::tools::createShearYB2DHomMatrix(double) _______________________________________________ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits