[vtkusers] Using a callback other than timer

Jordi Gutiérrez Hermoso jordigh at gmail.com
Mon Mar 15 03:43:53 EDT 2010


Continuing this thread:

     http://old.nabble.com/Modifying-vtkPolyData-td27732564.html

I have managed to create a mildly interesting animation in the code
attached, possibly even with offscreen plotting.

Now, my rather minor question is this. The idea is that I want to
update the rendered window not upon some timer event, but according to
how iterations of a computation get completed. I can do this by
calling programmableFilter -> Modified(); and renWin -> Render();
whenever an iteration of computation is complete, but then I lose the
ability to have an interactor.

I can think of kludges to work around this, e.g. have the timer
callback check if a new iteration is ready for rendering, but is there
a way to generate an event inside the interactor event loop other than
a timer to which I can attach a callback? An event that I can invoke
whenever a new iteration of the computation is ready?

Thanks,
- Jordi G. H.
-------------- next part --------------
cmake_minimum_required(VERSION 2.6)
PROJECT(vtktest)

set(SRC_FILE vtkplot.cpp)

FIND_PACKAGE(VTK REQUIRED)
INCLUDE(${VTK_USE_FILE})

ADD_EXECUTABLE(vtktest ${SRC_FILE})
TARGET_LINK_LIBRARIES(vtktest vtkHybrid)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vtkplot.cpp
Type: text/x-c++src
Size: 7482 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100315/cd424ee8/attachment.cpp>


More information about the vtkusers mailing list