VTK  9.3.1
vtkMutableGraphHelper.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-FileCopyrightText: Copyright (c) Sandia Corporation
3 // SPDX-License-Identifier: BSD-3-Clause
19 #ifndef vtkMutableGraphHelper_h
20 #define vtkMutableGraphHelper_h
21 
22 #include "vtkGraph.h" // For vtkEdgeType
23 #include "vtkInfovisCoreModule.h" // For export macro
24 #include "vtkObject.h"
25 
26 VTK_ABI_NAMESPACE_BEGIN
28 class vtkGraph;
29 class vtkGraphEdge;
32 
33 class VTKINFOVISCORE_EXPORT vtkMutableGraphHelper : public vtkObject
34 {
35 public:
36  static vtkMutableGraphHelper* New();
38  void PrintSelf(ostream& os, vtkIndent indent) override;
39 
41 
46  void SetGraph(vtkGraph* g);
47  vtkGraph* GetGraph();
49 
53  vtkEdgeType AddEdge(vtkIdType u, vtkIdType v);
54 
55  vtkGraphEdge* AddGraphEdge(vtkIdType u, vtkIdType v);
56 
60  vtkIdType AddVertex();
61 
65  void RemoveVertex(vtkIdType v);
66 
70  void RemoveVertices(vtkIdTypeArray* verts);
71 
75  void RemoveEdge(vtkIdType e);
76 
80  void RemoveEdges(vtkIdTypeArray* edges);
81 
82 protected:
84  ~vtkMutableGraphHelper() override;
85 
86  vtkGetObjectMacro(InternalGraph, vtkGraph);
87  void SetInternalGraph(vtkGraph* g);
89 
91 
94 
95 private:
97  void operator=(const vtkMutableGraphHelper&) = delete;
98 };
99 
100 VTK_ABI_NAMESPACE_END
101 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:51
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Helper class for building a directed or directed graph.
Representation of a single graph edge.
Definition: vtkGraphEdge.h:24
dynamic, self-adjusting array of vtkIdType
int vtkIdType
Definition: vtkType.h:315
Base class for graph data types.
Definition: vtkGraph.h:280
a simple class to control print indentation
Definition: vtkIndent.h:28
An editable directed graph.
represent and manipulate attribute data in a dataset
An editable undirected graph.
vtkMutableDirectedGraph * DirectedGraph
vtkMutableUndirectedGraph * UndirectedGraph
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
std::pair< boost::graph_traits< vtkGraph * >::edge_iterator, boost::graph_traits< vtkGraph * >::edge_iterator > edges(vtkGraph *g)