[vtkusers] vtkQtGraphicsViewRenderWindow

Clinton Stimpson clinton at elemtech.com
Fri Mar 30 10:39:05 EDT 2012


On Friday, March 30, 2012 08:11:45 am Doug Hoppes wrote:
> Yeah, I saw the example.  Is one method more efficient than the other one?

I'm not sure about performance, but one potential problem I see when I look 
over the code for vtkQtGraphicsViewRenderWindow, is that it uses QGLWidget  
vtkXOpenGLRenderWindow (on X11).  Each create their own OpenGL context for the 
same window, which I find confusing, and I imagine code using textures would be 
confused too.

> 
> The current idea that I'm using is that, in my QT application, I have a
> VTKView class that is sub-classed from QGraphicsView. Inside this class, I
> create an instance of the QVTKWidget2 (just like the example).
> 
> I DO like the idea of just adding QVTKGraphicsItem to my scene. If the user
> resizes the window, wouldn't I need to resize the graphics Item (so that
> it fully takes up my window)?

I wouldn't make an item to draw in the whole window all the time.  You'd 
already have QVTKWidget2 as the viewport widget, so you can use that.  The 
items use a FBO to render the vtk scene, so there is some overhead in that.

Clint

> 
> -----Original Message-----
> From: Clinton Stimpson [mailto:clinton at elemtech.com]
> Sent: Friday, March 30, 2012 10:06 AM
> To: vtkusers at vtk.org
> Cc: Doug Hoppes
> Subject: Re: [vtkusers] vtkQtGraphicsViewRenderWindow
> 
> 
> You can also have a look at the code in VTK/Examples/GUI/Qt/GraphicsView.
> It uses QVTKWidget2 instead of QVTKWidget as the viewport widget in a
> QGraphicsView.
> 
> There is also a QVTKGraphicsItem class if you want a VTK window as an item
> in the QGraphicsView.
> 
> On Friday, March 30, 2012 07:30:37 am Doug Hoppes wrote:
> > Forgot to mention:
> > 
> > 
> > In my current application, I already use the QVTKWidget to show my VTK
> > window in QT.  That works great.  However, I need to have the VTK
> > window inside of a QGraphicsView so that I can have my QTGraphicItems
> > (overlays) show over my VTK window.
> > 
> > 
> > From: vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] On
> > Behalf Of Doug Hoppes Sent: Friday, March 30, 2012 9:07 AM
> > To: vtkusers at vtk.org
> > Subject: [vtkusers] vtkQtGraphicsViewRenderWindow
> > 
> > I just downloaded the 10.0.0RC1.  Is this class not available?  I saw
> > some earlier postings about using the VTK window inside of the
> > QGraphicsView.
> > 
> > I also saw some postings for using the OpenGL/QVTKWidget2.  Should I
> > be using that class, instead?
> > 
> > Dougie
> 
> --
> Clinton Stimpson
> Elemental Technologies, Inc
> Computational Simulation Software, LLC
> www.csimsoft.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

-- 
Clinton Stimpson
Elemental Technologies, Inc
Computational Simulation Software, LLC
www.csimsoft.com



More information about the vtkusers mailing list