Make Sequential Execution Default
Currently there are two execution modes in iMSTK.
One that renders and simulates in parallel:
// Setup a viewer to render
imstkNew<VTKViewer> viewer("Viewer");
viewer->setActiveScene(scene);
// Setup a scene manager to advance the scene
imstkNew<SceneManager> sceneManager("Scene Manager");
sceneManager->setActiveScene(scene);
imstkNew<SimulationManager> driver;
driver->addModule(viewer);
driver->addModule(sceneManager);
driver->start();
One that renders and simulates sequentially. Calling simulate N times per render:
// Setup a viewer to render
imstkNew<VTKViewer> viewer("Viewer");
viewer->setActiveScene(scene);
// Setup a scene manager to advance the scene
imstkNew<SceneManager> sceneManager("Scene Manager");
sceneManager->setActiveScene(scene);
sceneManager->setExecutionType(Module::ExecutionType::ADAPTIVE);
imstkNew<SimulationManager> driver;
driver->addModule(viewer);
driver->addModule(sceneManager);
driver->setDesiredDt(0.005); // Governs N/how many steps per render
driver->start();
The parallel one is hard to support but may have some niche use cases with respect to medical simulation. But I do believe sequential should be default. ie: get rid of line sceneManager->setExecutionType(Module::ExecutionType::ADAPTIVE);
For this to happen all examples need to be tuned for the sequential mode. Ideally tuned for lowest common denominator (ie: worst machine). So others can start imstk examples without problems. Some take no effort to tune and have large ranges of valid timesteps even on bad machines. Others have a small ranges of valid timesteps, making it harder to tune. Some need their other parameters changed to account for new timesteps.