Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef QmitkRenderWindowMenu_h
00019 #define QmitkRenderWindowMenu_h
00020
00021 #if defined(_WIN32) || defined(__APPLE__)
00022 #define QMITK_USE_EXTERNAL_RENDERWINDOW_MENU
00023 #endif
00024
00025 #include "mitkCommon.h"
00026 #include "mitkBaseRenderer.h"
00027
00028 #include <QWidget>
00029 #include <QEvent>
00030 #include <QPushButton>
00031 #include <QMenuBar>
00032 #include <QAction>
00033 #include <QLabel>
00034
00035
00050 class QMITK_EXPORT QmitkRenderWindowMenu : public QWidget
00051 {
00052 Q_OBJECT
00053
00054 public:
00055
00056 QmitkRenderWindowMenu( QWidget* parent = 0, Qt::WFlags f = 0, mitk::BaseRenderer * b = 0 );
00057 virtual ~QmitkRenderWindowMenu();
00058
00062 bool GetSettingsMenuVisibilty()
00063 {
00064 if( m_Settings == NULL)
00065 return false;
00066 else
00067 return m_Settings->isVisible();
00068 }
00069
00071 void SetLayoutIndex( unsigned int layoutIndex );
00072
00074 unsigned int GetLayoutIndex()
00075 { return m_Layout; }
00076
00079 void UpdateLayoutDesignList( int layoutDesignIndex );
00080
00083 #ifdef QMITK_USE_EXTERNAL_RENDERWINDOW_MENU
00084 void MoveWidgetToCorrectPos(float opacity);
00085 #else
00086 void MoveWidgetToCorrectPos(float );
00087 #endif
00088
00089
00090 void ChangeFullScreenMode( bool state );
00091
00092 void NotifyNewWidgetPlanesMode( int mode );
00093
00094 protected:
00095
00098 void CreateMenuWidget();
00099
00100
00102 void CreateSettingsWidget();
00103
00105 void paintEvent(QPaintEvent *event);
00106
00110 void UpdateLayoutList();
00111
00113 void ChangeFullScreenIcon();
00114
00115
00116 int currentCrosshairRotationMode;
00117
00118 public slots:
00119
00120 void SetCrossHairVisibility( bool state ) ;
00121
00122
00123 signals:
00124
00125 void ResetView();
00126
00127
00128 void ChangeCrosshairRotationMode(int);
00129
00131 void SignalChangeLayoutDesign( int layoutDesign );
00132
00133 public slots:
00134
00135 void DeferredHideMenu( );
00136
00137 protected slots:
00138
00139 void enterEvent( QEvent* );
00140 void leaveEvent( QEvent* );
00141
00142 void OnTSNumChanged(int);
00143
00144 void OnCrosshairRotationModeSelected(QAction*);
00145
00149 void OnFullScreenButton( bool checked );
00150
00154 void OnSettingsButton( bool checked );
00155
00157 void OnChangeLayoutToDefault(bool);
00158
00160 void OnChangeLayoutTo2DImagesUp(bool);
00161
00163 void OnChangeLayoutTo2DImagesLeft(bool);
00164
00166 void OnChangeLayoutToBig3D(bool);
00167
00169 void OnChangeLayoutToWidget1(bool);
00170
00172 void OnChangeLayoutToWidget2(bool);
00173
00175 void OnChangeLayoutToWidget3(bool);
00176
00178 void OnChangeLayoutToRowWidget3And4(bool);
00179
00181 void OnChangeLayoutToColumnWidget3And4(bool);
00182
00184 void OnChangeLayoutToSmallUpperWidget2Big3and4(bool);
00185
00187 void OnChangeLayoutTo2x2Dand3DWidget(bool);
00188
00190 void OnChangeLayoutToLeft2Dand3DRight2D(bool);
00191
00192 void OnCrossHairMenuAboutToShow();
00193
00194 public:
00195
00197 enum {
00198 TRANSVERSAL,
00199 SAGITTAL,
00200 CORONAL,
00201 THREE_D
00202 };
00203
00204
00206 enum {
00207 LAYOUT_DEFAULT,
00208 LAYOUT_2DIMAGEUP,
00209 LAYOUT_2DIMAGELEFT,
00210 LAYOUT_BIG3D,
00211 LAYOUT_TRANSVERSAL,
00212 LAYOUT_SAGITTAL,
00213 LAYOUT_CORONAL,
00214 LAYOUT_2X2DAND3DWIDGET,
00215 LAYOUT_ROWWIDGET3AND4,
00216 LAYOUT_COLUMNWIDGET3AND4,
00217 LAYOUT_ROWWIDGETSMALL3ANDBIG4,
00218 LAYOUT_SMALLUPPERWIDGET2BIGAND4,
00219 LAYOUT_LEFT2DAND3DRIGHT2D
00220 };
00221
00222 void ShowMenu();
00223 void HideMenu();
00224
00225 protected:
00226
00227 QPushButton* m_CrosshairModeButton;
00228
00229
00230
00232 QPushButton* m_FullScreenButton;
00233
00235 QPushButton* m_SettingsButton;
00236
00238 QAction* m_DefaultLayoutAction;
00239
00241 QAction* m_2DImagesUpLayoutAction;
00242
00244 QAction* m_2DImagesLeftLayoutAction;
00245
00247 QAction* m_Big3DLayoutAction;
00248
00250 QAction* m_Widget1LayoutAction;
00251
00253 QAction* m_Widget2LayoutAction;
00254
00256 QAction* m_Widget3LayoutAction;
00257
00259 QAction* m_RowWidget3And4LayoutAction;
00260
00262 QAction* m_ColumnWidget3And4LayoutAction;
00263
00265 QAction* m_SmallUpperWidget2Big3and4LayoutAction;
00266
00268 QAction* m_2x2Dand3DWidgetLayoutAction;
00269
00271 QAction* m_Left2Dand3DRight2DLayoutAction;
00272
00273 QLabel *m_TSLabel;
00274
00275
00277 QMenu* m_Settings;
00278
00279 QMenu* m_CrosshairMenu;
00280
00282 unsigned int m_Layout;
00283
00287 unsigned int m_LayoutDesign;
00288
00290 unsigned int m_OldLayoutDesign;
00291
00293 bool m_FullScreenMode;
00294
00295 bool m_Entered;
00296
00297 bool m_Hidden;
00298
00299 private:
00300
00301 mitk::BaseRenderer::Pointer m_Renderer;
00302 };
00303
00304 #endif // QmitkRenderWindowMenu_H