Skip to content

REFAC: ViewerVTK, RenderingVTK as Separate Libraries

Andrew Wilson requested to merge LibReorganize into master

Doesn't introduce any new code. This splits off the VTK specific classes into their own libraries. This allows more libraries to build in parallel as well as decreases the amount of code you need to link to. This also sets it up to be more modular.

Two spots required code changes though:

  • KeyboardSceneControl was utlizing VTKViewer, VTKViewer & base Viewer was refactored to allow "info levels" to deal with this which allows a Viewer to define and toggle through info levels. VTKViewer has 3 now, 0 which displays nothing, 1 which displays the fps counter, and 2 which displays the fps counter and performance graph. Then the KeyboardSceneControl can toggle through levels without needing any VTK specifics.
  • InteractorStyle of the Viewer actually had a bit of a bug in it from legacy code. It was using multi inheritance to provide our own InteractorStyle that could also be a vtkInteractorStyle and was previously used for keyboard controls before I introduced the KeyboardDeviceClient, MouseDeviceClient, & more generalized controls last year. The issue is that it was passing a raw pointer from a shared_ptr to the vtkSmartPointer which which is a problem if anyone else was to grab that vtkSmartPointer and cause a destruct later. This was fixed.

Merge request reports