[vtkusers] ] update,interact and render in different threads
andrew.amaclean at gmail.com
Thu Dec 29 00:23:41 EST 2016
Your problem is in the modified callback. There is no need for this
while the rendering takes place this callback is invoked many times hence
the OpenGL errors.
By adding this observer to CellData you are forcing a reload of cell data
whenever any event happens during rendering.
Now, you only need the InteractionEndCallBack observer since you are only
interested in updating the end result.
If you leave in InteractionStartCallBack then the object is updated twice.
Once at the start of interaction and then at the end of interaction.
After all you are only interested in the result after the interaction has
Also remove "ComputerRGB();" on line 75 as this is not needed since this
is called in the thread.
are not needed at all.
---------- Forwarded message ----------
> From: Antonio Fortino <thoniorf at gmail.com>
> To: vtkusers at vtk.org
> Date: Wed, 28 Dec 2016 17:59:13 +0100
> Subject: [vtkusers] update,interact and render in different threads
> Hello to everyone,
> I'm trying to develop a simple example that update the celldata of a
> polydata in a thread while rendering in the main thread.
> My final goal is to interact with the scene, and pause the updates.
> To archive this i'm using a simple mutex and a boolean.
> However it seams that i'm trying to access the render for two different
> threads, and the mutex isn't enough, because when interacting with the
> scene errors like the one below appears, and at random the program stops
> with a segmentation.
> vtkOpenGLPolyDataMapper (0x1b62980): failed after UpdateShader 1 OpenGL
> errors detected
> 0 : (1282) Invalid operation
> I attach the code, any help is very appreciated.
> Best regards
> Antonio Fortino
> Powered by www.kitware.com
> Visit other Kitware open-source projects at http://www.kitware.com/
> Please keep messages on-topic and check the VTK FAQ at:
> Search the list archives at: http://markmail.org/search/?q=vtkusers
> Follow this link to subscribe/unsubscribe:
Andrew J. P. Maclean
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the vtkusers