[vtkusers] vtk python, point picker, UseCellsOff attribute error

David Gobbi david.gobbi at gmail.com
Sun Nov 30 11:44:14 EST 2014


Hi Michael,

The UseCells option did not exist in VTK 6.1, it was only added
to VTK a few weeks ago.  In other words, in VTK 6.1 the picking
is _always_ done from the raw points (and even in the latest VTK
master branch, UseCells is Off by default).

 - David


On Sun, Nov 30, 2014 at 8:52 AM, redmod79 <michael.j.redmond at gmail.com>
wrote:

> When using vtkPointPicker in python (vtk 6.1), trying to use UseCellsOff
> and
> related methods results in an attribute error... it seems like using cell
> points is on by default, and I don't want it to be... I want to be able to
> pick the raw points created as shown below and not the cell points (ids 1,
> 2, 3, 4 of the cell)
>
> points = vtk.vtkPoints()
> ... points added
>
> ugrid = vtk.vtkUnstructuredGrid()
>
> ugrid.SetPoints(points)
>
> for i in range(cell_count):
>     cell = some cell created using points
>     ugrid.InsertNextCell(cell)
>
> mapper = vtk.vtkMapper()
> mapper.SetInputData(ugrid)
> actor = vtk.vtkActor()
> actor.SetMapper(mapper)
>
> renderer = vtk.vtkRenderer()
> renderer.AddActor(actor)
>
> ... in another part of the code using a custom interactor style
>
> picker = vtk.vtkPointPicker()
>
> picker.UseCellsOff() ... this causes the attribute error
>
>
>
> doing print dir(picker) shows no methods UseCellsOff or related methods
>
> Thank you for your help.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20141130/bbf5e4e2/attachment.html>


More information about the vtkusers mailing list