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;
179  QAction* viewResetWindows;
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 
221  QAction* recentDocumentSeparator;
222 
224 
225 
226 private slots:
227 
229  void openRecentDocuments();
230 
231 };
232 
233 #endif //IMP_MAINWINDOW_H
234 
camitk::MainWindow::showViewer
virtual void showViewer(Viewer *, bool)
set the visibility for the given viewer (if it is in a dock)
Definition: MainWindow.cpp:247
ImpMainWindow::initActions
void initActions()
initializes all QActions of the application
Definition: ImpMainWindow.cpp:137
ImpMainWindow::viewMenuBar
QAction * viewMenuBar
Definition: ImpMainWindow.h:200
ImpMainWindow::updateRecentDocumentsMenu
void updateRecentDocumentsMenu()
update the recent document menu
Definition: ImpMainWindow.cpp:563
ImpMainWindow::recentDocumentSeparator
QAction * recentDocumentSeparator
the separator between the last file menu action and the recent document actions
Definition: ImpMainWindow.h:244
CAMITK_WARNING
#define CAMITK_WARNING(MSG)
Log for warning verbosity (the most common one) Will appear by default.
Definition: Log.h:263
PropertyExplorer.h
camitk::MainWindow::dockWidgetMap
QMap< Viewer *, QDockWidget * > dockWidgetMap
the map that gives the corresponding QDockWidget for a given Viewer
Definition: MainWindow.h:192
ImpMainWindow::initToolBar
void initToolBar()
this creates the toolbars.
Definition: ImpMainWindow.cpp:294
ImpMainWindow::fileSaveAll
QAction * fileSaveAll
Definition: ImpMainWindow.h:193
ImpMainWindow::fileClose
QAction * fileClose
Definition: ImpMainWindow.h:189
ImpMainWindow::setCentralViewer
virtual void setCentralViewer(camitk::Viewer *)
set the central Viewer of the application.
Definition: ImpMainWindow.cpp:130
ActionViewer.h
ImpMainWindow::fileSaveAs
QAction * fileSaveAs
Definition: ImpMainWindow.h:192
camitk::Action::getQAction
QAction * getQAction()
Get the corresponding QAction.
Definition: Action.cpp:183
ImpMainWindow::openDirectory
void openDirectory(QAction *)
Definition: ImpMainWindow.cpp:447
ImpMainWindow::updateViewMenu
void updateViewMenu()
update the viewer's menu
Definition: ImpMainWindow.cpp:480
ImpMainWindow::updateOpenDirectoryMenu
void updateOpenDirectoryMenu()
Definition: ImpMainWindow.cpp:424
ImpMainWindow::saveHistoryAsSCXML
void saveHistoryAsSCXML()
Save the history of action as a SCXML file.
Definition: ImpMainWindow.cpp:584
ImpMainWindow::redirectToConsole
virtual void redirectToConsole(bool)
use or not the application console (overriden to add an action to show the console window)
Definition: ImpMainWindow.cpp:538
PropertyObject.h
camitk::Component::getActionMenu
QMenu * getActionMenu()
Get a QMenu that contains all the action that can be applied to this component.
Definition: sdk/libraries/core/component/Component.cpp:366
ImpMainWindow::aboutToShow
void aboutToShow()
overriden from MainWindow to automatically load last opened document if needed
Definition: ImpMainWindow.cpp:98
ImpMainWindow::viewMenu
QMenu * viewMenu
view_menu contains all items of the menubar entry "View"
Definition: ImpMainWindow.h:199
Action.h
ImpMainWindow::fileQuit
QAction * fileQuit
Definition: ImpMainWindow.h:194
camitk::ActionList
QList< Action * > ActionList
A list of Action.
Definition: CamiTKAPI.h:95
ImpMainWindow::mainToolbar
QToolBar * mainToolbar
the main toolbar
Definition: ImpMainWindow.h:167
ImpMainWindow::saveHistory
QAction * saveHistory
Definition: ImpMainWindow.h:210
ImpMainWindow
This Class describes the "historical" imp application. It is a classical desktop application,...
Definition: ImpMainWindow.h:43
ImpMainWindow::actionMenu
QMenu * actionMenu
the actionMenu.
Definition: ImpMainWindow.h:220
FrameExplorer.h
ImpMainWindow::refresh
virtual void refresh()
Definition: ImpMainWindow.cpp:111
ImpMainWindow::fileOpen
QAction * fileOpen
Definition: ImpMainWindow.h:188
ImpMainWindow::recentDocumentActions
QList< QAction * > recentDocumentActions
list of all the possible recent documents actions
Definition: ImpMainWindow.h:241
ImpMainWindow::fileSave
QAction * fileSave
Definition: ImpMainWindow.h:191
Log.h
camitk::SettingsDialog
This class controls the settings dialog user interface.
Definition: SettingsDialog.h:54
ImpMainWindow::viewStatusBar
QAction * viewStatusBar
Definition: ImpMainWindow.h:201
ImpMainWindow.h
camitk::Action::applyAndRegister
ApplyStatus applyAndRegister()
This method is called whenever the action has to be applied on the target list (like the apply()) met...
Definition: Action.cpp:245
ImpMainWindow::editClearSelection
QAction * editClearSelection
Definition: ImpMainWindow.h:209
camitk::Action
Action class is an abstract class that enables you to build a action (generally on a component)....
Definition: Action.h:230
ImpMainWindow::fileCloseAll
QAction * fileCloseAll
Definition: ImpMainWindow.h:190
Property.h
camitk::Application
The generic/default application. Once this class is intanciated in the main, everything is setup....
Definition: Application.h:63
ImpMainWindow::updateActionStates
void updateActionStates()
Definition: ImpMainWindow.cpp:304
ImpMainWindow::viewResetWindows
QAction * viewResetWindows
Definition: ImpMainWindow.h:202
CAMITK_ERROR
#define CAMITK_ERROR(MSG)
Log for error verbosity (the minimum verbosity) Will always appear.
Definition: Log.h:273
ImpMainWindow::openRecentDocuments
void openRecentDocuments()
open a given recent document
Definition: ImpMainWindow.cpp:545
ImpMainWindow::editApplicationSettings
QAction * editApplicationSettings
Definition: ImpMainWindow.h:208
MedicalImageViewer.h
camitk::Viewer::getMenu
virtual QMenu * getMenu()
get the viewer menu (returns NULL by default, i.e. there are no default edit menu)
Definition: Viewer.h:80
camitk::MainWindow::viewers
QList< Viewer * > viewers
Definition: MainWindow.h:189
ImpMainWindow::helpShowConsole
QAction * helpShowConsole
action for the show console
Definition: ImpMainWindow.h:228
ImpMainWindow::changeLanguage
QAction * changeLanguage
Definition: ImpMainWindow.h:234
ImpMainWindow::fileMenu
QMenu * fileMenu
file_menu contains all items of the menubar entry "File"
Definition: ImpMainWindow.h:186
MainWindow.h
camitk::MainWindow::getProgressBar
QProgressBar * getProgressBar()
similar as statusBar() from QMainWindow but for the progress bar
Definition: MainWindow.cpp:319
camitk::MainWindow
This Class is the base class for your application. It sets up the main window and providing a menubar...
Definition: MainWindow.h:85
camitk::ActionExtension
This class describes what is a generic Action extension. To add a ActionExtension to CamiTK core,...
Definition: ActionExtension.h:82
Explorer.h
camitk::Viewer
Viewer is an abstract viewer.
Definition: Viewer.h:55
SettingsDialog.h
ImpMainWindow::resetWindows
void resetWindows()
reset all windows in their initial state
Definition: ImpMainWindow.cpp:383
camitk::SettingsDialog::editSettings
void editSettings(QObject *)
add a new property editor in a tab for the new object (it automatically connect the object "saveSetti...
Definition: SettingsDialog.cpp:137
ImpMainWindow::editSettings
void editSettings()
Definition: ImpMainWindow.cpp:508
camitk::Viewer::getPropertyObject
virtual QObject * getPropertyObject()
get the viewer property object (returns NULL by default, i.e. there are no property to edit)
Definition: Viewer.h:75
camitk::refresh
void refresh()
refresh the display
ImpMainWindow::showMenuBar
void showMenuBar(bool)
show or hide the menu bar
Definition: ImpMainWindow.cpp:360
ImpMainWindow::addDockViewer
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
camitk::MainWindow::setWindowSubtitle
void setWindowSubtitle(QString)
The subtitle is situated at the end of the title, on the title bar, is helps for example showing whic...
Definition: MainWindow.cpp:204
ImpMainWindow::showStatusBar
void showStatusBar(bool)
show or hide the status bar
Definition: ImpMainWindow.cpp:378
Core.h
ImpMainWindow::showToolbar
void showToolbar(bool)
show or hide the toolbar
Definition: ImpMainWindow.cpp:355
ImpMainWindow::initMenuBar
void initMenuBar()
initMenuBar creates the menu_bar and inserts the menuitems
Definition: ImpMainWindow.cpp:227
ImpMainWindow::fileOpenDataDirectoryMenu
QMenu * fileOpenDataDirectoryMenu
Definition: ImpMainWindow.h:187
ExtensionManager.h
ImpMainWindow::ImpMainWindow
ImpMainWindow()
Definition: ImpMainWindow.cpp:60
camitk::ActionExtension::getName
virtual QString getName()=0
returns the action extension name (to be overriden in your ActionExtension)
ImpMainWindow::~ImpMainWindow
virtual ~ImpMainWindow()
destructor
Definition: ImpMainWindow.cpp:94
camitk::Component
A Component represents something that could be included in the explorer view, the interactive 3D view...
Definition: sdk/libraries/core/component/Component.h:298
Application.h
camitk
Definition: Action.cpp:36
ImpMainWindow::helpAboutApp
QAction * helpAboutApp
Definition: ImpMainWindow.h:225