[vtkusers] vtkPropPicker and vtkPicker::SetTolerance questions.
David Gobbi
david.gobbi at gmail.com
Tue Dec 1 09:02:00 EST 2009
Hi Piotr,
To use the vtkCellPicker reliably, you should set a very small
tolerance: In fact, the vtkCellPicker even works well with a
tolerance of 0.0.
cellPicker.SetTolerance(1e-6)
Right now I'm working on a new picker in cvs called "vtkSurfacePicker"
that has a few advantages over the CellPicker, like the use of
locators to speed up the picking, and the addition of special code for
picking vtkVolume objects.
David
On Tue, Dec 1, 2009 at 6:13 AM, Piotr Byzia <piotr.byzia at gmail.com> wrote:
> In reference to my e-mail at http://www.vtk.org/pipermail/vtkusers/2009-November/104198.html
> this is what I found so far:
>
> vtkPropPicker has AddPickList, where I can specify which actor(s) I want to mark as picked.
> I'm using it like this:
>
> self.propPicker = vtk.vtkPropPicker()
> widget_3d.GetRenderWindow().GetInteractor().SetPicker(self.propPicker)
>
> selff.propPicker.AddPickList(actor)
> selff.propPicker.AddPickList(another_actor)
>
> widget_3d.GetRenderWindow().GetInteractor().GetInteractorStyle().SetCurrentStyleToTrackballActor()
>
> self.propPicker.GetPickList() returns number of items as 2, which is correct.
>
> What I expect at this point is to be able to rotate (with a mouse) both actors, but by picking (again, with the mouse) one of the actors that has PickableOn(), I'm rotating only this one, not *all* that I gathered in the PickList.
>
> I assume, that by another selection action I'm overwriting self.propPicker list -- so my question is: how to prevent overwriting and be able to rotate all actors that were added to the PickList?
>
>
> On the other hand, vtkCellPicker seems to ignore setting tolerance value like this:
>
> propPicker = vtk.vtkCellPicker()
> print propPicker.GetTolerance()
> propPicker.SetTolerance(50)
> print propPicker.GetTolerance()
> GetRenderWindow().GetInteractor().SetPicker(propPicker)
>
> 0.025
> 50.0
>
> I still have to precisely pick my actor.
> Do I have to add here something? Refresh the interactor, renderer, yet something else??
>
> Thanks,
> Piotr Byzia
More information about the vtkusers
mailing list