open_iA 2023.02
A tool for the visual analysis and processing of volumetric datasets, with a focus on industrial computed tomography.
Loading...
Searching...
No Matches
Public Slots | Signals | Public Member Functions | Static Public Member Functions | List of all members
MainWindow Class Reference

Application main window; implementation of iAMainWindow interface. More...

#include <mainwindow.h>

Inheritance diagram for MainWindow:
[legend]
Collaboration diagram for MainWindow:
[legend]

Public Slots

void loadLayout ()
 
void renderSettings ()
 
void slicerSettings ()
 

Signals

void closing ()
 
void fullScreenToggled ()
 
- Signals inherited from iAMainWindow
void childChanged ()
 Triggered whenever the active child window has changed.
 
void styleChanged ()
 Triggered whenever the user has changed the style of the program (bright/dark/...) via the preferences.
 

Public Member Functions

 MainWindow (QString const &appName, QString const &version, QString const &buildInformation, QString const &splashImage, iADockWidgetWrapper *dwJobs)
 
 ~MainWindow () override
 
template<typename T >
T * activeChild ()
 Get the active child window of type T.
 
QMdiSubWindow * activeChild () override
 Return the QMdiSubWindow for the current child.
 
iAMdiChildactiveMdiChild () override
 Provides access to the currently active mdi child, if such is available.
 
