PluginLoader Class Reference
Interface for the different format handled by the converter program. (Will be pluginable).
More...
#include <plugin_loader.h>
|
Public Member Functions |
virtual void | run ()=0 |
| Effectively load the mesh from path.
|
void | setPath (const std::string &path) |
| Set the path of the file to load.
|
std::string | getPath () const |
| get the path to the current loaded file.
|
std::string | getExt () |
| get the extensions handled by this plugin loader
|
MeshNS::SimpleMesh * | getResult () const |
Protected Member Functions |
| PluginLoader (const std::string &ext) |
| Construct the class base.
|
Protected Attributes |
std::string | _path |
MeshNS::SimpleMesh * | _result |
| _result should contain what has been loaded
|
std::string | _ext |
Detailed Description
Interface for the different format handled by the converter program. (Will be pluginable).
- Todo:
- Really make this a plugin (Already have the code, just insert...).
PluginLoqder is the base class that handle the input format for the converter. Each format should inherit from this class and implement the run method virtual method which load the mesh This class is used like that :
- instanciate the loader corresponding to the format, LoaderOFF off;
- set the path, off.setPath(path);
- call the run method, off.run()
- get the Result, result= off.getResult
- Warning:
- Please note that the result is of the form MeshNS::SimpleMesh
User of the loader has to delete the result.
- See also:
- simplemesh.h
LoaderOFF.h
LoaderOBJ.h
Constructor & Destructor Documentation
PluginLoader::PluginLoader |
( |
const std::string & |
ext |
) |
[inline, protected] |
Construct the class base.
when a derived class calls the constructor, it should set the extensions it handles
- Todo:
- add support for multiple extension
Member Function Documentation
virtual void PluginLoader::run |
( |
|
) |
[pure virtual] |
Effectively load the mesh from path.
- Precondition:
- setPath has been called to set the file to load
- Postcondition:
- Mesh is loaded into _result if loading is ok, else _result is NULL
Implemented in LoaderObj, and LoaderOFF.
void PluginLoader::setPath |
( |
const std::string & |
path |
) |
[inline] |
Set the path of the file to load.
- Parameters:
-
- Todo:
- : use boost::filesystem
std::string PluginLoader::getPath |
( |
|
) |
const [inline] |
get the path to the current loaded file.
- Returns:
- the current file.
std::string PluginLoader::getExt |
( |
|
) |
[inline] |
get the extensions handled by this plugin loader
- Returns:
- the extension supported by the plugin The different loader should inidicate which extensions are supported in the constructor
brief Return the mesh.
- Precondition:
- run has been called
- Warning:
- mesh has to be deleted by the callers
- Returns:
- A SimpleMesh if the mesh has been correctly loaded, NULL if it failed.
The documentation for this class was generated from the following file:
- /media/disk/disc/these/mine/meshseqsegenv/MSSEnv/lib/reader/plugin_loader.h