[vtkusers] Activiz.NET VTKCellArray Missing Functions
David Gobbi
david.gobbi at gmail.com
Fri Jul 15 00:41:05 EDT 2011
I can describe a different way to traverse a cell array from the wrapper
languages, that might be more suitable for your needs.
The vtkCellArray returned by GetLines() stores all the pointIds in a
vtkDataArray, and the data arrays are easier to manipulate through the
wrapper languages than cell arrays. The following is example code in
python:
cellArray = filter.GetOutput().GetLines()
n = cellArray.GetNumberOfCells()
dataArray = cellArray.GetData()
k = 0
# go through the line cells
for i in range(n):
# get the number of points in the line
m = dataArray.GetValue(k)
k += 1
# go through the points
for j in range(m):
pointId = dataArray.GetValue(j+k)
point = points.GetPoint(pointId)
# go to the next line
k += m
As seen in the above example, for each cell in the cell array, the data
array contains a value giving the size of the cell, followed by the point
Ids of all the points in that cell.
- David
On Thu, Jul 14, 2011 at 6:52 PM, zkhan <zkhan at novadaq.com> wrote:
> Can you please elaborate on how to use vtkDataSet.GetCell() to do this? I'm
> having the same problem. I'm using a vtkContourFilter to generate
> isocontours and then vtkContourFilter.GetOutput().GetLines() to get the
> lines describing those contours.
>
> I want to be able to traverse the points in each line, but still
> distinguish
> one line from another. Can I accomplish this with vtkDataSet and if so,
> how?
>
> Thanks,
> Zamir
>
> --
> View this message in context:
> http://vtk.1045678.n5.nabble.com/Activiz-NET-VTKCellArray-Missing-Functions-tp4480040p4588976.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110714/f6de190d/attachment.htm>
More information about the vtkusers
mailing list