[vtk-developers] Error on glGenQueries

Romain CENDRE romain.cendre at optopartner.com
Mon Dec 19 08:48:57 EST 2016


Ok thanks for your advices Ken, I will tryit. 

1) At this time I've made this to create my pipe: 



//Set input data to luminance (PNG data) 
m_luminanceFilter->SetInputConnection(m_reader->GetOutputPort()); 
//Extract as a set of polygons 
m_geometryFilter->SetInputConnection(m_luminanceFilter->GetOutputPort()); 
//Increase scale of geometry variations 
m_warp->SetInputConnection(m_geometryFilter->GetOutputPort()); 
m_warp->SetScaleFactor(-.3); 
//Now we just have to merge our data (color) and level map (geometry) that's all 
m_merge->SetGeometryConnection(m_warp->GetOutputPort()); 
m_merge->SetScalarsConnection(m_reader->GetOutputPort()); 

//Transition between datas and actors 
m_mapper->SetInputConnection(m_merge->GetOutputPort()); 

//Create an actor to provide a representation to our 2D data 
m_actor->SetMapper(m_mapper); 


After that, I'm only doing m_reader->SetFileName(fileName.toStdString().c_str()); to change my data. 
I've supposed that all pipe refresh itself. 

2) I will explore this way after the first thing. 

I will come back! 

Thanks! 


De: "Ken Martin" <ken.martin at kitware.com> 
À: "Romain CENDRE" <romain.cendre at optopartner.com> 
Envoyé: Lundi 19 Décembre 2016 14:41:00 
Objet: Re: [vtk-developers] Error on glGenQueries 

That code looks fine. Two ideas of what the issue could be 

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()->GetScalars()->Modified(); 

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_renderWindow); call at the end of your resetCamera. If something funny is going on with multiple windows that may fix it. 



On Mon, Dec 19, 2016 at 8:28 AM, Romain CENDRE < romain.cendre at optopartner.com > wrote: 



Hi Ken! 

This is my resetView() function: 

void QVTKDisplay::resetView() 
{ 
double * bounds = m_actor->GetBounds(); 

double imageCenterX = 0.5f * (bounds[1] - bounds[0]); 
double imageCenterY = 0.5f * (bounds[3] - bounds[2]); 
double imageWidth = bounds[1] - bounds[0]; 
double imageHeight = bounds[3] - bounds[2]; 

m_renderer->ResetCamera(); 
m_renderer->GetActiveCamera()->ParallelProjectionOn(); 
m_renderer->GetActiveCamera()->SetFocalPoint(imageCenterX, imageCenterY, 0.f); 
m_renderer->GetActiveCamera()->SetPosition( imageCenterX, imageCenterY, m_renderer->GetActiveCamera()->GetDistance()); 
m_renderer->GetActiveCamera()->SetViewUp(0, 1, 0); 
//m_renderer->Render(); 
} 

I try to keep always the same instance of object, idem for window. 
Does it answer to your question? 


De: "Ken Martin" < ken.martin at kitware.com > 
À: "Romain CENDRE" < romain.cendre at optopartner.com > 
Cc: "vtk-developers" < vtk-developers at vtk.org > 
Envoyé: Lundi 19 Décembre 2016 14:23:49 
Objet: Re: [vtk-developers] Error on glGenQueries 

What version of VTK are you using? How do you change your camera? Using the same window or creating a new one? 
Ken 

On Mon, Dec 19, 2016 at 4:01 AM, Romain CENDRE < romain.cendre at optopartner.com > wrote: 

BQ_BEGIN

Hi everyone, 
I'm new and I'm starting to work on VTK. 

//// CONTEXT 

We use VTK with OpenGL2 (don't ask me why, it's not mandatory, it was choosen by a previous developper). 

I've made a Pipeline made like this: 

2D data image => vtkImageMagnitude => vtkImageDataGeometryFilter => vtkWarpScalar => vtkMergeFilter (geometry) => Actor 
=========================================> vtkMergeFilter (Scalars) 

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. 

My image actor is included in a Renderer, with an cubeAxesActor, a ScalarBar and a LegendScaleActor. 

All pipeline objects are started one time at the start. 


//// PROBLEM 

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: 

