picking and translating..

Patric.Weis at mycrona.de Patric.Weis at mycrona.de
Fri Mar 10 09:16:52 EST 2000


Hi K.R.,

That's the way I identify my polydata actors (a bit complicated, but it
works):

Attach the ids to each cell or point of the actors (e.g. vtkLongArray ->
vtkFieldData -> vtkCellData). Then get the id of the picked actor by e.g.
vtkPicker::GetDataSet()->GetCellData()->GetFieldData()->GetArray()
->GetValue().

The other way is holding the vtkActor pointers  in a list for comparison
purposes (e.g. in a dynamic <vector> array of the C++ STL ).

vtkPicker does not only identify the closest actor. By means of
vtkPicker::GetActors() you can get a collection of all actors that were
intersected by the ray into the graphics window. By vtkActorCollection::
IsItemPresent() you can search for special actors in the collection.

Hope it helps!

Patric Weis
MYCRONA GmbH


- - - Original Message - - -



                                                                                                                                          
                    "K.R.Subramanian"                                                                                                     
                    <krs at zappa.uncc.edu>           An:     VTK HELP <vtkusers at public.kitware.com>                                         
                    Gesendet von:                  Kopie:                                                                                 
                    owner-vtkusers at public.k        Thema:  picking and translating..                                                      
                    itware.com                                                                                                            
                                                                                                                                          
                                                                                                                                          
                    10.03.00 08:59                                                                                                        
                                                                                                                                          
                                                                                                                                          




I need to be able to pick and move certain groups of actors in my
application.  Is
there a way to identify actors (say a unique id), so that I know which
actor got picked?
Based on this, I can figure out which group of actors need to be moved.


I assume vtkPicker identifies only  the closest actor to the vector from
the display point
into the 3d world.  I could always subclass and add an id, but I was
wondering if there
was a better way..


Thanks.


    -- krs
--
K.R.Subramanian                           Phone: (704) 547-4872
Department of Computer Science            FAX:   (704) 547-3516
UNC Charlotte, 228A Kennedy
9201 Univ. City Blvd.                     Email: krs at cs.uncc.edu
Charlotte, NC 28223-0001                  WWW: http://www.cs.uncc.edu/~krs










--------------------------------------------------------------------
This is the private VTK discussion list. Please keep messages on-topic.
Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at public.kitware.com>. For help, send message body containing
"info vtkusers" to the same address.
--------------------------------------------------------------------



More information about the vtkusers mailing list