vtkOpenGLGlyph3DMapper (OpenGL2 version in VTK 6.3) opengl error
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
When given an empty polydata for a glyph, an opengl error is generated, even after applying 844f2e06:
ERROR: In ......\Rendering\OpenGL2\vtkOpenGLGlyph3DHelper.cxx, line 579 vtkOpenGLGlyph3DHelper (14FE7268): failed after Render 1 OpenGL errors detected 0 : (1282) Invalid operation
My fix:
- add in vtkOpenGLGlyph3DMapperEntry a field bool HasGlyph;
- in Render, add the following line after ss->ShallowCopy(s) subarray->Entries[cc]->HasGlyph = s->GetPoints() && s->GetPoints()->GetNumberOfPoints();
- In RebuildStructures, replace the lines
vtkPolyData *source = this->GetSource(index);
// Make sure we're not indexing into empty glyph
if (source)
{
vtkOpenGLGlyph3DMapper::vtkOpenGLGlyph3DMapperEntry *entry =
subarray->Entries[index];
by
vtkOpenGLGlyph3DMapper::vtkOpenGLGlyph3DMapperEntry *entry =
subarray->Entries[index];
// Make sure we're not indexing into empty glyph
if (entry->HasGlyph)
{