Computer Assited Medical Intervention Tool Kit  version 5.0
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-2021 Univ. Grenoble Alpes, CNRS, Grenoble INP, 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;
163  QAction* fileOpen;
164  QAction* fileClose;
165  QAction* fileCloseAll;
166  QAction* fileSave;
167  QAction* fileSaveAs;
168  QAction* fileSaveAll;
169  QAction* fileQuit;
170 
173 
174  QMenu* viewMenu;
175  QAction* viewMenuBar;
176  QAction* viewStatusBar;
179 
185  QAction* saveHistory;
187 
190 
195  QMenu* actionMenu;
196 
200  QAction* helpAboutApp;
201 
203  QAction* helpShowConsole;
205 
209  QAction* changeLanguage;
211 
214 
216  QList<QAction*> recentDocumentActions;
217 
220 
222 
223 
224 private slots:
225 
227  void openRecentDocuments();
228 
229 };
230 
231 #endif //IMP_MAINWINDOW_H
232 
This Class describes the "historical" imp application.
Definition: ImpMainWindow.h:43
QAction * editClearSelection
Definition: ImpMainWindow.h:184
QAction * changeLanguage
Definition: ImpMainWindow.h:209
QAction * viewStatusBar
Definition: ImpMainWindow.h:176
void toggleMenuBar()
show or hide the menu bar
Definition: ImpMainWindow.cpp:412
virtual void redirectToConsole(bool) override
use or not the application console (overriden to add an action to show the console window)
Definition: ImpMainWindow.cpp:623
QAction * fileSaveAs
Definition: ImpMainWindow.h:167
void openRecentDocuments()
open a given recent document
Definition: ImpMainWindow.cpp:630
void updateActionStates()
set the current QAction enable state depending on the current selection
Definition: ImpMainWindow.cpp:355
QAction * helpAboutApp
Definition: ImpMainWindow.h:200
QAction * viewMenuBar
Definition: ImpMainWindow.h:175
QMenu * viewMenu
view_menu contains all items of the menubar entry "View"
Definition: ImpMainWindow.h:174
virtual ~ImpMainWindow()
destructor
Definition: ImpMainWindow.cpp:137
QAction * recentDocumentSeparator
the separator between the last file menu action and the recent document actions
Definition: ImpMainWindow.h:219
void updateOpenDirectoryMenu()
update the open data directory menu depending on registered plugins
Definition: ImpMainWindow.cpp:674
QMenu * fileOpenDataDirectoryMenu
Definition: ImpMainWindow.h:162
QMenu * fileMenu
file_menu contains all items of the menubar entry "File"
Definition: ImpMainWindow.h:161
QList< QAction * > recentDocumentActions
list of all the possible recent documents actions
Definition: ImpMainWindow.h:216
QAction * fileOpen
Definition: ImpMainWindow.h:163
QAction * saveHistory
Definition: ImpMainWindow.h:185
void editSettings()
Definition: ImpMainWindow.cpp:593
QAction * fileCloseAll
Definition: ImpMainWindow.h:165
QAction * fileQuit
Definition: ImpMainWindow.h:169
QAction * viewResetWindows
Definition: ImpMainWindow.h:177
virtual void setCentralViewer(camitk::Viewer *) override final
set the central Viewer of the application.
Definition: ImpMainWindow.cpp:172
QAction * fileSave
Definition: ImpMainWindow.h:166
void openDataDirectory(QString plugin)
Definition: ImpMainWindow.cpp:481
void initActions()
initializes all QActions of the application
Definition: ImpMainWindow.cpp:179
QMenu * actionMenu
the actionMenu.
Definition: ImpMainWindow.h:195
QAction * helpShowConsole
action for the show console
Definition: ImpMainWindow.h:203
virtual void refresh() override
Definition: ImpMainWindow.cpp:154
void aboutToShow() override
overriden from MainWindow to automatically load last opened document if needed
Definition: ImpMainWindow.cpp:141
QAction * editApplicationSettings
Definition: ImpMainWindow.h:183
void updateViewMenu()
Definition: ImpMainWindow.cpp:514
QToolBar * mainToolbar
the main toolbar
Definition: ImpMainWindow.h:142
void resetWindows()
reset all windows in their initial state
Definition: ImpMainWindow.cpp:432
QAction * fileSaveAll
Definition: ImpMainWindow.h:168
void saveHistoryAsSCXML()
Save the history of action as a SCXML file.
Definition: ImpMainWindow.cpp:669
QAction * fileClose
Definition: ImpMainWindow.h:164
void updateRecentDocumentsMenu()
update the recent document menu
Definition: ImpMainWindow.cpp:648
void initToolBar()
this creates the toolbars.
Definition: ImpMainWindow.cpp:345
void initMenuBar()
initMenuBar creates the menu_bar and inserts the menuitems
Definition: ImpMainWindow.cpp:280
void showToolbar(bool)
show or hide the toolbar
Definition: ImpMainWindow.cpp:407
void showStatusBar(bool)
show or hide the status bar
Definition: ImpMainWindow.cpp:427
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:165
ImpMainWindow()
Definition: ImpMainWindow.cpp:62
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:180