I can describe a different way to traverse a cell array from the wrapper languages, that might be more suitable for your needs.<div><br></div><div>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:</div>
<div><br></div><div>cellArray = filter.GetOutput().GetLines()</div><meta charset="utf-8"><div>n = cellArray.GetNumberOfCells()</div><div>dataArray = cellArray.GetData()</div><div>k = 0</div><div># go through the line cells</div>
<div>for i in range(n):</div><div> # get the number of points in the line</div><div> m = dataArray.GetValue(k)</div><div> k += 1</div><div> # go through the points</div><div> for j in range(m):</div><div> pointId = dataArray.GetValue(j+k)</div>
<div> point = points.GetPoint(pointId)</div><div> # go to the next line</div><div> k += m</div><div><br></div><div>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.</div>
<div><br></div><div> - David</div><div><br><br><div class="gmail_quote">On Thu, Jul 14, 2011 at 6:52 PM, zkhan <span dir="ltr"><<a href="mailto:zkhan@novadaq.com">zkhan@novadaq.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Can you please elaborate on how to use vtkDataSet.GetCell() to do this? I'm<br>
having the same problem. I'm using a vtkContourFilter to generate<br>
isocontours and then vtkContourFilter.GetOutput().GetLines() to get the<br>
lines describing those contours.<br>
<br>
I want to be able to traverse the points in each line, but still distinguish<br>
one line from another. Can I accomplish this with vtkDataSet and if so, how?<br>
<br>
Thanks,<br>
Zamir<br>
<font color="#888888"><br>
--<br>
View this message in context: <a href="http://vtk.1045678.n5.nabble.com/Activiz-NET-VTKCellArray-Missing-Functions-tp4480040p4588976.html" target="_blank">http://vtk.1045678.n5.nabble.com/Activiz-NET-VTKCellArray-Missing-Functions-tp4480040p4588976.html</a><br>
</font><div class="im">Sent from the VTK - Users mailing list archive at Nabble.com.<br>
</div><div><div></div><div class="h5">_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</div></div></blockquote></div><br></div>