Hi Serge,
On 5/11/07, Serge Lages <[EMAIL PROTECTED]> wrote:
Hi Robert and all,
I would just like to be sure of something about osgViewer and event
handling.
When an event occurs, it is passed in this order to :
1 - the event handlers added with viewer.addEventHandler.
2 - the camera manipulator added with viewer.setCameraManipulator.
3 - it traverse the graph for event callbacks.
And when one of these handlers return true, the osgGA::GUIEventAdapter
returns true when we ask for getHandled. Is it right ?
Yes, its up to your handler to decide if its happy to handle events
that have already been handled.
I also have one question, is it possible to change this order ? for example
first traverse the graph and then pass it to the event handlers ?
If you want to change the order then you'll need to override the
Viewer::eventTraversal() method.
One possibility to help this out might be for use to refactor the
eventTraversal() so the the event handlers are all called in on method
say eventHandlerTraversal() and the event callback vai
eventCallbackTraversal() and have the top level call these from
eventTraversal() in the normal order, but then it'd be easier for you
to override eventTraversal() and change the order.
Feel free to have a go at refactoring it this way if you wish.
Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/