SOFA API  014b24ea
Open source framework for multi-physics simuation
sofa::simulation::SceneLoader Class Referenceabstract

#include <SceneLoaderFactory.h>

Main class used to register scene file loaders. More...

Inheritance diagram for sofa::simulation::SceneLoader:

Detailed Description

Main class used to register scene file loaders.

It uses the Factory design pattern, where each class is registered in a map, and dynamically retrieved given the type name.Abstract interface of a scene loader


struct  Listener
 to be able to inform when a scene is loaded More...

Static Protected Attributes

static Listeners s_listeners

Public Member Functions

virtual bool canLoadFileName (const char *filename)
 Pre-loading check. More...
virtual bool canWriteFileName (const char *filename)
 Pre-saving check. More...
virtual bool canLoadFileExtension (const char *extension)=0
virtual bool canWriteFileExtension (const char *)
sofa::simulation::Node::SPtr load (const std::string &filename, bool reload=false, const std::vector< std::string > &sceneArgs=std::vector< std::string >(0))
 load the file More...
virtual sofa::simulation::Node::SPtr doLoad (const std::string &filename, const std::vector< std::string > &sceneArgs)=0
virtual void write (sofa::simulation::Node *, const char *)
 write scene graph in the file More...
virtual std::string getFileTypeDesc ()=0
 get the file type description More...
virtual void getExtensionList (ExtensionList *list)=0
 get the list of file extensions More...

Static Public Member Functions

static void addListener (Listener *l)
 adding a listener More...
static void removeListener (Listener *l)
 removing a listener More...

Static Protected Member Functions

static void notifyLoadingSceneBefore ()
static void notifyReloadingSceneBefore ()
static void notifyLoadingSceneAfter (sofa::simulation::Node::SPtr node)
static void notifyReloadingSceneAfter (sofa::simulation::Node::SPtr node)

Attribute details

SceneLoader::Listeners sofa::simulation::SceneLoader::s_listeners

Function details

static void sofa::simulation::SceneLoader::addListener ( Listener l)

adding a listener

virtual bool sofa::simulation::SceneLoader::canLoadFileExtension ( const char *  extension)
pure virtual
virtual bool sofa::simulation::SceneLoader::canLoadFileName ( const char *  filename)

Pre-loading check.

virtual bool sofa::simulation::SceneLoader::canWriteFileExtension ( const char *  )
virtual bool sofa::simulation::SceneLoader::canWriteFileName ( const char *  filename)

Pre-saving check.

virtual sofa::simulation::Node::SPtr sofa::simulation::SceneLoader::doLoad ( const std::string &  filename,
const std::vector< std::string > &  sceneArgs 
pure virtual
virtual void sofa::simulation::SceneLoader::getExtensionList ( ExtensionList list)
pure virtual

get the list of file extensions

Implemented in sofa::simulation::SceneLoaderXML, and sofa::simulation::SceneLoaderPHP.

virtual std::string sofa::simulation::SceneLoader::getFileTypeDesc ( )
pure virtual

get the file type description

Implemented in sofa::simulation::SceneLoaderXML, and sofa::simulation::SceneLoaderPHP.

sofa::simulation::Node::SPtr sofa::simulation::SceneLoader::load ( const std::string &  filename,
bool  reload = false,
const std::vector< std::string > &  sceneArgs = std::vector<std::string>(0) 

load the file

static void sofa::simulation::SceneLoader::notifyLoadingSceneAfter ( sofa::simulation::Node::SPtr  node)
static void sofa::simulation::SceneLoader::notifyLoadingSceneBefore ( )
static void sofa::simulation::SceneLoader::notifyReloadingSceneAfter ( sofa::simulation::Node::SPtr  node)
static void sofa::simulation::SceneLoader::notifyReloadingSceneBefore ( )
static void sofa::simulation::SceneLoader::removeListener ( Listener l)

removing a listener

virtual void sofa::simulation::SceneLoader::write ( sofa::simulation::Node ,
const char *   

write scene graph in the file

Reimplemented in sofa::simulation::SceneLoaderXML.