Sketcher: Python interface to solveraid

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

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());