Computer Assited Medical Intervention Tool Kit  version 5.0
ImpMainWindow Class Reference

This Class describes the "historical" imp application. It is a classical desktop application, with menubar, toolbar and statusbar. More...

#include <ImpMainWindow.h>

+ Inheritance diagram for ImpMainWindow:
+ Collaboration diagram for ImpMainWindow:

Public Slots

file menu slot

open a data directory, "called" from the fileOpenDataDirectoryMenu

void openDataDirectory (QString plugin)
 
viewers' slot

this slot is connected to all the viewers selectionChanged() signal, this will call the refresh method of all viewers but whoIsAsking

virtual void refresh () override
 
View menu slots
Note
everything that is linked to the InteractiveViewer has to be managed by the view (in case there is more than one InteractiveViewer)
void showToolbar (bool)
 show or hide the toolbar More...
 
void toggleMenuBar ()
 show or hide the menu bar More...
 
void resetWindows ()
 reset all windows in their initial state More...
 
void showStatusBar (bool)
 show or hide the status bar More...
 
void saveHistoryAsSCXML ()
 Save the history of action as a SCXML file. More...
 
Edit menu slots
void editSettings ()
 
- Public Slots inherited from camitk::MainWindow
virtual void refresh ()
 
void show ()
 inherited from QWidget, just to refresh all viewers More...
 

Public Member Functions

general

construtor

 ImpMainWindow ()
 
void aboutToShow () override
 overriden from MainWindow to automatically load last opened document if needed More...
 
virtual ~ImpMainWindow ()
 destructor More...
 
open a top-level component
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 takes the hand on the Viewer (it will be deleted when MainWindow is deleted). More...
 
virtual void setCentralViewer (camitk::Viewer *) override final
 set the central Viewer of the application. More...
 
virtual void redirectToConsole (bool) override
 use or not the application console (overriden to add an action to show the console window) More...
 
- Public Member Functions inherited from camitk::MainWindow
 MainWindow (QString title)
 Constructor, the window title can be changed here, it is inconsistent to use setWindowTitle(). More...
 
 ~MainWindow () override
 destructor More...
 
QString getName () const
 Get the main window title. More...
 
void setWindowSubtitle (QString)
 The subtitle is situated at the end of the title, on the title bar, is helps for example showing which file is currently selected. More...
 
QProgressBar * getProgressBar ()
 similar as statusBar() from QMainWindow but for the progress bar More...
 
void showStatusBar (bool)
 show the status bar (by default it is hidden) More...
 
void showConsole (bool)
 get the console window More...
 
