VTK
vtkMutableUndirectedGraph.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkMutableUndirectedGraph.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 /*-------------------------------------------------------------------------
16  Copyright 2008 Sandia Corporation.
17  Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
18  the U.S. Government retains certain rights in this software.
19 -------------------------------------------------------------------------*/
37 #ifndef vtkMutableUndirectedGraph_h
38 #define vtkMutableUndirectedGraph_h
39 
40 #include "vtkCommonDataModelModule.h" // For export macro
41 #include "vtkUndirectedGraph.h"
42 
44 class vtkGraphEdge;
45 
46 class VTKCOMMONDATAMODEL_EXPORT vtkMutableUndirectedGraph : public vtkUndirectedGraph
47 {
48 public:
51  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
52 
68 
80 
100 
116  vtkIdType AddVertex(const vtkVariant& pedigreeId);
117 
127 
141  vtkVariantArray *propertyArr);
142 
156  vtkVariantArray *propertyArr = 0);
157 
171  vtkVariantArray *propertyArr = 0);
172 
186  const vtkVariant& v,
187  vtkVariantArray *propertyArr = 0);
188 
197 
211  void LazyAddVertex(vtkVariantArray *propertyArr);
212 
223  void LazyAddVertex(const vtkVariant& pedigreeId);
224 
234 
247  void LazyAddEdge(vtkIdType u, vtkIdType v, vtkVariantArray *propertyArr);
248 
261  void LazyAddEdge(const vtkVariant& u, vtkIdType v,
262  vtkVariantArray *propertyArr = 0);
263 
276  void LazyAddEdge(vtkIdType u, const vtkVariant& v,
277  vtkVariantArray *propertyArr = 0);
278 
291  void LazyAddEdge(const vtkVariant& u,
292  const vtkVariant& v,
293  vtkVariantArray *propertyArr = 0);
294 
304 
310 
316 
321 
326 
327 protected:
330 
334  vtkGraphEdge *GraphEdge;
335 
336 private:
337  vtkMutableUndirectedGraph(const vtkMutableUndirectedGraph&) VTK_DELETE_FUNCTION;
338  void operator=(const vtkMutableUndirectedGraph&) VTK_DELETE_FUNCTION;
339 };
340 
341 #endif
Iterates through all edges in a graph.
Representation of a single graph edge.
Definition: vtkGraphEdge.h:40
dynamic, self-adjusting array of vtkIdType
a simple class to control print indentation
Definition: vtkIndent.h:40
An editable undirected graph.
void RemoveVertices(vtkIdTypeArray *arr)
Removes a collection of vertices from the graph along with any connected edges.
~vtkMutableUndirectedGraph() override
void LazyAddEdge(vtkIdType u, vtkIdType v)
Adds an undirected edge from u to v, where u and v are vertex indices.
vtkEdgeType AddEdge(vtkIdType u, const vtkVariant &v, vtkVariantArray *propertyArr=0)
Adds a directed edge from u to v, where u is a vertex index and v is a vertex pedigree ID,...
void LazyAddEdge(vtkIdType u, const vtkVariant &v, vtkVariantArray *propertyArr=0)
Adds an undirected edge from u to v, where u is a vertex index and v is a vertex pedigree ID.
vtkEdgeType AddEdge(const vtkVariant &u, const vtkVariant &v, vtkVariantArray *propertyArr=0)
Adds a directed edge from u to v, where u and v are vertex pedigree IDs, and returns a vtkEdgeType st...
void LazyAddEdge(const vtkVariant &u, vtkIdType v, vtkVariantArray *propertyArr=0)
Adds an undirected edge from u to v, where u is a vertex pedigree ID and v is a vertex index.
void LazyAddVertex()
Adds a vertex to the graph.
void LazyAddVertex(const vtkVariant &pedigreeId)
Adds a vertex with the given pedigreeID to the graph.
vtkIdType AddVertex(const vtkVariant &pedigreeId)
Adds a vertex with the given pedigreeID to the graph and returns the index of the new vertex.
virtual vtkIdType SetNumberOfVertices(vtkIdType numVerts)
Allocates space for the specified number of vertices in the graph's internal data structures.
void LazyAddVertex(vtkVariantArray *propertyArr)
Adds a vertex to the graph with associated properties defined in propertyArr.
void LazyAddEdge(vtkIdType u, vtkIdType v, vtkVariantArray *propertyArr)
Adds an undirected edge from u to v, where u and v are vertex indices.
vtkEdgeType AddEdge(const vtkVariant &u, vtkIdType v, vtkVariantArray *propertyArr=0)
Adds an undirected edge from u to v, where u is a vertex pedigree ID and v is a vertex index,...
vtkIdType AddVertex(vtkVariantArray *propertyArr)
Adds a vertex to the graph with associated properties defined in propertyArr and returns the index of...
void RemoveVertex(vtkIdType v)
Removes the vertex from the graph along with any connected edges.
vtkGraphEdge * AddGraphEdge(vtkIdType u, vtkIdType v)
Variant of AddEdge() that returns a heavyweight vtkGraphEdge object.
static vtkMutableUndirectedGraph * New()
void LazyAddEdge(const vtkVariant &u, const vtkVariant &v, vtkVariantArray *propertyArr=0)
Adds an undirected edge from u to v, where u and v are vertex pedigree IDs.
void RemoveEdge(vtkIdType e)
Removes the edge from the graph.
vtkIdType AddVertex()
Adds a vertex to the graph and returns the index of the new vertex.
vtkEdgeType AddEdge(vtkIdType u, vtkIdType v)
Adds an undirected edge from u to v, where u and v are vertex indices, and returns a vtkEdgeType stru...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkEdgeType AddEdge(vtkIdType u, vtkIdType v, vtkVariantArray *propertyArr)
Adds an undirected edge from u to v, where u and v are vertex indices, with associated properties def...
void RemoveEdges(vtkIdTypeArray *arr)
Removes a collection of edges from the graph.
An undirected graph.
An array holding vtkVariants.
A atomic type representing the union of many types.
Definition: vtkVariant.h:76
int vtkIdType
Definition: vtkType.h:287