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
21 #ifndef vtkMutableUndirectedGraph_h
22 #define vtkMutableUndirectedGraph_h
23 
24 #include "vtkCommonDataModelModule.h" // For export macro
25 #include "vtkUndirectedGraph.h"
26 
27 VTK_ABI_NAMESPACE_BEGIN
29 class vtkGraphEdge;
30 
31 class VTKCOMMONDATAMODEL_EXPORT vtkMutableUndirectedGraph : public vtkUndirectedGraph
32 {
33 public:
36  void PrintSelf(ostream& os, vtkIndent indent) override;
37 
52  virtual vtkIdType SetNumberOfVertices(vtkIdType numVerts);
53 
64  vtkIdType AddVertex();
65 
84  vtkIdType AddVertex(vtkVariantArray* propertyArr);
85 
101  vtkIdType AddVertex(const vtkVariant& pedigreeId);
102 
111  vtkEdgeType AddEdge(vtkIdType u, vtkIdType v);
112 
125  vtkEdgeType AddEdge(vtkIdType u, vtkIdType v, vtkVariantArray* propertyArr);
126 
139  vtkEdgeType AddEdge(const vtkVariant& u, vtkIdType v, vtkVariantArray* propertyArr = nullptr);
140 
153  vtkEdgeType AddEdge(vtkIdType u, const vtkVariant& v, vtkVariantArray* propertyArr = nullptr);
154 
167  vtkEdgeType AddEdge(
168  const vtkVariant& u, const vtkVariant& v, vtkVariantArray* propertyArr = nullptr);
169 
177  void LazyAddVertex();
178 
192  void LazyAddVertex(vtkVariantArray* propertyArr);
193 
204  void LazyAddVertex(const vtkVariant& pedigreeId);
205 
214  void LazyAddEdge(vtkIdType u, vtkIdType v);
215 
228  void LazyAddEdge(vtkIdType u, vtkIdType v, vtkVariantArray* propertyArr);
229 
242  void LazyAddEdge(const vtkVariant& u, vtkIdType v, vtkVariantArray* propertyArr = nullptr);
243 
256  void LazyAddEdge(vtkIdType u, const vtkVariant& v, vtkVariantArray* propertyArr = nullptr);
257 
270  void LazyAddEdge(
271  const vtkVariant& u, const vtkVariant& v, vtkVariantArray* propertyArr = nullptr);
272 
281  vtkGraphEdge* AddGraphEdge(vtkIdType u, vtkIdType v);
282 
287  void RemoveVertex(vtkIdType v);
288 
293  void RemoveEdge(vtkIdType e);
294 
298  void RemoveVertices(vtkIdTypeArray* arr);
299 
303  void RemoveEdges(vtkIdTypeArray* arr);
304 
305 protected:
307  ~vtkMutableUndirectedGraph() override;
308 
313 
314 private:
316  void operator=(const vtkMutableUndirectedGraph&) = delete;
317 };
318 
319 VTK_ABI_NAMESPACE_END
320 #endif
An array holding vtkVariants.
Iterates through all edges in a graph.
vtkGraphEdge * GraphEdge
Graph edge that is reused of AddGraphEdge calls.
An undirected graph.
Representation of a single graph edge.
Definition: vtkGraphEdge.h:24
dynamic, self-adjusting array of vtkIdType
int vtkIdType
Definition: vtkType.h:315
static vtkUndirectedGraph * New()
A type representing the union of many types.
Definition: vtkVariant.h:52
a simple class to control print indentation
Definition: vtkIndent.h:28
An editable undirected graph.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.