<blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">
1) how do you do that (without writing your</blockquote><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">
own tree traversal recursive functions) and 2) what does this class</blockquote><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">
do?</blockquote><div><br></div>1) Currently there is a vtkTreeDFSIterator which allows you to traverse a tree pre-order or post-order depth-first, but no BFS iterator.<div><br></div><div>If you need to iterate breadth-first, you can include vtkBoostGraphAdapter.h and use boost&#39;s breadth_first_search object to iterate over the vtkTree:<div>
<br></div><div><a href="http://www.boost.org/doc/libs/1_40_0/libs/graph/doc/breadth_first_search.html">http://www.boost.org/doc/libs/1_40_0/libs/graph/doc/breadth_first_search.html</a>
</div><div><br></div><div>This is what vtkBoostBreadthFirstSearch does in its implementation. Even better, you can implement a VTK iterator class to do this.</div><div><br></div><div>2) vtkBoostBreadthFirstSearch is simply a filter that inputs a graph and outputs a graph with a vtkIntArray appended that contains the distance (number of hops) from the origin vertex.</div>
<div><br></div><div>Jeff</div><div><br></div></div>