[vtk-developers] vtkGenericOpenGLRenderWindow thoughts

Clinton Stimpson clinton at elemtech.com
Thu May 27 19:22:05 EDT 2010


Thanks for the feedback.

I have run into an issue using this vtkGenericOpenGLRenderWindow with a 
framebuffer object that gets drawn into a main scene.  That embedded scene has 
interaction enabled.

Classes like vtkInteractorStyleRubberBand2D assume they can do a 
GetRGBACharPixelData() SetRGBACharPixelData() and Frame() to make the rubber 
band show up on the screen.  The problem is that Frame() doesn't make it show 
up on the user's screen, nor does it seem that it could.

Does anyone see a solution to this?  Can it be done using vtkRenderer's 
BackingStore, so a normal Render() can be called from the code drawing the 
main scene?

Thanks,
Clint

On Tuesday, May 25, 2010 12:47:57 pm Francois Bertel wrote:
> > MakeCurrent() is stubbed (along with the majority of the pure virtual
> > functions), and the caller of vtkGenericRenderWindow::Render() makes the
> > context current.
> 
> You cannot do the assumption. There are case where you are in the
> middle of rendering, you invoke a progress event, some callback
> actually refresh some other window, so can change the context. After
> you invoke the progress event, you must
> call MakeCurrent().
> 
> On Tue, May 25, 2010 at 2:21 PM, David Gobbi <david.gobbi at gmail.com> wrote:
> > I think that a vtkGenericOpenGLRenderWindow would be very useful.
> > Things like MakeCurrent() can be implemented via callbacks, in fact
> > vtkGenericOpenGLRenderWindow would need far fewer callbacks than e.g.
> > vtkGenericRenderWindowInteractor.
> > 
> >   David
> > 
> > 
> > On Tue, May 25, 2010 at 11:39 AM, Francois Bertel
> > 
> > <francois.bertel at kitware.com> wrote:
> >> Hi,
> >> 
> >> Can you please elaborate about the OpenGL functionality in Qt you want
> >> to use?
> >> 
> >> How would you do a vtkGenericOpenGLRenderWindow? How to pass context
> >> information? How would you implement MakeCurrent(), for example?
> >> 
> >> On Tue, May 25, 2010 at 1:27 PM, Clinton Stimpson <clinton at elemtech.com> 
wrote:
> >>> Hi,
> >>> 
> >>> Does anyone see any issues with having a class
> >>> vtkGenericOpenGLRenderWindow in VTK which would allow one to render a
> >>> VTK scene into a drawable & context of their own?
> >>> 
> >>> The reason I'm looking at this is because there is a great deal of
> >>> OpenGL functionality in Qt that can easily be used with this approach.
> >>>  The code in interest is not in a public api and is accessible only
> >>> through using Qt's classes that manage drawables and contexts.
> >>> 
> >>> I wonder if it'll be an issue as I'm seeing code in
> >>> vtkCameraPass::Render that checks if its drawing to a framebuffer
> >>> object, when it couldn't know if it is drawing to a framebuffer object
> >>> created on the Qt side.
> >>> 
> >>> Any thoughts?
> >>> 
> >>> Thanks,
> >>> Clint
> >>> _______________________________________________
> >>> Powered by www.kitware.com
> >>> 
> >>> Visit other Kitware open-source projects at
> >>> http://www.kitware.com/opensource/opensource.html
> >>> 
> >>> Follow this link to subscribe/unsubscribe:
> >>> http://www.vtk.org/mailman/listinfo/vtk-developers
> >> 
> >> --
> >> François Bertel, PhD  | Kitware Inc. Suite 204
> >> 1 (518) 371 3971 x113 | 28 Corporate Drive
> >>                      | Clifton Park NY 12065, USA
> >> _______________________________________________
> >> Powered by www.kitware.com
> >> 
> >> Visit other Kitware open-source projects at
> >> http://www.kitware.com/opensource/opensource.html
> >> 
> >> Follow this link to subscribe/unsubscribe:
> >> http://www.vtk.org/mailman/listinfo/vtk-developers
> > 
> > _______________________________________________
> > Powered by www.kitware.com
> > 
> > Visit other Kitware open-source projects at
> > http://www.kitware.com/opensource/opensource.html
> > 
> > Follow this link to subscribe/unsubscribe:
> > http://www.vtk.org/mailman/listinfo/vtk-developers



More information about the vtk-developers mailing list