|
virtual | ~ComponentExtension () |
| protected destructor, More...
|
|
|
|
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 throw (AbortException) |
| 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...
|
|
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:
- getName
- getDescription
- getFileExtensions
- open
The following methods can be redefined:
- save: saving from a Component to one of the managed format
- hasDataDirectory: for directory type extension
virtual bool camitk::ComponentExtension::save |
( |
Component * |
component) | |
const |
|
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 successfuly (this will reset the modification flag: component will not need to be saved prior to close).
- Note
- this will enable to export to one of the managed filename extension at the CamiTK level (i.e. if you write this method, any compatible component can be saved to your managed format!
-
this method is called by CamiTK only if the filename extension is managed by this component extension. There should be no need to check it in the method.
The default behaviour is a "not implemented yet" message box.
- Returns
- false if the operation was not performed properly or not performed at all.