Computer Assited Medical Intervention Tool Kit  version 4.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-2016 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 
147  virtual void initSettings();
148 
149 private:
150 
152 
155  void initMenuBar();
156 
160  void initToolBar();
162 
164 
166  QMenu *fileMenu;
168  QAction *fileOpen;
169  QAction *fileClose;
170  QAction *fileCloseAll;
171  QAction *fileSave;
172  QAction *fileSaveAs;
173  QAction *fileSaveAll;
174  QAction *fileQuit;
175 
177 
179  QMenu *viewMenu;
180  QAction *viewMenuBar;
181  QAction *viewStatusBar;
184 
186  QAction *editApplicationSettings;
190  QAction *saveHistory;
192 
194 
200  QMenu *actionMenu;
201 
203  QAction *helpAboutApp;
206 
208  QAction *helpShowConsole;
210 
212  QAction *changeLanguage;
216 
221 
223  QList<QAction*> recentDocumentActions;
224 
227 
229 
231  //camitk::Application::TargetPositionningMethods defaultTargetPositionningMethod;
234 
236 
237 private slots:
238 
240  void openRecentDocuments();
241 
242 };
243 
244 #endif //IMP_MAINWINDOW_H
245 
QMenu * fileOpenDataDirectoryMenu
Definition: ImpMainWindow.h:167
virtual void refresh()
Definition: ImpMainWindow.cpp:114
QMenu * actionMenu
the actionMenu.
Definition: ImpMainWindow.h:200
QAction * fileSave
Definition: ImpMainWindow.h:171
void updateViewMenu()
update the viewer&#39;s menu
Definition: ImpMainWindow.cpp:476
QAction * changeLanguage
Definition: ImpMainWindow.h:214
void saveHistoryAsSCXML()
Save the history of action as a SCXML file.
Definition: ImpMainWindow.cpp:614
void aboutToShow()
overriden from MainWindow to automatically load last opened document if needed
Definition: ImpMainWindow.cpp:101
void initMenuBar()
initMenuBar creates the menu_bar and inserts the menuitems
Definition: ImpMainWindow.cpp:229
bool autoLoadLastOpened
Definition: ImpMainWindow.h:220
QAction * viewResetWindows
Definition: ImpMainWindow.h:182
QAction * saveHistory
Definition: ImpMainWindow.h:190
Viewer is an abstract viewer.
Definition: Viewer.h:55
QAction * editApplicationSettings
Definition: ImpMainWindow.h:188
void openRecentDocuments()
open a given recent document
Definition: ImpMainWindow.cpp:577
This Class is the base class for your application.
Definition: MainWindow.h:62
QAction * helpAboutApp
Definition: ImpMainWindow.h:205
QAction * fileSaveAs
Definition: ImpMainWindow.h:172
QMenu * fileMenu
file_menu contains all items of the menubar entry "File"
Definition: ImpMainWindow.h:166
void updateOpenDirectoryMenu()
Definition: ImpMainWindow.cpp:421
void updateRecentDocumentsMenu()
update the recent document menu
Definition: ImpMainWindow.cpp:593
virtual void initSettings()
init ImpMainWindow specific settings (e.g. autoLoadLastOpened)
Definition: ImpMainWindow.cpp:546
QAction * recentDocumentSeparator
the separator between the last file menu action and the recent document actions
Definition: ImpMainWindow.h:226
void resetWindows()
reset all windows in their initial state
Definition: ImpMainWindow.cpp:383
void openDirectory(QAction *)
Definition: ImpMainWindow.cpp:444
QAction * viewStatusBar
Definition: ImpMainWindow.h:181
QAction * viewMenuBar
Definition: ImpMainWindow.h:180
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:570
void showToolbar(bool)
show or hide the toolbar
Definition: ImpMainWindow.cpp:354
QToolBar * mainToolbar
the main toolbar
Definition: ImpMainWindow.h:144
QAction * fileSaveAll
Definition: ImpMainWindow.h:173
QAction * fileOpen
Definition: ImpMainWindow.h:168
virtual ~ImpMainWindow()
destructor
Definition: ImpMainWindow.cpp:97
QAction * helpShowConsole
action for the show console
Definition: ImpMainWindow.h:208
void initActions()
initializes all QActions of the application
Definition: ImpMainWindow.cpp:140
void showMenuBar(bool)
show or hide the menu bar
Definition: ImpMainWindow.cpp:359
QMenu * viewMenu
view_menu contains all items of the menubar entry "View"
Definition: ImpMainWindow.h:179
void updateActionStates()
Definition: ImpMainWindow.cpp:306
ImpMainWindow()
Definition: ImpMainWindow.cpp:63
void initToolBar()
this creates the toolbars.
Definition: ImpMainWindow.cpp:296
QAction * fileQuit
Definition: ImpMainWindow.h:174
This Class describes the "historical" imp application.
Definition: ImpMainWindow.h:43
QAction * fileClose
Definition: ImpMainWindow.h:169
virtual void setCentralViewer(camitk::Viewer *)
set the central Viewer of the application.
Definition: ImpMainWindow.cpp:133
QList< QAction * > recentDocumentActions
list of all the possible recent documents actions
Definition: ImpMainWindow.h:223
void editSettings()
Definition: ImpMainWindow.cpp:502
QAction * editClearSelection
Definition: ImpMainWindow.h:189
QAction * fileCloseAll
Definition: ImpMainWindow.h:170
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:126