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 -------------------------------------------------------------------------*/
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) VTK_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,
138  vtkVariantArray *propertyArr);
139 
152  vtkEdgeType AddEdge(const vtkVariant& u, vtkIdType v,
153  vtkVariantArray *propertyArr = 0);
154 
167  vtkEdgeType AddEdge(vtkIdType u, const vtkVariant& v,
168  vtkVariantArray *propertyArr = 0);
169 
182  vtkEdgeType AddEdge(const vtkVariant& u,
183  const vtkVariant& v,
184  vtkVariantArray *propertyArr = 0);
185 
193  void LazyAddVertex();
194 
208  void LazyAddVertex(vtkVariantArray *propertyArr);
209 
220  void LazyAddVertex(const vtkVariant& pedigreeId);
221 
234  void LazyAddEdge(vtkIdType u, vtkIdType v, vtkVariantArray *propertyArr = 0);
235 
248  void LazyAddEdge(const vtkVariant& u, vtkIdType v,
249  vtkVariantArray *propertyArr = 0);
250 
263  void LazyAddEdge(vtkIdType u, const vtkVariant& v,
264  vtkVariantArray *propertyArr = 0);
265 
278  void LazyAddEdge(const vtkVariant& u,
279  const vtkVariant& v,
280  vtkVariantArray *propertyArr = 0);
281 
290  vtkGraphEdge *AddGraphEdge(vtkIdType u, vtkIdType v);
291 
304  vtkIdType AddChild(vtkIdType parent,
305  vtkVariantArray *propertyArr);
307  { return this->AddChild(parent, 0); }
308 
313  void RemoveVertex(vtkIdType v);
314 
319  void RemoveEdge(vtkIdType e);
320 
324  void RemoveVertices(vtkIdTypeArray* arr);
325 
329  void RemoveEdges(vtkIdTypeArray* arr);
330 
331 protected:
333  ~vtkMutableDirectedGraph() VTK_OVERRIDE;
334 
339 
340 private:
341  vtkMutableDirectedGraph(const vtkMutableDirectedGraph&) VTK_DELETE_FUNCTION;
342  void operator=(const vtkMutableDirectedGraph&) VTK_DELETE_FUNCTION;
343 };
344 
345 #endif
An array holding vtkVariants.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Iterates through all edges in a graph.
Representation of a single graph edge.
Definition: vtkGraphEdge.h:39
dynamic, self-adjusting array of vtkIdType
int vtkIdType
Definition: vtkType.h:345
A atomic type representing the union of many types.
Definition: vtkVariant.h:69
A directed graph.
a simple class to control print indentation
Definition: vtkIndent.h:33
An editable directed graph.
vtkIdType AddChild(vtkIdType parent)
static vtkDirectedGraph * New()
vtkGraphEdge * GraphEdge
Graph edge that is reused of AddGraphEdge calls.