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

Default GUI runner for an iAFilter. More...

#include <iAFilterRunnerGUI.h>

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

Signals

void finished ()
 Signal which by default (in the default ConnectThreadSignals) is connected to be emitted at the end of the filter thread run.
 

Public Member Functions

virtual bool askForParameters (std::shared_ptr< iAFilter > filter, QVariantMap &paramValues, iAMdiChild *sourceMdi, iAMainWindow *mainWnd, bool askForAdditionalInput)
 Prompts the user to adapt the parameters to his needs for the current filter run.
 
virtual void filterGUIPreparations (std::shared_ptr< iAFilter > filter, iAMdiChild *mdiChild, iAMainWindow *mainWnd, QVariantMap const &params)
 do any potentially necessary GUI preparations (directly before the filter is run)
 
virtual QVariantMap loadParameters (std::shared_ptr< iAFilter > filter, iAMdiChild *sourceMdi)
 Loads parameters from the platform-specific store.
 
virtual void run (std::shared_ptr< iAFilter > filter, iAMainWindow *mainWnd)
 Main run method.
 
virtual void storeParameters (std::shared_ptr< iAFilter > filter, QVariantMap &paramValues)
 Store parameters in the platform-specific store.
 

Static Public Member Functions

static std::shared_ptr< iAFilterRunnerGUIcreate ()
 Method to create an instance of this runner.
 

Detailed Description

Default GUI runner for an iAFilter.

For the given descendant of iAFilter, this method loads its settings from the platform-specific settings store (Registry under Windows, .config folder under Unix, ...). Then it shows a dialog to the user to change these parameters. Afterwards it checks the parameters with the given filter. If they are ok, it stores them back to the settings store. Subsequently it creates a thread for the given filter, assigns the slots required for progress indication, final display and cleanup, and finally it runs the filter with the parameters.

Member Function Documentation

◆ askForParameters()

bool iAFilterRunnerGUI::askForParameters ( std::shared_ptr< iAFilter filter,
QVariantMap &  paramValues,
iAMdiChild sourceMdi,
iAMainWindow mainWnd,
bool  askForAdditionalInput 
)
virtual

Prompts the user to adapt the parameters to his needs for the current filter run.

Parameters
filterthe filter that should be run
paramValuesthe parameter values as loaded from the platform-specific settings store
sourceMdithe mdi child that is the main image source for this filter
mainWndaccess to the main window (as parent for GUI windows)
askForAdditionalInputwhether the parameter dialog should also ask for additional inputs if the filter requires more than 1

◆ create()

std::shared_ptr< iAFilterRunnerGUI > iAFilterRunnerGUI::create ( )
static

Method to create an instance of this runner.

If you override this class, don't forget to create your own Create method (called from the factory template), otherwise still an iAFilterRunnerGUI will be created!

◆ filterGUIPreparations()

void iAFilterRunnerGUI::filterGUIPreparations ( std::shared_ptr< iAFilter filter,
iAMdiChild mdiChild,
iAMainWindow mainWnd,
QVariantMap const &  params 
)
virtual

do any potentially necessary GUI preparations (directly before the filter is run)

◆ finished

void iAFilterRunnerGUI::finished ( )
signal

Signal which by default (in the default ConnectThreadSignals) is connected to be emitted at the end of the filter thread run.

◆ loadParameters()

QVariantMap iAFilterRunnerGUI::loadParameters ( std::shared_ptr< iAFilter filter,
iAMdiChild sourceMdi 
)
virtual

Loads parameters from the platform-specific store.

Parameters
filterthe filter for which to load the parameters
sourceMdithe mdi child which was active when the filter was started. Not used in the standard implementation, but may be used by overriding classes to access properties of the input file, e.g. in the extract image filter it is used to get the size of the input image.
Returns
a map containing for each parameter name the stored value

◆ run()

void iAFilterRunnerGUI::run ( std::shared_ptr< iAFilter filter,
iAMainWindow mainWnd 
)
virtual

Main run method.

Calls all the other (non-static) methods in this class. Override only if you want to change the whole way the filter running works; typically you will only want to override one of the methods below

Parameters
filterthe filter to run
mainWndaccess to the main window

TODO: find way to check parameters already in iAParameterDlg (before closing)

◆ storeParameters()

void iAFilterRunnerGUI::storeParameters ( std::shared_ptr< iAFilter filter,
QVariantMap &  paramValues 
)
virtual

Store parameters in the platform-specific store.

Parameters
filterthe filter for which to store the parameters
paramValuesthe parameters and their values
Returns
a map containing for each parameter name the stored value, as set by the user

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