VTK  9.3.1
vtkUndirectedGraph.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-FileCopyrightText: Copyright 2008 Sandia Corporation
3 // SPDX-License-Identifier: LicenseRef-BSD-3-Clause-Sandia-USGov
32 #ifndef vtkUndirectedGraph_h
33 #define vtkUndirectedGraph_h
34 
35 #include "vtkCommonDataModelModule.h" // For export macro
36 #include "vtkGraph.h"
37 
38 VTK_ABI_NAMESPACE_BEGIN
39 class VTKCOMMONDATAMODEL_EXPORT vtkUndirectedGraph : public vtkGraph
40 {
41 public:
42  static vtkUndirectedGraph* New();
43  vtkTypeMacro(vtkUndirectedGraph, vtkGraph);
44  void PrintSelf(ostream& os, vtkIndent indent) override;
45 
49  int GetDataObjectType() override { return VTK_UNDIRECTED_GRAPH; }
50 
54  vtkIdType GetInDegree(vtkIdType v) override;
55 
61 
68  void GetInEdge(vtkIdType v, vtkIdType i, vtkGraphEdge* e) override
69  {
70  this->Superclass::GetInEdge(v, i, e);
71  }
72 
74 
78  static vtkUndirectedGraph* GetData(vtkInformationVector* v, int i = 0);
80 
85  void GetInEdges(vtkIdType v, vtkInEdgeIterator* it) override { Superclass::GetInEdges(v, it); }
86 
92  bool IsStructureValid(vtkGraph* g) override;
93 
94 protected:
96  ~vtkUndirectedGraph() override;
97 
101  void GetInEdges(vtkIdType v, const vtkInEdgeType*& edges, vtkIdType& nedges) override;
102 
103 private:
104  vtkUndirectedGraph(const vtkUndirectedGraph&) = delete;
105  void operator=(const vtkUndirectedGraph&) = delete;
106 };
107 
108 VTK_ABI_NAMESPACE_END
109 #endif
static vtkDataObject * New()
Store vtkAlgorithm input/output information.
#define VTK_UNDIRECTED_GRAPH
Definition: vtkType.h:89
An undirected graph.
Representation of a single graph edge.
Definition: vtkGraphEdge.h:24
static vtkGraph * GetData(vtkInformation *info)
Retrieve a graph from an information vector.
int vtkIdType
Definition: vtkType.h:315
virtual void GetInEdges(vtkIdType v, vtkInEdgeIterator *it)
Initializes the in edge iterator to iterate over all incoming edges to vertex v.
void GetInEdges(vtkIdType v, vtkInEdgeIterator *it) override
Initialize the iterator to get the incoming edges to a vertex.
virtual vtkInEdgeType GetInEdge(vtkIdType v, vtkIdType index)
Random-access method for retrieving incoming edges to vertex v.
Base class for graph data types.
Definition: vtkGraph.h:280
a simple class to control print indentation
Definition: vtkIndent.h:28
int GetDataObjectType() override
Return what type of dataset this is.
Iterates through all incoming edges to a vertex.
virtual vtkIdType GetInDegree(vtkIdType v)
The number of incoming edges to vertex v.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void GetInEdge(vtkIdType v, vtkIdType i, vtkGraphEdge *e) override
Random-access method for retrieving incoming edges to vertex v.
virtual bool IsStructureValid(vtkGraph *g)=0
Subclasses override this method to accept the structure based on their requirements.
Store zero or more vtkInformation instances.
std::pair< boost::graph_traits< vtkGraph * >::edge_iterator, boost::graph_traits< vtkGraph * >::edge_iterator > edges(vtkGraph *g)