[vtk-developers] Possible mouse-over event in ChartXY?

Marcus D. Hanwell marcus.hanwell at kitware.com
Mon Jan 28 15:48:34 EST 2013


Hi Eric,

On Thu, Jan 10, 2013 at 11:09 AM, Eric E. Monson <emonson at cs.duke.edu> wrote:
> Hey Marcus,
>
> Have you guys considered adding an event (maybe a UserEvent) in the XY charts on plot point mouse-over?

We have been talking about some additional events in the charts, and
this sounds like a reasonable one. My fear would be performance, as
you point out (but I haven't benchmarked this, and the mouse over code
has performance issues already - I think this is largely in the search
rather than any resulting actions).
>
> I don't know if invoking a lot of events on a chart that has a huge number of points would hurt performance, but I have an application where it's inconvenient to use custom classes, so instead of a custom tooltip I'd prefer to watch for a mouse-over event and update a separate panel in my GUI with info about the moused-over point. (The info often includes images or other things I can't put into the default tooltip).

You can just set a derived vtkToolTipItem class, I can point you to
where we do this in the MongoChem project if that is of interest. The
chart will then update the item whenever a mouse over occurs (and
attempt to show/hide at the appropriate time).
>
> Since you still can't read the data passed along with an event when using the Python wrappings, it would also be handy if the vtkChartPlotData were a get-able property that I could query when the event is observed.
>
> Let me know what you think when you get a chance.

Sorry - it took me a while to get the chance ;-) It's a shame that
Python has no way to get at the data, I would love a stronger signal
slot mechanism that could be wrapped in Python effectively. If this
would be helpful we can probably add a getter that would refer to the
last event.

I am preparing for travel, and so I am not certain exactly when I will
be able to get to this but I should be able to look at some of these
items.

Thanks,

Marcus



More information about the vtk-developers mailing list