<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2653.12">
<TITLE>RE: [vtkusers] mouse interaction with vtkImagePlaneWidget</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=2>You do not need any callback command. Instead, you should</FONT>
</P>
<P><FONT SIZE=2> planeWidgetX->SetInteractor(iren);</FONT>
<BR><FONT SIZE=2> planeWidgetX->SetKeyPressActivationValue('x');</FONT>
<BR><FONT SIZE=2> planeWidgetX->SetPicker(picker); // vtkCellPicker</FONT>
</P>
<P><FONT SIZE=2>Check the complete C++ in this example:</FONT>
<BR><FONT SIZE=2>\VTK\Hybrid\Testing\Cxx\ImagePlaneWidget.cxx</FONT>
</P>
<BR>
<P><FONT SIZE=2>Yang</FONT>
</P>
<P><FONT SIZE=2>-----Original Message-----</FONT>
<BR><FONT SIZE=2>From: Aaron Cois [<A HREF="mailto:aaron_vtk@yahoo.com">mailto:aaron_vtk@yahoo.com</A>] </FONT>
<BR><FONT SIZE=2>Sent: Tuesday, May 25, 2004 11:04 AM</FONT>
<BR><FONT SIZE=2>To: vtkusers@vtk.org</FONT>
<BR><FONT SIZE=2>Subject: [vtkusers] mouse interaction with vtkImagePlaneWidget</FONT>
</P>
<BR>
<P><FONT SIZE=2>I am attemmpting to get the coordinates of a mouse</FONT>
<BR><FONT SIZE=2>click on a vtkImagePlaneWidget. I believe (please</FONT>
<BR><FONT SIZE=2>correct me if i am wrong, I am not that experienced</FONT>
<BR><FONT SIZE=2>with vtk) that the best way to do this is to write a</FONT>
<BR><FONT SIZE=2>callback handler (deriving from vtkCommand), which i</FONT>
<BR><FONT SIZE=2>did, and to then add it as an observer to the</FONT>
<BR><FONT SIZE=2>vtkImagePlaneWidget. However, this seems to have no</FONT>
<BR><FONT SIZE=2>effect. My code basically looks like:</FONT>
</P>
<P><FONT SIZE=2>m_ImagePlane2D->AddObserver(vtkCommand::LeftButtonPressEvent,m_MouseCallbackHandler);</FONT>
<BR><FONT SIZE=2>m_ImagePlane2D->EnabledOn();</FONT>
<BR><FONT SIZE=2>m_ImagePlane2D->InteractionOn();</FONT>
<BR><FONT SIZE=2>m_ImagePlane2D->On();</FONT>
</P>
<P><FONT SIZE=2> Can anyone give me some help?</FONT>
</P>
<P><FONT SIZE=2>(Note: I have tested the callback function by adding</FONT>
<BR><FONT SIZE=2>an observer using it to the window interactor...it</FONT>
<BR><FONT SIZE=2>works fine, but naturally that only gives me mouse</FONT>
<BR><FONT SIZE=2>clicks outside of the image plane, not within)</FONT>
</P>
<P><FONT SIZE=2> -Aaron </FONT>
<BR><FONT SIZE=2>__________________________________________________</FONT>
<BR><FONT SIZE=2>Do You Yahoo!?</FONT>
<BR><FONT SIZE=2>Tired of spam? Yahoo! Mail has the best spam protection around </FONT>
<BR><FONT SIZE=2><A HREF="http://mail.yahoo.com" TARGET="_blank">http://mail.yahoo.com</A> </FONT>
</P>
</BODY>
</HTML>