Slicer  4.8
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
qSlicerAppMainWindow.h
Go to the documentation of this file.
1 /*==============================================================================
2 
3  Program: 3D Slicer
4 
5  Copyright (c) Kitware Inc.
6 
7  See COPYRIGHT.txt
8  or http://www.slicer.org/copyright/copyright.txt for details.
9 
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15 
16  This file was originally developed by Jean-Christophe Fillion-Robin, Kitware Inc.
17  and was partially funded by NIH grant 3P41RR013218-12S1
18 
19 ==============================================================================*/
20 
21 #ifndef __qSlicerAppMainWindow_h
22 #define __qSlicerAppMainWindow_h
23 
24 // Qt includes
25 #include <QMainWindow>
26 #include <QVariantMap>
27 
28 // CTK includes
29 #include <ctkErrorLogModel.h>
30 class ctkErrorLogWidget;
31 class ctkPythonConsole;
32 
33 // Slicer includes
34 #include "qSlicerAppExport.h"
35 #include "qSlicerIO.h"
36 #include "vtkSlicerConfigure.h" // For Slicer_BUILD_DICOM_SUPPORT, Slicer_USE_PYTHONQT, Slicer_USE_QtTesting
37 
39 class qSlicerAppMainWindowPrivate;
40 
41 // VTK includes
42 class vtkObject;
43 
44 class Q_SLICER_APP_EXPORT qSlicerAppMainWindow : public QMainWindow
45 {
46  Q_OBJECT
47 public:
48  typedef QMainWindow Superclass;
49 
50  qSlicerAppMainWindow(QWidget *parent=0);
51  virtual ~qSlicerAppMainWindow();
52 
56  Q_INVOKABLE qSlicerModuleSelectorToolBar* moduleSelector()const;
57 
58 #ifdef Slicer_USE_PYTHONQT
59  Q_INVOKABLE ctkPythonConsole* pythonConsole()const;
62 #endif
63  Q_INVOKABLE ctkErrorLogWidget* errorLogWidget()const;
66 
67 public slots:
68  virtual void setHomeModuleCurrent();
69  virtual void restoreToolbars();
70 
71  virtual void on_FileAddDataAction_triggered();
72  virtual void on_FileLoadDataAction_triggered();
73  virtual void on_FileImportSceneAction_triggered();
74  virtual void on_FileLoadSceneAction_triggered();
75  virtual void on_FileAddVolumeAction_triggered();
76  virtual void on_FileAddTransformAction_triggered();
77  virtual void on_FileSaveSceneAction_triggered();
78  virtual void on_FileExitAction_triggered();
79  virtual void onFileRecentLoadedActionTriggered();
80  virtual void on_SDBSaveToDirectoryAction_triggered();
81  virtual void on_SDBSaveToMRBAction_triggered();
82  virtual void on_SDBSaveToDCMAction_triggered();
83  virtual void on_FileCloseSceneAction_triggered();
84  virtual void on_LoadDICOMAction_triggered();
85 
86  virtual void on_EditRecordMacroAction_triggered();
87  virtual void on_EditPlayMacroAction_triggered();
88  virtual void on_EditUndoAction_triggered();
89  virtual void on_EditRedoAction_triggered();
90 
91  virtual void on_ModuleHomeAction_triggered();
92 
93  virtual void onLayoutActionTriggered(QAction* action);
94  virtual void onLayoutCompareActionTriggered(QAction* action);
95  virtual void onLayoutCompareWidescreenActionTriggered(QAction* action);
96  virtual void onLayoutCompareGridActionTriggered(QAction* action);
97 
98  virtual void setLayout(int);
99  virtual void setLayoutNumberOfCompareViewRows(int);
100  virtual void setLayoutNumberOfCompareViewColumns(int);
101 
102  virtual void onPythonConsoleToggled(bool);
103 
104  virtual void on_WindowErrorLogAction_triggered();
105  virtual void on_WindowToolbarsResetToDefaultAction_triggered();
106 
107  virtual void on_HelpKeyboardShortcutsAction_triggered();
108  virtual void on_HelpBrowseTutorialsAction_triggered();
109  virtual void on_HelpInterfaceDocumentationAction_triggered();
110  virtual void on_HelpSlicerPublicationsAction_triggered();
111  virtual void on_HelpVisualBlogAction_triggered();
112 
113  virtual void on_HelpReportBugOrFeatureRequestAction_triggered();
114  virtual void on_HelpAboutSlicerAppAction_triggered();
115 
116  virtual void on_EditApplicationSettingsAction_triggered();
117  virtual void on_CutAction_triggered();
118  virtual void on_CopyAction_triggered();
119  virtual void on_PasteAction_triggered();
120  virtual void on_ViewExtensionsManagerAction_triggered();
121 
122 signals:
125  void initialWindowShown();
126 
127 protected slots:
128  virtual void onModuleLoaded(const QString& moduleName);
129  virtual void onModuleAboutToBeUnloaded(const QString& moduleName);
130  virtual void onNewFileLoaded(const qSlicerIO::IOProperties &fileProperties);
131 
132  virtual void onMRMLSceneModified(vtkObject*);
133  virtual void onLayoutChanged(int);
134  virtual void onWarningsOrErrorsOccurred(ctkErrorLogLevel::LogLevel logLevel);
135 
136 #ifdef Slicer_USE_PYTHONQT
137  virtual void onPythonConsoleUserInput(const QString&);
138 #endif
139 
140 protected:
142  virtual void setupMenuActions();
143 
145  virtual void pythonConsoleInitialDisplay();
146 
148  virtual void disclaimer();
149 
153  virtual void dragEnterEvent(QDragEnterEvent *event);
154 
157  virtual void dropEvent(QDropEvent *event);
158 
165  virtual bool eventFilter(QObject* object, QEvent* event);
166 
167  virtual void closeEvent(QCloseEvent *event);
168  virtual void showEvent(QShowEvent *event);
169 
170 protected:
171  QScopedPointer<qSlicerAppMainWindowPrivate> d_ptr;
172 
173  qSlicerAppMainWindow(qSlicerAppMainWindowPrivate* pimpl, QWidget* parent);
174 
175 private:
176  Q_DECLARE_PRIVATE(qSlicerAppMainWindow);
177  Q_DISABLE_COPY(qSlicerAppMainWindow);
178 };
179 
180 #endif
QScopedPointer< qSlicerAppMainWindowPrivate > d_ptr