Slicer 4.2
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
qSlicerAbstractCoreModule Class Reference

qSlicerAbstractCoreModule is the base class of any module in Slicer. More...

#include <Base/QTCore/qSlicerAbstractCoreModule.h>

Inheritance diagram for qSlicerAbstractCoreModule:
Inheritance graph
[legend]

List of all members.

and not \a title.

Any object deriving from QObject must have the Q_OBJECT macro in order to have the signal/slots working and the meta-class name valid. The following properties are added to the meta-class and though are available through PythonQt. This property contains the name of the module. e.g. "Volumes", "VolumeRendering", "SampleData"... The name identifies a module and must be unique. In comparison to title, name contains only letter characters, no space/hyphen/apostrophe. The module name is set by the module factory (the registered item key string). Because name is unique, slots and functions that take a module as argument should use

typedef QObject Superclass
QString name
QString title
QStringList categories
int index
bool hidden
QString helpText
QString acknowledgementText
QStringList contributors
QString slicerWikiUrl
QStringList dependencies
QString path
bool isInstalled
QScopedPointer
< qSlicerAbstractCoreModulePrivate > 
d_ptr
class qSlicerAbstractModuleRepresentation
 qSlicerAbstractCoreModule (QObject *parent=0)
virtual ~qSlicerAbstractCoreModule ()
virtual void printAdditionalInfo ()
QString slicerWikiUrl () const
 Convenient method to return slicer wiki URL.
void initialize (vtkSlicerApplicationLogic *appLogic)
bool initialized ()
virtual QString name () const
virtual void setName (const QString &name)
virtual QString title () const =0
virtual QStringList categories () const
virtual int index () const
 Return the category index of the module.
virtual bool isHidden () const
virtual QStringList contributors () const
 Return the contributors of the module.
virtual QString helpText () const
virtual QString acknowledgementText () const
qSlicerAbstractModuleRepresentationwidgetRepresentation ()
void setAppLogic (vtkSlicerApplicationLogic *appLogic)
vtkSlicerApplicationLogicappLogic () const
Q_INVOKABLE vtkMRMLAbstractLogiclogic ()
Q_INVOKABLE vtkMRMLScenemrmlScene () const
 Return a pointer on the MRML scene.
virtual QStringList dependencies () const
QString path () const
void setPath (const QString &newPath)
bool isInstalled () const
void setInstalled (bool value)
virtual void setMRMLScene (vtkMRMLScene *)
virtual void setup ()=0
 All initialization code should be done in the setup.
virtual
qSlicerAbstractModuleRepresentation
createWidgetRepresentation ()=0
 Create and return a widget representation for the module.
virtual vtkMRMLAbstractLogiccreateLogic ()=0

Detailed Description

qSlicerAbstractCoreModule is the base class of any module in Slicer.

Core modules, Loadable modules, CLI modules derive from it. It is responsible to create the UI and the Logic: createWidgetRepresentation() and createLogic() must be reimplemented in derived classes. A Slicer module has a name and a title: The name is its UID, the title displayed to the user. When a MRML scene is set to the module, the module set the scene to the UI widget and the logic.

Definition at line 55 of file qSlicerAbstractCoreModule.h.


Member Typedef Documentation


Property Documentation

QString qSlicerAbstractCoreModule::acknowledgementText [read]

This property holds the acknowledgments for the module Credits (organization, grants, thanks...) can be given and are displayed in the acknowledgment tab in the module panel. The contributors of the module will automatically be appended when needed, don't duplicate the information in the acknowledgements. acknowledgementText() must be reimplemented for each module.

See also:
helpText, contributors

Reimplemented in qSlicerScriptedLoadableModule.

Definition at line 123 of file qSlicerAbstractCoreModule.h.

QStringList qSlicerAbstractCoreModule::categories [read]

This property holds the categories a module belongs to. It is used to organize modules in the modules menu. Sub-categories are supported by using '.' as a a separator to specify a subcategory (no depth limit), e.g.: "Filtering.Arithmetic". A category doesn't have to exist, it will be created if needed. The method categories() must be reimplemented for each module. An empty category means the module shows up at the top level. It is possible to define more than 1 category, the module will then be visible in all the listed categories

Reimplemented in qSlicerScriptedLoadableModule.

Definition at line 92 of file qSlicerAbstractCoreModule.h.

QStringList qSlicerAbstractCoreModule::contributors [read]

This property holds the authors of the module It is shown in the Acknowledgement page. If there are multiple contributors, they must be listed in the order of contribution. For each contributor, the name of the institution can succede the author: e.g. John Doe, CompanyName Inc. contributors() must be reimplemented for each module.

