[vtkusers] vtkRenderWindowInteractor with Python and VTK

David Gobbi dgobbi at irus.rri.ca
Tue Jan 8 17:32:01 EST 2002


I agree with Scott that if you are using a GUI, you are better off
ignoring the vtkRenderWindowInteractor altogether and do all
actor/camera control via events from the GUI toolkit.  You can
either use vtkRenderWidget.py for this, or just cut & paste the
interaction code from vtkRenderWidget.py into your own program.

I've never even tried using a Tkinter gui (or any other gui) in
combination with a vtkRenderWindowInteractor.  I know for certain
that as soon as you call Start(), Tk will freeze.  Since both Tk
and the vtkRenderWindowInteractor have their own event loops,
there will be a conflict unless Tk somehow knows enough
to pass events off to the Interactor.

I know some people have written tcl scripts that use Tk widgets
as well as Interactors.  Is there any magic in the .cxx code that
makes this possible?

 - David

--
  David Gobbi, MSc                       dgobbi at irus.rri.ca
  Advanced Imaging Research Group
  Robarts Research Institute, University of Western Ontario

On Tue, 8 Jan 2002, Harris Scott R CIV AFRL/SNJM wrote:

> What are you using to build your GUI? I use wxWindows. I just trap double click events on my RenderWindow and
> pass the coordinates to a picker. It works fine. If you're not using wxWindows, you can just generate the
> pick coordinates any way you want (e.g. mouse position when 'p' is pressed) and pass them to a picker.
>
> -Scott
>
>
> -----Original Message-----
> From: William Jacob Proctor [mailto:wjprocto at uncc.edu]
> Sent: Tuesday, January 08, 2002 4:12 PM
> To: vtkusers at public.kitware.com
> Subject: [vtkusers] vtkRenderWindowInteractor with Python and VTK
>
>
> Hello,
>
> I am just beginning with Python & VTK, and I am running into a problem
> with the vtkRenderWindowInteractor.  I am trying to create a gui using
> Python and have a window to do VTK rendering inside the gui.  I am using
> vtkRenderWidget to create the window to render into, but when I try to add
> a vtkRenderWindowInteractor, the vtkRenderWidget no longer works, it is
> not visible at all.  I have been unable to find any examples that utilize
> the vtkRenderWindowInteractor with vtkRenderWidget.   I need to add the
> vtkRenderWindowInteractor so that I can define my own picker function and
> assign it to the interactor (unless there is another way to do this??)
>
> Any suggestions would be appreciated! Thanks!
>
> 	-- Jake
>
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>




More information about the vtkusers mailing list