HI Pjotr, On 21 May 2014 09:14, Pjotr Svetachov <[email protected]> wrote: > Might moving the logic over to the add/remove parent methods and making > special overloads for those methods in the drawable class be a solution? I > don't know if it's better at the end but at least this would at least remove > the need to have special handling of this in the setChild method (with all > those delta's). > > Btw I also noticed that setNumChildrenRequiringUpdateTraversal has a special > check if there is already an updatecallback there should also be a test for a > drawable updatecallback somewhere in there, right?
I am wondering whether a virtual hasUpdateCallback() might be appropriate to help resolve this type of issue. > However you solve this you will get yucky code. Even both callbacks use the > same member variable name _updateCallback which just don't feel right now... That is a simple fix, I'll renamed Drawable::_updateCallback. > I just found a new bug regarding with the callbacks: a osg::NodeCallback as a > update callback to a drawable will not be called if the drawable is attached > to a geode. > > Btw I haven't tested event callbacks but those might also not work correctly > now. Could you put together a test example that illustrates these bugs? -- On a slightly different note, I'm currently working on osgUI and scripting integration via osg::CallbackObjects that get assigned to an Objects::UserDataContainer. It could be that we need to put all callback data into the UserDataContainer too. osg::CallbackObjects have the potential to unify how callbacks are handled, but it's not something one can just replace existing API's without breaking backwards compatibility. I'll have a think to see if there are any opportunities to adapt old usage to the generic osg::CallackObects approach. Cheers, Robert _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

