[vtkusers] vtk and Java : problem when remove a vtkactor to a vtkrenderer or add avtkrenderer to a vtkrenderwindow

Romain Ollivier Romain.Ollivier at sophia.inria.fr
Wed Jul 9 05:27:34 EDT 2003


  Thank you for your reply.
  I've tried to replace my code with your's but I still get :
  Xlib: unexpected async reply (sequence 0x5a1)!
Has anyone any idea about the way to solve this problem ? I think this is a
graphic card problem, but I'm not sure... I work with a VGA compatible
controler : nVidia Corporation NV25 [GeForce4 Ti4600]...

  Thanks for any help,

        Romain


R K Shyamprakash wrote:

> public void removeActor(vtkActor actor)
>   {
>     ren.RemoveActor(actor);
>   }
>
> This should work fine as it works for me. make sure reference to the
> argument actor has not changed and its actually the part of the renderer.
> also you can put check to see if the argument actor is null like
>
> public void removeActor(vtkActor actor)
>   {
>     if(actor != null)
>         ren.RemoveActor(actor);
>   }
>
> one more method will be
>
> public void removeActor(vtkActor actor)
>   {
>         vtkActorCollection col = ren.GetActors();
>         col.InitTraversal();
>         int count = col.GetNumberOfItems();
>         for(int i=0;i<count;i++){
>                 if(col.GetNextActor()==actor){
>                         ren.RemoveActor(actor);
>                         return;
>                 }
>         }
>   }
> make sure you call Render() to see the changes




More information about the vtkusers mailing list