Hi:<br><br>Could anyone give me some suggestions? I encounter a problem about vtkMFC interaction. How to get the mouse position?<br><br>I realize the "Examples/GUI/Win32/vtkMFC"<br>In the vtkDLG example, there is a global static function handle_double_click to process mouse double click event. The function is defined as: <br>
static void handle_double_click(vtkObject* obj, unsigned long,void*, void*);<br><br>I add two Edit Controls to display the mouse position when I double click the pvtkMFCWindow.<br><br>Two class variables (m_x,m_y) of Class CvtkDLGDlg are corresponding to these two Edit Control.<br>
<br>I want m_x and m_y to display the position of mouse event.<br><br>In the handle_double_click function: <br><br> vtkRenderWindowInteractor* iren = vtkRenderWindowInteractor::SafeDownCast(obj);<br> int event_pos[2];<br>
iren->GetEventPosition(event_pos);<br><br>These codes can get the mouse position. But, I don't know how to display m_x and m_y.<br>Because handle_double_click is the global function other than a member function in class CvtkDLGDlg .<br>
<br>So, how to do this:<br> let m_x ,m_y be the current mouse position, and display (UpdateData(false)) in the dialog.<br><br>I think the example of source of VTK just realize to accept the mouse event. Actually, I want to know how to get the position and use the position to do next process.<br>
<br>Could anyone help me figure out the problem. Thanks a lot.<br><br>A source code will be fine totally.<br><br>Best<br>Erkang<br><br><br><br><br>