[osg-users] Need a non-const NodeVisitor -- again

Paul Martz pmartz at skew-matrix.com
Sat Sep 15 14:29:21 PDT 2007

Hi Robert -- Here's an interesting aspect of OSG's design I've just recently
stumbled across.
osgDB::ReaderWriter::writeNode's first param is a const osg::Node&. I can
understand that writing a file is inherently a const operation as far as the
scene graph is concerned. However, the obvious thing to do within writeNode
is to traverse the node with a NodeVisitor, which requires calling
Node::accept(), which requires the node to be non-const.
So it seems like the nature of the design is to require writeNode to cast
away const, but I wanted to check: Did you intend implementations of
writeNode to do something other than use a NodeVisitor?
Paul Martz
Skew Matrix Software LLC
http://www.skew-matrix.com <http://www.skew-matrix.com/> 
303 859 9466
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20070915/067631f5/attachment-0002.htm>

More information about the osg-users mailing list