Glyphs errors when moving a QVTKOpenGLWidget to an another layout

Hi,

I’m getting these errors when I’m moving the QVTKOpenGLWidget, in which I’m using a vtkGlyph3DMapper, to an another layout of another widget in order to show it full screen :

ERROR: In /home/febus-g1/rpmbuild/BUILD/ParaView-v5.4.1/VTK/Rendering/OpenGL2/vtkOpenGLVertexArrayObject.cxx, line 311
vtkOpenGLVertexArrayObject (0xe2a7250): attempt to add attribute when not ready for attribute GCMCMatrix

ERROR: In /home/febus-g1/rpmbuild/BUILD/ParaView-v5.4.1/VTK/Rendering/OpenGL2/vtkOpenGLGlyph3DHelper.cxx, line 461
vtkOpenGLGlyph3DHelper (0xe340470): Error setting ‘GCMCMatrix’ in shader VAO.

Any idea ?

You cannot use the same mapper or actor in different renderers at the same time.

I’m not doing that, I’m just moving the Qt widget to an another layout : (by the way, is there a code formatting tag when pasting code in this editor ?)

QWidget* const fullScreenWindow = new QWidget(this, Qt::Window);
m_FullScreenWindow = fullScreenWindow;
fullScreenWindow->setObjectName(“FullScreenWindow”);

‘plots’ and ‘geomap’ are QVTKOpenGLWidget instances, and I remove them from their original layout

plotsLayout->removeWidget(plots);
mapLayout->removeWidget(geoMap);

QHBoxLayout* vbox = new QHBoxLayout(fullScreenWindow);
vbox->setSpacing(0);
vbox->setMargin(0);

and paste them in the full screen widget’s one !

vbox->addWidget(plots);
vbox->addWidget(geoMap);

fullScreenWindow->showFullScreen();
fullScreenWindow->show();

// Handle ESCAPE & F12 buttons : exit full screen mode
QShortcut* esc = new QShortcut(Qt::Key_Escape, fullScreenWindow);
QObject::connect(esc, &QShortcut::activated,
this, &MainWindow::toggleFullScreen);

QShortcut* f12 = new QShortcut(Qt::Key_F12, fullScreenWindow);
QObject::connect(f12, &QShortcut::activated,
this, &MainWindow::toggleFullScreen);

By the way, I took this logic from ParaView !

In fact, I’m using this project : vtkMap (https://github.com/OpenGeoscience/vtkMap), I’m using marker clusters that make use of vtkGlyph3DMapper, .

when I move to full screen, the clusters glyph disappears (only the text remains) :

and I got a bunch of these errors non-stop :

ERROR: In /home/febus-g1/rpmbuild/BUILD/ParaView-v5.4.1/VTK/Rendering/OpenGL2/vtkOpenGLVertexArrayObject.cxx, line 311
vtkOpenGLVertexArrayObject (0x8487be0): attempt to add attribute when not ready for attribute GCMCMatrix

ERROR: In /home/febus-g1/rpmbuild/BUILD/ParaView-v5.4.1/VTK/Rendering/OpenGL2/vtkOpenGLGlyph3DHelper.cxx, line 461
vtkOpenGLGlyph3DHelper (0x8a3c140): Error setting ‘GCMCMatrix’ in shader VAO.

ERROR: In /home/febus-g1/rpmbuild/BUILD/ParaView-v5.4.1/VTK/Rendering/OpenGL2/vtkOpenGLVertexArrayObject.cxx, line 311
vtkOpenGLVertexArrayObject (0x8487be0): attempt to add attribute when not ready for attribute glyphColor

ERROR: In /home/febus-g1/rpmbuild/BUILD/ParaView-v5.4.1/VTK/Rendering/OpenGL2/vtkOpenGLGlyph3DHelper.cxx, line 485
vtkOpenGLGlyph3DHelper (0x8a3c140): Error setting ‘diffuse color’ in shader VAO.

I think it’s a bug in QVTKOpenGLWidget. If someone is interested in fixing that bug, I can add the full screen feature in vtkMap’s weather station Qt example.

Otherwise, vtkMap is a great project, I’m sad that there is no people working actively on it :slightly_frowning_face: coloring a line with data is easy with VTK, I don’t think it’s easier to do the same with a web based slippy map.

There are multiple variants of QVTKOpenGLWidget class. Not all of them work correctly. It is hard to tell which one to use, as their names changed several times over the past few years, I would just recommend to try “the other one” (these topics may help).

Hi Andras,

I checked that the issue exists also with the old QVTKWidget (and with vtkMap’s weather station example app).

It occurs when moving QVTKWidget/QVTKOpenGLWidget to a fullscreen widget and the dimensions of the widget change.

If the dimensions don’t change, e.g. when moving the widget (QWidget/QFrame) that contains the QVTKWidget/QVTKOpenGLWidget there’s no bug, but the issue, it is not maximized in full screen.

How to move the QVTKWidget/QVTKOpenGLWidget parent’s instead of itself and make it show maximized ? I didn’t find a way to do it and I don’t know if that will work…

Have you tried the native widget, too?

My program is based on ParaView 5.4.1 IIRC, and the header doesn’t exist. I tried to build an example using pure VTK 7.1.1 but even the qt open gl widget doesn’t exist.

Andras,

The bug can be easily reproduced in ParaView 5.4.1 :

  1. Sources -> Box -> Apply
  2. change the representation of the box to “3D Glyphs”
  3. Press F11 to enable full screen.

I will try with the latest ParaView version from Gitlab and if the problem persists I will notify the issue.

Update: The bug doesn’t exist in ParaView 5.8.0 RC3 or with VTK 8.2.0.