[vtkusers] Get a VTKRender to draw inside an external QWidget (ver5) (or QOpenGLWidget)

David Gobbi david.gobbi at gmail.com
Sat Sep 15 09:58:39 EDT 2018


Hi Elvis,

QVTKOpenGLWidget is not available in Python, it would have to be
wrapped with sip (or shiboken) rather than with the stock VTK wrappers.

The old QVTKWidget was, at one point, wrapped in Python as shown here:
https://gitlab.kitware.com/vtk/vtk/commit/d487197

It's totally feasible to do something similar with QVTKOpenGLWidget, if
someone wants to dedicate the time.

 - David


On Sat, Sep 15, 2018 at 6:06 AM Elvis Stansvik <elvis.stansvik at orexplore.com>
wrote:

>
> I came across this thread while trying to find a QOpenGLWidget based
> VTK/PyQt5 widget.
>
> Just want to ask: The QVTKOpenGLWidget suggested here is not available
> from Python right? (since it's not a vtkObject).
>
> The OP asked about Python, and I'm sort of in the same boat.
>
> Elvis
>
> >
> > Regards,
> > Martijn
> >
> >
> >
> >
> >
> > Op 22 feb. 2018 21:10 schreef "Steve Petruzza" <spetruzza at sci.utah.edu>:
> >>
> >> Hi,
> >>
> >> I have a QOpenGLWidget that draws using gl calls. I would like to use a
> VTK render to draw inside the same canvas.
> >>
> >> I tried to use a QVTKRenderWindowInteractor passing the canvas as
> parent, but the canvas starts flickering and I cannot see any rendering.
> >> The same VTK render (using the same QVTKRenderWindowInteractor) works
> correctly in a separate vtkrenderwindow.
> >>
> >> Is there any simple way to just get the VTKRender to draw directly into
> the glRender loop of the canvas using the existing rendering window?
> >> Or any other suggestions.
> >>
> >> I am using VTK 8.1.0 and Qt 5.10 and this QVTKRenderWindowInteractor:
> https://gitlab.kitware.com/alextsui05/vtk/blob/e9e9ffcfbbad68343a0782a1d9024735b7649a46/Wrapping/Python/vtk/qt5/QVTKRenderWindowInteractor.py
> >>
> >> Thank you,
> >> Steve
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://public.kitware.com/pipermail/vtkusers/attachments/20180915/d1c229ad/attachment.html>


More information about the vtkusers mailing list