VTK  9.0.20200807
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 -------------------------------------------------------------------------*/
34 #ifndef vtkMutableUndirectedGraph_h
35 #define vtkMutableUndirectedGraph_h
36 
37 #include "vtkCommonDataModelModule.h" // For export macro
38 #include "vtkUndirectedGraph.h"
39 
41 class vtkGraphEdge;
42 
43 class VTKCOMMONDATAMODEL_EXPORT vtkMutableUndirectedGraph : public vtkUndirectedGraph
44 {
45 public:
48  void PrintSelf(ostream& os, vtkIndent indent) override;
49 
64  virtual vtkIdType SetNumberOfVertices(vtkIdType numVerts);
65 
76  vtkIdType AddVertex();
77 
96  vtkIdType AddVertex(vtkVariantArray* propertyArr);
97 
113  vtkIdType AddVertex(const vtkVariant& pedigreeId);
114 
123  vtkEdgeType AddEdge(vtkIdType u, vtkIdType v);
124 
137  vtkEdgeType AddEdge(vtkIdType u, vtkIdType v, vtkVariantArray* propertyArr);
138 
151  vtkEdgeType AddEdge(const vtkVariant& u, vtkIdType v, vtkVariantArray* propertyArr = nullptr);
152 
165  vtkEdgeType AddEdge(vtkIdType u, const vtkVariant& v, vtkVariantArray* propertyArr = nullptr);
166 
179  vtkEdgeType AddEdge(
180  const vtkVariant& u, const vtkVariant& v, vtkVariantArray* propertyArr = nullptr);
181 
189  void LazyAddVertex();
190 
204  void LazyAddVertex(vtkVariantArray* propertyArr);
205 
216  void LazyAddVertex(const vtkVariant& pedigreeId);
217 
226  void LazyAddEdge(vtkIdType u, vtkIdType v);
227 
240  void LazyAddEdge(vtkIdType u, vtkIdType v, vtkVariantArray* propertyArr);
241 
254  void LazyAddEdge(const vtkVariant& u, vtkIdType v, vtkVariantArray* propertyArr = nullptr);
255 
268  void LazyAddEdge(vtkIdType u, const vtkVariant& v, vtkVariantArray* propertyArr = nullptr);
269 
282  void LazyAddEdge(
283  const vtkVariant& u, const vtkVariant& v, vtkVariantArray* propertyArr = nullptr);
284 
293  vtkGraphEdge* AddGraphEdge(vtkIdType u, vtkIdType v);
294 
299  void RemoveVertex(vtkIdType v);
300 
305  void RemoveEdge(vtkIdType e);
306 
310  void RemoveVertices(vtkIdTypeArray* arr);
311 
315  void RemoveEdges(vtkIdTypeArray* arr);
316 
317 protected:
319  ~vtkMutableUndirectedGraph() override;
320 
325 
326 private:
328  void operator=(const vtkMutableUndirectedGraph&) = delete;
329 };
330 
331 #endif
vtkUndirectedGraph
An undirected graph.
Definition: vtkUndirectedGraph.h:48
vtkMutableUndirectedGraph
An editable undirected graph.
Definition: vtkMutableUndirectedGraph.h:43
vtkIdType
int vtkIdType
Definition: vtkType.h:330
vtkUndirectedGraph.h
vtkMutableUndirectedGraph::GraphEdge
vtkGraphEdge * GraphEdge
Graph edge that is reused of AddGraphEdge calls.
Definition: vtkMutableUndirectedGraph.h:324
vtkUndirectedGraph::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkVariantArray
An array holding vtkVariants.
Definition: vtkVariantArray.h:49
vtkEdgeType
Definition: vtkGraph.h:276
vtkGraphEdge
Representation of a single graph edge.
Definition: vtkGraphEdge.h:39
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkVariant
A atomic type representing the union of many types.
Definition: vtkVariant.h:65
vtkEdgeListIterator
Iterates through all edges in a graph.
Definition: vtkEdgeListIterator.h:50
vtkIdTypeArray
dynamic, self-adjusting array of vtkIdType
Definition: vtkIdTypeArray.h:35
vtkUndirectedGraph::New
static vtkUndirectedGraph * New()