diff options
author | Thorsten Behrens <thb@openoffice.org> | 2004-01-16 09:34:43 +0000 |
---|---|---|
committer | Thorsten Behrens <thb@openoffice.org> | 2004-01-16 09:34:43 +0000 |
commit | fb6fefbd9482f6fa26447be417286ae1935c0702 (patch) | |
tree | df3b1b957f17a5f70a83b705865b4c1291b1f382 /basegfx/source/polygon | |
parent | 08761ff6d5991730ed66b7e13817b325ce848da3 (diff) |
#110496# Added integer point, size and rectangle classes, needed for the new canvas
Diffstat (limited to 'basegfx/source/polygon')
-rw-r--r-- | basegfx/source/polygon/b2dpolygon.cxx | 72 | ||||
-rw-r--r-- | basegfx/source/polygon/b2dpolygontools.cxx | 324 | ||||
-rw-r--r-- | basegfx/source/polygon/b2dpolypolygon.cxx | 44 | ||||
-rw-r--r-- | basegfx/source/polygon/b2dpolypolygoncutter.cxx | 166 | ||||
-rw-r--r-- | basegfx/source/polygon/b2dpolypolygontools.cxx | 64 | ||||
-rw-r--r-- | basegfx/source/polygon/b3dpolygon.cxx | 42 | ||||
-rw-r--r-- | basegfx/source/polygon/b3dpolygontools.cxx | 20 | ||||
-rw-r--r-- | basegfx/source/polygon/b3dpolypolygon.cxx | 38 |
8 files changed, 385 insertions, 385 deletions
diff --git a/basegfx/source/polygon/b2dpolygon.cxx b/basegfx/source/polygon/b2dpolygon.cxx index 0dcbeaa7a3a2..0c2c921dd64a 100644 --- a/basegfx/source/polygon/b2dpolygon.cxx +++ b/basegfx/source/polygon/b2dpolygon.cxx @@ -2,9 +2,9 @@ * * $RCSfile: b2dpolygon.cxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: aw $ $Date: 2003-11-28 11:18:05 $ + * last change: $Author: thb $ $Date: 2004-01-16 10:34:32 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -95,7 +95,7 @@ public: const ::basegfx::B2DPoint& getCoordinate() const { return maPoint; } void setCoordinate(const ::basegfx::B2DPoint& rValue) { if(rValue != maPoint) maPoint = rValue; } - sal_Bool operator==(const CoordinateData2D& rData ) const { return (maPoint == rData.getCoordinate()); } + bool operator==(const CoordinateData2D& rData ) const { return (maPoint == rData.getCoordinate()); } void transform(const ::basegfx::B2DHomMatrix& rMatrix) { maPoint *= rMatrix; } }; @@ -132,7 +132,7 @@ public: return maVector.size(); } - sal_Bool isEqual(const CoordinateDataArray2D& rCandidate) const + bool isEqual(const CoordinateDataArray2D& rCandidate) const { return (maVector == rCandidate.maVector); } @@ -262,7 +262,7 @@ public: const ::basegfx::B2DVector& getVectorB() const { return maVectorB; } void setVectorB(const ::basegfx::B2DVector& rValue) { if(rValue != maVectorB) maVectorB = rValue; } - sal_Bool operator==(const ControlVectorPair2D& rData ) const + bool operator==(const ControlVectorPair2D& rData ) const { return (maVectorA == rData.getVectorA() && maVectorB == rData.getVectorB()); } }; @@ -319,12 +319,12 @@ public: return maVector.size(); } - sal_Bool isEqual(const ControlVectorArray2D& rCandidate) const + bool isEqual(const ControlVectorArray2D& rCandidate) const { return (maVector == rCandidate.maVector); } - sal_Bool isUsed() const + bool isUsed() const { return (0L != mnUsedVectors); } @@ -336,8 +336,8 @@ public: void setVectorA(sal_uInt32 nIndex, const ::basegfx::B2DVector& rValue) { - sal_Bool bWasUsed(mnUsedVectors && !maVector[nIndex].getVectorA().equalZero()); - sal_Bool bIsUsed(!rValue.equalZero()); + bool bWasUsed(mnUsedVectors && !maVector[nIndex].getVectorA().equalZero()); + bool bIsUsed(!rValue.equalZero()); if(bWasUsed) { @@ -368,8 +368,8 @@ public: void setVectorB(sal_uInt32 nIndex, const ::basegfx::B2DVector& rValue) { - sal_Bool bWasUsed(mnUsedVectors && !maVector[nIndex].getVectorB().equalZero()); - sal_Bool bIsUsed(!rValue.equalZero()); + bool bWasUsed(mnUsedVectors && !maVector[nIndex].getVectorB().equalZero()); + bool bIsUsed(!rValue.equalZero()); if(bWasUsed) { @@ -483,7 +483,7 @@ public: : mnRefCount(1), maPoints(0L), mpControlVector(0L), - mbIsClosed(sal_False) + mbIsClosed(false) { // complete initialization with defaults } @@ -549,12 +549,12 @@ public: return maPoints.count(); } - sal_Bool isClosed() const + bool isClosed() const { return mbIsClosed; } - void setClosed(sal_Bool bNew) + void setClosed(bool bNew) { if(bNew != mbIsClosed) { @@ -562,13 +562,13 @@ public: } } - sal_Bool isEqual(const ImplB2DPolygon& rCandidate) const + bool isEqual(const ImplB2DPolygon& rCandidate) const { if(mbIsClosed == rCandidate.mbIsClosed) { if(maPoints.isEqual(rCandidate.maPoints)) { - sal_Bool bControlVectorsAreEqual(sal_True); + bool bControlVectorsAreEqual(true); if(mpControlVector) { @@ -593,12 +593,12 @@ public: if(bControlVectorsAreEqual) { - return sal_True; + return true; } } } - return sal_False; + return false; } const ::basegfx::B2DPoint& getPoint(sal_uInt32 nIndex) const @@ -660,7 +660,7 @@ public: } } - sal_Bool areControlPointsUsed() const + bool areControlPointsUsed() const { return (mpControlVector && mpControlVector->isUsed()); } @@ -821,7 +821,7 @@ public: } } - sal_Bool hasDoublePoints() const + bool hasDoublePoints() const { if(mbIsClosed) { @@ -835,12 +835,12 @@ public: if(mpControlVector->getVectorA(nIndex).equalZero() && mpControlVector->getVectorB(nIndex).equalZero()) { - return sal_True; + return true; } } else { - return sal_True; + return true; } } } @@ -855,17 +855,17 @@ public: if(mpControlVector->getVectorA(a).equalZero() && mpControlVector->getVectorB(a).equalZero()) { - return sal_True; + return true; } } else { - return sal_True; + return true; } } } - return sal_False; + return false; } void removeDoublePointsAtBeginEnd() @@ -875,11 +875,11 @@ public: { if(mpControlVector) { - sal_Bool bRemove; + bool bRemove; do { - bRemove = sal_False; + bRemove = false; if(maPoints.count() > 1L) { @@ -890,7 +890,7 @@ public: if(mpControlVector->getVectorA(nIndex).equalZero() && mpControlVector->getVectorB(nIndex).equalZero()) { - bRemove = sal_True; + bRemove = true; } } } @@ -1045,21 +1045,21 @@ namespace basegfx return *this; } - sal_Bool B2DPolygon::operator==(const B2DPolygon& rPolygon) const + bool B2DPolygon::operator==(const B2DPolygon& rPolygon) const { if(mpPolygon == rPolygon.mpPolygon) { - return sal_True; + return true; } return mpPolygon->isEqual(*(rPolygon.mpPolygon)); } - sal_Bool B2DPolygon::operator!=(const B2DPolygon& rPolygon) const + bool B2DPolygon::operator!=(const B2DPolygon& rPolygon) const { if(mpPolygon == rPolygon.mpPolygon) { - return sal_False; + return false; } return !mpPolygon->isEqual(*(rPolygon.mpPolygon)); @@ -1144,7 +1144,7 @@ namespace basegfx } } - sal_Bool B2DPolygon::areControlPointsUsed() const + bool B2DPolygon::areControlPointsUsed() const { return mpPolygon->areControlPointsUsed(); } @@ -1225,12 +1225,12 @@ namespace basegfx mpPolygon->incRefCount(); } - sal_Bool B2DPolygon::isClosed() const + bool B2DPolygon::isClosed() const { return mpPolygon->isClosed(); } - void B2DPolygon::setClosed(sal_Bool bNew) + void B2DPolygon::setClosed(bool bNew) { if(mpPolygon->isClosed() != bNew) { @@ -1248,7 +1248,7 @@ namespace basegfx } } - sal_Bool B2DPolygon::hasDoublePoints() const + bool B2DPolygon::hasDoublePoints() const { return mpPolygon->hasDoublePoints(); } diff --git a/basegfx/source/polygon/b2dpolygontools.cxx b/basegfx/source/polygon/b2dpolygontools.cxx index 6f5ef6e89fba..a15ede36e987 100644 --- a/basegfx/source/polygon/b2dpolygontools.cxx +++ b/basegfx/source/polygon/b2dpolygontools.cxx @@ -2,9 +2,9 @@ * * $RCSfile: b2dpolygontools.cxx,v $ * - * $Revision: 1.9 $ + * $Revision: 1.10 $ * - * last change: $Author: aw $ $Date: 2003-11-28 11:18:05 $ + * last change: $Author: thb $ $Date: 2004-01-16 10:34:32 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -103,32 +103,32 @@ namespace basegfx while(rCandidate.count() > 1L && rCandidate.getB2DPoint(0L).equal(rCandidate.getB2DPoint(rCandidate.count() - 1L))) { - rCandidate.setClosed(sal_True); + rCandidate.setClosed(true); rCandidate.remove(rCandidate.count() - 1L); } } // Get index of outmost point (e.g. biggest X and biggest Y) - sal_uInt32 getIndexOfOutmostPoint(const ::basegfx::B2DPolygon& rCandidate) + sal_uInt32 getIndexOfOutmostPoint(const B2DPolygon& rCandidate) { sal_uInt32 nRetval(0L); if(rCandidate.count()) { - ::basegfx::B2DPoint aOutmostPoint(rCandidate.getB2DPoint(0L)); + B2DPoint aOutmostPoint(rCandidate.getB2DPoint(0L)); for(sal_uInt32 a(1L); a < rCandidate.count(); a++) { - ::basegfx::B2DPoint rPoint(rCandidate.getB2DPoint(a)); + B2DPoint rPoint(rCandidate.getB2DPoint(a)); - if(::basegfx::fTools::more(rPoint.getX(), aOutmostPoint.getX())) + if(fTools::more(rPoint.getX(), aOutmostPoint.getX())) { nRetval = a; aOutmostPoint = rPoint; } else { - if(::basegfx::fTools::more(rPoint.getY(), aOutmostPoint.getY())) + if(fTools::more(rPoint.getY(), aOutmostPoint.getY())) { nRetval = a; aOutmostPoint = rPoint; @@ -142,7 +142,7 @@ namespace basegfx // Get successor and predecessor indices. Returning the same index means there // is none. Same for successor. - sal_uInt32 getIndexOfPredecessor(sal_uInt32 nIndex, const ::basegfx::B2DPolygon& rCandidate) + sal_uInt32 getIndexOfPredecessor(sal_uInt32 nIndex, const B2DPolygon& rCandidate) { OSL_ENSURE(nIndex < rCandidate.count(), "getIndexOfPredecessor: Access to polygon out of range (!)"); @@ -160,7 +160,7 @@ namespace basegfx } } - sal_uInt32 getIndexOfSuccessor(sal_uInt32 nIndex, const ::basegfx::B2DPolygon& rCandidate) + sal_uInt32 getIndexOfSuccessor(sal_uInt32 nIndex, const B2DPolygon& rCandidate) { OSL_ENSURE(nIndex < rCandidate.count(), "getIndexOfPredecessor: Access to polygon out of range (!)"); @@ -174,7 +174,7 @@ namespace basegfx } } - sal_uInt32 getIndexOfDifferentPredecessor(sal_uInt32 nIndex, const ::basegfx::B2DPolygon& rCandidate) + sal_uInt32 getIndexOfDifferentPredecessor(sal_uInt32 nIndex, const B2DPolygon& rCandidate) { sal_uInt32 nNewIndex(nIndex); OSL_ENSURE(nIndex < rCandidate.count(), "getIndexOfPredecessor: Access to polygon out of range (!)"); @@ -182,7 +182,7 @@ namespace basegfx if(rCandidate.count() > 1) { nNewIndex = getIndexOfPredecessor(nIndex, rCandidate); - ::basegfx::B2DPoint aPoint(rCandidate.getB2DPoint(nIndex)); + B2DPoint aPoint(rCandidate.getB2DPoint(nIndex)); while(nNewIndex != nIndex && aPoint.equal(rCandidate.getB2DPoint(nNewIndex))) @@ -194,7 +194,7 @@ namespace basegfx return nNewIndex; } - sal_uInt32 getIndexOfDifferentSuccessor(sal_uInt32 nIndex, const ::basegfx::B2DPolygon& rCandidate) + sal_uInt32 getIndexOfDifferentSuccessor(sal_uInt32 nIndex, const B2DPolygon& rCandidate) { sal_uInt32 nNewIndex(nIndex); OSL_ENSURE(nIndex < rCandidate.count(), "getIndexOfPredecessor: Access to polygon out of range (!)"); @@ -202,7 +202,7 @@ namespace basegfx if(rCandidate.count() > 1) { nNewIndex = getIndexOfSuccessor(nIndex, rCandidate); - ::basegfx::B2DPoint aPoint(rCandidate.getB2DPoint(nIndex)); + B2DPoint aPoint(rCandidate.getB2DPoint(nIndex)); while(nNewIndex != nIndex && aPoint.equal(rCandidate.getB2DPoint(nNewIndex))) @@ -214,9 +214,9 @@ namespace basegfx return nNewIndex; } - ::basegfx::B2DVectorOrientation getOrientation(const ::basegfx::B2DPolygon& rCandidate) + B2VectorOrientation getOrientation(const B2DPolygon& rCandidate) { - ::basegfx::B2DVectorOrientation eRetval(::basegfx::ORIENTATION_NEUTRAL); + B2VectorOrientation eRetval(ORIENTATION_NEUTRAL); if(rCandidate.count() > 2) { @@ -227,26 +227,26 @@ namespace basegfx return eRetval; } - ::basegfx::B2DVectorContinuity getContinuityInPoint(const ::basegfx::B2DPolygon& rCandidate, sal_uInt32 nIndex) + B2VectorContinuity getContinuityInPoint(const B2DPolygon& rCandidate, sal_uInt32 nIndex) { OSL_ENSURE(nIndex < rCandidate.count(), "getIndexOfPredecessor: Access to polygon out of range (!)"); - ::basegfx::B2DVectorContinuity eRetval(::basegfx::CONTINUITY_NONE); + B2VectorContinuity eRetval(CONTINUITY_NONE); if(rCandidate.count() > 1L && rCandidate.areControlPointsUsed()) { sal_uInt32 nPrevInd(getIndexOfPredecessor(nIndex, rCandidate)); - const ::basegfx::B2DVector aForwardVector(rCandidate.getControlVectorA(nIndex)); - const ::basegfx::B2DVector aBackVector(rCandidate.getControlVectorB(nPrevInd)); + const B2DVector aForwardVector(rCandidate.getControlVectorA(nIndex)); + const B2DVector aBackVector(rCandidate.getControlVectorB(nPrevInd)); - eRetval = ::basegfx::getContinuity(aBackVector, aForwardVector); + eRetval = getContinuity(aBackVector, aForwardVector); } return eRetval; } - ::basegfx::B2DPolygon adaptiveSubdivideByDistance(const ::basegfx::B2DPolygon& rCandidate, double fDistanceBound) + B2DPolygon adaptiveSubdivideByDistance(const B2DPolygon& rCandidate, double fDistanceBound) { - ::basegfx::B2DPolygon aRetval(rCandidate); + B2DPolygon aRetval(rCandidate); if(aRetval.areControlPointsUsed()) { @@ -255,19 +255,19 @@ namespace basegfx for(sal_uInt32 a(0L); a < nPointCount; a++) { - const ::basegfx::B2DVector aVectorA(rCandidate.getControlVectorA(a)); - const ::basegfx::B2DVector aVectorB(rCandidate.getControlVectorB(a)); + const B2DVector aVectorA(rCandidate.getControlVectorA(a)); + const B2DVector aVectorB(rCandidate.getControlVectorB(a)); if(!aVectorA.equalZero() || !aVectorB.equalZero()) { // vectors are used, get points const sal_uInt32 nNext(getIndexOfSuccessor(a, rCandidate)); - ::basegfx::B2DPoint aPointA(rCandidate.getB2DPoint(a)); - ::basegfx::B2DPoint aPointB(rCandidate.getB2DPoint(nNext)); + B2DPoint aPointA(rCandidate.getB2DPoint(a)); + B2DPoint aPointB(rCandidate.getB2DPoint(nNext)); // build CubicBezier segment - ::basegfx::B2DCubicBezier aBezier( - aPointA, aPointA + aVectorA, aPointB + aVectorB, aPointB); + B2DCubicBezier aBezier( + aPointA, B2DPoint(aPointA + aVectorA), B2DPoint(aPointB + aVectorB), aPointB); // generate DistanceBound double fBound; @@ -276,8 +276,8 @@ namespace basegfx { // If not set, calculate rough length of bezier segment by taking // half of the sum of the edge and the control polygon - ::basegfx::B2DVector aSimpleDistance(aPointB - aPointA); - ::basegfx::B2DVector aTripleDistanceTop((aPointB + aVectorB) - (aPointA + aVectorA)); + B2DVector aSimpleDistance(aPointB - aPointA); + B2DVector aTripleDistanceTop((aPointB + aVectorB) - (aPointA + aVectorA)); const double fRoughLength( (aSimpleDistance.getLength() + (aVectorA.getLength() + aVectorB.getLength() + aTripleDistanceTop.getLength())) / 2.0); @@ -318,9 +318,9 @@ namespace basegfx return aRetval; } - ::basegfx::B2DPolygon adaptiveSubdivideByAngle(const ::basegfx::B2DPolygon& rCandidate, double fAngleBound) + B2DPolygon adaptiveSubdivideByAngle(const B2DPolygon& rCandidate, double fAngleBound) { - ::basegfx::B2DPolygon aRetval(rCandidate); + B2DPolygon aRetval(rCandidate); if(aRetval.areControlPointsUsed()) { @@ -329,25 +329,25 @@ namespace basegfx for(sal_uInt32 a(0L); a < nPointCount; a++) { - const ::basegfx::B2DVector aVectorA(rCandidate.getControlVectorA(a)); - const ::basegfx::B2DVector aVectorB(rCandidate.getControlVectorB(a)); + const B2DVector aVectorA(rCandidate.getControlVectorA(a)); + const B2DVector aVectorB(rCandidate.getControlVectorB(a)); if(!aVectorA.equalZero() || !aVectorB.equalZero()) { // vectors are used, get points const sal_uInt32 nNext(getIndexOfSuccessor(a, rCandidate)); - ::basegfx::B2DPoint aPointA(rCandidate.getB2DPoint(a)); - ::basegfx::B2DPoint aPointB(rCandidate.getB2DPoint(nNext)); + B2DPoint aPointA(rCandidate.getB2DPoint(a)); + B2DPoint aPointB(rCandidate.getB2DPoint(nNext)); // build CubicBezier segment - ::basegfx::B2DCubicBezier aBezier( - aPointA, aPointA + aVectorA, aPointB + aVectorB, aPointB); + B2DCubicBezier aBezier( + aPointA, B2DPoint(aPointA + aVectorA), B2DPoint(aPointB + aVectorB), aPointB); // generate AngleBound double fBound(fAngleBound); // make sure angle bound is not too small - if(::basegfx::fTools::less(fAngleBound, 0.1)) + if(fTools::less(fAngleBound, 0.1)) { fAngleBound = 0.1; } @@ -372,29 +372,29 @@ namespace basegfx return aRetval; } - sal_Bool isInside(const ::basegfx::B2DPolygon& rCandidate, const ::basegfx::B2DPoint& rPoint, sal_Bool bWithBorder) + bool isInside(const B2DPolygon& rCandidate, const B2DPoint& rPoint, bool bWithBorder) { - sal_Bool bRetval(sal_False); + bool bRetval(false); const sal_uInt32 nPointCount(rCandidate.count()); for(sal_uInt32 a(0L); a < nPointCount; a++) { - const ::basegfx::B2DPoint aCurrentPoint(rCandidate.getB2DPoint(a)); + const B2DPoint aCurrentPoint(rCandidate.getB2DPoint(a)); if(bWithBorder && aCurrentPoint.equal(rPoint)) { - return sal_True; + return true; } // cross-over in Y? - const ::basegfx::B2DPoint aPreviousPoint(rCandidate.getB2DPoint((!a) ? nPointCount - 1L : a - 1L)); - const sal_Bool bCompYA(::basegfx::fTools::more(aPreviousPoint.getY(), rPoint.getY())); - const sal_Bool bCompYB(::basegfx::fTools::more(aCurrentPoint.getY(), rPoint.getY())); + const B2DPoint aPreviousPoint(rCandidate.getB2DPoint((!a) ? nPointCount - 1L : a - 1L)); + const bool bCompYA(fTools::more(aPreviousPoint.getY(), rPoint.getY())); + const bool bCompYB(fTools::more(aCurrentPoint.getY(), rPoint.getY())); if(bCompYA != bCompYB) { - const sal_Bool bCompXA(::basegfx::fTools::more(aPreviousPoint.getX(), rPoint.getX())); - const sal_Bool bCompXB(::basegfx::fTools::more(aCurrentPoint.getX(), rPoint.getX())); + const bool bCompXA(fTools::more(aPreviousPoint.getX(), rPoint.getX())); + const bool bCompXB(fTools::more(aCurrentPoint.getX(), rPoint.getX())); if(bCompXA == bCompXB) { @@ -410,11 +410,11 @@ namespace basegfx (aPreviousPoint.getX() - aCurrentPoint.getX()) / (aPreviousPoint.getY() - aCurrentPoint.getY()); - if(bWithBorder && ::basegfx::fTools::more(fCompare, rPoint.getX())) + if(bWithBorder && fTools::more(fCompare, rPoint.getX())) { bRetval = !bRetval; } - else if(::basegfx::fTools::moreOrEqual(fCompare, rPoint.getX())) + else if(fTools::moreOrEqual(fCompare, rPoint.getX())) { bRetval = !bRetval; } @@ -425,35 +425,35 @@ namespace basegfx return bRetval; } - sal_Bool isInside(const ::basegfx::B2DPolygon& rCandidate, const ::basegfx::B2DPolygon& rPolygon, sal_Bool bWithBorder) + bool isInside(const B2DPolygon& rCandidate, const B2DPolygon& rPolygon, bool bWithBorder) { const sal_uInt32 nPointCount(rPolygon.count()); for(sal_uInt32 a(0L); a < nPointCount; a++) { - const ::basegfx::B2DPoint aTestPoint(rPolygon.getB2DPoint(a)); + const B2DPoint aTestPoint(rPolygon.getB2DPoint(a)); if(!isInside(rCandidate, aTestPoint, bWithBorder)) { - return sal_False; + return false; } } - return sal_True; + return true; } - ::basegfx::B2DRange getRange(const ::basegfx::B2DPolygon& rCandidate) + B2DRange getRange(const B2DPolygon& rCandidate) { - ::basegfx::B2DRange aRetval; + B2DRange aRetval; const sal_uInt32 nPointCount(rCandidate.count()); if(rCandidate.areControlPointsUsed()) { for(sal_uInt32 a(0L); a < nPointCount; a++) { - const ::basegfx::B2DPoint aTestPoint(rCandidate.getB2DPoint(a)); - const ::basegfx::B2DVector aVectorA(rCandidate.getControlVectorA(a)); - const ::basegfx::B2DVector aVectorB(rCandidate.getControlVectorB(a)); + const B2DPoint aTestPoint(rCandidate.getB2DPoint(a)); + const B2DVector aVectorA(rCandidate.getControlVectorA(a)); + const B2DVector aVectorB(rCandidate.getControlVectorB(a)); aRetval.expand(aTestPoint); if(!aVectorA.equalZero()) @@ -464,7 +464,7 @@ namespace basegfx if(!aVectorB.equalZero()) { const sal_uInt32 nNextIndex(getIndexOfSuccessor(a, rCandidate)); - const ::basegfx::B2DPoint aNextPoint(rCandidate.getB2DPoint(nNextIndex)); + const B2DPoint aNextPoint(rCandidate.getB2DPoint(nNextIndex)); aRetval.expand(aNextPoint + aVectorB); } } @@ -473,7 +473,7 @@ namespace basegfx { for(sal_uInt32 a(0L); a < nPointCount; a++) { - const ::basegfx::B2DPoint aTestPoint(rCandidate.getB2DPoint(a)); + const B2DPoint aTestPoint(rCandidate.getB2DPoint(a)); aRetval.expand(aTestPoint); } } @@ -481,7 +481,7 @@ namespace basegfx return aRetval; } - double getArea(const ::basegfx::B2DPolygon& rCandidate) + double getArea(const B2DPolygon& rCandidate) { double fRetval(0.0); const sal_uInt32 nPointCount(rCandidate.count()); @@ -490,8 +490,8 @@ namespace basegfx { for(sal_uInt32 a(0L); a < nPointCount; a++) { - const ::basegfx::B2DPoint aPreviousPoint(rCandidate.getB2DPoint((!a) ? nPointCount - 1L : a - 1L)); - const ::basegfx::B2DPoint aCurrentPoint(rCandidate.getB2DPoint(a)); + const B2DPoint aPreviousPoint(rCandidate.getB2DPoint((!a) ? nPointCount - 1L : a - 1L)); + const B2DPoint aCurrentPoint(rCandidate.getB2DPoint(a)); fRetval += aPreviousPoint.getX() * aCurrentPoint.getY(); fRetval -= aPreviousPoint.getY() * aCurrentPoint.getX(); @@ -501,7 +501,7 @@ namespace basegfx const double fZero(0.0); - if(::basegfx::fTools::less(fRetval, fZero)) + if(fTools::less(fRetval, fZero)) { fRetval = -fRetval; } @@ -510,7 +510,7 @@ namespace basegfx return fRetval; } - double getEdgeLength(const ::basegfx::B2DPolygon& rCandidate, sal_uInt32 nIndex) + double getEdgeLength(const B2DPolygon& rCandidate, sal_uInt32 nIndex) { OSL_ENSURE(nIndex < rCandidate.count(), "getIndexOfPredecessor: Access to polygon out of range (!)"); double fRetval(0.0); @@ -521,9 +521,9 @@ namespace basegfx if(rCandidate.isClosed() || nIndex + 1 != nPointCount) { const sal_uInt32 nNextIndex(nIndex + 1 == nPointCount ? 0L : nIndex + 1L); - const ::basegfx::B2DPoint aCurrentPoint(rCandidate.getB2DPoint(nIndex)); - const ::basegfx::B2DPoint aNextPoint(rCandidate.getB2DPoint(nNextIndex)); - const ::basegfx::B2DVector aVector(aNextPoint - aCurrentPoint); + const B2DPoint aCurrentPoint(rCandidate.getB2DPoint(nIndex)); + const B2DPoint aNextPoint(rCandidate.getB2DPoint(nNextIndex)); + const B2DVector aVector(aNextPoint - aCurrentPoint); fRetval = aVector.getLength(); } } @@ -531,7 +531,7 @@ namespace basegfx return fRetval; } - double getLength(const ::basegfx::B2DPolygon& rCandidate) + double getLength(const B2DPolygon& rCandidate) { // This method may also be implemented using a loop over getEdgeLength, but // since this would cause a lot of sqare roots to be solved it is much better @@ -543,17 +543,17 @@ namespace basegfx for(sal_uInt32 a(0L); a < nLoopCount; a++) { const sal_uInt32 nNextIndex(a + 1 == nPointCount ? 0L : a + 1L); - const ::basegfx::B2DPoint aCurrentPoint(rCandidate.getB2DPoint(a)); - const ::basegfx::B2DPoint aNextPoint(rCandidate.getB2DPoint(nNextIndex)); - const ::basegfx::B2DVector aVector(aNextPoint - aCurrentPoint); + const B2DPoint aCurrentPoint(rCandidate.getB2DPoint(a)); + const B2DPoint aNextPoint(rCandidate.getB2DPoint(nNextIndex)); + const B2DVector aVector(aNextPoint - aCurrentPoint); fRetval += aVector.scalar(aVector); } - if(!::basegfx::fTools::equalZero(fRetval)) + if(!fTools::equalZero(fRetval)) { const double fOne(1.0); - if(!::basegfx::fTools::equal(fOne, fRetval)) + if(!fTools::equal(fOne, fRetval)) { fRetval = sqrt(fRetval); } @@ -562,26 +562,26 @@ namespace basegfx return fRetval; } - ::basegfx::B2DPoint getPositionAbsolute(const ::basegfx::B2DPolygon& rCandidate, double fDistance, double fLength) + B2DPoint getPositionAbsolute(const B2DPolygon& rCandidate, double fDistance, double fLength) { - ::basegfx::B2DPoint aRetval; + B2DPoint aRetval; const sal_uInt32 nPointCount(rCandidate.count()); if(nPointCount > 1L) { sal_uInt32 nIndex(0L); - sal_Bool bIndexDone(sal_False); + bool bIndexDone(false); const double fZero(0.0); double fEdgeLength(fZero); // get length if not given - if(::basegfx::fTools::equalZero(fLength)) + if(fTools::equalZero(fLength)) { fLength = getLength(rCandidate); } // handle fDistance < 0.0 - if(::basegfx::fTools::less(fDistance, fZero)) + if(fTools::less(fDistance, fZero)) { if(rCandidate.isClosed()) { @@ -593,12 +593,12 @@ namespace basegfx { // crop to polygon start fDistance = fZero; - bIndexDone = sal_True; + bIndexDone = true; } } // handle fDistance >= fLength - if(::basegfx::fTools::moreOrEqual(fDistance, fLength)) + if(fTools::moreOrEqual(fDistance, fLength)) { if(rCandidate.isClosed()) { @@ -611,7 +611,7 @@ namespace basegfx // crop to polygon end fDistance = fZero; nIndex = nPointCount - 1L; - bIndexDone = sal_True; + bIndexDone = true; } } @@ -623,7 +623,7 @@ namespace basegfx // get length of next edge fEdgeLength = getEdgeLength(rCandidate, nIndex); - if(::basegfx::fTools::moreOrEqual(fDistance, fEdgeLength)) + if(fTools::moreOrEqual(fDistance, fEdgeLength)) { // go to next edge fDistance -= fEdgeLength; @@ -632,7 +632,7 @@ namespace basegfx else { // it's on this edge, stop - bIndexDone = sal_True; + bIndexDone = true; } } while (!bIndexDone); } @@ -642,29 +642,29 @@ namespace basegfx // if fDistance != 0.0, move that length on the edge. The edge // length is in fEdgeLength. - if(!::basegfx::fTools::equalZero(fDistance)) + if(!fTools::equalZero(fDistance)) { sal_uInt32 nNextIndex(getIndexOfSuccessor(nIndex, rCandidate)); - const ::basegfx::B2DPoint aNextPoint(rCandidate.getB2DPoint(nNextIndex)); + const B2DPoint aNextPoint(rCandidate.getB2DPoint(nNextIndex)); double fRelative(fZero); - if(!::basegfx::fTools::equalZero(fEdgeLength)) + if(!fTools::equalZero(fEdgeLength)) { fRelative = fDistance / fEdgeLength; } // add calculated average value to the return value - aRetval = ::basegfx::interpolate(aRetval, aNextPoint, fRelative); + aRetval = interpolate(aRetval, aNextPoint, fRelative); } } return aRetval; } - ::basegfx::B2DPoint getPositionRelative(const ::basegfx::B2DPolygon& rCandidate, double fDistance, double fLength) + B2DPoint getPositionRelative(const B2DPolygon& rCandidate, double fDistance, double fLength) { // get length if not given - if(::basegfx::fTools::equalZero(fLength)) + if(fTools::equalZero(fLength)) { fLength = getLength(rCandidate); } @@ -674,10 +674,10 @@ namespace basegfx return getPositionAbsolute(rCandidate, fDistance * fLength, fLength); } - ::basegfx::B2DVectorOrientation getPointOrientation(const ::basegfx::B2DPolygon& rCandidate, sal_uInt32 nIndex) + B2VectorOrientation getPointOrientation(const B2DPolygon& rCandidate, sal_uInt32 nIndex) { OSL_ENSURE(nIndex < rCandidate.count(), "getIndexOfPredecessor: Access to polygon out of range (!)"); - ::basegfx::B2DVectorOrientation eRetval(::basegfx::ORIENTATION_NEUTRAL); + B2VectorOrientation eRetval(ORIENTATION_NEUTRAL); if(rCandidate.count() > 2) { @@ -689,9 +689,9 @@ namespace basegfx if(nIndNext != nIndex && nIndNext != nIndPrev) { - ::basegfx::B2DPoint aPoint(rCandidate.getB2DPoint(nIndex)); - ::basegfx::B2DVector aVecPrev(rCandidate.getB2DPoint(nIndPrev) - aPoint); - ::basegfx::B2DVector aVecNext(rCandidate.getB2DPoint(nIndNext) - aPoint); + B2DPoint aPoint(rCandidate.getB2DPoint(nIndex)); + B2DVector aVecPrev(rCandidate.getB2DPoint(nIndPrev) - aPoint); + B2DVector aVecNext(rCandidate.getB2DPoint(nIndNext) - aPoint); eRetval = ::basegfx::getOrientation(aVecPrev, aVecNext); } } @@ -701,7 +701,7 @@ namespace basegfx } CutFlagValue findCut( - const ::basegfx::B2DPolygon& rCandidate, + const B2DPolygon& rCandidate, sal_uInt32 nIndex1, sal_uInt32 nIndex2, CutFlagValue aCutFlags, double* pCut1, double* pCut2) @@ -714,13 +714,13 @@ namespace basegfx sal_uInt32 nEnd1(getIndexOfSuccessor(nIndex1, rCandidate)); sal_uInt32 nEnd2(getIndexOfSuccessor(nIndex2, rCandidate)); - const ::basegfx::B2DPoint aStart1(rCandidate.getB2DPoint(nIndex1)); - const ::basegfx::B2DPoint aEnd1(rCandidate.getB2DPoint(nEnd1)); - const ::basegfx::B2DVector aVector1(aEnd1 - aStart1); + const B2DPoint aStart1(rCandidate.getB2DPoint(nIndex1)); + const B2DPoint aEnd1(rCandidate.getB2DPoint(nEnd1)); + const B2DVector aVector1(aEnd1 - aStart1); - const ::basegfx::B2DPoint aStart2(rCandidate.getB2DPoint(nIndex2)); - const ::basegfx::B2DPoint aEnd2(rCandidate.getB2DPoint(nEnd2)); - const ::basegfx::B2DVector aVector2(aEnd2 - aStart2); + const B2DPoint aStart2(rCandidate.getB2DPoint(nIndex2)); + const B2DPoint aEnd2(rCandidate.getB2DPoint(nEnd2)); + const B2DVector aVector2(aEnd2 - aStart2); aRetval = findCut( aStart1, aVector1, aStart2, aVector2, @@ -731,8 +731,8 @@ namespace basegfx } CutFlagValue findCut( - const ::basegfx::B2DPolygon& rCandidate1, sal_uInt32 nIndex1, - const ::basegfx::B2DPolygon& rCandidate2, sal_uInt32 nIndex2, + const B2DPolygon& rCandidate1, sal_uInt32 nIndex1, + const B2DPolygon& rCandidate2, sal_uInt32 nIndex2, CutFlagValue aCutFlags, double* pCut1, double* pCut2) { @@ -745,13 +745,13 @@ namespace basegfx sal_uInt32 nEnd1(getIndexOfSuccessor(nIndex1, rCandidate1)); sal_uInt32 nEnd2(getIndexOfSuccessor(nIndex2, rCandidate2)); - const ::basegfx::B2DPoint aStart1(rCandidate1.getB2DPoint(nIndex1)); - const ::basegfx::B2DPoint aEnd1(rCandidate1.getB2DPoint(nEnd1)); - const ::basegfx::B2DVector aVector1(aEnd1 - aStart1); + const B2DPoint aStart1(rCandidate1.getB2DPoint(nIndex1)); + const B2DPoint aEnd1(rCandidate1.getB2DPoint(nEnd1)); + const B2DVector aVector1(aEnd1 - aStart1); - const ::basegfx::B2DPoint aStart2(rCandidate2.getB2DPoint(nIndex2)); - const ::basegfx::B2DPoint aEnd2(rCandidate2.getB2DPoint(nEnd2)); - const ::basegfx::B2DVector aVector2(aEnd2 - aStart2); + const B2DPoint aStart2(rCandidate2.getB2DPoint(nIndex2)); + const B2DPoint aEnd2(rCandidate2.getB2DPoint(nEnd2)); + const B2DVector aVector2(aEnd2 - aStart2); aRetval = findCut( aStart1, aVector1, aStart2, aVector2, @@ -762,15 +762,15 @@ namespace basegfx } CutFlagValue findCut( - const ::basegfx::B2DPoint& rEdge1Start, const ::basegfx::B2DVector& rEdge1Delta, - const ::basegfx::B2DPoint& rEdge2Start, const ::basegfx::B2DVector& rEdge2Delta, + const B2DPoint& rEdge1Start, const B2DVector& rEdge1Delta, + const B2DPoint& rEdge2Start, const B2DVector& rEdge2Delta, CutFlagValue aCutFlags, double* pCut1, double* pCut2) { CutFlagValue aRetval(CUTFLAG_NONE); double fCut1(0.0); double fCut2(0.0); - sal_Bool bFinished(!((sal_Bool)(aCutFlags & CUTFLAG_ALL))); + bool bFinished(!((bool)(aCutFlags & CUTFLAG_ALL))); // test for same points? if(!bFinished @@ -782,7 +782,7 @@ namespace basegfx { if(rEdge1Start.equal(rEdge2Start)) { - bFinished = sal_True; + bFinished = true; aRetval = (CUTFLAG_START1|CUTFLAG_START2); } } @@ -790,12 +790,12 @@ namespace basegfx // same endpoint? if(!bFinished && (aCutFlags & (CUTFLAG_END1|CUTFLAG_END2)) == (CUTFLAG_END1|CUTFLAG_END2)) { - const ::basegfx::B2DPoint aEnd1(rEdge1Start + rEdge1Delta); - const ::basegfx::B2DPoint aEnd2(rEdge2Start + rEdge2Delta); + const B2DPoint aEnd1(rEdge1Start + rEdge1Delta); + const B2DPoint aEnd2(rEdge2Start + rEdge2Delta); if(aEnd1.equal(aEnd2)) { - bFinished = sal_True; + bFinished = true; aRetval = (CUTFLAG_END1|CUTFLAG_END2); fCut1 = fCut2 = 1.0; } @@ -804,11 +804,11 @@ namespace basegfx // startpoint1 == endpoint2? if(!bFinished && (aCutFlags & (CUTFLAG_START1|CUTFLAG_END2)) == (CUTFLAG_START1|CUTFLAG_END2)) { - const ::basegfx::B2DPoint aEnd2(rEdge2Start + rEdge2Delta); + const B2DPoint aEnd2(rEdge2Start + rEdge2Delta); if(rEdge1Start.equal(aEnd2)) { - bFinished = sal_True; + bFinished = true; aRetval = (CUTFLAG_START1|CUTFLAG_END2); fCut1 = 0.0; fCut2 = 1.0; @@ -818,11 +818,11 @@ namespace basegfx // startpoint2 == endpoint1? if(!bFinished&& (aCutFlags & (CUTFLAG_START2|CUTFLAG_END1)) == (CUTFLAG_START2|CUTFLAG_END1)) { - const ::basegfx::B2DPoint aEnd1(rEdge1Start + rEdge1Delta); + const B2DPoint aEnd1(rEdge1Start + rEdge1Delta); if(rEdge2Start.equal(aEnd1)) { - bFinished = sal_True; + bFinished = true; aRetval = (CUTFLAG_START2|CUTFLAG_END1); fCut1 = 1.0; fCut2 = 0.0; @@ -837,7 +837,7 @@ namespace basegfx // start1 on line 2 ? if(isPointOnEdge(rEdge1Start, rEdge2Start, rEdge2Delta, &fCut2)) { - bFinished = sal_True; + bFinished = true; aRetval = (CUTFLAG_LINE|CUTFLAG_START1); } } @@ -847,7 +847,7 @@ namespace basegfx // start2 on line 1 ? if(isPointOnEdge(rEdge2Start, rEdge1Start, rEdge1Delta, &fCut1)) { - bFinished = sal_True; + bFinished = true; aRetval = (CUTFLAG_LINE|CUTFLAG_START2); } } @@ -855,11 +855,11 @@ namespace basegfx if(!bFinished && (aCutFlags & CUTFLAG_END1)) { // end1 on line 2 ? - const ::basegfx::B2DPoint aEnd1(rEdge1Start + rEdge1Delta); + const B2DPoint aEnd1(rEdge1Start + rEdge1Delta); if(isPointOnEdge(aEnd1, rEdge2Start, rEdge2Delta, &fCut2)) { - bFinished = sal_True; + bFinished = true; aRetval = (CUTFLAG_LINE|CUTFLAG_END1); } } @@ -867,11 +867,11 @@ namespace basegfx if(!bFinished && (aCutFlags & CUTFLAG_END2)) { // end2 on line 1 ? - const ::basegfx::B2DPoint aEnd2(rEdge2Start + rEdge2Delta); + const B2DPoint aEnd2(rEdge2Start + rEdge2Delta); if(isPointOnEdge(aEnd2, rEdge1Start, rEdge1Delta, &fCut1)) { - bFinished = sal_True; + bFinished = true; aRetval = (CUTFLAG_LINE|CUTFLAG_END2); } } @@ -881,7 +881,7 @@ namespace basegfx // cut in line1, line2 ? fCut1 = (rEdge1Delta.getX() * rEdge2Delta.getY()) - (rEdge1Delta.getY() * rEdge2Delta.getX()); - if(!::basegfx::fTools::equalZero(fCut1)) + if(!fTools::equalZero(fCut1)) { fCut1 = (rEdge2Delta.getY() * (rEdge2Start.getX() - rEdge1Start.getX()) + rEdge2Delta.getX() * (rEdge1Start.getY() - rEdge2Start.getY())) / fCut1; @@ -890,8 +890,8 @@ namespace basegfx const double fOne(1.0); // inside parameter range edge1 AND fCut2 is calcable - if(::basegfx::fTools::more(fCut1, fZero) && ::basegfx::fTools::less(fCut1, fOne) - && (!::basegfx::fTools::equalZero(rEdge2Delta.getX()) || !::basegfx::fTools::equalZero(rEdge2Delta.getY()))) + if(fTools::more(fCut1, fZero) && fTools::less(fCut1, fOne) + && (!fTools::equalZero(rEdge2Delta.getX()) || !fTools::equalZero(rEdge2Delta.getY()))) { // take the mopre precise calculation of the two possible if(fabs(rEdge2Delta.getX()) > fabs(rEdge2Delta.getY())) @@ -906,9 +906,9 @@ namespace basegfx } // inside parameter range edge2, too - if(::basegfx::fTools::more(fCut2, fZero) && ::basegfx::fTools::less(fCut2, fOne)) + if(fTools::more(fCut2, fZero) && fTools::less(fCut2, fOne)) { - bFinished = sal_True; + bFinished = true; aRetval = CUTFLAG_LINE; } } @@ -930,56 +930,56 @@ namespace basegfx return aRetval; } - sal_Bool isPointOnEdge( - const ::basegfx::B2DPoint& rPoint, - const ::basegfx::B2DPoint& rEdgeStart, - const ::basegfx::B2DVector& rEdgeDelta, + bool isPointOnEdge( + const B2DPoint& rPoint, + const B2DPoint& rEdgeStart, + const B2DVector& rEdgeDelta, double* pCut) { - sal_Bool bDeltaXIsZero(::basegfx::fTools::equalZero(rEdgeDelta.getX())); - sal_Bool bDeltaYIsZero(::basegfx::fTools::equalZero(rEdgeDelta.getY())); + bool bDeltaXIsZero(fTools::equalZero(rEdgeDelta.getX())); + bool bDeltaYIsZero(fTools::equalZero(rEdgeDelta.getY())); const double fZero(0.0); const double fOne(1.0); if(bDeltaXIsZero && bDeltaYIsZero) { // no line, just a point - return sal_False; + return false; } else if(bDeltaXIsZero) { // vertical line - if(::basegfx::fTools::equal(rPoint.getX(), rEdgeStart.getX())) + if(fTools::equal(rPoint.getX(), rEdgeStart.getX())) { double fValue = (rPoint.getY() - rEdgeStart.getY()) / rEdgeDelta.getY(); - if(::basegfx::fTools::more(fValue, fZero) && ::basegfx::fTools::less(fValue, fOne)) + if(fTools::more(fValue, fZero) && fTools::less(fValue, fOne)) { if(pCut) { *pCut = fValue; } - return sal_True; + return true; } } } else if(bDeltaYIsZero) { // horizontal line - if(::basegfx::fTools::equal(rPoint.getY(), rEdgeStart.getY())) + if(fTools::equal(rPoint.getY(), rEdgeStart.getY())) { double fValue = (rPoint.getX() - rEdgeStart.getX()) / rEdgeDelta.getX(); - if(::basegfx::fTools::more(fValue, fZero) - && ::basegfx::fTools::less(fValue, fOne)) + if(fTools::more(fValue, fZero) + && fTools::less(fValue, fOne)) { if(pCut) { *pCut = fValue; } - return sal_True; + return true; } } } @@ -989,13 +989,13 @@ namespace basegfx double fTOne = (rPoint.getX() - rEdgeStart.getX()) / rEdgeDelta.getX(); double fTTwo = (rPoint.getY() - rEdgeStart.getY()) / rEdgeDelta.getY(); - if(::basegfx::fTools::equal(fTOne, fTTwo)) + if(fTools::equal(fTOne, fTTwo)) { // same parameter representation, point is on line. Take // middle value for better results double fValue = (fTOne + fTTwo) / 2.0; - if(::basegfx::fTools::more(fValue, fZero) && ::basegfx::fTools::less(fValue, fOne)) + if(fTools::more(fValue, fZero) && fTools::less(fValue, fOne)) { // point is inside line bounds, too if(pCut) @@ -1003,17 +1003,17 @@ namespace basegfx *pCut = fValue; } - return sal_True; + return true; } } } - return sal_False; + return false; } - ::basegfx::B2DPolyPolygon applyLineDashing(const ::basegfx::B2DPolygon& rCandidate, const ::std::vector<double>& raDashDotArray, double fFullDashDotLen) + B2DPolyPolygon applyLineDashing(const B2DPolygon& rCandidate, const ::std::vector<double>& raDashDotArray, double fFullDashDotLen) { - ::basegfx::B2DPolyPolygon aRetval; + B2DPolyPolygon aRetval; if(rCandidate.count() && fFullDashDotLen > 0.0) { @@ -1024,9 +1024,9 @@ namespace basegfx for(sal_uInt32 a(0L); a < nCount; a++) { const sal_uInt32 nNextIndex(getIndexOfSuccessor(a, rCandidate)); - const ::basegfx::B2DPoint aStart(rCandidate.getB2DPoint(a)); - const ::basegfx::B2DPoint aEnd(rCandidate.getB2DPoint(nNextIndex)); - const ::basegfx::B2DVector aVector(aEnd - aStart); + const B2DPoint aStart(rCandidate.getB2DPoint(a)); + const B2DPoint aEnd(rCandidate.getB2DPoint(nNextIndex)); + const B2DVector aVector(aEnd - aStart); double fLength(aVector.getLength()); double fPosOnVector(0.0); @@ -1035,7 +1035,7 @@ namespace basegfx // handle [fPosOnVector .. fPosOnVector+fDashDotLength] if(nDashDotIndex % 2) { - ::basegfx::B2DPolygon aResult; + B2DPolygon aResult; // add start point if(fPosOnVector == 0.0) @@ -1044,11 +1044,11 @@ namespace basegfx } else { - aResult.append(aStart + (aVector * fPosOnVector)); + aResult.append( B2DPoint(aStart + (aVector * fPosOnVector)) ); } // add end point - aResult.append(aStart + (aVector * (fPosOnVector + fDashDotLength))); + aResult.append( B2DPoint(aStart + (aVector * (fPosOnVector + fDashDotLength))) ); // add line to PolyPolygon aRetval.append(aResult); @@ -1064,10 +1064,10 @@ namespace basegfx // handle [fPosOnVector .. fPosOnVector+fLength (bzw. end)] if((fLength > 0.0) && (nDashDotIndex % 2)) { - ::basegfx::B2DPolygon aResult; + B2DPolygon aResult; // add start and end point - const ::basegfx::B2DPoint aPosA(aStart + (aVector * fPosOnVector)); + const B2DPoint aPosA(aStart + (aVector * fPosOnVector)); aResult.append(aPosA); // add line to PolyPolygon diff --git a/basegfx/source/polygon/b2dpolypolygon.cxx b/basegfx/source/polygon/b2dpolypolygon.cxx index f6fcbd9c0e55..53da317e483e 100644 --- a/basegfx/source/polygon/b2dpolypolygon.cxx +++ b/basegfx/source/polygon/b2dpolypolygon.cxx @@ -2,9 +2,9 @@ * * $RCSfile: b2dpolypolygon.cxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: aw $ $Date: 2003-11-28 11:18:06 $ + * last change: $Author: thb $ $Date: 2004-01-16 10:34:32 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -110,21 +110,21 @@ public: void incRefCount() { mnRefCount++; } void decRefCount() { mnRefCount--; } - sal_Bool isEqual(const ImplB2DPolyPolygon& rPolygonList) const + bool isEqual(const ImplB2DPolyPolygon& rPolygonList) const { // same polygon count? if(maPolygons.size() != rPolygonList.maPolygons.size()) - return sal_False; + return false; // if zero polygons the polys are equal if(!maPolygons.size()) - return sal_True; + return true; // compare polygon content if(maPolygons != rPolygonList.maPolygons) - return sal_False; + return false; - return sal_True; + return true; } const ::basegfx::B2DPolygon& getB2DPolygon(sal_uInt32 nIndex) const @@ -185,7 +185,7 @@ public: return maPolygons.size(); } - void setClosed(sal_Bool bNew) + void setClosed(bool bNew) { for(sal_uInt32 a(0L); a < maPolygons.size(); a++) { @@ -275,21 +275,21 @@ namespace basegfx return *this; } - sal_Bool B2DPolyPolygon::operator==(const B2DPolyPolygon& rPolyPolygon) const + bool B2DPolyPolygon::operator==(const B2DPolyPolygon& rPolyPolygon) const { if(mpPolyPolygon == rPolyPolygon.mpPolyPolygon) { - return sal_True; + return true; } return mpPolyPolygon->isEqual(*(rPolyPolygon.mpPolyPolygon)); } - sal_Bool B2DPolyPolygon::operator!=(const B2DPolyPolygon& rPolyPolygon) const + bool B2DPolyPolygon::operator!=(const B2DPolyPolygon& rPolyPolygon) const { if(mpPolyPolygon == rPolyPolygon.mpPolyPolygon) { - return sal_False; + return false; } return !mpPolyPolygon->isEqual(*(rPolyPolygon.mpPolyPolygon)); @@ -318,7 +318,7 @@ namespace basegfx } } - sal_Bool B2DPolyPolygon::areControlPointsUsed() const + bool B2DPolyPolygon::areControlPointsUsed() const { for(sal_uInt32 a(0L); a < mpPolyPolygon->count(); a++) { @@ -326,11 +326,11 @@ namespace basegfx if(rPolygon.areControlPointsUsed()) { - return sal_True; + return true; } } - return sal_False; + return false; } void B2DPolyPolygon::insert(sal_uInt32 nIndex, const B2DPolygon& rPolygon, sal_uInt32 nCount) @@ -399,9 +399,9 @@ namespace basegfx mpPolyPolygon->incRefCount(); } - sal_Bool B2DPolyPolygon::isClosed() const + bool B2DPolyPolygon::isClosed() const { - sal_Bool bRetval(sal_True); + bool bRetval(true); // PolyPOlygon is closed when all contained Polygons are closed or // no Polygon exists. @@ -409,14 +409,14 @@ namespace basegfx { if(!(mpPolyPolygon->getB2DPolygon(a)).isClosed()) { - bRetval = sal_False; + bRetval = false; } } return bRetval; } - void B2DPolyPolygon::setClosed(sal_Bool bNew) + void B2DPolyPolygon::setClosed(bool bNew) { if(bNew != isClosed()) { @@ -431,15 +431,15 @@ namespace basegfx mpPolyPolygon->flip(); } - sal_Bool B2DPolyPolygon::hasDoublePoints() const + bool B2DPolyPolygon::hasDoublePoints() const { - sal_Bool bRetval(sal_False); + bool bRetval(false); for(sal_uInt32 a(0L); !bRetval && a < mpPolyPolygon->count(); a++) { if((mpPolyPolygon->getB2DPolygon(a)).hasDoublePoints()) { - bRetval = sal_True; + bRetval = true; } } diff --git a/basegfx/source/polygon/b2dpolypolygoncutter.cxx b/basegfx/source/polygon/b2dpolypolygoncutter.cxx index 17d1c476acbf..9d1fb54e1e75 100644 --- a/basegfx/source/polygon/b2dpolypolygoncutter.cxx +++ b/basegfx/source/polygon/b2dpolypolygoncutter.cxx @@ -2,9 +2,9 @@ * * $RCSfile: b2dpolypolygoncutter.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: aw $ $Date: 2003-11-28 11:18:06 $ + * last change: $Author: thb $ $Date: 2004-01-16 10:34:33 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -88,7 +88,7 @@ namespace basegfx { - B2DPolygonNode::B2DPolygonNode(const ::basegfx::B2DPoint& rPosition, B2DPolygonNode* pPrevious) + B2DPolygonNode::B2DPolygonNode(const B2DPoint& rPosition, B2DPolygonNode* pPrevious) : maPosition(rPosition) { mpListPrevious = this; @@ -190,14 +190,14 @@ namespace basegfx } } - sal_Bool B2DPolygonNode::getOrientation() const + bool B2DPolygonNode::getOrientation() const { const B2DPolygonNode* pOutmost = this; const B2DPolygonNode* pCurrent = this->getNext(); while(pCurrent != this) { - if(::basegfx::fTools::more(pOutmost->getPosition().getX(), pCurrent->getPosition().getX())) + if(fTools::more(pOutmost->getPosition().getX(), pCurrent->getPosition().getX())) { if(pCurrent->getPosition().getX() < pOutmost->getPosition().getX()) { @@ -216,9 +216,9 @@ namespace basegfx pCurrent = pCurrent->getNext(); } - ::basegfx::B2DVector aVec1(pOutmost->getPrevious()->getPosition() - pOutmost->getPosition()); - ::basegfx::B2DVector aVec2(pOutmost->getNext()->getPosition() - pOutmost->getPosition()); - return sal_Bool(::basegfx::fTools::more(aVec1.getX() * aVec2.getY(), aVec1.getY() * aVec2.getX())); + B2DVector aVec1(pOutmost->getPrevious()->getPosition() - pOutmost->getPosition()); + B2DVector aVec2(pOutmost->getNext()->getPosition() - pOutmost->getPosition()); + return bool(fTools::more(aVec1.getX() * aVec2.getY(), aVec1.getY() * aVec2.getX())); } void B2DPolygonNode::swapOrientation() @@ -231,9 +231,9 @@ namespace basegfx } while(pCurrent != this); } - ::basegfx::B2DRange B2DPolygonNode::getRange() const + B2DRange B2DPolygonNode::getRange() const { - ::basegfx::B2DRange aRetval; + B2DRange aRetval; const B2DPolygonNode* pCurrent = this; do { @@ -244,26 +244,26 @@ namespace basegfx return aRetval; } - sal_Bool B2DPolygonNode::isInside(const ::basegfx::B2DPoint& rPoint, sal_Bool bWithBorder) const + bool B2DPolygonNode::isInside(const B2DPoint& rPoint, bool bWithBorder) const { - sal_Bool bInside(sal_False); + bool bInside(false); const B2DPolygonNode* pCurrent = this; do { if(bWithBorder && pCurrent->getPosition().equal(rPoint)) { - return sal_True; + return true; } B2DPolygonNode* pNext = pCurrent->getNext(); - const sal_Bool bCompYA(::basegfx::fTools::more(pCurrent->getPosition().getY(), rPoint.getY())); - const sal_Bool bCompYB(::basegfx::fTools::more(pNext->getPosition().getY(), rPoint.getY())); + const bool bCompYA(fTools::more(pCurrent->getPosition().getY(), rPoint.getY())); + const bool bCompYB(fTools::more(pNext->getPosition().getY(), rPoint.getY())); if(bCompYA != bCompYB) { - const sal_Bool bCompXA(::basegfx::fTools::more(pCurrent->getPosition().getX(), rPoint.getX())); - const sal_Bool bCompXB(::basegfx::fTools::more(pNext->getPosition().getX(), rPoint.getX())); + const bool bCompXA(fTools::more(pCurrent->getPosition().getX(), rPoint.getX())); + const bool bCompXB(fTools::more(pNext->getPosition().getX(), rPoint.getX())); if(bCompXA == bCompXB) { @@ -279,11 +279,11 @@ namespace basegfx (pCurrent->getPosition().getX() - pNext->getPosition().getX()) / (pCurrent->getPosition().getY() - pNext->getPosition().getY()); - if(bWithBorder && ::basegfx::fTools::more(fCmp, rPoint.getX())) + if(bWithBorder && fTools::more(fCmp, rPoint.getX())) { bInside = !bInside; } - else if(::basegfx::fTools::moreOrEqual(fCmp, rPoint.getX())) + else if(fTools::moreOrEqual(fCmp, rPoint.getX())) { bInside = !bInside; } @@ -298,10 +298,10 @@ namespace basegfx return bInside; } - sal_Bool B2DPolygonNode::isPolygonInside(B2DPolygonNode* pPoly, sal_Bool bWithBorder) const + bool B2DPolygonNode::isPolygonInside(B2DPolygonNode* pPoly, bool bWithBorder) const { B2DPolygonNode* pTest = pPoly; - sal_Bool bAllAInside(sal_True); + bool bAllAInside(true); do { bAllAInside = isInside(pTest->getPosition(), bWithBorder); @@ -348,7 +348,7 @@ namespace basegfx mnDepth = (mbOrientation) ? 0L : -1L; } - void B2DClipExtraPolygonInfo::changeDepth(sal_Bool bOrientation) + void B2DClipExtraPolygonInfo::changeDepth(bool bOrientation) { if(bOrientation) { @@ -376,7 +376,7 @@ namespace basegfx maPolygonList.clear(); } - void B2DPolyPolygonCutter::removeIncludedPolygons(sal_Bool bUseOr) + void B2DPolyPolygonCutter::removeIncludedPolygons(bool bUseOr) { const sal_uInt32 aCount(maPolygonList.size()); B2DClipExtraPolygonInfo* pInfos = new B2DClipExtraPolygonInfo[aCount]; @@ -400,7 +400,7 @@ namespace basegfx if(a != b && doRangesInclude(rInfoA.getRange(), rInfoB.getRange())) { // volume B in A, test pA, pB for inclusion, with border - if(maPolygonList[a]->isPolygonInside(maPolygonList[b], sal_True)) + if(maPolygonList[a]->isPolygonInside(maPolygonList[b], true)) { // pB is inside pA rInfoB.changeDepth(rInfoA.getOrientation()); @@ -486,7 +486,7 @@ namespace basegfx for(sal_uInt32 a(0L); a < rPolygon.count(); a++) { - ::basegfx::B2DPoint aPoint(rPolygon.getB2DPoint(a)); + B2DPoint aPoint(rPolygon.getB2DPoint(a)); pRetval = new B2DPolygonNode(aPoint, pRetval); } @@ -521,7 +521,7 @@ namespace basegfx } while(pAct != pPolygon); } - void B2DPolyPolygonCutter::addPolyPolygon(const B2DPolyPolygon& rPolyPolygon, sal_Bool bForceOrientation) + void B2DPolyPolygonCutter::addPolyPolygon(const B2DPolyPolygon& rPolyPolygon, bool bForceOrientation) { for(sal_uInt32 a(0L); a < rPolyPolygon.count(); a++) { @@ -536,10 +536,10 @@ namespace basegfx { if(bForceOrientation) { - ::basegfx::B2DVectorOrientation aOrientation = - ::basegfx::tools::getOrientation(aCandidate); + B2VectorOrientation aOrientation = + tools::getOrientation(aCandidate); - if(::basegfx::ORIENTATION_POSITIVE != aOrientation) + if(ORIENTATION_POSITIVE != aOrientation) { aCandidate.flip(); } @@ -575,7 +575,7 @@ namespace basegfx pAct = pAct->getNext(); } while(pAct != pCand); - aNewPolygon.setClosed(sal_True); + aNewPolygon.setClosed(true); rPolyPolygon.append(aNewPolygon); } @@ -656,7 +656,7 @@ namespace basegfx do { if(isSamePos(pA->getPosition(), pB->getPosition())) { - aNewCuts.push_back(new B2DSimpleCut(pA, pB, sal_True, pCand->getOrientation())); + aNewCuts.push_back(new B2DSimpleCut(pA, pB, true, pCand->getOrientation())); } // next B @@ -679,42 +679,42 @@ namespace basegfx do { pB->calcMinMaxX(fMaxBX, fMinBX); - if(::basegfx::fTools::more(fMaxBX, fMinAX) - && ::basegfx::fTools::more(fMaxAX, fMinBX)) + if(fTools::more(fMaxBX, fMinAX) + && fTools::more(fMaxAX, fMinBX)) { pB->calcMinMaxY(fMaxBY, fMinBY); - if(::basegfx::fTools::more(fMaxBY, fMinAY) - && ::basegfx::fTools::more(fMaxAY, fMinBY)) + if(fTools::more(fMaxBY, fMinAY) + && fTools::more(fMaxAY, fMinBY)) { if(!isSamePos(pA->getPosition(), pB->getPosition())) { - const ::basegfx::B2DVector aVectorA(pA->getNext()->getPosition() - pA->getPosition()); - const ::basegfx::B2DVector aVectorB(pB->getNext()->getPosition() - pB->getPosition()); + const B2DVector aVectorA(pA->getNext()->getPosition() - pA->getPosition()); + const B2DVector aVectorB(pB->getNext()->getPosition() - pB->getPosition()); - if(::basegfx::tools::findCut(pA->getPosition(), aVectorA, pB->getPosition(), aVectorB, CUTFLAG_LINE, &fCut)) + if(tools::findCut(pA->getPosition(), aVectorA, pB->getPosition(), aVectorB, CUTFLAG_LINE, &fCut)) { // crossover, two new points - ::basegfx::B2DPoint aNewPos(::basegfx::interpolate(pA->getPosition(), pA->getNext()->getPosition(), fCut)); + B2DPoint aNewPos(interpolate(pA->getPosition(), pA->getNext()->getPosition(), fCut)); B2DPolygonNode* pCutLo = new B2DPolygonNode(aNewPos, pA); B2DPolygonNode* pCutHi = new B2DPolygonNode(aNewPos, pB); - aNewCuts.push_back(new B2DSimpleCut(pCutLo, pCutHi, sal_True, pCand->getOrientation())); + aNewCuts.push_back(new B2DSimpleCut(pCutLo, pCutHi, true, pCand->getOrientation())); pA->calcMinMaxX(fMaxAX, fMinAX); pA->calcMinMaxY(fMaxAY, fMinAY); } else { - if(::basegfx::tools::isPointOnEdge(pA->getPosition(), pB->getPosition(), aVectorB, &fCut)) + if(tools::isPointOnEdge(pA->getPosition(), pB->getPosition(), aVectorB, &fCut)) { // startpoint A at edge B, one new point B2DPolygonNode* pCutHi = new B2DPolygonNode(pA->getPosition(), pB); - aNewCuts.push_back(new B2DSimpleCut(pA, pCutHi, sal_True, pCand->getOrientation())); + aNewCuts.push_back(new B2DSimpleCut(pA, pCutHi, true, pCand->getOrientation())); } - else if(::basegfx::tools::isPointOnEdge(pB->getPosition(), pA->getPosition(), aVectorA, &fCut)) + else if(tools::isPointOnEdge(pB->getPosition(), pA->getPosition(), aVectorA, &fCut)) { // startpoint B at edge A, one new point B2DPolygonNode* pCutLo = new B2DPolygonNode(pB->getPosition(), pA); - aNewCuts.push_back(new B2DSimpleCut(pCutLo, pB, sal_True, pCand->getOrientation())); + aNewCuts.push_back(new B2DSimpleCut(pCutLo, pB, true, pCand->getOrientation())); pA->calcMinMaxX(fMaxAX, fMinAX); pA->calcMinMaxY(fMaxAY, fMinAY); } @@ -743,11 +743,11 @@ namespace basegfx } } - sal_Bool B2DPolyPolygonCutter::isCrossover(B2DPolygonNode* pA, B2DPolygonNode* pB) + bool B2DPolyPolygonCutter::isCrossover(B2DPolygonNode* pA, B2DPolygonNode* pB) { // build entering vectors - ::basegfx::B2DVector aVecA(pA->getPrevious()->getPosition() - pA->getPosition()); - ::basegfx::B2DVector aVecB(pB->getPrevious()->getPosition() - pA->getPosition()); + B2DVector aVecA(pA->getPrevious()->getPosition() - pA->getPosition()); + B2DVector aVecB(pB->getPrevious()->getPosition() - pA->getPosition()); aVecA.normalize(); aVecB.normalize(); double fDegreeA2 = atan2(aVecA.getY(), aVecA.getX()); @@ -769,30 +769,30 @@ namespace basegfx fDegreeA1 = fTemp; } - sal_Bool bB1Inside(::basegfx::fTools::more(fDegreeB1, fDegreeA1) - && ::basegfx::fTools::more(fDegreeA2, fDegreeB1)); - sal_Bool bB2Inside(::basegfx::fTools::more(fDegreeB2, fDegreeA1) - && ::basegfx::fTools::more(fDegreeA2, fDegreeB2)); + bool bB1Inside(fTools::more(fDegreeB1, fDegreeA1) + && fTools::more(fDegreeA2, fDegreeB1)); + bool bB2Inside(fTools::more(fDegreeB2, fDegreeA1) + && fTools::more(fDegreeA2, fDegreeB2)); if(bB1Inside && bB2Inside) { - return sal_False; + return false; } - sal_Bool bB1Outside(::basegfx::fTools::more(fDegreeA1, fDegreeB1) - || ::basegfx::fTools::more(fDegreeB1, fDegreeA2)); - sal_Bool bB2Outside(::basegfx::fTools::more(fDegreeA1, fDegreeB2) - || ::basegfx::fTools::more(fDegreeB2, fDegreeA2)); + bool bB1Outside(fTools::more(fDegreeA1, fDegreeB1) + || fTools::more(fDegreeB1, fDegreeA2)); + bool bB2Outside(fTools::more(fDegreeA1, fDegreeB2) + || fTools::more(fDegreeB2, fDegreeA2)); return !(bB1Outside && bB2Outside); } - sal_Bool B2DPolyPolygonCutter::isCrossover(B2DSimpleCut* pEnter, B2DSimpleCut* pLeave) + bool B2DPolyPolygonCutter::isCrossover(B2DSimpleCut* pEnter, B2DSimpleCut* pLeave) { // build entering vectors - ::basegfx::B2DVector aVecJ(pEnter->getLeft()->getNext()->getPosition() - pEnter->getLeft()->getPosition()); - ::basegfx::B2DVector aVecA(pEnter->getLeft()->getPrevious()->getPosition() - pEnter->getLeft()->getPosition()); - ::basegfx::B2DVector aVecB(pEnter->getRight()->getPrevious()->getPosition() - pEnter->getLeft()->getPosition()); + B2DVector aVecJ(pEnter->getLeft()->getNext()->getPosition() - pEnter->getLeft()->getPosition()); + B2DVector aVecA(pEnter->getLeft()->getPrevious()->getPosition() - pEnter->getLeft()->getPosition()); + B2DVector aVecB(pEnter->getRight()->getPrevious()->getPosition() - pEnter->getLeft()->getPosition()); aVecJ.normalize(); aVecA.normalize(); aVecB.normalize(); @@ -822,7 +822,7 @@ namespace basegfx fDegreeB2 -= (2.0 * F_PI); } - sal_Bool bA2BiggerB2(::basegfx::fTools::more(fDegreeA2, fDegreeB2)); + bool bA2BiggerB2(fTools::more(fDegreeA2, fDegreeB2)); // build leaving vectors aVecJ = pLeave->getLeft()->getPrevious()->getPosition() - pLeave->getLeft()->getPosition(); @@ -857,7 +857,7 @@ namespace basegfx fDegreeB1 -= (2.0 * F_PI); } - sal_Bool bA1BiggerB1(::basegfx::fTools::more(fDegreeA1, fDegreeB1)); + bool bA1BiggerB1(fTools::more(fDegreeA1, fDegreeB1)); // compare return (bA1BiggerB1 == bA2BiggerB2); @@ -878,7 +878,7 @@ namespace basegfx sal_uInt32 a; // create volume list for all polys for faster compares - ::basegfx::B2DRange* pVolumes = new ::basegfx::B2DRange[maPolygonList.size()]; + B2DRange* pVolumes = new B2DRange[maPolygonList.size()]; for(a = 0L; a < maPolygonList.size(); a++) { @@ -928,23 +928,23 @@ namespace basegfx do { pB->calcMinMaxX(fMaxBX, fMinBX); - if(::basegfx::fTools::more(fMaxBX, fMinAX) - && ::basegfx::fTools::more(fMaxAX, fMinBX)) + if(fTools::more(fMaxBX, fMinAX) + && fTools::more(fMaxAX, fMinBX)) { pB->calcMinMaxY(fMaxBY, fMinBY); - if(::basegfx::fTools::more(fMaxBY, fMinAY) - && ::basegfx::fTools::more(fMaxAY, fMinBY)) + if(fTools::more(fMaxBY, fMinAY) + && fTools::more(fMaxAY, fMinBY)) { if(!isSamePos(pA->getPosition(), pB->getPosition())) { - const ::basegfx::B2DVector aVectorA(pA->getNext()->getPosition() - pA->getPosition()); - const ::basegfx::B2DVector aVectorB(pB->getNext()->getPosition() - pB->getPosition()); + const B2DVector aVectorA(pA->getNext()->getPosition() - pA->getPosition()); + const B2DVector aVectorB(pB->getNext()->getPosition() - pB->getPosition()); - if(::basegfx::tools::findCut(pA->getPosition(), aVectorA, pB->getPosition(), aVectorB, CUTFLAG_LINE, &fCut)) + if(tools::findCut(pA->getPosition(), aVectorA, pB->getPosition(), aVectorB, CUTFLAG_LINE, &fCut)) { // crossover, two new points, use as cutpoint - ::basegfx::B2DPoint aNewPos(::basegfx::interpolate(pA->getPosition(), pA->getNext()->getPosition(), fCut)); + B2DPoint aNewPos(interpolate(pA->getPosition(), pA->getNext()->getPosition(), fCut)); B2DPolygonNode* pCutLo = new B2DPolygonNode(aNewPos, pA); B2DPolygonNode* pCutHi = new B2DPolygonNode(aNewPos, pB); aNewCuts.push_back(new B2DSimpleCut(pCutLo, pCutHi)); @@ -953,14 +953,14 @@ namespace basegfx } else { - if(::basegfx::tools::isPointOnEdge(pA->getPosition(), pB->getPosition(), aVectorB, &fCut)) + if(tools::isPointOnEdge(pA->getPosition(), pB->getPosition(), aVectorB, &fCut)) { // startpoint A at edge B, one new point // leaves or enters common section B2DPolygonNode* pCutHi = new B2DPolygonNode(pA->getPosition(), pB); aTmpCuts.push_back(new B2DSimpleCut(pA, pCutHi)); } - else if(::basegfx::tools::isPointOnEdge(pB->getPosition(), pA->getPosition(), aVectorA, &fCut)) + else if(tools::isPointOnEdge(pB->getPosition(), pA->getPosition(), aVectorA, &fCut)) { // startpoint B at edge A, one new point // leaves or enters common section @@ -986,15 +986,15 @@ namespace basegfx for(sal_uInt32 c(0L); c < aTmpCuts.size();) { B2DSimpleCut* pCand = aTmpCuts[c]; - sal_Bool bPrevSamePos(isPrevSamePos(pCand->getLeft(), pCand->getRight())); - sal_Bool bNextSamePos(isNextSamePos(pCand->getLeft(), pCand->getRight())); - sal_Bool bDelete(sal_False); - sal_Bool bIncC(sal_True); + bool bPrevSamePos(isPrevSamePos(pCand->getLeft(), pCand->getRight())); + bool bNextSamePos(isNextSamePos(pCand->getLeft(), pCand->getRight())); + bool bDelete(false); + bool bIncC(true); if(bPrevSamePos && bNextSamePos) { // single point inside continued same direction section - bDelete = sal_True; + bDelete = true; } else if(!bPrevSamePos && !bNextSamePos) { @@ -1004,12 +1004,12 @@ namespace basegfx // real cut, move to real cutlist aNewCuts.push_back(pCand); aTmpCuts.erase(aTmpCuts.begin() + c); - bIncC = sal_False; + bIncC = false; } else { // no cut, just a touch in one point - bDelete = sal_True; + bDelete = true; } } @@ -1018,7 +1018,7 @@ namespace basegfx { delete pCand; aTmpCuts.erase(aTmpCuts.begin() + c); - bIncC = sal_False; + bIncC = false; } // next candidate @@ -1036,8 +1036,8 @@ namespace basegfx aTmpCuts.erase(aTmpCuts.begin()); B2DPolygonNode* pActA = pCutA->getLeft(); B2DPolygonNode* pActB = pCutA->getRight(); - sal_Bool bPrevSamePos(isPrevSamePos(pActA, pActB)); - sal_Bool bNextSamePos(isNextSamePos(pActA, pActB)); + bool bPrevSamePos(isPrevSamePos(pActA, pActB)); + bool bNextSamePos(isNextSamePos(pActA, pActB)); if(aTmpCuts.size()) { diff --git a/basegfx/source/polygon/b2dpolypolygontools.cxx b/basegfx/source/polygon/b2dpolypolygontools.cxx index 60f61b347135..856725546868 100644 --- a/basegfx/source/polygon/b2dpolypolygontools.cxx +++ b/basegfx/source/polygon/b2dpolypolygontools.cxx @@ -2,9 +2,9 @@ * * $RCSfile: b2dpolypolygontools.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: aw $ $Date: 2003-11-28 11:18:06 $ + * last change: $Author: thb $ $Date: 2004-01-16 10:34:33 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -91,37 +91,37 @@ namespace basegfx { // B2DPolyPolygon tools - void correctOrientations(::basegfx::B2DPolyPolygon& rCandidate) + void correctOrientations(B2DPolyPolygon& rCandidate) { const sal_uInt32 nPolygonCount(rCandidate.count()); sal_uInt32 nIndexOfOutmostPolygon(0L); - sal_Bool bIndexOfOutmostPolygonSet(sal_False); + bool bIndexOfOutmostPolygonSet(false); for(sal_uInt32 a(0L); a < nPolygonCount; a++) { - ::basegfx::B2DPolygon aCandidate = rCandidate.getB2DPolygon(a); + B2DPolygon aCandidate = rCandidate.getB2DPolygon(a); if(aCandidate.count() > 2L) { - ::basegfx::B2DVectorOrientation aOrientation = - ::basegfx::tools::getOrientation(aCandidate); - sal_Bool bDoFlip(::basegfx::ORIENTATION_POSITIVE != aOrientation); + B2VectorOrientation aOrientation = + tools::getOrientation(aCandidate); + bool bDoFlip(ORIENTATION_POSITIVE != aOrientation); // init values for depth and compare point for // inside test. Since the ordering makes only sense when assuming // that there are no intersections, the inside test is done with // any point of the candidate, so teke the first one. sal_uInt32 nDepth(0L); - const ::basegfx::B2DPoint aTestPoint(aCandidate.getB2DPoint(0L)); + const B2DPoint aTestPoint(aCandidate.getB2DPoint(0L)); // loop over other polygons and calculate depth for(sal_uInt32 b(0L); b < nPolygonCount; b++) { if(b != a) { - ::basegfx::B2DPolygon aComparePolygon = rCandidate.getB2DPolygon(b); + B2DPolygon aComparePolygon = rCandidate.getB2DPolygon(b); - if(::basegfx::tools::isInside(aComparePolygon, aTestPoint)) + if(tools::isInside(aComparePolygon, aTestPoint)) { nDepth++; } @@ -129,7 +129,7 @@ namespace basegfx } // if nDepth is odd it is a hole - sal_Bool bIsHole(1L == (nDepth & 0x00000001)); + bool bIsHole(1L == (nDepth & 0x00000001)); // does polygon need to be flipped? if((bDoFlip && !bIsHole) || (!bDoFlip && bIsHole)) @@ -143,7 +143,7 @@ namespace basegfx // remember the index if it's the outmost polygon if(!bIndexOfOutmostPolygonSet && 0L == nDepth) { - bIndexOfOutmostPolygonSet = sal_True; + bIndexOfOutmostPolygonSet = true; nIndexOfOutmostPolygon = a; } } @@ -152,16 +152,16 @@ namespace basegfx // if the outmost polygon is not the first, move it in front if(bIndexOfOutmostPolygonSet && nIndexOfOutmostPolygon > 0L) { - ::basegfx::B2DPolygon aOutmostPolygon = rCandidate.getB2DPolygon(nIndexOfOutmostPolygon); + B2DPolygon aOutmostPolygon = rCandidate.getB2DPolygon(nIndexOfOutmostPolygon); rCandidate.remove(nIndexOfOutmostPolygon); rCandidate.insert(0L, aOutmostPolygon); } } - void removeIntersections(::basegfx::B2DPolyPolygon& rCandidate, - sal_Bool bForceOrientation, sal_Bool bInvertRemove) + void removeIntersections(B2DPolyPolygon& rCandidate, + bool bForceOrientation, bool bInvertRemove) { - ::basegfx::B2DPolyPolygonCutter aCutter; + B2DPolyPolygonCutter aCutter; aCutter.addPolyPolygon(rCandidate, bForceOrientation); aCutter.removeSelfIntersections(); @@ -171,9 +171,9 @@ namespace basegfx aCutter.getPolyPolygon(rCandidate); } - ::basegfx::B2DPolyPolygon adaptiveSubdivideByDistance(const ::basegfx::B2DPolyPolygon& rCandidate, double fDistanceBound) + B2DPolyPolygon adaptiveSubdivideByDistance(const B2DPolyPolygon& rCandidate, double fDistanceBound) { - ::basegfx::B2DPolyPolygon aRetval(rCandidate); + B2DPolyPolygon aRetval(rCandidate); if(aRetval.areControlPointsUsed()) { @@ -181,11 +181,11 @@ namespace basegfx for(sal_uInt32 a(0L); aRetval.areControlPointsUsed() && a < nPolygonCount; a++) { - ::basegfx::B2DPolygon aCandidate = aRetval.getB2DPolygon(a); + B2DPolygon aCandidate = aRetval.getB2DPolygon(a); if(aCandidate.areControlPointsUsed()) { - aCandidate = ::basegfx::tools::adaptiveSubdivideByDistance(aCandidate, fDistanceBound); + aCandidate = tools::adaptiveSubdivideByDistance(aCandidate, fDistanceBound); aRetval.setB2DPolygon(a, aCandidate); } } @@ -194,9 +194,9 @@ namespace basegfx return aRetval; } - ::basegfx::B2DPolyPolygon adaptiveSubdivideByAngle(const ::basegfx::B2DPolyPolygon& rCandidate, double fAngleBound) + B2DPolyPolygon adaptiveSubdivideByAngle(const B2DPolyPolygon& rCandidate, double fAngleBound) { - ::basegfx::B2DPolyPolygon aRetval(rCandidate); + B2DPolyPolygon aRetval(rCandidate); if(aRetval.areControlPointsUsed()) { @@ -204,11 +204,11 @@ namespace basegfx for(sal_uInt32 a(0L); aRetval.areControlPointsUsed() && a < nPolygonCount; a++) { - ::basegfx::B2DPolygon aCandidate = aRetval.getB2DPolygon(a); + B2DPolygon aCandidate = aRetval.getB2DPolygon(a); if(aCandidate.areControlPointsUsed()) { - aCandidate = ::basegfx::tools::adaptiveSubdivideByAngle(aCandidate, fAngleBound); + aCandidate = tools::adaptiveSubdivideByAngle(aCandidate, fAngleBound); aRetval.setB2DPolygon(a, aCandidate); } } @@ -217,28 +217,28 @@ namespace basegfx return aRetval; } - ::basegfx::B2DRange getRange(const ::basegfx::B2DPolyPolygon& rCandidate) + B2DRange getRange(const B2DPolyPolygon& rCandidate) { - ::basegfx::B2DRange aRetval; + B2DRange aRetval; const sal_uInt32 nPolygonCount(rCandidate.count()); for(sal_uInt32 a(0L); a < nPolygonCount; a++) { - ::basegfx::B2DPolygon aCandidate = rCandidate.getB2DPolygon(a); - aRetval.expand(::basegfx::tools::getRange(aCandidate)); + B2DPolygon aCandidate = rCandidate.getB2DPolygon(a); + aRetval.expand(tools::getRange(aCandidate)); } return aRetval; } - ::basegfx::B2DPolyPolygon applyLineDashing(const ::basegfx::B2DPolyPolygon& rCandidate, const ::std::vector<double>& raDashDotArray, double fFullDashDotLen) + B2DPolyPolygon applyLineDashing(const B2DPolyPolygon& rCandidate, const ::std::vector<double>& raDashDotArray, double fFullDashDotLen) { - ::basegfx::B2DPolyPolygon aRetval; + B2DPolyPolygon aRetval; const sal_uInt32 nPolygonCount(rCandidate.count()); for(sal_uInt32 a(0L); a < nPolygonCount; a++) { - ::basegfx::B2DPolygon aCandidate = rCandidate.getB2DPolygon(a); + B2DPolygon aCandidate = rCandidate.getB2DPolygon(a); aRetval.append(applyLineDashing(aCandidate, raDashDotArray, fFullDashDotLen)); } diff --git a/basegfx/source/polygon/b3dpolygon.cxx b/basegfx/source/polygon/b3dpolygon.cxx index 0d488c04bf2c..f31c91cdcb49 100644 --- a/basegfx/source/polygon/b3dpolygon.cxx +++ b/basegfx/source/polygon/b3dpolygon.cxx @@ -2,9 +2,9 @@ * * $RCSfile: b3dpolygon.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: aw $ $Date: 2003-11-28 11:18:06 $ + * last change: $Author: thb $ $Date: 2004-01-16 10:34:33 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -91,7 +91,7 @@ public: const ::basegfx::B3DPoint& getCoordinate() const { return maPoint; } void setCoordinate(const ::basegfx::B3DPoint& rValue) { if(rValue != maPoint) maPoint = rValue; } - sal_Bool operator==(const CoordinateData3D& rData ) const { return (maPoint == rData.getCoordinate()); } + bool operator==(const CoordinateData3D& rData ) const { return (maPoint == rData.getCoordinate()); } void transform(const ::basegfx::B3DHomMatrix& rMatrix) { maPoint *= rMatrix; } }; @@ -128,7 +128,7 @@ public: return maVector.size(); } - sal_Bool isEqual(const CoordinateDataArray3D& rCandidate) const + bool isEqual(const CoordinateDataArray3D& rCandidate) const { return (maVector == rCandidate.maVector); } @@ -262,7 +262,7 @@ public: ImplB3DPolygon() : mnRefCount(1), maPoints(0L), - mbIsClosed(sal_False) + mbIsClosed(false) { // complete initialization with defaults } @@ -307,12 +307,12 @@ public: return maPoints.count(); } - sal_Bool isClosed() const + bool isClosed() const { return mbIsClosed; } - void setClosed(sal_Bool bNew) + void setClosed(bool bNew) { if(bNew != mbIsClosed) { @@ -320,17 +320,17 @@ public: } } - sal_Bool isEqual(const ImplB3DPolygon& rCandidate) const + bool isEqual(const ImplB3DPolygon& rCandidate) const { if(mbIsClosed == rCandidate.mbIsClosed) { if(maPoints.isEqual(rCandidate.maPoints)) { - return sal_True; + return true; } } - return sal_False; + return false; } const ::basegfx::B3DPoint& getPoint(sal_uInt32 nIndex) const @@ -378,7 +378,7 @@ public: } } - sal_Bool hasDoublePoints() const + bool hasDoublePoints() const { if(mbIsClosed) { @@ -387,7 +387,7 @@ public: if(maPoints.getCoordinate(0L) == maPoints.getCoordinate(nIndex)) { - return sal_True; + return true; } } @@ -396,11 +396,11 @@ public: { if(maPoints.getCoordinate(a) == maPoints.getCoordinate(a + 1L)) { - return sal_True; + return true; } } - return sal_False; + return false; } void removeDoublePointsAtBeginEnd() @@ -486,21 +486,21 @@ namespace basegfx return *this; } - sal_Bool B3DPolygon::operator==(const B3DPolygon& rPolygon) const + bool B3DPolygon::operator==(const B3DPolygon& rPolygon) const { if(mpPolygon == rPolygon.mpPolygon) { - return sal_True; + return true; } return mpPolygon->isEqual(*(rPolygon.mpPolygon)); } - sal_Bool B3DPolygon::operator!=(const B3DPolygon& rPolygon) const + bool B3DPolygon::operator!=(const B3DPolygon& rPolygon) const { if(mpPolygon == rPolygon.mpPolygon) { - return sal_False; + return false; } return !mpPolygon->isEqual(*(rPolygon.mpPolygon)); @@ -625,12 +625,12 @@ namespace basegfx mpPolygon->incRefCount(); } - sal_Bool B3DPolygon::isClosed() const + bool B3DPolygon::isClosed() const { return mpPolygon->isClosed(); } - void B3DPolygon::setClosed(sal_Bool bNew) + void B3DPolygon::setClosed(bool bNew) { if(mpPolygon->isClosed() != bNew) { @@ -648,7 +648,7 @@ namespace basegfx } } - sal_Bool B3DPolygon::hasDoublePoints() const + bool B3DPolygon::hasDoublePoints() const { return mpPolygon->hasDoublePoints(); } diff --git a/basegfx/source/polygon/b3dpolygontools.cxx b/basegfx/source/polygon/b3dpolygontools.cxx index 9784ae5930a9..e4f2011795ae 100644 --- a/basegfx/source/polygon/b3dpolygontools.cxx +++ b/basegfx/source/polygon/b3dpolygontools.cxx @@ -2,9 +2,9 @@ * * $RCSfile: b3dpolygontools.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: aw $ $Date: 2003-11-28 11:18:07 $ + * last change: $Author: thb $ $Date: 2004-01-16 10:34:34 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -91,7 +91,7 @@ namespace basegfx while(rCandidate.count() > 1L && rCandidate.getB3DPoint(0L).equal(rCandidate.getB3DPoint(rCandidate.count() - 1L))) { - rCandidate.setClosed(sal_True); + rCandidate.setClosed(true); rCandidate.remove(rCandidate.count() - 1L); } } @@ -244,7 +244,7 @@ namespace basegfx if(nPointCount > 1L) { sal_uInt32 nIndex(0L); - sal_Bool bIndexDone(sal_False); + bool bIndexDone(false); const double fZero(0.0); double fEdgeLength(fZero); @@ -267,7 +267,7 @@ namespace basegfx { // crop to polygon start fDistance = fZero; - bIndexDone = sal_True; + bIndexDone = true; } } @@ -285,7 +285,7 @@ namespace basegfx // crop to polygon end fDistance = fZero; nIndex = nPointCount - 1L; - bIndexDone = sal_True; + bIndexDone = true; } } @@ -306,7 +306,7 @@ namespace basegfx else { // it's on this edge, stop - bIndexDone = sal_True; + bIndexDone = true; } } while (!bIndexDone); } @@ -328,7 +328,7 @@ namespace basegfx } // add calculated average value to the return value - aRetval += ::basegfx::average(aRetval, aNextPoint, fRelative); + aRetval += ::basegfx::interpolate(aRetval, aNextPoint, fRelative); } } @@ -382,11 +382,11 @@ namespace basegfx } else { - aResult.append(aStart + (aVector * fPosOnVector)); + aResult.append( B3DPoint(aStart + (aVector * fPosOnVector)) ); } // add end point - aResult.append(aStart + (aVector * (fPosOnVector + fDashDotLength))); + aResult.append( B3DPoint(aStart + (aVector * (fPosOnVector + fDashDotLength))) ); // add line to PolyPolygon aRetval.append(aResult); diff --git a/basegfx/source/polygon/b3dpolypolygon.cxx b/basegfx/source/polygon/b3dpolypolygon.cxx index bb78552b24e5..72e77b05f578 100644 --- a/basegfx/source/polygon/b3dpolypolygon.cxx +++ b/basegfx/source/polygon/b3dpolypolygon.cxx @@ -2,9 +2,9 @@ * * $RCSfile: b3dpolypolygon.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: aw $ $Date: 2003-11-28 11:18:07 $ + * last change: $Author: thb $ $Date: 2004-01-16 10:34:34 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -106,21 +106,21 @@ public: void incRefCount() { mnRefCount++; } void decRefCount() { mnRefCount--; } - sal_Bool isEqual(const ImplB3DPolyPolygon& rPolygonList) const + bool isEqual(const ImplB3DPolyPolygon& rPolygonList) const { // same polygon count? if(maPolygons.size() != rPolygonList.maPolygons.size()) - return sal_False; + return false; // if zero polygons the polys are equal if(!maPolygons.size()) - return sal_True; + return true; // compare polygon content if(maPolygons != rPolygonList.maPolygons) - return sal_False; + return false; - return sal_True; + return true; } const ::basegfx::B3DPolygon& getB3DPolygon(sal_uInt32 nIndex) const @@ -181,7 +181,7 @@ public: return maPolygons.size(); } - void setClosed(sal_Bool bNew) + void setClosed(bool bNew) { for(sal_uInt32 a(0L); a < maPolygons.size(); a++) { @@ -271,21 +271,21 @@ namespace basegfx return *this; } - sal_Bool B3DPolyPolygon::operator==(const B3DPolyPolygon& rPolyPolygon) const + bool B3DPolyPolygon::operator==(const B3DPolyPolygon& rPolyPolygon) const { if(mpPolyPolygon == rPolyPolygon.mpPolyPolygon) { - return sal_True; + return true; } return mpPolyPolygon->isEqual(*(rPolyPolygon.mpPolyPolygon)); } - sal_Bool B3DPolyPolygon::operator!=(const B3DPolyPolygon& rPolyPolygon) const + bool B3DPolyPolygon::operator!=(const B3DPolyPolygon& rPolyPolygon) const { if(mpPolyPolygon == rPolyPolygon.mpPolyPolygon) { - return sal_False; + return false; } return !mpPolyPolygon->isEqual(*(rPolyPolygon.mpPolyPolygon)); @@ -380,9 +380,9 @@ namespace basegfx mpPolyPolygon->incRefCount(); } - sal_Bool B3DPolyPolygon::isClosed() const + bool B3DPolyPolygon::isClosed() const { - sal_Bool bRetval(sal_True); + bool bRetval(true); // PolyPOlygon is closed when all contained Polygons are closed or // no Polygon exists. @@ -390,14 +390,14 @@ namespace basegfx { if(!(mpPolyPolygon->getB3DPolygon(a)).isClosed()) { - bRetval = sal_False; + bRetval = false; } } return bRetval; } - void B3DPolyPolygon::setClosed(sal_Bool bNew) + void B3DPolyPolygon::setClosed(bool bNew) { if(bNew != isClosed()) { @@ -412,15 +412,15 @@ namespace basegfx mpPolyPolygon->flip(); } - sal_Bool B3DPolyPolygon::hasDoublePoints() const + bool B3DPolyPolygon::hasDoublePoints() const { - sal_Bool bRetval(sal_False); + bool bRetval(false); for(sal_uInt32 a(0L); !bRetval && a < mpPolyPolygon->count(); a++) { if((mpPolyPolygon->getB3DPolygon(a)).hasDoublePoints()) { - bRetval = sal_True; + bRetval = true; } } |