version 3.3

VRS::SceneGraphPrinter Class Reference

Visitor class for printing the scene graph (hand-made). More...

#include <vrs/sg/scenegraphprinter.h>

Inheritance diagram for VRS::SceneGraphPrinter:

VRS::VisitorBase VRS::Visitor< VRS::SharedObj >

List of all members.

Public Types

typedef CallbackR1
< std::string, SO
< VRS::SharedObj > > 
ToStringCallback

Public Member Functions

 SceneGraphPrinter (unsigned int maxLevels=1000)
virtual VisitMode visit (VRS::SharedObj *obj, bool pushObj)
void registerCustomToString (const VRS::ID &className, SO< ToStringCallback > callback)
void printHeader () const
void writeToFile (SO< SceneNode > scene, const std::string &filename)

Protected Member Functions

virtual void print (VRS::SharedObj *obj, bool pushObj)

Protected Attributes

const unsigned int m_maxLevels
std::string m_indentation
std::map< VRS::ID, SO
< ToStringCallback > > 
m_customToStrings


Detailed Description

Visitor class for printing the scene graph (hand-made).

Please feel free to add custom output for more Attributes and Shapes! If you need to add Shapes or other objects that are not part of VRS itself, subclass this class and overwrite print(). You can call it explicitly via SceneGraphPrinter::print() inside that overwritten method to use the existing functionality.

Usage: SceneGraphPrinter printer; mySceneThing->accept(printer);


Member Typedef Documentation


Constructor & Destructor Documentation

VRS::SceneGraphPrinter::SceneGraphPrinter ( unsigned int  maxLevels = 1000  ) 


Member Function Documentation

virtual VisitMode VRS::SceneGraphPrinter::visit ( VRS::SharedObj obj,
bool  pushObj 
) [virtual]

void VRS::SceneGraphPrinter::registerCustomToString ( const VRS::ID className,
SO< ToStringCallback callback 
)

void VRS::SceneGraphPrinter::printHeader (  )  const

void VRS::SceneGraphPrinter::writeToFile ( SO< SceneNode scene,
const std::string &  filename 
)

virtual void VRS::SceneGraphPrinter::print ( VRS::SharedObj obj,
bool  pushObj 
) [protected, virtual]


Member Data Documentation

const unsigned int VRS::SceneGraphPrinter::m_maxLevels [protected]

std::string VRS::SceneGraphPrinter::m_indentation [protected]


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

Generated on Tue May 22 06:00:30 2012 by Doxygen 1.5.6
© 2001-2010 Hasso-Plattner-Institut | Impressum | Contact