Section: Visualization Toolkit Infovis Classes
vtkCollapseGraph "collapses" vertices onto their neighbors, while maintaining connectivity. Two inputs are required - a graph (directed or undirected), and a vertex selection that can be converted to indices.
Conceptually, each of the vertices specified in the input selection expands, "swallowing" adacent vertices. Edges to-or-from the "swallowed" vertices become edges to-or-from the expanding vertices, maintaining the overall graph connectivity.
In the case of directed graphs, expanding vertices only swallow vertices that are connected via out edges. This rule provides intuitive behavior when working with trees, so that "child" vertices collapse into their parents when the parents are part of the input selection.
Input port 0: graph Input port 1: selection
To create an instance of class vtkCollapseGraph, simply invoke its constructor as follows
obj = vtkCollapseGraph
obj
is an instance of the vtkCollapseGraph class.
string = obj.GetClassName ()
int = obj.IsA (string name)
vtkCollapseGraph = obj.NewInstance ()
vtkCollapseGraph = obj.SafeDownCast (vtkObject o)
obj.SetGraphConnection (vtkAlgorithmOutput )
obj.SetSelectionConnection (vtkAlgorithmOutput )