FreeMat

- Main Page
- Related Pages

vtkUndirectedGraph

Section: Visualization Toolkit Filtering Classes

# Usage

vtkUndirectedGraph is a collection of vertices along with a collection of undirected edges (they connect two vertices in no particular order). ShallowCopy(), DeepCopy(), CheckedShallowCopy(), CheckedDeepCopy() accept instances of vtkUndirectedGraph and vtkMutableUndirectedGraph. GetOutEdges(v, it) and GetInEdges(v, it) return the same list of edges, which is the list of all edges which have a v as an endpoint. GetInDegree(v), GetOutDegree(v) and GetDegree(v) all return the full degree of vertex v.

vtkUndirectedGraph is read-only. To create an undirected graph, use an instance of vtkMutableUndirectedGraph, then you may set the structure to a vtkUndirectedGraph using ShallowCopy().

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

      obj = vtkUndirectedGraph

# Methods

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

- `string = obj.GetClassName ()`
- `int = obj.IsA (string name)`
- `vtkUndirectedGraph = obj.NewInstance ()`
- `vtkUndirectedGraph = obj.SafeDownCast (vtkObject o)`
- `int = obj.GetDataObjectType ()` - Returns the full degree of the vertex.
- `vtkIdType = obj.GetInDegree (vtkIdType v)` - Returns the full degree of the vertex.
- `obj.GetInEdge (vtkIdType v, vtkIdType i, vtkGraphEdge e)` - Initialize the iterator to get the incoming edges to a vertex. For an undirected graph, this is all incident edges.
- `obj.GetInEdges (vtkIdType v, vtkInEdgeIterator it)`