[vtkusers] vtkRenderer.AddActor

Mike Gagnon mike at gagnon.com
Fri Jul 12 10:03:59 EDT 2013


Thanks David, my question remains though, because I removed the thread 
and the actor didn't appear when I called it like this from the only 
(GUI) thread:

void vtkMFCSingleView::AddActor(vtkSmartPointer<vtkActor> pActor)
{
     Renderer->AddActor(pActor);
     Invalidate();
}

It still requires that I click on the view with the mouse for the actor 
to appear...  It worked fine when I added the actors while creating the 
view in OnInitialUpdate, but now I'd like to be able to add/remove 
actors while the view is rendering (only from the GUI thread of course).

Mike


On 7/12/2013 9:53 AM, David Cole wrote:
> VTK is not easily usable from multiple threads. So, in general, you 
> should restrict access to VTK objects to a single thread in your app, 
> or use mutexes to guarantee that only one thread at a time has access 
> to VTK objects. And, if you have to pick a thread to restrict the 
> access to, use the same one that’s doing all the GUI stuff -- VTK 
> rendering has to run in the GUI thread anyhow.
> HTH,
> David C.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130712/f5a28d8b/attachment.htm>


More information about the vtkusers mailing list