[vtkusers] pointpicker

Gopalakrishnan, Gowri Gowri.Gopalakrishnan at inteq.com
Fri May 24 08:37:46 EDT 2002


I think it could be related to the set up of the picking action. I handle
the event myself. Does any one have an example of how to pick on your own
instead of passing it to vtk?.

Cheers
Gowri


-----Original Message-----
From: Prabhu Ramachandran [mailto:prabhu at aero.iitm.ernet.in] 
Sent: 24 May 2002 13:09
To: Gopalakrishnan, Gowri
Cc: vtkusers at public.kitware.com
Subject: [vtkusers] pointpicker

>>>>> "GG" == Gowri Gopalakrishnan <Gopalakrishnan> writes:

    GG> Hi I use the following code to set the pipe line

    GG> 	vtkPoints *points = vtkPoints::New(VTK_DOUBLE);
    GG> vtkCellArray *lines = vtkCellArray::New();

    GG> 	vtkpolydata takes the above two as the input.  I do
    GG> the plot with 42 points and it is alright.  But when I use
    GG> point picker no matter where I pick on the screen the point
    GG> picker always returns 239306080.  Do I have to set the point
    GG> Id somewhere. The result is the same if I use cellpicker
    GG> instead of point picker.

That sounds very wierd.  Using the pickers is pretty easy.  You simply
need to call picker.Pick(x, y, 0, renderer) where x and y are
co-ordinates on the screen that you determine from your GUI.  Then you
say picker.GetPointId() etc.  If no point was picked you should get an
id of -1.  Look at the value of picker.GetPickPosition().  It might
help you debug whats happening.

prabhu



More information about the vtkusers mailing list