Kaydet (Commit) 1d92933d authored tarafından Noel Grandin's avatar Noel Grandin

convert B2VectorContinuity to scoped enum

Change-Id: Ifa401dd0d2d1bef8c0ae2987d2aee86100b59816
üst 397a0afd
......@@ -1336,7 +1336,7 @@ namespace basegfx
}
else
{
return CONTINUITY_NONE;
return B2VectorContinuity::NONE;
}
}
......
......@@ -2625,7 +2625,7 @@ namespace basegfx
switch(eContinuity)
{
case CONTINUITY_NONE :
case B2VectorContinuity::NONE :
{
if(rCandidate.isPrevControlPointUsed(nIndex))
{
......@@ -2661,7 +2661,7 @@ namespace basegfx
break;
}
case CONTINUITY_C1 :
case B2VectorContinuity::C1 :
{
if(rCandidate.isPrevControlPointUsed(nIndex) && rCandidate.isNextControlPointUsed(nIndex))
{
......@@ -2714,7 +2714,7 @@ namespace basegfx
}
break;
}
case CONTINUITY_C2 :
case B2VectorContinuity::C2 :
{
if(rCandidate.isPrevControlPointUsed(nIndex) && rCandidate.isNextControlPointUsed(nIndex))
{
......@@ -3557,11 +3557,11 @@ namespace basegfx
{
const B2VectorContinuity eCont(rPolygon.getContinuityInPoint(a));
if(CONTINUITY_C1 == eCont)
if(B2VectorContinuity::C1 == eCont)
{
aCollectFlags[nStartPointIndex] = com::sun::star::drawing::PolygonFlags_SMOOTH;
}
else if(CONTINUITY_C2 == eCont)
else if(B2VectorContinuity::C2 == eCont)
{
aCollectFlags[nStartPointIndex] = com::sun::star::drawing::PolygonFlags_SYMMETRIC;
}
......
......@@ -758,7 +758,7 @@ namespace basegfx
// is necessary.
const bool bSymmetricAtEdgeStart(
0 != nIndex
&& CONTINUITY_C2 == aPolygon.getContinuityInPoint(nIndex));
&& B2VectorContinuity::C2 == aPolygon.getContinuityInPoint(nIndex));
if(bDetectQuadraticBeziers)
{
......
......@@ -214,11 +214,11 @@ namespace unotools
{
const basegfx::B2VectorContinuity eCont(rPoly.getContinuityInPoint(b));
if(basegfx::CONTINUITY_C1 == eCont)
if(basegfx::B2VectorContinuity::C1 == eCont)
{
aFlags[nStartPointIndex] = drawing::PolygonFlags_SMOOTH;
}
else if(basegfx::CONTINUITY_C2 == eCont)
else if(basegfx::B2VectorContinuity::C2 == eCont)
{
aFlags[nStartPointIndex] = drawing::PolygonFlags_SYMMETRIC;
}
......
......@@ -168,22 +168,22 @@ namespace basegfx
{
if(rBackVector.equalZero() || rForwardVector.equalZero())
{
return CONTINUITY_NONE;
return B2VectorContinuity::NONE;
}
if(fTools::equal(rBackVector.getX(), -rForwardVector.getX()) && fTools::equal(rBackVector.getY(), -rForwardVector.getY()))
{
// same direction and same length -> C2
return CONTINUITY_C2;
return B2VectorContinuity::C2;
}
if(areParallel(rBackVector, rForwardVector) && rBackVector.scalar(rForwardVector) < 0.0)
{
// parallel and opposite direction -> C1
return CONTINUITY_C1;
return B2VectorContinuity::C1;
}
return CONTINUITY_NONE;
return B2VectorContinuity::NONE;
}
} // end of namespace basegfx
......
......@@ -737,7 +737,7 @@ public:
CPPUNIT_ASSERT_MESSAGE("areControlPointsUsed() wrong",
aPoly.areControlPointsUsed());
CPPUNIT_ASSERT_MESSAGE("getContinuityInPoint() wrong",
aPoly.getContinuityInPoint(0) == CONTINUITY_C2);
aPoly.getContinuityInPoint(0) == B2VectorContinuity::C2);
aPoly.resetControlPoints();
CPPUNIT_ASSERT_MESSAGE("resetControlPoints() did not clear",
......
......@@ -43,13 +43,13 @@ namespace basegfx
enum B2VectorContinuity
{
/// none
CONTINUITY_NONE = 0,
NONE = 0,
/// mathematically negative oriented
CONTINUITY_C1,
C1,
/// mathematically neutral, thus parallel
CONTINUITY_C2
C2
};
/** Descriptor for possible line joins between two line segments
......
......@@ -869,7 +869,7 @@ void MotionPathTag::CheckPossibilities()
bool bCurve(false);
bool bSmoothFuz(false);
bool bSegmFuz(false);
basegfx::B2VectorContinuity eSmooth = basegfx::CONTINUITY_NONE;
basegfx::B2VectorContinuity eSmooth = basegfx::B2VectorContinuity::NONE;
mrView.CheckPolyPossibilitiesHelper( mpMark, b1stSmooth, b1stSegm, bCurve, bSmoothFuz, bSegmFuz, eSmooth );
}
......@@ -1136,15 +1136,15 @@ void MotionPathTag::SetMarkedPointsSmooth(SdrPathSmoothKind eKind)
if(SDRPATHSMOOTH_ANGULAR == eKind)
{
eFlags = basegfx::CONTINUITY_NONE;
eFlags = basegfx::B2VectorContinuity::NONE;
}
else if(SDRPATHSMOOTH_ASYMMETRIC == eKind)
{
eFlags = basegfx::CONTINUITY_C1;
eFlags = basegfx::B2VectorContinuity::C1;
}
else if(SDRPATHSMOOTH_SYMMETRIC == eKind)
{
eFlags = basegfx::CONTINUITY_C2;
eFlags = basegfx::B2VectorContinuity::C2;
}
else
{
......
......@@ -72,7 +72,7 @@ void SdrPolyEditView::ImpCheckPolyPossibilities()
bool bCurve(false);
bool bSmoothFuz(false);
bool bSegmFuz(false);
basegfx::B2VectorContinuity eSmooth = basegfx::CONTINUITY_NONE;
basegfx::B2VectorContinuity eSmooth = basegfx::B2VectorContinuity::NONE;
for(size_t nMarkNum = 0; nMarkNum < nMarkCount; ++nMarkNum)
{
......@@ -152,17 +152,17 @@ void SdrPolyEditView::CheckPolyPossibilitiesHelper( SdrMark* pM, bool& b1stSmoot
if(!b1stSmooth && !bSmoothFuz)
{
if(basegfx::CONTINUITY_NONE == eSmooth)
if(basegfx::B2VectorContinuity::NONE == eSmooth)
{
eMarkedPointsSmooth = SDRPATHSMOOTH_ANGULAR;
}
if(basegfx::CONTINUITY_C1 == eSmooth)
if(basegfx::B2VectorContinuity::C1 == eSmooth)
{
eMarkedPointsSmooth = SDRPATHSMOOTH_ASYMMETRIC;
}
if(basegfx::CONTINUITY_C2 == eSmooth)
if(basegfx::B2VectorContinuity::C2 == eSmooth)
{
eMarkedPointsSmooth = SDRPATHSMOOTH_SYMMETRIC;
}
......@@ -182,15 +182,15 @@ void SdrPolyEditView::SetMarkedPointsSmooth(SdrPathSmoothKind eKind)
if(SDRPATHSMOOTH_ANGULAR == eKind)
{
eFlags = basegfx::CONTINUITY_NONE;
eFlags = basegfx::B2VectorContinuity::NONE;
}
else if(SDRPATHSMOOTH_ASYMMETRIC == eKind)
{
eFlags = basegfx::CONTINUITY_C1;
eFlags = basegfx::B2VectorContinuity::C1;
}
else if(SDRPATHSMOOTH_SYMMETRIC == eKind)
{
eFlags = basegfx::CONTINUITY_C2;
eFlags = basegfx::B2VectorContinuity::C2;
}
else
{
......
......@@ -1872,11 +1872,11 @@ Polygon::Polygon(const basegfx::B2DPolygon& rPolygon)
{
const basegfx::B2VectorContinuity eCont(rPolygon.getContinuityInPoint(a));
if(basegfx::CONTINUITY_C1 == eCont)
if(basegfx::B2VectorContinuity::C1 == eCont)
{
mpImplPolygon->mpFlagAry[nStartPointIndex] = (sal_uInt8)POLY_SMOOTH;
}
else if(basegfx::CONTINUITY_C2 == eCont)
else if(basegfx::B2VectorContinuity::C2 == eCont)
{
mpImplPolygon->mpFlagAry[nStartPointIndex] = (sal_uInt8)POLY_SYMMTR;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment