[vtkusers] About MouseEvents.py example

Elvis Stansvik elvis.stansvik at orexplore.com
Thu Jun 23 05:18:00 EDT 2016

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

> On Fri, Jun 17, 2016 at 6:23 AM, Elvis Stansvik <
> elvis.stansvik at orexplore.com> wrote:
>> Alright, I see. Would you mind sharing how you handle custom interactions
>> with a VTK rendering, if you don't use the interactor styles?
>> Do you directly observe events on the interactor instead? Or do you
>> simply handle the Qt events directly and then perform the appropriate
>> manipulation of VTK objects in response to those?
>> I'm very interested in if you use some event forwarding code similar to
>> that in QVTKRenderWindowInteractor, or if you are simply not bothering with
>> feeding input events from Qt to VTK, and handling all input on the Qt side
>> of the fence so to speak.
> I have a subclass of QWidget that receives the Qt events and converts them
> to my own events (which are similar to Qt events but also carry useful VTK
> information).  Those events are dispatched to my interaction bindings.
> I've always done interaction in VTK this way.  Neither the
> vtkRenderWindowInteractor or QVTKWidget play any role.

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?

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?

Thanks in advance for your insight!


>  - David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160623/97ebeee2/attachment.html>

More information about the vtkusers mailing list