Section: Visualization Toolkit Filtering Classes
vtkDirectedAcyclicGraph is a read-only data structure. To construct a tree, create an instance of vtkMutableDirectedGraph. Add vertices and edges with AddVertex() and AddEdge(). You may alternately start by adding a single vertex as the root then call graph->AddChild(parent) which adds a new vertex and connects the parent to the child. The tree MUST have all edges in the proper direction, from parent to child. After building the tree, call tree->CheckedShallowCopy(graph) to copy the structure into a vtkDirectedAcyclicGraph. This method will return false if the graph is an invalid tree.
vtkDirectedAcyclicGraph provides some convenience methods for obtaining the parent and children of a vertex, for finding the root, and determining if a vertex is a leaf (a vertex with no children).
To create an instance of class vtkDirectedAcyclicGraph, simply invoke its constructor as follows
obj = vtkDirectedAcyclicGraph
obj
is an instance of the vtkDirectedAcyclicGraph class.
string = obj.GetClassName ()
int = obj.IsA (string name)
vtkDirectedAcyclicGraph = obj.NewInstance ()
vtkDirectedAcyclicGraph = obj.SafeDownCast (vtkObject o)
int = obj.GetDataObjectType ()