[vtkusers] About MouseEvents.py example

Elvis Stansvik elvis.stansvik at orexplore.com
Sun Jun 26 04:03:36 EDT 2016


2016-06-24 14:59 GMT+02:00 David Gobbi <david.gobbi at gmail.com>:

> 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.
>

Interesting, so you really are forgoing the entire interactor system.
Thanks for explaining.


>
>
>
>> 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.
>

Thanks, I'll have a look. Right now I'm stuck on another problem I ran into
while trying to port my own renderering/event adapter to QOpenGLWidget (see
other thread), but I hope I'll solve that.

Elvis


>  - David
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160626/4ff1ecb7/attachment.html>


More information about the vtkusers mailing list