-------------------------------------------------------------------------------
| 390 | |
| 391 | //------------------------------------------------------------------------------- |
| 392 | vtkSessionResult vtkSessionStopEventLoop(vtkSession session, vtkObjectHandle object) |
| 393 | { |
| 394 | auto objectImpl = session->Manager->GetObjectAtId(object); |
| 395 | #if VTK_MODULE_ENABLE_VTK_RenderingCore |
| 396 | if (auto* renderWindow = vtkRenderWindow::SafeDownCast(objectImpl)) |
| 397 | { |
| 398 | if (auto* interactor = renderWindow->GetInteractor()) |
| 399 | { |
| 400 | vtkVLog(session->Manager->GetObjectManagerLogVerbosity(), |
| 401 | << "Stopping event loop id=" << objectImpl |
| 402 | << ", interactor=" << interactor->GetObjectDescription()); |
| 403 | interactor->TerminateApp(); |
| 404 | return vtkSessionResultSuccess; |
| 405 | } |
| 406 | else |
| 407 | { |
| 408 | vtkLog(ERROR, << objectImpl << " does not have an interactor!"); |
| 409 | } |
| 410 | } |
| 411 | else if (objectImpl != nullptr) |
| 412 | { |
| 413 | vtkLog(ERROR, << "Object " << objectImpl->GetObjectDescription() << " at id=" << object |
| 414 | << " is not a vtkRenderWindow!"); |
| 415 | } |
| 416 | else |
| 417 | { |
| 418 | vtkLog(TRACE, << "Object at id=" << object << " is null"); |
| 419 | } |
| 420 | return vtkSessionResultFailure; |
| 421 | #else |
| 422 | (void)objectImpl; |
| 423 | vtkLog(ERROR, << "VTK_RenderingCore module is not enabled. Cannot start event loop."); |
| 424 | return vtkSessionResultFailure; |
| 425 | #endif |
| 426 | } |
| 427 | |
| 428 | //------------------------------------------------------------------------------- |
| 429 | unsigned long vtkSessionAddObserver(vtkSession session, vtkObjectHandle object, |
no test coverage detected