[vtk-developers] InteractorStyle and viewport focus

David Gobbi david.gobbi at gmail.com
Thu Feb 11 12:59:57 EST 2010


One of the threads on the list reminded me of a problem that I've been
having with VTK.

I often use multiple Renderers in the same RenderWindow.  This is the
only way for me to make multi-paned VTK apps that don't depend on
external GUI toolkits, and it's very important to me because I always
want my visualization code to be as GUI-independent as possible.

However, when I start an interaction in one renderer, if my mouse-drag
causes the mouse to leave that renderer and enter another one, then
all of a sudden the other renderer starts responding to the events.

In other words, the vtkInteractorStyle does not have any mechanism for
recognizing that one renderer has the "focus" for mouse (and keyboard)
events.  What is needed is for the InteractorStyle to have a
"FocusedRenderer" ivar that never changes while InteractorStyle->State
is nonzero.  This isn't a trivial fix, though... locking the focus is
easy, but setting the focus can often be tricky. Another thing that
would be nice is an InteractorStyle that will automatically switch
modes depending on which renderer has the focus.

Are there any others out there that would like to see this?  Is it
already on the Kitware wish-list?

   David



More information about the vtk-developers mailing list