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

Method SetPythonObject

Filters/Python/vtkPythonAlgorithm.cxx:115–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

113}
114
115void vtkPythonAlgorithm::SetPythonObject(PyObject* obj)
116{
117 vtkPythonScopeGilEnsurer gilEnsurer;
118
119 if (!obj)
120 {
121 return;
122 }
123
124 Py_XDECREF(this->Object);
125
126 this->Object = obj;
127 Py_INCREF(this->Object);
128
129 char mname[] = "Initialize";
130 VTK_GET_METHOD(method, this->Object, mname, /* no return */)
131
132 PyObject* vtkself = VTKToPython(this);
133 vtkSmartPyObject args(PyTuple_Pack(1, vtkself));
134 Py_DECREF(vtkself);
135
136 vtkSmartPyObject result(PyObject_Call(method, args, nullptr));
137
138 CheckResult(mname, result);
139}
140
141void vtkPythonAlgorithm::SetNumberOfInputPorts(int n)
142{

Callers 2

testSourceMethod · 0.45
testFilterMethod · 0.45

Calls 2

VTKToPythonFunction · 0.70
CheckResultFunction · 0.50

Tested by 2

testSourceMethod · 0.36
testFilterMethod · 0.36