[vtkusers] Problems with Pickers

Malcolm Drummond geov at netactive.co.za
Wed Apr 4 11:05:55 EDT 2001


Hi Carlos

If you know which actor/s you want to pick, you can use PickLists
eg.

set p [iren GetPicker]
$p InitializePickList
$p AddPickList ConeActor
$p PickFromListOn

You can also try decreasing the pick tolerance. I'm not sure what tolerances
are good for point picking but I've found that a tolerance of around 1 pixel
normally gives good results for vtkCellPicker - divide 1 by the hypoteneuse
of the window dimensions (this will be way too small for point-picking,
you'll have to experiment).

If that doesn't solve your problem you could pick with vtkCellPicker and use
the CellId to get PointIds (use GetCellPoints). If you don't already know
the DataSet, you can use the pickers GetDataSet() method. Then you could
access the points and decide which of them is closest to your position and
whether it's close enough to consider picked.

Hope this helps
Malcolm

----- Original Message -----
From: Carlos Martinez Burgos <cmarbur at iti.upv.es>
To: Will Schroeder <will.schroeder at kitware.com>
Cc: VTK User Mailing List <vtkusers at public.kitware.com>
Sent: Wednesday, April 04, 2001 12:31 PM
Subject: Re: [vtkusers] Problems with Pickers


Hi again.

I have tryed to use the pickers as you say but this is not a good solution
to me.

First, if I use vtkPicker instead of vtkCellPicker I get the same
results. I have done a program to show what happends to me. It is done in
Java. Run it and press 'r' key one time. Move the mouse to point
to the cone at (465,350) or left. Push 'u' and what is the result? The
cone is pointed but the sphere is selected and its bounding box is not
intersected. What is the problem? Should I use another picker?

Second, I need to use vtkPointPicker because I need the point ID, to
link it with my data, and this method is not present in vtkPropPicker.

Could somebody send me a solution?

Thanks.


On Tue, 3 Apr 2001, Will Schroeder wrote:

> Hi Carlos-
>
> At 06:56 PM 4/3/2001 +0200, Carlos Martinez Burgos wrote:
>
> >I use a CellPicker and when I run the Pick method on the renderer, it
> >picks on the first actor whose bounding box has hited. If I have a big
> >actor in front of a smaller one and I point to the smaller the first is
> >picked because its bounding box is in front.
>
> This is the behavior of vtkPicker, not vtkCellPicker. Are you assigning
the picker to the vtkRenderWindowInteractor?
>
>
> >I use a PointPicker to select points from a point cloud (polydata). When
I
> >run the Pick method I get ids but there are no points around in some
> >distance.
>
> You probably want to use vtkPropPicker...it uses hardware picking
(warning: sometimes the drivers do not work right, especially on PC's).
>
> Will
>
>
> Dr. William J. Schroeder
> Kitware, Inc.
> 469 Clifton Corporate Parkway
> Clifton Park, NY 12065
> will.schroeder at kitware.com
> 1-518-371-3971 (Phone & Fax)
>

--
----------------------------------------------------------------------
Carlos Martínez Burgos      |     Instituto Tecnológico de Informática
Ingeniero Informático       |      Universidad Politécnica de Valencia
Tlf: +34 963877237          |                        Camí de Vera, S/N
cmarbur at iti.upv.es          |                   46071 Valencia - Spain
www.iti.upv.es/~cmarbur     |                           www.iti.upv.es
----------------------------------------------------------------------






More information about the vtkusers mailing list