[vtkusers] vtkPointPicker

Chris Hood Chris.Hood at noaa.gov
Tue May 25 16:08:21 EDT 2004


Here's one in Java. There's two problems: it ignores the picklist and give 
random points and at some view points, the z value become negative of what 
it should be. I've asked about these problems on the list, but got no 
helpful responses so I think they may be bugs in VTK.

   void PointPick(MouseEvent e) {
       int x=e.getX(), y=e.getY();
       pointPicker = new vtkPointPicker();
       pointPicker.AddPickList(actor3);      pointPicker.PickFromListOn();
       pointPicker.AddPickList(actor0);      pointPicker.AddPickList(actor2);
       pointPicker.Pick(x, y, 0, renPanel.GetRenderer());
       int noOfPoints = pointPicker.GetPickedPositions().GetNumberOfPoints();
       if(noOfPoints!=0) {
          double[][] points = new double [noOfPoints][3];
          for(int i=0;i<noOfPoints;i++) {
             points[i] = pointPicker.GetPickedPositions().GetPoint(i);
             points[i][1]=-points[i][1];
             System.out.println(points[i][0] + ",  " + points[i][1] + ",  " 
+ points[i][2]);
             }
          }
       }


At 07:51 AM 5/25/2004, you wrote:
>Hi
>      Can any body provide me with the program for
>picking a picking the coordinates of a point with a
>mouse. I collect the attached program from vtk mail
>archive but it is not working.
>
>Can anybody have c++ version of the program in
>/Examples/Annotation/Python/annotatePick.py.
>
>
>Respond please.
>
>
>    Regards
>    Donald
>
>
>
>
>__________________________________
>Do you Yahoo!?
>Friends.  Fun.  Try the all-new Yahoo! Messenger.
>http://messenger.yahoo.com/
>_______________________________________________
>This is the private VTK discussion list.
>Please keep messages on-topic. Check the FAQ at: 
><http://public.kitware.com/cgi-bin/vtkfaq>
>Follow this link to subscribe/unsubscribe:
>http://www.vtk.org/mailman/listinfo/vtkusers

____________________________________
Chris Hood
Graduate Student Research Assistant
University of Colorado, Boulder
Space Environment Center - NOAA 




More information about the vtkusers mailing list