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

Function vtkSessionStartEventLoop

Serialization/Manager/vtkSession.cxx:355–389  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

353
354 //-------------------------------------------------------------------------------
355 vtkSessionResult vtkSessionStartEventLoop(vtkSession session, vtkObjectHandle object)
356 {
357 auto objectImpl = session->Manager->GetObjectAtId(object);
358#if VTK_MODULE_ENABLE_VTK_RenderingCore
359 if (auto* renderWindow = vtkRenderWindow::SafeDownCast(objectImpl))
360 {
361 if (auto* interactor = renderWindow->GetInteractor())
362 {
363 vtkVLog(session->Manager->GetObjectManagerLogVerbosity(),
364 << "Started event loop id=" << object
365 << ", interactor=" << interactor->GetObjectDescription());
366 interactor->Start();
367 return vtkSessionResultSuccess;
368 }
369 else
370 {
371 vtkLog(ERROR, << objectImpl << " does not have an interactor!");
372 }
373 }
374 else if (objectImpl != nullptr)
375 {
376 vtkLog(ERROR, << "Object " << objectImpl->GetObjectDescription() << " at id=" << object
377 << "is not a vtkRenderWindow!");
378 }
379 else
380 {
381 vtkLog(TRACE, << "Object at id=" << object << " is null");
382 }
383 return vtkSessionResultFailure;
384#else
385 (void)objectImpl;
386 vtkLog(ERROR, << "VTK_RenderingCore module is not enabled. Cannot start event loop.");
387 return vtkSessionResultFailure;
388#endif
389 }
390
391 //-------------------------------------------------------------------------------
392 vtkSessionResult vtkSessionStopEventLoop(vtkSession session, vtkObjectHandle object)

Callers 2

StartEventLoopMethod · 0.85
TestSessionFunction · 0.85

Calls 5

GetObjectAtIdMethod · 0.45
GetInteractorMethod · 0.45
GetObjectDescriptionMethod · 0.45
StartMethod · 0.45

Tested by 1

TestSessionFunction · 0.68