[vtkusers] mouse interaction with vtkImagePlaneWidget
Xianjin Yang
Yang at AGIUSA.COM
Tue May 25 15:21:12 EDT 2004
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
-----Original Message-----
From: Aaron Cois [mailto:aaron_vtk at yahoo.com]
Sent: Tuesday, May 25, 2004 11:04 AM
To: vtkusers at vtk.org
Subject: [vtkusers] mouse interaction with vtkImagePlaneWidget
I am attemmpting to get the coordinates of a mouse
click on a vtkImagePlaneWidget. I believe (please
correct me if i am wrong, I am not that experienced
with vtk) that the best way to do this is to write a
callback handler (deriving from vtkCommand), which i
did, and to then add it as an observer to the
vtkImagePlaneWidget. However, this seems to have no
effect. My code basically looks like:
m_ImagePlane2D->AddObserver(vtkCommand::LeftButtonPressEvent,m_MouseCallback
Handler);
m_ImagePlane2D->EnabledOn();
m_ImagePlane2D->InteractionOn();
m_ImagePlane2D->On();
Can anyone give me some help?
(Note: I have tested the callback function by adding
an observer using it to the window interactor...it
works fine, but naturally that only gives me mouse
clicks outside of the image plane, not within)
-Aaron
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20040525/6f77b42d/attachment.htm>
More information about the vtkusers
mailing list