open_iA  2020.01
A tool for the visual analysis and processing of volumetric datasets, with a focus on industrial computed tomography.
Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes | List of all members
iAModuleInterface Class Referenceabstract

Base class for a module interface. More...

#include <iAModuleInterface.h>

Inheritance diagram for iAModuleInterface:
Collaboration diagram for iAModuleInterface:

Public Member Functions

virtual void ChildCreated (MdiChild *child)
 Called whenever an MdiChild object is created. Override to react on this. More...
 
 iAModuleInterface ()
 
virtual void Initialize ()=0
 Override to add references to the module in the core code, for example menu entries. More...
 
virtual void SaveSettings () const
 Override to store custom settings of this module; called when program is shut down. More...
 
void SetDispatcher (iAModuleDispatcher *dispatcher)
 Called by the module dispatcher on module initialization. There should be no need to call this method from user code. More...
 
void SetMainWindow (MainWindow *mainWnd)
 Called by the module dispatcher on module initialization. There should be no need to call this method from user code. More...
 
virtual ~iAModuleInterface ()
 

Protected Slots

void attachedChildClosed ()
 
void detach ()
 

Protected Member Functions

void AddActionToMenuAlphabeticallySorted (QMenu *menu, QAction *action, bool isDisablable=true)
 Add an action to a given menu ensuring alphabetic order. More...
 
bool AttachToMdiChild (MdiChild *child)
 Sets up a new attachment for the given MdiChild via CreateAttachment and links the two. More...
 
virtual iAModuleAttachmentToChildCreateAttachment (MainWindow *mainWnd, MdiChild *child)
 Create a new attachment for the given child. More...
 
template<class T >
T * GetAttachment ()
 Get an attachment of the current mdi child. More...
 
QMenu * getMenuWithTitle (QMenu *parentMenu, QString const &title, bool isDisablable=true)
 Retrieve the menu with the given title (or creates it if it doesn't exist yet). More...
 
bool isAttached ()
 Return true if attached to current mdi child. More...
 
void PrepareActiveChild ()
 Set the currently active child as "current". More...
 
void PrepareResultChild (int childInd, QString const &title)
 Create a new result child at the given index in the MdiChild list with the given title. More...
 
void PrepareResultChild (QString const &title)
 Create a new result child, with a title made from the given title + the previous title of the active child. More...
 

Protected Attributes

QVector< iAModuleAttachmentToChild * > m_attachments
 attachments of this module More...
 
iAModuleDispatcherm_dispatcher
 access to the module dispatcher More...
 
MainWindowm_mainWnd
 access to the main window More...
 
MdiChildm_mdiChild
 "current" mdi child More...
 

Detailed Description

Base class for a module interface.

A class derived from this class, and having a name in the form iA<ModuleName>ModuleInterface needs to be part of each module. E.g. the XRF module needs to contain a class iAXRFModuleInterface. At least the Initialize method needs to be overriden in order to add the custom code of the module to open_iA. This can either be the addition of some filters, or adding an entry directly to open_iA's toolbar or menu.

Constructor & Destructor Documentation

◆ iAModuleInterface()

iAModuleInterface::iAModuleInterface ( )

◆ ~iAModuleInterface()

iAModuleInterface::~iAModuleInterface ( )
virtual

Member Function Documentation

◆ AddActionToMenuAlphabeticallySorted()

void iAModuleInterface::AddActionToMenuAlphabeticallySorted ( QMenu *  menu,
QAction *  action,
bool  isDisablable = true 
)
protected

Add an action to a given menu ensuring alphabetic order.

Parameters
menuthe menu to add the entry to (see e.g. MainWindow::getToolMenu())
actionthe action to add to the menu
isDisablablewhether the action should be disabled when no child is currently open

◆ attachedChildClosed

void iAModuleInterface::attachedChildClosed ( )
protectedslot

◆ AttachToMdiChild()

bool iAModuleInterface::AttachToMdiChild ( MdiChild child)
protected

Sets up a new attachment for the given MdiChild via CreateAttachment and links the two.

◆ ChildCreated()

void iAModuleInterface::ChildCreated ( MdiChild child)
virtual

Called whenever an MdiChild object is created. Override to react on this.

◆ CreateAttachment()

iAModuleAttachmentToChild * iAModuleInterface::CreateAttachment ( MainWindow mainWnd,
MdiChild child 
)
protectedvirtual

Create a new attachment for the given child.

◆ detach

void iAModuleInterface::detach ( )
protectedslot

◆ GetAttachment()

template<class T >
T * iAModuleInterface::GetAttachment ( )
protected

Get an attachment of the current mdi child.

Note
current mdi child is determined through m_mdiChild member which is not automatically updated to the active mdi child, see m_mdiChild member!

◆ getMenuWithTitle()

QMenu * iAModuleInterface::getMenuWithTitle ( QMenu *  parentMenu,
QString const &  title,
bool  isDisablable = true 
)
protected

Retrieve the menu with the given title (or creates it if it doesn't exist yet).

◆ Initialize()

virtual void iAModuleInterface::Initialize ( )
pure virtual

Override to add references to the module in the core code, for example menu entries.

◆ isAttached()

bool iAModuleInterface::isAttached ( )
protected

Return true if attached to current mdi child.

Note
: current mdi child is determined through m_mdiChild member which is not automatically updated to the active mdi child!

◆ PrepareActiveChild()

void iAModuleInterface::PrepareActiveChild ( )
protected

Set the currently active child as "current".

◆ PrepareResultChild() [1/2]

void iAModuleInterface::PrepareResultChild ( int  childInd,
QString const &  title 
)
protected

Create a new result child at the given index in the MdiChild list with the given title.

◆ PrepareResultChild() [2/2]

void iAModuleInterface::PrepareResultChild ( QString const &  title)
protected

Create a new result child, with a title made from the given title + the previous title of the active child.

◆ SaveSettings()

void iAModuleInterface::SaveSettings ( ) const
virtual

Override to store custom settings of this module; called when program is shut down.

◆ SetDispatcher()

void iAModuleInterface::SetDispatcher ( iAModuleDispatcher dispatcher)

Called by the module dispatcher on module initialization. There should be no need to call this method from user code.

◆ SetMainWindow()

void iAModuleInterface::SetMainWindow ( MainWindow mainWnd)

Called by the module dispatcher on module initialization. There should be no need to call this method from user code.

Member Data Documentation

◆ m_attachments

QVector<iAModuleAttachmentToChild*> iAModuleInterface::m_attachments
protected

attachments of this module

◆ m_dispatcher

iAModuleDispatcher* iAModuleInterface::m_dispatcher
protected

access to the module dispatcher

◆ m_mainWnd

MainWindow* iAModuleInterface::m_mainWnd
protected

access to the main window

◆ m_mdiChild

MdiChild* iAModuleInterface::m_mdiChild
protected

"current" mdi child

Deprecated:
use direct access via MainWindow methods

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