-------------------------- PyUtilGetPointVectorData -------------------------- Convert a Python list of points into a c++ vector.
| 561 | // Convert a Python list of points into a c++ vector. |
| 562 | // |
| 563 | bool PyUtilGetPointVectorData(PyObject *pointsObj, std::vector<std::array<double,3>>& points, std::string& msg) |
| 564 | { |
| 565 | int numPts = PyList_Size(pointsObj); |
| 566 | |
| 567 | for (int i = 0; i < numPts; i++) { |
| 568 | PyObject* ptObj = PyList_GetItem(pointsObj,i); |
| 569 | std::array<double,3> point; |
| 570 | if (!PyUtilGetPointData(ptObj, msg, point.data())) { |
| 571 | return false; |
| 572 | } |
| 573 | points.push_back(point); |
| 574 | } |
| 575 | |
| 576 | return true; |
| 577 | } |
| 578 | |
| 579 | //------------------------------- |
| 580 | // PyUtilPointVectorDataToPyList |
no test coverage detected