Hello Robert,
> All present NodeCallbacks are effectively traversal callbacks - all
> require you to call traverse.
Yes, but most NodeCallbacks will be standalone (i.e. no dependency
between callbacks), so calling them in series shouldn't be a problem,
or am I missing something?
Anyways, there's obviously some things I don't understand about
callbacks or you would have done this a long time ago. Since it works
for me I'll keep using it. I was just thinking it could be useful to
others too, but not in its current state it seems.
The whole thing I'm trying to solve is that Node::set*Callback()
replaces the callback, and if you need to have both the old and the
new callbacks, you have to do it manually, i.e. with
if (node->getUpdateCallback())
node->getUpdateCallback()->addNestedCallback(callback);
else
node->setUpdateCallback(callback);
And you have to *remember* to do that if there's any chance that you
may need more than one callback on a given node. I'm just trying to
make that more automatic and transparent...
So alternatively, would you accept a method in osg::Node that would
look like this:
void Node::addUpdateCallback(osg::NodeCallback* callback)
{
if (_updateCallback.valid())
_updateCallback->addNestedCallback(callback);
else
setUpdateCallback(callback);
}
That would give an alternative to Node::set*Callback, where if you
*know* you want to replace the existing callback, you call set, but if
you might need more than one, you call add.
It's such a simple method, but it would take some variables and some
possible user error (*cough*) out of the equation...
Anyways, I think I'm done rambling now. :-)
J-S
--
______________________________________________________
Jean-Sebastien Guay [EMAIL PROTECTED]
http://whitestar02.webhop.org/
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org