[vtkusers] A question

Charl P. Botha c.p.botha at ewi.tudelft.nl
Wed Mar 10 18:02:34 EST 2004


Luke Hua wrote:
> My application dynamically create and delete actors in my scene. If I 
> use pointer to track actors, I have to use large actor array to store 
> data. I hate use array to store and delete data. It's a pain.
>  
>                                                          Luke 

What's the difference between storing an array of actor pointers (on 
x86-32, 4 bytes each) and storing an array of IDs (on x86-32, int IDs 
are 4 bytes each)?  I still don't see your problem.

> 
> */"Charl P. Botha" <c.p.botha at ewi.tudelft.nl>/* wrote:
> 
>     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/
> 
> ------------------------------------------------------------------------
> Do you Yahoo!?
> Yahoo! Search - Find what you’re looking for faster. 
> <http://search.yahoo.com/?fr=ad-mailsig-home>


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




More information about the vtkusers mailing list