See also:
helpText, acknowledgementText

Reimplemented in qSlicerScriptedLoadableModule.

Definition at line 132 of file qSlicerAbstractCoreModule.h.

QStringList qSlicerAbstractCoreModule::dependencies [read]

This property holds the module name list of the module dependencies. It is used to order the loading of the modules. When setup() is called it is ensured that all the dependencies have already been setup. There is no dependency cycle check, so special care must be taken to avoid infinite loop. By default, there is no dependencies.

Reimplemented in qSlicerScriptedLoadableModule.

Definition at line 145 of file qSlicerAbstractCoreModule.h.

QString qSlicerAbstractCoreModule::helpText [read]

This property holds the help of the module. The help is displayed inside the module as a tab. helpText must be reimplemented for each module.

See also:
acknowledgement, contributors

Reimplemented in qSlicerScriptedLoadableModule.

Definition at line 114 of file qSlicerAbstractCoreModule.h.

bool qSlicerAbstractCoreModule::hidden [read]

This property holds whether the module is visible to the user. If the module is hidden, it doesn't appear in the list of modules menu. However, the module is programatically accessible. By default, modules are visible (hidden == false).

See also:
isHidden

Reimplemented in qSlicerScriptedLoadableModule.

Definition at line 108 of file qSlicerAbstractCoreModule.h.

int qSlicerAbstractCoreModule::index [read]

This property controls the index used to sort modules in the module selector's menu in the module's category. An index of 0 means the module should be first in the category, a value of 1 if the module should be second and so on. -1 means that the module should be added at the end. In case modules indexes have the same index, the alphabetical order will be used. -1 by default.

Reimplemented in qSlicerScriptedLoadableModule.

Definition at line 101 of file qSlicerAbstractCoreModule.h.

bool qSlicerAbstractCoreModule::isInstalled [read]

This property holds whether the module is loaded from an installed directory. isInstalled is set by the module factory and shouldn't be reimplemented in each module.

Definition at line 159 of file qSlicerAbstractCoreModule.h.

QString qSlicerAbstractCoreModule::name [read]

Definition at line 73 of file qSlicerAbstractCoreModule.h.

QString qSlicerAbstractCoreModule::path [read]

This property holds the path of the module if any. The path is the library (dll, so...) location on disk. path is set by the module factory and shouldn't be reimplemented in each module.

Todo:
Ideally this function should be added within the qSlicerLoadableModule.

Definition at line 153 of file qSlicerAbstractCoreModule.h.

QString qSlicerAbstractCoreModule::slicerWikiUrl [read]

This property holds the URL of the module for the Slicer wiki. It can be used in the help/ackknowledgement. : obsolete ? should be static ?

Definition at line 137 of file qSlicerAbstractCoreModule.h.

QString qSlicerAbstractCoreModule::title [read]

This property contains the title of the module. e.g. "Volumes", "Volume Rendering", "Welcome to Slicer"... title (not name) is displayed to the user in the GUI (but internally name is used to uniquely identify the module). The module title can contain any characters. title() must be overwritten for each module.

Reimplemented in qSlicerScriptedLoadableModule.

Definition at line 81 of file qSlicerAbstractCoreModule.h.


Constructor & Destructor Documentation

qSlicerAbstractCoreModule::qSlicerAbstractCoreModule ( QObject *  parent = 0)

Constructor Warning: If there is no parent given, make sure you delete the object. The modules can typically be instantiated before the application is initialized (module manager, iomanager...). Most of the initialization must be done in qSlicerAbstractCoreModule::setup()

virtual qSlicerAbstractCoreModule::~qSlicerAbstractCoreModule ( ) [virtual]

Member Function Documentation

virtual QString qSlicerAbstractCoreModule::acknowledgementText ( ) const [virtual]
vtkSlicerApplicationLogic* qSlicerAbstractCoreModule::appLogic ( ) const
virtual QStringList qSlicerAbstractCoreModule::categories ( ) const [virtual]

Categories the module belongs to. Categories support subcategories. Use the '.' separator to specify a subcategory (no depth limit), e.g.: "Filtering.Arithmetic". The function must be reimplemented in derived classes. Note: If a category doesn't exist, it will be created.

