[vtkusers] A question

Luke Hua luke_qz at yahoo.com
Thu Mar 11 12:25:55 EST 2004


You don't need to store an array of IDs. You just need to have an integer and incrementally increase the integer and assaign it to individual actors.  You can use ID to retrieve the actors by ID from actor collection of the render window.
 
I think it is better than actor array, which you have to assaign an integer when you don't know how many actors will actually be there.
 
                                                                           Luke
 
"Charl P. Botha" <c.p.botha at ewi.tudelft.nl> wrote:
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" /* 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#25262;e looking for faster. 
> 


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

_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at: 
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers

---------------------------------
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20040311/49370cc3/attachment.htm>


More information about the vtkusers mailing list