VTK  9.7.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 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
38 
39 VTK_ABI_NAMESPACE_BEGIN
40 class VTKCOMMONDATAMODEL_EXPORT VTK_MARSHALAUTO vtkUndirectedGraph : public vtkGraph
41 {
42 public:
43  static vtkUndirectedGraph* New();
44  vtkTypeMacro(vtkUndirectedGraph, vtkGraph);
45  void PrintSelf(ostream& os, vtkIndent indent) override;
46 
50  int GetDataObjectType() VTK_FUTURE_CONST override { return VTK_UNDIRECTED_GRAPH; }
51 
55  vtkIdType GetInDegree(vtkIdType v) override;
56 
62 
69  void GetInEdge(vtkIdType v, vtkIdType i, vtkGraphEdge* e) override
70  {
71  this->Superclass::GetInEdge(v, i, e);
72  }
73 
75 
79  static vtkUndirectedGraph* GetData(vtkInformationVector* v, int i = 0);
81 
86  void GetInEdges(vtkIdType v, vtkInEdgeIterator* it) override { Superclass::GetInEdges(v, it); }
87 
93  bool IsStructureValid(vtkGraph* g) override;
94 
95 protected:
97  ~vtkUndirectedGraph() override;
98 
102  void GetInEdges(vtkIdType v, const vtkInEdgeType*& edges, vtkIdType& nedges) override;
103 
104 private:
105  vtkUndirectedGraph(const vtkUndirectedGraph&) = delete;
106  void operator=(const vtkUndirectedGraph&) = delete;
107 };
108 
109 VTK_ABI_NAMESPACE_END
110 #endif
static vtkDataObject * New()
Store vtkAlgorithm input/output information.
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:363
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:282
a simple class to control print indentation
Definition: vtkIndent.h:28
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.
#define VTK_MARSHALAUTO
int GetDataObjectType() VTK_FUTURE_CONST override
Return what type of dataset this is.
std::pair< boost::graph_traits< vtkGraph * >::edge_iterator, boost::graph_traits< vtkGraph * >::edge_iterator > edges(vtkGraph *g)