16 #ifndef _MITK_UndirectedGraph_H
17 #define _MITK_UndirectedGraph_H
22 #include <boost/graph/adjacency_list.hpp>
47 template <
class TVertex,
class TEdge>
63 typedef boost::adjacency_list<boost::listS,
66 boost::property<vertex_properties_t, VertexType>,
67 boost::property<edge_properties_t, EdgeType>>
88 this->
GetSource()->UpdateOutputInformation();
95 VertexDescriptorType
AddVertex(
const VertexType &vertexData);
101 VertexType
GetVertex(
const VertexDescriptorType &vertex);
104 void SetVertex(
const VertexDescriptorType &vertex,
const VertexType &vertexData);
110 EdgeDescriptorType
AddEdge(
const VertexDescriptorType &vertexA,
111 const VertexDescriptorType &vertexB,
112 const EdgeType &edgeData);
115 void RemoveEdge(
const EdgeDescriptorType &edge);
118 EdgeType
GetEdge(
const EdgeDescriptorType &edge);
121 void SetEdge(
const EdgeDescriptorType &edge,
const EdgeType &edgeData);
127 std::pair<VertexType, VertexType>
GetVerticesOfAnEdge(
const EdgeDescriptorType &edge)
const;
131 const VertexDescriptorType &vertexB)
const;
149 void Clear()
override;
165 VertexType &properties(
const VertexDescriptorType &vertex);
167 const VertexType &properties(
const VertexDescriptorType &vertex)
const;
169 EdgeType &properties(
const EdgeDescriptorType &edge);
171 const EdgeType &properties(
const EdgeDescriptorType &edge)
const;
VertexDescriptorType AddVertex(const VertexType &vertexData)
int GetNumberOfEdges() const
virtual void SetRequestedRegionToLargestPossibleRegion() override
Set the RequestedRegion to the LargestPossibleRegion.
mitkClassMacro(UndirectedGraph, BaseData)
Base of all data objects.
boost::graph_traits< GraphType >::vertex_iterator VertexIteratorType
void RemoveVertex(const VertexDescriptorType &vertex)
virtual void SetRequestedRegion(const itk::DataObject *data) override
Set the requested region from this data object to match the requested region of the data object passe...
DataCollection - Class to facilitate loading/accessing structured data.
std::vector< EdgeType > GetVectorOfAllEdges() const
void SetVertex(const VertexDescriptorType &vertex, const VertexType &vertexData)
int GetNumberOfVertices() const
std::pair< VertexType, VertexType > GetVerticesOfAnEdge(const EdgeDescriptorType &edge) const
VertexType GetVertex(const VertexDescriptorType &vertex)
EdgeDescriptorType AddEdge(const VertexDescriptorType &vertexA, const VertexDescriptorType &vertexB, const EdgeType &edgeData)
VertexDescriptorType GetVertexDescriptor(const VertexType &vertexData) const
boost::graph_traits< GraphType >::adjacency_iterator AdjacenyIteratorType
void SetEdge(const EdgeDescriptorType &edge, const EdgeType &edgeData)
void RemoveEdge(const EdgeDescriptorType &edge)
boost::graph_traits< GraphType >::edge_descriptor EdgeDescriptorType
virtual void UpdateOutputInformation() override
EdgeType GetEdge(const EdgeDescriptorType &edge)
boost::adjacency_list< boost::listS, boost::vecS, boost::undirectedS, boost::property< vertex_properties_t, VertexType >, boost::property< edge_properties_t, EdgeType > > GraphType
boost::graph_traits< GraphType >::edge_iterator EdgeIteratorType
boost::graph_traits< GraphType >::out_edge_iterator OutEdgeIteratorType
itk::SmartPointer< mitk::BaseDataSource > GetSource() const
Get the process object that generated this data object.
std::vector< EdgeType > GetAllEdgesOfAVertex(const VertexDescriptorType &vertex) const
EdgeDescriptorType GetEdgeDescriptor(const EdgeType &edgeData) const
Template class for undirected graphs.Paramters should be the vertex and edge classes, which contains the information.
boost::graph_traits< GraphType >::vertex_descriptor VertexDescriptorType
UndirectedGraph< VertexType, EdgeType > & operator=(const UndirectedGraph< VertexType, EdgeType > &rhs)
BOOST_INSTALL_PROPERTY(vertex, properties)
virtual ~UndirectedGraph()
virtual bool RequestedRegionIsOutsideOfTheBufferedRegion() override
Determine whether the RequestedRegion is outside of the BufferedRegion.
EdgeDescriptorType GetEdgeDescriptorByVerices(const VertexDescriptorType &vertexA, const VertexDescriptorType &vertexB) const
const GraphType & GetGraph() const
boost::graph_traits< GraphType >::in_edge_iterator InEdgeIteratorType
virtual bool VerifyRequestedRegion() override
Verify that the RequestedRegion is within the LargestPossibleRegion.
std::vector< VertexType > GetVectorOfAllVertices() const