[vtkusers] vtkChartXY: How to catch mouse click events, user interaction? (VTK 5.8.0)

Natalie natis261270 at yahoo.com
Thu Oct 27 10:39:05 EDT 2011


Hi,

I am new to VTK and switched to the 5.8.0 version yesterday after reading
about all improvements. I wish to thank everyone involved for all effort in
making the charts better.

I am searching for an example about how to catch mouse click events (single
or double) of vtkChartXY. I found out that with

chart->SetClickActionToButton(vtkChart::NOTIFY,
vtkContextMouseEvent::RIGHT_BUTTON);

I can set an event. Now I need to catch it, but how?
I started out with VTK 5.6.1 and did

vtkSmartPointer<MouseInteractorStyleDoubleClick> style =
vtkSmartPointer<MouseInteractorStyleDoubleClick>::New();
viewQvtkWidget->GetRenderWindow()->GetInteractor()->SetInteractorStyle(style); 

according to the DoubleClick example 
http://www.itk.org/Wiki/VTK/Examples/Cxx/Interaction/DoubleClick
This did work but disabled the pan and zoom functions of the chart.
With the new VTK 5.8.0 this does not work any longer.
It would be great if someone could add an example to the example page about
how to implement single and/or double mouse clicks for vtkChartsXY that also
shows how to catch or handle the events.

All the best,
Natalie




--
View this message in context: http://vtk.1045678.n5.nabble.com/vtkChartXY-How-to-catch-mouse-click-events-user-interaction-VTK-5-8-0-tp4943170p4943170.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list