[vtkusers] Multi-threaded creation, display and deletion of actors

Sebastien Jourdain sebastien.jourdain at kitware.com
Wed Feb 20 20:06:53 EST 2013


The add actor should be done by the same VTK thread that is rendering.
So only one thread can do that action.
Moreover, you should call Update() on the mapper within each of your thread
to reduce the work that will be done by the main vtk thread.

Hope that make sense,

Seb

PS: VTK is not thread safe, but I've already done something similar to what
you did without any issue.


On Wed, Feb 20, 2013 at 5:18 PM, Dženan Zukić <dzenanz at gmail.com> wrote:

> I have a need to modify the scene from multiple threads.
>
> Each thread looks like:
> {
> for (i=1 to 100)
> create mesh_i;
> convert it to vtkPolyData;
> if exists actor delete it;
> create actor with pd;
> add actor to renderer;
> update display;
> }
>
> How best to accomplish this? I already tried this<http://www.vtk.org/pipermail/vtkusers/2004-April/073478.html>approach, but it does not work. It always crashes before returning from
> Render() method. Crashes are at random location in VTK rendering code.
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130220/7d34f28b/attachment.htm>


More information about the vtkusers mailing list