[vtkusers] capture mouse position

vidyadhar vidyadhar at lucidindia.net
Wed Sep 14 00:32:01 EDT 2005


Hi
Use GetEventPosition method instead of GetMousePosition.
HTH
Vidyadhar
  ----- Original Message ----- 
  From: Diego Parada 
  To: vtkusers at vtk.org 
  Sent: Wednesday, September 14, 2005 6:13 AM
  Subject: [vtkusers] capture mouse position


  Hi;

  I can't get the mouse positon, the code is:

  //replace the vtkCommand
  void OnLButtonUp(vtkObject *caller, unsigned long eid, void *clientdata, void *calldata)
  {
      int x,y;
      
      vtkInteractorStyle * istyle = (vtkInteractorStyle *) caller;
      vtkRenderWindowInteractor * iren = istyle->GetInteractor();
      iren->GetMousePosition(&x,&y);    
  }
  // whit style interactor

      vtkInteractorStyle * istyle = vtkInteractorStyle::New();
      vtkCallbackCommand * LMouseUp = vtkCallbackCommand::New();
      LMouseUp->SetCallback(OnLButtonUp);
      istyle->AddObserver(vtkCommand::LeftButtonReleaseEvent,LMouseUp);
      this->m_InteractorRender->SetInteractorStyle(istyle);

  the code runs but not capture the mouse position

  the application is made in VC++ 6.0 MFC


  Thanks

  -- 
  Diego Armando Parada Cuervo
  Estudiante de Ingeniería de Sistemas y Computación
  Universidad Pedagógica y Tecnológica de Colombia 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20050914/97f8c80d/attachment.htm>


More information about the vtkusers mailing list