vtkOpenGLRenderer (0537D740): failed after Clear 16 OpenGL errors detected 
0 : (1282) Invalid operation 
1 : (1282) Invalid operation 
2 : (1282) Invalid operation 
3 : (1282) Invalid operation 
4 : (1282) Invalid operation 
5 : (1282) Invalid operation 
6 : (1282) Invalid operation 
7 : (1282) Invalid operation 
8 : (1282) Invalid operation 
9 : (1282) Invalid operation 
10 : (1282) Invalid operation 
11 : (1282) Invalid operation 
12 : (1282) Invalid operation 
13 : (1282) Invalid operation 
14 : (1282) Invalid operation 
15 : (1282) Invalid operation 


ERROR: In ..\..\..\sources\Rendering\OpenGL2\vtkOpenGLCamera.cxx, line 144 
vtkOpenGLCamera (053D4D20): failed after Render 16 OpenGL errors detected 
0 : (1282) Invalid operation 
1 : (1282) Invalid operation 
2 : (1282) Invalid operation 
3 : (1282) Invalid operation 
4 : (1282) Invalid operation 
5 : (1282) Invalid operation 
6 : (1282) Invalid operation 
7 : (1282) Invalid operation 
8 : (1282) Invalid operation 
9 : (1282) Invalid operation 
10 : (1282) Invalid operation 
11 : (1282) Invalid operation 
12 : (1282) Invalid operation 
13 : (1282) Invalid operation 
14 : (1282) Invalid operation 
15 : (1282) Invalid operation 


ERROR: In ..\..\..\sources\Rendering\OpenGL2\vtkOpenGLRenderer.cxx, line 125 
vtkOpenGLRenderer (0537D740): failed after UpdateLights 16 OpenGL errors detected 
0 : (1282) Invalid operation 
1 : (1282) Invalid operation 
2 : (1282) Invalid operation 
3 : (1282) Invalid operation 
4 : (1282) Invalid operation 
5 : (1282) Invalid operation 
6 : (1282) Invalid operation 
7 : (1282) Invalid operation 
8 : (1282) Invalid operation 
9 : (1282) Invalid operation 
10 : (1282) Invalid operation 
11 : (1282) Invalid operation 
12 : (1282) Invalid operation 
13 : (1282) Invalid operation 
14 : (1282) Invalid operation 
15 : (1282) Invalid operation 


ERROR: In ..\..\..\sources\Rendering\OpenGL2\vtkOpenGLProperty.cxx, line 91 
vtkOpenGLProperty (05A061E8): failed after Render 16 OpenGL errors detected 
0 : (1282) Invalid operation 
1 : (1282) Invalid operation 
2 : (1282) Invalid operation 
3 : (1282) Invalid operation 
4 : (1282) Invalid operation 
5 : (1282) Invalid operation 
6 : (1282) Invalid operation 
7 : (1282) Invalid operation 
8 : (1282) Invalid operation 
9 : (1282) Invalid operation 
10 : (1282) Invalid operation 
11 : (1282) Invalid operation 
12 : (1282) Invalid operation 
13 : (1282) Invalid operation 
14 : (1282) Invalid operation 
15 : (1282) Invalid operation 


The error happens at this line : 

if (this->TimerQuery == 0) 
{ 
glGenQueries(1, static_cast<GLuint*>(&this->TimerQuery)); 
} 

If you want my code, you can ask me. 

I think it's just a newbie problem, but I don't find anything on it. 

Best regards 
Romain 

_______________________________________________ 
Powered by www.kitware.com 

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html 

Search the list archives at: http://markmail.org/search/?q=vtk-developers 

Follow this link to subscribe/unsubscribe: 
http://public.kitware.com/mailman/listinfo/vtk-developers 








-- 
Ken Martin PhD 
Chairman & CFO 
Kitware Inc. 
28 Corporate Drive 
Clifton Park NY 12065 
518 371 3971 
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. 


BQ_END




-- 
Ken Martin PhD 
Chairman & CFO 
Kitware Inc. 
28 Corporate Drive 
Clifton Park NY 12065 
518 371 3971 
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. 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20161219/4dc67bba/attachment-0001.html>


More information about the vtk-developers mailing list