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. 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... | |
Private Attributes | |
bool | autoload |
the autoload state More... | |
QString | dynamicLibraryFileName |
the shared lib (.so, .dll or .dylib) used to instantiate the ComponentExtension subclass instance 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::ImageComponentExtension, camitk::MeshComponentExtension, VRMLComponentExtension, MshExtension, MMLComponentExtension, PMLComponentExtension, ItkImageComponentExtension, ObjExtension, OffExtension, VtkMeshComponentExtension, StlExtension, VtkImageComponentExtension, 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 VRMLComponentExtension, MshExtension, MMLComponentExtension, PMLComponentExtension, ItkImageComponentExtension, ObjExtension, OffExtension, StlExtension, VtkMeshComponentExtension, VtkImageComponentExtension, and DicomComponentExtension.
Referenced by OpenAction::apply(), SaveAsAction::apply(), camitk::SettingsDialog::editSettings(), main(), and OpenFile::selectFile().
|
inline |
get the file path (location of the .dll/.so/.dylib) of this plugin
Referenced by camitk::SettingsDialog::editSettings(), and camitk::SettingsDialog::updateComponentExtensionList().
|
pure virtual |
Implemented in camitk::ImageComponentExtension, camitk::MeshComponentExtension, VRMLComponentExtension, MshExtension, MMLComponentExtension, PMLComponentExtension, ItkImageComponentExtension, ObjExtension, OffExtension, VtkMeshComponentExtension, StlExtension, VtkImageComponentExtension, and DicomComponentExtension.
Referenced by OpenAction::apply(), SaveAsAction::apply(), camitk::SettingsDialog::editSettings(), main(), camitk::Application::open(), camitk::Application::openDirectory(), OpenFile::selectFile(), and camitk::SettingsDialog::updateComponentExtensionList().
|
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.
void camitk::ComponentExtension::initResources | ( | ) |
Load, for the selected langage (asked to the Application), the associated .qm file.
|
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::ImageComponentExtension, camitk::MeshComponentExtension, VRMLComponentExtension, MMLComponentExtension, PMLComponentExtension, MshExtension, ItkImageComponentExtension, ObjExtension, OffExtension, StlExtension, VtkImageComponentExtension, VtkMeshComponentExtension, 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. It is advised to call component->setModified(false) when the saving has been performed successfully (this will reset the modification flag: component will not need to be saved prior to close).
The default behaviour is a "not implemented yet" message box.
Reimplemented in MshExtension, MMLComponentExtension, PMLComponentExtension, OffExtension, StlExtension, ObjExtension, VRMLComponentExtension, ItkImageComponentExtension, VtkImageComponentExtension, VtkMeshComponentExtension, and DicomComponentExtension.
Referenced by MMLComponentExtension::save(), and camitk::Application::save().
|
inline |
set the file path (once loaded as a dynamic library)
|
private |
the autoload state
|
private |
the shared lib (.so, .dll or .dylib) used to instantiate the ComponentExtension subclass instance