Hi Robert,

cool, I was afraid there was a specific reason not to pass the visitor to
those handlers...
I've submitted the patch.

Also, while checking the event handling related code,
let me remind you that some people found in the past
that cameras sometimes receive twice the same event:
https://groups.google.com/d/topic/osg-users/9oj5XSRocB8/discussion

not sure where that issue comes from anyway... maybe you can spot it.

Cheers,
Ricky


On Wed, Feb 15, 2012 at 17:03, Robert Osfield <robert.osfi...@gmail.com>wrote:

> HI Riccardo,
>
> On 15 February 2012 15:38, Riccardo Corsi <riccardo.co...@kairos3d.it>
> wrote:
> > while checking the code related to event handling,
> > I've noticed that node callbacks receives a NodeVisitor in their handle()
> > callback, and can then extract the frameStamp if needed.
> >
> > The same does not apply to the GUIEventHandler added directly to the
> > osgViewer classes, as thy are invoked this way:
> > (*hitr)->handleWithCheckAgainstIgnoreHandledEventsMask( *event, *this, 0,
> > 0); //no visitor passed in as argument
>
> Curious, and surprising - as far as I recall you're the first to spot
> this difference.  Thinking back I suspect I did this many years when
> transitioning from old osgProducer based viewer before there was an
> EventVisitor and this limitation just carried forward.


>
> > Being able to get the frame stamp could be quite useful, for instance if
> one
> > has to reset some information at every frame,
> > and doesn't want to place a dummy node somewhere in the scenegraph.
> >
> > There are workarounds based on event timing,
> > but I think it would be more robust if the viewer passed this info to the
> > handler.
> > A simple solution could be to pass the same _eventVisitor used for the
> > scenegraph as an argument to the viewer's handlers, like
> > (*hitr)->handleWithCheckAgainstIgnoreHandledEventsMask( *event, *this, 0,
> > _eventVisitor); //no visitor passed in as argument
> >
> > Robert, do you think it's a viable solution?
> > If so I will make a submission.
>
> I think this would be fine, I've just checked CompositeViewer.cpp and
> Viewer.cpp's use of the handleWithCheckAgainstIgnoreHandledEventsMask
> method and it looks to me like passing in the _eventVisitor as you
> have suggested would be fine.  So go ahead and make the change and
> send it into osg-submissions.
>
> Cheers,
> Robert.
> _______________________________________________
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to