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

Noeska noeska.smit at gmail.com
Thu Mar 13 14:35:14 EDT 2014


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.


More information about the vtkusers mailing list