[vtkusers] vtkRenderWindowInteractor with Python and VTK

William Jacob Proctor wjprocto at uncc.edu
Wed Jan 9 21:16:27 EST 2002


I'm using the Tkinter module to create the GUI.  I'll take a closer look
at vtkRenderWidget.py to see how it handles picking.  Thanks for the info!

     -- Jake

-----Original Message-----
From: David Gobbi [mailto:dgobbi at irus.rri.ca]
Sent: Tuesday, January 08, 2002 5:32 PM
To: Harris Scott R CIV AFRL/SNJM
Cc: 'William Jacob Proctor'; vtkusers at public.kitware.com
Subject: RE: [vtkusers] vtkRenderWindowInteractor with Python and VTK


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