[vtkusers] Coordinates of the point clicked with the mouse

Naim naim at electromagneticworks.com
Thu Nov 30 10:50:37 EST 2006


I'm using this to get the coordinates (OnLeftClick):

 

 

vtkPointPicker  *pointpicker = (vtkPointPicker *)(iren->GetPicker());

            

//get the mouse position

int * pos = iren->GetEventPosition();

 

pointpicker->SetTolerance(0.001);

 

//start the picking process

if ( pointpicker->Pick((double)pos[0], (double)pos[1], 0.0, m_prenderer) !=
0)

{

      //get the list of picked point

      vtkPoints* thePointList = pointpicker->GetPickedPositions();

 

      //get the number of picked points

      int nbrpoints = thePointList->GetNumberOfPoints();

}

 

Naim Himrane

Electromagneticworks Inc.

 

  _____  

From: vtkusers-bounces+naim=electromagneticworks.com at vtk.org
[mailto:vtkusers-bounces+naim=electromagneticworks.com at vtk.org] On Behalf Of
cyros at tiscali.it
Sent: November 29, 2006 7:06 PM
To: vtkusers at vtk.org
Subject: [vtkusers] Coordinates of the point clicked with the mouse 

 

 

Which it is the alternative way to vtkRenderWindow.GetEventPosition () for
having the coordinates of the point clicked with the mouse on the
vtkRenderWindow?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20061130/04e5a538/attachment.htm>


More information about the vtkusers mailing list