Sketcher: Python interface to solveraid

This commit is contained in:
Abdullah Tahiri
2018-06-08 22:01:03 +02:00
committed by wmayer
parent ce31cecc95
commit eacb14c3d4
2 changed files with 30 additions and 1 deletions

View File

@@ -263,7 +263,16 @@
</UserDocu>
</Documentation>
</Methode>
<Methode Name="getGeometryWithDependentParameters">
<Documentation>
<UserDocu>
getGeometryWithDependentParameters - returns a list of geoid posid pairs
with all the geometry element edges and vertices which the solver regards
as being dependent on other parameters.
</UserDocu>
</Documentation>
</Methode>
<Attribute Name="ConstraintCount" ReadOnly="true">
<Documentation>
<UserDocu>Number of Constraints in this sketch</UserDocu>

View File

@@ -1274,6 +1274,26 @@ PyObject* SketchObjectPy::modifyBSplineKnotMultiplicity(PyObject *args)
Py_Return;
}
PyObject* SketchObjectPy::getGeometryWithDependentParameters(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
std::vector<std::pair<int,PointPos>> geometrymap;
this->getSketchObjectPtr()->getGeometryWithDependentParameters(geometrymap);
Py::List list;
for (auto pair : geometrymap) {
Py::Tuple t(2);
t.setItem(0, Py::Long(pair.first));
t.setItem(1, Py::Long(((pair.second == Sketcher::none)?0:(pair.second == Sketcher::start)?1:(pair.second == Sketcher::end)?2:3)));
list.append(t);
}
return Py::new_reference_to(list);
}
Py::Long SketchObjectPy::getConstraintCount(void) const
{
return Py::Long(this->getSketchObjectPtr()->Constraints.getSize());