<div dir="ltr">Hi Andras,<div><br></div><div>Would it be reasonable to add PythonQt support directly into the VTK build?</div><div><br></div><div> David<br><br><div class="gmail_quote"><div dir="ltr">On Sat, Sep 15, 2018 at 8:16 AM Andras Lasso <<a href="mailto:lasso@queensu.ca">lasso@queensu.ca</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12.0pt;line-height:1.3;color:#1f497d">
<div>The Qt OpenGL widget is Python-wrapped in CTK using PythonQt. The view widget has several improvements over the plain VTK widget, such as scheduleRender infrastructure to optimize calling of render() after changes in the VTK pipeline.
<br>
<br>
<a href="http://www.commontk.org" target="_blank">http://www.commontk.org</a><br>
<br>
It is used in 3D Slicer, MITK, etc. <br>
</div>
<br>
<div id="m_1758909948326891116signature-x" class="m_1758909948326891116signature_editor" style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12.0pt;color:#1f497d">
Andras<br>
</div>
</div>
<div id="m_1758909948326891116quoted_header" style="clear:both">
<hr style="border:none;height:1px;color:#e1e1e1;background-color:#e1e1e1">
<div style="border:none;padding:3.0pt 0cm 0cm 0cm"><span style="font-size:11.0pt;font-family:'Calibri','sans-serif'"><b>From:</b> David Gobbi <<a href="mailto:david.gobbi@gmail.com" target="_blank">david.gobbi@gmail.com</a>><br>
<b>Sent:</b> Saturday, September 15, 2018 9:58 AM<br>
<b>To:</b> Elvis Stansvik<br>
<b>Cc:</b> VTK Users<br>
<b>Subject:</b> Re: [vtkusers] Get a VTKRender to draw inside an external QWidget (ver5) (or QOpenGLWidget)<br>
</span></div>
</div>
<br type="attribution">
<div>
<div dir="ltr">
<div dir="ltr">Hi Elvis,
<div><br>
</div>
<div>QVTKOpenGLWidget is not available in Python, it would have to be</div>
<div>wrapped with sip (or shiboken) rather than with the stock VTK wrappers.</div>
<div><br>
</div>
<div>The old QVTKWidget was, at one point, wrapped in Python as shown here:</div>
<div><a href="https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitlab.kitware.com%2Fvtk%2Fvtk%2Fcommit%2Fd487197&data=02%7C01%7Classo%40queensu.ca%7Ca811ce9266714ebcb9a808d61b136097%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636726167389018144&sdata=UIeDsSTCw0YQ168bpV11UR8YcGbbrwmxMZBjeeSlx1A%3D&reserved=0" target="_blank">https://gitlab.kitware.com/vtk/vtk/commit/d487197</a> <br>
<br>
It's totally feasible to do something similar with QVTKOpenGLWidget, if</div>
<div>someone wants to dedicate the time.</div>
<div><br>
</div>
<div> - David</div>
<div><br>
<br>
<div class="gmail_quote">
<div dir="ltr">On Sat, Sep 15, 2018 at 6:06 AM Elvis Stansvik <<a href="mailto:elvis.stansvik@orexplore.com" target="_blank">elvis.stansvik@orexplore.com</a>> wrote:</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
I came across this thread while trying to find a QOpenGLWidget based<br>
VTK/PyQt5 widget.<br>
<br>
Just want to ask: The QVTKOpenGLWidget suggested here is not available<br>
from Python right? (since it's not a vtkObject).<br>
<br>
The OP asked about Python, and I'm sort of in the same boat.<br>
<br>
Elvis<br>
<br>
><br>
> Regards,<br>
> Martijn<br>
><br>
><br>
><br>
><br>
><br>
> Op 22 feb. 2018 21:10 schreef "Steve Petruzza" <<a href="mailto:spetruzza@sci.utah.edu" target="_blank">spetruzza@sci.utah.edu</a>>:<br>
>><br>
>> Hi,<br>
>><br>
>> I have a QOpenGLWidget that draws using gl calls. I would like to use a VTK render to draw inside the same canvas.<br>
>><br>
>> I tried to use a QVTKRenderWindowInteractor passing the canvas as parent, but the canvas starts flickering and I cannot see any rendering.<br>
>> The same VTK render (using the same QVTKRenderWindowInteractor) works correctly in a separate vtkrenderwindow.<br>
>><br>
>> 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?<br>
>> Or any other suggestions.<br>
>><br>
>> I am using VTK 8.1.0 and Qt 5.10 and this QVTKRenderWindowInteractor: <a href="https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitlab.kitware.com%2Falextsui05%2Fvtk%2Fblob%2Fe9e9ffcfbbad68343a0782a1d9024735b7649a46%2FWrapping%2FPython%2Fvtk%2Fqt5%2FQVTKRenderWindowInteractor.py&data=02%7C01%7Classo%40queensu.ca%7Ca811ce9266714ebcb9a808d61b136097%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636726167389018144&sdata=q62tMP%2ButZOYi13u%2FJ0Uv3GEWpLaZKRG%2FJpgk1BmjYk%3D&reserved=0" rel="noreferrer" target="_blank">
https://gitlab.kitware.com/alextsui05/vtk/blob/e9e9ffcfbbad68343a0782a1d9024735b7649a46/Wrapping/Python/vtk/qt5/QVTKRenderWindowInteractor.py</a><br>
>><br>
>> Thank you,<br>
>> Steve<br>
</blockquote>
</div>
</div>
</div>
</div>
</div>
</div>

</blockquote></div></div></div>