VTK: Common/DataModel/vtkMutableUndirectedGraph.h Source File

| VTK 9.3.1

vtkMutableUndirectedGraph.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-FileCopyrightText: Copyright 2008 Sandia Corporation
3 // SPDX-License-Identifier: LicenseRef-BSD-3-Clause-Sandia-USGov
30 #ifndef vtkMutableUndirectedGraph_h
31 #define vtkMutableUndirectedGraph_h
32
33 #include "vtkCommonDataModelModule.h" // For export macro
34 #include "vtkUndirectedGraph.h"
35
36 VTK_ABI_NAMESPACE_BEGIN
37 class vtkEdgeListIterator;
38 class vtkGraphEdge;
39
40 class VTKCOMMONDATAMODEL_EXPORT vtkMutableUndirectedGraph : public vtkUndirectedGraph
41 {
42 public:
43 static vtkMutableUndirectedGraph* New();
44 vtkTypeMacro(vtkMutableUndirectedGraph, vtkUndirectedGraph);
45 void PrintSelf(ostream& os, vtkIndent indent) override;
46
61 virtual vtkIdType SetNumberOfVertices(vtkIdType numVerts);
62
73 vtkIdType AddVertex();
74
93 vtkIdType AddVertex(vtkVariantArray* propertyArr);
94
110 vtkIdType AddVertex(const vtkVariant& pedigreeId);
111
120 vtkEdgeType AddEdge(vtkIdType u, vtkIdType v);
121
134 vtkEdgeType AddEdge(vtkIdType u, vtkIdType v, vtkVariantArray* propertyArr);
135
148 vtkEdgeType AddEdge(const vtkVariant& u, vtkIdType v, vtkVariantArray* propertyArr = nullptr);
149
162 vtkEdgeType AddEdge(vtkIdType u, const vtkVariant& v, vtkVariantArray* propertyArr = nullptr);
163
176 vtkEdgeType AddEdge(
177 const vtkVariant& u, const vtkVariant& v, vtkVariantArray* propertyArr = nullptr);
178
186 void LazyAddVertex();
187
201 void LazyAddVertex(vtkVariantArray* propertyArr);
202
213 void LazyAddVertex(const vtkVariant& pedigreeId);
214
223 void LazyAddEdge(vtkIdType u, vtkIdType v);
224
237 void LazyAddEdge(vtkIdType u, vtkIdType v, vtkVariantArray* propertyArr);
238
251 void LazyAddEdge(const vtkVariant& u, vtkIdType v, vtkVariantArray* propertyArr = nullptr);
252
265 void LazyAddEdge(vtkIdType u, const vtkVariant& v, vtkVariantArray* propertyArr = nullptr);
266
279 void LazyAddEdge(
280 const vtkVariant& u, const vtkVariant& v, vtkVariantArray* propertyArr = nullptr);
281
290 vtkGraphEdge* AddGraphEdge(vtkIdType u, vtkIdType v);
291
296 void RemoveVertex(vtkIdType v);
297
302 void RemoveEdge(vtkIdType e);
303
307 void RemoveVertices(vtkIdTypeArray* arr);
308
312 void RemoveEdges(vtkIdTypeArray* arr);
313
314 protected:
315 vtkMutableUndirectedGraph();
316 ~vtkMutableUndirectedGraph() override;
317
321 vtkGraphEdge* GraphEdge;
322
323 private:
324 vtkMutableUndirectedGraph(const vtkMutableUndirectedGraph&) = delete;
325 void operator=(const vtkMutableUndirectedGraph&) = delete;
326 };
327
328 VTK_ABI_NAMESPACE_END
329 #endif
vtkEdgeListIterator
Iterates through all edges in a graph.
Definition: vtkEdgeListIterator.h:51
vtkGraphEdge
Representation of a single graph edge.
Definition: vtkGraphEdge.h:25
vtkIdTypeArray
dynamic, self-adjusting array of vtkIdType
Definition: vtkIdTypeArray.h:37
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkMutableUndirectedGraph
An editable undirected graph.
Definition: vtkMutableUndirectedGraph.h:41
vtkMutableUndirectedGraph::RemoveVertices
void RemoveVertices(vtkIdTypeArray *arr)
Removes a collection of vertices from the graph along with any connected edges.
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::~vtkMutableUndirectedGraph
~vtkMutableUndirectedGraph() override
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.
vtkMutableUndirectedGraph::LazyAddEdge
void LazyAddEdge(vtkIdType u, vtkIdType v)
Adds an undirected edge from u to v, where u and v are vertex indices.
vtkMutableUndirectedGraph::vtkMutableUndirectedGraph
vtkMutableUndirectedGraph()
vtkMutableUndirectedGraph::LazyAddVertex
void LazyAddVertex()
Adds a vertex to the graph.
vtkMutableUndirectedGraph::LazyAddVertex
void LazyAddVertex(const vtkVariant &pedigreeId)
Adds a vertex with the given pedigreeID to the graph.
vtkMutableUndirectedGraph::GraphEdge
vtkGraphEdge * GraphEdge
Graph edge that is reused of AddGraphEdge calls.
Definition: vtkMutableUndirectedGraph.h:321
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.
vtkMutableUndirectedGraph::SetNumberOfVertices
virtual vtkIdType SetNumberOfVertices(vtkIdType numVerts)
Allocates space for the specified number of vertices in the graph's internal data structures.
vtkMutableUndirectedGraph::LazyAddVertex
void LazyAddVertex(vtkVariantArray *propertyArr)
Adds a vertex to the graph with associated properties defined in propertyArr.
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::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::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.
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,...
vtkMutableUndirectedGraph::AddVertex
vtkIdType AddVertex(vtkVariantArray *propertyArr)
Adds a vertex to the graph with associated properties defined in propertyArr and returns the index of...
vtkMutableUndirectedGraph::RemoveVertex
void RemoveVertex(vtkIdType v)
Removes the vertex from the graph along with any connected edges.
vtkMutableUndirectedGraph::AddGraphEdge
vtkGraphEdge * AddGraphEdge(vtkIdType u, vtkIdType v)
Variant of AddEdge() that returns a heavyweight vtkGraphEdge object.
vtkMutableUndirectedGraph::New
static vtkMutableUndirectedGraph * New()
vtkMutableUndirectedGraph::RemoveEdge
void RemoveEdge(vtkIdType e)
Removes the edge from the graph.
vtkMutableUndirectedGraph::AddVertex
vtkIdType AddVertex()
Adds a vertex to the graph and returns the index of the new vertex.
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::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
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::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,...
vtkUndirectedGraph
An undirected graph.
Definition: vtkUndirectedGraph.h:49
vtkVariantArray
An array holding vtkVariants.
Definition: vtkVariantArray.h:47
vtkVariant
A type representing the union of many types.
Definition: vtkVariant.h:62
vtkEdgeType
Definition: vtkGraph.h:277
vtkIdType
int vtkIdType
Definition: vtkType.h:315
vtkUndirectedGraph.h