Difference between revisions of "Documentation/Labs/ViewInfrastructureImprovements"
From Slicer Wiki
(Access 3D View) |
|||
Line 10: | Line 10: | ||
= InteractorStyle management = | = InteractorStyle management = | ||
− | == | + | == Workaround == |
− | + | === Access 3D View === | |
− | == | + | * Created a new Action menu in qSlicerMouseModeToolBar following [https://github.com/Slicer/Slicer/blob/a331fb0/Base/QTGUI/qSlicerMouseModeToolBar.cxx#L59-L103| this method.] |
+ | * Accessed all qMRMLThreeDView through the layoutManager | ||
+ | <pre> | ||
+ | void qSlicerMouseModeToolBar::switchToTrackBallInteractorStyle() | ||
+ | { | ||
+ | qMRMLLayoutManager *layoutManager = qSlicerApplication::application()->layoutManager(); | ||
+ | |||
+ | // loop through all existing threeDViews | ||
+ | vtkNew<vtkThreeDViewInteractorStyle> interactorStyle; | ||
+ | for (int i=0; i < layoutManager->threeDViewCount(); ++i) | ||
+ | { | ||
+ | qMRMLThreeDView* view = layoutManager->threeDWidget(i)->threeDView(); | ||
+ | // Update Interactor style | ||
+ | this->SetInteractorStyle(view, interactorStyle.GetPointer()); | ||
+ | // Reset focal point | ||
+ | view->resetFocalPoint(); | ||
+ | } | ||
+ | |||
+ | // Update icon | ||
+ | Q_D(qSlicerMouseModeToolBar); | ||
+ | d->InteractorStyleToolButton->setIcon(QIcon(":/Icons/TrackBall.png")); | ||
+ | } | ||
+ | </pre> | ||
+ | |||
+ | * Issue : not setting the interactor per view but for all views | ||
+ | * Solution : adding the switch in each 3D View Qt controller | ||
+ | |||
+ | === Update InteractorStyle === | ||
TODO | TODO | ||
+ | |||
== Design & implementation == | == Design & implementation == | ||
TODO | TODO |
Revision as of 19:20, 1 December 2015
Home < Documentation < Labs < ViewInfrastructureImprovementsContents
Goals
- Update Slicer code base to listen to interactor instead of interactor style
- Add support for interactor style switch per view
- Allow access to vtkRenderWindow from vtkMRMLViewNode
Motivation
- We would like to conveniently be able to change the interactor style without having to reset all observer for the displayable managers.
- Accessing the vtkRenderWindow would allow us to do (for example) screenshots given a specific viewNode.
InteractorStyle management
Workaround
Access 3D View
- Created a new Action menu in qSlicerMouseModeToolBar following this method.
- Accessed all qMRMLThreeDView through the layoutManager
void qSlicerMouseModeToolBar::switchToTrackBallInteractorStyle() { qMRMLLayoutManager *layoutManager = qSlicerApplication::application()->layoutManager(); // loop through all existing threeDViews vtkNew<vtkThreeDViewInteractorStyle> interactorStyle; for (int i=0; i < layoutManager->threeDViewCount(); ++i) { qMRMLThreeDView* view = layoutManager->threeDWidget(i)->threeDView(); // Update Interactor style this->SetInteractorStyle(view, interactorStyle.GetPointer()); // Reset focal point view->resetFocalPoint(); } // Update icon Q_D(qSlicerMouseModeToolBar); d->InteractorStyleToolButton->setIcon(QIcon(":/Icons/TrackBall.png")); }
- Issue : not setting the interactor per view but for all views
- Solution : adding the switch in each 3D View Qt controller
Update InteractorStyle
TODO
Design & implementation
TODO
vtkRenderWindow mapping
Current workaround
TODO
Issues
TODO
Design & implementation
TODO