py3: Points: gathering commits:

5f682d2a97a0b965813077d03fa2aee65377f3b2
5ccfa18e8c8471639a7f98e294625c5532e7440e
24836b36d5214db6823d6ac409afa42ce47ce263
This commit is contained in:
looooo
2017-02-28 16:59:15 +01:00
committed by wmayer
parent 137e68d087
commit 4574348937
2 changed files with 15 additions and 4 deletions

View File

@@ -174,7 +174,7 @@ PyObject* PointsPy::addPoints(PyObject * args)
Py_Return;
}
PyObject* PointsPy::fromSegment(PyObject * args)
{
PyObject *obj;
@@ -188,7 +188,11 @@ PyObject* PointsPy::fromSegment(PyObject * args)
pts->reserve(list.size());
int numPoints = static_cast<int>(points->size());
for (Py::Sequence::iterator it = list.begin(); it != list.end(); ++it) {
#if PY_MAJOR_VERSION < 3
int index = static_cast<int>(Py::Int(*it));
#else
long index = static_cast<long>(Py::Long(*it));
#endif
if (index >= 0 && index < numPoints)
pts->push_back(points->getPoint(index));
}
@@ -222,10 +226,16 @@ PyObject* PointsPy::fromValid(PyObject * args)
return 0;
}
}
Py::Long PointsPy::getCountPoints(void) const
#if PY_MAJOR_VERSION >= 3
Py::Long PointsPy::getCountPoints(void) const
{
return Py::Long((long)getPointKernelPtr()->size());
#else
Py::Int PointsPy::getCountPoints(void) const
{
return Py::Int((long)getPointKernelPtr()->size());
#endif
}
Py::List PointsPy::getPoints(void) const