diff options
author | Tor Lillqvist <tml@collabora.com> | 2017-09-22 14:12:07 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2017-09-26 14:18:41 +0200 |
commit | 8e7897588d7185ef1964e8120669c1de3d1ce734 (patch) | |
tree | 8f48598670a5dc22703371943c05789d60b9a07d /basegfx | |
parent | 0b4135ec9945ea627318ecf5fccc4b7d0940ff0d (diff) |
Rename the basegfx::tools namespace to basegfx::utils
Reduce potential confusion with the global tools namespace. Will
hopefully make it possible to remove the annoying initial :: when
referring to the global tools namespace. Unless we have even more
tools subnamespaces somewhere.
Thorsten said it was OK.
Change-Id: Id088dfe8f4244cb79df9aa988995b31a1758c996
Reviewed-on: https://gerrit.libreoffice.org/42644
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Diffstat (limited to 'basegfx')
31 files changed, 275 insertions, 275 deletions
diff --git a/basegfx/source/color/bcolortools.cxx b/basegfx/source/color/bcolortools.cxx index b28607bf298d..7b5bf9cae140 100644 --- a/basegfx/source/color/bcolortools.cxx +++ b/basegfx/source/color/bcolortools.cxx @@ -21,7 +21,7 @@ #include <basegfx/color/bcolor.hxx> #include <basegfx/color/bcolortools.hxx> -namespace basegfx { namespace tools +namespace basegfx { namespace utils { BColor rgb2hsl(const BColor& rRGBColor) { diff --git a/basegfx/source/matrix/b2dhommatrix.cxx b/basegfx/source/matrix/b2dhommatrix.cxx index f9bc24e81ea4..9f7d5bff0156 100644 --- a/basegfx/source/matrix/b2dhommatrix.cxx +++ b/basegfx/source/matrix/b2dhommatrix.cxx @@ -188,7 +188,7 @@ namespace basegfx double fSin(0.0); double fCos(1.0); - tools::createSinCosOrthogonal(fSin, fCos, fRadiant); + utils::createSinCosOrthogonal(fSin, fCos, fRadiant); Impl2DHomMatrix aRotMat; aRotMat.set(0, 0, fCos); diff --git a/basegfx/source/matrix/b2dhommatrixtools.cxx b/basegfx/source/matrix/b2dhommatrixtools.cxx index 89ab91424706..a267b05b96d1 100644 --- a/basegfx/source/matrix/b2dhommatrixtools.cxx +++ b/basegfx/source/matrix/b2dhommatrixtools.cxx @@ -25,7 +25,7 @@ namespace basegfx { - namespace tools + namespace utils { void createSinCosOrthogonal(double& o_rSin, double& o_rCos, double fRadiant) { @@ -412,7 +412,7 @@ namespace basegfx { return B2DTuple(rMatrix.get(0, nCol), rMatrix.get(1, nCol)); } - } // end of namespace tools + } // end of namespace utils } // end of namespace basegfx /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/basegfx/source/polygon/b2dlinegeometry.cxx b/basegfx/source/polygon/b2dlinegeometry.cxx index 8ae52d508fd2..042cb480437b 100644 --- a/basegfx/source/polygon/b2dlinegeometry.cxx +++ b/basegfx/source/polygon/b2dlinegeometry.cxx @@ -33,7 +33,7 @@ namespace basegfx { - namespace tools + namespace utils { B2DPolyPolygon createAreaGeometryForLineStartEnd( const B2DPolygon& rCandidate, @@ -47,7 +47,7 @@ namespace basegfx { B2DPolyPolygon aRetval; OSL_ENSURE(rCandidate.count() > 1, "createAreaGeometryForLineStartEnd: Line polygon has too less points (!)"); - OSL_ENSURE(rArrow.count() > 0, "createAreaGeometryForLineStartEnd: Empty arrow tools::PolyPolygon (!)"); + OSL_ENSURE(rArrow.count() > 0, "createAreaGeometryForLineStartEnd: Empty arrow utils::PolyPolygon (!)"); OSL_ENSURE(fWidth > 0.0, "createAreaGeometryForLineStartEnd: Width too small (!)"); OSL_ENSURE(fDockingPosition >= 0.0 && fDockingPosition <= 1.0, "createAreaGeometryForLineStartEnd: fDockingPosition out of range [0.0 .. 1.0] (!)"); @@ -75,7 +75,7 @@ namespace basegfx const B2DRange aArrowSize(getRange(rArrow)); // build ArrowTransform; center in X, align with axis in Y - B2DHomMatrix aArrowTransform(basegfx::tools::createTranslateB2DHomMatrix( + B2DHomMatrix aArrowTransform(basegfx::utils::createTranslateB2DHomMatrix( -aArrowSize.getCenter().getX(), -aArrowSize.getMinimum().getY())); // scale to target size @@ -125,7 +125,7 @@ namespace basegfx return aRetval; } - } // end of namespace tools + } // end of namespace utils } // end of namespace basegfx namespace basegfx @@ -359,7 +359,7 @@ namespace basegfx const B2DVector aPerpendStartA(aNormalizedPerpendicularA * -fHalfLineWidth); const B2DVector aPerpendEndA(aNormalizedPerpendicularB * -fHalfLineWidth); double fCutA(0.0); - const CutFlagValue aCutA(tools::findCut( + const CutFlagValue aCutA(utils::findCut( rEdge.getStartPoint(), aPerpendStartA, rEdge.getEndPoint(), aPerpendEndA, CutFlagValue::ALL, &fCutA)); @@ -369,7 +369,7 @@ namespace basegfx const B2DVector aPerpendStartB(aNormalizedPerpendicularA * fHalfLineWidth); const B2DVector aPerpendEndB(aNormalizedPerpendicularB * fHalfLineWidth); double fCutB(0.0); - const CutFlagValue aCutB(tools::findCut( + const CutFlagValue aCutB(utils::findCut( rEdge.getEndPoint(), aPerpendEndB, rEdge.getStartPoint(), aPerpendStartB, CutFlagValue::ALL, &fCutB)); @@ -384,10 +384,10 @@ namespace basegfx { if(bStartRound) { - basegfx::B2DPolygon aStartPolygon(tools::createHalfUnitCircle()); + basegfx::B2DPolygon aStartPolygon(utils::createHalfUnitCircle()); aStartPolygon.transform( - tools::createScaleShearXRotateTranslateB2DHomMatrix( + utils::createScaleShearXRotateTranslateB2DHomMatrix( fHalfLineWidth, fHalfLineWidth, 0.0, atan2(aTangentA.getY(), aTangentA.getX()) + F_PI2, @@ -447,10 +447,10 @@ namespace basegfx { if(bEndRound) { - basegfx::B2DPolygon aEndPolygon(tools::createHalfUnitCircle()); + basegfx::B2DPolygon aEndPolygon(utils::createHalfUnitCircle()); aEndPolygon.transform( - tools::createScaleShearXRotateTranslateB2DHomMatrix( + utils::createScaleShearXRotateTranslateB2DHomMatrix( fHalfLineWidth, fHalfLineWidth, 0.0, atan2(aTangentB.getY(), aTangentB.getX()) - F_PI2, @@ -522,7 +522,7 @@ namespace basegfx // Remark: This nearly never happens due to curve preparations to extreme points // and maximum angle turning, but I constructed a test case and checked that it is // working properly. - const B2DPolyPolygon aTemp(tools::solveCrossovers(aBezierPolygon)); + const B2DPolyPolygon aTemp(utils::solveCrossovers(aBezierPolygon)); const sal_uInt32 nTempCount(aTemp.count()); if(nTempCount) @@ -589,11 +589,11 @@ namespace basegfx // create left vertical if(bStartRound) { - aEdgePolygon = tools::createHalfUnitCircle(); + aEdgePolygon = utils::createHalfUnitCircle(); fAngle = atan2(aTangent.getY(), aTangent.getX()); bAngle = true; aEdgePolygon.transform( - tools::createScaleShearXRotateTranslateB2DHomMatrix( + utils::createScaleShearXRotateTranslateB2DHomMatrix( fHalfLineWidth, fHalfLineWidth, 0.0, fAngle + F_PI2, @@ -623,7 +623,7 @@ namespace basegfx // create right vertical if(bEndRound) { - basegfx::B2DPolygon aEndPolygon(tools::createHalfUnitCircle()); + basegfx::B2DPolygon aEndPolygon(utils::createHalfUnitCircle()); if(!bAngle) { @@ -631,7 +631,7 @@ namespace basegfx } aEndPolygon.transform( - tools::createScaleShearXRotateTranslateB2DHomMatrix( + utils::createScaleShearXRotateTranslateB2DHomMatrix( fHalfLineWidth, fHalfLineWidth, 0.0, fAngle - F_PI2, @@ -713,7 +713,7 @@ namespace basegfx // is not needed since the same fCut will be found on the first edge. // If it exists, insert it to complete the mitered fill polygon. double fCutPos(0.0); - tools::findCut(aStartPoint, rTangentPrev, aEndPoint, rTangentEdge, CutFlagValue::ALL, &fCutPos); + utils::findCut(aStartPoint, rTangentPrev, aEndPoint, rTangentEdge, CutFlagValue::ALL, &fCutPos); if(fCutPos != 0.0) { @@ -740,7 +740,7 @@ namespace basegfx fAngleEnd += F_2PI; } - const B2DPolygon aBow(tools::createPolygonFromEllipseSegment(rPoint, fHalfLineWidth, fHalfLineWidth, fAngleStart, fAngleEnd)); + const B2DPolygon aBow(utils::createPolygonFromEllipseSegment(rPoint, fHalfLineWidth, fHalfLineWidth, fAngleStart, fAngleEnd)); if(aBow.count() > 1) { @@ -777,7 +777,7 @@ namespace basegfx } } // end of anonymus namespace - namespace tools + namespace utils { B2DPolyPolygon createAreaGeometry( const B2DPolygon& rCandidate, @@ -971,7 +971,7 @@ namespace basegfx return B2DPolyPolygon(rCandidate); } } - } // end of namespace tools + } // end of namespace utils } // end of namespace basegfx /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/basegfx/source/polygon/b2dpolygon.cxx b/basegfx/source/polygon/b2dpolygon.cxx index aa528ad861ac..17df4c4b3738 100644 --- a/basegfx/source/polygon/b2dpolygon.cxx +++ b/basegfx/source/polygon/b2dpolygon.cxx @@ -477,7 +477,7 @@ public: { if(!mpDefaultSubdivision) { - const_cast< ImplBufferedData* >(this)->mpDefaultSubdivision.reset(new basegfx::B2DPolygon(basegfx::tools::adaptiveSubdivideByAngle(rSource))); + const_cast< ImplBufferedData* >(this)->mpDefaultSubdivision.reset(new basegfx::B2DPolygon(basegfx::utils::adaptiveSubdivideByAngle(rSource))); } return *mpDefaultSubdivision; diff --git a/basegfx/source/polygon/b2dpolygonclipper.cxx b/basegfx/source/polygon/b2dpolygonclipper.cxx index 63d3ac8c2210..5057fc52d977 100644 --- a/basegfx/source/polygon/b2dpolygonclipper.cxx +++ b/basegfx/source/polygon/b2dpolygonclipper.cxx @@ -25,12 +25,12 @@ #include <basegfx/polygon/b2dpolygoncutandtouch.hxx> #include <basegfx/polygon/b2dpolypolygontools.hxx> #include <basegfx/curve/b2dcubicbezier.hxx> -#include <basegfx/tools/rectcliptools.hxx> +#include <basegfx/utils/rectcliptools.hxx> #include <basegfx/matrix/b2dhommatrixtools.hxx> namespace basegfx { - namespace tools + namespace utils { B2DPolyPolygon clipPolygonOnParallelAxis(const B2DPolygon& rCandidate, bool bParallelToXAxis, bool bAboveAxis, double fValueOnOtherAxis, bool bStroke) { @@ -360,7 +360,7 @@ namespace basegfx { aCandidate.getBezierSegment(b, aEdge); const B2DPoint aTestPoint(aEdge.interpolatePoint(0.5)); - const bool bIsInside(tools::isInside(rClip, aTestPoint) == bInside); + const bool bIsInside(utils::isInside(rClip, aTestPoint) == bInside); if(bIsInside) { @@ -413,10 +413,10 @@ namespace basegfx // check for simplification with ranges if !bStroke (handling as stroke is more simple), // but also only when bInside, else the simplification may lead to recursive calls (see // calls to clipPolyPolygonOnPolyPolygon in clipPolyPolygonOnRange and clipPolygonOnRange) - if (bInside && basegfx::tools::isRectangle(rClip)) + if (bInside && basegfx::utils::isRectangle(rClip)) { // #i125349# detect if both given PolyPolygons are indeed ranges - if (basegfx::tools::isRectangle(rCandidate)) + if (basegfx::utils::isRectangle(rCandidate)) { // both are rectangle if(rCandidate.getB2DRange().equal(rClip.getB2DRange())) @@ -440,9 +440,9 @@ namespace basegfx else { // use common aIntersectionRange as result, convert - // to expected tools::PolyPolygon form + // to expected utils::PolyPolygon form return basegfx::B2DPolyPolygon( - basegfx::tools::createPolygonFromRect(aIntersectionRange)); + basegfx::utils::createPolygonFromRect(aIntersectionRange)); } } } @@ -461,7 +461,7 @@ namespace basegfx // Also get rid of some not-needed polygons (neutral, no area -> when // no intersections, these are tubes). // Now it is possible to correct the orientations in the cut-free - // polygons to values corresponding to painting the tools::PolyPolygon with + // polygons to values corresponding to painting the utils::PolyPolygon with // a XOR-WindingRule. aMergePolyPolygonA = solveCrossovers(aMergePolyPolygonA); aMergePolyPolygonA = stripNeutralPolygons(aMergePolyPolygonA); @@ -814,7 +814,7 @@ namespace basegfx return aResult; } - } // end of namespace tools + } // end of namespace utils } // end of namespace basegfx /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/basegfx/source/polygon/b2dpolygoncutandtouch.cxx b/basegfx/source/polygon/b2dpolygoncutandtouch.cxx index 6f164d2965ec..843b9c64e7ae 100644 --- a/basegfx/source/polygon/b2dpolygoncutandtouch.cxx +++ b/basegfx/source/polygon/b2dpolygoncutandtouch.cxx @@ -77,7 +77,7 @@ namespace basegfx public: const B2DPolygon& getPolygon() const { return maPolygon; } - void setPolygon(const B2DPolygon& rNew) { maPolygon = rNew; maRange = tools::getRange(maPolygon); } + void setPolygon(const B2DPolygon& rNew) { maPolygon = rNew; maRange = utils::getRange(maPolygon); } const B2DRange& getRange() const { return maRange; } temporaryPointVector& getTemporaryPointVector() { return maPoints; } }; @@ -160,7 +160,7 @@ namespace basegfx if(rCandidate.isClosed()) { // set closed flag and correct last point (which is added double now). - tools::closeWithGeometryChange(aRetval); + utils::closeWithGeometryChange(aRetval); } return aRetval; @@ -841,7 +841,7 @@ namespace basegfx namespace basegfx { - namespace tools + namespace utils { B2DPolygon addPointsAtCutsAndTouches(const B2DPolygon& rCandidate) @@ -1070,7 +1070,7 @@ namespace basegfx return rCandidate; } - } // end of namespace tools + } // end of namespace utils } // end of namespace basegfx /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/basegfx/source/polygon/b2dpolygontools.cxx b/basegfx/source/polygon/b2dpolygontools.cxx index 00ba32193db5..45fc27f5575f 100644 --- a/basegfx/source/polygon/b2dpolygontools.cxx +++ b/basegfx/source/polygon/b2dpolygontools.cxx @@ -47,7 +47,7 @@ static double fAngleBoundStartValue = ANGLE_BOUND_START_VALUE; namespace basegfx { - namespace tools + namespace utils { void openWithGeometryChange(B2DPolygon& rCandidate) { @@ -3225,7 +3225,7 @@ namespace basegfx if(bCheckClosed) { // check for closed state flag - tools::checkClosed(aRetval); + utils::checkClosed(aRetval); } } @@ -3345,7 +3345,7 @@ namespace basegfx SAL_WARN_IF(ePolygonFlag == css::drawing::PolygonFlags_CONTROL || bControlA != bControlB, "basegfx", "UnoPolygonBezierCoordsToB2DPolygon: Illegal source polygon (!)"); - // the previous writes used the B2DPolyPoygon -> tools::PolyPolygon converter + // the previous writes used the B2DPolyPoygon -> utils::PolyPolygon converter // which did not create minimal PolyPolygons, but created all control points // as null vectors (identical points). Because of the former P(CA)(CB)-norm of // B2DPolygon and it's unused sign of being the zero-vector and CA and CB being @@ -3536,7 +3536,7 @@ namespace basegfx } } - } // end of namespace tools + } // end of namespace utils } // end of namespace basegfx /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/basegfx/source/polygon/b2dpolygontriangulator.cxx b/basegfx/source/polygon/b2dpolygontriangulator.cxx index 4a85547d7de3..8cd4f895b14a 100644 --- a/basegfx/source/polygon/b2dpolygontriangulator.cxx +++ b/basegfx/source/polygon/b2dpolygontriangulator.cxx @@ -181,7 +181,7 @@ namespace basegfx bool Triangulator::CheckPointInTriangle(EdgeEntry* pEdgeA, EdgeEntry const * pEdgeB, const B2DPoint& rTestPoint) { // inside triangle or on edge? - if(tools::isPointInTriangle(pEdgeA->getStart(), pEdgeA->getEnd(), pEdgeB->getEnd(), rTestPoint, true)) + if(utils::isPointInTriangle(pEdgeA->getStart(), pEdgeA->getEnd(), pEdgeB->getEnd(), rTestPoint, true)) { // but not on point if(!rTestPoint.equal(pEdgeA->getEnd()) && !rTestPoint.equal(pEdgeB->getEnd())) @@ -387,9 +387,9 @@ namespace basegfx B2DPolygon aRetval; // subdivide locally (triangulate does not work with beziers), remove double and neutral points - B2DPolygon aCandidate(rCandidate.areControlPointsUsed() ? tools::adaptiveSubdivideByAngle(rCandidate) : rCandidate); + B2DPolygon aCandidate(rCandidate.areControlPointsUsed() ? utils::adaptiveSubdivideByAngle(rCandidate) : rCandidate); aCandidate.removeDoublePoints(); - aCandidate = tools::removeNeutralPoints(aCandidate); + aCandidate = utils::removeNeutralPoints(aCandidate); if(aCandidate.count() == 2) { @@ -398,10 +398,10 @@ namespace basegfx } else if(aCandidate.count() > 2) { - if(tools::isConvex(aCandidate)) + if(utils::isConvex(aCandidate)) { // polygon is convex, just use a triangle fan - tools::addTriangleFan(aCandidate, aRetval); + utils::addTriangleFan(aCandidate, aRetval); } else { @@ -420,7 +420,7 @@ namespace basegfx B2DPolygon aRetval; // subdivide locally (triangulate does not work with beziers) - B2DPolyPolygon aCandidate(rCandidate.areControlPointsUsed() ? tools::adaptiveSubdivideByAngle(rCandidate) : rCandidate); + B2DPolyPolygon aCandidate(rCandidate.areControlPointsUsed() ? utils::adaptiveSubdivideByAngle(rCandidate) : rCandidate); if(aCandidate.count() == 1) { diff --git a/basegfx/source/polygon/b2dpolypolygoncutter.cxx b/basegfx/source/polygon/b2dpolypolygoncutter.cxx index 1c72680a325a..5f6e088fff1d 100644 --- a/basegfx/source/polygon/b2dpolypolygoncutter.cxx +++ b/basegfx/source/polygon/b2dpolypolygoncutter.cxx @@ -486,9 +486,9 @@ namespace basegfx if(nOriginalCount) { - B2DPolygon aGeometry(tools::addPointsAtCutsAndTouches(rOriginal)); + B2DPolygon aGeometry(utils::addPointsAtCutsAndTouches(rOriginal)); aGeometry.removeDoublePoints(); - aGeometry = tools::simplifyCurveSegments(aGeometry); + aGeometry = utils::simplifyCurveSegments(aGeometry); mbIsCurve = aGeometry.areControlPointsUsed(); const sal_uInt32 nPointCount(aGeometry.count()); @@ -521,9 +521,9 @@ namespace basegfx if(nOriginalCount) { - B2DPolyPolygon aGeometry(tools::addPointsAtCutsAndTouches(maOriginal)); + B2DPolyPolygon aGeometry(utils::addPointsAtCutsAndTouches(maOriginal)); aGeometry.removeDoublePoints(); - aGeometry = tools::simplifyCurveSegments(aGeometry); + aGeometry = utils::simplifyCurveSegments(aGeometry); mbIsCurve = aGeometry.areControlPointsUsed(); nOriginalCount = aGeometry.count(); @@ -682,7 +682,7 @@ namespace basegfx namespace basegfx { - namespace tools + namespace utils { B2DPolyPolygon solveCrossovers(const B2DPolyPolygon& rCandidate) @@ -712,7 +712,7 @@ namespace basegfx { const B2DPolygon aCandidate(rCandidate.getB2DPolygon(a)); - if(tools::getOrientation(aCandidate) != B2VectorOrientation::Neutral) + if(utils::getOrientation(aCandidate) != B2VectorOrientation::Neutral) { aRetval.append(aCandidate); } @@ -728,15 +728,15 @@ namespace basegfx // remove all self-intersections and intersections if(rCandidate.count() == 1) { - aCandidate = basegfx::tools::solveCrossovers(rCandidate.getB2DPolygon(0)); + aCandidate = basegfx::utils::solveCrossovers(rCandidate.getB2DPolygon(0)); } else { - aCandidate = basegfx::tools::solveCrossovers(rCandidate); + aCandidate = basegfx::utils::solveCrossovers(rCandidate); } // cleanup evtl. neutral polygons - aCandidate = basegfx::tools::stripNeutralPolygons(aCandidate); + aCandidate = basegfx::utils::stripNeutralPolygons(aCandidate); // remove all polygons which have the same orientation as the polygon they are directly contained in const sal_uInt32 nCount(aCandidate.count()); @@ -751,8 +751,8 @@ namespace basegfx { const B2DPolygon aCand(aCandidate.getB2DPolygon(a)); StripHelper* pNewHelper = &(aHelpers[a]); - pNewHelper->maRange = tools::getRange(aCand); - pNewHelper->meOrinetation = tools::getOrientation(aCand); + pNewHelper->maRange = utils::getRange(aCand); + pNewHelper->meOrinetation = utils::getOrientation(aCand); // initialize with own orientation pNewHelper->mnDepth = (pNewHelper->meOrinetation == B2VectorOrientation::Negative ? -1 : 1); @@ -767,7 +767,7 @@ namespace basegfx { const B2DPolygon aCandB(aCandidate.getB2DPolygon(b)); StripHelper& rHelperB = aHelpers[b]; - const bool bAInB(rHelperB.maRange.isInside(rHelperA.maRange) && tools::isInside(aCandB, aCandA, true)); + const bool bAInB(rHelperB.maRange.isInside(rHelperA.maRange) && utils::isInside(aCandB, aCandA, true)); if(bAInB) { @@ -775,7 +775,7 @@ namespace basegfx rHelperA.mnDepth += (rHelperB.meOrinetation == B2VectorOrientation::Negative ? -1 : 1); } - const bool bBInA(rHelperA.maRange.isInside(rHelperB.maRange) && tools::isInside(aCandA, aCandB, true)); + const bool bBInA(rHelperA.maRange.isInside(rHelperB.maRange) && utils::isInside(aCandA, aCandB, true)); if(bBInA) { @@ -816,7 +816,7 @@ namespace basegfx { if(nCount == 1) { - if(!bKeepAboveZero && tools::getOrientation(rCandidate.getB2DPolygon(0)) == B2VectorOrientation::Positive) + if(!bKeepAboveZero && utils::getOrientation(rCandidate.getB2DPolygon(0)) == B2VectorOrientation::Positive) { aRetval = rCandidate; } @@ -831,8 +831,8 @@ namespace basegfx { const B2DPolygon aCandidate(rCandidate.getB2DPolygon(a)); StripHelper* pNewHelper = &(aHelpers[a]); - pNewHelper->maRange = tools::getRange(aCandidate); - pNewHelper->meOrinetation = tools::getOrientation(aCandidate); + pNewHelper->maRange = utils::getRange(aCandidate); + pNewHelper->meOrinetation = utils::getOrientation(aCandidate); pNewHelper->mnDepth = (pNewHelper->meOrinetation == B2VectorOrientation::Negative ? -1 : 0); } @@ -845,8 +845,8 @@ namespace basegfx { const B2DPolygon aCandB(rCandidate.getB2DPolygon(b)); StripHelper& rHelperB = aHelpers[b]; - const bool bAInB(rHelperB.maRange.isInside(rHelperA.maRange) && tools::isInside(aCandB, aCandA, true)); - const bool bBInA(rHelperA.maRange.isInside(rHelperB.maRange) && tools::isInside(aCandA, aCandB, true)); + const bool bAInB(rHelperB.maRange.isInside(rHelperA.maRange) && utils::isInside(aCandB, aCandA, true)); + const bool bBInA(rHelperA.maRange.isInside(rHelperB.maRange) && utils::isInside(aCandA, aCandB, true)); if(bAInB && bBInA) { @@ -1019,10 +1019,10 @@ namespace basegfx // solve crossovers and throw away all sub-polygons which have a // depth other than 0. - aRetval = basegfx::tools::solveCrossovers(aRetval); - aRetval = basegfx::tools::stripNeutralPolygons(aRetval); + aRetval = basegfx::utils::solveCrossovers(aRetval); + aRetval = basegfx::utils::stripNeutralPolygons(aRetval); - return basegfx::tools::stripDispensablePolygons(aRetval); + return basegfx::utils::stripDispensablePolygons(aRetval); } } @@ -1106,7 +1106,7 @@ namespace basegfx return B2DPolyPolygon(); } - } // end of namespace tools + } // end of namespace utils } // end of namespace basegfx /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/basegfx/source/polygon/b2dpolypolygontools.cxx b/basegfx/source/polygon/b2dpolypolygontools.cxx index d0353f5640c8..6e0a62f18a89 100644 --- a/basegfx/source/polygon/b2dpolypolygontools.cxx +++ b/basegfx/source/polygon/b2dpolypolygontools.cxx @@ -28,7 +28,7 @@ namespace basegfx { - namespace tools + namespace utils { B2DPolyPolygon correctOrientations(const B2DPolyPolygon& rCandidate) { @@ -38,7 +38,7 @@ namespace basegfx for(sal_uInt32 a(0); a < nCount; a++) { const B2DPolygon aCandidate(rCandidate.getB2DPolygon(a)); - const B2VectorOrientation aOrientation(tools::getOrientation(aCandidate)); + const B2VectorOrientation aOrientation(utils::getOrientation(aCandidate)); sal_uInt32 nDepth(0); for(sal_uInt32 b(0); b < nCount; b++) @@ -47,7 +47,7 @@ namespace basegfx { const B2DPolygon aCompare(rCandidate.getB2DPolygon(b)); - if(tools::isInside(aCompare, aCandidate, true)) + if(utils::isInside(aCompare, aCandidate, true)) { nDepth++; } @@ -85,7 +85,7 @@ namespace basegfx { const B2DPolygon aCompare(rCandidate.getB2DPolygon(b)); - if(tools::isInside(aCompare, aCandidate, true)) + if(utils::isInside(aCompare, aCandidate, true)) { nDepth++; } @@ -125,7 +125,7 @@ namespace basegfx if(aCandidate.areControlPointsUsed()) { - aRetval.append(tools::adaptiveSubdivideByDistance(aCandidate, fDistanceBound)); + aRetval.append(utils::adaptiveSubdivideByDistance(aCandidate, fDistanceBound)); } else { @@ -154,7 +154,7 @@ namespace basegfx if(aCandidate.areControlPointsUsed()) { - aRetval.append(tools::adaptiveSubdivideByAngle(aCandidate, fAngleBound)); + aRetval.append(utils::adaptiveSubdivideByAngle(aCandidate, fAngleBound)); } else { @@ -205,7 +205,7 @@ namespace basegfx for(sal_uInt32 a(0); a < nPolygonCount; a++) { B2DPolygon aCandidate = rCandidate.getB2DPolygon(a); - aRetval.expand(tools::getRange(aCandidate)); + aRetval.expand(utils::getRange(aCandidate)); } return aRetval; @@ -220,7 +220,7 @@ namespace basegfx { const B2DPolygon aCandidate(rCandidate.getB2DPolygon(a)); - fRetval += tools::getSignedArea(aCandidate); + fRetval += utils::getSignedArea(aCandidate); } return fRetval; @@ -704,7 +704,7 @@ namespace basegfx } } - } // end of namespace tools + } // end of namespace utils } // end of namespace basegfx /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/basegfx/source/polygon/b2dsvgpolypolygon.cxx b/basegfx/source/polygon/b2dsvgpolypolygon.cxx index 7514abe6e3c8..98d77fe362d2 100644 --- a/basegfx/source/polygon/b2dsvgpolypolygon.cxx +++ b/basegfx/source/polygon/b2dsvgpolypolygon.cxx @@ -29,7 +29,7 @@ namespace basegfx { - namespace tools + namespace utils { bool PointIndex::operator<(const PointIndex& rComp) const { @@ -488,7 +488,7 @@ namespace basegfx // |y1'| = |-sin phi cos phi| |(y1 - y2)/2| const B2DPoint p1(nLastX, nLastY); const B2DPoint p2(nX, nY); - B2DHomMatrix aTransform(basegfx::tools::createRotateB2DHomMatrix(-fPhi*M_PI/180)); + B2DHomMatrix aTransform(basegfx::utils::createRotateB2DHomMatrix(-fPhi*M_PI/180)); const B2DPoint p1_prime( aTransform * B2DPoint(((p1-p2)/2.0)) ); @@ -573,11 +573,11 @@ namespace basegfx // finally, create bezier polygon from this B2DPolygon aSegment( - tools::createPolygonFromUnitEllipseSegment( + utils::createPolygonFromUnitEllipseSegment( fTheta1, fTheta2 )); // transform ellipse by rotation & move to final center - aTransform = basegfx::tools::createScaleB2DHomMatrix(fRX, fRY); + aTransform = basegfx::utils::createScaleB2DHomMatrix(fRX, fRY); aTransform.translate(aCenter_prime.getX(), aCenter_prime.getY()); aTransform.rotate(fPhi*M_PI/180); diff --git a/basegfx/source/polygon/b2dtrapezoid.cxx b/basegfx/source/polygon/b2dtrapezoid.cxx index 8572e8d18754..3e3c1c9d6b8c 100644 --- a/basegfx/source/polygon/b2dtrapezoid.cxx +++ b/basegfx/source/polygon/b2dtrapezoid.cxx @@ -360,24 +360,24 @@ namespace basegfx // check if one point is on the other edge (a touch, not a cut) const B2DVector aDeltaB(aEdgeB.getDeltaX(), aEdgeB.getDeltaY()); - if(tools::isPointOnEdge(aEdgeA.getStart(), aEdgeB.getStart(), aDeltaB)) + if(utils::isPointOnEdge(aEdgeA.getStart(), aEdgeB.getStart(), aDeltaB)) { return splitEdgeAtGivenPoint(aEdgeB, aEdgeA.getStart(), aCurrent); } - if(tools::isPointOnEdge(aEdgeA.getEnd(), aEdgeB.getStart(), aDeltaB)) + if(utils::isPointOnEdge(aEdgeA.getEnd(), aEdgeB.getStart(), aDeltaB)) { return splitEdgeAtGivenPoint(aEdgeB, aEdgeA.getEnd(), aCurrent); } const B2DVector aDeltaA(aEdgeA.getDeltaX(), aEdgeA.getDeltaY()); - if(tools::isPointOnEdge(aEdgeB.getStart(), aEdgeA.getStart(), aDeltaA)) + if(utils::isPointOnEdge(aEdgeB.getStart(), aEdgeA.getStart(), aDeltaA)) { return splitEdgeAtGivenPoint(aEdgeA, aEdgeB.getStart(), aCurrent); } - if(tools::isPointOnEdge(aEdgeB.getEnd(), aEdgeA.getStart(), aDeltaA)) + if(utils::isPointOnEdge(aEdgeB.getEnd(), aEdgeA.getStart(), aDeltaA)) { return splitEdgeAtGivenPoint(aEdgeA, aEdgeB.getEnd(), aCurrent); } @@ -387,7 +387,7 @@ namespace basegfx double fCutA(0.0); double fCutB(0.0); - if(tools::findCut( + if(utils::findCut( aEdgeA.getStart(), aDeltaA, aEdgeB.getStart(), aDeltaB, CutFlagValue::LINE, @@ -943,9 +943,9 @@ namespace basegfx namespace basegfx { - namespace tools + namespace utils { - // convert Source tools::PolyPolygon to trapezoids + // convert Source utils::PolyPolygon to trapezoids void trapezoidSubdivide(B2DTrapezoidVector& ro_Result, const B2DPolyPolygon& rSourcePolyPolygon) { trapezoidhelper::TrapezoidSubdivider aTrapezoidSubdivider(rSourcePolyPolygon); @@ -1168,7 +1168,7 @@ namespace basegfx } - } // end of namespace tools + } // end of namespace utils } // end of namespace basegfx /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/basegfx/source/polygon/b3dpolygontools.cxx b/basegfx/source/polygon/b3dpolygontools.cxx index 0e09d996dd37..de362287f8ea 100644 --- a/basegfx/source/polygon/b3dpolygontools.cxx +++ b/basegfx/source/polygon/b3dpolygontools.cxx @@ -31,7 +31,7 @@ namespace basegfx { - namespace tools + namespace utils { // B3DPolygon tools void checkClosed(B3DPolygon& rCandidate) @@ -786,7 +786,7 @@ namespace basegfx } } - } // end of namespace tools + } // end of namespace utils } // end of namespace basegfx /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/basegfx/source/polygon/b3dpolypolygontools.cxx b/basegfx/source/polygon/b3dpolypolygontools.cxx index 04408dee4721..ba93d1926b84 100644 --- a/basegfx/source/polygon/b3dpolypolygontools.cxx +++ b/basegfx/source/polygon/b3dpolypolygontools.cxx @@ -35,7 +35,7 @@ namespace basegfx { - namespace tools + namespace utils { // B3DPolyPolygon tools B3DRange getRange(const B3DPolyPolygon& rCandidate) @@ -525,7 +525,7 @@ namespace basegfx // see callers if(bCheckClosed) { - basegfx::tools::checkClosed(aNewPolygon); + basegfx::utils::checkClosed(aNewPolygon); } aRetval.append(aNewPolygon); @@ -606,7 +606,7 @@ namespace basegfx } } - } // end of namespace tools + } // end of namespace utils } // end of namespace basegfx /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/basegfx/source/range/b2dpolyrange.cxx b/basegfx/source/range/b2dpolyrange.cxx index 3b86f4fd8c0c..a98578ee974d 100644 --- a/basegfx/source/range/b2dpolyrange.cxx +++ b/basegfx/source/range/b2dpolyrange.cxx @@ -84,7 +84,7 @@ namespace basegfx B2DPolyPolygon solveCrossovers() const { - return tools::solveCrossovers(maRanges,maOrient); + return utils::solveCrossovers(maRanges,maOrient); } void transform(const basegfx::B2DHomMatrix& rTranslate) diff --git a/basegfx/source/range/b2drangeclipper.cxx b/basegfx/source/range/b2drangeclipper.cxx index 2b68bae713ad..e38a9132ec80 100644 --- a/basegfx/source/range/b2drangeclipper.cxx +++ b/basegfx/source/range/b2drangeclipper.cxx @@ -838,7 +838,7 @@ namespace basegfx } } - namespace tools + namespace utils { B2DPolyPolygon solveCrossovers(const std::vector<B2DRange>& rRanges, const std::vector<B2VectorOrientation>& rOrientations) diff --git a/basegfx/source/tools/b2dclipstate.cxx b/basegfx/source/tools/b2dclipstate.cxx index 5e0453fbf529..cf848f1af1c2 100644 --- a/basegfx/source/tools/b2dclipstate.cxx +++ b/basegfx/source/tools/b2dclipstate.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include <basegfx/tools/b2dclipstate.hxx> +#include <basegfx/utils/b2dclipstate.hxx> #include <basegfx/range/b2drange.hxx> #include <basegfx/range/b2dpolyrange.hxx> @@ -31,7 +31,7 @@ namespace basegfx { -namespace tools +namespace utils { class ImplB2DClipState { @@ -196,7 +196,7 @@ namespace tools // assumption: maClipPoly has kept polygons prepared for // clipping; i.e. no neutral polygons & correct // orientation - maPendingPolygons = tools::prepareForPolygonOperation(maPendingPolygons); + maPendingPolygons = utils::prepareForPolygonOperation(maPendingPolygons); const bool bIsEmpty=isNullClipPoly(); const bool bIsCleared=!maClipPoly.count(); switch(mePendingOps) @@ -207,7 +207,7 @@ namespace tools if( bIsEmpty ) maClipPoly = maPendingPolygons; else - maClipPoly = tools::solvePolygonOperationOr( + maClipPoly = utils::solvePolygonOperationOr( maClipPoly, maPendingPolygons); break; @@ -217,7 +217,7 @@ namespace tools if( bIsCleared ) maClipPoly = maPendingPolygons; else - maClipPoly = tools::solvePolygonOperationAnd( + maClipPoly = utils::solvePolygonOperationAnd( maClipPoly, maPendingPolygons); break; @@ -235,13 +235,13 @@ namespace tools // 'holes' here) // going for an ugly hack meanwhile - maClipPoly = tools::solvePolygonOperationXor( + maClipPoly = utils::solvePolygonOperationXor( B2DPolyPolygon( - tools::createPolygonFromRect(B2DRange(-1E20,-1E20,1E20,1E20))), + utils::createPolygonFromRect(B2DRange(-1E20,-1E20,1E20,1E20))), maPendingPolygons); } else - maClipPoly = tools::solvePolygonOperationXor( + maClipPoly = utils::solvePolygonOperationXor( maClipPoly, maPendingPolygons); break; @@ -264,13 +264,13 @@ namespace tools // 'holes' here) // going for an ugly hack meanwhile - maClipPoly = tools::solvePolygonOperationDiff( + maClipPoly = utils::solvePolygonOperationDiff( B2DPolyPolygon( - tools::createPolygonFromRect(B2DRange(-1E20,-1E20,1E20,1E20))), + utils::createPolygonFromRect(B2DRange(-1E20,-1E20,1E20,1E20))), maPendingPolygons); } else - maClipPoly = tools::solvePolygonOperationDiff( + maClipPoly = utils::solvePolygonOperationDiff( maClipPoly, maPendingPolygons); break; @@ -300,7 +300,7 @@ namespace tools if( bIsEmpty ) maClipPoly = aCollectedRanges; else - maClipPoly = tools::solvePolygonOperationOr( + maClipPoly = utils::solvePolygonOperationOr( maClipPoly, aCollectedRanges); break; @@ -315,7 +315,7 @@ namespace tools if( bIsCleared ) maClipPoly = aCollectedRanges; else - maClipPoly = tools::solvePolygonOperationAnd( + maClipPoly = utils::solvePolygonOperationAnd( maClipPoly, aCollectedRanges); break; @@ -337,13 +337,13 @@ namespace tools // 'holes' here) // going for an ugly hack meanwhile - maClipPoly = tools::solvePolygonOperationXor( + maClipPoly = utils::solvePolygonOperationXor( B2DPolyPolygon( - tools::createPolygonFromRect(B2DRange(-1E20,-1E20,1E20,1E20))), + utils::createPolygonFromRect(B2DRange(-1E20,-1E20,1E20,1E20))), aCollectedRanges); } else - maClipPoly = tools::solvePolygonOperationXor( + maClipPoly = utils::solvePolygonOperationXor( maClipPoly, aCollectedRanges); break; @@ -366,13 +366,13 @@ namespace tools // 'holes' here) // going for an ugly hack meanwhile - maClipPoly = tools::solvePolygonOperationDiff( + maClipPoly = utils::solvePolygonOperationDiff( B2DPolyPolygon( - tools::createPolygonFromRect(B2DRange(-1E20,-1E20,1E20,1E20))), + utils::createPolygonFromRect(B2DRange(-1E20,-1E20,1E20,1E20))), aCollectedRanges); } else - maClipPoly = tools::solvePolygonOperationDiff( + maClipPoly = utils::solvePolygonOperationDiff( maClipPoly, aCollectedRanges); break; @@ -493,7 +493,7 @@ namespace tools } -} // end of namespace tools +} // end of namespace utils } // end of namespace basegfx /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/basegfx/source/tools/canvastools.cxx b/basegfx/source/tools/canvastools.cxx index e65ae9ce44b3..7073e49711ba 100644 --- a/basegfx/source/tools/canvastools.cxx +++ b/basegfx/source/tools/canvastools.cxx @@ -34,7 +34,7 @@ #include <com/sun/star/awt/Size.hpp> #include <com/sun/star/awt/Point.hpp> #include <com/sun/star/awt/Rectangle.hpp> -#include <basegfx/tools/unopolypolygon.hxx> +#include <basegfx/utils/unopolypolygon.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> #include <basegfx/matrix/b3dhommatrix.hxx> #include <basegfx/vector/b2dsize.hxx> @@ -47,7 +47,7 @@ #include <basegfx/range/b2ibox.hxx> #include <basegfx/polygon/b2dpolygon.hxx> #include <basegfx/polygon/b2dpolypolygon.hxx> -#include <basegfx/tools/canvastools.hxx> +#include <basegfx/utils/canvastools.hxx> #include <limits> using namespace ::com::sun::star; diff --git a/basegfx/source/tools/gradienttools.cxx b/basegfx/source/tools/gradienttools.cxx index a3c42a6b7e75..b05d9b219a53 100644 --- a/basegfx/source/tools/gradienttools.cxx +++ b/basegfx/source/tools/gradienttools.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include <basegfx/tools/gradienttools.hxx> +#include <basegfx/utils/gradienttools.hxx> #include <basegfx/point/b2dpoint.hxx> #include <basegfx/range/b2drange.hxx> #include <basegfx/matrix/b2dhommatrixtools.hxx> @@ -100,7 +100,7 @@ namespace basegfx { const B2DPoint aCenter(0.5 * fTargetSizeX, 0.5 * fTargetSizeY); - aTextureTransform *= basegfx::tools::createRotateAroundPoint(aCenter, fAngle); + aTextureTransform *= basegfx::utils::createRotateAroundPoint(aCenter, fAngle); } // add object translate @@ -161,7 +161,7 @@ namespace basegfx { const B2DPoint aCenter(0.5 * fTargetSizeX, 0.5 * fTargetSizeY); - aTextureTransform *= basegfx::tools::createRotateAroundPoint(aCenter, fAngle); + aTextureTransform *= basegfx::utils::createRotateAroundPoint(aCenter, fAngle); } // add defined offsets after rotation @@ -238,7 +238,7 @@ namespace basegfx { const B2DPoint aCenter(0.5 * fTargetSizeX, 0.5 * fTargetSizeY); - aTextureTransform *= basegfx::tools::createRotateAroundPoint(aCenter, fAngle); + aTextureTransform *= basegfx::utils::createRotateAroundPoint(aCenter, fAngle); } // add defined offsets after rotation @@ -258,7 +258,7 @@ namespace basegfx return ODFGradientInfo(aTextureTransform, fAspectRatio, nSteps); } - namespace tools + namespace utils { ODFGradientInfo createLinearODFGradientInfo( const B2DRange& rTargetArea, @@ -465,7 +465,7 @@ namespace basegfx { return getSquareGradientAlpha(rUV, rGradInfo); // only matrix setup differs } - } // namespace tools + } // namespace utils } // namespace basegfx /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/basegfx/source/tools/keystoplerp.cxx b/basegfx/source/tools/keystoplerp.cxx index e68bb1b60bf6..0b0f230253f1 100644 --- a/basegfx/source/tools/keystoplerp.cxx +++ b/basegfx/source/tools/keystoplerp.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include <basegfx/tools/keystoplerp.hxx> +#include <basegfx/utils/keystoplerp.hxx> #include <com/sun/star/uno/Sequence.hxx> #include <osl/diagnose.h> @@ -42,7 +42,7 @@ static void validateInput(const std::vector<double>& rKeyStops) namespace basegfx { - namespace tools + namespace utils { KeyStopLerp::KeyStopLerp( const std::vector<double>& rKeyStops ) : maKeyStops(rKeyStops), diff --git a/basegfx/source/tools/numbertools.cxx b/basegfx/source/tools/numbertools.cxx index 86b926ab55d2..c4bf5792cfb5 100644 --- a/basegfx/source/tools/numbertools.cxx +++ b/basegfx/source/tools/numbertools.cxx @@ -7,7 +7,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include <basegfx/tools/tools.hxx> +#include <basegfx/utils/tools.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> #include <basegfx/polygon/b2dpolypolygon.hxx> #include <basegfx/polygon/b2dpolypolygontools.hxx> @@ -17,7 +17,7 @@ #include <utility> -namespace basegfx { namespace tools +namespace basegfx { namespace utils { B2DPolyPolygon number2PolyPolygon(double fValue, sal_Int32 nTotalDigits, sal_Int32 nDecPlaces, bool bLitSegments) { diff --git a/basegfx/source/tools/tools.cxx b/basegfx/source/tools/tools.cxx index ec7170b513a7..16feb0c7ef16 100644 --- a/basegfx/source/tools/tools.cxx +++ b/basegfx/source/tools/tools.cxx @@ -17,14 +17,14 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include <basegfx/tools/tools.hxx> +#include <basegfx/utils/tools.hxx> #include <basegfx/range/b2drange.hxx> #include <algorithm> namespace basegfx { - namespace tools + namespace utils { namespace { diff --git a/basegfx/source/tools/unopolypolygon.cxx b/basegfx/source/tools/unopolypolygon.cxx index 05318647c2fb..e0b5b85f079b 100644 --- a/basegfx/source/tools/unopolypolygon.cxx +++ b/basegfx/source/tools/unopolypolygon.cxx @@ -28,10 +28,10 @@ #include <basegfx/range/b2drange.hxx> #include <basegfx/range/b2drectangle.hxx> #include <basegfx/point/b2dpoint.hxx> -#include <basegfx/tools/canvastools.hxx> +#include <basegfx/utils/canvastools.hxx> #include <basegfx/polygon/b2dpolygon.hxx> #include <basegfx/polygon/b2dpolypolygontools.hxx> -#include <basegfx/tools/unopolypolygon.hxx> +#include <basegfx/utils/unopolypolygon.hxx> #include <basegfx/matrix/b2dhommatrixtools.hxx> #include <cppuhelper/supportsservice.hxx> @@ -117,13 +117,13 @@ namespace unotools } } - const B2DRange aBounds( tools::getRange( aSrcPoly ) ); + const B2DRange aBounds( utils::getRange( aSrcPoly ) ); const B2DVector aOffset( unotools::b2DPointFromRealPoint2D( position ) - aBounds.getMinimum() ); if( !aOffset.equalZero() ) { - const B2DHomMatrix aTranslate(tools::createTranslateB2DHomMatrix(aOffset)); + const B2DHomMatrix aTranslate(utils::createTranslateB2DHomMatrix(aOffset)); aSrcPoly.transform( aTranslate ); } diff --git a/basegfx/source/tools/unotools.cxx b/basegfx/source/tools/unotools.cxx index 7e3309e09c79..a80b6b9994a3 100644 --- a/basegfx/source/tools/unotools.cxx +++ b/basegfx/source/tools/unotools.cxx @@ -26,7 +26,7 @@ #include <basegfx/polygon/b2dpolygon.hxx> #include <basegfx/curve/b2dcubicbezier.hxx> -#include <basegfx/tools/unotools.hxx> +#include <basegfx/utils/unotools.hxx> #include <comphelper/sequence.hxx> using namespace ::com::sun::star; @@ -113,7 +113,7 @@ namespace unotools if(ePolyFlag == drawing::PolygonFlags_CONTROL || bControlA != bControlB) throw lang::IllegalArgumentException(); - // the previous writes used the B2DPolyPoygon -> tools::PolyPolygon converter + // the previous writes used the B2DPolyPoygon -> utils::PolyPolygon converter // which did not create minimal PolyPolygons, but created all control points // as null vectors (identical points). Because of the former P(CA)(CB)-norm of // B2DPolygon and it's unused sign of being the zero-vector and CA and CB being @@ -146,7 +146,7 @@ namespace unotools // #i72807# API import uses old line start/end-equal definition for closed, // so we need to correct this to closed state here - basegfx::tools::checkClosed(aNewPolygon); + basegfx::utils::checkClosed(aNewPolygon); // add new subpolygon aNewPolyPolygon.append(aNewPolygon); diff --git a/basegfx/source/tools/zoomtools.cxx b/basegfx/source/tools/zoomtools.cxx index 57d88de6fe3c..7e007c525b52 100644 --- a/basegfx/source/tools/zoomtools.cxx +++ b/basegfx/source/tools/zoomtools.cxx @@ -7,7 +7,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include <basegfx/tools/zoomtools.hxx> +#include <basegfx/utils/zoomtools.hxx> namespace basegfx { diff --git a/basegfx/test/basegfx2d.cxx b/basegfx/test/basegfx2d.cxx index f5cc617ddbc2..9b9fec5a6d66 100644 --- a/basegfx/test/basegfx2d.cxx +++ b/basegfx/test/basegfx2d.cxx @@ -41,7 +41,7 @@ #include <basegfx/color/bcolor.hxx> #include <basegfx/color/bcolortools.hxx> -#include <basegfx/tools/rectcliptools.hxx> +#include <basegfx/utils/rectcliptools.hxx> #include <iostream> #include <fstream> @@ -138,20 +138,20 @@ public: OUString aExport; CPPUNIT_ASSERT_MESSAGE("importing simple rectangle from SVG-D", - tools::importFromSvgD( aPoly, aPath0, false, nullptr )); - aExport = tools::exportToSvgD( aPoly, true, true, false ); + utils::importFromSvgD( aPoly, aPath0, false, nullptr )); + aExport = utils::exportToSvgD( aPoly, true, true, false ); const char sExportString[] = "m10 10h-20v-20h20z"; CPPUNIT_ASSERT_EQUAL_MESSAGE("exporting rectangle to SVG-D", OUString(sExportString), aExport ); CPPUNIT_ASSERT_MESSAGE("importing simple rectangle from SVG-D (round-trip", - tools::importFromSvgD( aPoly, aExport, false, nullptr )); - aExport = tools::exportToSvgD( aPoly, true, true, false ); + utils::importFromSvgD( aPoly, aExport, false, nullptr )); + aExport = utils::exportToSvgD( aPoly, true, true, false ); CPPUNIT_ASSERT_EQUAL_MESSAGE("exporting rectangle to SVG-D (round-trip)", OUString(sExportString), aExport); CPPUNIT_ASSERT_MESSAGE("importing simple bezier polygon from SVG-D", - tools::importFromSvgD( aPoly, aPath1, false, nullptr )); - aExport = tools::exportToSvgD( aPoly, true, true, false ); + utils::importFromSvgD( aPoly, aPath1, false, nullptr )); + aExport = utils::exportToSvgD( aPoly, true, true, false ); // Adaptions for B2DPolygon bezier change (see #i77162#): @@ -178,11 +178,11 @@ public: // a 2nd good test is that re-importing of aExport has to create the same // B2DPolPolygon again: B2DPolyPolygon aReImport; - CPPUNIT_ASSERT_MESSAGE("importing simple bezier polygon from SVG-D", tools::importFromSvgD( aReImport, aExport, false, nullptr)); + CPPUNIT_ASSERT_MESSAGE("importing simple bezier polygon from SVG-D", utils::importFromSvgD( aReImport, aExport, false, nullptr)); CPPUNIT_ASSERT_EQUAL_MESSAGE("re-imported polygon needs to be identical", aPoly, aReImport); - CPPUNIT_ASSERT_MESSAGE("importing '@' from SVG-D", tools::importFromSvgD( aPoly, aPath2, false, nullptr)); - aExport = tools::exportToSvgD( aPoly, true, true, false ); + CPPUNIT_ASSERT_MESSAGE("importing '@' from SVG-D", utils::importFromSvgD( aPoly, aPath2, false, nullptr)); + aExport = utils::exportToSvgD( aPoly, true, true, false ); // Adaptions for B2DPolygon bezier change (see #i77162#): @@ -198,19 +198,19 @@ public: "8 752-224 1128-21 101-31 183-31 245 0 39 9 70 26 93 17 24 39 36 67 36 145 0 279-80 400-240s182-365 182-615c0-2" "88-107-533-322-734s-487-301-816-301c-395 0-715 124-960 373s-368 569-368 958q0 577.5 357 900c237 216 557 324 95" "8 325 189-1 389-27 600-77 211-52 378-110 503-174q40.5 105 81 210z"; - CPPUNIT_ASSERT_MESSAGE("re-importing '@' from SVG-D", tools::importFromSvgD( aReImport, aExport, false, nullptr)); + CPPUNIT_ASSERT_MESSAGE("re-importing '@' from SVG-D", utils::importFromSvgD( aReImport, aExport, false, nullptr)); CPPUNIT_ASSERT_EQUAL_MESSAGE("re-imported '@' needs to be identical", aPoly, aReImport); CPPUNIT_ASSERT_EQUAL_MESSAGE("exporting '@' to SVG-D", OUString(sExportString1), aExport); CPPUNIT_ASSERT_MESSAGE("importing '@' from SVG-D (round-trip", - tools::importFromSvgD( aPoly, aExport, false, nullptr )); - aExport = tools::exportToSvgD( aPoly, true, true, false ); + utils::importFromSvgD( aPoly, aExport, false, nullptr )); + aExport = utils::exportToSvgD( aPoly, true, true, false ); CPPUNIT_ASSERT_EQUAL_MESSAGE("exporting '@' to SVG-D (round-trip)", OUString(sExportString1), aExport); CPPUNIT_ASSERT_MESSAGE("importing complex polygon from SVG-D", - tools::importFromSvgD( aPoly, aPath3, false, nullptr )); - aExport = tools::exportToSvgD( aPoly, true, true, false ); + utils::importFromSvgD( aPoly, aPath3, false, nullptr )); + aExport = utils::exportToSvgD( aPoly, true, true, false ); const char sExportString2[] = "m1598 125h306v2334h-306v-1105h-1293v1105h-305v-2334h305v973h1293" "zm2159 1015 78-44 85 235-91 47-91 40-90 34-90 29-89 21-88 16-88 10-88 3-102-4-97" @@ -235,14 +235,14 @@ public: CPPUNIT_ASSERT_EQUAL_MESSAGE("exporting complex polygon to SVG-D", OUString(sExportString2), aExport); CPPUNIT_ASSERT_MESSAGE("importing complex polygon from SVG-D (round-trip", - tools::importFromSvgD( aPoly, aExport, false, nullptr )); - aExport = tools::exportToSvgD( aPoly, true, true, false ); + utils::importFromSvgD( aPoly, aExport, false, nullptr )); + aExport = utils::exportToSvgD( aPoly, true, true, false ); CPPUNIT_ASSERT_EQUAL_MESSAGE("exporting complex polygon to SVG-D (round-trip)", OUString(sExportString2), aExport); const B2DPolygon aRect( - tools::createPolygonFromRect( B2DRange(0.0,0.0,4000.0,4000.0) )); - aExport = tools::exportToSvgD( B2DPolyPolygon(aRect), false, false, false ); + utils::createPolygonFromRect( B2DRange(0.0,0.0,4000.0,4000.0) )); + aExport = utils::exportToSvgD( B2DPolyPolygon(aRect), false, false, false ); const char sExportStringRect[] = "M0 0H4000V4000H0Z"; CPPUNIT_ASSERT_EQUAL_MESSAGE("exporting to rectangle svg-d string", @@ -297,7 +297,7 @@ public: // B2DPolyRange relies on correctly orientated rects const B2DRange aRect(0,0,1,1); CPPUNIT_ASSERT_EQUAL_MESSAGE("createPolygonFromRect - correct orientation", - B2VectorOrientation::Positive, tools::getOrientation(tools::createPolygonFromRect(aRect))); + B2VectorOrientation::Positive, utils::getOrientation(utils::createPolygonFromRect(aRect))); } // Change the following lines only, if you add, remove or rename @@ -669,7 +669,7 @@ public: CPPUNIT_ASSERT_MESSAGE("decompose: error test I4", impDecomposeComposeTest(-fSX, -fSY, tan(-fS), -fR)); // cover special case of 180 degree rotation - B2DHomMatrix aTest=tools::createScaleShearXRotateTranslateB2DHomMatrix( + B2DHomMatrix aTest=utils::createScaleShearXRotateTranslateB2DHomMatrix( 6425,3938, 0, 180*F_PI180, @@ -795,7 +795,7 @@ public: void testIsRectangle() { B2DPolygon aRect1( - tools::createPolygonFromRect( + utils::createPolygonFromRect( B2DRange(0,0,1,1) ) ); B2DPolygon aRect2 { @@ -847,19 +847,19 @@ public: aNonRect5.setClosed(true); CPPUNIT_ASSERT_MESSAGE("checking rectangle-ness of rectangle 1", - tools::isRectangle( aRect1 )); + utils::isRectangle( aRect1 )); CPPUNIT_ASSERT_MESSAGE("checking rectangle-ness of rectangle 2", - tools::isRectangle( aRect2 )); + utils::isRectangle( aRect2 )); CPPUNIT_ASSERT_MESSAGE("checking non-rectangle-ness of polygon 1", - !tools::isRectangle( aNonRect1 )); + !utils::isRectangle( aNonRect1 )); CPPUNIT_ASSERT_MESSAGE("checking non-rectangle-ness of polygon 2", - !tools::isRectangle( aNonRect2 )); + !utils::isRectangle( aNonRect2 )); CPPUNIT_ASSERT_MESSAGE("checking non-rectangle-ness of polygon 3", - !tools::isRectangle( aNonRect3 )); + !utils::isRectangle( aNonRect3 )); CPPUNIT_ASSERT_MESSAGE("checking non-rectangle-ness of polygon 4", - !tools::isRectangle( aNonRect4 )); + !utils::isRectangle( aNonRect4 )); CPPUNIT_ASSERT_MESSAGE("checking non-rectangle-ness of polygon 5", - !tools::isRectangle( aNonRect5 )); + !utils::isRectangle( aNonRect5 )); } // Change the following lines only, if you add, remove or rename @@ -901,7 +901,7 @@ public: aPolyPolygon.append(aPolygon); aPolyPolygon.append(aPolygonOffset); B2DTrapezoidVector aVector; - basegfx::tools::trapezoidSubdivide(aVector, aPolyPolygon); + basegfx::utils::trapezoidSubdivide(aVector, aPolyPolygon); CPPUNIT_ASSERT_MESSAGE("more than zero sub-divided trapezoids", aVector.size() > 0); } @@ -984,15 +984,15 @@ public: Type aRange(0,0,10,10); CPPUNIT_ASSERT_MESSAGE("(0,0) is outside range!", - tools::getCohenSutherlandClipFlags(B2IPoint(0,0),aRange) == 0); + utils::getCohenSutherlandClipFlags(B2IPoint(0,0),aRange) == 0); CPPUNIT_ASSERT_MESSAGE("(-1,-1) is inside range!", - tools::getCohenSutherlandClipFlags(B2IPoint(-1,-1),aRange) == - (tools::RectClipFlags::LEFT|tools::RectClipFlags::TOP)); + utils::getCohenSutherlandClipFlags(B2IPoint(-1,-1),aRange) == + (utils::RectClipFlags::LEFT|utils::RectClipFlags::TOP)); CPPUNIT_ASSERT_MESSAGE("(10,10) is outside range!", - tools::getCohenSutherlandClipFlags(B2IPoint(10,10),aRange) == 0); + utils::getCohenSutherlandClipFlags(B2IPoint(10,10),aRange) == 0); CPPUNIT_ASSERT_MESSAGE("(11,11) is inside range!", - tools::getCohenSutherlandClipFlags(B2IPoint(11,11),aRange) == - (tools::RectClipFlags::RIGHT|tools::RectClipFlags::BOTTOM)); + utils::getCohenSutherlandClipFlags(B2IPoint(11,11),aRange) == + (utils::RectClipFlags::RIGHT|utils::RectClipFlags::BOTTOM)); } void check() @@ -1019,15 +1019,15 @@ public: B2IBox aBox(0,0,10,10); CPPUNIT_ASSERT_EQUAL_MESSAGE("(0,0) is outside range!", - sal_uInt32(0), tools::getCohenSutherlandClipFlags(B2IPoint(0,0),aBox)); + sal_uInt32(0), utils::getCohenSutherlandClipFlags(B2IPoint(0,0),aBox)); CPPUNIT_ASSERT_EQUAL_MESSAGE("(-1,-1) is inside range!", - tools::RectClipFlags::LEFT|tools::RectClipFlags::TOP, - tools::getCohenSutherlandClipFlags(B2IPoint(-1,-1),aBox)); + utils::RectClipFlags::LEFT|utils::RectClipFlags::TOP, + utils::getCohenSutherlandClipFlags(B2IPoint(-1,-1),aBox)); CPPUNIT_ASSERT_EQUAL_MESSAGE("(9,9) is outside range!", - sal_uInt32(0), tools::getCohenSutherlandClipFlags(B2IPoint(9,9),aBox)); + sal_uInt32(0), utils::getCohenSutherlandClipFlags(B2IPoint(9,9),aBox)); CPPUNIT_ASSERT_EQUAL_MESSAGE("(10,10) is inside range!", - tools::RectClipFlags::RIGHT|tools::RectClipFlags::BOTTOM, - tools::getCohenSutherlandClipFlags(B2IPoint(10,10),aBox)); + utils::RectClipFlags::RIGHT|utils::RectClipFlags::BOTTOM, + utils::getCohenSutherlandClipFlags(B2IPoint(10,10),aBox)); } // Change the following lines only, if you add, remove or rename @@ -1084,118 +1084,118 @@ public: void hslTest() { CPPUNIT_ASSERT_EQUAL_MESSAGE("white", - BColor(0,0,1), tools::rgb2hsl(maWhite)); + BColor(0,0,1), utils::rgb2hsl(maWhite)); CPPUNIT_ASSERT_EQUAL_MESSAGE("black", - BColor(0,0,0), tools::rgb2hsl(maBlack)); + BColor(0,0,0), utils::rgb2hsl(maBlack)); CPPUNIT_ASSERT_EQUAL_MESSAGE("red", - BColor(0,1,0.5), tools::rgb2hsl(maRed)); + BColor(0,1,0.5), utils::rgb2hsl(maRed)); CPPUNIT_ASSERT_EQUAL_MESSAGE("green", - BColor(120,1,0.5), tools::rgb2hsl(maGreen)); + BColor(120,1,0.5), utils::rgb2hsl(maGreen)); CPPUNIT_ASSERT_EQUAL_MESSAGE("blue", - BColor(240,1,0.5), tools::rgb2hsl(maBlue)); + BColor(240,1,0.5), utils::rgb2hsl(maBlue)); CPPUNIT_ASSERT_EQUAL_MESSAGE("yellow", - BColor(60,1,0.5), tools::rgb2hsl(maYellow)); + BColor(60,1,0.5), utils::rgb2hsl(maYellow)); CPPUNIT_ASSERT_EQUAL_MESSAGE("magenta", - BColor(300,1,0.5), tools::rgb2hsl(maMagenta)); + BColor(300,1,0.5), utils::rgb2hsl(maMagenta)); CPPUNIT_ASSERT_EQUAL_MESSAGE("cyan", - BColor(180,1,0.5), tools::rgb2hsl(maCyan)); + BColor(180,1,0.5), utils::rgb2hsl(maCyan)); CPPUNIT_ASSERT_EQUAL_MESSAGE("third hue case", - BColor(210,1,0.5), tools::rgb2hsl(BColor(0,0.5,1))); + BColor(210,1,0.5), utils::rgb2hsl(BColor(0,0.5,1))); CPPUNIT_ASSERT_EQUAL_MESSAGE("roundtrip white", - maWhite, tools::hsl2rgb(tools::rgb2hsl(maWhite))); + maWhite, utils::hsl2rgb(utils::rgb2hsl(maWhite))); CPPUNIT_ASSERT_EQUAL_MESSAGE("roundtrip black", - maBlack, tools::hsl2rgb(tools::rgb2hsl(maBlack))); + maBlack, utils::hsl2rgb(utils::rgb2hsl(maBlack))); CPPUNIT_ASSERT_EQUAL_MESSAGE("roundtrip red", - maRed, tools::hsl2rgb(tools::rgb2hsl(maRed))); + maRed, utils::hsl2rgb(utils::rgb2hsl(maRed))); CPPUNIT_ASSERT_EQUAL_MESSAGE("roundtrip green", - maGreen, tools::hsl2rgb(tools::rgb2hsl(maGreen))); + maGreen, utils::hsl2rgb(utils::rgb2hsl(maGreen))); CPPUNIT_ASSERT_EQUAL_MESSAGE("roundtrip blue", - maBlue, tools::hsl2rgb(tools::rgb2hsl(maBlue))); + maBlue, utils::hsl2rgb(utils::rgb2hsl(maBlue))); CPPUNIT_ASSERT_EQUAL_MESSAGE("roundtrip yellow", - maYellow, tools::hsl2rgb(tools::rgb2hsl(maYellow))); + maYellow, utils::hsl2rgb(utils::rgb2hsl(maYellow))); CPPUNIT_ASSERT_EQUAL_MESSAGE("roundtrip magenta", - maMagenta, tools::hsl2rgb(tools::rgb2hsl(maMagenta))); + maMagenta, utils::hsl2rgb(utils::rgb2hsl(maMagenta))); CPPUNIT_ASSERT_EQUAL_MESSAGE("roundtrip cyan", - maCyan, tools::hsl2rgb(tools::rgb2hsl(maCyan))); + maCyan, utils::hsl2rgb(utils::rgb2hsl(maCyan))); CPPUNIT_ASSERT_EQUAL_MESSAGE("grey10", - BColor(0,0,.1), tools::rgb2hsl(maWhite*.1)); + BColor(0,0,.1), utils::rgb2hsl(maWhite*.1)); CPPUNIT_ASSERT_EQUAL_MESSAGE("grey90", - BColor(0,0,.9), tools::rgb2hsl(maWhite*.9)); + BColor(0,0,.9), utils::rgb2hsl(maWhite*.9)); CPPUNIT_ASSERT_EQUAL_MESSAGE("red/2", - BColor(0,1,0.25), tools::rgb2hsl(maRed*.5)); + BColor(0,1,0.25), utils::rgb2hsl(maRed*.5)); CPPUNIT_ASSERT_EQUAL_MESSAGE("green/2", - BColor(120,1,0.25), tools::rgb2hsl(maGreen*.5)); + BColor(120,1,0.25), utils::rgb2hsl(maGreen*.5)); CPPUNIT_ASSERT_EQUAL_MESSAGE("blue/2", - BColor(240,1,0.25), tools::rgb2hsl(maBlue*.5)); + BColor(240,1,0.25), utils::rgb2hsl(maBlue*.5)); CPPUNIT_ASSERT_EQUAL_MESSAGE("yellow/2", - BColor(60,1,0.25), tools::rgb2hsl(maYellow*.5)); + BColor(60,1,0.25), utils::rgb2hsl(maYellow*.5)); CPPUNIT_ASSERT_EQUAL_MESSAGE("magenta/2", - BColor(300,1,0.25), tools::rgb2hsl(maMagenta*.5)); + BColor(300,1,0.25), utils::rgb2hsl(maMagenta*.5)); CPPUNIT_ASSERT_EQUAL_MESSAGE("cyan/2", - BColor(180,1,0.25), tools::rgb2hsl(maCyan*.5)); + BColor(180,1,0.25), utils::rgb2hsl(maCyan*.5)); CPPUNIT_ASSERT_EQUAL_MESSAGE("pastel", - BColor(0,.5,.5), tools::rgb2hsl(BColor(.75,.25,.25))); + BColor(0,.5,.5), utils::rgb2hsl(BColor(.75,.25,.25))); } // insert your test code here. void hsvTest() { CPPUNIT_ASSERT_EQUAL_MESSAGE("white", - BColor(0,0,1), tools::rgb2hsv(maWhite)); + BColor(0,0,1), utils::rgb2hsv(maWhite)); CPPUNIT_ASSERT_EQUAL_MESSAGE("black", - BColor(0,0,0), tools::rgb2hsv(maBlack)); + BColor(0,0,0), utils::rgb2hsv(maBlack)); CPPUNIT_ASSERT_EQUAL_MESSAGE("red", - BColor(0,1,1), tools::rgb2hsv(maRed)); + BColor(0,1,1), utils::rgb2hsv(maRed)); CPPUNIT_ASSERT_EQUAL_MESSAGE("green", - BColor(120,1,1), tools::rgb2hsv(maGreen)); + BColor(120,1,1), utils::rgb2hsv(maGreen)); CPPUNIT_ASSERT_EQUAL_MESSAGE("blue", - BColor(240,1,1), tools::rgb2hsv(maBlue)); + BColor(240,1,1), utils::rgb2hsv(maBlue)); CPPUNIT_ASSERT_EQUAL_MESSAGE("yellow", - BColor(60,1,1), tools::rgb2hsv(maYellow)); + BColor(60,1,1), utils::rgb2hsv(maYellow)); CPPUNIT_ASSERT_EQUAL_MESSAGE("magenta", - BColor(300,1,1), tools::rgb2hsv(maMagenta)); + BColor(300,1,1), utils::rgb2hsv(maMagenta)); CPPUNIT_ASSERT_EQUAL_MESSAGE("cyan", - BColor(180,1,1), tools::rgb2hsv(maCyan)); + BColor(180,1,1), utils::rgb2hsv(maCyan)); CPPUNIT_ASSERT_EQUAL_MESSAGE("roundtrip white", - maWhite, tools::hsv2rgb(tools::rgb2hsv(maWhite))); + maWhite, utils::hsv2rgb(utils::rgb2hsv(maWhite))); CPPUNIT_ASSERT_EQUAL_MESSAGE("roundtrip black", - maBlack, tools::hsv2rgb(tools::rgb2hsv(maBlack))); + maBlack, utils::hsv2rgb(utils::rgb2hsv(maBlack))); CPPUNIT_ASSERT_EQUAL_MESSAGE("roundtrip red", - maRed, tools::hsv2rgb(tools::rgb2hsv(maRed))); + maRed, utils::hsv2rgb(utils::rgb2hsv(maRed))); CPPUNIT_ASSERT_EQUAL_MESSAGE("roundtrip green", - maGreen, tools::hsv2rgb(tools::rgb2hsv(maGreen))); + maGreen, utils::hsv2rgb(utils::rgb2hsv(maGreen))); CPPUNIT_ASSERT_EQUAL_MESSAGE("roundtrip blue", - maBlue, tools::hsv2rgb(tools::rgb2hsv(maBlue))); + maBlue, utils::hsv2rgb(utils::rgb2hsv(maBlue))); CPPUNIT_ASSERT_EQUAL_MESSAGE("roundtrip yellow", - maYellow, tools::hsv2rgb(tools::rgb2hsv(maYellow))); + maYellow, utils::hsv2rgb(utils::rgb2hsv(maYellow))); CPPUNIT_ASSERT_EQUAL_MESSAGE("roundtrip magenta", - maMagenta, tools::hsv2rgb(tools::rgb2hsv(maMagenta))); + maMagenta, utils::hsv2rgb(utils::rgb2hsv(maMagenta))); CPPUNIT_ASSERT_EQUAL_MESSAGE("roundtrip cyan", - maCyan, tools::hsv2rgb(tools::rgb2hsv(maCyan))); + maCyan, utils::hsv2rgb(utils::rgb2hsv(maCyan))); CPPUNIT_ASSERT_EQUAL_MESSAGE("grey10", - BColor(0,0,.1), tools::rgb2hsv(maWhite*.1)); + BColor(0,0,.1), utils::rgb2hsv(maWhite*.1)); CPPUNIT_ASSERT_EQUAL_MESSAGE("grey90", - BColor(0,0,.9), tools::rgb2hsv(maWhite*.9)); + BColor(0,0,.9), utils::rgb2hsv(maWhite*.9)); CPPUNIT_ASSERT_EQUAL_MESSAGE("red/2", - BColor(0,1,0.5), tools::rgb2hsv(maRed*.5)); + BColor(0,1,0.5), utils::rgb2hsv(maRed*.5)); CPPUNIT_ASSERT_EQUAL_MESSAGE("green/2", - BColor(120,1,0.5), tools::rgb2hsv(maGreen*.5)); + BColor(120,1,0.5), utils::rgb2hsv(maGreen*.5)); CPPUNIT_ASSERT_EQUAL_MESSAGE("blue/2", - BColor(240,1,0.5), tools::rgb2hsv(maBlue*.5)); + BColor(240,1,0.5), utils::rgb2hsv(maBlue*.5)); CPPUNIT_ASSERT_EQUAL_MESSAGE("yellow/2", - BColor(60,1,0.5), tools::rgb2hsv(maYellow*.5)); + BColor(60,1,0.5), utils::rgb2hsv(maYellow*.5)); CPPUNIT_ASSERT_EQUAL_MESSAGE("magenta/2", - BColor(300,1,0.5), tools::rgb2hsv(maMagenta*.5)); + BColor(300,1,0.5), utils::rgb2hsv(maMagenta*.5)); CPPUNIT_ASSERT_EQUAL_MESSAGE("cyan/2", - BColor(180,1,0.5), tools::rgb2hsv(maCyan*.5)); + BColor(180,1,0.5), utils::rgb2hsv(maCyan*.5)); CPPUNIT_ASSERT_EQUAL_MESSAGE("pastel", - BColor(0,.5,.5), tools::rgb2hsv(BColor(.5,.25,.25))); + BColor(0,.5,.5), utils::rgb2hsv(BColor(.5,.25,.25))); } // Change the following lines only, if you add, remove or rename diff --git a/basegfx/test/basegfxtools.cxx b/basegfx/test/basegfxtools.cxx index e06ee194cf00..5a443358f39b 100644 --- a/basegfx/test/basegfxtools.cxx +++ b/basegfx/test/basegfxtools.cxx @@ -22,7 +22,7 @@ #include <cppunit/TestFixture.h> #include <cppunit/extensions/HelperMacros.h> -#include <basegfx/tools/keystoplerp.hxx> +#include <basegfx/utils/keystoplerp.hxx> #include <basegfx/numeric/ftools.hxx> using namespace ::basegfx; @@ -32,7 +32,7 @@ namespace basegfxtools class KeyStopLerpTest : public CppUnit::TestFixture { - tools::KeyStopLerp maKeyStops; + utils::KeyStopLerp maKeyStops; static std::vector<double> getTestVector() { diff --git a/basegfx/test/boxclipper.cxx b/basegfx/test/boxclipper.cxx index 5be8ebb1660d..5f9794a2235a 100644 --- a/basegfx/test/boxclipper.cxx +++ b/basegfx/test/boxclipper.cxx @@ -161,7 +161,7 @@ public: #else const char randomSvg[]="m394 783h404v57h-404zm-197-505h571v576h-571zm356-634h75v200h-75zm-40-113h403v588h-403zm93-811h111v494h-111zm-364-619h562v121h-562zm-134-8h292v27h-292zm110 356h621v486h-621zm78-386h228v25h-228zm475-345h201v201h-201zm-2-93h122v126h-122zm-417-243h567v524h-567zm-266-738h863v456h-863zm262-333h315v698h-315zm-328-826h43v393h-43zm830-219h120v664h-120zm-311-636h221v109h-221zm-500 137h628v19h-628zm681-94h211v493h-211zm-366-646h384v355h-384zm-189-199h715v247h-715zm165-459h563v601h-563zm258-479h98v606h-98zm270-517h65v218h-65zm-44-259h96v286h-96zm-599-202h705v468h-705zm216-803h450v494h-450zm-150-22h26v167h-26zm-55-599h50v260h-50zm190-278h490v387h-490zm-290-453h634v392h-634zm257 189h552v300h-552zm-151-690h136v455h-136zm12-597h488v432h-488zm501-459h48v39h-48zm-224-112h429v22h-429zm-281 102h492v621h-492zm519-158h208v17h-208zm-681-563h56v427h-56zm126-451h615v392h-615zm-47-410h598v522h-598zm-32 316h79v110h-79zm-71-129h18v127h-18zm126-993h743v589h-743zm211-430h428v750h-428zm61-554h100v220h-100zm-353-49h658v157h-658zm778-383h115v272h-115zm-249-541h119v712h-119zm203 86h94v40h-94z"; B2DPolyPolygon randomPoly; - tools::importFromSvgD(randomPoly, randomSvg, false, nullptr); + utils::importFromSvgD(randomPoly, randomSvg, false, nullptr); for (auto const& aPolygon : randomPoly) aRandomIntersections.appendElement(aPolygon.getB2DRange(), B2VectorOrientation::Negative); #endif @@ -173,10 +173,10 @@ public: for( sal_uInt32 i=0; i<rPoly.count(); ++i ) { B2DPolygon aTmp=rPoly.getB2DPolygon(i); - if( tools::getOrientation(aTmp) == B2VectorOrientation::Negative ) + if( utils::getOrientation(aTmp) == B2VectorOrientation::Negative ) aTmp.flip(); - aTmp=tools::removeNeutralPoints(aTmp); + aTmp=utils::removeNeutralPoints(aTmp); std::vector<B2DPoint> aTmp2(aTmp.count()); for(sal_uInt32 j=0; j<aTmp.count(); ++j) aTmp2[j] = aTmp.getB2DPoint(j); @@ -202,7 +202,7 @@ public: // boxclipper & generic clipper disagree slightly on area-less // polygons (one or two points only) - aRes = tools::stripNeutralPolygons(aRes); + aRes = utils::stripNeutralPolygons(aRes); // now, sort all polygons with increasing 0th point std::sort(aRes.begin(), @@ -218,14 +218,14 @@ public: { B2DPolyPolygon aTmp1; CPPUNIT_ASSERT_MESSAGE(sName, - tools::importFromSvgD( + utils::importFromSvgD( aTmp1, OUString::createFromAscii(sSvg), false, nullptr)); const OUString aSvg= - tools::exportToSvgD(toTest.solveCrossovers(), true, true, false); + utils::exportToSvgD(toTest.solveCrossovers(), true, true, false); B2DPolyPolygon aTmp2; CPPUNIT_ASSERT_MESSAGE(sName, - tools::importFromSvgD( + utils::importFromSvgD( aTmp2, aSvg, false, nullptr)); CPPUNIT_ASSERT_EQUAL_MESSAGE( @@ -299,7 +299,7 @@ public: #if OSL_DEBUG_LEVEL > 2 fprintf(stderr, "%s - svg:d=\"%s\"\n", pName, OUStringToOString( - basegfx::tools::exportToSvgD(rPoly, , true, true, false), + basegfx::utils::exportToSvgD(rPoly, , true, true, false), RTL_TEXTENCODING_UTF8).getStr() ); #endif } @@ -331,7 +331,7 @@ public: const sal_uInt32 nCount=rRange.count(); for( sal_uInt32 i=0; i<nCount; ++i ) { - B2DPolygon aRect=tools::createPolygonFromRect(std::get<0>(rRange.getElement(i))); + B2DPolygon aRect=utils::createPolygonFromRect(std::get<0>(rRange.getElement(i))); if( std::get<1>(rRange.getElement(i)) == B2VectorOrientation::Negative ) aRect.flip(); @@ -341,14 +341,14 @@ public: #if OSL_DEBUG_LEVEL > 2 fprintf(stderr, "%s input - svg:d=\"%s\"\n", pName, OUStringToOString( - basegfx::tools::exportToSvgD( + basegfx::utils::exportToSvgD( genericClip, , true, true, false), RTL_TEXTENCODING_UTF8).getStr() ); #endif const B2DPolyPolygon boxClipResult=rRange.solveCrossovers(); const OUString boxClipSvg( - basegfx::tools::exportToSvgD( + basegfx::utils::exportToSvgD( normalizePoly(boxClipResult), true, true, false)); #if OSL_DEBUG_LEVEL > 2 fprintf(stderr, "%s boxclipper - svg:d=\"%s\"\n", @@ -357,9 +357,9 @@ public: RTL_TEXTENCODING_UTF8).getStr() ); #endif - genericClip = tools::solveCrossovers(genericClip); + genericClip = utils::solveCrossovers(genericClip); const OUString genericClipSvg( - basegfx::tools::exportToSvgD( + basegfx::utils::exportToSvgD( normalizePoly(genericClip), true, true, false)); #if OSL_DEBUG_LEVEL > 2 fprintf(stderr, "%s genclipper - svg:d=\"%s\"\n", diff --git a/basegfx/test/clipstate.cxx b/basegfx/test/clipstate.cxx index 02618d61034c..898b616c57a5 100644 --- a/basegfx/test/clipstate.cxx +++ b/basegfx/test/clipstate.cxx @@ -22,7 +22,7 @@ #include <cppunit/TestFixture.h> #include <cppunit/extensions/HelperMacros.h> -#include <basegfx/tools/b2dclipstate.hxx> +#include <basegfx/utils/b2dclipstate.hxx> #include <basegfx/range/b2dpolyrange.hxx> #include <basegfx/polygon/b2dpolygon.hxx> #include <basegfx/polygon/b2dpolygontools.hxx> @@ -38,11 +38,11 @@ namespace basegfx2d class clipstate : public CppUnit::TestFixture { private: - tools::B2DClipState aUnion1; - tools::B2DClipState aUnion2; - tools::B2DClipState aIntersect; - tools::B2DClipState aXor; - tools::B2DClipState aSubtract; + utils::B2DClipState aUnion1; + utils::B2DClipState aUnion2; + utils::B2DClipState aIntersect; + utils::B2DClipState aXor; + utils::B2DClipState aSubtract; public: void setUp() override @@ -86,25 +86,25 @@ public: aSubtract.subtractRange(aEast); } - void verifyPoly(const char* sName, const char* sSvg, const tools::B2DClipState& toTest) + void verifyPoly(const char* sName, const char* sSvg, const utils::B2DClipState& toTest) { #if OSL_DEBUG_LEVEL > 2 fprintf(stderr, "%s - svg:d=\"%s\"\n", sName, OUStringToOString( - basegfx::tools::exportToSvgD(toTest.getClipPoly(), true, true, false), + basegfx::utils::exportToSvgD(toTest.getClipPoly(), true, true, false), RTL_TEXTENCODING_UTF8).getStr() ); #endif B2DPolyPolygon aTmp1; CPPUNIT_ASSERT_MESSAGE(sName, - tools::importFromSvgD( + utils::importFromSvgD( aTmp1, OUString::createFromAscii(sSvg), false, nullptr)); const OUString aSvg= - tools::exportToSvgD(toTest.getClipPoly(), true, true, false); + utils::exportToSvgD(toTest.getClipPoly(), true, true, false); B2DPolyPolygon aTmp2; CPPUNIT_ASSERT_MESSAGE(sName, - tools::importFromSvgD( + utils::importFromSvgD( aTmp2, aSvg, false, nullptr)); CPPUNIT_ASSERT_EQUAL_MESSAGE( @@ -130,12 +130,12 @@ public: void verifyMixedClips() { - tools::B2DClipState aMixedClip; + utils::B2DClipState aMixedClip; const char unionSvg[]="m100 10v90h-90v10h-20v-10h-90v-90h-10v-20h10v-90h90v-10h20v10h90v90h10v20z"; B2DPolyPolygon aTmp1; - tools::importFromSvgD(aTmp1, unionSvg, false, nullptr); + utils::importFromSvgD(aTmp1, unionSvg, false, nullptr); aMixedClip.intersectPolyPolygon(aTmp1); aMixedClip.subtractRange(B2DRange(-20,-150,20,0)); diff --git a/basegfx/test/genericclipper.cxx b/basegfx/test/genericclipper.cxx index a345b0eb3f0c..44aad203390b 100644 --- a/basegfx/test/genericclipper.cxx +++ b/basegfx/test/genericclipper.cxx @@ -59,7 +59,7 @@ public: aSelfIntersecting.append(B2DPoint(100,0)); aSelfIntersecting.setClosed(true); - aShiftedRectangle = tools::createPolygonFromRect( + aShiftedRectangle = utils::createPolygonFromRect( B2DRange(0,90,20,150)); } @@ -69,18 +69,18 @@ public: B2DPolyPolygon (*pFunc)(const B2DPolyPolygon&, const B2DPolyPolygon&)) { const B2DPolyPolygon aSelfIntersect( - tools::prepareForPolygonOperation(aSelfIntersecting)); + utils::prepareForPolygonOperation(aSelfIntersecting)); const B2DPolyPolygon aRect( - tools::prepareForPolygonOperation(aShiftedRectangle)); + utils::prepareForPolygonOperation(aShiftedRectangle)); #if OSL_DEBUG_LEVEL > 2 fprintf(stderr, "%s input LHS - svg:d=\"%s\"\n", pName, OUStringToOString( - basegfx::tools::exportToSvgD( + basegfx::utils::exportToSvgD( aSelfIntersect, true, true, false), RTL_TEXTENCODING_UTF8).getStr() ); fprintf(stderr, "%s input RHS - svg:d=\"%s\"\n", pName, OUStringToOString( - basegfx::tools::exportToSvgD( + basegfx::utils::exportToSvgD( aRect, true, true, false), RTL_TEXTENCODING_UTF8).getStr() ); #endif @@ -91,38 +91,38 @@ public: #if OSL_DEBUG_LEVEL > 2 fprintf(stderr, "%s - svg:d=\"%s\"\n", pName, OUStringToOString( - basegfx::tools::exportToSvgD(aRes, true, true, false), + basegfx::utils::exportToSvgD(aRes, true, true, false), RTL_TEXTENCODING_UTF8).getStr() ); #endif OUString aValid=OUString::createFromAscii(pValidSvgD); CPPUNIT_ASSERT_EQUAL_MESSAGE(pName, - aValid, basegfx::tools::exportToSvgD(aRes, true, true, false)); + aValid, basegfx::utils::exportToSvgD(aRes, true, true, false)); } void validateOr() { const char* const pValid="m0 0h100v150h-75v-50h-5v50h-20v-50-10zm75 100v-50h-50v50z"; - validate("validateOr", pValid, &tools::solvePolygonOperationOr); + validate("validateOr", pValid, &utils::solvePolygonOperationOr); } void validateXor() { const char* const pValid="m0 0h100v150h-75v-50h-5v50h-20v-50-10zm0 100h20v-10h-20zm75 0v-50h-50v50z"; - validate("validateXor", pValid, &tools::solvePolygonOperationXor); + validate("validateXor", pValid, &utils::solvePolygonOperationXor); } void validateAnd() { const char* const pValid="m0 100v-10h20v10z"; - validate("validateAnd", pValid, &tools::solvePolygonOperationAnd); + validate("validateAnd", pValid, &utils::solvePolygonOperationAnd); } void validateDiff() { const char* const pValid="m0 90v-90h100v150h-75v-50h-5v-10zm75 10v-50h-50v50z"; - validate("validateDiff", pValid, &tools::solvePolygonOperationDiff); + validate("validateDiff", pValid, &utils::solvePolygonOperationDiff); } void validateCrossover(const char* pName, @@ -133,14 +133,14 @@ public: OUString aValid=OUString::createFromAscii(pValidSvgD); B2DPolyPolygon aInputPoly, aValidPoly; - tools::importFromSvgD(aInputPoly, aInput, false, nullptr); - tools::importFromSvgD(aValidPoly, aValid, false, nullptr); + utils::importFromSvgD(aInputPoly, aInput, false, nullptr); + utils::importFromSvgD(aValidPoly, aValid, false, nullptr); CPPUNIT_ASSERT_EQUAL_MESSAGE( pName, aValid, - basegfx::tools::exportToSvgD( - tools::solveCrossovers(aInputPoly), true, true, false)); + basegfx::utils::exportToSvgD( + utils::solveCrossovers(aInputPoly), true, true, false)); } void checkCrossoverSolver() |