MCPcopy Create free account
hub / github.com/Kitware/VTK / BuildTuple

Method BuildTuple

Wrapping/PythonCore/vtkPythonArgs.cxx:885–909  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

883
884// For an array of smart pointers
885PyObject* vtkPythonArgs::BuildTuple(const vtkSmartPointerBase* a, size_t n)
886{
887 if (a)
888 {
889 Py_ssize_t m = static_cast<Py_ssize_t>(n);
890 PyObject* t = PyTuple_New(m);
891 for (Py_ssize_t i = 0; i < m; i++)
892 {
893 vtkObjectBase* ob = a[i].GetPointer();
894 if (ob)
895 {
896 PyTuple_SetItem(t, i, vtkPythonUtil::GetObjectFromPointer(ob));
897 }
898 else
899 {
900 PyTuple_SetItem(t, i, Py_None);
901 Py_INCREF(Py_None);
902 }
903 }
904 return t;
905 }
906
907 Py_INCREF(Py_None);
908 return Py_None;
909}
910
911//------------------------------------------------------------------------------
912

Callers

nothing calls this directly

Calls 1

GetPointerMethod · 0.45

Tested by

no test coverage detected