VTK  9.7.20260709
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
129
130#ifndef vtkMutableUndirectedGraph_h
131#define vtkMutableUndirectedGraph_h
132
133#include "vtkCommonDataModelModule.h" // For export macro
134#include "vtkUndirectedGraph.h"
135
136VTK_ABI_NAMESPACE_BEGIN
137class vtkDataArray;
139class vtkGraphEdge;
140
141class VTKCOMMONDATAMODEL_EXPORT vtkMutableUndirectedGraph : public vtkUndirectedGraph
142{
143public:
146 void PrintSelf(ostream& os, vtkIndent indent) override;
147
163
175
195
211 vtkIdType AddVertex(const vtkVariant& pedigreeId);
212
222
236
249 vtkEdgeType AddEdge(const vtkVariant& u, vtkIdType v, vtkVariantArray* propertyArr = nullptr);
250
263 vtkEdgeType AddEdge(vtkIdType u, const vtkVariant& v, vtkVariantArray* propertyArr = nullptr);
264
278 const vtkVariant& u, const vtkVariant& v, vtkVariantArray* propertyArr = nullptr);
279
288
302 void LazyAddVertex(vtkVariantArray* propertyArr);
303
314 void LazyAddVertex(const vtkVariant& pedigreeId);
315
325
339
352 void LazyAddEdge(const vtkVariant& u, vtkIdType v, vtkVariantArray* propertyArr = nullptr);
353
366 void LazyAddEdge(vtkIdType u, const vtkVariant& v, vtkVariantArray* propertyArr = nullptr);
367
381 const vtkVariant& u, const vtkVariant& v, vtkVariantArray* propertyArr = nullptr);
382
392
398
404
409
414
424
425protected:
428
433
434private:
436 void operator=(const vtkMutableUndirectedGraph&) = delete;
437};
438
439VTK_ABI_NAMESPACE_END
440#endif
Iterates through all edges in a graph.
Representation of a single graph edge.
dynamic, self-adjusting array of vtkIdType
a simple class to control print indentation
Definition vtkIndent.h:108
void RemoveVertices(vtkIdTypeArray *arr)
Removes a collection of vertices from the graph along with any connected edges.
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() override
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.
void LazyAddEdge(vtkIdType u, vtkIdType v)
Adds an undirected edge from u to v, where u and v are vertex indices.
void SetEdges(vtkDataArray *edges)
Replace all edges in the graph with the given edge array.
void LazyAddVertex()
Adds a vertex to the graph.
void LazyAddVertex(const vtkVariant &pedigreeId)
Adds a vertex with the given pedigreeID to the graph.
vtkGraphEdge * GraphEdge
Graph edge that is reused of AddGraphEdge calls.
vtkIdType AddVertex(const vtkVariant &pedigreeId)
Adds a vertex with the given pedigreeID to the graph and returns the index of the new vertex.
static vtkMutableUndirectedGraph * New()
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, 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...
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.
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,...
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.
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...
vtkGraphEdge * AddGraphEdge(vtkIdType u, vtkIdType v)
Variant of AddEdge() that returns a heavyweight vtkGraphEdge object.
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.
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,...
An array holding vtkVariants.
A type representing the union of many types.
Definition vtkVariant.h:162
std::pair< boost::graph_traits< vtkGraph * >::edge_iterator, boost::graph_traits< vtkGraph * >::edge_iterator > edges(vtkGraph *g)
#define vtkDataArray
int vtkIdType
Definition vtkType.h:363