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:
54  static vtkMutableDirectedGraph *New();
56  void PrintSelf(ostream& os, vtkIndent indent) override;
57 
70  virtual vtkIdType SetNumberOfVertices( vtkIdType numVerts );
71 
82  vtkIdType AddVertex();
83 
102  vtkIdType AddVertex(vtkVariantArray *propertyArr);
103 
119  vtkIdType AddVertex(const vtkVariant& pedigreeId);
120 
129  vtkEdgeType AddEdge(vtkIdType u, vtkIdType v);
130 
143  vtkEdgeType AddEdge(vtkIdType u, vtkIdType v,
144  vtkVariantArray *propertyArr);
145 
158  vtkEdgeType AddEdge(const vtkVariant& u, vtkIdType v,
159  vtkVariantArray *propertyArr = nullptr);
160 
173  vtkEdgeType AddEdge(vtkIdType u, const vtkVariant& v,
174  vtkVariantArray *propertyArr = nullptr);
175 
188  vtkEdgeType AddEdge(const vtkVariant& u,
189  const vtkVariant& v,
190  vtkVariantArray *propertyArr = nullptr);
191 
199  void LazyAddVertex();
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 
296  vtkGraphEdge *AddGraphEdge(vtkIdType u, vtkIdType v);
297 
310  vtkIdType AddChild(vtkIdType parent,
311  vtkVariantArray *propertyArr);
313  { return this->AddChild(parent, nullptr); }
314 
319  void RemoveVertex(vtkIdType v);
320 
325  void RemoveEdge(vtkIdType e);
326 
330  void RemoveVertices(vtkIdTypeArray* arr);
331 
335  void RemoveEdges(vtkIdTypeArray* arr);
336 
337 protected:
339  ~vtkMutableDirectedGraph() override;
340 
345 
346 private:
348  void operator=(const vtkMutableDirectedGraph&) = delete;
349 };
350 
351 #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:347
A atomic type representing the union of many types.
Definition: vtkVariant.h:71
A directed graph.
a simple class to control print indentation
Definition: vtkIndent.h:39
An editable directed graph.
vtkIdType AddChild(vtkIdType parent)
static vtkDirectedGraph * New()
vtkGraphEdge * GraphEdge
Graph edge that is reused of AddGraphEdge calls.