Section: Visualization Toolkit Filtering Classes
To create an instance of class vtkMutableUndirectedGraph, simply invoke its constructor as follows
obj = vtkMutableUndirectedGraph
obj
is an instance of the vtkMutableUndirectedGraph class.
string = obj.GetClassName ()
int = obj.IsA (string name)
vtkMutableUndirectedGraph = obj.NewInstance ()
vtkMutableUndirectedGraph = obj.SafeDownCast (vtkObject o)
vtkIdType = obj.AddVertex ()
- Adds a vertex to the graph and returns the index of the new vertex.
Note: In a distributed graph (i.e. a graph whose DistributedHelper
is non-null), this routine cannot be used to add a vertex
if the vertices in the graph have pedigree IDs, because this routine
will always add the vertex locally, which may conflict with the
proper location of the vertex based on the distribution of the
pedigree IDs.
vtkIdType = obj.AddVertex (vtkVariantArray propertyArr)
- Adds a vertex to the graph with associated properties defined in
\p propertyArr and returns the index of the new vertex.
The number and order of values in \p propertyArr must match up with the
arrays in the vertex data retrieved by GetVertexData().
If a vertex with the given pedigree ID already exists, its properties will be
overwritten with the properties in \p propertyArr and the existing
vertex index will be returned.
Note: In a distributed graph (i.e. a graph whose DistributedHelper
is non-null) the vertex added or found might not be local. In this case,
AddVertex will wait until the vertex can be added or found
remotely, so that the proper vertex index can be returned. If you
don't actually need to use the vertex index, consider calling
LazyAddVertex, which provides better performance by eliminating
the delays associated with returning the vertex index.
obj.LazyAddVertex ()
- Adds a vertex to the graph.
This method is lazily evaluated for distributed graphs (i.e. graphs
whose DistributedHelper is non-null) the next time Synchronize is
called on the helper.
obj.LazyAddVertex (vtkVariantArray propertyArr)
- Adds a vertex to the graph with associated properties defined in
\p propertyArr.
The number and order of values in \p propertyArr must match up with the
arrays in the vertex data retrieved by GetVertexData().
If a vertex with the given pedigree ID already exists, its properties will be
overwritten with the properties in \p propertyArr.
This method is lazily evaluated for distributed graphs (i.e. graphs
whose DistributedHelper is non-null) the next time Synchronize is
called on the helper.
obj.LazyAddEdge (vtkIdType u, vtkIdType v)
- Adds an undirected edge from \p u to \p v,
where \p u and \p v are vertex indices.
This method is lazily evaluated for distributed graphs (i.e. graphs
whose DistributedHelper is non-null) the next time Synchronize is
called on the helper.
obj.LazyAddEdge (vtkIdType u, vtkIdType v, vtkVariantArray propertyArr)
- Adds an undirected edge from \p u to \p v,
where \p u and \p v are vertex indices.
The number and order of values in
\p propertyArr must match up with the arrays in the edge data
retrieved by GetEdgeData().
This method is lazily evaluated for distributed graphs (i.e. graphs
whose DistributedHelper is non-null) the next time Synchronize is
called on the helper.
vtkGraphEdge = obj.AddGraphEdge (vtkIdType u, vtkIdType v)
- Variant of AddEdge() that returns a heavyweight \p vtkGraphEdge object.
The graph owns the reference of the edge and will replace
its contents on the next call to AddGraphEdge().
Note: This is a less efficient method for use with wrappers.
In C++ you should use the faster AddEdge().
obj.RemoveVertex (vtkIdType v)
- Removes the vertex from the graph along with any connected edges.
Note: This invalidates the last vertex index, which is reassigned to v.
obj.RemoveEdge (vtkIdType e)
- Removes the edge from the graph.
Note: This invalidates the last edge index, which is reassigned to e.
obj.RemoveVertices (vtkIdTypeArray arr)
- Removes a collection of vertices from the graph along with any connected edges.
obj.RemoveEdges (vtkIdTypeArray arr)
- Removes a collection of edges from the graph.