VTK  9.0.1
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 -------------------------------------------------------------------------*/
34 #ifndef vtkMutableUndirectedGraph_h
35 #define vtkMutableUndirectedGraph_h
36 
37 #include "vtkCommonDataModelModule.h" // For export macro
38 #include "vtkUndirectedGraph.h"
39 
41 class vtkGraphEdge;
42 
43 class VTKCOMMONDATAMODEL_EXPORT vtkMutableUndirectedGraph : public vtkUndirectedGraph
44 {
45 public:
48  void PrintSelf(ostream& os, vtkIndent indent) override;
49 
65 
77 
97 
113  vtkIdType AddVertex(const vtkVariant& pedigreeId);
114 
124 
138 
151  vtkEdgeType AddEdge(const vtkVariant& u, vtkIdType v, vtkVariantArray* propertyArr = nullptr);
152 
165  vtkEdgeType AddEdge(vtkIdType u, const vtkVariant& v, vtkVariantArray* propertyArr = nullptr);
166 
180  const vtkVariant& u, const vtkVariant& v, vtkVariantArray* propertyArr = nullptr);
181 
190 
204  void LazyAddVertex(vtkVariantArray* propertyArr);
205 
216  void LazyAddVertex(const vtkVariant& pedigreeId);
217 
227 
240  void LazyAddEdge(vtkIdType u, vtkIdType v, vtkVariantArray* propertyArr);
241 
254  void LazyAddEdge(const vtkVariant& u, vtkIdType v, vtkVariantArray* propertyArr = nullptr);
255 
268  void LazyAddEdge(vtkIdType u, const vtkVariant& v, vtkVariantArray* propertyArr = nullptr);
269 
283  const vtkVariant& u, const vtkVariant& v, vtkVariantArray* propertyArr = nullptr);
284 
294 
300 
306 
311 
316 
317 protected:
320 
325 
326 private:
328  void operator=(const vtkMutableUndirectedGraph&) = delete;
329 };
330 
331 #endif
vtkMutableUndirectedGraph::LazyAddVertex
void LazyAddVertex()
Adds a vertex to the graph.
vtkUndirectedGraph
An undirected graph.
Definition: vtkUndirectedGraph.h:49
vtkMutableUndirectedGraph
An editable undirected graph.
Definition: vtkMutableUndirectedGraph.h:44
vtkIdType
int vtkIdType
Definition: vtkType.h:338
vtkMutableUndirectedGraph::LazyAddVertex
void LazyAddVertex(const vtkVariant &pedigreeId)
Adds a vertex with the given pedigreeID to the graph.
vtkMutableUndirectedGraph::AddEdge
vtkEdgeType AddEdge(const vtkVariant &u, const vtkVariant &v, vtkVariantArray *propertyArr=nullptr)
Adds a directed edge from u to v, where u and v are vertex pedigree IDs, and returns a vtkEdgeType st...
vtkMutableUndirectedGraph::RemoveVertices
void RemoveVertices(vtkIdTypeArray *arr)
Removes a collection of vertices from the graph along with any connected edges.
vtkUndirectedGraph.h
vtkMutableUndirectedGraph::SetNumberOfVertices
virtual vtkIdType SetNumberOfVertices(vtkIdType numVerts)
Allocates space for the specified number of vertices in the graph's internal data structures.
vtkMutableUndirectedGraph::AddGraphEdge
vtkGraphEdge * AddGraphEdge(vtkIdType u, vtkIdType v)
Variant of AddEdge() that returns a heavyweight vtkGraphEdge object.
vtkMutableUndirectedGraph::GraphEdge
vtkGraphEdge * GraphEdge
Graph edge that is reused of AddGraphEdge calls.
Definition: vtkMutableUndirectedGraph.h:324
vtkMutableUndirectedGraph::LazyAddEdge
void LazyAddEdge(vtkIdType u, vtkIdType v, vtkVariantArray *propertyArr)
Adds an undirected edge from u to v, where u and v are vertex indices.
vtkMutableUndirectedGraph::LazyAddEdge
void LazyAddEdge(const vtkVariant &u, vtkIdType v, vtkVariantArray *propertyArr=nullptr)
Adds an undirected edge from u to v, where u is a vertex pedigree ID and v is a vertex index.
vtkVariantArray
An array holding vtkVariants.
Definition: vtkVariantArray.h:50
vtkEdgeType
Definition: vtkGraph.h:277
vtkMutableUndirectedGraph::AddEdge
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...
vtkMutableUndirectedGraph::AddVertex
vtkIdType AddVertex(vtkVariantArray *propertyArr)
Adds a vertex to the graph with associated properties defined in propertyArr and returns the index of...
vtkMutableUndirectedGraph::LazyAddVertex
void LazyAddVertex(vtkVariantArray *propertyArr)
Adds a vertex to the graph with associated properties defined in propertyArr.
vtkMutableUndirectedGraph::LazyAddEdge
void LazyAddEdge(const vtkVariant &u, const vtkVariant &v, vtkVariantArray *propertyArr=nullptr)
Adds an undirected edge from u to v, where u and v are vertex pedigree IDs.
vtkGraphEdge
Representation of a single graph edge.
Definition: vtkGraphEdge.h:40
vtkMutableUndirectedGraph::RemoveEdge
void RemoveEdge(vtkIdType e)
Removes the edge from the graph.
vtkMutableUndirectedGraph::New
static vtkMutableUndirectedGraph * New()
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:34
vtkMutableUndirectedGraph::AddVertex
vtkIdType AddVertex()
Adds a vertex to the graph and returns the index of the new vertex.
vtkVariant
A atomic type representing the union of many types.
Definition: vtkVariant.h:66
vtkEdgeListIterator
Iterates through all edges in a graph.
Definition: vtkEdgeListIterator.h:51
vtkMutableUndirectedGraph::LazyAddEdge
void LazyAddEdge(vtkIdType u, const vtkVariant &v, vtkVariantArray *propertyArr=nullptr)
Adds an undirected edge from u to v, where u is a vertex index and v is a vertex pedigree ID.
vtkMutableUndirectedGraph::AddVertex
vtkIdType AddVertex(const vtkVariant &pedigreeId)
Adds a vertex with the given pedigreeID to the graph and returns the index of the new vertex.
vtkIdTypeArray
dynamic, self-adjusting array of vtkIdType
Definition: vtkIdTypeArray.h:36
vtkMutableUndirectedGraph::RemoveVertex
void RemoveVertex(vtkIdType v)
Removes the vertex from the graph along with any connected edges.
vtkMutableUndirectedGraph::AddEdge
vtkEdgeType AddEdge(const vtkVariant &u, vtkIdType v, vtkVariantArray *propertyArr=nullptr)
Adds an undirected edge from u to v, where u is a vertex pedigree ID and v is a vertex index,...
vtkMutableUndirectedGraph::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkMutableUndirectedGraph::vtkMutableUndirectedGraph
vtkMutableUndirectedGraph()
vtkMutableUndirectedGraph::~vtkMutableUndirectedGraph
~vtkMutableUndirectedGraph() override
vtkMutableUndirectedGraph::AddEdge
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...
vtkMutableUndirectedGraph::RemoveEdges
void RemoveEdges(vtkIdTypeArray *arr)
Removes a collection of edges from the graph.
vtkMutableUndirectedGraph::LazyAddEdge
void LazyAddEdge(vtkIdType u, vtkIdType v)
Adds an undirected edge from u to v, where u and v are vertex indices.
vtkMutableUndirectedGraph::AddEdge
vtkEdgeType AddEdge(vtkIdType u, const vtkVariant &v, vtkVariantArray *propertyArr=nullptr)
Adds a directed edge from u to v, where u is a vertex index and v is a vertex pedigree ID,...