[vtkusers] HELP vtkPointPicker question

Shyam Prakash ramakrishna.prakash at quest-global.com
Wed Oct 22 04:09:03 EDT 2003


I always use vtkPropPicker to pick a particular point. It gives me much
accurate results than vtkPointPicker. You can do something like

vtkPropPicker picker = new vtkPropPicker();
Lock();
int isPicked = propPicker.Pick(e.getX(), rw.GetSize()[1] - e.getY(), 0,
ren);
Unlock();

if (isPicked != 0) {
	double []pickPos	= propPicker.GetPickPosition();		
}

--Shyam

-----Original Message-----
From: vtkusers-admin at vtk.org [mailto:vtkusers-admin at vtk.org] On Behalf
Of xiaofeng qi
Sent: Wednesday, October 22, 2003 12:30 PM
To: vtkusers at vtk.org
Subject: [vtkusers] HELP vtkPointPicker question

Hi,vtkusers

  I am using vtk+java to develop a application to visualize
some CFD data.I use vtkPointPicker to pick the  point 
from a section plane,then i use the point's coordinate
as start point of a streamline , but something cause me annoyed,
The point's coordinate i got from vtkPointPicker is not
the same  to the start point of the streamline,when I 
press the mouse ,and the streamline do not start from the
cursor'position, it starts from some place else.
here is some of my codes,
     

    vtkPointPicker picker=new vtkPointPicker();
       picker.InitializePickList();
       picker.AddPickList(sectionActor);
       picker.PickFromListOn();
       picker.SetTolerance(0.01);
       picker.Pick(lastX, lastY, 0, renWin.GetRenderer());
      
      
   if(picker.GetPointId()<0){

        System.out.println("Mouse point: ("+lastX+","+lastY+")");
        System.out.println("notok");
         }else{
     
        double []selPt = picker.GetSelectionPoint();
        double []pickPos = picker.GetPickPosition();
	
        drawStreamline(pickPos);
        }
       ..............................
        
 Do i miss something?Any help will be appreciate.

Thanks !!!

 				

        xiaofeng qi
        xiaofeng_qi at sina.com
          2003-10-22



_______________________________________________
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




More information about the vtkusers mailing list