VTK  9.3.0
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
25#ifndef vtkMutableDirectedGraph_h
26#define vtkMutableDirectedGraph_h
27
28#include "vtkCommonDataModelModule.h" // For export macro
29#include "vtkDirectedGraph.h"
30
31VTK_ABI_NAMESPACE_BEGIN
33class vtkGraphEdge;
34class vtkVariant;
35
36class VTKCOMMONDATAMODEL_EXPORT vtkMutableDirectedGraph : public vtkDirectedGraph
37{
38public:
41 void PrintSelf(ostream& os, vtkIndent indent) override;
42
56
68
88
104 vtkIdType AddVertex(const vtkVariant& pedigreeId);
105
115
129
142 vtkEdgeType AddEdge(const vtkVariant& u, vtkIdType v, vtkVariantArray* propertyArr = nullptr);
143
156 vtkEdgeType AddEdge(vtkIdType u, const vtkVariant& v, vtkVariantArray* propertyArr = nullptr);
157
171 const vtkVariant& u, const vtkVariant& v, vtkVariantArray* propertyArr = nullptr);
172
181
195 void LazyAddVertex(vtkVariantArray* propertyArr);
196
207 void LazyAddVertex(const vtkVariant& pedigreeId);
208
221 void LazyAddEdge(vtkIdType u, vtkIdType v, vtkVariantArray* propertyArr = nullptr);
222
235 void LazyAddEdge(const vtkVariant& u, vtkIdType v, vtkVariantArray* propertyArr = nullptr);
236
249 void LazyAddEdge(vtkIdType u, const vtkVariant& v, vtkVariantArray* propertyArr = nullptr);
250
264 const vtkVariant& u, const vtkVariant& v, vtkVariantArray* propertyArr = nullptr);
265
275
289 vtkIdType AddChild(vtkIdType parent) { return this->AddChild(parent, nullptr); }
290
296
302
307
312
313protected:
316
321
322private:
324 void operator=(const vtkMutableDirectedGraph&) = delete;
325};
326
327VTK_ABI_NAMESPACE_END
328#endif
A directed graph.
Iterates through all edges in a graph.
Representation of a single graph edge.
dynamic, self-adjusting array of vtkIdType
a simple class to control print indentation
Definition vtkIndent.h:29
An editable directed graph.
void RemoveEdges(vtkIdTypeArray *arr)
Removes a collection of edges from the graph.
void RemoveEdge(vtkIdType e)
Removes the edge from the graph.
vtkGraphEdge * GraphEdge
Graph edge that is reused of AddGraphEdge calls.
void LazyAddEdge(vtkIdType u, vtkIdType v, vtkVariantArray *propertyArr=nullptr)
Adds a directed edge from u to v, where u and v are vertex indices.
static vtkMutableDirectedGraph * New()
vtkIdType AddVertex(vtkVariantArray *propertyArr)
Adds a vertex to the graph with associated properties defined in propertyArr and returns the index of...
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...
vtkIdType AddChild(vtkIdType parent, vtkVariantArray *propertyArr)
Convenience method for creating trees.
vtkIdType AddChild(vtkIdType parent)
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.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkIdType AddVertex(const vtkVariant &pedigreeId)
Adds a vertex with the given pedigreeID to the graph and returns the index of the new vertex.
vtkGraphEdge * AddGraphEdge(vtkIdType u, vtkIdType v)
Variant of AddEdge() that returns a heavyweight vtkGraphEdge object.
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() override
void LazyAddVertex(vtkVariantArray *propertyArr)
Adds a vertex to the graph with associated properties defined in propertyArr.
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...
vtkIdType AddVertex()
Adds a vertex to the graph and returns the index of the new vertex.
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,...
void LazyAddVertex(const vtkVariant &pedigreeId)
Adds a vertex with the given pedigreeID to the graph.
void RemoveVertices(vtkIdTypeArray *arr)
Removes a collection of vertices from the graph along with any connected edges.
void RemoveVertex(vtkIdType v)
Removes the vertex from the graph along with any connected edges.
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,...
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...
virtual vtkIdType SetNumberOfVertices(vtkIdType numVerts)
Allocates space for the specified number of vertices in the graph's internal data structures.
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.
void LazyAddVertex()
Adds a vertex to the graph.
An array holding vtkVariants.
A type representing the union of many types.
Definition vtkVariant.h:53
int vtkIdType
Definition vtkType.h:315