MCPcopy Create free account
hub / github.com/SimVascular/SimVascular / PyUtilGetPointVectorData

Function PyUtilGetPointVectorData

Code/Source/PythonAPI/PyUtils.cxx:563–577  ·  view source on GitHub ↗

-------------------------- PyUtilGetPointVectorData -------------------------- Convert a Python list of points into a c++ vector.

Source from the content-addressed store, hash-verified

561// Convert a Python list of points into a c++ vector.
562//
563bool 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

Calls 2

PyUtilGetPointDataFunction · 0.85
dataMethod · 0.80

Tested by

no test coverage detected