Medical Imaging Interaction Toolkit  2016.11.0
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,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef QmitkRenderWindowMenu_h
18 #define QmitkRenderWindowMenu_h
19 
20 #if defined(_WIN32) || defined(__APPLE__)
21 #define QMITK_USE_EXTERNAL_RENDERWINDOW_MENU
22 #endif
23 
24 #include "mitkBaseRenderer.h"
25 #include <MitkQtWidgetsExports.h>
26 
27 #include <QAction>
28 #include <QEvent>
29 #include <QLabel>
30 #include <QMenuBar>
31 #include <QPushButton>
32 #include <QTimer>
33 #include <QToolButton>
34 #include <QWidget>
35 
37 
56 {
57  Q_OBJECT
58 
59 public:
60  QmitkRenderWindowMenu(QWidget *parent = 0,
61  Qt::WindowFlags f = 0,
62  mitk::BaseRenderer *b = 0,
63  QmitkStdMultiWidget *mw = 0);
64  virtual ~QmitkRenderWindowMenu();
65 
70  {
71  if (m_Settings == NULL)
72  return false;
73  else
74  return m_Settings->isVisible();
75  }
76 
78  void SetLayoutIndex(unsigned int layoutIndex);
79 
81  unsigned int GetLayoutIndex() { return m_Layout; }
84  void UpdateLayoutDesignList(int layoutDesignIndex);
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 ChangeFullScreenMode(bool state);
95 
96  void NotifyNewWidgetPlanesMode(int mode);
97 
98 protected:
102  void CreateMenuWidget();
103 
105  void CreateSettingsWidget();
106 
108  void paintEvent(QPaintEvent *event);
109 
113  void UpdateLayoutList();
114 
116  void ChangeFullScreenIcon();
117 
119 
120 public slots:
121 
122  void SetCrossHairVisibility(bool state);
123 
124 signals:
125 
126  void ResetView(); // == "global reinit"
127 
128  // \brief int parameters are enum from QmitkStdMultiWidget
129  void ChangeCrosshairRotationMode(int);
130 
132  void SignalChangeLayoutDesign(int layoutDesign);
133 
134 public slots:
135 
136  void DeferredHideMenu();
137  void DeferredShowMenu();
138  void smoothHide();
139 
140 protected slots:
141 
146  void AutoRotateNextStep();
151  void OnAutoRotationActionTriggered();
152 
153  void enterEvent(QEvent * /*e*/) override;
154  void leaveEvent(QEvent * /*e*/) override;
155  void OnTSNumChanged(int);
156 
157  void OnCrosshairRotationModeSelected(QAction *);
158 
164  void OnFullScreenButton(bool checked);
165 
169  void OnSettingsButton(bool checked);
170 
173  void OnChangeLayoutToDefault(bool);
174 
177  void OnChangeLayoutTo2DImagesUp(bool);
178 
181  void OnChangeLayoutTo2DImagesLeft(bool);
182 
185  void OnChangeLayoutToBig3D(bool);
186 
189  void OnChangeLayoutToWidget1(bool);
190 
193  void OnChangeLayoutToWidget2(bool);
194 
197  void OnChangeLayoutToWidget3(bool);
198 
201  void OnChangeLayoutToRowWidget3And4(bool);
202 
205  void OnChangeLayoutToColumnWidget3And4(bool);
206 
209  void OnChangeLayoutToSmallUpperWidget2Big3and4(bool);
210 
213  void OnChangeLayoutTo2x2Dand3DWidget(bool);
214 
217  void OnChangeLayoutToLeft2Dand3DRight2D(bool);
218 
219  void OnCrossHairMenuAboutToShow();
220 
221 public:
223  enum
224  {
228  THREE_D
229  };
230 
232  enum
233  {
244  LAYOUT_ROWWIDGETSMALL3ANDBIG4, // not in use in this class, but we need it here to synchronize with the
245  // SdtMultiWidget.
247  LAYOUT_LEFT2DAND3DRIGHT2D
248  };
249 
250  void ShowMenu();
251  void HideMenu();
252 
253 protected:
254  QToolButton *m_CrosshairModeButton;
255 
256  // QAction* m_ShowHideCrosshairVisibilityAction;
257 
259  QToolButton *m_FullScreenButton;
260 
262  QToolButton *m_SettingsButton;
263 
266 
269 
272 
275 
278 
281 
284 
287 
290 
293 
296 
299 
300  QLabel *m_TSLabel;
301 
303  QMenu *m_Settings;
304 
306 
308  unsigned int m_Layout;
309 
314  unsigned int m_LayoutDesign;
315 
318  unsigned int m_OldLayoutDesign;
319 
322 
323  bool m_Entered;
324 
325 private:
326  mitk::BaseRenderer::Pointer m_Renderer;
327 
328  QmitkStdMultiWidget *m_MultiWidget;
329 
333  QTimer m_AutoRotationTimer;
334  QTimer m_HideTimer;
335 
336  QWidget *m_Parent;
337 };
338 
339 #endif // QmitkRenderWindowMenu_H
The QmitkRenderWindowMenu is a popup Widget which shows up when the mouse curser enter a QmitkRenderW...
Organizes the rendering process.
#define MITKQTWIDGETS_EXPORT
QAction * m_SmallUpperWidget2Big3and4LayoutAction