This class describes what is a generic Action extension. More...
#include <ViewerExtension.h>
Public Member Functions | |
virtual QString | getDescription ()=0 |
returns the viewer extension small description (to be overriden in the derived class) More... | |
QString | getLocation () const |
get the file path (location of the .dll/.so/.dylib) of this plugin More... | |
virtual QString | getName ()=0 |
returns the viewer extension name (to be overriden in the derived class) More... | |
Viewer * | getNewInstance (QString name) |
factory: create a new viewer instance and register it More... | |
QString | getViewerClassName () |
get the class name of the viewer managed by this extension More... | |
const ViewerList & | getViewers () |
get the list of viewer instances registered by this extension More... | |
virtual void | init ()=0 |
this method should just call registerNewViewer(MyViewer) for any MyViewer class you need to register by this extension More... | |
void | initResources () |
Load, for the selected langage (asked to the Application), the associated .qm file. More... | |
void | setLocation (const QString loc) |
set the file path (once loaded as a dynamic library) = where this extension was loaded More... | |
~ViewerExtension () override | |
destructor More... | |
Protected Member Functions | |
bool | registerViewer (Viewer *) |
register an viewer instance The first call will also register the managed viewer class name in viewerClassName and its static meta object in More... | |
void | setManagedMetaObject (const QMetaObject *) |
The first time this method is called, it sets the static meta object. More... | |
ViewerExtension () | |
constructor More... | |
Protected Attributes | |
ViewerList | viewers |
the list of viewers More... | |
This class describes what is a generic Action extension.
To add a ActionExtension to CamiTK core, write a new class that inherits from this class.
The following methods HAVE to be redefined in your subclass:
ViewerExtension implements a specific Factory pattern (see getNewInstance())
Each time a viewer is registered, call setManagedMetaObject (the fist registered viewer will register the managed class meta object that can be reused later on to instantiate new viewer).
Use registerDefaultViewer() or registerNewViewer() in your inherited viewer extension to register and instantiate new viewers.
Using registerDefaultViewer() registers the class and instantiate a default viewer of the same name.
This is important as this name will be shown in the GUI. Therefore:
will instantiate the default FooBarViewer viewer called "Foo Bar Viewer".
To get the default FooBarViewer instance, use Application::getViewer("Foo Bar Viewer").
|
protected |
constructor
|
override |
destructor
References viewers.
|
pure virtual |
returns the viewer extension small description (to be overriden in the derived class)
Implemented in PropertyExplorerExtension, MedicalImageViewerExtension, InteractiveSliceViewerExtension, InteractiveGeometryViewerExtension, FrameExplorerExtension, ExplorerExtension, BitmapViewerExtension, ActionViewerExtension, and ActionStateViewerExtension.
QString camitk::ViewerExtension::getLocation | ( | ) | const |
get the file path (location of the .dll/.so/.dylib) of this plugin
Referenced by camitk::Core::getConfig(), and initResources().
|
pure virtual |
returns the viewer extension name (to be overriden in the derived class)
Implemented in PropertyExplorerExtension, MedicalImageViewerExtension, InteractiveSliceViewerExtension, InteractiveGeometryViewerExtension, FrameExplorerExtension, ExplorerExtension, BitmapViewerExtension, ActionViewerExtension, and ActionStateViewerExtension.
Referenced by camitk::Core::getConfig(), camitk::ExtensionManager::loadExtension(), camitk::Application::registerViewer(), and registerViewer().
Viewer * camitk::ViewerExtension::getNewInstance | ( | QString | name | ) |
factory: create a new viewer instance and register it
References CAMITK_ERROR, CAMITK_INFO, getViewerClassName(), registerViewer(), and viewers.
Referenced by camitk::Application::getNewViewer().
QString camitk::ViewerExtension::getViewerClassName | ( | ) |
get the class name of the viewer managed by this extension
Referenced by getNewInstance(), camitk::ExtensionManager::loadExtension(), and registerViewer().
const ViewerList & camitk::ViewerExtension::getViewers | ( | ) |
get the list of viewer instances registered by this extension
References viewers.
Referenced by camitk::Core::getConfig(), camitk::Application::registerAllViewers(), and camitk::Application::unregisterAllViewers().
|
pure virtual |
this method should just call registerNewViewer(MyViewer) for any MyViewer class you need to register by this extension
Implemented in PropertyExplorerExtension, MedicalImageViewerExtension, InteractiveSliceViewerExtension, InteractiveGeometryViewerExtension, FrameExplorerExtension, ExplorerExtension, BitmapViewerExtension, ActionViewerExtension, and ActionStateViewerExtension.
Referenced by camitk::ExtensionManager::loadExtension().
void camitk::ViewerExtension::initResources | ( | ) |
Load, for the selected langage (asked to the Application), the associated .qm file.
References CAMITK_INFO, getLocation(), and camitk::Application::getSelectedLanguage().
Referenced by ActionStateMachine::ActionStateMachine(), and camitk::ExtensionManager::loadExtension().
|
protected |
register an viewer instance The first call will also register the managed viewer class name in viewerClassName and its static meta object in
References CAMITK_ERROR, camitk::Viewer::getName(), getName(), getViewerClassName(), and viewers.
Referenced by getNewInstance().
void camitk::ViewerExtension::setLocation | ( | const QString | loc | ) |
set the file path (once loaded as a dynamic library) = where this extension was loaded
Referenced by camitk::ExtensionManager::loadExtension().
|
protected |
The first time this method is called, it sets the static meta object.
|
protected |
the list of viewers
Referenced by getNewInstance(), getViewers(), registerViewer(), and ~ViewerExtension().