[vtkusers] UnstructuredGrid to Graph

Fabian, Nathan ndfabia at sandia.gov
Tue Jun 1 20:14:13 EDT 2010


Hi David,

It looks to me like the loop where you iterate over points and GetConnectedVertices() is where it's most expensive. You can replace that behavior with the vtkUnstructuredGrid::GetCells().

Iterating over that vtkCellArray and iterating over the pts returned from GetCell() may be faster.  You'll need to build a switch around cell type to understand what that connectivity is, but I think after removing GetConnectedVertices(), the code size won't change too much...

HTH,
Nathan.

On 5/21/10 7:35 AM, "David Doria" <daviddoria+vtk at gmail.com> wrote:

I am trying to convert all of the edges in an vtkUnstructuredGrid to a vtkGraph.

Here is what I have come up with:
http://www.rpi.edu/~doriad/VTK_List/UnstructuredGridToGraph/

It seems to be horribly slow. Can anyone recommend a faster way to do this?

Thanks,

David
_______________________________________________
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/20100601/b3432f13/attachment.htm>


More information about the vtkusers mailing list