[vtkusers] Interactive run in Tcl shell in Linux

Yang Yang yyang109 at gmail.com
Tue Feb 6 08:14:00 EST 2007


Hello All,
I built a function library, which uses VTK to visualize the data. I used
swig to wrap it to a Tcl command library. When I run a Tcl script line by
line in the Tcl shell(run $wish, then the Tcl console window pops up, and
the Tcl shell starts with % to receive Tcl command), I found the graphics
has no interaction(I setup all the Renderer, RenderWindow and
RenderWindowInteractor stuff) if I don't call a event loop from the library.
But if I call an event loop to make the graphics interactive, this event
loop will always block and the Tcl shell cannot receive command any more.
Could any body help me with how to make the graphics interactive without
calling an event call? This problem only exists in Linux. In windows I don't
have to call the event loop and the graphics window has interaction by
default.
I see that the Tcl wrapper of VTK library has this feature both in Windows
and in Linux. If I setup a pipeline and call "renwin Render", the graphics
window will pop up with interaction, and the Tcl shell is still active for
reading new command, so I can call "renwin SetBackground 1 0 0" then to
change the background color of the graphics window. I don't have to
explicitly call "iren Start" to start the vtk event loop to enable the
interaction, which will block the Tcl shell.

Any help will be appreciated! Thank you very much in advance.

Yang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20070206/93fadb9b/attachment.htm>


More information about the vtkusers mailing list