diff options
author | Noel Grandin <noel@peralex.com> | 2015-06-03 09:32:33 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-06-04 08:30:24 +0200 |
commit | 397a0afd3b3dd597f23bfbc75543eaead8bab5d2 (patch) | |
tree | a9eb5993ffd80cc8b88b2f011be10d8167049bd6 /basegfx/source | |
parent | 94d92d00fa756ecb1865e56110ceca920fbaa8ac (diff) |
convert B2VectorOrientation to scoped enum
Change-Id: Id7e444bc896ae5d52e5a0bd1b471679c4945afa4
Diffstat (limited to 'basegfx/source')
-rw-r--r-- | basegfx/source/polygon/b2dlinegeometry.cxx | 8 | ||||
-rw-r--r-- | basegfx/source/polygon/b2dpolygontools.cxx | 28 | ||||
-rw-r--r-- | basegfx/source/polygon/b2dpolygontriangulator.cxx | 2 | ||||
-rw-r--r-- | basegfx/source/polygon/b2dpolypolygoncutter.cxx | 16 | ||||
-rw-r--r-- | basegfx/source/polygon/b2dpolypolygontools.cxx | 4 | ||||
-rw-r--r-- | basegfx/source/range/b2drangeclipper.cxx | 4 | ||||
-rw-r--r-- | basegfx/source/tools/b2dclipstate.cxx | 2 | ||||
-rw-r--r-- | basegfx/source/vector/b2dvector.cxx | 6 |
8 files changed, 35 insertions, 35 deletions
diff --git a/basegfx/source/polygon/b2dlinegeometry.cxx b/basegfx/source/polygon/b2dlinegeometry.cxx index 860161d6af67..ddd215e54f1c 100644 --- a/basegfx/source/polygon/b2dlinegeometry.cxx +++ b/basegfx/source/polygon/b2dlinegeometry.cxx @@ -864,7 +864,7 @@ namespace basegfx B2DVector aTangentEdge(aEdge.getTangent(0.0)); aTangentEdge.normalize(); B2VectorOrientation aOrientation(getOrientation(aTangentPrev, aTangentEdge)); - if(ORIENTATION_NEUTRAL == aOrientation) + if(B2VectorOrientation::Neutral == aOrientation) { // they are parallell or empty; if they are both not zero and point // in opposite direction, a half-circle is needed @@ -876,12 +876,12 @@ namespace basegfx { // for half-circle production, fallback to positive // orientation - aOrientation = ORIENTATION_POSITIVE; + aOrientation = B2VectorOrientation::Positive; } } } - if(ORIENTATION_POSITIVE == aOrientation) + if(B2VectorOrientation::Positive == aOrientation) { const B2DVector aPerpendPrev(getPerpendicular(aTangentPrev) * -fHalfLineWidth); const B2DVector aPerpendEdge(getPerpendicular(aTangentEdge) * -fHalfLineWidth); @@ -897,7 +897,7 @@ namespace basegfx eJoin, fMiterMinimumAngle)); } - else if(ORIENTATION_NEGATIVE == aOrientation) + else if(B2VectorOrientation::Negative == aOrientation) { const B2DVector aPerpendPrev(getPerpendicular(aTangentPrev) * fHalfLineWidth); const B2DVector aPerpendEdge(getPerpendicular(aTangentEdge) * fHalfLineWidth); diff --git a/basegfx/source/polygon/b2dpolygontools.cxx b/basegfx/source/polygon/b2dpolygontools.cxx index 02c44d818b0e..41b40f4190f9 100644 --- a/basegfx/source/polygon/b2dpolygontools.cxx +++ b/basegfx/source/polygon/b2dpolygontools.cxx @@ -138,7 +138,7 @@ namespace basegfx B2VectorOrientation getOrientation(const B2DPolygon& rCandidate) { - B2VectorOrientation eRetval(ORIENTATION_NEUTRAL); + B2VectorOrientation eRetval(B2VectorOrientation::Neutral); if(rCandidate.count() > 2L || rCandidate.areControlPointsUsed()) { @@ -146,15 +146,15 @@ namespace basegfx if(fTools::equalZero(fSignedArea)) { - // ORIENTATION_NEUTRAL, already set + // B2VectorOrientation::Neutral, already set } if(fSignedArea > 0.0) { - eRetval = ORIENTATION_POSITIVE; + eRetval = B2VectorOrientation::Positive; } else if(fSignedArea < 0.0) { - eRetval = ORIENTATION_NEGATIVE; + eRetval = B2VectorOrientation::Negative; } } @@ -1981,7 +1981,7 @@ namespace basegfx const B2DVector aNextVec(aNextPoint - aCurrPoint); const B2VectorOrientation aOrientation(getOrientation(aNextVec, aPrevVec)); - if(ORIENTATION_NEUTRAL == aOrientation) + if(B2VectorOrientation::Neutral == aOrientation) { // current has neutral orientation return true; @@ -2014,7 +2014,7 @@ namespace basegfx const B2DVector aNextVec(aNextPoint - aCurrPoint); const B2VectorOrientation aOrientation(getOrientation(aNextVec, aPrevVec)); - if(ORIENTATION_NEUTRAL == aOrientation) + if(B2VectorOrientation::Neutral == aOrientation) { // current has neutral orientation, leave it out and prepare next aCurrPoint = aNextPoint; @@ -2030,7 +2030,7 @@ namespace basegfx } } - while(aRetval.count() && ORIENTATION_NEUTRAL == getOrientationForIndex(aRetval, 0L)) + while(aRetval.count() && B2VectorOrientation::Neutral == getOrientationForIndex(aRetval, 0L)) { aRetval.remove(0L); } @@ -2056,7 +2056,7 @@ namespace basegfx const B2DPoint aPrevPoint(rCandidate.getB2DPoint(nPointCount - 1L)); B2DPoint aCurrPoint(rCandidate.getB2DPoint(0L)); B2DVector aCurrVec(aPrevPoint - aCurrPoint); - B2VectorOrientation aOrientation(ORIENTATION_NEUTRAL); + B2VectorOrientation aOrientation(B2VectorOrientation::Neutral); for(sal_uInt32 a(0L); a < nPointCount; a++) { @@ -2064,14 +2064,14 @@ namespace basegfx const B2DVector aNextVec(aNextPoint - aCurrPoint); const B2VectorOrientation aCurrentOrientation(getOrientation(aNextVec, aCurrVec)); - if(ORIENTATION_NEUTRAL == aOrientation) + if(B2VectorOrientation::Neutral == aOrientation) { // set start value, maybe neutral again aOrientation = aCurrentOrientation; } else { - if(ORIENTATION_NEUTRAL != aCurrentOrientation && aCurrentOrientation != aOrientation) + if(B2VectorOrientation::Neutral != aCurrentOrientation && aCurrentOrientation != aOrientation) { // different orientations found, that's it return false; @@ -2674,7 +2674,7 @@ namespace basegfx aVectorNext.normalize(); const B2VectorOrientation aOrientation(getOrientation(aVectorPrev, aVectorNext)); - if(ORIENTATION_NEUTRAL == aOrientation && aVectorPrev.scalar(aVectorNext) < 0.0) + if(B2VectorOrientation::Neutral == aOrientation && aVectorPrev.scalar(aVectorNext) < 0.0) { // parallel and opposite direction; check length if(fTools::equal(fLenPrev, fLenNext)) @@ -2696,7 +2696,7 @@ namespace basegfx // not parallel or same direction, set vectors and length const B2DVector aNormalizedPerpendicular(getNormalizedPerpendicular(aVectorPrev + aVectorNext)); - if(ORIENTATION_POSITIVE == aOrientation) + if(B2VectorOrientation::Positive == aOrientation) { rCandidate.setControlPoints(nIndex, aCurrentPoint - (aNormalizedPerpendicular * fLenPrev), @@ -2726,7 +2726,7 @@ namespace basegfx aVectorNext.normalize(); const B2VectorOrientation aOrientation(getOrientation(aVectorPrev, aVectorNext)); - if(ORIENTATION_NEUTRAL == aOrientation && aVectorPrev.scalar(aVectorNext) < 0.0) + if(B2VectorOrientation::Neutral == aOrientation && aVectorPrev.scalar(aVectorNext) < 0.0) { // parallel and opposite direction; set length. Use one direction for better numerical correctness const B2DVector aScaledDirection(aVectorPrev * fCommonLength); @@ -2741,7 +2741,7 @@ namespace basegfx const B2DVector aNormalizedPerpendicular(getNormalizedPerpendicular(aVectorPrev + aVectorNext)); const B2DVector aPerpendicular(aNormalizedPerpendicular * fCommonLength); - if(ORIENTATION_POSITIVE == aOrientation) + if(B2VectorOrientation::Positive == aOrientation) { rCandidate.setControlPoints(nIndex, aCurrentPoint - aPerpendicular, diff --git a/basegfx/source/polygon/b2dpolygontriangulator.cxx b/basegfx/source/polygon/b2dpolygontriangulator.cxx index 0f02913ffeb5..27ebf64955d2 100644 --- a/basegfx/source/polygon/b2dpolygontriangulator.cxx +++ b/basegfx/source/polygon/b2dpolygontriangulator.cxx @@ -284,7 +284,7 @@ namespace basegfx const B2DVector aLeft(pEdgeA->getEnd() - pEdgeA->getStart()); const B2DVector aRight(pEdgeB->getEnd() - pEdgeA->getStart()); - if(ORIENTATION_NEUTRAL == getOrientation(aLeft, aRight)) + if(B2VectorOrientation::Neutral == getOrientation(aLeft, aRight)) { // edges are parallel and have different length -> neutral triangle, // delete both edges and handle closing edge diff --git a/basegfx/source/polygon/b2dpolypolygoncutter.cxx b/basegfx/source/polygon/b2dpolypolygoncutter.cxx index c0d080be18c0..106e217a2308 100644 --- a/basegfx/source/polygon/b2dpolypolygoncutter.cxx +++ b/basegfx/source/polygon/b2dpolypolygoncutter.cxx @@ -713,7 +713,7 @@ namespace basegfx { const B2DPolygon aCandidate(rCandidate.getB2DPolygon(a)); - if(ORIENTATION_NEUTRAL != tools::getOrientation(aCandidate)) + if(B2VectorOrientation::Neutral != tools::getOrientation(aCandidate)) { aRetval.append(aCandidate); } @@ -756,7 +756,7 @@ namespace basegfx pNewHelper->meOrinetation = tools::getOrientation(aCand); // initialize with own orientation - pNewHelper->mnDepth = (ORIENTATION_NEGATIVE == pNewHelper->meOrinetation ? -1 : 1); + pNewHelper->mnDepth = (B2VectorOrientation::Negative == pNewHelper->meOrinetation ? -1 : 1); } for(a = 0; a < nCount - 1; a++) @@ -773,7 +773,7 @@ namespace basegfx if(bAInB) { // A is inside B, add orientation of B to A - rHelperA.mnDepth += (ORIENTATION_NEGATIVE == rHelperB.meOrinetation ? -1 : 1); + rHelperA.mnDepth += (B2VectorOrientation::Negative == rHelperB.meOrinetation ? -1 : 1); } const bool bBInA(rHelperA.maRange.isInside(rHelperB.maRange) && tools::isInside(aCandA, aCandB, true)); @@ -781,7 +781,7 @@ namespace basegfx if(bBInA) { // B is inside A, add orientation of A to B - rHelperB.mnDepth += (ORIENTATION_NEGATIVE == rHelperA.meOrinetation ? -1 : 1); + rHelperB.mnDepth += (B2VectorOrientation::Negative == rHelperA.meOrinetation ? -1 : 1); } } } @@ -817,7 +817,7 @@ namespace basegfx { if(nCount == 1L) { - if(!bKeepAboveZero && ORIENTATION_POSITIVE == tools::getOrientation(rCandidate.getB2DPolygon(0L))) + if(!bKeepAboveZero && B2VectorOrientation::Positive == tools::getOrientation(rCandidate.getB2DPolygon(0L))) { aRetval = rCandidate; } @@ -834,7 +834,7 @@ namespace basegfx StripHelper* pNewHelper = &(aHelpers[a]); pNewHelper->maRange = tools::getRange(aCandidate); pNewHelper->meOrinetation = tools::getOrientation(aCandidate); - pNewHelper->mnDepth = (ORIENTATION_NEGATIVE == pNewHelper->meOrinetation ? -1L : 0L); + pNewHelper->mnDepth = (B2VectorOrientation::Negative == pNewHelper->meOrinetation ? -1L : 0L); } for(a = 0L; a < nCount - 1L; a++) @@ -870,7 +870,7 @@ namespace basegfx { if(bAInB) { - if(ORIENTATION_NEGATIVE == rHelperB.meOrinetation) + if(B2VectorOrientation::Negative == rHelperB.meOrinetation) { rHelperA.mnDepth--; } @@ -881,7 +881,7 @@ namespace basegfx } else if(bBInA) { - if(ORIENTATION_NEGATIVE == rHelperA.meOrinetation) + if(B2VectorOrientation::Negative == rHelperA.meOrinetation) { rHelperB.mnDepth--; } diff --git a/basegfx/source/polygon/b2dpolypolygontools.cxx b/basegfx/source/polygon/b2dpolypolygontools.cxx index 37526219d992..5dc1cbce20a8 100644 --- a/basegfx/source/polygon/b2dpolypolygontools.cxx +++ b/basegfx/source/polygon/b2dpolypolygontools.cxx @@ -55,9 +55,9 @@ namespace basegfx } const bool bShallBeHole(1L == (nDepth & 0x00000001)); - const bool bIsHole(ORIENTATION_NEGATIVE == aOrientation); + const bool bIsHole(B2VectorOrientation::Negative == aOrientation); - if(bShallBeHole != bIsHole && ORIENTATION_NEUTRAL != aOrientation) + if(bShallBeHole != bIsHole && B2VectorOrientation::Neutral != aOrientation) { B2DPolygon aFlipped(aCandidate); aFlipped.flip(); diff --git a/basegfx/source/range/b2drangeclipper.cxx b/basegfx/source/range/b2drangeclipper.cxx index edbb12803d45..a62f44e177e4 100644 --- a/basegfx/source/range/b2drangeclipper.cxx +++ b/basegfx/source/range/b2drangeclipper.cxx @@ -570,7 +570,7 @@ namespace basegfx SweepLineEvent( rCurrRect.getMinX(), rCurrRect, SweepLineEvent::STARTING_EDGE, - (*aCurrOrientation++) == ORIENTATION_POSITIVE ? + (*aCurrOrientation++) == B2VectorOrientation::Positive ? SweepLineEvent::PROCEED_UP : SweepLineEvent::PROCEED_DOWN) ); } @@ -586,7 +586,7 @@ namespace basegfx SweepLineEvent( rCurrRect.getMaxX(), rCurrRect, SweepLineEvent::FINISHING_EDGE, - (*aCurrOrientationR++) == ORIENTATION_POSITIVE ? + (*aCurrOrientationR++) == B2VectorOrientation::Positive ? SweepLineEvent::PROCEED_DOWN : SweepLineEvent::PROCEED_UP ) ); } diff --git a/basegfx/source/tools/b2dclipstate.cxx b/basegfx/source/tools/b2dclipstate.cxx index 54d2797f245d..90e5b31b8489 100644 --- a/basegfx/source/tools/b2dclipstate.cxx +++ b/basegfx/source/tools/b2dclipstate.cxx @@ -102,7 +102,7 @@ namespace tools mePendingOps = eOp; maPendingRanges.appendElement( rRange, - ORIENTATION_POSITIVE); + B2VectorOrientation::Positive); } void addPolyPolygon(B2DPolyPolygon aPoly, Operation eOp) diff --git a/basegfx/source/vector/b2dvector.cxx b/basegfx/source/vector/b2dvector.cxx index 2a08fab110fd..4c23f51c03c2 100644 --- a/basegfx/source/vector/b2dvector.cxx +++ b/basegfx/source/vector/b2dvector.cxx @@ -129,16 +129,16 @@ namespace basegfx if(fTools::equalZero(fVal)) { - return ORIENTATION_NEUTRAL; + return B2VectorOrientation::Neutral; } if(fVal > 0.0) { - return ORIENTATION_POSITIVE; + return B2VectorOrientation::Positive; } else { - return ORIENTATION_NEGATIVE; + return B2VectorOrientation::Negative; } } |