13 #ifndef _MITK_UndirectedGraph_H 14 #define _MITK_UndirectedGraph_H 19 #include <boost/graph/adjacency_list.hpp> 44 template <
class TVertex,
class TEdge>
60 typedef boost::adjacency_list<boost::listS,
63 boost::property<vertex_properties_t, VertexType>,
64 boost::property<edge_properties_t, EdgeType>>
84 if (this->GetSource())
85 this->GetSource()->UpdateOutputInformation();
92 VertexDescriptorType AddVertex(
const VertexType &vertexData);
95 void RemoveVertex(
const VertexDescriptorType &vertex);
98 VertexType GetVertex(
const VertexDescriptorType &vertex);
101 void SetVertex(
const VertexDescriptorType &vertex,
const VertexType &vertexData);
104 VertexDescriptorType GetVertexDescriptor(
const VertexType &vertexData)
const;
107 EdgeDescriptorType AddEdge(
const VertexDescriptorType &vertexA,
108 const VertexDescriptorType &vertexB,
109 const EdgeType &edgeData);
112 void RemoveEdge(
const EdgeDescriptorType &edge);
115 EdgeType GetEdge(
const EdgeDescriptorType &edge);
118 void SetEdge(
const EdgeDescriptorType &edge,
const EdgeType &edgeData);
121 EdgeDescriptorType GetEdgeDescriptor(
const EdgeType &edgeData)
const;
124 std::pair<VertexType, VertexType> GetVerticesOfAnEdge(
const EdgeDescriptorType &edge)
const;
127 EdgeDescriptorType GetEdgeDescriptorByVerices(
const VertexDescriptorType &vertexA,
128 const VertexDescriptorType &vertexB)
const;
131 std::vector<EdgeType> GetAllEdgesOfAVertex(
const VertexDescriptorType &vertex)
const;
134 int GetNumberOfVertices()
const;
137 int GetNumberOfEdges()
const;
140 std::vector<VertexType> GetVectorOfAllVertices()
const;
143 std::vector<EdgeType> GetVectorOfAllEdges()
const;
146 void Clear()
override;
161 VertexType &properties(
const VertexDescriptorType &vertex);
163 const VertexType &properties(
const VertexDescriptorType &vertex)
const;
165 EdgeType &properties(
const EdgeDescriptorType &edge);
167 const EdgeType &properties(
const EdgeDescriptorType &edge)
const;
172 #include "mitkUndirectedGraph.txx"
Base of all data objects.
boost::graph_traits< GraphType >::vertex_iterator VertexIteratorType
DataCollection - Class to facilitate loading/accessing structured data.
void SetRequestedRegionToLargestPossibleRegion() override
Set the RequestedRegion to the LargestPossibleRegion.
boost::graph_traits< GraphType >::adjacency_iterator AdjacenyIteratorType
bool VerifyRequestedRegion() override
Verify that the RequestedRegion is within the LargestPossibleRegion.
boost::graph_traits< GraphType >::edge_descriptor EdgeDescriptorType
boost::adjacency_list< boost::listS, boost::vecS, boost::undirectedS, boost::property< vertex_properties_t, VertexType >, boost::property< edge_properties_t, EdgeType > > GraphType
void UpdateOutputInformation() override
#define mitkClassMacro(className, SuperClassName)
boost::graph_traits< GraphType >::edge_iterator EdgeIteratorType
boost::graph_traits< GraphType >::out_edge_iterator OutEdgeIteratorType
bool RequestedRegionIsOutsideOfTheBufferedRegion() override
Determine whether the RequestedRegion is outside of the BufferedRegion.
void SetRequestedRegion(const itk::DataObject *) override
Set the requested region from this data object to match the requested region of the data object passe...
Template class for undirected graphs.Paramters should be the vertex and edge classes, which contains the information.
boost::graph_traits< GraphType >::vertex_descriptor VertexDescriptorType
BOOST_INSTALL_PROPERTY(vertex, properties)
boost::graph_traits< GraphType >::in_edge_iterator InEdgeIteratorType