[vtkusers] Picking Glyphs?

Lee A. Butler butler at ARL.ARMY.MIL
Mon Oct 7 22:19:56 EDT 2002

Does anyone have example code of picking glyphs?  I want to be able to get the
point the glyph was constructed from as a result of a pick operation.  

I gather from the web page on Glyph3D that the "GeneratePointIds" option is

A fragment of the Tcl code I have is:

	vtkUnstructuredGridReader ugr
		ugr SetFileName ptdata.vtk

	vtkConeSource cone

	vtkGlyph3D glyph
		glyph SetInput [ugr GetOutput]
		glyph SetSource [cone GetOutput]
		glyph GeneratePointIdsOn

	vtkPolyDataMapper glyphmapper
	vtkActor glyphActor

	proc endPick {args} {
		# What code here?

	vtkCellPicker picker
		picker SetEndPickMethod endPick

Two things are wrong here:
	1) The bounding box is drawn around the whole collection of points,
		whereas I want to box just the glyph selected.
	2) I can't seem to find a way to identify the original point from
		the glyph through any accessor methods.

Can anyone tell me how to access the original point from within the endPick
routine?  The cell reported by the picker is one for the polygon of the cone.
It seems to have only coincidental relationship to the original point.

Can anyone tell me how to change the behavior of picking away from drawing the
bounding box?  

If anybody cares, I've attached the point data file

Lee A. Butler					E-Mail: butler at arl.army.mil
Attn: AMSRL-SL-BE				Phone: (410) 278-9200
U.S. Army Research Laboratory			DSN:	     298-9200
Aberdeen Proving Ground, MD  21005-5068		FAX:   (410) 278-5058

As nightfall does not come at once, neither does oppression.  In both
instances, there is a twilight when everything remains seemingly unchanged.
And it is in such twilight that we all must be most aware of change in the
air--however slight--lest we become unwitting victims of the darkness.
--- Justice William O. Douglas

-------------- next part --------------
# vtk DataFile Version 4.0
Points to glyph
POINTS 3 float
-700.0000000000 0.0000000000 7080.8653830235
7080.8653830235 400.0000000000 1200.0000000000
4175.2403126471 5765.7029515300 700.0000000000

SCALARS scalar float 1

VECTORS direction float
0 0 -1
-1 0 0
-0.5 -0.866025 0

More information about the vtkusers mailing list