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 -------------------------------------------------------------------------*/
40 #ifndef __vtkMutableDirectedGraph_h
41 #define __vtkMutableDirectedGraph_h
42 
43 #include "vtkDirectedGraph.h"
44 
45 class vtkEdgeListIterator;
46 class vtkGraphEdge;
47 class vtkVariant;
48 
49 class VTK_FILTERING_EXPORT vtkMutableDirectedGraph : public vtkDirectedGraph
50 {
51 public:
52  static vtkMutableDirectedGraph *New();
53  vtkTypeMacro(vtkMutableDirectedGraph, vtkDirectedGraph);
54  void PrintSelf(ostream& os, vtkIndent indent);
55 
64  virtual vtkIdType SetNumberOfVertices( vtkIdType numVerts );
65 
72  vtkIdType AddVertex();
73 
87  vtkIdType AddVertex(vtkVariantArray *propertyArr);
88 
99  vtkIdType AddVertex(const vtkVariant& pedigreeId);
100 
101 //BTX
103 
107  vtkEdgeType AddEdge(vtkIdType u, vtkIdType v);
108 //ETX
110 
111 //BTX
113 
120  vtkEdgeType AddEdge(vtkIdType u, vtkIdType v,
121  vtkVariantArray *propertyArr);
122 //ETX
124 
125  //BTX
127 
134  vtkEdgeType AddEdge(const vtkVariant& u, vtkIdType v,
135  vtkVariantArray *propertyArr = 0);
137 
139 
146  vtkEdgeType AddEdge(vtkIdType u, const vtkVariant& v,
147  vtkVariantArray *propertyArr = 0);
149 
151 
157  vtkEdgeType AddEdge(const vtkVariant& u,
158  const vtkVariant& v,
159  vtkVariantArray *propertyArr = 0);
160  //ETX
162 
166  void LazyAddVertex();
167 
176  void LazyAddVertex(vtkVariantArray *propertyArr);
177 
183  void LazyAddVertex(const vtkVariant& pedigreeId);
184 
191  void LazyAddEdge(vtkIdType u, vtkIdType v, vtkVariantArray *propertyArr = 0);
192 
194 
201  void LazyAddEdge(const vtkVariant& u, vtkIdType v,
202  vtkVariantArray *propertyArr = 0);
204 
206 
212  void LazyAddEdge(vtkIdType u, const vtkVariant& v,
213  vtkVariantArray *propertyArr = 0);
215 
217 
223  void LazyAddEdge(const vtkVariant& u,
224  const vtkVariant& v,
225  vtkVariantArray *propertyArr = 0);
227 
233  vtkGraphEdge *AddGraphEdge(vtkIdType u, vtkIdType v);
234 
236 
242  vtkIdType AddChild(vtkIdType parent,
243  vtkVariantArray *propertyArr);
245  { return this->AddChild(parent, 0); }
247 
251  void RemoveVertex(vtkIdType v);
252 
255  void RemoveEdge(vtkIdType e);
256 
259  void RemoveVertices(vtkIdTypeArray* arr);
260 
262  void RemoveEdges(vtkIdTypeArray* arr);
263 
264 protected:
267 
269  vtkGraphEdge *GraphEdge;
270 
271 private:
272  vtkMutableDirectedGraph(const vtkMutableDirectedGraph&); // Not implemented.
273  void operator=(const vtkMutableDirectedGraph&); // Not implemented.
274 };
275 
276 #endif
An array holding vtkVariants.
#define VTK_FILTERING_EXPORT
dynamic, self-adjusting array of vtkIdType
int vtkIdType
Definition: vtkType.h:255
A atomic type representing the union of many types.
Definition: vtkVariant.h:72
a simple class to control print indentation
Definition: vtkIndent.h:37
An editable directed graph.
vtkIdType AddChild(vtkIdType parent)