Computer Assited Medical Intervention Tool Kit
version 4.1
|
This class describes what is a generic Component extension. More...
#include <ComponentExtension.h>
Inherits QObject.
Inherited by camitk::ImageAcquisitionComponentExtension, camitk::ImageComponentExtension, camitk::MeshComponentExtension, DicomComponentExtension, and MMLComponentExtension.
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 instanciate 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,
References autoload.
|
overridedefault |
protected destructor,
|
pure virtual |
get the plugin description
Implemented in DicomComponentExtension, camitk::ImageComponentExtension, camitk::MeshComponentExtension, VRMLComponentExtension, MshExtension, MMLComponentExtension, PMLComponentExtension, ItkImageComponentExtension, ObjExtension, OffExtension, VtkMeshComponentExtension, StlExtension, and VtkImageComponentExtension.
Referenced by main(), MMLComponentExtension::MMLComponentExtension(), and camitk::SettingsDialog::on_componentExtensionList_cellClicked().
|
pure virtual |
get the list of managed extensions (each file with an extension in the list can be loaded by this Component)
Implemented in DicomComponentExtension, VRMLComponentExtension, MshExtension, MMLComponentExtension, PMLComponentExtension, ItkImageComponentExtension, ObjExtension, OffExtension, StlExtension, VtkMeshComponentExtension, and VtkImageComponentExtension.
Referenced by OpenAction::apply(), SaveAsAction::apply(), camitk::Core::getConfig(), camitk::ExtensionManager::loadExtension(), main(), MMLComponentExtension::MMLComponentExtension(), OpenFile::selectFile(), and camitk::SettingsDialog::updateComponentExtensionList().
|
inline |
get the file path (location of the .dll/.so/.dylib) of this plugin
Referenced by camitk::Core::getConfig(), initResources(), camitk::ExtensionManager::loadExtension(), camitk::SettingsDialog::on_componentExtensionList_cellClicked(), camitk::ExtensionManager::unloadComponentExtension(), and camitk::SettingsDialog::updateComponentExtensionList().
|
pure virtual |
Implemented in DicomComponentExtension, camitk::ImageComponentExtension, camitk::MeshComponentExtension, VRMLComponentExtension, MshExtension, MMLComponentExtension, PMLComponentExtension, ItkImageComponentExtension, ObjExtension, OffExtension, VtkMeshComponentExtension, StlExtension, and VtkImageComponentExtension.
Referenced by OpenAction::apply(), SaveAsAction::apply(), camitk::ExtensionManager::componentExtensionLessThan(), camitk::CamiTKLogger::getCamiTKAPIInformation(), camitk::Core::getConfig(), camitk::ExtensionManager::loadExtension(), main(), MMLComponentExtension::MMLComponentExtension(), camitk::Application::open(), camitk::Application::openDirectory(), save(), 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.
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 DicomComponentExtension, VRMLComponentExtension, camitk::ImageComponentExtension, camitk::MeshComponentExtension, MMLComponentExtension, PMLComponentExtension, MshExtension, ItkImageComponentExtension, ObjExtension, OffExtension, StlExtension, VtkImageComponentExtension, and VtkMeshComponentExtension.
Referenced by MMLComponentExtension::MMLComponentExtension(), 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 DicomComponentExtension, VRMLComponentExtension, MshExtension, MMLComponentExtension, PMLComponentExtension, ItkImageComponentExtension, OffExtension, StlExtension, VtkImageComponentExtension, VtkMeshComponentExtension, and ObjExtension.
References CAMITK_WARNING, camitk::Component::getFileName(), getName(), and camitk::Component::getName().
Referenced by MMLComponentExtension::MMLComponentExtension(), and MMLComponentExtension::save().
|
inline |
set the file path (once loaded as a dynamic library)
Referenced by camitk::ExtensionManager::loadExtension().
|
private |
the autoload state
Referenced by ComponentExtension().
|
private |
the shared lib (.so, .dll or .dylib) used to instanciate the ComponentExtension subclass instance