[vtkusers] how to pick points using a vtkPointPicker from a vtkXYPlotActor

Kleistereimer kleistereimer at gmx.de
Wed Jul 25 19:35:01 EDT 2007


i use picking with a vtkPointPicker inside a mouse leftclick callback.
inside this callback iren->GetPicker()->pick(xpos, ypos, 0, renderer) is
called to probe the mouseposition for vtkPoints.

everything works fine with my code, if i display a vtkDataSet inside a
vtkDataSetMapper. i can get the list of points, get their id, ...  very
good, no problem.

now if i use the same code on a vtkXYPlotActor,
iren->GetPicker()->pick(..) always fails (returning 0).

same with vtkPicker.

interestingly, if i use vtkPropPicker instead, it works with
vtkXYPlotActor. ->pick(..) succeeds if i pick near a point, the callback
is triggered fine, but of course i can not get the point-id from the
btw, ->pick() calls up vtkPropPicker::Pick in this case.

if vtkPointPicker is used, ->pick(..) calls vtkPicker::Pick. in this
function i found a comment: //only vtkProp3D's (actors and volumes) can
be picked.

my general aproach seems to work, but just not with vtkXYPlotActor.

-i guess this is because vtkXYPlotActor is 2d, not 3d, so the
'probe-rays' simply dont work.

any ideas? how to get point id's from the RenderWindow XY coordinates?
(i need it to display details about the curvepoints the mouse clicks.
most important are x and y values from the scales of course)

(->pick() should be reimplemented (virtual function) in case
vtkXYPlotActor is used. (??probably not possible) or contain code which
deals with it. => does there exists such code?)

regards, kl

1) i use vtk 5.0.1 inside win xp / msvc 7.1

2) i read the email:
it says nothing about the use of pickers, instead it shows the use of
callbacks and markers, which work fine for me.

3) where to find a changelog of vtk? (say, between 5.0.1 and 5.0.3) it's
not even in cvs..

More information about the vtkusers mailing list