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

Method StartEventLoop

Web/WebAssembly/vtkWasmSceneManager.cxx:107–136  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

105
106//-------------------------------------------------------------------------------
107bool vtkWasmSceneManager::StartEventLoop(vtkTypeUInt32 identifier)
108{
109 auto object = this->GetObjectAtId(identifier);
110 if (auto* renderWindow = vtkRenderWindow::SafeDownCast(object))
111 {
112 if (auto* interactor =
113 vtkWebAssemblyRenderWindowInteractor::SafeDownCast(renderWindow->GetInteractor()))
114 {
115 if (auto* wasmGLWindow = vtkWebAssemblyOpenGLRenderWindow::SafeDownCast(renderWindow))
116 {
117 // copy canvas selector from the render window to the interactor.
118 interactor->SetCanvasSelector(wasmGLWindow->GetCanvasSelector());
119 std::cout << "Started event loop id=" << identifier
120 << ", interactor=" << interactor->GetObjectDescription() << '\n';
121 interactor->Start();
122 return true;
123 }
124 else
125 {
126 std::cerr << "Render window class " << renderWindow->GetClassName()
127 << " is not recognized!\n";
128 }
129 }
130 else
131 {
132 std::cerr << "Interactor class " << renderWindow->GetClassName() << " is not recognized!\n";
133 }
134 }
135 return false;
136}
137
138//-------------------------------------------------------------------------------
139bool vtkWasmSceneManager::StopEventLoop(vtkTypeUInt32 identifier)

Callers

nothing calls this directly

Calls 6

SetCanvasSelectorMethod · 0.80
GetObjectAtIdMethod · 0.45
GetInteractorMethod · 0.45
GetObjectDescriptionMethod · 0.45
StartMethod · 0.45
GetClassNameMethod · 0.45

Tested by

no test coverage detected