[vtkusers] Widget interaction in multiple viewports

Timothee Evain tevain at telecom-paristech.fr
Wed Feb 8 08:48:51 EST 2017

Hi folks,

Some follow-up about using (2D) widgets in multiple viewports configuration, that may interest VTK-devs:
I found an old post in the mailing list relating a similar issue( http://public.kitware.com/pipermail/vtkusers/2010-August/062118.html ), that gave me enough hints to unravel what was happening.

The issue arises because widget representations are unaware of the viewport configuration during event handling, whereas their positions are set relative to their renderers through the PlaceWidget method.
This leads the widget event to falsely detect events over the first viewport only, and miss them over the others. 
For example, in a four-tiles viewport configuration, setting a widget in the top right viewport at (10,10), will lead to event handling at (10,10) in the full window (bottom left viewport).

My workaround was to write a modified representation class, based on what I needed (2D textured button in this case), to handle events relatively to the viewport. I think that this problem may call for a more global fix about widgets since I know this impact at least one other widget (the 2D slider).




More information about the vtkusers mailing list