void addActionIcon (QAction *action, QString const &iconName) override
 add an icon to an action (and keep the action for that icon up-to-date if the style changes
 
void addRecentFile (const QString &fileName)
 add a file to the list of recently loaded/saved files
 
QMdiSubWindow * addSubWindow (QWidget *child) override
 add a new widget as sub window in the mdi area, and return the respective mdi subwindow.
 
bool brightMode () const
 whether the current qss theme is bright mode (true) or dark mode (false)
 
template<typename T >
QList< T * > childList (QMdiArea::WindowOrder order=QMdiArea::CreationOrder)
 Get the list of current child windows of type T.
 
void closeAllSubWindows () override
 Close all child windows (with a question whether sure if a child has modified data)
 
void closeMdiChild (iAMdiChild *child) override
 Close a child window.
 
iAMdiChildcreateMdiChild (bool unsavedChanges) override
 Create a new child window.
 
iAPreferences const & defaultPreferences () const override
 retrieve the default preferences.
 
iARenderSettings const & defaultRenderSettings () const override
 retrieve default renderer settings.
 
iAVolumeSettings const & defaultVolumeSettings () const override
 retrieve default volume rendering settings.
 
QMenu * fileMenu () override
 Get the File menu (can be used by modules to append entries to it).
 
QMenu * filtersMenu () override
 Get the Filters menu (can be used by modules to append entries to it).
 
QMenu * helpMenu () override
 Get the Help menu (can be used by modules to append entries to it).
 
void loadFileNew (QString const &fileName, iAMdiChild *child=nullptr, std::shared_ptr< iAFileIO > io=nullptr) override
 TODO NEWIO: create signal triggered on new child (fully) created.
 
void loadFiles (QStringList fileNames)
 
void makeActionChildDependent (QAction *action) override
 mark a QAction (typically added to filters or tools menu by a module) as depending on an MDI child window being open and active
 
QList< iAMdiChild * > mdiChildList () override
 Get the list of current MdiChild windows.
 
QList< QString > mdiWindowTitles ()
 Get list of the titles of currently open MdiChild windows.
 
iAModuleDispatchermoduleDispatcher () const override
 retrieve the module dispatcher
 
QString const & path () const override
 Retrieve current directory path (the "working folder")
 
iAMdiChildsecondNonActiveChild () override
 Provides access to a second loaded mdi child, if such is available.
 
void setPath (QString const &p) override
 Set current directory path (the "working folder")
 
QMenu * toolsMenu () override
 Get the Tools menu (can be used by modules to append entries to it).
 
void updateInteractionModeControls (int mode)
 
void updateMagicLens2DCheckState (bool enabled)
 
virtual QMdiSubWindow * activeChild ()=0
 Return the QMdiSubWindow for the current child.
 
virtual iAMdiChildactiveMdiChild ()=0
 Provides access to the currently active mdi child, if such is available.
 
virtual void addActionIcon (QAction *action, QString const &iconName)=0
 add an icon to an action (and keep the action for that icon up-to-date if the style changes
 
virtual QMdiSubWindow * addSubWindow (QWidget *child)=0
 add a new widget as sub window in the mdi area, and return the respective mdi subwindow.
 
virtual void closeAllSubWindows ()=0
 Close all child windows (with a question whether sure if a child has modified data)
 
virtual void closeMdiChild (iAMdiChild *child)=0
 Close a child window.
 
virtual iAMdiChildcreateMdiChild (bool unsavedChanges)=0
 Create a new child window.
 
virtual iAPreferences const & defaultPreferences () const =0
 retrieve the default preferences.
 
virtual iARenderSettings const & defaultRenderSettings () const =0
 retrieve default renderer settings.
 
virtual iAVolumeSettings const & defaultVolumeSettings () const =0
 retrieve default volume rendering settings.
 
virtual QMenu * fileMenu ()=0
 Get the File menu (can be used by modules to append entries to it).
 
virtual QMenu * filtersMenu ()=0
 Get the Filters menu (can be used by modules to append entries to it).
 
virtual QMenu * helpMenu ()=0
 Get the Help menu (can be used by modules to append entries to it).
 
virtual void loadFileNew (QString const &fileName, iAMdiChild *child=nullptr, std::shared_ptr< iAFileIO > io=nullptr)=0
 Load a file, either into an existing child window or creating a new one.
 
virtual void makeActionChildDependent (QAction *action)=0
 mark a QAction (typically added to filters or tools menu by a module) as depending on an MDI child window being open and active
 
virtual QList< iAMdiChild * > mdiChildList ()=0
 Get the list of current MdiChild windows.
 
virtual iAModuleDispatchermoduleDispatcher () const =0
 retrieve the module dispatcher
 
virtual QString const & path () const =0
 Retrieve current directory path (the "working folder")
 
virtual iAMdiChildsecondNonActiveChild ()=0
 Provides access to a second loaded mdi child, if such is available.
 
virtual void setPath (QString const &p)=0
 Set current directory path (the "working folder")
 
virtual QMenu * toolsMenu ()=0
 Get the Tools menu (can be used by modules to append entries to it).
 

Static Public Member Functions

static void initResources ()
 
static int runGUI (int argc, char *argv[], QString const &appName, QString const &version, QString const &buildInformation, QString const &splashPath, QString const &iconPath)
 
- Static Public Member Functions inherited from iAMainWindow
static iAMainWindowget ()
 Access to the main window (more or less singleton); implementation currently in iAModuleDispatcher.cpp.
 

Additional Inherited Members

- Static Protected Attributes inherited from iAMainWindow
static iAMainWindowm_mainWnd = nullptr
 the one main window
 

Detailed Description

Application main window; implementation of iAMainWindow interface.

Constructor & Destructor Documentation

◆ MainWindow()

MainWindow::MainWindow ( QString const &  appName,
QString const &  version,
QString const &  buildInformation,
QString const &  splashImage,
iADockWidgetWrapper dwJobs 
)

◆ ~MainWindow()

MainWindow::~MainWindow ( )
override

Member Function Documentation

◆ activeChild() [1/2]

template<typename T >
T * MainWindow::activeChild
virtual

Get the active child window of type T.

Implements iAMainWindow.

◆ activeChild() [2/2]

QMdiSubWindow * MainWindow::activeChild ( )
overridevirtual

Return the QMdiSubWindow for the current child.

Implements iAMainWindow.

◆ activeMdiChild()

iAMdiChild * MainWindow::activeMdiChild ( )
overridevirtual

Provides access to the currently active mdi child, if such is available.

Returns
pointer to the currently active mdi child, or nullptr if no child is currently open

Implements iAMainWindow.

◆ addActionIcon()

void MainWindow::addActionIcon ( QAction *  action,
QString const &  iconName 
)
overridevirtual

add an icon to an action (and keep the action for that icon up-to-date if the style changes

Implements iAMainWindow.

◆ addRecentFile()

void MainWindow::addRecentFile ( const QString &  fileName)

add a file to the list of recently loaded/saved files

◆ addSubWindow()

QMdiSubWindow * MainWindow::addSubWindow ( QWidget *  child)
overridevirtual

add a new widget as sub window in the mdi area, and return the respective mdi subwindow.

Implements iAMainWindow.

◆ brightMode()

bool MainWindow::brightMode ( ) const

whether the current qss theme is bright mode (true) or dark mode (false)

◆ childList()

template<typename T >
QList< T * > MainWindow::childList ( QMdiArea::WindowOrder  order = QMdiArea::CreationOrder)

Get the list of current child windows of type T.

◆ closeAllSubWindows()

void MainWindow::closeAllSubWindows ( )
overridevirtual

Close all child windows (with a question whether sure if a child has modified data)

Implements iAMainWindow.

◆ closeMdiChild()

void MainWindow::closeMdiChild ( iAMdiChild child)
overridevirtual

Close a child window.

Implements iAMainWindow.

◆ closing

void MainWindow::closing ( )
signal

◆ createMdiChild()

iAMdiChild * MainWindow::createMdiChild ( bool  unsavedChanges)
overridevirtual

Create a new child window.

Implements iAMainWindow.

◆ defaultPreferences()

iAPreferences const & MainWindow::defaultPreferences ( ) const
overridevirtual

retrieve the default preferences.

Implements iAMainWindow.

◆ defaultRenderSettings()

iARenderSettings const & MainWindow::defaultRenderSettings ( ) const
overridevirtual

retrieve default renderer settings.

Implements iAMainWindow.

◆ defaultVolumeSettings()

iAVolumeSettings const & MainWindow::defaultVolumeSettings ( ) const
overridevirtual

retrieve default volume rendering settings.

TODO: more generic interface, also suitable for other datasets (mesh, ...)

Implements iAMainWindow.

◆ fileMenu()

QMenu * MainWindow::fileMenu ( )
overridevirtual

Get the File menu (can be used by modules to append entries to it).

Implements iAMainWindow.

◆ filtersMenu()

QMenu * MainWindow::filtersMenu ( )
overridevirtual

Get the Filters menu (can be used by modules to append entries to it).

Implements iAMainWindow.

◆ fullScreenToggled

void MainWindow::fullScreenToggled ( )
signal

◆ helpMenu()

QMenu * MainWindow::helpMenu ( )
overridevirtual

Get the Help menu (can be used by modules to append entries to it).

Implements iAMainWindow.

◆ initResources()

void MainWindow::initResources ( )
static

◆ loadFileNew()

void MainWindow::loadFileNew ( QString const &  fileName,
iAMdiChild child = nullptr,
std::shared_ptr< iAFileIO io = nullptr 
)
overridevirtual

TODO NEWIO: create signal triggered on new child (fully) created.

Implements iAMainWindow.

◆ loadFiles()

void MainWindow::loadFiles ( QStringList  fileNames)

◆ loadLayout

void MainWindow::loadLayout ( )
slot

◆ makeActionChildDependent()

void MainWindow::makeActionChildDependent ( QAction *  action)
overridevirtual

mark a QAction (typically added to filters or tools menu by a module) as depending on an MDI child window being open and active

Implements iAMainWindow.

◆ mdiChildList()

QList< iAMdiChild * > MainWindow::mdiChildList ( )
overridevirtual

Get the list of current MdiChild windows.

Implements iAMainWindow.

◆ mdiWindowTitles()

QList< QString > MainWindow::mdiWindowTitles ( )

Get list of the titles of currently open MdiChild windows.

◆ moduleDispatcher()

iAModuleDispatcher & MainWindow::moduleDispatcher ( ) const
overridevirtual

retrieve the module dispatcher

Implements iAMainWindow.

◆ path()

QString const & MainWindow::path ( ) const
overridevirtual

Retrieve current directory path (the "working folder")

Implements iAMainWindow.

◆ renderSettings

void MainWindow::renderSettings ( )
slot

◆ runGUI()

int MainWindow::runGUI ( int  argc,
char *  argv[],
QString const &  appName,
QString const &  version,
QString const &  buildInformation,
QString const &  splashPath,
QString const &  iconPath 
)
static

◆ secondNonActiveChild()

iAMdiChild * MainWindow::secondNonActiveChild ( )
overridevirtual

Provides access to a second loaded mdi child, if such is available.

Will throw an error if none is available or more than two are loaded.

Deprecated:
instead of this method, in filters, use the facilities provided in iAFilter (via the requiredInputs parameter to the constructor) to specify multiple inputs

Implements iAMainWindow.

◆ setPath()

void MainWindow::setPath ( QString const &  p)
overridevirtual

Set current directory path (the "working folder")

Implements iAMainWindow.

◆ slicerSettings

void MainWindow::slicerSettings ( )
slot

◆ toolsMenu()

QMenu * MainWindow::toolsMenu ( )
overridevirtual

Get the Tools menu (can be used by modules to append entries to it).

Implements iAMainWindow.

◆ updateInteractionModeControls()

void MainWindow::updateInteractionModeControls ( int  mode)

◆ updateMagicLens2DCheckState()

void MainWindow::updateMagicLens2DCheckState ( bool  enabled)

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