PluginLoader Class Reference

Interface for the different format handled by the converter program. (Will be pluginable). More...

#include <plugin_loader.h>

Inheritance diagram for PluginLoader:

Inheritance graph
[legend]
Collaboration diagram for PluginLoader:

Collaboration graph
[legend]

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::SimpleMeshgetResult () 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 :
  1. instanciate the loader corresponding to the format, LoaderOFF off;
  2. set the path, off.setPath(path);
  3. call the run method, off.run()
  4. 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:
path : path of the file
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

MeshNS::SimpleMesh* PluginLoader::getResult (  )  const [inline]

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:

Generated on Fri Jan 16 13:00:19 2009 by  doxygen 1.5.5