picking glyphs vtkGlyph3DMapper

We’ve implemented glyph display and efficient glyph picking in 3D Slicer, which now works interactively up to about a few ten thousands glyphs, displayed synchronized in several 2D and 3D. It was a lot of work, quite painful, and we ended up almost completely rewriting the VTK widgets infrastructure. See performance with 1k then with 10k glyphs in this demo video:

We used various selection/picking approaches for different problems. For example, we need extremely quick visibility check for all glyphs to show/hide glyph labels - we use hardware picker for that. However, when we hover over with the mouse over a glyph, we want to pick it even when we are exactly on top of it (because the glyph may be too small, so hitting it with the mouse can be really hard), so we do a closest point search for all the visible glyphs in screen coordinates. We only use cell picker when placing the glyph or moving it on the surface of other actors.

You can find the source code here and here. It’s quite complicated, so probably you cannot easily use these classes in your application (unless you use 3D Slicer as a basis of your application), but maybe you can take some ideas from it.