Sketcher: GeoId, GeoElementId and GeoUndef refactor

===================================================

This commit is an independent refactor of the identifications used at Sketcher level.

It introduces a new type "GeoElementId" as a combination of GeoId and PointPos.

It moves the Undefined GeoId, previous Constraint::GeoUndef to GeoEnum, together with all
other fixed values of GeoIds.
This commit is contained in:
Abdullah Tahiri
2021-12-11 14:40:21 +01:00
parent 56d86df5bb
commit bb76be1371
20 changed files with 277 additions and 192 deletions

View File

@@ -49,11 +49,11 @@ int ConstraintPy::PyInit(PyObject* args, PyObject* /*kwd*/)
PyErr_Clear();
char *ConstraintType;
int FirstIndex = Constraint::GeoUndef;
int FirstIndex = GeoEnum::GeoUndef;
int FirstPos = none;
int SecondIndex= Constraint::GeoUndef;
int SecondIndex= GeoEnum::GeoUndef;
int SecondPos = none;
int ThirdIndex = Constraint::GeoUndef;
int ThirdIndex = GeoEnum::GeoUndef;
int ThirdPos = none;
double Value = 0;
int intArg1, intArg2, intArg3, intArg4, intArg5;
@@ -487,20 +487,20 @@ std::string ConstraintPy::representation(void) const
case Weight : result << "'Weight'>";break;
case Parallel : result << "'Parallel'>";break;
case Tangent :
if (this->getConstraintPtr()->Third == Constraint::GeoUndef)
if (this->getConstraintPtr()->Third == GeoEnum::GeoUndef)
result << "'Tangent'>";
else
result << "'TangentViaPoint'>";
break;
case Perpendicular :
if (this->getConstraintPtr()->Third == Constraint::GeoUndef)
if (this->getConstraintPtr()->Third == GeoEnum::GeoUndef)
result << "'Perpendicular'>";
else
result << "'PerpendicularViaPoint'>";
break;
case Distance : result << "'Distance'>";break;
case Angle :
if (this->getConstraintPtr()->Third == Constraint::GeoUndef)
if (this->getConstraintPtr()->Third == GeoEnum::GeoUndef)
result << "'Angle'>";
else
result << "'AngleViaPoint'>";