VTK: Common/DataModel/vtkGraphInternals.h Source File

| VTK 9.3.1

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
28 class vtkVertexAdjacencyList
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:
41 static vtkGraphInternals* New();
42
43 vtkTypeMacro(vtkGraphInternals, vtkObject);
44 void PrintSelf(ostream& os, vtkIndent indent) override;
45
46 std::vector<vtkVertexAdjacencyList> Adjacency;
47
48 vtkIdType NumberOfEdges;
49
50 vtkIdType LastRemoteEdgeId;
51 vtkIdType LastRemoteEdgeSource;
52 vtkIdType LastRemoteEdgeTarget;
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.
59 bool UsingPedigreeIds;
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:
82 vtkGraphInternals();
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
vtkGraphInternals
Internal representation of vtkGraph.
Definition: vtkGraphInternals.h:39
vtkGraphInternals::ReplaceEdgeFromInList
void ReplaceEdgeFromInList(vtkIdType from, vtkIdType to, std::vector< vtkInEdgeType > &inEdges)
Convenience method for renaming an edge in an in edge list.
vtkGraphInternals::ReplaceEdgeFromOutList
void ReplaceEdgeFromOutList(vtkIdType from, vtkIdType to, std::vector< vtkOutEdgeType > &outEdges)
Convenience method for renaming an edge in an out edge list.
vtkGraphInternals::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkGraphInternals::Adjacency
std::vector< vtkVertexAdjacencyList > Adjacency
Definition: vtkGraphInternals.h:46
vtkGraphInternals::vtkGraphInternals
vtkGraphInternals()
vtkGraphInternals::LastRemoteEdgeId
vtkIdType LastRemoteEdgeId
Definition: vtkGraphInternals.h:50
vtkGraphInternals::RemoveEdgeFromOutList
void RemoveEdgeFromOutList(vtkIdType e, std::vector< vtkOutEdgeType > &outEdges)
Convenience method for removing an edge from an out edge list.
vtkGraphInternals::NumberOfEdges
vtkIdType NumberOfEdges
Definition: vtkGraphInternals.h:48
vtkGraphInternals::LastRemoteEdgeSource
vtkIdType LastRemoteEdgeSource
Definition: vtkGraphInternals.h:51
vtkGraphInternals::LastRemoteEdgeTarget
vtkIdType LastRemoteEdgeTarget
Definition: vtkGraphInternals.h:52
vtkGraphInternals::UsingPedigreeIds
bool UsingPedigreeIds
Definition: vtkGraphInternals.h:59
vtkGraphInternals::RemoveEdgeFromInList
void RemoveEdgeFromInList(vtkIdType e, std::vector< vtkInEdgeType > &inEdges)
Convenience method for removing an edge from an in edge list.
vtkGraphInternals::New
static vtkGraphInternals * New()
vtkGraphInternals::~vtkGraphInternals
~vtkGraphInternals() override
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:61
vtkVertexAdjacencyList
Definition: vtkGraphInternals.h:29
vtkVertexAdjacencyList::InEdges
std::vector< vtkInEdgeType > InEdges
Definition: vtkGraphInternals.h:31
vtkVertexAdjacencyList::OutEdges
std::vector< vtkOutEdgeType > OutEdges
Definition: vtkGraphInternals.h:32
vtkGraph.h
vtkObject.h
vtkIdType
int vtkIdType
Definition: vtkType.h:315