Computer Assited Medical Intervention Tool Kit  version 4.1
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-2018 Univ. Grenoble Alpes, CNRS, TIMC-IMAG UMR 5525 (GMCAO)
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();
55 
57  virtual ~ImpMainWindow();
58 
61 
66  virtual void addDockViewer(Qt::DockWidgetArea, camitk::Viewer*);
67 
72  virtual void setCentralViewer(camitk::Viewer*);
73 
75  virtual void redirectToConsole(bool);
77 
78 public slots:
79 
83  void openDirectory(QAction*);
85 
89  virtual void refresh();
91 
95 
98  void showToolbar(bool);
99 
101  void showMenuBar(bool);
102 
104  void resetWindows();
105 
107  void showStatusBar(bool);
108 
110  void saveHistoryAsSCXML();
111 
113 
115  void editSettings();
118 
120 
121 protected:
123  void updateViewMenu();
124 
129 
133 
135  void updateActionStates();
139 
141  void initActions();
142 
144  QToolBar* mainToolbar;
145 
146 private:
147 
149 
152  void initMenuBar();
153 
157  void initToolBar();
159 
161 
163  QMenu* fileMenu;
165  QAction* fileOpen;
166  QAction* fileClose;
167  QAction* fileCloseAll;
168  QAction* fileSave;
169  QAction* fileSaveAs;
170  QAction* fileSaveAll;
171  QAction* fileQuit;
172 
174 
176  QMenu* viewMenu;
177  QAction* viewMenuBar;
178  QAction* viewStatusBar;
181 
183  QAction* editApplicationSettings;
187  QAction* saveHistory;
189 
191 
197  QMenu* actionMenu;
198 
200  QAction* helpAboutApp;
203 
205  QAction* helpShowConsole;
207 
209  QAction* changeLanguage;
213 
216 
218  QList<QAction*> recentDocumentActions;
219 
222 
224 
225 
226 private slots:
227 
229  void openRecentDocuments();
230 
231 };
232 
233 #endif //IMP_MAINWINDOW_H
234 
QMenu * fileOpenDataDirectoryMenu
Definition: ImpMainWindow.h:164
virtual void refresh()
Definition: ImpMainWindow.cpp:111
QMenu * actionMenu
the actionMenu.
Definition: ImpMainWindow.h:197
QAction * fileSave
Definition: ImpMainWindow.h:168
void updateViewMenu()
update the viewer&#39;s menu
Definition: ImpMainWindow.cpp:480
QAction * changeLanguage
Definition: ImpMainWindow.h:211
void saveHistoryAsSCXML()
Save the history of action as a SCXML file.
Definition: ImpMainWindow.cpp:584
void aboutToShow()
overriden from MainWindow to automatically load last opened document if needed
Definition: ImpMainWindow.cpp:98
void initMenuBar()
initMenuBar creates the menu_bar and inserts the menuitems
Definition: ImpMainWindow.cpp:227
QAction * viewResetWindows
Definition: ImpMainWindow.h:179
QAction * saveHistory
Definition: ImpMainWindow.h:187
Viewer is an abstract viewer.
Definition: Viewer.h:55
QAction * editApplicationSettings
Definition: ImpMainWindow.h:185
void openRecentDocuments()
open a given recent document
Definition: ImpMainWindow.cpp:545
This Class is the base class for your application.
Definition: MainWindow.h:62
QAction * helpAboutApp
Definition: ImpMainWindow.h:202
QAction * fileSaveAs
Definition: ImpMainWindow.h:169
QMenu * fileMenu
file_menu contains all items of the menubar entry "File"
Definition: ImpMainWindow.h:163
void updateOpenDirectoryMenu()
Definition: ImpMainWindow.cpp:424
void updateRecentDocumentsMenu()
update the recent document menu
Definition: ImpMainWindow.cpp:563
QAction * recentDocumentSeparator
the separator between the last file menu action and the recent document actions
Definition: ImpMainWindow.h:221
void resetWindows()
reset all windows in their initial state
Definition: ImpMainWindow.cpp:383
void openDirectory(QAction *)
Definition: ImpMainWindow.cpp:447
QAction * viewStatusBar
Definition: ImpMainWindow.h:178
QAction * viewMenuBar
Definition: ImpMainWindow.h:177
void showStatusBar(bool)
show or hide the status bar
Definition: ImpMainWindow.cpp:378
virtual void redirectToConsole(bool)
use or not the application console (overriden to add an action to show the console window) ...
Definition: ImpMainWindow.cpp:538
void showToolbar(bool)
show or hide the toolbar
Definition: ImpMainWindow.cpp:355
QToolBar * mainToolbar
the main toolbar
Definition: ImpMainWindow.h:144
QAction * fileSaveAll
Definition: ImpMainWindow.h:170
QAction * fileOpen
Definition: ImpMainWindow.h:165
virtual ~ImpMainWindow()
destructor
Definition: ImpMainWindow.cpp:94
QAction * helpShowConsole
action for the show console
Definition: ImpMainWindow.h:205
void initActions()
initializes all QActions of the application
Definition: ImpMainWindow.cpp:137
void showMenuBar(bool)
show or hide the menu bar
Definition: ImpMainWindow.cpp:360
QMenu * viewMenu
view_menu contains all items of the menubar entry "View"
Definition: ImpMainWindow.h:176
void updateActionStates()
Definition: ImpMainWindow.cpp:304
ImpMainWindow()
Definition: ImpMainWindow.cpp:60
void initToolBar()
this creates the toolbars.
Definition: ImpMainWindow.cpp:294
QAction * fileQuit
Definition: ImpMainWindow.h:171
This Class describes the "historical" imp application.
Definition: ImpMainWindow.h:43
QAction * fileClose
Definition: ImpMainWindow.h:166
virtual void setCentralViewer(camitk::Viewer *)
set the central Viewer of the application.
Definition: ImpMainWindow.cpp:130
QList< QAction * > recentDocumentActions
list of all the possible recent documents actions
Definition: ImpMainWindow.h:218
void editSettings()
Definition: ImpMainWindow.cpp:508
QAction * editClearSelection
Definition: ImpMainWindow.h:186
QAction * fileCloseAll
Definition: ImpMainWindow.h:167
virtual void addDockViewer(Qt::DockWidgetArea, camitk::Viewer *)
add a Viewer to the application as a docking widget and specify where it has to be docked MainWindow ...
Definition: ImpMainWindow.cpp:123