Sketcher: Convert PointPos into an enum CLASS

This commit is contained in:
Abdullah Tahiri
2021-12-11 14:43:57 +01:00
parent 182596ba08
commit 44567167ff
22 changed files with 845 additions and 843 deletions

View File

@@ -125,59 +125,59 @@ Base::Vector3d GeoListModel<T>::getPoint(const Part::Geometry * geo, Sketcher::P
if (geo->getTypeId() == Part::GeomPoint::getClassTypeId()) {
const Part::GeomPoint *p = static_cast<const Part::GeomPoint*>(geo);
if (pos == start || pos == mid || pos == end)
if (pos == PointPos::start || pos == PointPos::mid || pos == PointPos::end)
return p->getPoint();
} else if (geo->getTypeId() == Part::GeomLineSegment::getClassTypeId()) {
const Part::GeomLineSegment *lineSeg = static_cast<const Part::GeomLineSegment*>(geo);
if (pos == start)
if (pos == PointPos::start)
return lineSeg->getStartPoint();
else if (pos == end)
else if (pos == PointPos::end)
return lineSeg->getEndPoint();
} else if (geo->getTypeId() == Part::GeomCircle::getClassTypeId()) {
const Part::GeomCircle *circle = static_cast<const Part::GeomCircle*>(geo);
if (pos == mid)
if (pos == PointPos::mid)
return circle->getCenter();
} else if (geo->getTypeId() == Part::GeomEllipse::getClassTypeId()) {
const Part::GeomEllipse *ellipse = static_cast<const Part::GeomEllipse*>(geo);
if (pos == mid)
if (pos == PointPos::mid)
return ellipse->getCenter();
} else if (geo->getTypeId() == Part::GeomArcOfCircle::getClassTypeId()) {
const Part::GeomArcOfCircle *aoc = static_cast<const Part::GeomArcOfCircle*>(geo);
if (pos == start)
if (pos == PointPos::start)
return aoc->getStartPoint(/*emulateCCW=*/true);
else if (pos == end)
else if (pos == PointPos::end)
return aoc->getEndPoint(/*emulateCCW=*/true);
else if (pos == mid)
else if (pos == PointPos::mid)
return aoc->getCenter();
} else if (geo->getTypeId() == Part::GeomArcOfEllipse::getClassTypeId()) {
const Part::GeomArcOfEllipse *aoc = static_cast<const Part::GeomArcOfEllipse*>(geo);
if (pos == start)
if (pos == PointPos::start)
return aoc->getStartPoint(/*emulateCCW=*/true);
else if (pos == end)
else if (pos == PointPos::end)
return aoc->getEndPoint(/*emulateCCW=*/true);
else if (pos == mid)
else if (pos == PointPos::mid)
return aoc->getCenter();
} else if (geo->getTypeId() == Part::GeomArcOfHyperbola::getClassTypeId()) {
const Part::GeomArcOfHyperbola *aoh = static_cast<const Part::GeomArcOfHyperbola*>(geo);
if (pos == start)
if (pos == PointPos::start)
return aoh->getStartPoint();
else if (pos == end)
else if (pos == PointPos::end)
return aoh->getEndPoint();
else if (pos == mid)
else if (pos == PointPos::mid)
return aoh->getCenter();
} else if (geo->getTypeId() == Part::GeomArcOfParabola::getClassTypeId()) {
const Part::GeomArcOfParabola *aop = static_cast<const Part::GeomArcOfParabola*>(geo);
if (pos == start)
if (pos == PointPos::start)
return aop->getStartPoint();
else if (pos == end)
else if (pos == PointPos::end)
return aop->getEndPoint();
else if (pos == mid)
else if (pos == PointPos::mid)
return aop->getCenter();
} else if (geo->getTypeId() == Part::GeomBSplineCurve::getClassTypeId()) {
const Part::GeomBSplineCurve *bsp = static_cast<const Part::GeomBSplineCurve*>(geo);
if (pos == start)
if (pos == PointPos::start)
return bsp->getStartPoint();
else if (pos == end)
else if (pos == PointPos::end)
return bsp->getEndPoint();
}