[vtkusers] mouse interaction with vtkImagePlaneWidget
Xianjin Yang
Yang at AGIUSA.COM
Tue May 25 16:39:25 EDT 2004
Showing x, y, z and value of a picked cell is a built-in behavior. If you
want something else to happen, you will need
vtkCellPicker* picker = vtkCellPicker::New();
picker->SetTolerance(??);
planewidget>SetPicker(picker);
planewidget->SetKeyPressActivationValue('x');
vtkIPWCallback *myCallback = vtkIPWCallback::New();
planewidget->AddObserver(vtkCommand::StartInteractionEvent, myCallback);
Define your callback command vtkIPWCallback. In addition to
StartInteractionEvent, you may try InteractionEvent or EndInteractionEvent.
Yang
-----Original Message-----
From: Aaron Cois [mailto:aaron_vtk at yahoo.com]
Sent: Tuesday, May 25, 2004 3:19 PM
To: Xianjin Yang; vtkusers at vtk.org
Cc: 'Aaron Cois'
Subject: RE: [vtkusers] mouse interaction with vtkImagePlaneWidget
I looked through the code, but I don't understand how the picker can replace
a callback function. I need some specific things to happen each time a
point in the plane is clicked, and I don't see any event functionality in
the picker, just record functionality...am i wrong?
-Aaron
Xianjin Yang <Yang at AGIUSA.COM> wrote:
You do not need any callback command. Instead, you should
planeWidgetX->SetInteractor(iren);
planeWidgetX->SetKeyPressActivationValue('x');
planeWidgetX->SetPicker(picker); // vtkCellPicker
Check the complete C++ in this example:
\VTK\Hybrid\Testing\Cxx\ImagePlaneWidget.cxx
Yang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20040525/87db2be8/attachment.htm>
More information about the vtkusers
mailing list