Skip to content

WIP+ENH: Widget rework

Davide Punzo requested to merge github/fork/Punzo/widget-rework into master

DO NOT MERGE

@lassoan @pieper @jcfr

here the ongoing work for the markups internal rework and adding line/angle/curve interactive widgets

video showing the current state (i.e. integration of the vtkSlicerPointsWidget into fiducials): https://www.dropbox.com/s/p8v1m7mgopsnrp4/Widget-rework.mkv?dl=0

the new infrastructure provide better performance (no drop-down at 1000 points) and many other interactive features (i.e., support for middle, right, double clicks, shift, scale rotate actions, mouse hover with selection of the points, etc...)

implementation summary: A) For each vtkMRMLMarkupsFiducialNode there is a vtkWidget for each view. B) Each vtkMRMLMarkupsFiducialNode have N ControlPoint structs (N for fiducials, 2 for rulers, 3 for angles and N for curves). The ControlPoint struct is the one that have the information of the position, Selected, Visibility, locked, etc.. for each point of the widget. C) Each widget have a representation. D) Each representation has 3 actors for the points: "normal", "selected" and "active" (the last is always only one point) for fiducials. The others widget will have also the actor for the line. + actors for texts. E) The ControlPoint structs in the vtkMRMLMarkupsFiducialNode are shared directly to all the representations. F) The update of the actors in the representations is handled by the display managers (by using the info stored in the ControlPoint structs) when the info in the ControlPoint structs in the vtkMRMLMarkupsFiducialNode are modified by any widget (the display manager simply call BuildRepresentation method of the representation at the point modified events). E) at level of vtk widgets, the widgets have more features, and they have also been simplified (just one representation, the handles have been removed).

To Do:

  • Fiducials widget rework done (it uses the new vtkSlicerPointsWidget)
  • Integrate the others widgets: line, angle, curve (already implemented at VTK level).
  • Implement the widget projection in the 2d views (both total and distance gradient fading, similar to models).
  • Additional to do: move the point infos contained in the ControlPoint struct in VTK objects (vtkPointSet).

Minimal modification to VTK are required as: This needs https://github.com/Slicer/VTK/pull/20

The new vtk widgets, for now, are in the folder Modules/Loadable/Markups/VTKWidgets. Two reasons for having the widget in Slicer:

  1. the widget have a pointer to the MarkupsNode to share the coordinates and others proprieties of the points (i.e. removing a lot of manual updates)
  2. Faster prototyping and dev.

Merge request reports