<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<font style="color: rgb(0, 0, 0); font-size: 13px; font-style:
normal; font-variant: normal; font-weight: normal; letter-spacing:
normal; line-height: normal; orphans: auto; text-align: start;
text-indent: 0px; text-transform: none; white-space: normal;
widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255);" color="#000000"
face="Arial">Hi,</font>
<div style="color: rgb(0, 0, 0); font-family: Tahoma, Verdana;
font-size: 13px; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height: normal;
orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: 1;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255);"><font color="#000000"
face="Arial"><br>
</font></div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma, Verdana;
font-size: 13px; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height: normal;
orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: 1;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255);"><font color="#000000"
face="Arial">I will answer my own question. It might help
someone one day.</font></div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma, Verdana;
font-size: 13px; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height: normal;
orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: 1;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255);"><font color="#000000"
face="Arial"><br>
</font></div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma, Verdana;
font-size: 13px; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height: normal;
orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: 1;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255);">So for those interested, I
managed to make it work. In the QVTKFrameBufferObjectItem class, I
used a vtkExternalOpenGLRenderWindow instead of a
vtkGenericOpenGLRenderWindow. I passed directly the
vtkExternalOpenGLRenderWindow object to the
QVTKFramebufferObjectRenderer's constructor. No need to define a
vtkInternalOpenGLRenderWindow anymore. And in the render() method
of QVTKFramebufferObjectRenderer I simply call Render() on this
vtkExternalOpenGLRenderWindow object (no push/pop state nor
OpenGlInitState). It works with VTK 7.0 rc (and therefore the
"new" OpenGL2 backend of VTK). I'm not sure it's the way that
QVTKFrameBufferObjectItem and vtkExternalOpenGLRenderWindow are
intented to be combined, but it works...</div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma, Verdana;
font-size: 13px; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height: normal;
orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: 1;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255);"><br>
</div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma, Verdana;
font-size: 13px; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height: normal;
orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: 1;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255);">Cheers,</div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma, Verdana;
font-size: 13px; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height: normal;
orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: 1;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255);"><br>
</div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma, Verdana;
font-size: 13px; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height: normal;
orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: 1;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255);">Olivier</div>
<font color="#000000" face="Arial">
<div><br>
</div>
</font>
<blockquote class="history_container" type="cite"
style="border-left-style: solid;border-width: 1px;margin-top:
20px;margin-left: 0px;padding-left: 10px;min-width: 500px"
id="blockquote635883879702468533">
<p style="color: #AAAAAA; margin-top: 10px;">On 11/01/2016
13:12:35, Olivier Comas <a class="moz-txt-link-rfc2396E" href="mailto:ocomas@apelem.com"><ocomas@apelem.com></a> wrote:</p>
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US">Hi everyone,</span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="EN-US">I was wondering if
anyone managed to integrate VTK and Qt Quick 2. I found this
post: <a
href="https://gist.github.com/nocnokneo/c3fb01bb7ecaf437f7d6"><a class="moz-txt-link-freetext" href="https://gist.github.com/nocnokneo/c3fb01bb7ecaf437f7d6">https://gist.github.com/nocnokneo/c3fb01bb7ecaf437f7d6</a></a>
which gives an example of integration. And it works great
with VTK 6.3. But using the OpenGL2 backend in 6.3 or using
VTK 7.0 rc, it crashes in OpenGLInitState() at the first
OpenGL call. Even a call to “glEnable(GL_DEBUG_OUTPUT);”
crashes. I checked the handle returned by
wglGetCurrentContext() and it’s not NULL so it seems to have
a valid OpenGL context. That would be awesome to be able to
use the “new” VTK rendering backend along with a GUI made
with Qt Quick 2.<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="EN-US">I also found this post
from Kitware: </span><a
href="http://www.kitware.com/blog/home/post/688"><a class="moz-txt-link-freetext" href="http://www.kitware.com/blog/home/post/688">http://www.kitware.com/blog/home/post/688</a></a><span
lang="EN-US">. If I understand correctly, </span>ExternalVTKWidget<span
lang="EN-US"> seems to be a helper class for making it
easier to use </span>vtkExternalOpenGLRenderWindow<span
lang="EN-US">, </span>vtkExternalOpenGLRender<span
lang="EN-US"> and </span>vtkExternalOpenGL<span
lang="EN-US">Camera. But I could not find any working
example. How is it supposed to be used? Could we use those
classes in a class inheriting from QWindow so VTK can use
the OpenGL context created by Qt? It is how those classes
are intented to be used?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Do you intend to release
a QVTKQuickItem or QVTKWindow at some point? I know there is
a QVTKWidget but there is nothing for Qt Quick. From my
understanding, </span>ExternalVTKWidget<span lang="EN-US">
could be used for QtQuick integration. So do you intent to
release a class to support QtQuick? An example on how to use
</span>ExternalVTKWidget<span lang="EN-US"> would be great
already.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Any help would be
greatly appreciated.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Regards,</span></p>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">O<span
lang="EN-US">livier</span></p>
<p class="MsoNormal"><span
style="font-size:12.0pt;font-family:"Times New
Roman",serif"><o:p> </o:p></span></p>
</div>
</blockquote>
</body>
</html>