SOFA API  1a4bb3e7
Open source framework for multi-physics simuation
sofa::simulation::SceneLoaderXML Class Reference

#include <SceneLoaderXML.h>

Inheritance diagram for sofa::simulation::SceneLoaderXML:

Static Public Attributes

static bool loadSucceed = true
 

Public Member Functions

bool canLoadFileExtension (const char *extension) override
 Pre-loading check. More...
 
bool canWriteFileExtension (const char *extension) override
 Pre-saving check. More...
 
virtual sofa::simulation::NodeSPtr doLoad (const std::string &filename, const std::vector< std::string > &sceneArgs) override
 load the file More...
 
void write (sofa::simulation::Node *node, const char *filename) override
 write the file More...
 
NodeSPtr doLoadFromMemory (const char *filename, const char *data)
 load a scene from memory (typically : an xml into a string) More...
 
virtual std::string getFileTypeDesc () override
 get the file type description More...
 
void getExtensionList (ExtensionList *list) override
 get the list of file extensions More...
 
bool syntaxForAddingRequiredPlugin (const std::string &pluginName, const std::vector< std::string > &listComponents, std::ostream &ss, sofa::simulation::Node *nodeWhereAdded) override
 
- Public Member Functions inherited from sofa::simulation::SceneLoader
virtual bool canLoadFileName (const char *filename)
 Pre-loading check. More...
 
virtual bool canWriteFileName (const char *filename)
 Pre-saving check. More...
 
sofa::simulation::NodeSPtr load (const std::string &filename, bool reload=false, const std::vector< std::string > &sceneArgs=std::vector< std::string >(0))
 load the file More...
 

Static Public Member Functions

static NodeSPtr processXML (xml::BaseElement *xml, const char *filename)
 generic function to process xml tree (after loading the xml structure) More...
 
static NodeSPtr loadFromMemory (const char *filename, const char *data)
 load a scene from memory (typically : an xml into a string) More...
 
- Static Public Member Functions inherited from sofa::simulation::SceneLoader
static void addListener (Listener *l)
 adding a listener More...
 
static void removeListener (Listener *l)
 removing a listener More...
 

Additional Inherited Members

- Static Protected Attributes inherited from sofa::simulation::SceneLoader
static Listeners s_listeners
 
- Static Protected Member Functions inherited from sofa::simulation::SceneLoader
static void notifyLoadingSceneBefore (SceneLoader *sceneLoader)
 
static void notifyReloadingSceneBefore (SceneLoader *sceneLoader)
 
static void notifyLoadingSceneAfter (sofa::simulation::NodeSPtr node, SceneLoader *sceneLoader)
 
static void notifyReloadingSceneAfter (sofa::simulation::NodeSPtr node, SceneLoader *sceneLoader)
 

Attribute details

◆ loadSucceed

bool sofa::simulation::SceneLoaderXML::loadSucceed = true
static

Function details

◆ canLoadFileExtension()

bool sofa::simulation::SceneLoaderXML::canLoadFileExtension ( const char extension)
overridevirtual

Pre-loading check.

Implements sofa::simulation::SceneLoader.

◆ canWriteFileExtension()

bool sofa::simulation::SceneLoaderXML::canWriteFileExtension ( const char extension)
overridevirtual

Pre-saving check.

Reimplemented from sofa::simulation::SceneLoader.

◆ doLoad()

sofa::simulation::Node::SPtr sofa::simulation::SceneLoaderXML::doLoad ( const std::string &  filename,
const std::vector< std::string > &  sceneArgs 
)
overridevirtual

load the file

Implements sofa::simulation::SceneLoader.

◆ doLoadFromMemory()

NodeSPtr sofa::simulation::SceneLoaderXML::doLoadFromMemory ( const char filename,
const char data 
)

load a scene from memory (typically : an xml into a string)

◆ getExtensionList()

void sofa::simulation::SceneLoaderXML::getExtensionList ( ExtensionList list)
overridevirtual

get the list of file extensions

Implements sofa::simulation::SceneLoader.

◆ getFileTypeDesc()

std::string sofa::simulation::SceneLoaderXML::getFileTypeDesc ( )
overridevirtual

get the file type description

Implements sofa::simulation::SceneLoader.

◆ loadFromMemory()

Node::SPtr sofa::simulation::SceneLoaderXML::loadFromMemory ( const char filename,
const char data 
)
static

load a scene from memory (typically : an xml into a string)

Load from a string in memory.

◆ processXML()

Node::SPtr sofa::simulation::SceneLoaderXML::processXML ( xml::BaseElement xml,
const char filename 
)
static

generic function to process xml tree (after loading the xml structure)

Load a scene from a file.

◆ syntaxForAddingRequiredPlugin()

bool sofa::simulation::SceneLoaderXML::syntaxForAddingRequiredPlugin ( const std::string &  pluginName,
const std::vector< std::string > &  listComponents,
std::ostream &  ss,
sofa::simulation::Node nodeWhereAdded 
)
overridevirtual

Write into a ostream the syntax to add a RequiredPlugin component in the scene file. The syntax depends on the file format, hence the SceneLoader. The function returns true if the derived SceneLoader implements this function, false otherwise.

Reimplemented from sofa::simulation::SceneLoader.

◆ write()

void sofa::simulation::SceneLoaderXML::write ( sofa::simulation::Node node,
const char filename 
)
overridevirtual

write the file

Reimplemented from sofa::simulation::SceneLoader.