[vtkusers] mouse interaction with vtkImagePlaneWidget

Greg Book gbook at gbook.org
Mon Jul 6 12:14:06 EDT 2009

I'm trying to intercept mouse clicks on the vtkImagePlaneWidget, but I'm not
having much luck. I've created an observer and I've put some code in the
Execute function which should catch the mouse events.

Here is the code for creating the observer:
    ObserverMousePicker *observeMousePick =
ObserverMousePicker::New(planeWidgetX, planeWidgetY, planeWidgetZ, points,
poly, polyMapper, polyActor, conn, ren1, vtkWindow);

Inside the observer, I try to check for particular mouse events, like
leftmousedown, leftmouseup, etc:

void ObserverMousePicker::Execute(vtkObject *caller, unsigned long event,
    if ( event == vtkCommand::LeftButtonReleaseEvent )
       /* do something */

The problem is that the mouse button events never reach my observer...
certain events work, like mousemove, but not mouse clicks, which seem to be
the events caught by the imageplanewidget itself. How can I catch these
mouse button events in my observer?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090706/02f83063/attachment.htm>

More information about the vtkusers mailing list