This class describes what is a generic Component extension. More...
#include <ComponentExtension.h>
Public Member Functions | |
~ComponentExtension () override=default | |
protected destructor, More... | |
ComponentExtension plugin interface methods | |
get the plugin name | |
virtual QString | getName () const =0 |
virtual QString | getDescription () const =0 |
get the plugin description More... | |
virtual QStringList | getFileExtensions () const =0 |
get the list of managed extensions (each file with an extension in the list can be loaded by this Component) More... | |
virtual Component * | open (const QString &)=0 |
get a new instance from data stored in a file (this is the most important method to redefine in your subclass) More... | |
virtual bool | save (Component *component) const |
save a given Component (does not have to be top-level) into one of the currently managed format (check the component QFileInfo(component->getFileName()).completeSuffix(). More... | |
virtual bool | hasDataDirectory () const |
return true if this component manages directory instead of individual files (e.g. Dicom series are stored in directories, not files) More... | |
QString | getLocation () const |
get the file path (location of the .dll/.so/.dylib) of this plugin More... | |
void | setLocation (const QString loc) |
set the file path (once loaded as a dynamic library) More... | |
void | initResources () |
Load, for the selected langage (asked to the Application), the associated .qm file. More... | |
Protected Member Functions | |
ComponentExtension () | |
protected constructor, More... | |
This class describes what is a generic Component extension.
To add a ComponentExtension to CamiTK core, write a new class that inherits from this class.
There are two types of component extension: the classical one manages (mime type) file extension, the other one manages all files in a given directory (e.g. Dicom images). For the latter you have to redefine hasDataDirectory().
The following methods HAVE to be redefined in your subclass:
The following methods can be redefined:
|
protected |
protected constructor,
|
overridedefault |
protected destructor,
|
pure virtual |
get the plugin description
Implemented in camitk::MeshComponentExtension, camitk::ImageComponentExtension, WorkspaceExtension, VtkMeshComponentExtension, VtkImageComponentExtension, VRMLComponentExtension, StlExtension, OffExtension, ObjExtension, MshExtension, PMLComponentExtension, MMLComponentExtension, ItkImageComponentExtension, and DicomComponentExtension.
Referenced by main().
|
pure virtual |
get the list of managed extensions (each file with an extension in the list can be loaded by this Component)
Implemented in WorkspaceExtension, VtkMeshComponentExtension, VtkImageComponentExtension, VRMLComponentExtension, StlExtension, OffExtension, ObjExtension, MshExtension, PMLComponentExtension, MMLComponentExtension, ItkImageComponentExtension, and DicomComponentExtension.
Referenced by OpenAction::apply(), SaveAsAction::apply(), camitk::Core::getConfig(), camitk::ExtensionManager::loadExtension(), main(), and OpenFile::selectFile().
|
inline |
get the file path (location of the .dll/.so/.dylib) of this plugin
Referenced by camitk::Core::getConfig(), initResources(), camitk::ExtensionManager::loadExtension(), and camitk::ExtensionManager::unloadComponentExtension().
|
pure virtual |
Implemented in camitk::MeshComponentExtension, camitk::ImageComponentExtension, WorkspaceExtension, VtkMeshComponentExtension, VtkImageComponentExtension, VRMLComponentExtension, StlExtension, OffExtension, ObjExtension, MshExtension, PMLComponentExtension, MMLComponentExtension, ItkImageComponentExtension, and DicomComponentExtension.
Referenced by OpenAction::apply(), SaveAsAction::apply(), camitk::Core::getConfig(), camitk::ExtensionManager::loadExtension(), main(), camitk::Application::open(), camitk::Application::openDirectory(), save(), and OpenFile::selectFile().
|
inlinevirtual |
return true if this component manages directory instead of individual files (e.g. Dicom series are stored in directories, not files)
Reimplemented in DicomComponentExtension.
Referenced by camitk::ExtensionManager::loadExtension().
void camitk::ComponentExtension::initResources | ( | ) |
Load, for the selected langage (asked to the Application), the associated .qm file.
References CAMITK_INFO, getLocation(), and camitk::Application::getSelectedLanguage().
Referenced by camitk::ExtensionManager::loadExtension().
|
pure virtual |
get a new instance from data stored in a file (this is the most important method to redefine in your subclass)
This method may throw an AbortException if a problem occurs.
Implemented in camitk::MeshComponentExtension, camitk::ImageComponentExtension, WorkspaceExtension, VtkMeshComponentExtension, VtkImageComponentExtension, VRMLComponentExtension, StlExtension, OffExtension, ObjExtension, MshExtension, PMLComponentExtension, MMLComponentExtension, ItkImageComponentExtension, and DicomComponentExtension.
Referenced by camitk::Application::open(), and camitk::Application::openDirectory().
|
virtual |
save a given Component (does not have to be top-level) into one of the currently managed format (check the component QFileInfo(component->getFileName()).completeSuffix().
Redefine this method to extract all needed data/information from the Geometry or BitMap representation in order to export a given component to one of the file extension managed by this component extension.
The default behaviour is a "not implemented yet" message box.
Reimplemented in WorkspaceExtension, StlExtension, OffExtension, ObjExtension, MshExtension, PMLComponentExtension, MMLComponentExtension, VtkMeshComponentExtension, VtkImageComponentExtension, VRMLComponentExtension, ItkImageComponentExtension, and DicomComponentExtension.
References CAMITK_WARNING, camitk::Component::getFileName(), getName(), and camitk::Component::getName().
Referenced by MMLComponentExtension::save(), and camitk::Application::save().
|
inline |
set the file path (once loaded as a dynamic library)
Referenced by camitk::ExtensionManager::loadExtension().