+ Make Python API more pythonic
This commit is contained in:
@@ -273,13 +273,13 @@ PyObject* BezierCurvePy::getPoles(PyObject * args)
|
||||
PyObject* BezierCurvePy::setPoles(PyObject * args)
|
||||
{
|
||||
PyObject* plist;
|
||||
if (!PyArg_ParseTuple(args, "O!", &(PyList_Type), &plist))
|
||||
if (!PyArg_ParseTuple(args, "O", &plist))
|
||||
return 0;
|
||||
try {
|
||||
Py::List list(plist);
|
||||
Py::Sequence list(plist);
|
||||
TColgp_Array1OfPnt poles(1,list.size());
|
||||
int index = poles.Lower();
|
||||
for (Py::List::iterator it = list.begin(); it != list.end(); ++it) {
|
||||
for (Py::Sequence::iterator it = list.begin(); it != list.end(); ++it) {
|
||||
Py::Vector v(*it);
|
||||
Base::Vector3d pole = v.toVector();
|
||||
poles.SetValue(index++, gp_Pnt(pole.x,pole.y,pole.z));
|
||||
|
||||
Reference in New Issue
Block a user