The triangulations of Cgal are all models of the concepts BidirectionalGraph and VertexAndEdgeListGraph of the Boost Graph Library [SLL02].
The class graph_traits< CGAL::Triangulation_2<GT, TDS> > is a partial specialization of the class boost::graph_traits<G>.
The mapping between vertices and edges of the triangulation and the graph is rather straightforward, but there are some subtleties. The value type of the Bgl iterators is the vertex or edge descriptor, whereas in Cgal all iterators and circulators are also handles and hence have as value type Vertex or Edge.
The graph traits class for triangulations does not distinguish between finite and infinite vertices and edges. As the edge weight computed with the default property map of Bgl algorithms (obtained with boost::get(t, boost::edge_weight)) is the length of the edge, the edge weight is not well defined for infinite edges. For algorithms that make use of the edge weight the user must therefore define a boost::filtered_graph or pass a property map to the algorithm that returns ``infinity'' for infinite edges.
Note also that when you derive from the class CGAL::Triangulation_2 you must upcast the object in order to use this partial specialization.
For the user convenience, Cgal provides the partial specializations for all 2D triangulation classes.
#include <CGAL/boost/graph/graph_traits_Triangulation_2.h>
typedef Triangulation::Vertex_handle | ||
vertex_descriptor; | The vertex descriptor. |
typedef boost::undirected_tag | directed_category; | |
typedef boost::disallow_parallel_edge_tag | ||
edge_parallel_category; |