VTK  9.2.6
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 -------------------------------------------------------------------------*/
37 #ifndef vtkMutableUndirectedGraph_h
38 #define vtkMutableUndirectedGraph_h
39 
40 #include "vtkCommonDataModelModule.h" // For export macro
41 #include "vtkUndirectedGraph.h"
42 
44 class vtkGraphEdge;
45 
46 class VTKCOMMONDATAMODEL_EXPORT vtkMutableUndirectedGraph : public vtkUndirectedGraph
47 {
48 public:
51  void PrintSelf(ostream& os, vtkIndent indent) override;
52 
67  virtual vtkIdType SetNumberOfVertices(vtkIdType numVerts);
68 
79  vtkIdType AddVertex();
80 
99  vtkIdType AddVertex(vtkVariantArray* propertyArr);
100 
116  vtkIdType AddVertex(const vtkVariant& pedigreeId);
117 
126  vtkEdgeType AddEdge(vtkIdType u, vtkIdType v);
127 
140  vtkEdgeType AddEdge(vtkIdType u, vtkIdType v, vtkVariantArray* propertyArr);
141 
154  vtkEdgeType AddEdge(const vtkVariant& u, vtkIdType v, vtkVariantArray* propertyArr = nullptr);
155 
168  vtkEdgeType AddEdge(vtkIdType u, const vtkVariant& v, vtkVariantArray* propertyArr = nullptr);
169 
182  vtkEdgeType AddEdge(
183  const vtkVariant& u, const vtkVariant& v, vtkVariantArray* propertyArr = nullptr);
184 
192  void LazyAddVertex();
193 
207  void LazyAddVertex(vtkVariantArray* propertyArr);
208 
219  void LazyAddVertex(const vtkVariant& pedigreeId);
220 
229  void LazyAddEdge(vtkIdType u, vtkIdType v);
230 
243  void LazyAddEdge(vtkIdType u, vtkIdType v, vtkVariantArray* propertyArr);
244 
257  void LazyAddEdge(const vtkVariant& u, vtkIdType v, vtkVariantArray* propertyArr = nullptr);
258 
271  void LazyAddEdge(vtkIdType u, const vtkVariant& v, vtkVariantArray* propertyArr = nullptr);
272 
285  void LazyAddEdge(
286  const vtkVariant& u, const vtkVariant& v, vtkVariantArray* propertyArr = nullptr);
287 
296  vtkGraphEdge* AddGraphEdge(vtkIdType u, vtkIdType v);
297 
302  void RemoveVertex(vtkIdType v);
303 
308  void RemoveEdge(vtkIdType e);
309 
313  void RemoveVertices(vtkIdTypeArray* arr);
314 
318  void RemoveEdges(vtkIdTypeArray* arr);
319 
320 protected:
322  ~vtkMutableUndirectedGraph() override;
323 
328 
329 private:
331  void operator=(const vtkMutableUndirectedGraph&) = delete;
332 };
333 
334 #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:39
dynamic, self-adjusting array of vtkIdType
int vtkIdType
Definition: vtkType.h:332
static vtkUndirectedGraph * New()
A atomic type representing the union of many types.
Definition: vtkVariant.h:69
a simple class to control print indentation
Definition: vtkIndent.h:39
An editable undirected graph.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.