[vtkusers] Interactive graph in QVTKRenderWindowInteractor (VTK 6.1/Python 2.7/Pyside)

Michka Popoff michkapopoff at gmail.com
Thu Mar 13 14:42:33 EDT 2014


Hi,

QVTKWidget is not really tested I think, the preferred way is to use the QVTKRenderWindowInteractor.

There are two examples I wrote with the help of the people here on the list, and by refactoring some older code.
I personally us the first one.

http://www.vtk.org/Wiki/VTK/Examples/Python/Widgets/EmbedPyQt

http://www.vtk.org/Wiki/VTK/Examples/Python/Widgets/EmbedPyQt2

Would this help ?

Michka

On 13 mars 2014, at 19:35, Noeska <noeska.smit at gmail.com> wrote:

> Hi everyone,
> 
> I have been trying to get an interactive animated graph working in my
> application for quite some time, but I am unfortunately not able to
> successfully embed it in my GUI. I am using VTK 6.1/Python 2.7 and PySide. 
> 
> I would like to get an animated interactive graph, like in  the Infovis with
> VTK webinar
> <http://www.kitware.com/media/protrainingwebinars.php#infovisvtk>  . The
> example works perfectly when converted to Python, there is only one problem
> that I can't seem to solve. While everything works when I render it to a
> separate renderwindow, I run into trouble when I try to embed it in my GUI. 
> 
> From what I understand from  these slides on VTK Charts (more specifically
> slide 22)
> <http://www.na-mic.org/Wiki/images/1/18/NA-MIC-VTK-Charts-2011.pdf>  , I
> need to use a QVTKWidget and a vtkContextView. I then need to set the
> interactor of the view to the one from the widget and set the renderwindow
> of the widget to the renderwindow of the view. First of all, I can't find a
> QVTKWidget in my VTK build (built against Qt with Python wrappings). Is this
> really a problem? I am currently trying to use a QVTKRenderWindowInteractor
> which I do have, but the example still doesn't work with that. Intuitively,
> I think it might have something to do with attempting to set the
> interactorstyle of the QVTKRenderWindowInteractor. 
> 
> I will include two snippets with the relevant code. The first ( snippet1.txt
> <http://vtk.1045678.n5.nabble.com/file/n5726303/snippet1.txt>  ) renders to
> a separate renderwindow and works, while the second ( snippet2.txt
> <http://vtk.1045678.n5.nabble.com/file/n5726303/snippet2.txt>  ) attempts to
> render the graph to the embedded QVTKRenderWindowInteractor renderwindow and
> fails. It still gives me a separate renderwindow with the graph in it only
> this time it doesn't respond to interaction and even crashes my Python after
> some time. I have also tried to add the view renderer to the
> QVTKRenderWindowInteractor renderwindow directly, but this also didn't work
> out.
> 
> Thanks in advance for your help :) Please let me know if you need me to
> provide more details.
> 
> Noeska
> 
> 
> 
> --
> View this message in context: http://vtk.1045678.n5.nabble.com/Interactive-graph-in-QVTKRenderWindowInteractor-VTK-6-1-Python-2-7-Pyside-tp5726303.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers



More information about the vtkusers mailing list