FreeMat

- Main Page
- Related Pages

vtkDirectedAcyclicGraph

Section: Visualization Toolkit Filtering Classes

# Usage

vtkDirectedAcyclicGraph is a connected directed graph with no cycles. A tree is a type of directed graph, so works with all graph algorithms.

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

# Methods

The class vtkDirectedAcyclicGraph has several methods that can be used. They are listed below. Note that the documentation is translated automatically from the VTK sources, and may not be completely intelligible. When in doubt, consult the VTK website. In the methods listed below, `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 ()`