From cda68e913c3127cfc95d9386e3db6ed411ab3e0e Mon Sep 17 00:00:00 2001 From: Paddle Date: Thu, 16 Nov 2023 14:48:37 +0100 Subject: [PATCH] Sketcher: Add support for adding internal alignment constraints independently --- src/Mod/Sketcher/App/ConstraintPyImp.cpp | 30 ++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/Mod/Sketcher/App/ConstraintPyImp.cpp b/src/Mod/Sketcher/App/ConstraintPyImp.cpp index cac0c9bd04..df684a6914 100644 --- a/src/Mod/Sketcher/App/ConstraintPyImp.cpp +++ b/src/Mod/Sketcher/App/ConstraintPyImp.cpp @@ -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;