Medical Imaging Interaction Toolkit  2024.12.99-0da743f6
Medical Imaging Interaction Toolkit
QmitkRenderWindowMenu.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 QmitkRenderWindowMenu_h
14 #define QmitkRenderWindowMenu_h
15 
16 // mitk qtwidgets module
17 #include "MitkQtWidgetsExports.h"
19 
20 // mitk core
21 #include <mitkBaseRenderer.h>
22 
23 // qt
24 #include <QAction>
25 #include <QEvent>
26 #include <QLabel>
27 #include <QMenuBar>
28 #include <QPushButton>
29 #include <QTimer>
30 #include <QToolButton>
31 #include <QWidget>
32 
51 {
52  Q_OBJECT
53 
54 public:
55 
58 
59  QmitkRenderWindowMenu(QWidget *parent = nullptr,
60  Qt::WindowFlags f = {},
61  mitk::BaseRenderer *b = nullptr);
62  ~QmitkRenderWindowMenu() override;
63 
68  {
69  if (m_LayoutActionsMenu == nullptr)
70  return false;
71  else
72  return m_LayoutActionsMenu->isVisible();
73  }
74 
76  void SetLayoutIndex(LayoutIndex layoutIndex);
77 
79  LayoutIndex GetLayoutIndex() { return m_Layout; }
82  void UpdateLayoutDesignList(LayoutDesign layoutDesign);
83 
84  void UpdateCrosshairVisibility(bool visible);
85 
86  void UpdateCrosshairRotationMode(int mode);
87 
90  void MoveWidgetToCorrectPos();
91 
92  void ShowMenu();
93  void HideMenu();
94 
95 protected:
96 
98  void paintEvent(QPaintEvent *event) override;
99 
100  void CreateMenuWidget();
101 
103  void CreateSettingsWidget();
104 
106  void ChangeFullScreenIcon();
107 
108 Q_SIGNALS:
109 
110  void ResetView(); // == "global reinit"
111 
112  void CrosshairVisibilityChanged(bool);
113 
114  // \brief int parameters are enum from QmitkStdMultiWidget
115  void CrosshairRotationModeChanged(int);
116 
118  void LayoutDesignChanged(LayoutDesign layoutDesign);
119 
120 protected Q_SLOTS:
121 
124  void AutoRotateNextStep();
125 
128  void OnAutoRotationActionTriggered();
129 
130  void OnTSNumChanged(int);
131 
132  void OnCrosshairMenuAboutToShow();
133  void OnCrosshairVisibilityChanged(bool);
134  void OnCrosshairRotationModeSelected(QAction *);
135 
140  void OnFullScreenButton(bool checked);
141 
145  void OnLayoutDesignButton(bool checked);
146 
147  void OnSetLayout(LayoutDesign layoutDesign);
148 
149 protected:
150 
151  QToolButton* m_CrosshairModeButton;
152 
153  QToolButton* m_FullScreenButton;
154 
155  QToolButton* m_LayoutDesignButton;
168 
169  QLabel *m_TSLabel;
170 
172 
175 
176 private:
177 
178  mitk::BaseRenderer::Pointer m_Renderer;
179 
180  QTimer* m_AutoRotationTimer;
181 
182  QWidget *m_Parent;
183 
184  //memory because mode is set to default for slice num = 1
185  static unsigned int m_DefaultThickMode;
186 
187  int m_CrosshairRotationMode;
188  bool m_CrosshairVisibility;
189 
190  LayoutIndex m_Layout;
191  LayoutDesign m_LayoutDesign;
192  LayoutDesign m_OldLayoutDesign;
193 
194 };
195 
196 #endif
QmitkRenderWindowMenu
The QmitkRenderWindowMenu is a popup Widget which shows up when the mouse cursor enter a QmitkRenderW...
Definition: QmitkRenderWindowMenu.h:50
QmitkMultiWidgetLayoutManager::LayoutDesign
LayoutDesign
Definition: QmitkMultiWidgetLayoutManager.h:41
MITKQTWIDGETS_EXPORT
#define MITKQTWIDGETS_EXPORT
Definition: MitkQtWidgetsExports.h:15
QmitkRenderWindowMenu::m_OneLeft3DRightLayoutAction
QAction * m_OneLeft3DRightLayoutAction
Definition: QmitkRenderWindowMenu.h:164
QmitkRenderWindowMenu::m_Only2DVerticalLayoutAction
QAction * m_Only2DVerticalLayoutAction
Definition: QmitkRenderWindowMenu.h:162
QmitkRenderWindowMenu::m_FullScreenMode
bool m_FullScreenMode
Definition: QmitkRenderWindowMenu.h:174
QmitkRenderWindowMenu::m_OneTop3DBottomLayoutAction
QAction * m_OneTop3DBottomLayoutAction
Definition: QmitkRenderWindowMenu.h:163
QmitkMultiWidgetLayoutManager.h
QmitkRenderWindowMenu::m_All2DLeft3DRightLayoutAction
QAction * m_All2DLeft3DRightLayoutAction
Definition: QmitkRenderWindowMenu.h:159
itk::SmartPointer< Self >
QmitkRenderWindowMenu::m_All2DTop3DBottomLayoutAction
QAction * m_All2DTop3DBottomLayoutAction
Definition: QmitkRenderWindowMenu.h:158
QmitkRenderWindowMenu::m_OneBigLayoutAction
QAction * m_OneBigLayoutAction
Definition: QmitkRenderWindowMenu.h:160
QmitkRenderWindowMenu::m_RemoveOneLayoutAction
QAction * m_RemoveOneLayoutAction
Definition: QmitkRenderWindowMenu.h:167
QmitkRenderWindowMenu::m_TSLabel
QLabel * m_TSLabel
Definition: QmitkRenderWindowMenu.h:169
mitk::AnatomicalPlane
AnatomicalPlane
Definition: mitkAnatomicalPlanes.h:18
QmitkRenderWindowMenu::m_LayoutActionsMenu
QMenu * m_LayoutActionsMenu
Definition: QmitkRenderWindowMenu.h:156
MitkQtWidgetsExports.h
QmitkRenderWindowMenu::m_Only2DHorizontalLayoutAction
QAction * m_Only2DHorizontalLayoutAction
Definition: QmitkRenderWindowMenu.h:161
QmitkRenderWindowMenu::m_AllHorizontalLayoutAction
QAction * m_AllHorizontalLayoutAction
Definition: QmitkRenderWindowMenu.h:165
QmitkRenderWindowMenu::m_LayoutDesignButton
QToolButton * m_LayoutDesignButton
Definition: QmitkRenderWindowMenu.h:155
QmitkRenderWindowMenu::GetSettingsMenuVisibilty
bool GetSettingsMenuVisibilty()
Definition: QmitkRenderWindowMenu.h:67
mitk::BaseRenderer
Definition: mitkBaseRenderer.h:56
QmitkRenderWindowMenu::m_FullScreenButton
QToolButton * m_FullScreenButton
Definition: QmitkRenderWindowMenu.h:153
QmitkRenderWindowMenu::m_DefaultLayoutAction
QAction * m_DefaultLayoutAction
Definition: QmitkRenderWindowMenu.h:157
mitkBaseRenderer.h
QmitkRenderWindowMenu::GetLayoutIndex
LayoutIndex GetLayoutIndex()
Definition: QmitkRenderWindowMenu.h:79
QmitkRenderWindowMenu::m_CrosshairMenu
QMenu * m_CrosshairMenu
Definition: QmitkRenderWindowMenu.h:171
QmitkRenderWindowMenu::m_AllVerticalLayoutAction
QAction * m_AllVerticalLayoutAction
Definition: QmitkRenderWindowMenu.h:166
QmitkRenderWindowMenu::m_CrosshairModeButton
QToolButton * m_CrosshairModeButton
Definition: QmitkRenderWindowMenu.h:151