Section: Visualization Toolkit Filtering Classes
After setting up the iterator, the normal mode of operation is to set up a <code>while(iter->HasNext())</code> loop, with the statement <code>vtkIdType vertex = iter->Next()</code> inside the loop.
To create an instance of class vtkTreeDFSIterator, simply invoke its constructor as follows
obj = vtkTreeDFSIterator
obj
is an instance of the vtkTreeDFSIterator class.
string = obj.GetClassName ()
int = obj.IsA (string name)
vtkTreeDFSIterator = obj.NewInstance ()
vtkTreeDFSIterator = obj.SafeDownCast (vtkObject o)
obj.SetTree (vtkTree graph)
- Set the graph to iterate over.
obj.SetMode (int mode)
- Set the visit mode of the iterator. Mode can be
DISCOVER (0): Order by discovery time
FINISH (1): Order by finish time
Default is DISCOVER.
Use DISCOVER for top-down algorithms where parents need to be processed before children.
Use FINISH for bottom-up algorithms where children need to be processed before parents.
int = obj.GetMode ()
- Set the visit mode of the iterator. Mode can be
DISCOVER (0): Order by discovery time
FINISH (1): Order by finish time
Default is DISCOVER.
Use DISCOVER for top-down algorithms where parents need to be processed before children.
Use FINISH for bottom-up algorithms where children need to be processed before parents.
obj.SetStartVertex (vtkIdType vertex)
- The start vertex of the seedgeh.
The tree iterator will only iterate over the subtree rooted at vertex.
If not set (or set to a negative value), starts at the root of the tree.
vtkIdType = obj.GetStartVertex ()
- The start vertex of the seedgeh.
The tree iterator will only iterate over the subtree rooted at vertex.
If not set (or set to a negative value), starts at the root of the tree.
vtkIdType = obj.Next ()
- The next vertex visited in the graph.
bool = obj.HasNext ()
- Return true when all vertices have been visited.