Hi all.

I have a question why Node::traverse(NodeVisitor&) doesn't called with
NodeVisitor of type UPDATE_VISITOR?
I have a class derived from Geode and I remoulded function
traverse(NodeVisitor&) for some update operations:

void MyClass::traverse(osg::NodeVisitor& nv)
{
        if (nv.getVisitorType() == osg::NodeVisitor::UPDATE_VISITOR)
        {
                // Do smth
        }
        Geode::traverse(nv);
}

And I use osgViewer::Viewer for showing scene. But this function
traverse is never called with updateVisitor, because in
osgUtil::UpdateVisitor::apply(Geode&) only callbacks is proceeded, but
not traverse.

And what about deriving from other classes and using traverse for update
operations then we can see that in osgUtil::UpdateVisitor::apply(Node&)
calls function void handle_callbacks_and_traverse(osg::Node& node) which
calls callback if presented and check
node.getNumChildrenRequiringUpdateTraversal()>0 and calls traverse(node)
in this case. But as I can see in osg/src/Node.cpp,
_numChildrenRequiringUpdateTraversal changes in two cases: when update
callback is attached and when void
Node::setNumChildrenRequiringUpdateTraversal(unsigned int num) is
called. But I want to not use update callback, so, I must call
setNumChildrenRequiringUpdateTraversal for it. I would like to remould
function addParent for it, but this function is not virtual, so, I
really confused how to use traverse for update operations.

Best regards,
Valery
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to