[vtkusers] Re: UserInteraction

Robert Mitchell robmitch at eng.uts.edu.au
Thu Sep 20 20:37:25 EDT 2001

Hello Ahmet,

Perhaps, by telling you how Ive done this, someone else can enlighten us
both about how to do it better.
I have the same setup; vtkPolydata with vtkPoints, and vtkSphereSource
as input into a vtkGlyph3D... This produces the sphere glyphs at each of
the points. Now to pick a point using vtkPointPicker, you would be
picking any one of the points in the render window, which include all
the points required to make up the shperes ie. perhaps 50 points in each
glyph! So, What I did, thanks to Nigel Nunn, was to create a
vtkCellArray and insert a vertex for each point in the dataset, then
associate that with the polydata. By passing the polydata through a
vtkGlyph3D with a vtkGlyphSource2D(type 1), then eventually through  to
an actor you get the vertex glyphs present at each of the poiints(inside
the spheres). If you set all the actors except the vertex actor to
PickableOff(), then use a cell picker (also quicker than a point picker)
you can pick the vertices and get a cell ID that corresponds to the
point as well.

I might have got a few things wrong here, it is from memory!? The main
thing is that Im using a cell picker to pick a cell ID, indirectly
getting the point ID.


Robert Mitchell
Faculty of Engineering
University of Technology, Sydney
+61 2 9514 2317

More information about the vtkusers mailing list