[vtkusers] mouse interaction with vtkImagePlaneWidget
Aaron Cois
aaron_vtk at yahoo.com
Tue May 25 16:19:29 EDT 2004
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
-----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_MouseCallbackHandler);
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
---------------------------------
Do you Yahoo!?
Friends. Fun. Try the all-new Yahoo! Messenger
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20040525/fb9dbc5c/attachment.htm>
More information about the vtkusers
mailing list