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

Elvis Stansvik elvis.stansvik at orexplore.com
Sat Sep 15 08:06:11 EDT 2018


Den tors 22 feb. 2018 kl 21:42 skrev Martijn Koopman <koopman.mk at gmail.com>:
>
> Hi Steve,
>
> I believe what you're looking for is  QVTKOpenGLWidget.
>
> It is a subclass of QOpenGLWidget.
>
> See https://www.vtk.org/doc/nightly/html/classQVTKOpenGLWidget.html

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
>>
>>
>>
>>
>>
>>
>> _______________________________________________
>> 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
>>
>> Search the list archives at: http://markmail.org/search/?q=vtkusers
>>
>> Follow this link to subscribe/unsubscribe:
>> https://vtk.org/mailman/listinfo/vtkusers
>>
> _______________________________________________
> 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
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> https://vtk.org/mailman/listinfo/vtkusers


More information about the vtkusers mailing list