SceneParser Class Reference

#include <sceneparser.h>

Collaboration diagram for SceneParser:

Collaboration graph
[legend]
List of all members.

Public Member Functions

void parse (xmlNode *root)
 SceneParser (std::string scene_file_name)

Protected Attributes

std::map< std::string, nodehandler_tm_node_handlers
 This is our map of node names to node handlers.
std::string m_scene_filename

Private Member Functions

Renderablenoop (Scene *scene, xmlNode *node)
Renderableparse_bumpmaps (Scene *scene, xmlNode *node)
Renderableparse_camera (Scene *scene, xmlNode *node)
Renderableparse_colors (Scene *scene, xmlNode *node)
Renderableparse_light_sources (Scene *scene, xmlNode *node)
Renderableparse_materials (Scene *scene, xmlNode *node)
Renderableparse_meta (Scene *scene, xmlNode *node)
Renderableparse_objects (Scene *scene, xmlNode *node)
void register_default_handlers ()
 Register the default node handlers.

Detailed Description

This class parses an XML scene definition file, and creates a Scene object based on the definition.

Definition at line 20 of file sceneparser.h.


Constructor & Destructor Documentation

SceneParser::SceneParser ( std::string  scene_file_name  ) 

Loads a scene from the XML file named by scene_file_name.

Parameters:
scene_file_name This is the name of the file that contains the XML specification of the scene to be ray traced.


Member Function Documentation

Renderable * SceneParser::noop ( Scene scene,
xmlNode *  node 
) [private]

Parameters:
scene The scene that the object will affect.
node The xml node that contains configuration for this element

Definition at line 90 of file sceneparser.cpp.

void SceneParser::parse ( xmlNode *  root  ) 

Parse the XML document whose root is passed in.

Parameters:
root The root of the document to parse.

Definition at line 227 of file sceneparser.cpp.

References Scene::get_instance(), log_debug, log_err, log_info, log_warn, and m_node_handlers.

Here is the call graph for this function:

Renderable * SceneParser::parse_bumpmaps ( Scene scene,
xmlNode *  node 
) [private]

Parameters:
scene The scene that the object will affect.
node The xml node that contains configuration for this element

Definition at line 198 of file sceneparser.cpp.

References Scene::add_bumpmap(), PluginFactory< _ParentType, _SigType, _SlotType >::get_instance(), get_properties(), log_debug, and log_warn.

Referenced by register_default_handlers().

Here is the call graph for this function:

Here is the caller graph for this function:

Renderable * SceneParser::parse_camera ( Scene scene,
xmlNode *  node 
) [private]

Parameters:
scene The scene that the object will affect.
node The xml node that contains configuration for this element

Definition at line 148 of file sceneparser.cpp.

References get_properties(), log_debug, and Scene::set_camera().

Referenced by register_default_handlers().

Here is the call graph for this function:

Here is the caller graph for this function:

Renderable* SceneParser::parse_colors ( Scene scene,
xmlNode *  node 
) [private]

Parse a set of color nodes and return them in a map<char *, Color>.

Parameters:
scene The scene that the object will affect.
node The xml node that contains configuration for this element

Renderable * SceneParser::parse_light_sources ( Scene scene,
xmlNode *  node 
) [private]

Parse the <light_sources> XML node.

Parameters:
scene The scene that the object will affect.
node The xml node that contains configuration for this element

Todo:
This is a near duplicate of parse_objects()

Definition at line 171 of file sceneparser.cpp.

References Scene::add_primitive(), PluginFactory< _ParentType, _SigType, _SlotType >::get_instance(), Renderable::initialize(), log_debug, log_warn, and Renderable::set_is_light().

Referenced by register_default_handlers().

Here is the call graph for this function:

Here is the caller graph for this function:

Renderable * SceneParser::parse_materials ( Scene scene,
xmlNode *  node 
) [private]

Parameters:
scene The scene that the object will affect.
node The xml node that contains configuration for this element

Definition at line 63 of file sceneparser.cpp.

References Scene::add_material(), exit_mbrt(), PluginFactory< _ParentType, _SigType, _SlotType >::get_instance(), get_properties(), and log_crit.

Referenced by register_default_handlers().

Here is the call graph for this function:

Here is the caller graph for this function:

Renderable * SceneParser::parse_meta ( Scene scene,
xmlNode *  node 
) [private]

Parameters:
scene The scene that the object will affect.
node The xml node that contains configuration for this element

Definition at line 117 of file sceneparser.cpp.

References get_properties(), log_debug, Scene::set_max_recurse_depth(), Scene::set_output_filename(), Scene::set_pixel_height(), Scene::set_pixel_width(), and Scene::set_subpixel_sqrt().

Referenced by register_default_handlers().

Here is the call graph for this function:

Here is the caller graph for this function:

Renderable * SceneParser::parse_objects ( Scene scene,
xmlNode *  node 
) [private]

Parameters:
scene The scene that the object will affect.
node The xml node that contains configuration for this element

Definition at line 95 of file sceneparser.cpp.

References Scene::add_primitive(), PluginFactory< _ParentType, _SigType, _SlotType >::get_instance(), Renderable::initialize(), log_debug, and log_warn.

Referenced by register_default_handlers().

Here is the call graph for this function:

Here is the caller graph for this function:

void SceneParser::register_default_handlers (  )  [private]

Register the default node handlers.

Definition at line 53 of file sceneparser.cpp.

References m_node_handlers, parse_bumpmaps(), parse_camera(), parse_light_sources(), parse_materials(), parse_meta(), and parse_objects().

Here is the call graph for this function:


Member Data Documentation

std::map<std::string, nodehandler_t> SceneParser::m_node_handlers [protected]

This is our map of node names to node handlers.

Definition at line 64 of file sceneparser.h.

Referenced by parse(), and register_default_handlers().

std::string SceneParser::m_scene_filename [protected]

This is the name of the XML file which contains the definition of the scene.

Definition at line 68 of file sceneparser.h.


The documentation for this class was generated from the following files:
Generated on Tue Oct 30 22:12:25 2007 for mbrt by  doxygen 1.5.2