[vtkusers] QVTKWidget and vtkRenderWindowInteractor problem

kdsfinger at gmail.com kdsfinger at gmail.com
Tue Jun 27 01:33:05 EDT 2006


hi, all
I am using Qt3.3+vtk5.0. I have a mainframe and a slaveframe. The
QVTKWidget is in the slaveframe. By click a button on the mainframe,
the slaveframe is loaded with data and shown.
The problem is: when I start the vtkRenderWindowInteractor of the
slaveframe, the mainframe becomes frozen (all the items in the frame
can not be seen) while the slaveframe works fine. The mainframe can
only be accessed again by killing the slaveframe.
I need the vtkRenderWindowInteractor to connect the
vtkImagePlaneWidget with the QVTKWidget (in the following simplified
code it did not show this). How should I implement such that in the
slaveframe I can interact with the vtkImagePlaneWidget and at the same
time (of course move the mouse onto the masterframe) I can interact
with the mainframe as wish.
The following is the problem code:

mainframe::initialSlaveframe(){
    vtkRenderer* ren1 = vtkRenderer::New();
    vtkRenderWindow* renWin1 = vtkRenderWindow::New();
    renWin1->AddRenderer(ren1);
    vtkRenderWindowInteractor* iren1 = vtkRenderWindowInteractor::New();
    iren1->SetRenderWindow(renWin1);
    iren1->Initialize();
    iren1->Start();
    slaveframe->qVTKWidget->SetRenderWindow(renWin1);
}

Thanks for help.

zl2k



More information about the vtkusers mailing list