[vtkusers] Rendering VTK inside a QGLWidget

Paul Rossi paulrossi at mail.ru
Mon Oct 17 05:06:06 EDT 2011


Hi Clint, so after having played around a little with the vtkGraphLayoutView, following
your tips, i found out that this class seemingly works fine inside a simple qglwidget, 
but in the framework i use it doesnt work properly (for some reasons which i dont know, 
perhaps the fbo usage)

essentially, the problem is this line:

m_vtkGraphLayoutView = vtkGraphLayoutView::New();

which causes "stack overflow" as OpenGL error.

Maybe this happens because the vtkGraphLayoutView comes with a renderwindow, which
interferes somehow with opengl? Do you have any idea how to solve this?
by the way, i found in the RenderViewBase class documentation the following:

 In order to use the view with a QVTKWidget the following code is required to 
 ensure the interactor and render window are initialized properly.

 QVTKWidget *widget = new QVTKWidget;
 vtkContextView *view = vtkContextView::New();
 view->SetInteractor(widget->GetInteractor());
 widget->SetRenderWindow(view->GetRenderWindow());

the problem is that it is not possible to do this with a qglwidget..



More information about the vtkusers mailing list