VTK  9.2.6
vtkMutableDirectedGraph.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkMutableDirectedGraph.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 -------------------------------------------------------------------------*/
41 #ifndef vtkMutableDirectedGraph_h
42 #define vtkMutableDirectedGraph_h
43 
44 #include "vtkCommonDataModelModule.h" // For export macro
45 #include "vtkDirectedGraph.h"
46 
48 class vtkGraphEdge;
49 class vtkVariant;
50 
51 class VTKCOMMONDATAMODEL_EXPORT vtkMutableDirectedGraph : public vtkDirectedGraph
52 {
53 public:
54  static vtkMutableDirectedGraph* New();
56  void PrintSelf(ostream& os, vtkIndent indent) override;
57 
70  virtual vtkIdType SetNumberOfVertices(vtkIdType numVerts);
71 
82  vtkIdType AddVertex();
83 
102  vtkIdType AddVertex(vtkVariantArray* propertyArr);
103 
119  vtkIdType AddVertex(const vtkVariant& pedigreeId);
120 
129  vtkEdgeType AddEdge(vtkIdType u, vtkIdType v);
130 
143  vtkEdgeType AddEdge(vtkIdType u, vtkIdType v, vtkVariantArray* propertyArr);
144 
157  vtkEdgeType AddEdge(const vtkVariant& u, vtkIdType v, vtkVariantArray* propertyArr = nullptr);
158 
171  vtkEdgeType AddEdge(vtkIdType u, const vtkVariant& v, vtkVariantArray* propertyArr = nullptr);
172 
185  vtkEdgeType AddEdge(
186  const vtkVariant& u, const vtkVariant& v, vtkVariantArray* propertyArr = nullptr);
187 
195  void LazyAddVertex();
196 
210  void LazyAddVertex(vtkVariantArray* propertyArr);
211 
222  void LazyAddVertex(const vtkVariant& pedigreeId);
223 
236  void LazyAddEdge(vtkIdType u, vtkIdType v, vtkVariantArray* propertyArr = nullptr);
237 
250  void LazyAddEdge(const vtkVariant& u, vtkIdType v, vtkVariantArray* propertyArr = nullptr);
251 
264  void LazyAddEdge(vtkIdType u, const vtkVariant& v, vtkVariantArray* propertyArr = nullptr);
265 
278  void LazyAddEdge(
279  const vtkVariant& u, const vtkVariant& v, vtkVariantArray* propertyArr = nullptr);
280 
289  vtkGraphEdge* AddGraphEdge(vtkIdType u, vtkIdType v);
290 
303  vtkIdType AddChild(vtkIdType parent, vtkVariantArray* propertyArr);
304  vtkIdType AddChild(vtkIdType parent) { return this->AddChild(parent, nullptr); }
305 
310  void RemoveVertex(vtkIdType v);
311 
316  void RemoveEdge(vtkIdType e);
317 
321  void RemoveVertices(vtkIdTypeArray* arr);
322 
326  void RemoveEdges(vtkIdTypeArray* arr);
327 
328 protected:
330  ~vtkMutableDirectedGraph() override;
331 
336 
337 private:
339  void operator=(const vtkMutableDirectedGraph&) = delete;
340 };
341 
342 #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:39
dynamic, self-adjusting array of vtkIdType
int vtkIdType
Definition: vtkType.h:332
A atomic type representing the union of many types.
Definition: vtkVariant.h:69
A directed graph.
a simple class to control print indentation
Definition: vtkIndent.h:39
An editable directed graph.
vtkIdType AddChild(vtkIdType parent)
static vtkDirectedGraph * New()
vtkGraphEdge * GraphEdge
Graph edge that is reused of AddGraphEdge calls.