[vtkusers] How to re-render on input data updates

Andy Treisch Andy.Treisch at gmx.de
Tue Sep 12 06:26:58 EDT 2006


Hi!

I created a rendering pipeline, which is based on a vtkImageData. It is
constructed by x and y coordinates and the "values" of the points added
via ->GetPointData()->SetScalars() method. During runtime, the scalar
data will change and i need to update my rendering window. how can I
do that? I tried to add an Observer to the vtkRenderWindowInteractor
using eventid = AddObserver(vtkCommand::UserEvent, cbc, 1.0) with
cbc beeing an instance of vtkCallbackCommand with my update function
set via ->SetCallback(). As far as I understand the doxygen
documentation, eventid should hold a value, which is needed to invoke
the event. When I try to iren->InvokeEvent(eventid) nothing happens.
I also tried InvokeEvent(vtkCommand::UserEvent) but nothing happens,
too. So I tried to change the event to a LeftButtonPressEvent resulting
in AddObserver(vtkCommand::LeftButtonPressEvent, ...) and it works.
But it only updates the plot if I click inside the renderwindow.

Is there any other way to update the renderwindow on changed basedata
or did I understand something wrong with the use of the Observer-system?
I work on that since about a week and it drives me crazy...


Thanks in advance,
Andy Treisch 






More information about the vtkusers mailing list