Medical Imaging Interaction Toolkit
2018.4.99-389bf124
Medical Imaging Interaction Toolkit
|
controller that manages the positioning and stacking of QmitkOverlays More...
#include <QmitkOverlayController.h>
Public Slots | |
void | AdjustAllOverlayPosition () |
adjusts the position of all overlays to the position of the RenderWindow More... | |
void | AdjustOverlayPosition (QmitkOverlay::DisplayPosition displayPosition) |
void | UpdateAllOverlays () |
void | UpdateOverlayData (QmitkOverlay *overlay) |
Public Member Functions | |
QmitkOverlayController (QmitkRenderWindow *rw, mitk::PropertyList *pl=nullptr) | |
constructor with mandatory QmitkRenderWindow and optional mitk::PropertyList More... | |
~QmitkOverlayController () override | |
void | AddOverlay (QmitkOverlay *) |
adds an instance of QmitkOverlay to the RenderWindow More... | |
void | RemoveOverlay (QmitkOverlay *) |
void | RemoveAllOverlays () |
void | SetOverlayVisibility (bool visible) |
setting the visibility of all overlays More... | |
mitk::PropertyList * | GetPropertyList () |
getter for the RenderWindow-specific PropertyList More... | |
void | SetPropertyList (mitk::PropertyList *) |
setter for the RenderWindow-specific PropertyList More... | |
Protected Types | |
typedef std::map< QmitkOverlay::DisplayPosition, QWidget * > | OverlayPositionMap |
typedef std::vector< QmitkOverlay * > | OverlayVector |
Protected Member Functions | |
void | InitializeOverlayLayout () |
setting up the widgets that will hold all overlays More... | |
virtual void | AlignOverlays () |
re-aligning the overlays - not implemented yet More... | |
void | InitializeWidget (QmitkOverlay::DisplayPosition pos) |
initializes one QWidget - internally used by InitializeOverlayLayout() More... | |
void | RestackOverlays (QmitkOverlay::DisplayPosition pos) |
QSize | GetMinimumSizeForWidget (QmitkOverlay::DisplayPosition displayPosition) |
Protected Attributes | |
OverlayVector | m_AllOverlays |
all QmitkOverlays that are currently added More... | |
OverlayPositionMap | m_PositionedOverlays |
all possible positions and the QWidgets representing the corresponding QmitkOverlays More... | |
QmitkRenderWindow * | m_RenderWindow |
RenderWindow that all Overlays will be added to. More... | |
mitk::PropertyList::Pointer | m_PropertyList |
PropertyList for RenderWindow-specific properties. More... | |
controller that manages the positioning and stacking of QmitkOverlays
This controller manages all QmitkOverlays of one QmitkRenderWindow.
When constructed, it creates one QWidget for each possible display-position and sets the appropriate attributes and layouts.
It is possible to add new Overlays using AddOverlay( QmitkOverlay ). This overlay will be added to the correct Widget according to its destined position (stored in QmitkOverlay). If this widget already holds an overlay, the layer-property is taken into account. If no layer has been set, the overlay will be appended at the end.
It is possible to set the visibility of all overlays at a time using SetOverlayVisibility(bool).
RenderWindow specific properties can be set using the internal mitk::PropertyList. This propertyList and the 'default' propertyList of the RenderingManager will be concatenated before the overlay is set up. If one property exists in both propertyLists, the one in the QmitkOverlayController will be used!
Definition at line 53 of file QmitkOverlayController.h.
|
protected |
Definition at line 132 of file QmitkOverlayController.h.
|
protected |
Definition at line 133 of file QmitkOverlayController.h.
QmitkOverlayController::QmitkOverlayController | ( | QmitkRenderWindow * | rw, |
mitk::PropertyList * | pl = nullptr |
||
) |
constructor with mandatory QmitkRenderWindow and optional mitk::PropertyList
Definition at line 24 of file QmitkOverlayController.cpp.
References AdjustAllOverlayPosition(), InitializeOverlayLayout(), m_PropertyList, m_RenderWindow, MITK_ERROR, mitk::PropertyList::New(), and SetOverlayVisibility().
|
override |
Definition at line 43 of file QmitkOverlayController.cpp.
void QmitkOverlayController::AddOverlay | ( | QmitkOverlay * | overlay | ) |
adds an instance of QmitkOverlay to the RenderWindow
This method adds the given QmitkOverlay as a sub-widget to the registered RenderWindow. It will be added to the correct position in the RenderWindow as it's defined by the overlays position-variable. The layer-property will only be considered if necessary.
Definition at line 306 of file QmitkOverlayController.cpp.
References AdjustOverlayPosition(), mitk::RenderingManager::GetInstance(), QmitkOverlay::GetPosition(), GetPropertyList(), QmitkOverlay::GetWidget(), m_AllOverlays, m_PositionedOverlays, m_PropertyList, m_RenderWindow, MITK_ERROR, RestackOverlays(), and UpdateOverlayData().
|
slot |
adjusts the position of all overlays to the position of the RenderWindow
This method updates the position of all Widgets according to the position of the RenderWindow and the extend of the overlays.
Definition at line 169 of file QmitkOverlayController.cpp.
References AdjustOverlayPosition(), QmitkOverlay::bottom_Center, QmitkOverlay::bottom_Left, QmitkOverlay::bottom_Right, QmitkOverlay::middle_Left, QmitkOverlay::middle_Right, QmitkOverlay::top_Center, QmitkOverlay::top_Left, and QmitkOverlay::top_Right.
Referenced by QmitkOverlayController().
|
slot |
Definition at line 181 of file QmitkOverlayController.cpp.
References QmitkOverlay::bottom_Center, QmitkOverlay::bottom_Left, QmitkOverlay::bottom_Right, GetMinimumSizeForWidget(), m_PositionedOverlays, m_RenderWindow, max(), QmitkOverlay::middle_Left, QmitkOverlay::middle_Right, QmitkOverlay::top_Center, QmitkOverlay::top_Left, and QmitkOverlay::top_Right.
Referenced by AddOverlay(), AdjustAllOverlayPosition(), RemoveOverlay(), and UpdateOverlayData().
|
protectedvirtual |
re-aligning the overlays - not implemented yet
Definition at line 392 of file QmitkOverlayController.cpp.
|
protected |
Definition at line 477 of file QmitkOverlayController.cpp.
References QmitkOverlay::GetNeededSize(), QmitkOverlay::GetPosition(), m_AllOverlays, and max().
Referenced by AdjustOverlayPosition().
mitk::PropertyList* QmitkOverlayController::GetPropertyList | ( | ) |
getter for the RenderWindow-specific PropertyList
Referenced by AddOverlay().
|
protected |
setting up the widgets that will hold all overlays
This method sets up the 8 QWidgets that will later hold all QmitkOverlays. This includes the correct setting of layouts, alignments and the widget attributes necessary to achieve a translucent background and correct rendering on all platforms.
Definition at line 47 of file QmitkOverlayController.cpp.
References QmitkOverlay::bottom_Center, QmitkOverlay::bottom_Left, QmitkOverlay::bottom_Right, InitializeWidget(), QmitkOverlay::middle_Left, QmitkOverlay::middle_Right, QmitkOverlay::top_Center, QmitkOverlay::top_Left, and QmitkOverlay::top_Right.
Referenced by QmitkOverlayController().
|
protected |
initializes one QWidget - internally used by InitializeOverlayLayout()
Definition at line 60 of file QmitkOverlayController.cpp.
References QmitkOverlay::bottom_Center, QmitkOverlay::bottom_Left, QmitkOverlay::bottom_Right, m_PositionedOverlays, m_RenderWindow, QmitkOverlay::middle_Left, QmitkOverlay::middle_Right, QmitkOverlay::top_Center, QmitkOverlay::top_Left, and QmitkOverlay::top_Right.
Referenced by InitializeOverlayLayout().
void QmitkOverlayController::RemoveAllOverlays | ( | ) |
Definition at line 349 of file QmitkOverlayController.cpp.
References QmitkOverlay::GetWidget(), and m_AllOverlays.
void QmitkOverlayController::RemoveOverlay | ( | QmitkOverlay * | overlay | ) |
Definition at line 361 of file QmitkOverlayController.cpp.
References AdjustOverlayPosition(), QmitkOverlay::GetPosition(), QmitkOverlay::GetWidget(), m_AllOverlays, m_PositionedOverlays, and RestackOverlays().
|
protected |
Definition at line 405 of file QmitkOverlayController.cpp.
References QmitkOverlay::bottom_Center, QmitkOverlay::bottom_Left, QmitkOverlay::bottom_Right, m_AllOverlays, m_PositionedOverlays, QmitkOverlay::middle_Left, QmitkOverlay::middle_Right, QmitkOverlay::top_Center, QmitkOverlay::top_Left, and QmitkOverlay::top_Right.
Referenced by AddOverlay(), and RemoveOverlay().
void QmitkOverlayController::SetOverlayVisibility | ( | bool | visible | ) |
setting the visibility of all overlays
Definition at line 277 of file QmitkOverlayController.cpp.
References m_AllOverlays, and m_PositionedOverlays.
Referenced by QmitkOverlayController().
void QmitkOverlayController::SetPropertyList | ( | mitk::PropertyList * | ) |
setter for the RenderWindow-specific PropertyList
|
slot |
Definition at line 469 of file QmitkOverlayController.cpp.
References m_AllOverlays, and UpdateOverlayData().
|
slot |
Definition at line 340 of file QmitkOverlayController.cpp.
References AdjustOverlayPosition(), QmitkOverlay::GenerateData(), QmitkOverlay::GetPosition(), and m_PropertyList.
Referenced by AddOverlay(), and UpdateAllOverlays().
|
protected |
all QmitkOverlays that are currently added
Definition at line 138 of file QmitkOverlayController.h.
Referenced by AddOverlay(), GetMinimumSizeForWidget(), RemoveAllOverlays(), RemoveOverlay(), RestackOverlays(), SetOverlayVisibility(), and UpdateAllOverlays().
|
protected |
all possible positions and the QWidgets representing the corresponding QmitkOverlays
Definition at line 143 of file QmitkOverlayController.h.
Referenced by AddOverlay(), AdjustOverlayPosition(), InitializeWidget(), RemoveOverlay(), RestackOverlays(), and SetOverlayVisibility().
|
protected |
PropertyList for RenderWindow-specific properties.
Definition at line 153 of file QmitkOverlayController.h.
Referenced by AddOverlay(), QmitkOverlayController(), and UpdateOverlayData().
|
protected |
RenderWindow that all Overlays will be added to.
Definition at line 148 of file QmitkOverlayController.h.
Referenced by AddOverlay(), AdjustOverlayPosition(), InitializeWidget(), and QmitkOverlayController().