Hi Валерa,

As in my case, I always do just call setNumChildrenRequiringUpdateTraversal(1) 
somewhere during the initialization phase and this do force using update 
traversals.
Just call it in the constructor of your MyClass class and this is fine.

Best regards,
Art (Артём)


--- Валерий Быков <[EMAIL PROTECTED]> schrieb am Mo, 19.5.2008:

> Von: Валерий Быков <[EMAIL PROTECTED]>
> Betreff: [osg-users] traverse
> An: osg-users@lists.openscenegraph.org
> Datum: Montag, 19. Mai 2008, 11:00
> 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


      __________________________________________________________
Gesendet von Yahoo! Mail.
Dem pfiffigeren Posteingang.
http://de.overview.mail.yahoo.com
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to