VTK  9.3.20240328
vtkGraphInternals.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
13 #ifndef vtkGraphInternals_h
14 #define vtkGraphInternals_h
15 
16 #include "vtkCommonDataModelModule.h" // For export macro
17 #include "vtkGraph.h" // For edge types
18 #include "vtkObject.h"
19 
20 #include <map> // STL Header
21 #include <vector> // STL Header
22 
23 //----------------------------------------------------------------------------
24 // class vtkVertexAdjacencyList
25 //----------------------------------------------------------------------------
26 
27 VTK_ABI_NAMESPACE_BEGIN
29 {
30 public:
31  std::vector<vtkInEdgeType> InEdges;
32  std::vector<vtkOutEdgeType> OutEdges;
33 };
34 
35 //----------------------------------------------------------------------------
36 // class vtkGraphInternals
37 //----------------------------------------------------------------------------
38 class VTKCOMMONDATAMODEL_EXPORT vtkGraphInternals : public vtkObject
39 {
40 public:
42 
43  vtkTypeMacro(vtkGraphInternals, vtkObject);
44  void PrintSelf(ostream& os, vtkIndent indent) override;
45 
46  std::vector<vtkVertexAdjacencyList> Adjacency;
47 
49 
53 
54  // Whether we have used pedigree IDs to refer to the vertices of the
55  // graph, e.g., to add edges or vertices. In a distributed graph,
56  // the pedigree-id interface is mutually exclusive with the
57  // no-argument AddVertex() function in vtkMutableUndirectedGraph and
58  // vtkMutableDirectedGraph.
60 
64  void RemoveEdgeFromOutList(vtkIdType e, std::vector<vtkOutEdgeType>& outEdges);
65 
69  void RemoveEdgeFromInList(vtkIdType e, std::vector<vtkInEdgeType>& inEdges);
70 
74  void ReplaceEdgeFromOutList(vtkIdType from, vtkIdType to, std::vector<vtkOutEdgeType>& outEdges);
75 
79  void ReplaceEdgeFromInList(vtkIdType from, vtkIdType to, std::vector<vtkInEdgeType>& inEdges);
80 
81 protected:
83  ~vtkGraphInternals() override;
84 
85 private:
86  vtkGraphInternals(const vtkGraphInternals&) = delete;
87  void operator=(const vtkGraphInternals&) = delete;
88 };
89 
90 VTK_ABI_NAMESPACE_END
91 #endif // vtkGraphInternals_h
Internal representation of vtkGraph.
void ReplaceEdgeFromInList(vtkIdType from, vtkIdType to, std::vector< vtkInEdgeType > &inEdges)
Convenience method for renaming an edge in an in edge list.
void ReplaceEdgeFromOutList(vtkIdType from, vtkIdType to, std::vector< vtkOutEdgeType > &outEdges)
Convenience method for renaming an edge in an out edge list.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
std::vector< vtkVertexAdjacencyList > Adjacency
vtkIdType LastRemoteEdgeId
void RemoveEdgeFromOutList(vtkIdType e, std::vector< vtkOutEdgeType > &outEdges)
Convenience method for removing an edge from an out edge list.
vtkIdType LastRemoteEdgeSource
vtkIdType LastRemoteEdgeTarget
void RemoveEdgeFromInList(vtkIdType e, std::vector< vtkInEdgeType > &inEdges)
Convenience method for removing an edge from an in edge list.
static vtkGraphInternals * New()
~vtkGraphInternals() override
a simple class to control print indentation
Definition: vtkIndent.h:108
abstract base class for most VTK objects
Definition: vtkObject.h:161
std::vector< vtkInEdgeType > InEdges
std::vector< vtkOutEdgeType > OutEdges
int vtkIdType
Definition: vtkType.h:315