Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
QmitkOverlay.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef QmitkOverlay_h
14 #define QmitkOverlay_h
15 
16 // MITK
17 #include <mitkCommon.h>
18 #include <mitkPropertyList.h>
19 
20 // Qt
21 #include <QWidget>
22 
23 #include <MitkQtOverlaysExports.h>
24 
54 class MITKQTOVERLAYS_EXPORT QmitkOverlay : public QObject
55 {
56  Q_OBJECT
57 
58 public:
67  {
68  top_Left = 0,
69  top_Center = 1,
70  top_Right = 2,
71  middle_Left = 3,
72  middle_Right = 4,
73  bottom_Left = 5,
74  bottom_Center = 6,
75  bottom_Right = 7
76  };
77 
82  QmitkOverlay(const char *id);
83 
85  ~QmitkOverlay() override;
86 
91  virtual void SetPosition(DisplayPosition pos);
92 
98 
103  virtual void SetLayer(unsigned int layer);
104 
109  virtual unsigned int GetLayer();
110 
119  virtual void GenerateData(mitk::PropertyList::Pointer pl);
120 
125  virtual QWidget *GetWidget();
126 
131  virtual QSize GetNeededSize() = 0;
132 
133 protected:
138  void AddDropShadow(QWidget *widget);
139 
141  const char *m_Id;
142 
145 
147  unsigned int m_Layer;
148 
150  QWidget *m_Widget;
151 
154 };
155 
156 #endif
#define MITKQTOVERLAYS_EXPORT
Abstract base class for all Qt-based overlay widgets in MITK.
Definition: QmitkOverlay.h:55
virtual void SetPosition(DisplayPosition pos)
Sets the display position of this overlay.
const char * m_Id
ID of the overlay, used as property key for lookups.
Definition: QmitkOverlay.h:141
DisplayPosition
Enumeration of all possible display positions in a render window.
Definition: QmitkOverlay.h:67
virtual void GenerateData(mitk::PropertyList::Pointer pl)
Configures the overlay using properties from the given PropertyList.
~QmitkOverlay() override
Destructor. Deletes the internal widget unless it was set externally.
virtual void SetLayer(unsigned int layer)
Sets the stacking layer of this overlay.
virtual unsigned int GetLayer()
Returns the current stacking layer.
DisplayPosition m_Position
Current display position of the overlay.
Definition: QmitkOverlay.h:144
virtual QSize GetNeededSize()=0
Returns the minimum size needed to fully display this overlay.
unsigned int m_Layer
Stacking layer of the overlay.
Definition: QmitkOverlay.h:147
QWidget * m_Widget
Internal QWidget representing the overlay content.
Definition: QmitkOverlay.h:150
virtual DisplayPosition GetPosition()
Returns the current display position.
virtual QWidget * GetWidget()
Returns the internal QWidget representing this overlay.
QmitkOverlay(const char *id)
Constructor.
bool m_WidgetIsCustom
Flag indicating whether the widget was set externally (custom overlay).
Definition: QmitkOverlay.h:153
void AddDropShadow(QWidget *widget)
Adds a drop shadow graphics effect to the given widget.