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 
95 
98  void showToolbar(bool);
99 
101  void toggleMenuBar();
102 
104  void resetWindows();
105 
107  void showStatusBar(bool);
108 
110  void saveHistoryAsSCXML();
111 
113 
115  void editSettings();
118 
120 
121 protected:
122 
124  void updateViewMenu();
127 
130 
133 
135  void updateActionStates();
136 
138  void initActions();
140 
142  QToolBar* mainToolbar;
143 
144 private:
145 
147 
150  void initMenuBar();
151 
155  void initToolBar();
157 
159 
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 
172 
174  QMenu* viewMenu;
175  QAction* viewMenuBar;
176  QAction* viewStatusBar;
177  QAction* viewResetWindows;
179 
181  QAction* editApplicationSettings;
185  QAction* saveHistory;
187 
189 
195  QMenu* actionMenu;
196 
198  QAction* helpAboutApp;
201 
203  QAction* helpShowConsole;
205 
207  QAction* changeLanguage;
211 
214 
216  QList<QAction*> recentDocumentActions;
217 
219  QAction* recentDocumentSeparator;
220 
222 
223 
224 private slots:
225 
227  void openRecentDocuments();
228 
229 };
230 
231 #endif //IMP_MAINWINDOW_H
232 
Explorer
The Explorer viewer displays the list of all data currently opened in the application....
Definition: Explorer.h:64
ImpMainWindow::initActions
void initActions()
initializes all QActions of the application
Definition: ImpMainWindow.cpp:179
ImpMainWindow::viewMenuBar
QAction * viewMenuBar
Definition: ImpMainWindow.h:198
ImpMainWindow::updateRecentDocumentsMenu
void updateRecentDocumentsMenu()
update the recent document menu
Definition: ImpMainWindow.cpp:648
ImpMainWindow::recentDocumentSeparator
QAction * recentDocumentSeparator
the separator between the last file menu action and the recent document actions
Definition: ImpMainWindow.h:242
CAMITK_WARNING
#define CAMITK_WARNING(MSG)
Log for warning verbosity (the most common one) Will appear by default.
Definition: Log.h:266
PropertyExplorer.h
ImpMainWindow::toggleMenuBar
void toggleMenuBar()
show or hide the menu bar
Definition: ImpMainWindow.cpp:412
ImpMainWindow::aboutToShow
void aboutToShow() override
overriden from MainWindow to automatically load last opened document if needed
Definition: ImpMainWindow.cpp:141
ActionViewer::setSearchPanelVisible
virtual void setSearchPanelVisible(bool)
show/hide the search panel (hidden by default)
Definition: ActionViewer.cpp:120
camitk::MainWindow::dockWidgetMap
QMap< Viewer *, QDockWidget * > dockWidgetMap
the map that gives the corresponding QDockWidget for a given Viewer
Definition: MainWindow.h:222
ImpMainWindow::initToolBar
void initToolBar()
this creates the toolbars.
Definition: ImpMainWindow.cpp:345
ImpMainWindow::fileSaveAll
QAction * fileSaveAll
Definition: ImpMainWindow.h:191
ImpMainWindow::fileClose
QAction * fileClose
Definition: ImpMainWindow.h:187
camitk::Viewer::getEmbedder
QLayout * getEmbedder()
Get the QLayout* where this viewer is currently embedded (or nullptr if it is not embedded anywhere o...
Definition: Viewer.cpp:205
ActionViewer.h
MedicalImageViewer
All-in-one medical image viewer.
Definition: MedicalImageViewer.h:59
ImpMainWindow::fileSaveAs
QAction * fileSaveAs
Definition: ImpMainWindow.h:190
ImpMainWindow::refresh
virtual void refresh() override
Definition: ImpMainWindow.cpp:154
FrameExplorer
Frame Explorer window, display the hierachy of the frames of all the data currently opened in the app...
Definition: FrameExplorer.h:60
ImpMainWindow::updateOpenDirectoryMenu
void updateOpenDirectoryMenu()
update the open data directory menu depending on registered plugins
Definition: ImpMainWindow.cpp:674
ImpMainWindow::updateViewMenu
void updateViewMenu()
Definition: ImpMainWindow.cpp:514
ImpMainWindow::saveHistoryAsSCXML
void saveHistoryAsSCXML()
Save the history of action as a SCXML file.
Definition: ImpMainWindow.cpp:669
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:355
ImpMainWindow::viewMenu
QMenu * viewMenu
view_menu contains all items of the menubar entry "View"
Definition: ImpMainWindow.h:197
Action.h
ImpMainWindow::fileQuit
QAction * fileQuit
Definition: ImpMainWindow.h:192
camitk::ActionList
QList< Action * > ActionList
A list of Action.
Definition: CamiTKAPI.h:136
ImpMainWindow::mainToolbar
QToolBar * mainToolbar
the main toolbar
Definition: ImpMainWindow.h:165
ImpMainWindow::saveHistory
QAction * saveHistory
Definition: ImpMainWindow.h:208
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:218
FrameExplorer.h
ImpMainWindow::fileOpen
QAction * fileOpen
Definition: ImpMainWindow.h:186
ImpMainWindow::recentDocumentActions
QList< QAction * > recentDocumentActions
list of all the possible recent documents actions
Definition: ImpMainWindow.h:239
ImpMainWindow::fileSave
QAction * fileSave
Definition: ImpMainWindow.h:189
Log.h
camitk::SettingsDialog
This class controls the settings dialog user interface.
Definition: SettingsDialog.h:54
ImpMainWindow::viewStatusBar
QAction * viewStatusBar
Definition: ImpMainWindow.h:199
ImpMainWindow::setCentralViewer
virtual void setCentralViewer(camitk::Viewer *) override final
set the central Viewer of the application.
Definition: ImpMainWindow.cpp:172
ImpMainWindow.h
camitk::Viewer::getName
QString getName() const
get the name of the viewer
Definition: Viewer.h:200
camitk::Action::applyAndRegister
camitk::Action::ApplyStatus applyAndRegister()
This method is called whenever the action has to be applied on the target list (like the apply()) met...
Definition: Action.cpp:263
ImpMainWindow::editClearSelection
QAction * editClearSelection
Definition: ImpMainWindow.h:207
camitk::Action
Action class is an abstract class that enables you to build a action (generally on a component)....
Definition: Action.h:231
camitk::MainWindow::showDockViewer
virtual void showDockViewer(Viewer *, bool)
set the visibility for the given docked viewer and its toolbar
Definition: MainWindow.cpp:253
ImpMainWindow::fileCloseAll
QAction * fileCloseAll
Definition: ImpMainWindow.h:188
camitk::Action::getQAction
virtual QAction * getQAction(Component *target=nullptr)
Get the corresponding QAction.
Definition: Action.cpp:204
Property.h
camitk::Application
The generic/default application. Once this class is intanciated in the main, everything is setup....
Definition: Application.h:82
ImpMainWindow::updateActionStates
void updateActionStates()
set the current QAction enable state depending on the current selection
Definition: ImpMainWindow.cpp:355
ImpMainWindow::addDockViewer
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::viewResetWindows
QAction * viewResetWindows
Definition: ImpMainWindow.h:200
CAMITK_ERROR
#define CAMITK_ERROR(MSG)
Log for error verbosity (the minimum verbosity) Will always appear.
Definition: Log.h:276
ImpMainWindow::openRecentDocuments
void openRecentDocuments()
open a given recent document
Definition: ImpMainWindow.cpp:630
ImpMainWindow::editApplicationSettings
QAction * editApplicationSettings
Definition: ImpMainWindow.h:206
MedicalImageViewer.h
camitk::Viewer::getMenu
virtual QMenu * getMenu()
get the viewer menu (returns nullptr by default, i.e. there are no default edit menu)
Definition: Viewer.h:245
camitk::MainWindow::viewers
QList< Viewer * > viewers
Definition: MainWindow.h:219
ImpMainWindow::helpShowConsole
QAction * helpShowConsole
action for the show console
Definition: ImpMainWindow.h:226
ActionViewer
ActionViewer is the viewer used to manage the actions.
Definition: ActionViewer.h:63
ImpMainWindow::changeLanguage
QAction * changeLanguage
Definition: ImpMainWindow.h:232
ImpMainWindow::fileMenu
QMenu * fileMenu
file_menu contains all items of the menubar entry "File"
Definition: ImpMainWindow.h:184
ImpMainWindow::openDataDirectory
void openDataDirectory(QString plugin)
Definition: ImpMainWindow.cpp:481
MainWindow.h
camitk::MainWindow::getProgressBar
QProgressBar * getProgressBar()
similar as statusBar() from QMainWindow but for the progress bar
Definition: MainWindow.cpp:388
camitk::MainWindow
This class is the base class for your application. It sets up the main window and creates a menubar,...
Definition: MainWindow.h:89
camitk::Viewer::getType
ViewerType getType()
get the viewer layout
Definition: Viewer.cpp:140
camitk::ActionExtension
This class describes what is a generic Action extension. To add a ActionExtension to CamiTK core,...
Definition: ActionExtension.h:80
Explorer.h
camitk::Viewer
Viewer is an abstract class that is the base class for all viewers.
Definition: Viewer.h:180
SettingsDialog.h
PropertyExplorer
The property explorer.
Definition: PropertyExplorer.h:81
ImpMainWindow::redirectToConsole
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
ImpMainWindow::resetWindows
void resetWindows()
reset all windows in their initial state
Definition: ImpMainWindow.cpp:432
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:142
Viewer.h
camitk::Viewer::getIcon
virtual QPixmap getIcon()
get the viewer icon
Definition: Viewer.cpp:89
ImpMainWindow::editSettings
void editSettings()
Definition: ImpMainWindow.cpp:593
camitk::Viewer::getPropertyObject
virtual QObject * getPropertyObject()
get the viewer property object (returns nullptr by default, i.e. there are no property to edit)
Definition: Viewer.h:240
camitk::refresh
void refresh()
refresh the display
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:223
ImpMainWindow::showStatusBar
void showStatusBar(bool)
show or hide the status bar
Definition: ImpMainWindow.cpp:427
Core.h
ImpMainWindow::showToolbar
void showToolbar(bool)
show or hide the toolbar
Definition: ImpMainWindow.cpp:407
ImpMainWindow::initMenuBar
void initMenuBar()
initMenuBar creates the menu_bar and inserts the menuitems
Definition: ImpMainWindow.cpp:280
ImpMainWindow::fileOpenDataDirectoryMenu
QMenu * fileOpenDataDirectoryMenu
Definition: ImpMainWindow.h:185
ExtensionManager.h
ImpMainWindow::ImpMainWindow
ImpMainWindow()
Definition: ImpMainWindow.cpp:62
camitk::MainWindow::centralViewer
Viewer * centralViewer
The actual central Viewer.
Definition: MainWindow.h:261
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:137
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:302
Application.h
camitk
Definition: Action.cpp:35
ImpMainWindow::helpAboutApp
QAction * helpAboutApp
Definition: ImpMainWindow.h:223