VTK
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:
56  void PrintSelf(ostream& os, vtkIndent indent) override;
57 
71 
83 
103 
119  vtkIdType AddVertex(const vtkVariant& pedigreeId);
120 
130 
144  vtkVariantArray *propertyArr);
145 
159  vtkVariantArray *propertyArr = nullptr);
160 
174  vtkVariantArray *propertyArr = nullptr);
175 
189  const vtkVariant& v,
190  vtkVariantArray *propertyArr = nullptr);
191 
200 
214  void LazyAddVertex(vtkVariantArray *propertyArr);
215 
226  void LazyAddVertex(const vtkVariant& pedigreeId);
227 
240  void LazyAddEdge(vtkIdType u, vtkIdType v, vtkVariantArray *propertyArr = nullptr);
241 
254  void LazyAddEdge(const vtkVariant& u, vtkIdType v,
255  vtkVariantArray *propertyArr = nullptr);
256 
269  void LazyAddEdge(vtkIdType u, const vtkVariant& v,
270  vtkVariantArray *propertyArr = nullptr);
271 
284  void LazyAddEdge(const vtkVariant& u,
285  const vtkVariant& v,
286  vtkVariantArray *propertyArr = nullptr);
287 
297 
311  vtkVariantArray *propertyArr);
313  { return this->AddChild(parent, nullptr); }
314 
320 
326 
331 
336 
337 protected:
340 
345 
346 private:
348  void operator=(const vtkMutableDirectedGraph&) = delete;
349 };
350 
351 #endif
vtkMutableDirectedGraph
An editable directed graph.
Definition: vtkMutableDirectedGraph.h:52
vtkMutableDirectedGraph::LazyAddVertex
void LazyAddVertex(const vtkVariant &pedigreeId)
Adds a vertex with the given pedigreeID to the graph.
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::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...
vtkIdType
int vtkIdType
Definition: vtkType.h:347
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::~vtkMutableDirectedGraph
~vtkMutableDirectedGraph() override
vtkMutableDirectedGraph::SetNumberOfVertices
virtual vtkIdType SetNumberOfVertices(vtkIdType numVerts)
Allocates space for the specified number of vertices in the graph's internal data structures.
vtkDirectedGraph
A directed graph.
Definition: vtkDirectedGraph.h:48
vtkMutableDirectedGraph::RemoveVertices
void RemoveVertices(vtkIdTypeArray *arr)
Removes a collection of vertices from the graph along with any connected edges.
vtkVariantArray
An array holding vtkVariants.
Definition: vtkVariantArray.h:47
vtkMutableDirectedGraph::RemoveEdges
void RemoveEdges(vtkIdTypeArray *arr)
Removes a collection of edges from the graph.
vtkDirectedGraph.h
vtkMutableDirectedGraph::LazyAddVertex
void LazyAddVertex()
Adds a vertex to the graph.
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,...
vtkEdgeType
Definition: vtkGraph.h:277
vtkGraphEdge
Representation of a single graph edge.
Definition: vtkGraphEdge.h:40
vtkMutableDirectedGraph::vtkMutableDirectedGraph
vtkMutableDirectedGraph()
vtkMutableDirectedGraph::AddChild
vtkIdType AddChild(vtkIdType parent, vtkVariantArray *propertyArr)
Convenience method for creating trees.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkVariant
A atomic type representing the union of many types.
Definition: vtkVariant.h:72
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.
vtkEdgeListIterator
Iterates through all edges in a graph.
Definition: vtkEdgeListIterator.h:57
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::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::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,...
vtkIdTypeArray
dynamic, self-adjusting array of vtkIdType
Definition: vtkIdTypeArray.h:42
vtkMutableDirectedGraph::RemoveEdge
void RemoveEdge(vtkIdType e)
Removes the edge from the graph.
vtkMutableDirectedGraph::AddChild
vtkIdType AddChild(vtkIdType parent)
Definition: vtkMutableDirectedGraph.h:312
vtkMutableDirectedGraph::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkMutableDirectedGraph::GraphEdge
vtkGraphEdge * GraphEdge
Graph edge that is reused of AddGraphEdge calls.
Definition: vtkMutableDirectedGraph.h:344
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::AddGraphEdge
vtkGraphEdge * AddGraphEdge(vtkIdType u, vtkIdType v)
Variant of AddEdge() that returns a heavyweight vtkGraphEdge object.
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::New
static vtkMutableDirectedGraph * New()
vtkMutableDirectedGraph::RemoveVertex
void RemoveVertex(vtkIdType v)
Removes the vertex from the graph along with any connected edges.
vtkMutableDirectedGraph::AddVertex
vtkIdType AddVertex(vtkVariantArray *propertyArr)
Adds a vertex to the graph with associated properties defined in propertyArr and returns the index of...