VTK  9.0.20200807
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 -------------------------------------------------------------------------*/
35 #ifndef vtkMutableDirectedGraph_h
36 #define vtkMutableDirectedGraph_h
37 
38 #include "vtkCommonDataModelModule.h" // For export macro
39 #include "vtkDirectedGraph.h"
40 
42 class vtkGraphEdge;
43 class vtkVariant;
44 
45 class VTKCOMMONDATAMODEL_EXPORT vtkMutableDirectedGraph : public vtkDirectedGraph
46 {
47 public:
48  static vtkMutableDirectedGraph* New();
50  void PrintSelf(ostream& os, vtkIndent indent) override;
51 
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 
230  void LazyAddEdge(vtkIdType u, vtkIdType v, vtkVariantArray* propertyArr = nullptr);
231 
244  void LazyAddEdge(const vtkVariant& u, vtkIdType v, vtkVariantArray* propertyArr = nullptr);
245 
258  void LazyAddEdge(vtkIdType u, const vtkVariant& v, vtkVariantArray* propertyArr = nullptr);
259 
272  void LazyAddEdge(
273  const vtkVariant& u, const vtkVariant& v, vtkVariantArray* propertyArr = nullptr);
274 
283  vtkGraphEdge* AddGraphEdge(vtkIdType u, vtkIdType v);
284 
297  vtkIdType AddChild(vtkIdType parent, vtkVariantArray* propertyArr);
298  vtkIdType AddChild(vtkIdType parent) { return this->AddChild(parent, nullptr); }
299 
304  void RemoveVertex(vtkIdType v);
305 
310  void RemoveEdge(vtkIdType e);
311 
315  void RemoveVertices(vtkIdTypeArray* arr);
316 
320  void RemoveEdges(vtkIdTypeArray* arr);
321 
322 protected:
324  ~vtkMutableDirectedGraph() override;
325 
330 
331 private:
333  void operator=(const vtkMutableDirectedGraph&) = delete;
334 };
335 
336 #endif
vtkMutableDirectedGraph
An editable directed graph.
Definition: vtkMutableDirectedGraph.h:45
vtkIdType
int vtkIdType
Definition: vtkType.h:330
vtkDirectedGraph
A directed graph.
Definition: vtkDirectedGraph.h:44
vtkVariantArray
An array holding vtkVariants.
Definition: vtkVariantArray.h:49
vtkDirectedGraph::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkDirectedGraph.h
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
vtkMutableDirectedGraph::AddChild
vtkIdType AddChild(vtkIdType parent)
Definition: vtkMutableDirectedGraph.h:298
vtkDirectedGraph::New
static vtkDirectedGraph * New()
vtkMutableDirectedGraph::GraphEdge
vtkGraphEdge * GraphEdge
Graph edge that is reused of AddGraphEdge calls.
Definition: vtkMutableDirectedGraph.h:329