Reimplemented in qSlicerCLIModule, qSlicerScriptedLoadableModule, qSlicerEventBrokerModule, qSlicerROIModule, qSlicerAnnotationsModule, qSlicerCamerasModule, qSlicerColorsModule, qSlicerCropVolumeModule, qSlicerDataModule, qSlicerDoubleArraysModule, qSlicerModelsModule, qSlicerMultiVolumeRenderingModule, qSlicerReformatModule, qSlicerSceneViewsModule, qSlicerWelcomeModule, qSlicerTractographyDisplayModule, qSlicerTractographyInteractiveSeedingModule, qSlicerTransformsModule, qSlicerViewControllersModule, qSlicerVolumeRenderingModule, and qSlicerVolumesModule.

virtual QStringList qSlicerAbstractCoreModule::contributors ( ) const [virtual]
virtual vtkMRMLAbstractLogic* qSlicerAbstractCoreModule::createLogic ( ) [protected, pure virtual]
virtual qSlicerAbstractModuleRepresentation* qSlicerAbstractCoreModule::createWidgetRepresentation ( ) [protected, pure virtual]
virtual QStringList qSlicerAbstractCoreModule::dependencies ( ) const [virtual]
virtual QString qSlicerAbstractCoreModule::helpText ( ) const [virtual]
virtual int qSlicerAbstractCoreModule::index ( ) const [virtual]

Return the category index of the module.

Reimplemented in qSlicerCLIModule, and qSlicerScriptedLoadableModule.

void qSlicerAbstractCoreModule::initialize ( vtkSlicerApplicationLogic appLogic)

Initialize the module, an appLogic must be given to initialize the module

bool qSlicerAbstractCoreModule::initialized ( ) [inline]

Definition at line 180 of file qSlicerAbstractCoreModule.h.

virtual bool qSlicerAbstractCoreModule::isHidden ( ) const [virtual]

Returns true if the module should be hidden to the user. By default, modules are not hidden.

See also:
hidden

Reimplemented in qSlicerScriptedLoadableModule, qSlicerColorsModule, and qSlicerDoubleArraysModule.

bool qSlicerAbstractCoreModule::isInstalled ( ) const

Return true is this instance of the module is loaded from an installed directory

Todo:
Ideally this function should be added within the qSlicerLoadableModule.
Q_INVOKABLE vtkMRMLAbstractLogic* qSlicerAbstractCoreModule::logic ( )

This method allows to get a pointer to the module logic. If no moduleLogic already exists, one will be created calling the 'createLogic' method. A module logic is typically a vtkSlicerModuleLogic but not necessarily.

Q_INVOKABLE vtkMRMLScene* qSlicerAbstractCoreModule::mrmlScene ( ) const

Return a pointer on the MRML scene.

virtual QString qSlicerAbstractCoreModule::name ( ) const [virtual]

Set/Get the name of the module. The name is used to uniquely describe a module: name must be unique. The name is set by the module factory (the registered item key string).

QString qSlicerAbstractCoreModule::path ( ) const

Returns path if any

Todo:
Ideally this function should be added within the qSlicerLoadableModule.
virtual void qSlicerAbstractCoreModule::printAdditionalInfo ( ) [virtual]
void qSlicerAbstractCoreModule::setAppLogic ( vtkSlicerApplicationLogic appLogic)

Get/Set the application logic. It must be set.

void qSlicerAbstractCoreModule::setInstalled ( bool  value)
virtual void qSlicerAbstractCoreModule::setMRMLScene ( vtkMRMLScene ) [virtual, slot]

Set the current MRML scene to the module, it is propagated to the logic and representations if any

Reimplemented in qSlicerColorsModule.

virtual void qSlicerAbstractCoreModule::setName ( const QString &  name) [virtual]
void qSlicerAbstractCoreModule::setPath ( const QString &  newPath)
virtual void qSlicerAbstractCoreModule::setup ( ) [protected, pure virtual]
QString qSlicerAbstractCoreModule::slicerWikiUrl ( ) const [inline]

Convenient method to return slicer wiki URL.

Definition at line 175 of file qSlicerAbstractCoreModule.h.

virtual QString qSlicerAbstractCoreModule::title ( ) const [pure virtual]

Title of the module, (displayed to the user) title() must be reimplemented in derived classes.

Implemented in qSlicerCLIModule, and qSlicerScriptedLoadableModule.

qSlicerAbstractModuleRepresentation* qSlicerAbstractCoreModule::widgetRepresentation ( )

This method allows to get a pointer to the WidgetRepresentation. If no WidgetRepresentation already exists, one will be created calling 'createWidgetRepresentation' method.


Friends And Related Function Documentation

friend class qSlicerAbstractModuleRepresentation [friend]

Definition at line 272 of file qSlicerAbstractCoreModule.h.


Member Data Documentation

QScopedPointer<qSlicerAbstractCoreModulePrivate> qSlicerAbstractCoreModule::d_ptr [protected]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines