Computer Assisted Medical Intervention Tool Kit  version 5.2
ImpMainWindow.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * $CAMITK_LICENCE_BEGIN$
3  *
4  * CamiTK - Computer Assisted Medical Intervention ToolKit
5  * (c) 2001-2024 Univ. Grenoble Alpes, CNRS, Grenoble INP - UGA, TIMC, 38000 Grenoble, France
6  *
7  * Visit http://camitk.imag.fr for more information
8  *
9  * This file is part of CamiTK.
10  *
11  * CamiTK is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * CamiTK is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Lesser General Public License version 3 for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public License
21  * version 3 along with CamiTK. If not, see <http://www.gnu.org/licenses/>.
22  *
23  * $CAMITK_LICENCE_END$
24  ****************************************************************************/
25 
26 
27 #ifndef IMP_MAINWINDOW_H
28 #define IMP_MAINWINDOW_H
29 
30 
31 // -- Core stuff
32 #include <MainWindow.h>
33 #include <Application.h>
34 
44  Q_OBJECT
45 
46 public:
47 
51  ImpMainWindow();
52 
54  void aboutToShow() override;
55 
57  virtual ~ImpMainWindow();
58 
61 
66  virtual void addDockViewer(Qt::DockWidgetArea, camitk::Viewer*) override final;
67 
72  virtual void setCentralViewer(camitk::Viewer*) override final;
73 
75  virtual void redirectToConsole(bool) override;
77 
78 public slots:
79 
83  void openDataDirectory(QString plugin);
85 
89  virtual void refresh() override;
91 
96 
98  void showToolbar(bool);
99 
101  void toggleMenuBar();
102 
104  void resetWindows();
105 
107  void showStatusBar(bool);
108 
110  void saveHistoryAsSCXML();
111 
113 
117  void editSettings();
118 
120 
121 protected:
122 
126  void updateViewMenu();
127 
130 
133 
135  void updateActionStates();
136 
138  void initActions();
140 
142  QToolBar* mainToolbar;
143 
144 private:
145 
148 
150  void initMenuBar();
151 
155  void initToolBar();
157 
160 
161  QMenu* fileMenu;
162  QMenu* fileOpenDataDirectoryMenu;
163  QAction* fileOpen;
164  QAction* workspaceOpen;
165  QAction* fileClose;
166  QAction* fileCloseAll;
167  QAction* fileSave;
168  QAction* fileSaveAs;
169  QAction* fileSaveAll;
170  QAction* workspaceSave;
171  QAction* fileQuit;
172 
175 
176  QMenu* viewMenu;
177  QAction* viewMenuBar;
178  QAction* viewStatusBar;
179  QAction* viewResetWindows;
181 
185  QAction* editApplicationSettings;
186  QAction* editClearSelection;
187  QAction* saveHistory;
189 
192 
197  QMenu* actionMenu;
198 
202  QAction* helpAboutApp;
203 
205  QAction* helpShowConsole;
207 
211  QAction* changeLanguage;
213 
216 
218  QList<QAction*> recentDocumentActions;
219 
221  QAction* recentDocumentSeparator;
222 
224 
225 
226 private slots:
227 
229  void openRecentDocuments();
230 
231 };
232 
233 #endif //IMP_MAINWINDOW_H
234 
This Class describes the "historical" imp application.
Definition: ImpMainWindow.h:43
void toggleMenuBar()
show or hide the menu bar
Definition: ImpMainWindow.cpp:410
virtual void redirectToConsole(bool) override
use or not the application console (overriden to add an action to show the console window)
Definition: ImpMainWindow.cpp:621
void updateActionStates()
set the current QAction enable state depending on the current selection
Definition: ImpMainWindow.cpp:353
virtual ~ImpMainWindow()
destructor
Definition: ImpMainWindow.cpp:131
void updateOpenDirectoryMenu()
update the open data directory menu depending on registered plugins
Definition: ImpMainWindow.cpp:672
void editSettings()
Definition: ImpMainWindow.cpp:591
virtual void setCentralViewer(camitk::Viewer *) override final
set the central Viewer of the application.
Definition: ImpMainWindow.cpp:166
void openDataDirectory(QString plugin)
Definition: ImpMainWindow.cpp:479
void initActions()
initializes all QActions of the application
Definition: ImpMainWindow.cpp:173
virtual void refresh() override
Definition: ImpMainWindow.cpp:148
void aboutToShow() override
overriden from MainWindow to automatically load last opened document if needed
Definition: ImpMainWindow.cpp:135
void updateViewMenu()
Definition: ImpMainWindow.cpp:512
QToolBar * mainToolbar
the main toolbar
Definition: ImpMainWindow.h:142
void resetWindows()
reset all windows in their initial state
Definition: ImpMainWindow.cpp:430
void saveHistoryAsSCXML()
Save the history of action as a SCXML file.
Definition: ImpMainWindow.cpp:667
void updateRecentDocumentsMenu()
update the recent document menu
Definition: ImpMainWindow.cpp:646
void showToolbar(bool)
show or hide the toolbar
Definition: ImpMainWindow.cpp:405
void showStatusBar(bool)
show or hide the status bar
Definition: ImpMainWindow.cpp:425
virtual void addDockViewer(Qt::DockWidgetArea, camitk::Viewer *) override final
add a Viewer to the application as a docking widget and specify where it has to be docked MainWindow ...
Definition: ImpMainWindow.cpp:159
ImpMainWindow()
Definition: ImpMainWindow.cpp:57
This class is the base class for your application.
Definition: MainWindow.h:66
Viewer is an abstract class that is the base class for all viewers.
Definition: Viewer.h:181