[vtkusers] Resolved how to use vtk and qt QVTKRenderWindowInteractor (fwd)

Tore Aurstad toreaur at stud.ntnu.no
Sat Feb 5 22:16:02 EST 2005




---------- Forwarded message ----------
Date: Sun, 6 Feb 2005 04:13:50 +0100 (MET)
From: Tore Aurstad <toreaur at stud.ntnu.no>
To: vtkusers at vtk.org
Subject: Resolved how to use vtk and qt QVTKRenderWindowInteractor


Basically,

from vtk.qt.QVTKRenderWidget import *
from vtk.qt.QVTKRenderWindowInteractor import *
import os,math,vtk,vtkpython,qt
#add more imports if neccessary (should suffice)

Then take a look into the QVTKRenderWindowInteractor.py file and
read the last lines which gives a function that can be called:

QVTKRenderWidgetConeExample()

If other VTK files than the standard cone is needed to be viewed in the
PyQT/VTK application, study the function (def)
QVTKRenderWidgetConeExample(), and make lines like:

widget = QVTKRenderWindowInteractor()
widget.Start()

and so on.. (read the QVTKRenderWindowInteractor.py file!)

I got some questions still-

I do not want a separate window for the QVTKRenderWindowInteractor

This is more like a Qt question, but.. :

How do I make the QVTKRenderWindowInteractor window "inline", that is

the PyQT/VTK application has got one window with a render window inside
the containing Qt window (all in all window, with added buttons)

And could I get one example how to link button events to the
QVTKRenderWindowInteractor window, say let one button be a + sign
and when that QPushbutton is clicked, the VTK scene zooms in..

I guess if there is no such support, the user must interact directly with
the QVTKRenderWindowInteractor scene, but I have to run and stop
animations and want to provide the user with some linkage between Qt and
VTK. (This is a bit of Qt question, but the connection between porting
VTK into Qt applications is I hope interesting for you vtkusers out
there..)

Tore Aurstad



More information about the vtkusers mailing list