1 Nov 21:11
Tooltips to identify plotted objects in mayavi
I have a bunch of datapoints I'm plotting in 3D with mlab.points3d(). I also have a bunch of ellipsoids (ParametricSurface objects) interspersed among the plotted data, enveloping some of the points. Each ellipsoid has an associated ID, and I'd like to be able to display that ID in a tooltip when hovering over the ellipsoid with the mouse. Is there a simple way to do this? I find the whole enthought/mayavi/VTK/TVTK/Traits/Envisage/wx combination a big confusing jumble, and I have no clear idea of where to begin, nor can I find any tips in the mayavi documentation or this mailing list. I have some scattered ideas: When I print out my scene.interactor, I notice it has a MouseMoveEvent vtkObserver, which might be useful. Or, maybe I should catch a wx mouse movement event, grab the mouse's x and y coords in wx, use those to somehow do a hit test on the vtk stuff underlying it (maybe scene.picker.pick_world(x, y)?), and somehow check if there's an ellipsoid under the returned coordinate. Or simply find the nearest one. Thanks for any help you can offer, Martin
RSS Feed