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

Function vtkSessionStopEventLoop

Serialization/Manager/vtkSession.cxx:392–426  ·  view source on GitHub ↗

-------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

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,

Callers 1

StopEventLoopMethod · 0.85

Calls 5

GetObjectAtIdMethod · 0.45
GetInteractorMethod · 0.45
GetObjectDescriptionMethod · 0.45
TerminateAppMethod · 0.45

Tested by

no test coverage detected