Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   Related Pages  

sglModelLoader Class Reference

#include <sglModelLoader.hpp>

Inheritance diagram for sglModelLoader::

sglDataLoader List of all members.

Public Types

typedef sglNode* (* loaderFunc )(const string &, unsigned int)
typedef bool (* callbackFunction )(sglNode *node, void *loaderNode, string &function, void *userData)
enum  ModeEnum {
  eNONE = 0x00,
  eSTRIPIFY = 0x01,
  eCOMPUTE_FACETED_NORMALS = 0x02,
  eCOMPUTE_SMOOTH_NORMALS = 0x04
}

Public Methods

virtual ~sglModelLoader ()=0

Static Public Methods

sglNodeloadModel (const string &filepath, unsigned int mode)
void registerModelLoader (const string &extension, loaderFunc model_loader_func)
loaderFunc getModelLoader (const string &extension)
void registerCallback (const string &extension, callbackFunction callback_func, void *userData)
callbackFunction getCallback (const string &extension, void **ud)
void registerOptionString (const string &extension, const string &options)
string getOptionString (const string &extension)

Protected Methods

 sglModelLoader ()
 sglModelLoader (const sglModelLoader &)
sglModelLoader& operator= (const sglModelLoader &)

Detailed Description

Abstract base class for 3D models.

Definition at line 40 of file sglModelLoader.hpp.


Member Typedef Documentation

typedef sglNode *(* sglModelLoader::loaderFunc)(const string &, unsigned int)
 

The prototype for loader functions.

typedef bool(* sglModelLoader::callbackFunction)(sglNode *node, void *loaderNode, string &function, void *userData)
 

The prototype for callback functions.


Member Enumeration Documentation

enum sglModelLoader::ModeEnum
 

Valid loader mode bit flags.

Definition at line 44 of file sglModelLoader.hpp.


Constructor & Destructor Documentation

sglModelLoader::~sglModelLoader ( ) [pure virtual]
 

Destructor.


Member Function Documentation

sglNode* sglModelLoader::loadModel ( const string & filepath,
unsigned int mode ) [static]
 

Load the given model file using whatever loader has been registered for files of that type.

Parameters:
filepath   the full pathname of the file to load
Returns:
NULL on failure, otherwise a pointer to the root node for the model subtree (note, all memory allocated for this model will be automatically freed when the root note is destructed)

void sglModelLoader::registerModelLoader ( const string & extension,
loaderFunc model_loader_func ) [static]
 

Register a model function pointer and the extension it supports. Note that a single function can support multiple extensions. Registering an extension a second time will replace the existing entry.

Parameters:
extension   extension string that the function supports.
model_loader_func   pointer to function supporting the extension

loaderFunc sglModelLoader::getModelLoader ( const string & extension ) [static]
 

Get the registered model loader function pointer based on extension.

Parameters:
extension   extension to search on.
Returns:
function pointer, or NULL if not found

void sglModelLoader::registerCallback ( const string & extension,
callbackFunction callback_func,
void * userData ) [static]
 

Register a callback function pointer and the extension it is for. Applications should use this function to register callbacks for the extensions they are interested in. Registering an extension a second time will replace the existing entry.

Parameters:
extension   extension string that the function supports.
callback_func   pointer to function supporting the extension.
userData   user data to pass to the callback when executed.

callbackFunction sglModelLoader::getCallback ( const string & extension,
void ** ud ) [static]
 

Get the registered callback function pointer based on extension. Model loaders should use this function to retrieve the callback for their extension.

Parameters:
extension   extension to search on.
ud   pointer to void pointer to receive the userData
Returns:
function pointer, or NULL if not found

void sglModelLoader::registerOptionString ( const string & extension,
const string & options ) [static]
 

Register a loader option string, and the extension it is for. The application should use this function to register an option string for individual model loaders. Registering an extension a second time will replace the existing entry.

Parameters:
extension   extension that the option string is for.
options   the loader option string

string sglModelLoader::getOptionString ( const string & extension ) [static]
 

Get the option string for an extension. Model loaders should use this function to determine if an option string has been registered for their extension.

Parameters:
extension   extension to search on.
Returns:
the option string for this extension, or a string containing NONE if no options have been registered.


The documentation for this class was generated from the following file:
Generated at Mon Jul 1 18:00:08 2002 for SGL by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001