VTK  9.3.1
vtkMutableDirectedGraph.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
25 #ifndef vtkMutableDirectedGraph_h
26 #define vtkMutableDirectedGraph_h
27 
28 #include "vtkCommonDataModelModule.h" // For export macro
29 #include "vtkDirectedGraph.h"
30 
31 VTK_ABI_NAMESPACE_BEGIN
33 class vtkGraphEdge;
34 class vtkVariant;
35 
36 class VTKCOMMONDATAMODEL_EXPORT vtkMutableDirectedGraph : public vtkDirectedGraph
37 {
38 public:
39  static vtkMutableDirectedGraph* New();
41  void PrintSelf(ostream& os, vtkIndent indent) override;
42 
55  virtual vtkIdType SetNumberOfVertices(vtkIdType numVerts);
56 
67  vtkIdType AddVertex();
68 
87  vtkIdType AddVertex(vtkVariantArray* propertyArr);
88 
104  vtkIdType AddVertex(const vtkVariant& pedigreeId);
105 
114  vtkEdgeType AddEdge(vtkIdType u, vtkIdType v);
115 
128  vtkEdgeType AddEdge(vtkIdType u, vtkIdType v, vtkVariantArray* propertyArr);
129 
142  vtkEdgeType AddEdge(const vtkVariant& u, vtkIdType v, vtkVariantArray* propertyArr = nullptr);
143 
156  vtkEdgeType AddEdge(vtkIdType u, const vtkVariant& v, vtkVariantArray* propertyArr = nullptr);
157 
170  vtkEdgeType AddEdge(
171  const vtkVariant& u, const vtkVariant& v, vtkVariantArray* propertyArr = nullptr);
172 
180  void LazyAddVertex();
181 
195  void LazyAddVertex(vtkVariantArray* propertyArr);
196 
207  void LazyAddVertex(const vtkVariant& pedigreeId);
208 
221  void LazyAddEdge(vtkIdType u, vtkIdType v, vtkVariantArray* propertyArr = nullptr);
222 
235  void LazyAddEdge(const vtkVariant& u, vtkIdType v, vtkVariantArray* propertyArr = nullptr);
236 
249  void LazyAddEdge(vtkIdType u, const vtkVariant& v, vtkVariantArray* propertyArr = nullptr);
250 
263  void LazyAddEdge(
264  const vtkVariant& u, const vtkVariant& v, vtkVariantArray* propertyArr = nullptr);
265 
274  vtkGraphEdge* AddGraphEdge(vtkIdType u, vtkIdType v);
275 
288  vtkIdType AddChild(vtkIdType parent, vtkVariantArray* propertyArr);
289  vtkIdType AddChild(vtkIdType parent) { return this->AddChild(parent, nullptr); }
290 
295  void RemoveVertex(vtkIdType v);
296 
301  void RemoveEdge(vtkIdType e);
302 
306  void RemoveVertices(vtkIdTypeArray* arr);
307 
311  void RemoveEdges(vtkIdTypeArray* arr);
312 
313 protected:
315  ~vtkMutableDirectedGraph() override;
316 
321 
322 private:
324  void operator=(const vtkMutableDirectedGraph&) = delete;
325 };
326 
327 VTK_ABI_NAMESPACE_END
328 #endif
An array holding vtkVariants.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Iterates through all edges in a graph.
Representation of a single graph edge.
Definition: vtkGraphEdge.h:24
dynamic, self-adjusting array of vtkIdType
int vtkIdType
Definition: vtkType.h:315
A type representing the union of many types.
Definition: vtkVariant.h:52
A directed graph.
a simple class to control print indentation
Definition: vtkIndent.h:28
An editable directed graph.
vtkIdType AddChild(vtkIdType parent)
static vtkDirectedGraph * New()
vtkGraphEdge * GraphEdge
Graph edge that is reused of AddGraphEdge calls.