[vtkusers] vtkAdjacentVertexIterator doesn't work after removing vertices?

planar3d planar3d at gmail.com
Mon Apr 30 14:41:29 EDT 2012


I created a new VTK graph using CheckedDeepCopy

I then proceeded to remove a subset of vertices from this copy using the
RemoveVertices function

I can then step through these remaining vertices using the GetVertices
function and I am printing out their vtkIdType which is their vertex ID.

I call GetAdjacentVertices (which sets the vtkAdjacentVertexIterator) on
each of these vertices to examine their neighbors.

However, vtkAdjacentVertexIterator->Next returns a vtkIdType that is way too
high. I only have 50 vertices in my graph but that Next function is
returning a number like 31699040.

The funny thing is I can display this small graph and I can see the edges
connecting various vertices.

Now I said that the argument going into this code that calls GetVertices and
GetAdjacentVertices was a graph that had some vertices removed using the
RemoveVertices function. I got rid of the call to RemoveVertices to see how
the code behaves when it has been given a graph that hasn't been modified
and it worked as expected. Is there something wrong with
vtkAdjacentVertexIterator and mutable graphs?


--
View this message in context: http://vtk.1045678.n5.nabble.com/vtkAdjacentVertexIterator-doesn-t-work-after-removing-vertices-tp5676605.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list