Sketcher: Add support for adding internal alignment constraints independently

This commit is contained in:
Paddle
2023-11-16 14:48:37 +01:00
committed by abdullahtahiriyo
parent 8cf4aacfb6
commit cda68e913c

View File

@@ -116,6 +116,15 @@ int ConstraintPy::PyInit(PyObject* args, PyObject* /*kwd*/)
else if (strstr(ConstraintType, "EllipseMinorDiameter")) {
this->getConstraintPtr()->AlignmentType = EllipseMinorDiameter;
}
else if (strstr(ConstraintType, "HyperbolaMajor")) {
this->getConstraintPtr()->AlignmentType = HyperbolaMajor;
}
else if (strstr(ConstraintType, "HyperbolaMinor")) {
this->getConstraintPtr()->AlignmentType = HyperbolaMinor;
}
else if (strstr(ConstraintType, "ParabolaFocalAxis")) {
this->getConstraintPtr()->AlignmentType = ParabolaFocalAxis;
}
else {
this->getConstraintPtr()->AlignmentType = Undef;
valid = false;
@@ -214,6 +223,12 @@ int ConstraintPy::PyInit(PyObject* args, PyObject* /*kwd*/)
else if (strstr(ConstraintType, "EllipseFocus2")) {
this->getConstraintPtr()->AlignmentType = EllipseFocus2;
}
else if (strstr(ConstraintType, "HyperbolaFocus")) {
this->getConstraintPtr()->AlignmentType = HyperbolaFocus;
}
else if (strstr(ConstraintType, "ParabolaFocus")) {
this->getConstraintPtr()->AlignmentType = ParabolaFocus;
}
else {
this->getConstraintPtr()->AlignmentType = Undef;
valid = false;
@@ -589,6 +604,21 @@ std::string ConstraintPy::representation() const
case EllipseFocus2:
result << "'InternalAlignment:EllipseFocus2'>";
break;
case HyperbolaMajor:
result << "'InternalAlignment:HyperbolaMajor'>";
break;
case HyperbolaMinor:
result << "'InternalAlignment:HyperbolaMinor'>";
break;
case HyperbolaFocus:
result << "'InternalAlignment:HyperbolaFocus'>";
break;
case ParabolaFocalAxis:
result << "'InternalAlignment:ParabolaFocalAxis'>";
break;
case ParabolaFocus:
result << "'InternalAlignment:ParabolaFocus'>";
break;
default:
result << "'InternalAlignment:?'>";
break;