[vtkusers] About MouseEvents.py example
David Gobbi
david.gobbi at gmail.com
Fri Jun 24 08:59:53 EDT 2016
On Thu, Jun 23, 2016 at 3:18 AM, Elvis Stansvik <
elvis.stansvik at orexplore.com>
>
>
> Just a final small question about your approach if that's okay: You say
> here that the vtkRenderWindowInteractor does not play any role, but don't
> you use the interactor for some things, such as finding the poked renderer
> (vtkRenderWindowInteractor::FindPokedRenderer) ? Other things as well?
>
For event handling, I have a "Frame" class that manages the vtkRenderWindow
and each "Frame" object has child "Pane" objects that manage each renderer,
i.e. they manage both the layout and event bindings. So the "Frame" object
has a method that decides which "Pane" to forward each event to (and this
method does not use FindPokedRenderer).
Instead of attaching a interaction style to the RenderWindow, I attach a
set of event bindings to a Pane (where each Pane manages events for a
Renderer). In other words, interaction is handled at the level of the
Renderer, not at the level of the RenderWindow.
> Up until now I've based my custom interactions on vtkInteractorStyleUser,
> so have made use of the interactor/interactor style system. But I think I'm
> finally succumbing to the idea of building a system more like yours,
> especially as I've found that vtkInteractorStyleUser does not support wheel
> events (recently added that). But I'm interested in if you ever make use of
> the interactor/interactor style system? E.g. say you would like to provide
> interaction with an vtkChartXY, would you make use of the builtin
> interaction styles that VTK has for that, or build your own based on the
> mechanism you've described here? Do you use your mechanism only when you
> have a need for highly custom interaction behavior?
>
So far I haven't used interaction with charts. Take a look at
QVTKInteractorAdapter.cxx if you're interested in handling some events
yourself and forwarding others to VTK's interactors. I haven't tried doing
this yet.
- David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160624/69d8be4c/attachment.html>
More information about the vtkusers
mailing list