------------------------------------------------------------------------------
| 253 | |
| 254 | //------------------------------------------------------------------------------ |
| 255 | int PyVTKObject_Traverse(PyObject* o, visitproc visit, void* arg) |
| 256 | { |
| 257 | PyVTKObject* self = (PyVTKObject*)o; |
| 258 | int err = 0; |
| 259 | |
| 260 | if (self->vtk_observers != nullptr) |
| 261 | { |
| 262 | unsigned long* olist = self->vtk_observers; |
| 263 | while (err == 0 && *olist != 0) |
| 264 | { |
| 265 | vtkObject* op = static_cast<vtkObject*>(self->vtk_ptr); |
| 266 | vtkCommand* c = op->GetCommand(*olist); |
| 267 | if (c == nullptr) |
| 268 | { |
| 269 | // observer is gone, remove from list |
| 270 | unsigned long* tmp = olist; |
| 271 | do |
| 272 | { |
| 273 | tmp++; |
| 274 | } while (*tmp != 0); |
| 275 | *olist = *--tmp; |
| 276 | *tmp = 0; |
| 277 | } |
| 278 | else |
| 279 | { |
| 280 | // visit the observer |
| 281 | vtkPythonCommand* cbc = static_cast<vtkPythonCommand*>(c); |
| 282 | err = visit(cbc->obj, arg); |
| 283 | olist++; |
| 284 | } |
| 285 | } |
| 286 | } |
| 287 | |
| 288 | return err; |
| 289 | } |
| 290 | |
| 291 | //------------------------------------------------------------------------------ |
| 292 | PyObject* PyVTKObject_New(PyTypeObject* tp, PyObject* args, PyObject* /*kwds*/) |
nothing calls this directly
no test coverage detected