[vtkusers] Java RemoveActors

David Cole david.cole at kitware.com
Sat Aug 13 14:10:35 EDT 2005


Are you calling this code from the same thread that AddActor was called 
on? The same thread on which rendering occurs?

Richard Haney wrote:

> I am trying to build a Java Swing application that utilizes the VTK 
> and have been successful except for when I try to remove a 
> pre-existing actor. When I try, the application freezes. Has anyone 
> ran into this problem and if so, how did you solve it?
>
> I am using VTK42 and JDK 1.4.0.
>
> A small sample of the code I am using follows:
> (renWin is a reference to vtkPanel and actor is a reference to 
> vtkActor object)
>
> if (actor != null) {
>  renWin.GetRenderer().RemoveActor(actor);
>  // Force garbage collection!!
>  System.gc();
> }
>
> Thanks to anyone with any ideas on how to solve this.
>
>
> _______________________________________________
> This is the private VTK discussion list. Please keep messages 
> on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>




More information about the vtkusers mailing list