Robert Osfield wrote:
Hi OM,The event mask would be an interesting approach that be worth experimenting with. I don't have the available time to go try this out, so could you have a tinker and see how you get on.
Ok, turns out this was even easier than expected.This will break any code that depends on the absolute values of osgGA::GUIEvent::EventType, but I'd consider that kind of code broken anyway.
This changes osgGA::GUIEvent::EventType so I can use them in a bitmask. I also added the ability to set/get the mask in osgGA::GUIEventHandler and changed osgViewer::Viewer to consider the mask when delivering handled events to cameraManipulators. The same could easily be done for the generic case of eventHandlers if that should be of interest.
This will let the cameraManipulators signal to the osgViewer::Viewer which handled events they're willing to ignore.
Simplest testcase I could come up with was to use the NodeTrackerManipulator and setting the mask to osgGA::GUIEventHandler::DRAG while having an eventhandler that returns true for DRAG events. This basically stops the NodeTrackManipulator from working. Setting the mask to NONE (which is the default) brings back the normal behaviour.
- OM
ignoreEvents.tar.gz
Description: GNU Zip compressed data
_______________________________________________ osg-submissions mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
