[vtkusers] vtkCellArray in python

David Gobbi david.gobbi at gmail.com
Wed Jan 19 15:02:15 EST 2011


On Wed, Jan 19, 2011 at 12:54 PM, igorznt <igorznt at gmail.com> wrote:
>
> vtkCellArray in Python doesnt have the GetCell and GetNextCell method. How
> could I work with its data without them?

In python you can use the following signatures of these methods:

int GetNextCell(vtkIdList *pts);
void GetCell(vtkIdType loc, vtkIdList* pts);

For example, in Python code,

idList = vtk.vtkIdList()

cellArray.GetNextCell(idList)
for i in range(cellArray.GetNumberOfIds()):
    id = cellArray.GetId(i)

You can see all the wrapped methods by using Python "help", like this:
help(vtk.vtkCellArray)

 - David



More information about the vtkusers mailing list