[vtkusers] A question

Charl P. Botha c.p.botha at ewi.tudelft.nl
Tue Mar 9 04:37:58 EST 2004


On Mon, 2004-03-08 at 21:19, Luke Hua wrote: 
> Is there any way to retrieve actor by ID or properties? My renderer
> has various kind of actors and I need to delete and add them
> dynamically. It's very difficult to track the position of actors using
> Initialtraversal().
>  
> There is no return values for addActor(). Could vtk make some changes
> so that the addActor() can return a ID for each actor therefore easier
> to retrieve actors?
>  
> Or there is any other way to retrieve actors?

Why do you need an ID?  Why can't you just keep track of the pointers
yourself?

actor = vtkActor::New();
doStuffWithActor(actor);
renderer->AddActor(actor);
.
.
.
// sometime later, in a galaxy far far away
renderer->RemoveActor(actor);


-- 
charl p. botha http://cpbotha.net/ http://visualisation.tudelft.nl/





More information about the vtkusers mailing list