EsMo wrote:
> I'm not sure what data the visitor should extract for me.



Solkar wrote:
> Let it dump every precondition and state you assume for your algorithm.
 (emphasis added)

For getting an overview, it is advantageous to indent the output of the visitor 
according to traversal depth.

Create a class "Indentor" with a static string "current_indentation", a ctor 
that extends that static string by 4 spaces, and a dtor that shortens it again 
by 4 spaces. Surround the child traversal call by curlies and ctor an indentor 
(on the stack) at the beginning of that scope; the dtor will be called 
automatically on scope exit. 

Prefix all output with output of Indentor::current_indentation. 

Make sure the visitor operates depth-first.

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=60269#60269





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to