Medical Imaging Interaction Toolkit  2024.06.99-60d9b802
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 
49 {
50  Q_OBJECT
51 
52 public:
53 
56 
57  QmitkRenderWindowMenu(QWidget *parent = nullptr,
58  Qt::WindowFlags f = {},
59  mitk::BaseRenderer *b = nullptr);
60  ~QmitkRenderWindowMenu() override;
61 
66  {
67  if (m_LayoutActionsMenu == nullptr)
68  return false;
69  else
70  return m_LayoutActionsMenu->isVisible();
71  }
72 
74  void SetLayoutIndex(LayoutIndex layoutIndex);
75 
77  LayoutIndex GetLayoutIndex() { return m_Layout; }
80  void UpdateLayoutDesignList(LayoutDesign layoutDesign);
81 
82  void UpdateCrosshairVisibility(bool visible);
83 
84  void UpdateCrosshairRotationMode(int mode);
85 
88  void MoveWidgetToCorrectPos();
89 
90  void ShowMenu();
91  void HideMenu();
92 
93 protected:
94 
96  void paintEvent(QPaintEvent *event) override;
97 
98  void CreateMenuWidget();
99 
101  void CreateSettingsWidget();
102 
104  void ChangeFullScreenIcon();
105 
106 Q_SIGNALS:
107 
108  void ResetView(); // == "global reinit"
109 
110  void CrosshairVisibilityChanged(bool);
111 
112  // \brief int parameters are enum from QmitkStdMultiWidget
113  void CrosshairRotationModeChanged(int);
114 
116  void LayoutDesignChanged(LayoutDesign layoutDesign);
117 
118 protected Q_SLOTS:
119 
122  void AutoRotateNextStep();
123 
126  void OnAutoRotationActionTriggered();
127 
128  void OnTSNumChanged(int);
129 
130  void OnCrosshairMenuAboutToShow();
131  void OnCrosshairVisibilityChanged(bool);
132  void OnCrosshairRotationModeSelected(QAction *);
133 
138  void OnFullScreenButton(bool checked);
139 
143  void OnLayoutDesignButton(bool checked);
144 
145  void OnSetLayout(LayoutDesign layoutDesign);
146 
147 protected:
148 
149  QToolButton* m_CrosshairModeButton;
150 
151  QToolButton* m_FullScreenButton;
152 
153  QToolButton* m_LayoutDesignButton;
166 
167  QLabel *m_TSLabel;
168 
170 
173 
174 private:
175 
176  mitk::BaseRenderer::Pointer m_Renderer;
177 
178  QTimer* m_AutoRotationTimer;
179 
180  QWidget *m_Parent;
181 
182  //memory because mode is set to default for slice num = 1
183  static unsigned int m_DefaultThickMode;
184 
185  int m_CrosshairRotationMode;
186  bool m_CrosshairVisibility;
187 
188  LayoutIndex m_Layout;
189  LayoutDesign m_LayoutDesign;
190  LayoutDesign m_OldLayoutDesign;
191 
192 };
193 
194 #endif
QmitkRenderWindowMenu
The QmitkRenderWindowMenu is a popup Widget which shows up when the mouse cursor enter a QmitkRenderW...
Definition: QmitkRenderWindowMenu.h:48
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:162
QmitkRenderWindowMenu::m_Only2DVerticalLayoutAction
QAction * m_Only2DVerticalLayoutAction
Definition: QmitkRenderWindowMenu.h:160
QmitkRenderWindowMenu::m_FullScreenMode
bool m_FullScreenMode
Definition: QmitkRenderWindowMenu.h:172
QmitkRenderWindowMenu::m_OneTop3DBottomLayoutAction
QAction * m_OneTop3DBottomLayoutAction
Definition: QmitkRenderWindowMenu.h:161
QmitkMultiWidgetLayoutManager.h
QmitkRenderWindowMenu::m_All2DLeft3DRightLayoutAction
QAction * m_All2DLeft3DRightLayoutAction
Definition: QmitkRenderWindowMenu.h:157
itk::SmartPointer< Self >
QmitkRenderWindowMenu::m_All2DTop3DBottomLayoutAction
QAction * m_All2DTop3DBottomLayoutAction
Definition: QmitkRenderWindowMenu.h:156
QmitkRenderWindowMenu::m_OneBigLayoutAction
QAction * m_OneBigLayoutAction
Definition: QmitkRenderWindowMenu.h:158
QmitkRenderWindowMenu::m_RemoveOneLayoutAction
QAction * m_RemoveOneLayoutAction
Definition: QmitkRenderWindowMenu.h:165
QmitkRenderWindowMenu::m_TSLabel
QLabel * m_TSLabel
Definition: QmitkRenderWindowMenu.h:167
mitk::AnatomicalPlane
AnatomicalPlane
Definition: mitkAnatomicalPlanes.h:18
QmitkRenderWindowMenu::m_LayoutActionsMenu
QMenu * m_LayoutActionsMenu
Definition: QmitkRenderWindowMenu.h:154
MitkQtWidgetsExports.h
QmitkRenderWindowMenu::m_Only2DHorizontalLayoutAction
QAction * m_Only2DHorizontalLayoutAction
Definition: QmitkRenderWindowMenu.h:159
QmitkRenderWindowMenu::m_AllHorizontalLayoutAction
QAction * m_AllHorizontalLayoutAction
Definition: QmitkRenderWindowMenu.h:163
QmitkRenderWindowMenu::m_LayoutDesignButton
QToolButton * m_LayoutDesignButton
Definition: QmitkRenderWindowMenu.h:153
QmitkRenderWindowMenu::GetSettingsMenuVisibilty
bool GetSettingsMenuVisibilty()
Definition: QmitkRenderWindowMenu.h:65
mitk::BaseRenderer
Definition: mitkBaseRenderer.h:56
QmitkRenderWindowMenu::m_FullScreenButton
QToolButton * m_FullScreenButton
Definition: QmitkRenderWindowMenu.h:151
QmitkRenderWindowMenu::m_DefaultLayoutAction
QAction * m_DefaultLayoutAction
Definition: QmitkRenderWindowMenu.h:155
mitkBaseRenderer.h
QmitkRenderWindowMenu::GetLayoutIndex
LayoutIndex GetLayoutIndex()
Definition: QmitkRenderWindowMenu.h:77
QmitkRenderWindowMenu::m_CrosshairMenu
QMenu * m_CrosshairMenu
Definition: QmitkRenderWindowMenu.h:169
QmitkRenderWindowMenu::m_AllVerticalLayoutAction
QAction * m_AllVerticalLayoutAction
Definition: QmitkRenderWindowMenu.h:164
QmitkRenderWindowMenu::m_CrosshairModeButton
QToolButton * m_CrosshairModeButton
Definition: QmitkRenderWindowMenu.h:149