bool getConsoleVisibility ()
 get the visibility state of the console ( More...
 
virtual void showDockViewer (Viewer *, bool)
 set the visibility for the given docked viewer and its toolbar More...
 
void refreshViewers ()
 Method uses to refresh all the viewer of the Main Window. More...
 
virtual ViewergetCentralViewer () const
 
virtual void showViewerToolbar (Viewer *theViewer, bool visible)
 Set the visibility of a viewer's toolbar. More...
 

Protected Attributes

QToolBar * mainToolbar
 the main toolbar More...
 
- Protected Attributes inherited from camitk::MainWindow
ViewercentralViewer
 The actual central Viewer. More...
 
QList< Viewer * > viewers
 
QMap< Viewer *, QDockWidget * > dockWidgetMap
 the map that gives the corresponding QDockWidget for a given Viewer More...
 

Private Slots

void openRecentDocuments ()
 open a given recent document More...
 

Private Attributes

File menu attributes
QMenu * fileMenu
 file_menu contains all items of the menubar entry "File" More...
 
QMenu * fileOpenDataDirectoryMenu
 
QAction * fileOpen
 
QAction * fileClose
 
QAction * fileCloseAll
 
QAction * fileSave
 
QAction * fileSaveAs
 
QAction * fileSaveAll
 
QAction * fileQuit
 
View menu attributes and action
QMenu * viewMenu
 view_menu contains all items of the menubar entry "View" More...
 
QAction * viewMenuBar
 
QAction * viewStatusBar
 
QAction * viewResetWindows
 
Edit menu attributes
QAction * editApplicationSettings
 
QAction * editClearSelection
 
QAction * saveHistory
 
Other menu attributes
QMenu * actionMenu
 the actionMenu. More...
 
QAction * helpAboutApp
 
QAction * helpShowConsole
 action for the show console More...
 
Translation menu attributes
QAction * changeLanguage
 
File management attributes
QList< QAction * > recentDocumentActions
 list of all the possible recent documents actions More...
 
QAction * recentDocumentSeparator
 the separator between the last file menu action and the recent document actions More...
 

initialization/update methods

void updateViewMenu ()
 
void updateOpenDirectoryMenu ()
 update the open data directory menu depending on registered plugins More...
 
void updateRecentDocumentsMenu ()
 update the recent document menu More...
 
void updateActionStates ()
 set the current QAction enable state depending on the current selection More...
 
void initActions ()
 initializes all QActions of the application More...
 
void initMenuBar ()
 initMenuBar creates the menu_bar and inserts the menuitems More...
 
void initToolBar ()
 this creates the toolbars. More...
 

Additional Inherited Members

- Protected Member Functions inherited from camitk::MainWindow
void closeEvent (QCloseEvent *) override
 overriden from QMainWindow, just connect to slotFileQuit More...
 
void dragEnterEvent (QDragEnterEvent *event) override
 called when a drag event started on the main window, accept drag only if file is MIME type text/uri-list More...
 
void dragLeaveEvent (QDragLeaveEvent *event) override
 called when the mouse leaves the widgets area during a drag/drop operation More...
 
void dragMoveEvent (QDragMoveEvent *event) override
 called when the mouse moves inside the widgets area during a drag/drop operation More...
 
void dropEvent (QDropEvent *event) override
 just call open with the dragged uri More...
 
virtual void initSettings ()
 init MainWindow specific settings (e.g. size, position) More...
 

Detailed Description

This Class describes the "historical" imp application. It is a classical desktop application, with menubar, toolbar and statusbar.

Constructor & Destructor Documentation

◆ ImpMainWindow()

ImpMainWindow::ImpMainWindow ( )

References addDockViewer(), CAMITK_ERROR, camitk::MainWindow::dockWidgetMap, fileOpenDataDirectoryMenu, initActions(), initMenuBar(), initToolBar(), setCentralViewer(), ActionViewer::setSearchPanelVisible(), camitk::MainWindow::showDockViewer(), showStatusBar(), and updateActionStates().

+ Here is the call graph for this function:

◆ ~ImpMainWindow()

ImpMainWindow::~ImpMainWindow ( )
virtual

destructor

Member Function Documentation

◆ aboutToShow()

void ImpMainWindow::aboutToShow ( )
overridevirtual

overriden from MainWindow to automatically load last opened document if needed

Reimplemented from camitk::MainWindow.

References updateRecentDocumentsMenu().

+ Here is the call graph for this function:

◆ addDockViewer()

void ImpMainWindow::addDockViewer ( Qt::DockWidgetArea  dockingArea,
camitk::Viewer theViewer 
)
finaloverridevirtual

add a Viewer to the application as a docking widget and specify where it has to be docked MainWindow takes the hand on the Viewer (it will be deleted when MainWindow is deleted).

This method calls addViewer(...).

Reimplemented from camitk::MainWindow.

References updateViewMenu().

Referenced by ImpMainWindow(), and updateViewMenu().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ editSettings

void ImpMainWindow::editSettings ( )
slot

settings slot

References camitk::SettingsDialog::editSettings(), camitk::Viewer::getPropertyObject(), updateOpenDirectoryMenu(), updateRecentDocumentsMenu(), and camitk::MainWindow::viewers.

Referenced by initActions().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initActions()

void ImpMainWindow::initActions ( )
protected

initializes all QActions of the application

References CAMITK_ERROR, changeLanguage, editApplicationSettings, editClearSelection, editSettings(), fileClose, fileCloseAll, fileOpen, fileQuit, fileSave, fileSaveAll, fileSaveAs, camitk::ActionExtension::getName(), helpAboutApp, helpShowConsole, openRecentDocuments(), recentDocumentActions, recentDocumentSeparator, resetWindows(), saveHistory, saveHistoryAsSCXML(), showStatusBar(), toggleMenuBar(), viewMenuBar, viewResetWindows, and viewStatusBar.

Referenced by ImpMainWindow().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initMenuBar()

void ImpMainWindow::initMenuBar ( )
private

initMenuBar creates the menu_bar and inserts the menuitems

References actionMenu, changeLanguage, editApplicationSettings, editClearSelection, fileClose, fileCloseAll, fileMenu, fileOpen, fileQuit, fileSave, fileSaveAll, fileSaveAs, helpAboutApp, helpShowConsole, recentDocumentActions, recentDocumentSeparator, saveHistory, updateOpenDirectoryMenu(), and viewMenu.

Referenced by ImpMainWindow().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initToolBar()

void ImpMainWindow::initToolBar ( )
private

this creates the toolbars.

Change the toobar look and add new toolbars in this function.

References fileOpen, fileSave, and mainToolbar.

Referenced by ImpMainWindow().

+ Here is the caller graph for this function:

◆ openDataDirectory

void ImpMainWindow::openDataDirectory ( QString  plugin)
slot

References camitk::MainWindow::getProgressBar(), and refresh().

Referenced by updateOpenDirectoryMenu().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ openRecentDocuments

void ImpMainWindow::openRecentDocuments ( )
privateslot

open a given recent document

References camitk::Action::applyAndRegister(), and CAMITK_WARNING.

Referenced by initActions().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ redirectToConsole()

void ImpMainWindow::redirectToConsole ( bool  visible)
overridevirtual

use or not the application console (overriden to add an action to show the console window)

Reimplemented from camitk::MainWindow.

References helpShowConsole.

◆ refresh

void ImpMainWindow::refresh ( )
overridevirtualslot

References camitk::refresh(), updateActionStates(), and updateRecentDocumentsMenu().

Referenced by openDataDirectory().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetWindows

void ImpMainWindow::resetWindows ( )
slot

reset all windows in their initial state

References camitk::MainWindow::dockWidgetMap, showStatusBar(), and showToolbar().

Referenced by initActions().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveHistoryAsSCXML

void ImpMainWindow::saveHistoryAsSCXML ( )
slot

Save the history of action as a SCXML file.

Referenced by initActions().

+ Here is the caller graph for this function:

◆ setCentralViewer()

void ImpMainWindow::setCentralViewer ( camitk::Viewer theViewer)
finaloverridevirtual

set the central Viewer of the application.

MainWindow takes the hand on the Viewer (it will be deleted when MainWindow is deleted) This method calls addViewer(...).

Reimplemented from camitk::MainWindow.

References updateViewMenu().

Referenced by ImpMainWindow(), and updateViewMenu().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showStatusBar

void ImpMainWindow::showStatusBar ( bool  b)
slot

show or hide the status bar

Referenced by ImpMainWindow(), initActions(), and resetWindows().

+ Here is the caller graph for this function:

◆ showToolbar

void ImpMainWindow::showToolbar ( bool  b)
slot

show or hide the toolbar

References mainToolbar.

Referenced by resetWindows().

+ Here is the caller graph for this function:

◆ toggleMenuBar

void ImpMainWindow::toggleMenuBar ( )
slot

show or hide the menu bar

References CAMITK_WARNING, and viewMenuBar.

Referenced by initActions().

+ Here is the caller graph for this function:

◆ updateActionStates()

void ImpMainWindow::updateActionStates ( )
protected

set the current QAction enable state depending on the current selection

References actionMenu, editClearSelection, fileClose, fileCloseAll, fileSave, fileSaveAll, fileSaveAs, camitk::Component::getActionMenu(), camitk::Action::getQAction(), and camitk::MainWindow::setWindowSubtitle().

Referenced by ImpMainWindow(), and refresh().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateOpenDirectoryMenu()

void ImpMainWindow::updateOpenDirectoryMenu ( )
protected

update the open data directory menu depending on registered plugins

References fileMenu, fileOpenDataDirectoryMenu, and openDataDirectory().

Referenced by editSettings(), and initMenuBar().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateRecentDocumentsMenu()

void ImpMainWindow::updateRecentDocumentsMenu ( )
protected

update the recent document menu

References recentDocumentActions, and recentDocumentSeparator.

Referenced by aboutToShow(), editSettings(), and refresh().

+ Here is the caller graph for this function:

◆ updateViewMenu()

void ImpMainWindow::updateViewMenu ( )
protected

update the viewer's menu

References addDockViewer(), camitk::MainWindow::centralViewer, camitk::MainWindow::dockWidgetMap, camitk::Viewer::getEmbedder(), camitk::Viewer::getIcon(), camitk::Viewer::getMenu(), camitk::Viewer::getName(), camitk::Viewer::getType(), mainToolbar, setCentralViewer(), camitk::MainWindow::viewers, viewMenu, viewMenuBar, viewResetWindows, and viewStatusBar.

Referenced by addDockViewer(), and setCentralViewer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ actionMenu

QMenu* ImpMainWindow::actionMenu
private

the actionMenu.

it contains the list of specific actions possible on the currently selected Component (this menu is in fact the Popup Menu of the selected Component and is updated everytime a new Component is selected)

Referenced by initMenuBar(), and updateActionStates().

◆ changeLanguage

QAction* ImpMainWindow::changeLanguage
private

action to the change the language of the application

Referenced by initActions(), and initMenuBar().

◆ editApplicationSettings

QAction* ImpMainWindow::editApplicationSettings
private

edit actions

Referenced by initActions(), and initMenuBar().

◆ editClearSelection

QAction* ImpMainWindow::editClearSelection
private

◆ fileClose

QAction* ImpMainWindow::fileClose
private

◆ fileCloseAll

QAction* ImpMainWindow::fileCloseAll
private

◆ fileMenu

QMenu* ImpMainWindow::fileMenu
private

file_menu contains all items of the menubar entry "File"

Referenced by initMenuBar(), and updateOpenDirectoryMenu().

◆ fileOpen

QAction* ImpMainWindow::fileOpen
private

◆ fileOpenDataDirectoryMenu

QMenu* ImpMainWindow::fileOpenDataDirectoryMenu
private

◆ fileQuit

QAction* ImpMainWindow::fileQuit
private

Referenced by initActions(), and initMenuBar().

◆ fileSave

QAction* ImpMainWindow::fileSave
private

◆ fileSaveAll

QAction* ImpMainWindow::fileSaveAll
private

◆ fileSaveAs

QAction* ImpMainWindow::fileSaveAs
private

◆ helpAboutApp

QAction* ImpMainWindow::helpAboutApp
private

actions of the Help menu

Referenced by initActions(), and initMenuBar().

◆ helpShowConsole

QAction* ImpMainWindow::helpShowConsole
private

action for the show console

Referenced by initActions(), initMenuBar(), and redirectToConsole().

◆ mainToolbar

QToolBar* ImpMainWindow::mainToolbar
protected

the main toolbar

Referenced by initToolBar(), showToolbar(), and updateViewMenu().

◆ recentDocumentActions

QList<QAction*> ImpMainWindow::recentDocumentActions
private

list of all the possible recent documents actions

Referenced by initActions(), initMenuBar(), and updateRecentDocumentsMenu().

◆ recentDocumentSeparator

QAction* ImpMainWindow::recentDocumentSeparator
private

the separator between the last file menu action and the recent document actions

Referenced by initActions(), initMenuBar(), and updateRecentDocumentsMenu().

◆ saveHistory

QAction* ImpMainWindow::saveHistory
private

Referenced by initActions(), and initMenuBar().

◆ viewMenu

QMenu* ImpMainWindow::viewMenu
private

view_menu contains all items of the menubar entry "View"

Referenced by initMenuBar(), and updateViewMenu().

◆ viewMenuBar

QAction* ImpMainWindow::viewMenuBar
private

◆ viewResetWindows

QAction* ImpMainWindow::viewResetWindows
private

Referenced by initActions(), and updateViewMenu().

◆ viewStatusBar

QAction* ImpMainWindow::viewStatusBar
private

Referenced by initActions(), and updateViewMenu().


The documentation for this class was generated from the following files: