[vtkusers] Store User Data in Actor

Jeff Lee jeff at cdnorthamerica.com
Tue Dec 17 09:25:56 EST 2002


Massimo Ivani wrote:

> Hello vtk Users,
>  
> I need to store small text or number inside an Actor...(it is the ID# 
> of this Actor). How can I do that???

there are a variety of ways to achieve this, the simplest is probably to 
keep a map keyed by actors with the text/number as the value.  This way 
when you get the actor (presumably from a pick?) you can look up the 
data in the map.  A more sophisticated way is to sublcass vtkActor and 
put the member data in your new class.  Then when you pick you can 
dynamic cast a vtkActor to your subclass and then ask that object for 
the data.
-Jeff

>  
> Thank you in advance
>  
>  
> Dr. Massimo Ivani
> Media Lab Software
> Tel.: +39 0187 517775
> Fax: +39 0187 511833
> massimo.ivani at mlsw.com <mailto:massimo.ivani at mlsw.com>
> www.mlsw.com <http://www.mlsw.com>





More information about the vtkusers mailing list