CGAL 5.0.2 - Three
|
#include <CGAL/Three/Polyhedron_demo_io_plugin_interface.h>
This class provides a base for creating a new IO plugin.
Public Member Functions | |
virtual void | init () |
Initializes the plugin This function is called in the constructor of the MainWindow. More... | |
virtual QString | name () const =0 |
Returns the name of the plugin It is used by the loading system. More... | |
virtual QString | nameFilters () const =0 |
The filters for the names of the files that can be used by the plugin. More... | |
virtual QString | saveNameFilters () const |
Returns only the filters used for saving. More... | |
virtual QString | loadNameFilters () const |
Returns only the filters used for loading. More... | |
virtual bool | canLoad (QFileInfo fileinfo) const =0 |
Specifies if the io_plugin is able to load an item or not. More... | |
virtual QList< Scene_item * > | load (QFileInfo fileinfo, bool &ok, bool add_to_scene=true)=0 |
Loads one or more item(s) from a file. More... | |
virtual bool | canSave (const Scene_item *)=0 |
Specifies if the io_plugin can save the item or not. More... | |
virtual bool | save (QFileInfo fileinfo, QList< CGAL::Three::Scene_item *> &)=0 |
Saves one or more items in the file corresponding to the path contained in fileinfo. More... | |
virtual bool | isDefaultLoader (const Scene_item *) const |
If this returns true , then the loader will be chosen as default in the list of available loaders when saving a file, which means it will be the first in the list. More... | |
virtual bool | isDefaultLoader (const QString &name) const |
If this returns true , then the loader will be chosen as default in the list of available loaders when loading a file, which means it will be the first in the list. More... | |
|
pure virtual |
Specifies if the io_plugin is able to load an item or not.
This must be overriden.
|
pure virtual |
Specifies if the io_plugin can save the item or not.
This must be overriden.
|
virtual |
Initializes the plugin This function is called in the constructor of the MainWindow.
Whatever initialization the plugin needs can be done here. Default behavior is to do nothing.
|
virtual |
If this returns true
, then the loader will be chosen as default in the list of available loaders when saving a file, which means it will be the first in the list.
|
virtual |
If this returns true
, then the loader will be chosen as default in the list of available loaders when loading a file, which means it will be the first in the list.
name | is the extension without the dot (e.g. "off" for a .off file) |
|
pure virtual |
Loads one or more item(s) from a file.
ok
is true
if the loading was successful, false
otherwise. New items will be added to the scene if add_to_scene
is true
. You don't want that when you reload an item, for example, as it will be added at some other point of the process. This must be overriden.
|
virtual |
Returns only the filters used for loading.
The default is nameFilters()
. You must override this function to change its behavior. If multiple plugins have the same load filters, only once will be kept, so be careful not to use one that already exists.
|
pure virtual |
Returns the name of the plugin It is used by the loading system.
|
pure virtual |
The filters for the names of the files that can be used by the plugin.
Example : to filter OFF files : return "OFF files (*.off)"
|
pure virtual |
Saves one or more items in the file corresponding to the path contained in fileinfo.
Returns false if error. This must be overriden.
|
virtual |
Returns only the filters used for saving.
The default is nameFilters()
. You must override this function to change its behavior.