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

Function PyUtilConvertPointData

Code/Source/PythonAPI/PyUtils.cxx:263–271  ·  view source on GitHub ↗

------------------------ PyUtilConvertPointData ------------------------ Convert a Python object to a double and store it into the given position in an array.

Source from the content-addressed store, hash-verified

261// position in an array.
262//
263bool PyUtilConvertPointData(PyObject* data, int index, std::string& msg, double point[3])
264{
265 if (!PyFloat_Check(data) && !PyLong_Check(data)) {
266 msg = "data at " + std::to_string(index) + " in the list is not a float.";
267 return false;
268 }
269 point[index] = PyFloat_AsDouble(data);
270 return true;
271}
272
273bool PyUtilConvertPointData(PyObject* data, int index, std::string& msg, int point[3])
274{

Callers 1

PyUtilGetPointDataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected