Remove magic number and hard type enums in CenterLine.h

- Remove currently present magic numbers
- Hard type enums, so magic numbers can no longer be introduced. We don't want people to introduce magic numbers.
This commit is contained in:
Benjamin Bræstrup Sayoc
2025-01-30 22:46:13 +01:00
committed by WandererFan
parent c53679422b
commit ea26b3f18c
6 changed files with 109 additions and 93 deletions

View File

@@ -153,20 +153,20 @@ Py::String CenterLinePy::getTag() const
Py::Long CenterLinePy::getType() const
{
int tmp = getCenterLinePtr()->m_type;
return Py::Long(tmp);
CenterLine::Type tmp = getCenterLinePtr()->m_type;
return Py::Long(static_cast<int>(tmp));
}
Py::Long CenterLinePy::getMode() const
{
int tmp = getCenterLinePtr()->m_mode;
return Py::Long(tmp);
CenterLine::Mode tmp = getCenterLinePtr()->m_mode;
return Py::Long(static_cast<int>(tmp));
}
void CenterLinePy::setMode(Py::Long arg)
{
int temp = static_cast<int>(arg);
getCenterLinePtr()->m_mode = temp;
getCenterLinePtr()->m_mode = static_cast<CenterLine::Mode>(temp);
}
Py::Float CenterLinePy::getHorizShift() const