<div dir="ltr">Yes, what you are doing in (1) is all good. That is the right way to do it.</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Dec 19, 2016 at 8:48 AM, Romain CENDRE <span dir="ltr"><<a href="mailto:romain.cendre@optopartner.com" target="_blank">romain.cendre@optopartner.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-family:arial,helvetica,sans-serif;font-size:12pt;color:#000000"><div>Ok thanks for your advices Ken, I will tryit.<br><br></div><div>1) At this time I've made this to create my pipe:</div><div><br></div><div><br></div><div><br></div><div> //Set input data to luminance (PNG data)<br> m_luminanceFilter-><wbr>SetInputConnection(m_reader-><wbr>GetOutputPort());<br> //Extract as a set of polygons<br> m_geometryFilter-><wbr>SetInputConnection(m_<wbr>luminanceFilter-><wbr>GetOutputPort());<br> //Increase scale of geometry variations<br> m_warp->SetInputConnection(m_<wbr>geometryFilter->GetOutputPort(<wbr>));<br> m_warp->SetScaleFactor(-.3);<br> //Now we just have to merge our data (color) and level map (geometry) that's all<br> m_merge-><wbr>SetGeometryConnection(m_warp-><wbr>GetOutputPort());<br> m_merge->SetScalarsConnection(<wbr>m_reader->GetOutputPort());<br> <br> //Transition between datas and actors<br> m_mapper->SetInputConnection(<wbr>m_merge->GetOutputPort());<br><br> //Create an actor to provide a representation to our 2D data<br> m_actor->SetMapper(m_mapper);</div><div><br></div><div><br></div><div>After that, I'm only doing m_reader->SetFileName(<wbr>fileName.toStdString().c_str()<wbr>); to change my data.<br>I've supposed that all pipe refresh itself.</div><div><br></div><div>2) I will explore this way after the first thing.<br><br>I will come back!</div><div><br></div><div>Thanks!</div><div><br></div><hr id="m_4451402436139775409zwchr"><div><b>De: </b>"Ken Martin" <<a href="mailto:ken.martin@kitware.com" target="_blank">ken.martin@kitware.com</a>><br><b>À: </b>"Romain CENDRE" <<a href="mailto:romain.cendre@optopartner.com" target="_blank">romain.cendre@optopartner.com</a><wbr>><br><b>Envoyé: </b>Lundi 19 Décembre 2016 14:41:00<br><b>Objet: </b>Re: [vtk-developers] Error on glGenQueries<br></div><br><div><div dir="ltr"><div>That code looks fine. Two ideas of what the issue could be<br></div><br><div>1) you mentioned holding onto ImageMagnitude and changing its data inside. I'm not sure how your doing that but if you are messing with the underlying C++ data in an image data instance make sure you mark the data as modified. ala myImageData->Modified() maybe even myImageData->GetPointData()-><wbr>GetScalars()->Modified();</div><br><div>2) is the rendering working prior to calling resetCamera?  If so maybe try commenting out the ParallelProjection although I doubt that is it. If you are rendering correctly before that call, and not creating a different window, then you should be OK. Nothing in that code looks problematic. One other thing you can try is adding a m_renderWindow(or whatever your renderWindow is named, maybe this) ->ReleaseGraphicsResources(m_<wbr>renderWindow); call at the end of your resetCamera. If something funny is going on with multiple windows that may fix it.</div><br><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Dec 19, 2016 at 8:28 AM, Romain CENDRE <span dir="ltr"><<a href="mailto:romain.cendre@optopartner.com" target="_blank">romain.cendre@optopartner.com</a><wbr>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-family:arial,helvetica,sans-serif;font-size:12pt;color:#000000"><div>Hi Ken!<br><br></div><div>This is my resetView() function:</div><br><div>void QVTKDisplay::resetView()<br>{ <br> double * bounds = m_actor->GetBounds();<br><br> double imageCenterX = 0.5f * (bounds[1] - bounds[0]);<br> double imageCenterY = 0.5f * (bounds[3] - bounds[2]);<br> double imageWidth = bounds[1] - bounds[0];<br> double imageHeight = bounds[3] - bounds[2];<br><br> m_renderer->ResetCamera();<br> m_renderer->GetActiveCamera()-<wbr>>ParallelProjectionOn();<br> m_renderer->GetActiveCamera()-<wbr>>SetFocalPoint(imageCenterX, imageCenterY, 0.f);<br> m_renderer->GetActiveCamera()-<wbr>>SetPosition( imageCenterX, imageCenterY, m_renderer->GetActiveCamera()-<wbr>>GetDistance());<br> m_renderer->GetActiveCamera()-<wbr>>SetViewUp(0, 1, 0);<br> //m_renderer->Render();<br>}</div><br><div>I try to keep always the same instance of object, idem for window.<br>Does it answer to your question?</div><br><hr id="m_4451402436139775409m_7867017216963902664zwchr"><div><b>De: </b>"Ken Martin" <<a href="mailto:ken.martin@kitware.com" target="_blank">ken.martin@kitware.com</a>><br><b>À: </b>"Romain CENDRE" <<a href="mailto:romain.cendre@optopartner.com" target="_blank">romain.cendre@optopartner.com</a><wbr>><br><b>Cc: </b>"vtk-developers" <<a href="mailto:vtk-developers@vtk.org" target="_blank">vtk-developers@vtk.org</a>><br><b>Envoyé: </b>Lundi 19 Décembre 2016 14:23:49<br><b>Objet: </b>Re: [vtk-developers] Error on glGenQueries<br></div><br><div><div dir="ltr">What version of VTK are you using? How do you change your camera? Using the same window or creating a new one?<br><div>Ken</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Dec 19, 2016 at 4:01 AM, Romain CENDRE <span dir="ltr"><<a href="mailto:romain.cendre@optopartner.com" target="_blank">romain.cendre@optopartner.com</a><wbr>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-family:arial,helvetica,sans-serif;font-size:12pt;color:#000000"><div>Hi everyone,</div><div>I'm new and I'm starting to work on VTK.</div><br><div>////    CONTEXT</div><br><div>We use VTK with OpenGL2 (don't ask me why, it's not mandatory, it was choosen by a previous developper).<br><br>I've made a Pipeline made like this:</div><br><div>2D data image   =>   vtkImageMagnitude  => vtkImageDataGeometryFilter  =>  vtkWarpScalar => vtkMergeFilter (geometry)  => Actor</div><div>                                                                   =============================<wbr>============> <span style="color:#000000;font-family:arial,helvetica,sans-serif;font-size:16px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:#ffffff;display:inline!important;float:none">vtkMergeFilter (Scalars)</span></div><div><span style="color:#000000;font-family:arial,helvetica,sans-serif;font-size:16px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:#ffffff;display:inline!important;float:none"><br></span></div><div><span style="color:#000000;font-family:arial,helvetica,sans-serif;font-size:16px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:#ffffff;display:inline!important;float:none">I keep a reference on vtkImageMagnitude  to change image data stored inside, hope that all the pipe refresh itself and it seems to work at this time.</span></div><div><span style="color:#000000;font-family:arial,helvetica,sans-serif;font-size:16px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:#ffffff;display:inline!important;float:none"><br></span></div><div>My image actor is included in a Renderer, with an cubeAxesActor, a ScalarBar and  a LegendScaleActor.</div><br><div>All pipeline objects are started one time at the start.</div><br><br><div>////    PROBLEM</div><br><div>My problem is when I want to change my camera location (to get a 2D view) and call Render() on the renderer to refresh scene I get the following error:</div><br><div>vtkOpenGLRenderer (0537D740): failed after Clear 16 OpenGL errors detected<br> 0 : (1282) Invalid operation<br> 1 : (1282) Invalid operation<br> 2 : (1282) Invalid operation<br> 3 : (1282) Invalid operation<br> 4 : (1282) Invalid operation<br> 5 : (1282) Invalid operation<br> 6 : (1282) Invalid operation<br> 7 : (1282) Invalid operation<br> 8 : (1282) Invalid operation<br> 9 : (1282) Invalid operation<br> 10 : (1282) Invalid operation<br> 11 : (1282) Invalid operation<br> 12 : (1282) Invalid operation<br> 13 : (1282) Invalid operation<br> 14 : (1282) Invalid operation<br> 15 : (1282) Invalid operation<br><br><br>ERROR: In ..\..\..\sources\Rendering\<wbr>OpenGL2\vtkOpenGLCamera.cxx, line 144<br>vtkOpenGLCamera (053D4D20): failed after Render 16 OpenGL errors detected<br> 0 : (1282) Invalid operation<br> 1 : (1282) Invalid operation<br> 2 : (1282) Invalid operation<br> 3 : (1282) Invalid operation<br> 4 : (1282) Invalid operation<br> 5 : (1282) Invalid operation<br> 6 : (1282) Invalid operation<br> 7 : (1282) Invalid operation<br> 8 : (1282) Invalid operation<br> 9 : (1282) Invalid operation<br> 10 : (1282) Invalid operation<br> 11 : (1282) Invalid operation<br> 12 : (1282) Invalid operation<br> 13 : (1282) Invalid operation<br> 14 : (1282) Invalid operation<br> 15 : (1282) Invalid operation<br><br><br>ERROR: In ..\..\..\sources\Rendering\<wbr>OpenGL2\vtkOpenGLRenderer.cxx, line 125<br>vtkOpenGLRenderer (0537D740): failed after UpdateLights 16 OpenGL errors detected<br> 0 : (1282) Invalid operation<br> 1 : (1282) Invalid operation<br> 2 : (1282) Invalid operation<br> 3 : (1282) Invalid operation<br> 4 : (1282) Invalid operation<br> 5 : (1282) Invalid operation<br> 6 : (1282) Invalid operation<br> 7 : (1282) Invalid operation<br> 8 : (1282) Invalid operation<br> 9 : (1282) Invalid operation<br> 10 : (1282) Invalid operation<br> 11 : (1282) Invalid operation<br> 12 : (1282) Invalid operation<br> 13 : (1282) Invalid operation<br> 14 : (1282) Invalid operation<br> 15 : (1282) Invalid operation<br><br><br>ERROR: In ..\..\..\sources\Rendering\<wbr>OpenGL2\vtkOpenGLProperty.cxx, line 91<br>vtkOpenGLProperty (05A061E8): failed after Render 16 OpenGL errors detected<br> 0 : (1282) Invalid operation<br> 1 : (1282) Invalid operation<br> 2 : (1282) Invalid operation<br> 3 : (1282) Invalid operation<br> 4 : (1282) Invalid operation<br> 5 : (1282) Invalid operation<br> 6 : (1282) Invalid operation<br> 7 : (1282) Invalid operation<br> 8 : (1282) Invalid operation<br> 9 : (1282) Invalid operation<br> 10 : (1282) Invalid operation<br> 11 : (1282) Invalid operation<br> 12 : (1282) Invalid operation<br> 13 : (1282) Invalid operation<br> 14 : (1282) Invalid operation<br> 15 : (1282) Invalid operation<br></div><br><br><div>The error happens at this line :</div><br><div style="padding-left:30px"> if (this->TimerQuery == 0)<br> {<br>   glGenQueries(1, static_cast<GLuint*>(&this-><wbr>TimerQuery));<br> }</div><div style="padding-left:30px"><br></div><div>If you want my code, you can ask me.</div><br><div>I think it's just a newbie problem, but I don't find anything on it.</div><br><div>Best regards</div><span class="m_4451402436139775409m_7867017216963902664HOEnZb"><span style="color:#888888"><div>Romain</div></span></span></div></div><br>______________________________<wbr>_________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtk-developers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>vtk-developers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtk-developers" rel="noreferrer" target="_blank">http://public.kitware.com/<wbr>mailman/listinfo/vtk-<wbr>developers</a><br>
<br>
<br></blockquote></div><span class="m_4451402436139775409HOEnZb"><span color="#888888" style="color:#888888"><br><br clear="all"><span class="HOEnZb"><font color="#888888"><br>-- <br><div class="m_4451402436139775409m_7867017216963902664gmail_signature">Ken Martin PhD<div>Chairman & CFO<br>Kitware Inc.<br>28 Corporate Drive<br>Clifton Park NY 12065<br><a href="tel:(518)%20371-3971" target="_blank">518 371 3971</a><br><div><span style="font-size:10pt;font-family:Tahoma,sans-serif">This communication,
including all attachments, contains confidential and legally privileged
information, and it is intended only for the use of the addressee.  Access to this email by anyone else is
unauthorized. If you are not the intended recipient, any disclosure, copying,
distribution or any action taken in reliance on it is prohibited and may be
unlawful. If you received this communication in error please notify us
immediately and destroy the original message. 
Thank you.</span></div></div></div>
</font></span></span></span></div><span class="HOEnZb"><font color="#888888"><br></font></span></div></div></div></blockquote></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><br>-- <br><div class="m_4451402436139775409gmail_signature">Ken Martin PhD<div>Chairman & CFO<br>Kitware Inc.<br>28 Corporate Drive<br>Clifton Park NY 12065<br><a href="tel:(518)%20371-3971" value="+15183713971" target="_blank">518 371 3971</a><br><div><span style="font-size:10pt;font-family:Tahoma,sans-serif">This communication,
including all attachments, contains confidential and legally privileged
information, and it is intended only for the use of the addressee.  Access to this email by anyone else is
unauthorized. If you are not the intended recipient, any disclosure, copying,
distribution or any action taken in reliance on it is prohibited and may be
unlawful. If you received this communication in error please notify us
immediately and destroy the original message. 
Thank you.</span></div></div></div>
</font></span></div></div><br></div></div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Ken Martin PhD<div>Chairman & CFO<br>Kitware Inc.<br>28 Corporate Drive<br>Clifton Park NY 12065<br>518 371 3971<div><br></div><div><span style="font-size:10pt;font-family:Tahoma,sans-serif">This communication,
including all attachments, contains confidential and legally privileged
information, and it is intended only for the use of the addressee.  Access to this email by anyone else is
unauthorized. If you are not the intended recipient, any disclosure, copying,
distribution or any action taken in reliance on it is prohibited and may be
unlawful. If you received this communication in error please notify us
immediately and destroy the original message. 
Thank you.</span></div></div></div>
</div>