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

Jeff Lee jeff at cdnorthamerica.com
Wed Jul 9 06:28:58 EDT 2003


Hi,
i think your solution with multiple renderers is not necessary, but I do 
something like

public void removeActor(vtkActor actor)
  {
    Lock();
    ren.RemoveActor(actor);
    UnLock();
  }

inside vtkPanel.  I could add this functionality to vtkPanel, since 
adding/removing of actors is a common thing, but you could try it by 
sublcassing vtkPanel and adding the above.  This is not a graphics card 
problem.
-Jeff

Romain Ollivier wrote:

>  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
>>    
>>
>
>_______________________________________________
>This is the private VTK discussion list. 
>Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
>Follow this link to subscribe/unsubscribe:
>http://www.vtk.org/mailman/listinfo/vtkusers
>
>
>  
>




More information about the vtkusers mailing list