VTK  9.1.20211115
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 -------------------------------------------------------------------------*/
144 #ifndef vtkMutableDirectedGraph_h
145 #define vtkMutableDirectedGraph_h
146 
147 #include "vtkCommonDataModelModule.h" // For export macro
148 #include "vtkDirectedGraph.h"
149 
150 class vtkEdgeListIterator;
151 class vtkGraphEdge;
152 class vtkVariant;
153 
154 class VTKCOMMONDATAMODEL_EXPORT vtkMutableDirectedGraph : public vtkDirectedGraph
155 {
156 public:
159  void PrintSelf(ostream& os, vtkIndent indent) override;
160 
174 
186 
206 
222  vtkIdType AddVertex(const vtkVariant& pedigreeId);
223 
233 
247 
260  vtkEdgeType AddEdge(const vtkVariant& u, vtkIdType v, vtkVariantArray* propertyArr = nullptr);
261 
274  vtkEdgeType AddEdge(vtkIdType u, const vtkVariant& v, vtkVariantArray* propertyArr = nullptr);
275 
289  const vtkVariant& u, const vtkVariant& v, vtkVariantArray* propertyArr = nullptr);
290 
299 
313  void LazyAddVertex(vtkVariantArray* propertyArr);
314 
325  void LazyAddVertex(const vtkVariant& pedigreeId);
326 
339  void LazyAddEdge(vtkIdType u, vtkIdType v, vtkVariantArray* propertyArr = nullptr);
340 
353  void LazyAddEdge(const vtkVariant& u, vtkIdType v, vtkVariantArray* propertyArr = nullptr);
354 
367  void LazyAddEdge(vtkIdType u, const vtkVariant& v, vtkVariantArray* propertyArr = nullptr);
368 
382  const vtkVariant& u, const vtkVariant& v, vtkVariantArray* propertyArr = nullptr);
383 
393 
407  vtkIdType AddChild(vtkIdType parent) { return this->AddChild(parent, nullptr); }
408 
414 
420 
425 
430 
431 protected:
434 
439 
440 private:
442  void operator=(const vtkMutableDirectedGraph&) = delete;
443 };
444 
445 #endif
A directed graph.
Iterates through all edges in a graph.
Representation of a single graph edge.
Definition: vtkGraphEdge.h:40
dynamic, self-adjusting array of vtkIdType
a simple class to control print indentation
Definition: vtkIndent.h:113
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.
static vtkMutableDirectedGraph * New()
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.
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 atomic type representing the union of many types.
Definition: vtkVariant.h:155
int vtkIdType
Definition: vtkType.h:332