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. 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... | |
Private Attributes | |
QString | dynamicLibraryFileName |
the shared lib (.so, .dll or .dylib) used to instantiate the ComponentExtension subclass instance More... | |
const QMetaObject * | managedMetaObject |
static meta object of the viewer class managed by this extension More... | |
QTranslator * | translator |
Provide internationalization support for text output. 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 |
|
override |
destructor
|
pure virtual |
returns the viewer extension small description (to be overriden in the derived class)
Implemented in InteractiveSliceViewerExtension, ActionViewerExtension, ExplorerExtension, FrameExplorerExtension, InteractiveGeometryViewerExtension, MedicalImageViewerExtension, PropertyExplorerExtension, BitmapViewerExtension, and ActionStateViewerExtension.
QString camitk::ViewerExtension::getLocation | ( | ) | const |
get the file path (location of the .dll/.so/.dylib) of this plugin
Referenced by ViewerExtension().
|
pure virtual |
returns the viewer extension name (to be overriden in the derived class)
Implemented in InteractiveSliceViewerExtension, ActionViewerExtension, ExplorerExtension, FrameExplorerExtension, InteractiveGeometryViewerExtension, MedicalImageViewerExtension, PropertyExplorerExtension, BitmapViewerExtension, and ActionStateViewerExtension.
Referenced by camitk::Application::registerViewer(), and setManagedMetaObject().
Viewer * camitk::ViewerExtension::getNewInstance | ( | QString | name | ) |
factory: create a new viewer instance and register it
Referenced by camitk::Application::getNewViewer().
QString camitk::ViewerExtension::getViewerClassName | ( | ) |
get the class name of the viewer managed by this extension
Referenced by setManagedMetaObject().
const ViewerList & camitk::ViewerExtension::getViewers | ( | ) |
get the list of viewer instances registered by this extension
Referenced by 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 InteractiveSliceViewerExtension, ActionViewerExtension, ExplorerExtension, FrameExplorerExtension, InteractiveGeometryViewerExtension, MedicalImageViewerExtension, PropertyExplorerExtension, BitmapViewerExtension, and ActionStateViewerExtension.
void camitk::ViewerExtension::initResources | ( | ) |
Load, for the selected langage (asked to the Application), the associated .qm file.
Referenced by ActionStateMachine::ActionStateMachine().
|
protected |
register an viewer instance The first call will also register the managed viewer class name in viewerClassName and its static meta object in
void camitk::ViewerExtension::setLocation | ( | const QString | loc | ) |
set the file path (once loaded as a dynamic library) = where this extension was loaded
|
protected |
The first time this method is called, it sets the static meta object.
References CAMITK_ERROR, getName(), camitk::Viewer::getName(), and getViewerClassName().
|
private |
the shared lib (.so, .dll or .dylib) used to instantiate the ComponentExtension subclass instance
|
private |
static meta object of the viewer class managed by this extension
|
private |
Provide internationalization support for text output.
|
protected |
the list of viewers