[vtkusers] vtkChartXY picking
Richard Brown
richard.j.brown at live.co.uk
Fri Apr 22 10:05:26 EDT 2016
Hi Jeff,
So if I want my left button to select the point underneath it (I think the right button by default creates a box and selects points within that box but then does nothing with them…) and then, for example, print the information pertaining to that point, how would I go about that?
SetButtonToAction(vtkChartXY::SELECT, vtkContextMouseEvent::LEFT_MOUSE);
Do I then set up an observer for vtkChartXY::SELECT?
And from there, when I’m in the callback function, how do I get the information of the selected point?
Thanks in advance,
Richard
> On 18 Apr 2016, at 13:54, Jeff Baumes <jeff.baumes at kitware.com> wrote:
>
> I think you want SetActionToButton() on vtkChart to change mouse bindings. You should be able to listen for a selection event once that is set up.
>
> http://www.vtk.org/doc/nightly/html/classvtkChart.html#ac4162187f5f3ad97f0163a079e06f13d <http://www.vtk.org/doc/nightly/html/classvtkChart.html#ac4162187f5f3ad97f0163a079e06f13d>
> On Fri, Apr 15, 2016 at 9:13 AM mbcx9rb9 <richard.j.brown at live.co.uk <mailto:richard.j.brown at live.co.uk>> wrote:
> Hi all,
>
> I'd like to create a custom interactor for vtkChartXY (inherited from
> vtkContextInteractorStyle), but I can't figure out how to select single
> points with the left click of the mouse. Once I manage to that, I would need
> to return the index of the selected point.
>
> This seems very straightforward to me, but I haven't seen any concrete
> examples.
>
> Any pointers would be greatly appreciated.
>
> Regards,
> Richard
>
>
>
>
>
> --
> View this message in context: http://vtk.1045678.n5.nabble.com/vtkChartXY-picking-tp5737711.html <http://vtk.1045678.n5.nabble.com/vtkChartXY-picking-tp5737711.html>
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> Powered by www.kitware.com <http://www.kitware.com/>
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html <http://www.kitware.com/opensource/opensource.html>
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ <http://www.vtk.org/Wiki/VTK_FAQ>
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers <http://markmail.org/search/?q=vtkusers>
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers <http://public.kitware.com/mailman/listinfo/vtkusers>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160422/d93efce0/attachment.html>
More information about the vtkusers
mailing list