[vtkusers] VTK Change Value Event

Siavash siavashk at ece.ubc.ca
Thu Jul 9 19:32:35 EDT 2015


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20150709/f59c4d54/attachment.html>


More information about the vtkusers mailing list