Medical Imaging Interaction Toolkit  2018.4.99-389bf124
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 #if defined(_WIN32) || defined(__APPLE__)
17 #define QMITK_USE_EXTERNAL_RENDERWINDOW_MENU
18 #endif
19 
20 // mitk qtwidgets module
21 #include "MitkQtWidgetsExports.h"
23 
24 // mitk core
25 #include <mitkBaseRenderer.h>
26 
27 // qt
28 #include <QAction>
29 #include <QEvent>
30 #include <QLabel>
31 #include <QMenuBar>
32 #include <QPushButton>
33 #include <QTimer>
34 #include <QToolButton>
35 #include <QWidget>
36 
53 {
54  Q_OBJECT
55 
56 public:
57 
60 
61  QmitkRenderWindowMenu(QWidget *parent = nullptr,
62  Qt::WindowFlags f = nullptr,
63  mitk::BaseRenderer *b = nullptr);
64  ~QmitkRenderWindowMenu() override;
65 
70  {
71  if (m_LayoutActionsMenu == nullptr)
72  return false;
73  else
74  return m_LayoutActionsMenu->isVisible();
75  }
76 
78  void SetLayoutIndex(LayoutIndex layoutIndex);
79 
81  LayoutIndex GetLayoutIndex() { return m_Layout; }
84  void UpdateLayoutDesignList(LayoutDesign layoutDesign);
85 
88 #ifdef QMITK_USE_EXTERNAL_RENDERWINDOW_MENU
89  void MoveWidgetToCorrectPos(float opacity);
90 #else
91  void MoveWidgetToCorrectPos(float /*opacity*/);
92 #endif
93 
94  void ShowMenu();
95  void HideMenu();
96 
97 protected:
98 
100  void paintEvent(QPaintEvent *event) override;
101 
102  void CreateMenuWidget();
103 
105  void CreateSettingsWidget();
106 
108  void ChangeFullScreenIcon();
109 
110 Q_SIGNALS:
111 
112  void ResetView(); // == "global reinit"
113 
114  void CrosshairVisibilityChanged(bool);
115 
116  // \brief int parameters are enum from QmitkStdMultiWidget
117  void CrosshairRotationModeChanged(int);
118 
120  void LayoutDesignChanged(LayoutDesign layoutDesign);
121 
122 public Q_SLOTS:
123 
124  void DeferredShowMenu();
125  void DeferredHideMenu();
128  void smoothHide();
129 
130 protected Q_SLOTS:
131 
132  void enterEvent(QEvent * /*e*/) override;
133  void leaveEvent(QEvent * /*e*/) override;
134 
137  void AutoRotateNextStep();
138 
141  void OnAutoRotationActionTriggered();
142 
143  void OnTSNumChanged(int);
144 
145  void OnCrosshairMenuAboutToShow();
146  void OnCrosshairVisibilityChanged(bool);
147  void OnCrosshairRotationModeSelected(QAction *);
148 
153  void OnFullScreenButton(bool checked);
154 
158  void OnLayoutDesignButton(bool checked);
159 
160  void OnSetLayout(LayoutDesign layoutDesign);
161 
162 protected:
163 
164  QToolButton* m_CrosshairModeButton;
165 
166  QToolButton* m_FullScreenButton;
167 
168  QToolButton* m_LayoutDesignButton;
181 
182  QLabel *m_TSLabel;
183 
185 
188 
189 private:
190 
191  mitk::BaseRenderer::Pointer m_Renderer;
192 
193  QTimer* m_AutoRotationTimer;
194  QTimer* m_HideTimer;
195 
196  QWidget *m_Parent;
197 
198  //memory because mode is set to default for slice num = 1
199  static unsigned int m_DefaultThickMode;
200 
201  int m_CrosshairRotationMode;
202  bool m_CrosshairVisibility;
203 
204  LayoutIndex m_Layout;
205  LayoutDesign m_LayoutDesign;
206  LayoutDesign m_OldLayoutDesign;
207 
208 };
209 
210 #endif // QMITKRENDERWINDOWMENU_H
The QmitkRenderWindowMenu is a popup Widget which shows up when the mouse cursor enter a QmitkRenderW...
Organizes the rendering process.
#define MITKQTWIDGETS_EXPORT
ViewDirection
Possible view directions for render windows.