VTK: Common/DataModel/vtkMutableDirectedGraph.h Source File

| 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
34 #ifndef vtkMutableDirectedGraph_h
35 #define vtkMutableDirectedGraph_h
36
37 #include "vtkCommonDataModelModule.h" // For export macro
38 #include "vtkDirectedGraph.h"
39
40 VTK_ABI_NAMESPACE_BEGIN
41 class vtkEdgeListIterator;
42 class vtkGraphEdge;
43 class vtkVariant;
44
45 class VTKCOMMONDATAMODEL_EXPORT vtkMutableDirectedGraph : public vtkDirectedGraph
46 {
47 public:
48 static vtkMutableDirectedGraph* New();
49 vtkTypeMacro(vtkMutableDirectedGraph, vtkDirectedGraph);
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:
323 vtkMutableDirectedGraph();
324 ~vtkMutableDirectedGraph() override;
325
329 vtkGraphEdge* GraphEdge;
330
331 private:
332 vtkMutableDirectedGraph(const vtkMutableDirectedGraph&) = delete;
333 void operator=(const vtkMutableDirectedGraph&) = delete;
334 };
335
336 VTK_ABI_NAMESPACE_END
337 #endif
vtkDirectedGraph
A directed graph.
Definition: vtkDirectedGraph.h:42
vtkEdgeListIterator
Iterates through all edges in a graph.
Definition: vtkEdgeListIterator.h:51
vtkGraphEdge
Representation of a single graph edge.
Definition: vtkGraphEdge.h:25
vtkIdTypeArray
dynamic, self-adjusting array of vtkIdType
Definition: vtkIdTypeArray.h:37
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkMutableDirectedGraph
An editable directed graph.
Definition: vtkMutableDirectedGraph.h:46
vtkMutableDirectedGraph::RemoveEdges
void RemoveEdges(vtkIdTypeArray *arr)
Removes a collection of edges from the graph.
vtkMutableDirectedGraph::RemoveEdge
void RemoveEdge(vtkIdType e)
Removes the edge from the graph.
vtkMutableDirectedGraph::New
static vtkMutableDirectedGraph * New()
vtkMutableDirectedGraph::GraphEdge
vtkGraphEdge * GraphEdge
Graph edge that is reused of AddGraphEdge calls.
Definition: vtkMutableDirectedGraph.h:329
vtkMutableDirectedGraph::LazyAddEdge
void LazyAddEdge(vtkIdType u, vtkIdType v, vtkVariantArray *propertyArr=nullptr)
Adds a directed edge from u to v, where u and v are vertex indices.
vtkMutableDirectedGraph::AddVertex
vtkIdType AddVertex(vtkVariantArray *propertyArr)
Adds a vertex to the graph with associated properties defined in propertyArr and returns the index of...
vtkMutableDirectedGraph::AddEdge
vtkEdgeType AddEdge(const vtkVariant &u, const vtkVariant &v, vtkVariantArray *propertyArr=nullptr)
Adds a directed edge from u to v, where u and v are vertex pedigree IDs, and returns a vtkEdgeType st...
vtkMutableDirectedGraph::AddChild
vtkIdType AddChild(vtkIdType parent, vtkVariantArray *propertyArr)
Convenience method for creating trees.
vtkMutableDirectedGraph::AddChild
vtkIdType AddChild(vtkIdType parent)
Definition: vtkMutableDirectedGraph.h:298
vtkMutableDirectedGraph::LazyAddEdge
void LazyAddEdge(vtkIdType u, const vtkVariant &v, vtkVariantArray *propertyArr=nullptr)
Adds a directed edge from u to v, where u is a vertex index and v is a vertex pedigree ID.
vtkMutableDirectedGraph::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkMutableDirectedGraph::AddVertex
vtkIdType AddVertex(const vtkVariant &pedigreeId)
Adds a vertex with the given pedigreeID to the graph and returns the index of the new vertex.
vtkMutableDirectedGraph::vtkMutableDirectedGraph
vtkMutableDirectedGraph()
vtkMutableDirectedGraph::AddGraphEdge
vtkGraphEdge * AddGraphEdge(vtkIdType u, vtkIdType v)
Variant of AddEdge() that returns a heavyweight vtkGraphEdge object.
vtkMutableDirectedGraph::LazyAddEdge
void LazyAddEdge(const vtkVariant &u, const vtkVariant &v, vtkVariantArray *propertyArr=nullptr)
Adds a directed edge from u to v, where u and v are vertex pedigree IDs.
vtkMutableDirectedGraph::~vtkMutableDirectedGraph
~vtkMutableDirectedGraph() override
vtkMutableDirectedGraph::LazyAddVertex
void LazyAddVertex(vtkVariantArray *propertyArr)
Adds a vertex to the graph with associated properties defined in propertyArr.
vtkMutableDirectedGraph::AddEdge
vtkEdgeType AddEdge(vtkIdType u, vtkIdType v, vtkVariantArray *propertyArr)
Adds a directed edge from u to v, where u and v are vertex indices, with associated properties define...
vtkMutableDirectedGraph::AddVertex
vtkIdType AddVertex()
Adds a vertex to the graph and returns the index of the new vertex.
vtkMutableDirectedGraph::AddEdge
vtkEdgeType AddEdge(vtkIdType u, const vtkVariant &v, vtkVariantArray *propertyArr=nullptr)
Adds a directed edge from u to v, where u is a vertex index and v is a vertex pedigree ID,...
vtkMutableDirectedGraph::LazyAddVertex
void LazyAddVertex(const vtkVariant &pedigreeId)
Adds a vertex with the given pedigreeID to the graph.
vtkMutableDirectedGraph::RemoveVertices
void RemoveVertices(vtkIdTypeArray *arr)
Removes a collection of vertices from the graph along with any connected edges.
vtkMutableDirectedGraph::RemoveVertex
void RemoveVertex(vtkIdType v)
Removes the vertex from the graph along with any connected edges.
vtkMutableDirectedGraph::AddEdge
vtkEdgeType AddEdge(const vtkVariant &u, vtkIdType v, vtkVariantArray *propertyArr=nullptr)
Adds a directed edge from u to v, where u is a vertex pedigree ID and v is a vertex index,...
vtkMutableDirectedGraph::AddEdge
vtkEdgeType AddEdge(vtkIdType u, vtkIdType v)
Adds a directed edge from u to v, where u and v are vertex indices, and returns a vtkEdgeType structu...
vtkMutableDirectedGraph::SetNumberOfVertices
virtual vtkIdType SetNumberOfVertices(vtkIdType numVerts)
Allocates space for the specified number of vertices in the graph's internal data structures.
vtkMutableDirectedGraph::LazyAddEdge
void LazyAddEdge(const vtkVariant &u, vtkIdType v, vtkVariantArray *propertyArr=nullptr)
Adds a directed edge from u to v, where u is a vertex pedigree ID and v is a vertex index.
vtkMutableDirectedGraph::LazyAddVertex
void LazyAddVertex()
Adds a vertex to the graph.
vtkVariantArray
An array holding vtkVariants.
Definition: vtkVariantArray.h:47
vtkVariant
A type representing the union of many types.
Definition: vtkVariant.h:62
vtkEdgeType
Definition: vtkGraph.h:277
vtkDirectedGraph.h
vtkIdType
int vtkIdType
Definition: vtkType.h:315