Skip to content

BUG: Inversion of dependence of Viewer in SimManager

Andrew Wilson requested to merge andrew.wilson/iMSTK:SimManagerFix into master

Recently changed it so that the Viewer is not created until setActiveScene or start->setActiveScene this caused a few examples that used getViewer to fail if they did so before setActiveScene was called.

This is bigger design issue in that VTKViewer and any Module should not be dependent on SimulationManager or Scene or else all classes in the build knot up into SimulationManager.

This commit is a quick fix to follow inversion of dependency principles and allow the user of SimulationManager to set the viewer themselves (if not set will be created for them). This allows one to configure VTKViewer.

Merge request reports