summaryrefslogtreecommitdiff
path: root/basegfx
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-03-26 15:39:26 +0200
committerNoel Grandin <noel@peralex.com>2015-03-27 08:33:44 +0200
commit9bccd26037188f20fec244bede3022900d1b96fa (patch)
tree4751478fa7608813568c5a3c5777d0b87117110c /basegfx
parenta1d10eb8d7ee73d901041fdf550d2196a63c9d1d (diff)
convert CUTFLAG_ constants to enum class
Change-Id: I98dc5488954a4d46f7e0158790a4c3dabebfc1b3
Diffstat (limited to 'basegfx')
-rw-r--r--basegfx/source/polygon/b2dlinegeometry.cxx14
-rw-r--r--basegfx/source/polygon/b2dpolygontools.cxx44
-rw-r--r--basegfx/source/polygon/b2dtrapezoid.cxx4
3 files changed, 31 insertions, 31 deletions
diff --git a/basegfx/source/polygon/b2dlinegeometry.cxx b/basegfx/source/polygon/b2dlinegeometry.cxx
index 78a722b092d8..860161d6af67 100644
--- a/basegfx/source/polygon/b2dlinegeometry.cxx
+++ b/basegfx/source/polygon/b2dlinegeometry.cxx
@@ -359,21 +359,21 @@ namespace basegfx
const B2DVector aPerpendStartA(aNormalizedPerpendicularA * -fHalfLineWidth);
const B2DVector aPerpendEndA(aNormalizedPerpendicularB * -fHalfLineWidth);
double fCutA(0.0);
- const tools::CutFlagValue aCutA(tools::findCut(
+ const CutFlagValue aCutA(tools::findCut(
rEdge.getStartPoint(), aPerpendStartA,
rEdge.getEndPoint(), aPerpendEndA,
- CUTFLAG_ALL, &fCutA));
- const bool bCutA(CUTFLAG_NONE != aCutA);
+ CutFlagValue::ALL, &fCutA));
+ const bool bCutA(CutFlagValue::NONE != aCutA);
// create lower displacement vectors and check if they cut
const B2DVector aPerpendStartB(aNormalizedPerpendicularA * fHalfLineWidth);
const B2DVector aPerpendEndB(aNormalizedPerpendicularB * fHalfLineWidth);
double fCutB(0.0);
- const tools::CutFlagValue aCutB(tools::findCut(
+ const CutFlagValue aCutB(tools::findCut(
rEdge.getEndPoint(), aPerpendEndB,
rEdge.getStartPoint(), aPerpendStartB,
- CUTFLAG_ALL, &fCutB));
- const bool bCutB(CUTFLAG_NONE != aCutB);
+ CutFlagValue::ALL, &fCutB));
+ const bool bCutB(CutFlagValue::NONE != aCutB);
// check if cut happens
const bool bCut(bCutA || bCutB);
@@ -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, CUTFLAG_ALL, &fCutPos);
+ tools::findCut(aStartPoint, rTangentPrev, aEndPoint, rTangentEdge, CutFlagValue::ALL, &fCutPos);
if(0.0 != fCutPos)
{
diff --git a/basegfx/source/polygon/b2dpolygontools.cxx b/basegfx/source/polygon/b2dpolygontools.cxx
index 09cb226bdc40..ba27b93f7f09 100644
--- a/basegfx/source/polygon/b2dpolygontools.cxx
+++ b/basegfx/source/polygon/b2dpolygontools.cxx
@@ -947,28 +947,28 @@ namespace basegfx
CutFlagValue aCutFlags,
double* pCut1, double* pCut2)
{
- CutFlagValue aRetval(CUTFLAG_NONE);
+ CutFlagValue aRetval(CutFlagValue::NONE);
double fCut1(0.0);
double fCut2(0.0);
- bool bFinished(!((bool)(aCutFlags & CUTFLAG_ALL)));
+ bool bFinished(!((bool)(aCutFlags & CutFlagValue::ALL)));
// test for same points?
if(!bFinished
- && (aCutFlags & (CUTFLAG_START1|CUTFLAG_END1))
- && (aCutFlags & (CUTFLAG_START2|CUTFLAG_END2)))
+ && (aCutFlags & (CutFlagValue::START1|CutFlagValue::END1))
+ && (aCutFlags & (CutFlagValue::START2|CutFlagValue::END2)))
{
// same startpoint?
- if(!bFinished && (aCutFlags & (CUTFLAG_START1|CUTFLAG_START2)) == (CUTFLAG_START1|CUTFLAG_START2))
+ if(!bFinished && (aCutFlags & (CutFlagValue::START1|CutFlagValue::START2)) == (CutFlagValue::START1|CutFlagValue::START2))
{
if(rEdge1Start.equal(rEdge2Start))
{
bFinished = true;
- aRetval = (CUTFLAG_START1|CUTFLAG_START2);
+ aRetval = (CutFlagValue::START1|CutFlagValue::START2);
}
}
// same endpoint?
- if(!bFinished && (aCutFlags & (CUTFLAG_END1|CUTFLAG_END2)) == (CUTFLAG_END1|CUTFLAG_END2))
+ if(!bFinished && (aCutFlags & (CutFlagValue::END1|CutFlagValue::END2)) == (CutFlagValue::END1|CutFlagValue::END2))
{
const B2DPoint aEnd1(rEdge1Start + rEdge1Delta);
const B2DPoint aEnd2(rEdge2Start + rEdge2Delta);
@@ -976,63 +976,63 @@ namespace basegfx
if(aEnd1.equal(aEnd2))
{
bFinished = true;
- aRetval = (CUTFLAG_END1|CUTFLAG_END2);
+ aRetval = (CutFlagValue::END1|CutFlagValue::END2);
fCut1 = fCut2 = 1.0;
}
}
// startpoint1 == endpoint2?
- if(!bFinished && (aCutFlags & (CUTFLAG_START1|CUTFLAG_END2)) == (CUTFLAG_START1|CUTFLAG_END2))
+ if(!bFinished && (aCutFlags & (CutFlagValue::START1|CutFlagValue::END2)) == (CutFlagValue::START1|CutFlagValue::END2))
{
const B2DPoint aEnd2(rEdge2Start + rEdge2Delta);
if(rEdge1Start.equal(aEnd2))
{
bFinished = true;
- aRetval = (CUTFLAG_START1|CUTFLAG_END2);
+ aRetval = (CutFlagValue::START1|CutFlagValue::END2);
fCut1 = 0.0;
fCut2 = 1.0;
}
}
// startpoint2 == endpoint1?
- if(!bFinished&& (aCutFlags & (CUTFLAG_START2|CUTFLAG_END1)) == (CUTFLAG_START2|CUTFLAG_END1))
+ if(!bFinished&& (aCutFlags & (CutFlagValue::START2|CutFlagValue::END1)) == (CutFlagValue::START2|CutFlagValue::END1))
{
const B2DPoint aEnd1(rEdge1Start + rEdge1Delta);
if(rEdge2Start.equal(aEnd1))
{
bFinished = true;
- aRetval = (CUTFLAG_START2|CUTFLAG_END1);
+ aRetval = (CutFlagValue::START2|CutFlagValue::END1);
fCut1 = 1.0;
fCut2 = 0.0;
}
}
}
- if(!bFinished && (aCutFlags & CUTFLAG_LINE))
+ if(!bFinished && (aCutFlags & CutFlagValue::LINE))
{
- if(!bFinished && (aCutFlags & CUTFLAG_START1))
+ if(!bFinished && (aCutFlags & CutFlagValue::START1))
{
// start1 on line 2 ?
if(isPointOnEdge(rEdge1Start, rEdge2Start, rEdge2Delta, &fCut2))
{
bFinished = true;
- aRetval = (CUTFLAG_LINE|CUTFLAG_START1);
+ aRetval = (CutFlagValue::LINE|CutFlagValue::START1);
}
}
- if(!bFinished && (aCutFlags & CUTFLAG_START2))
+ if(!bFinished && (aCutFlags & CutFlagValue::START2))
{
// start2 on line 1 ?
if(isPointOnEdge(rEdge2Start, rEdge1Start, rEdge1Delta, &fCut1))
{
bFinished = true;
- aRetval = (CUTFLAG_LINE|CUTFLAG_START2);
+ aRetval = (CutFlagValue::LINE|CutFlagValue::START2);
}
}
- if(!bFinished && (aCutFlags & CUTFLAG_END1))
+ if(!bFinished && (aCutFlags & CutFlagValue::END1))
{
// end1 on line 2 ?
const B2DPoint aEnd1(rEdge1Start + rEdge1Delta);
@@ -1040,11 +1040,11 @@ namespace basegfx
if(isPointOnEdge(aEnd1, rEdge2Start, rEdge2Delta, &fCut2))
{
bFinished = true;
- aRetval = (CUTFLAG_LINE|CUTFLAG_END1);
+ aRetval = (CutFlagValue::LINE|CutFlagValue::END1);
}
}
- if(!bFinished && (aCutFlags & CUTFLAG_END2))
+ if(!bFinished && (aCutFlags & CutFlagValue::END2))
{
// end2 on line 1 ?
const B2DPoint aEnd2(rEdge2Start + rEdge2Delta);
@@ -1052,7 +1052,7 @@ namespace basegfx
if(isPointOnEdge(aEnd2, rEdge1Start, rEdge1Delta, &fCut1))
{
bFinished = true;
- aRetval = (CUTFLAG_LINE|CUTFLAG_END2);
+ aRetval = (CutFlagValue::LINE|CutFlagValue::END2);
}
}
@@ -1088,7 +1088,7 @@ namespace basegfx
// inside parameter range edge2, too
if(fTools::more(fCut2, fZero) && fTools::less(fCut2, fOne))
{
- aRetval = CUTFLAG_LINE;
+ aRetval = CutFlagValue::LINE;
}
}
}
diff --git a/basegfx/source/polygon/b2dtrapezoid.cxx b/basegfx/source/polygon/b2dtrapezoid.cxx
index a5ac050af4fe..b813e03a9b85 100644
--- a/basegfx/source/polygon/b2dtrapezoid.cxx
+++ b/basegfx/source/polygon/b2dtrapezoid.cxx
@@ -390,9 +390,9 @@ namespace basegfx
if(tools::findCut(
aEdgeA.getStart(), aDeltaA,
aEdgeB.getStart(), aDeltaB,
- CUTFLAG_LINE,
+ CutFlagValue::LINE,
&fCutA,
- &fCutB))
+ &fCutB) != CutFlagValue::NONE)
{
// use a simple metric (length criteria) for choosing the numerically
// better cut