FreeMat

- Main Page
- Related Pages

vtkCollapseGraph

Section: Visualization Toolkit Infovis Classes

# Usage

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

# Methods

The class vtkCollapseGraph 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 vtkCollapseGraph class.

- `string = obj.GetClassName ()`
- `int = obj.IsA (string name)`
- `vtkCollapseGraph = obj.NewInstance ()`
- `vtkCollapseGraph = obj.SafeDownCast (vtkObject o)`
- `obj.SetGraphConnection (vtkAlgorithmOutput )`
- `obj.SetSelectionConnection (vtkAlgorithmOutput )`