[vtkusers] VTK Change Value Event

siavashk siavashk at ece.ubc.ca
Thu Jul 9 19:39:40 EDT 2015


[Sorry for possible multiple postings, I am not sure if my original email
went through]

Hello,

I am trying to write a complicated GUI. The final GUI should have a minimap
and it should also be able to zoom and pan images. The minimap has a
rectangle that corresponds to the viewport.

There are two challenges associated with this problem that make it difficult
compared to standard vtk examples:
1) If the zoom value is beyond a threshold, I have to load a higher
reolution image from the hard drive and update the displayed vtkImage and
the minimap accordingly; and 2) Higher resolution images are also larger
than the available memory (~10 GB), so I cannot load the entire image at
once. I should only load part of the image that is to be displayed on the
viewport.

I am using the mouse wheel event and mouse move events for zooming and
panning. I am updating the minimap using the window render event.

The issue is that the minimap, zoom and pan callbacks (classes inherited
from vtkCommand), share states. For example, if the zoom changes using the
mouse wheel, the size of the rectangle in the minimap callback should change
too. As a result, keeping track of shared information between callbacks is
too complicated.

What I think I should do is to have user events change the state of the GUI
(e.g. the zoom value) and have callbacks that execute when the state
changes. Unfortunately, I am not sure how to do this properly in VTK.

So my question is this: *Is there a way to fire an event when a value (e.g.
a double variable) is changed in VTK? And how do you catch this event?*

Thank you,

Siavash



--
View this message in context: http://vtk.1045678.n5.nabble.com/VTK-Change-Value-Event-tp5732812.html
Sent from the VTK - Users mailing list archive at Nabble.com.


More information about the vtkusers mailing list