-------------------------------------------------------------------------------
| 105 | |
| 106 | //------------------------------------------------------------------------------- |
| 107 | bool 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 | //------------------------------------------------------------------------------- |
| 139 | bool vtkWasmSceneManager::StopEventLoop(vtkTypeUInt32 identifier) |
nothing calls this directly
no test coverage detected