[vtkusers] Force rendering from a thread

Totte Karlsson totte at dunescientific.com
Tue Jan 13 19:01:47 EST 2015

I have created some data objects using a simple "observer-subject" pattern.
The observer contains the code to render a 'subject' object using vtk.

The update of internal data in the subject may be performed in a thread 
and I have now come across the fact that one can't call render() from 
such. Instead, one need to communicate that a render() is needed trough 
some data variable. This can be done but setting up a timer that checks 
every so often, and if the variable is 'set', do a render in the timer 
callback. But I never been a big fan of that kind of pulling. So I 
wonder if there is another, more direct way?

I have noticed when I execute renderInteractive(), that vtk objects are 
indeed updated from their sources every time the mouse interactively 
generate a 'render' somewhere. Not sure how that works. Is it possible 
to tie in there somewhere?


Totte Karlsson, Ph.D.
Dune Scientific, LLC
425-296 1980 (office)
425-780 9648 (cell)

More information about the vtkusers mailing list