FreeMat: vtkMergeGraphs

FreeMat

- Main Page
- Related Pages

vtkMergeGraphs

Section: Visualization Toolkit Infovis Classes

# Usage

vtkMergeGraphs combines information from two graphs into one. Both graphs must have pedigree ids assigned to the vertices. The output will contain the vertices/edges in the first graph, in addition to:

- vertices in the second graph whose pedigree id does not match a vertex in the first input

- edges in the second graph

The output will contain the same attribute structure as the input; fields associated only with the second input graph will not be passed to the output. When possible, the vertex/edge data for new vertices and edges will be populated with matching attributes on the second graph. To be considered a matching attribute, the array must have the same name, type, and number of components.

To create an instance of class vtkMergeGraphs, simply invoke its constructor as follows

      obj = vtkMergeGraphs

# Methods

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

- `string = obj.GetClassName ()`
- `int = obj.IsA (string name)`
- `vtkMergeGraphs = obj.NewInstance ()`
- `vtkMergeGraphs = obj.SafeDownCast (vtkObject o)`
- `int = obj.ExtendGraph (vtkMutableGraphHelper g1, vtkGraph g2)` - This is the core functionality of the algorithm. Adds edges and vertices from g2 into g1.
- `obj.SetMaxEdges (vtkIdType )` - The maximum number of edges in the combined graph. Default is -1, which specifies that there should be no limit on the number of edges.
- `vtkIdType = obj.GetMaxEdges ()` - The maximum number of edges in the combined graph. Default is -1, which specifies that there should be no limit on the number of edges.