VISR  0.11.6
Versatile Interactive Scene Renderer
visr::objectmodel::PointSourceParser Class Reference

#include <point_source_parser.hpp>

Inheritance diagram for visr::objectmodel::PointSourceParser:
visr::objectmodel::ObjectParser visr::objectmodel::PointSourceWithDiffusenessParser visr::objectmodel::PointSourceWithReverbParser visr::objectmodel::PointSourceExtentParser

Public Member Functions

virtual void parse (boost::property_tree::ptree const &tree, Object &src) const
 
virtual void write (Object const &obj, boost::property_tree::ptree &tree) const
 
- Public Member Functions inherited from visr::objectmodel::ObjectParser
 ObjectParser ()
 
virtual ~ObjectParser ()
 

Static Protected Member Functions

static void parsePosition (boost::property_tree::ptree const &posTree, Object::Coordinate &x, Object::Coordinate &y, Object::Coordinate &z)
 

Member Function Documentation

◆ parse()

void visr::objectmodel::PointSourceParser::parse ( boost::property_tree::ptree const &  tree,
Object obj 
) const
virtual

Parse an object from a property node.

Parameters
treeThe property tree node containing the object information.
[out]objThe object to which the parsed values are set.
Note
: This function is marked as pure virtual, thus making the class abstract (non-instantiable). However, it has an implementation which performs sensible work.

Implements visr::objectmodel::ObjectParser.

Reimplemented in visr::objectmodel::PointSourceWithReverbParser, visr::objectmodel::PointSourceExtentParser, and visr::objectmodel::PointSourceWithDiffusenessParser.

◆ parsePosition()

void visr::objectmodel::PointSourceParser::parsePosition ( boost::property_tree::ptree const &  posTree,
Object::Coordinate x,
Object::Coordinate y,
Object::Coordinate z 
)
staticprotected

Parse the content of a "position" node. Supports Cartesian and spherical coordinates as well as default values for the z coordinate and the radius, respectively. This is separated into a method because derived classes potentially need this functionality in other places.

Parameters
posTreeThe property tree containing the coordinates (typically named "position")
x[out] Reference to hold the parsed x coordinate.
y[out] Reference to hold the parsed y coordinate.
z[out] Reference to hold the parsed z coordinate.
Todo:
Consider making this a more general facility.

◆ write()

void visr::objectmodel::PointSourceParser::write ( Object const &  obj,
boost::property_tree::ptree &  tree 
) const
virtual

Serialize an object itno a property tree node.

Parameters
objThe audio object to be serialised.
[out]treeThe property tree subtree to where the object information is written to.
Note
This method is pure virtual, because his class does not correspond to an instantiable audio object type. Nonetheless, it has an implementation which is called by derived classes.

Implements visr::objectmodel::ObjectParser.

Reimplemented in visr::objectmodel::PointSourceWithReverbParser, visr::objectmodel::PointSourceExtentParser, and visr::objectmodel::PointSourceWithDiffusenessParser.


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