In osgWidget's current design, Widgets are notified of events such as
mouseOver by a single ViewerEventHandler object that traverses a given
root node and determines (or tries to :)) what kind of "thing" is going
on. When I originally wrote this part of osgWidget, such was the limit
of my knowldege...

However, I would like to move to a more divorced system, in which each
Drawable (Widget) or Node (Window) can use special UpdateCallback and
NodeCallback objects so that they can simply "subscribe" to the events
they're interested in.

What I'm looking for are some ideas as to how I could best accomplish
this.

One possibility is that I could keep the osgWidget::ViewerEventHandlers
that I currently have (MouseHandler, KeyboarHandler, etc.) except than
instead of having them call the mouseOver methods on the Widgets
directly they would simply set various state variables (mouse position,
etc.) that the user could later query in their on NodeCallback or
UpdateCallback functions.

Does this make sense? Is this even a worthy endeavor? I get a lot of
questions about how osgWidget "marries" the WindowManager+Event
mechanism and the widgets it manages, so I'm looking for ways to break
that up. The general idea is that I really want to use the OSG "update"
traversal more, since right now I basically just have one object (the
various ViewerEventHandlers) doing EVERYTHING on every object during
their own update phase.

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to