Mitsuba Renderer  0.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
mitsuba::SceneHandler Class Reference

XML parser for Mitsuba scene files. To be used with the SAX interface of Xerces-C++. More...

#include <mitsuba/render/scenehandler.h>

+ Inheritance diagram for mitsuba::SceneHandler:

Public Types

typedef std::map< std::string,
ConfigurableObject * > 
NamedObjectMap
 
typedef std::map< std::string,
std::string,
SimpleStringOrdering
ParameterMap
 

Public Member Functions

 SceneHandler (const ParameterMap &params, NamedObjectMap *objects=NULL, bool isIncludedFile=false)
 
virtual ~SceneHandler ()
 
virtual void startDocument ()
 
virtual void endDocument ()
 
virtual void startElement (const XMLCh *const name, xercesc::AttributeList &attributes)
 
virtual void endElement (const XMLCh *const name)
 
virtual void characters (const XMLCh *const chars, const XMLSize_t length)
 
virtual void setDocumentLocator (const xercesc::Locator *const locator)
 
const ScenegetScene () const
 
ScenegetScene ()
 
void warning (const xercesc::SAXParseException &exc)
 
void error (const xercesc::SAXParseException &exc)
 
void fatalError (const xercesc::SAXParseException &exc)
 

Static Public Member Functions

static ref< SceneloadScene (const fs::path &filename, const ParameterMap &params=ParameterMap())
 Convenience method – load a scene from a given filename. More...
 
static ref< SceneloadSceneFromString (const std::string &string, const ParameterMap &params=ParameterMap())
 Convenience method – load a scene from a given string. More...
 
static void staticInitialization ()
 Initialize Xerces-C++ (needs to be called once at program startup) More...
 
static void staticShutdown ()
 Free the memory taken up by staticInitialization() More...
 

Protected Member Functions

std::string transcode (const XMLCh *input) const
 
Float parseFloat (const std::string &name, const std::string &str, Float defVal=-1) const
 
void clear ()
 

Detailed Description

XML parser for Mitsuba scene files. To be used with the SAX interface of Xerces-C++.

Remarks
In the Python bindings, only the static function loadScene() is exposed.

Member Typedef Documentation

typedef std::map<std::string, std::string, SimpleStringOrdering> mitsuba::SceneHandler::ParameterMap

Constructor & Destructor Documentation

mitsuba::SceneHandler::SceneHandler ( const ParameterMap params,
NamedObjectMap objects = NULL,
bool  isIncludedFile = false 
)
virtual mitsuba::SceneHandler::~SceneHandler ( )
virtual

Member Function Documentation

virtual void mitsuba::SceneHandler::characters ( const XMLCh *const  chars,
const XMLSize_t  length 
)
virtual
void mitsuba::SceneHandler::clear ( )
protected
virtual void mitsuba::SceneHandler::endDocument ( )
virtual
virtual void mitsuba::SceneHandler::endElement ( const XMLCh *const  name)
virtual
void mitsuba::SceneHandler::error ( const xercesc::SAXParseException &  exc)
void mitsuba::SceneHandler::fatalError ( const xercesc::SAXParseException &  exc)
const Scene* mitsuba::SceneHandler::getScene ( ) const
inline
Scene* mitsuba::SceneHandler::getScene ( )
inline
static ref<Scene> mitsuba::SceneHandler::loadScene ( const fs::path &  filename,
const ParameterMap params = ParameterMap() 
)
static

Convenience method – load a scene from a given filename.

static ref<Scene> mitsuba::SceneHandler::loadSceneFromString ( const std::string &  string,
const ParameterMap params = ParameterMap() 
)
static

Convenience method – load a scene from a given string.

Float mitsuba::SceneHandler::parseFloat ( const std::string &  name,
const std::string &  str,
Float  defVal = -1 
) const
protected
virtual void mitsuba::SceneHandler::setDocumentLocator ( const xercesc::Locator *const  locator)
virtual
virtual void mitsuba::SceneHandler::startDocument ( )
virtual
virtual void mitsuba::SceneHandler::startElement ( const XMLCh *const  name,
xercesc::AttributeList &  attributes 
)
virtual
static void mitsuba::SceneHandler::staticInitialization ( )
static

Initialize Xerces-C++ (needs to be called once at program startup)

static void mitsuba::SceneHandler::staticShutdown ( )
static

Free the memory taken up by staticInitialization()

std::string mitsuba::SceneHandler::transcode ( const XMLCh *  input) const
protected
void mitsuba::SceneHandler::warning ( const xercesc::SAXParseException &  exc)

The documentation for this class was generated from the following file: