------------------------------------------------------------------------------
| 290 | |
| 291 | //------------------------------------------------------------------------------ |
| 292 | PyObject* PyVTKObject_New(PyTypeObject* tp, PyObject* args, PyObject* /*kwds*/) |
| 293 | { |
| 294 | // XXX(python3-abi3): all types will be heap types in abi3 |
| 295 | // If type was subclassed within python, then skip arg checks and |
| 296 | // simply create a new object. |
| 297 | PyObject* o = nullptr; |
| 298 | if ((PyType_GetFlags(tp) & Py_TPFLAGS_HEAPTYPE) == 0) |
| 299 | { |
| 300 | if (!PyArg_UnpackTuple(args, vtkPythonUtil::GetTypeName(tp), 0, 1, &o)) |
| 301 | { |
| 302 | return nullptr; |
| 303 | } |
| 304 | |
| 305 | if (o) |
| 306 | { |
| 307 | // used to create a VTK object from a SWIG pointer |
| 308 | return vtkPythonUtil::GetObjectFromObject(o, vtkPythonUtil::StripModuleFromType(tp)); |
| 309 | } |
| 310 | } |
| 311 | |
| 312 | // if PyVTKObject_FromPointer gets nullptr, it creates a new object. |
| 313 | o = PyVTKObject_FromPointer(tp, nullptr, nullptr); |
| 314 | |
| 315 | return o; |
| 316 | } |
| 317 | |
| 318 | //------------------------------------------------------------------------------ |
| 319 | int PyVTKObject_Init(PyObject* obj, PyObject* /*args*/, PyObject* kwds) |
nothing calls this directly
no test coverage detected