Medical Imaging Interaction Toolkit
2018.4.99-389bf124
Medical Imaging Interaction Toolkit
|
The base class of all MITK related blueberry views (~ in the old version of MITK, this was called "Functionality") More...
#include <QmitkFunctionality.h>
Public Member Functions | |
berryObjectMacro (QmitkFunctionality) | |
QmitkFunctionality () | |
~QmitkFunctionality () override | |
virtual void | ClosePart () |
virtual void | OnSelectionChanged (std::vector< mitk::DataNode *>) |
virtual void | OnPreferencesChanged (const berry::IBerryPreferences *) |
void | SetHandleMultipleDataStorages (bool multiple) |
bool | HandlesMultipleDataStorages () const |
virtual void | MultiWidgetAvailable (QmitkAbstractMultiWidget &multiWidget) |
virtual void | MultiWidgetClosed (QmitkAbstractMultiWidget &multiWidget) |
virtual void | MultiWidgetNotAvailable () |
virtual void | Activated () |
bool | IsActivated () const |
virtual void | Deactivated () |
virtual bool | IsExclusiveFunctionality () const |
void | FireNodeSelected (mitk::DataNode *node) |
void | FireNodesSelected (std::vector< mitk::DataNode *> nodes) |
virtual void | Visible () |
bool | IsVisible () const |
virtual void | Hidden () |
void | CreatePartControl (QWidget *parent) override |
void | SetFocus () override |
void | NodeAddedProxy (const mitk::DataNode *node) |
void | NodeRemovedProxy (const mitk::DataNode *node) |
void | NodeChangedProxy (const mitk::DataNode *node) |
void | SetVisible (bool visible) |
void | SetActivated (bool activated) |
void | ClosePartProxy () |
![]() | |
berryObjectMacro (QtViewPart) | |
![]() | |
berryObjectMacro (ViewPart, WorkbenchPart, IViewPart) | |
void | Init (IViewSite::Pointer site, IMemento::Pointer memento=IMemento::Pointer(nullptr)) override |
void | SaveState (IMemento::Pointer memento) override |
IViewSite::Pointer | GetViewSite () override |
![]() | |
berryObjectMacro (WorkbenchPart, QObject, IWorkbenchPart, IExecutableExtension) | |
~WorkbenchPart () override | |
void | AddPropertyListener (IPropertyChangeListener *l) override |
void | RemovePropertyListener (IPropertyChangeListener *l) override |
void | SetPartProperty (const QString &key, const QString &value) override |
QString | GetPartProperty (const QString &key) const override |
const QHash< QString, QString > & | GetPartProperties () const override |
void | SetInitializationData (const IConfigurationElement::Pointer &cfig, const QString &propertyName, const Object::Pointer &data) override |
IWorkbenchPartSite::Pointer | GetSite () const override |
QString | GetPartName () const override |
QString | GetContentDescription () const override |
QIcon | GetTitleImage () const override |
QString | GetTitleToolTip () const override |
![]() | |
berryObjectMacro (berry::IWorkbenchPart, Object) | |
~IWorkbenchPart () override | |
![]() | |
virtual QString | GetClassName () const |
virtual Reflection::TypeInfo | GetTypeInfo () const |
virtual QList< Reflection::TypeInfo > | GetSuperclasses () const |
virtual void | Delete () |
QDebug | Print (QDebug os, Indent Indent=0) const |
virtual QString | ToString () const |
virtual uint | HashCode () const |
virtual bool | operator< (const Object *) const |
void | Register () const |
void | UnRegister (bool del=true) const |
int | GetReferenceCount () const |
void | SetReferenceCount (int) |
void | AddDestroyListener (const MessageAbstractDelegate<> &delegate) const |
void | RemoveDestroyListener (const MessageAbstractDelegate<> &delegate) const |
virtual bool | operator== (const Object *) const |
![]() | |
virtual | ~IExecutableExtension () |
virtual void | SetInitializationData (const SmartPointer< IConfigurationElement > &config, const QString &propertyName, const Object::Pointer &data)=0 |
![]() | |
berryObjectMacro (berry::IViewPart, IWorkbenchPart) | |
~IViewPart () override | |
Protected Member Functions | |
virtual void | NodeAdded (const mitk::DataNode *node) |
virtual void | NodeChanged (const mitk::DataNode *) |
virtual void | NodeRemoved (const mitk::DataNode *node) |
virtual void | DataStorageChanged () |
std::vector< mitk::DataNode * > | GetCurrentSelection () const |
std::vector< mitk::DataNode * > | GetDataManagerSelection () const |
berry::IPreferences::Pointer | GetPreferences () const |
mitk::DataStorage::Pointer | GetDataStorage () const |
mitk::DataStorage::Pointer | GetDefaultDataStorage () const |
mitk::IDataStorageReference::Pointer | GetDataStorageReference () const |
QmitkAbstractMultiWidget * | GetActiveMultiWidget (bool reCreateWidget=true) |
void | HandleException (std::exception &e, QWidget *parent=nullptr, bool showDialog=true) const |
void | HandleException (const char *str, QWidget *parent=nullptr, bool showDialog=true) const |
void | WaitCursorOn () |
void | WaitCursorOff () |
void | BusyCursorOn () |
void | BusyCursorOff () |
void | RestoreOverrideCursor () |
void | AfterCreateQtPartControl () |
void | ActivateLastVisibleFunctionality () |
void | BlueBerrySelectionChanged (const berry::IWorkbenchPart::Pointer &sourcepart, const berry::ISelection::ConstPointer &selection) |
std::vector< mitk::DataNode * > | DataNodeSelectionToVector (mitk::DataNodeSelection::ConstPointer currentSelection) const |
![]() | |
virtual void | CreateQtPartControl (QWidget *parent)=0 |
![]() | |
ViewPart () | |
void | CheckSite (IWorkbenchPartSite::Pointer site) override |
![]() | |
WorkbenchPart () | |
IConfigurationElement::Pointer | GetConfigurationElement () const |
void | SetSite (IWorkbenchPartSite::Pointer site) |
virtual void | SetTitleImage (const QIcon &titleImage) |
virtual void | SetTitleToolTip (const QString &toolTip) |
virtual void | SetPartName (const QString &partName) |
virtual void | SetContentDescription (const QString &description) |
void | FirePropertyChanged (const QString &key, const QString &oldValue, const QString &newValue) |
void | FirePropertyChange (int propertyId) |
![]() | |
Object () | |
virtual | ~Object () |
virtual QDebug | PrintSelf (QDebug os, Indent indent) const |
virtual QDebug | PrintHeader (QDebug os, Indent indent) const |
virtual QDebug | PrintTrailer (QDebug os, Indent indent) const |
Protected Attributes | |
QWidget * | m_Parent |
bool | m_Active |
bool | m_Visible |
![]() | |
QAtomicInt | m_ReferenceCount |
QMutex | m_ReferenceCountLock |
Additional Inherited Members | |
![]() | |
typedef Object | Self |
typedef berry::SmartPointer< Self > | Pointer |
typedef berry::SmartPointer< const Self > | ConstPointer |
typedef berry::WeakPointer< Self > | WeakPtr |
typedef berry::WeakPointer< const Self > | ConstWeakPtr |
![]() | |
static const char * | GetStaticClassName () |
static Reflection::TypeInfo | GetStaticTypeInfo () |
static QList< Reflection::TypeInfo > | GetStaticSuperclasses () |
The base class of all MITK related blueberry views (~ in the old version of MITK, this was called "Functionality")
QmitkFunctionality provides several convenience methods that eases the introduction of a new view:
Please use the Activated/Deactivated method to add/remove interactors, disabling multiwidget crosshair or anything which may "affect" other functionalities. For further reading please have a look at QmitkFunctionality::IsExclusiveFunctionality().
Definition at line 70 of file QmitkFunctionality.h.
QmitkFunctionality::QmitkFunctionality | ( | ) |
Nothing to do in the standard ctor. Initiliaze your GUI in CreateQtPartControl(QWidget*)
Definition at line 39 of file QmitkFunctionality.cpp.
|
override |
Disconnects all standard event listeners
Definition at line 214 of file QmitkFunctionality.cpp.
References ClosePartProxy(), berry::Object::Register(), and berry::Object::UnRegister().
|
virtual |
Only called when IsExclusiveFunctionality() returns true.
Definition at line 248 of file QmitkFunctionality.cpp.
Referenced by QmitkFunctionalityCoordinator::ActivateStandaloneFunctionality().
|
protected |
code to activate the last visible functionality
|
protected |
Called immediately after CreateQtPartControl(). Here standard event listeners for a QmitkFunctionality are registered
Definition at line 137 of file QmitkFunctionality.cpp.
References BlueBerrySelectionChanged(), berry::SmartPointer< TObjectType >::Cast(), GetActiveMultiWidget(), GetDataManagerSelection(), GetDefaultDataStorage(), GetPreferences(), berry::WorkbenchPart::GetSite(), berry::SmartPointer< TObjectType >::IsNotNull(), MultiWidgetAvailable(), NodeAddedProxy(), NodeChangedProxy(), NodeRemovedProxy(), OnPreferencesChanged(), and OnSelectionChanged().
Referenced by CreatePartControl().
QmitkFunctionality::berryObjectMacro | ( | QmitkFunctionality | ) |
Creates smartpointer typedefs
|
protected |
reactions to selection events from data manager (and potential other senders)
Definition at line 228 of file QmitkFunctionality.cpp.
References berry::SmartPointer< TObjectType >::Cast(), DataNodeSelectionToVector(), berry::SmartPointer< TObjectType >::IsNull(), and OnSelectionChanged().
Referenced by AfterCreateQtPartControl().
|
protected |
Convenient method to restore the standard cursor
Definition at line 326 of file QmitkFunctionality.cpp.
References RestoreOverrideCursor().
|
protected |
Convenient method to set and reset a busy cursor
Definition at line 316 of file QmitkFunctionality.cpp.
|
virtual |
Called, when the WorkbenchPart gets closed by the user directly or by closing the whole app (e.g. for removing event listeners)
Definition at line 179 of file QmitkFunctionality.cpp.
Referenced by ClosePartProxy().
void QmitkFunctionality::ClosePartProxy | ( | ) |
Called, when the WorkbenchPart gets closed for removing event listeners Internally this method calls ClosePart after it removed the listeners registered by QmitkFunctionality. By having this proxy method the user does not have to call QmitkFunctionality::ClosePart() when overwriting ClosePart()
Definition at line 184 of file QmitkFunctionality.cpp.
References berry::SmartPointer< TObjectType >::Cast(), ClosePart(), GetDefaultDataStorage(), GetPreferences(), berry::WorkbenchPart::GetSite(), berry::SmartPointer< TObjectType >::IsNotNull(), NodeAddedProxy(), NodeChangedProxy(), NodeRemovedProxy(), OnPreferencesChanged(), and berry::ISelectionService::RemovePostSelectionListener().
Referenced by ~QmitkFunctionality().
|
overridevirtual |
Creates a scroll area for this view and calls CreateQtPartControl then
Reimplemented from berry::QtViewPart.
Definition at line 101 of file QmitkFunctionality.cpp.
References AfterCreateQtPartControl(), berry::QtViewPart::CreateQtPartControl(), and m_Parent.
|
protected |
Converts a mitk::DataNodeSelection to a std::vector<mitk::DataNode*> (possibly empty
Definition at line 41 of file QmitkFunctionality2.cpp.
References mitk::DataNodeObject::GetDataNode(), and berry::SmartPointer< TObjectType >::IsNull().
Referenced by BlueBerrySelectionChanged(), GetCurrentSelection(), and GetDataManagerSelection().
|
protectedvirtual |
Called when a DataStorage add or remove or change event was thrown. May be reimplemented by deriving classes.
Definition at line 263 of file QmitkFunctionality.cpp.
Referenced by NodeAddedProxy(), NodeChangedProxy(), and NodeRemovedProxy().
|
virtual |
Only called when IsExclusiveFunctionality() returns true.
Definition at line 252 of file QmitkFunctionality.cpp.
Referenced by QmitkFunctionalityCoordinator::DeactivateStandaloneFunctionality().
void QmitkFunctionality::FireNodeSelected | ( | mitk::DataNode * | node | ) |
Informs other parts of the workbench that node is selected via the blueberry selection service.
Definition at line 118 of file QmitkFunctionality2.cpp.
References FireNodesSelected().
void QmitkFunctionality::FireNodesSelected | ( | std::vector< mitk::DataNode *> | nodes | ) |
Informs other parts of the workbench that the nodes are selected via the blueberry selection service.
Definition at line 125 of file QmitkFunctionality2.cpp.
Referenced by FireNodeSelected().
|
protected |
Returns the default and active MultiWidget.
reCreateWidget | a boolean flag to en-/disable the attempt to re-create the StdWidget If there is not MultiWidget yet a new one is created in this method when called with default parameter! |
Definition at line 268 of file QmitkFunctionality.cpp.
References berry::SmartPointer< TObjectType >::Cast(), QmitkStdMultiWidgetEditor::EDITOR_ID, GetDataStorageReference(), berry::WorkbenchPart::GetSite(), and berry::IWorkbenchPage::MATCH_ID.
Referenced by AfterCreateQtPartControl().
|
protected |
Definition at line 21 of file QmitkFunctionality2.cpp.
References berry::SmartPointer< TObjectType >::Cast(), DataNodeSelectionToVector(), and berry::WorkbenchPart::GetSite().
|
protected |
Returns the current selection made in the datamanager bundle or an empty vector if nothing`s selected or if the bundle does not exist
Definition at line 29 of file QmitkFunctionality2.cpp.
References berry::SmartPointer< TObjectType >::Cast(), DataNodeSelectionToVector(), and berry::WorkbenchPart::GetSite().
Referenced by AfterCreateQtPartControl().
|
protected |
Returns the default or the currently active DataStorage if m_HandlesMultipleDataStorages is set to true
Definition at line 62 of file QmitkFunctionality.cpp.
References mitk::IDataStorageService::GetActiveDataStorage(), and mitk::IDataStorageService::GetDefaultDataStorage().
|
protected |
Definition at line 89 of file QmitkFunctionality.cpp.
References mitk::IDataStorageService::GetDataStorage().
Referenced by GetActiveMultiWidget().
|
protected |
Definition at line 77 of file QmitkFunctionality.cpp.
References mitk::IDataStorageService::GetDefaultDataStorage().
Referenced by AfterCreateQtPartControl(), and ClosePartProxy().
|
protected |
Returns the Preferences object for this Functionality. Important: When refering to this preferences, e.g. in a PreferencePage: The ID for this preferences object is "/<VIEW-ID>", e.g. "/org.mitk.views.datamanager"
Definition at line 336 of file QmitkFunctionality.cpp.
References berry::Platform::GetPreferencesService(), and berry::IPreferencesService::GetSystemPreferences().
Referenced by AfterCreateQtPartControl(), and ClosePartProxy().
|
protected |
Outputs an error message to the console and displays a message box containing the exception description.
e | the exception which should be handled |
showDialog | controls, whether additionally a message box should be displayed to inform the user that something went wrong |
Definition at line 301 of file QmitkFunctionality.cpp.
|
protected |
Calls HandleException ( std::exception&, QWidget*, bool ) internally
Definition at line 291 of file QmitkFunctionality.cpp.
References MITK_ERROR.
bool QmitkFunctionality::HandlesMultipleDataStorages | ( | ) | const |
Definition at line 56 of file QmitkFunctionality.cpp.
|
virtual |
Called when this functionality is hidden ( no matter what IsExclusiveFunctionality() returns )
Definition at line 349 of file QmitkFunctionality.cpp.
bool QmitkFunctionality::IsActivated | ( | ) | const |
Definition at line 369 of file QmitkFunctionality.cpp.
References m_Active.
Referenced by QmitkFunctionalityCoordinator::ActivateStandaloneFunctionality(), and QmitkFunctionalityCoordinator::DeactivateStandaloneFunctionality().
|
virtual |
Some functionalities need to add special interactors, removes the crosshair from the multiwidget, etc. In this case the functionality has to tidy up when changing to another functionality which also wants to change the "default configuration". In the old Qt3-based version of MITK, two functionalities could never be opened at the same time so that the methods Activated() and Deactivated() were the right place for the functionalitites to add/remove their interactors, etc. This is still true for the new MITK Workbench, but as there can be several functionalities visible at the same time, the behaviour concerning when Activated() and Deactivated() are called has changed:
As a consequence of 1. if you overwrite IsExclusiveFunctionality() and let it return false, you signalize the MITK Workbench that this functionality does nothing to the "default configuration" and can easily be visible while other functionalities are also visible.
By default the method returns true.
Definition at line 354 of file QmitkFunctionality.cpp.
Referenced by QmitkFunctionalityCoordinator::ActivateStandaloneFunctionality().
bool QmitkFunctionality::IsVisible | ( | ) | const |
Definition at line 239 of file QmitkFunctionality.cpp.
References m_Visible.
|
virtual |
Called when a MultiWidget is available. Should not be used anymore, see GetActiveMultiWidget()
Definition at line 256 of file QmitkFunctionality.cpp.
Referenced by AfterCreateQtPartControl().
|
virtual |
Called when a MultiWidget is available. Should not be used anymore, see GetActiveMultiWidget()
Definition at line 306 of file QmitkFunctionality.cpp.
|
virtual |
Called when no MultiWidget is available anymore. Should not be used anymore, see GetActiveMultiWidget()
Definition at line 259 of file QmitkFunctionality.cpp.
|
protectedvirtual |
Called when a DataStorage Add event was thrown. May be reimplemented by deriving classes.
Definition at line 79 of file QmitkFunctionality2.cpp.
Referenced by NodeAddedProxy().
void QmitkFunctionality::NodeAddedProxy | ( | const mitk::DataNode * | node | ) |
Called when a DataStorage Add Event was thrown. Sets m_InDataStorageChanged to true and calls NodeAdded afterwards.
Definition at line 66 of file QmitkFunctionality2.cpp.
References DataStorageChanged(), and NodeAdded().
Referenced by AfterCreateQtPartControl(), and ClosePartProxy().
|
protectedvirtual |
Called when a DataStorage Changed event was thrown. May be reimplemented by deriving classes.
Definition at line 101 of file QmitkFunctionality2.cpp.
Referenced by NodeChangedProxy().
void QmitkFunctionality::NodeChangedProxy | ( | const mitk::DataNode * | node | ) |
Called when a DataStorage changed event was thrown. Sets m_InDataStorageChanged to true and calls NodeChanged afterwards.
Definition at line 106 of file QmitkFunctionality2.cpp.
References DataStorageChanged(), and NodeChanged().
Referenced by AfterCreateQtPartControl(), and ClosePartProxy().
|
protectedvirtual |
Called when a DataStorage Remove event was thrown. May be reimplemented by deriving classes.
Definition at line 96 of file QmitkFunctionality2.cpp.
Referenced by NodeRemovedProxy().
void QmitkFunctionality::NodeRemovedProxy | ( | const mitk::DataNode * | node | ) |
Called when a DataStorage remove event was thrown. Sets m_InDataStorageChanged to true and calls NodeRemoved afterwards.
Definition at line 84 of file QmitkFunctionality2.cpp.
References DataStorageChanged(), and NodeRemoved().
Referenced by AfterCreateQtPartControl(), and ClosePartProxy().
|
virtual |
Called when the preferences object of this view changed.
Definition at line 224 of file QmitkFunctionality.cpp.
Referenced by AfterCreateQtPartControl(), and ClosePartProxy().
|
virtual |
Called when the selection in the workbench changed
Definition at line 37 of file QmitkFunctionality2.cpp.
Referenced by AfterCreateQtPartControl(), and BlueBerrySelectionChanged().
|
protected |
Convenient method to restore the standard cursor
Definition at line 331 of file QmitkFunctionality.cpp.
Referenced by BusyCursorOff(), and WaitCursorOff().
void QmitkFunctionality::SetActivated | ( | bool | activated | ) |
Toggles the activated flag m_Activated
Definition at line 364 of file QmitkFunctionality.cpp.
References m_Active.
Referenced by QmitkFunctionalityCoordinator::ActivateStandaloneFunctionality(), and QmitkFunctionalityCoordinator::DeactivateStandaloneFunctionality().
|
overridevirtual |
Called when this view receives the focus. Same as Activated()
Implements berry::WorkbenchPart.
Definition at line 244 of file QmitkFunctionality.cpp.
void QmitkFunctionality::SetHandleMultipleDataStorages | ( | bool | multiple | ) |
Make this view manage multiple DataStorage. If set to true GetDataStorage() will return the currently active DataStorage (and not the default one).
Definition at line 51 of file QmitkFunctionality.cpp.
void QmitkFunctionality::SetVisible | ( | bool | visible | ) |
Toggles the visible flag m_Visible
Definition at line 359 of file QmitkFunctionality.cpp.
References m_Visible.
|
virtual |
Called when this functionality becomes visible ( no matter what IsExclusiveFunctionality() returns )
Definition at line 344 of file QmitkFunctionality.cpp.
|
protected |
Convenient method to restore the standard cursor
Definition at line 321 of file QmitkFunctionality.cpp.
References RestoreOverrideCursor().
|
protected |
Convenient method to set and reset a wait cursor ("hourglass")
Definition at line 311 of file QmitkFunctionality.cpp.
|
protected |
Saves if this view is the currently active one.
Definition at line 361 of file QmitkFunctionality.h.
Referenced by IsActivated(), and SetActivated().
|
protected |
Saves the parent of this view (this is the scrollarea created in CreatePartControl(QWidget*)
Definition at line 357 of file QmitkFunctionality.h.
Referenced by CreatePartControl().
|
protected |
Saves if this view is visible
Definition at line 365 of file QmitkFunctionality.h.
Referenced by IsVisible(), and SetVisible().