CGAL 4.3 - CGAL and the Boost Graph Library
|
#include <CGAL/boost/graph/graph_traits_Triangulation_2.h>
The class graph_traits
is a partial specialization of boost::graph_traits
for the 2D triangulation classes.
The triangulations of CGAL are all models of the concepts BidirectionalGraph
and VertexAndEdgeListGraph
of the Boost Graph Library [1].
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.
Types | |
typedef Triangulation::Vertex_handle | vertex_descriptor |
The vertex descriptor. | |
typedef unspecified_type | edge_descriptor |
The edge descriptor. More... | |
typedef unspecified_type | vertex_iterator |
The vertex iterator type. More... | |
typedef unspecified_type | edge_iterator |
The edge iterator type, Its value type is edge_descriptor . | |
typedef unspecified_type | out_edge_iterator |
An iterator for the outgoing edges incident to a vertex. More... | |
typedef unspecified_type | in_edge_iterator |
An iterator for the incoming edges incident to a vertex. More... | |
typedef unspecified_type | adjacency_iterator |
An iterator for the vertices adjacent to a vertex. More... | |
typedef boost::undirected_tag | directed_category |
typedef boost::disallow_parallel_edge_tag | edge_parallel_category |
typedef unspecified_type boost::graph_traits< CGAL::Triangulation_2< GT, TDS > >::adjacency_iterator |
An iterator for the vertices adjacent to a vertex.
Its value type is vertex_descriptor
.
typedef unspecified_type boost::graph_traits< CGAL::Triangulation_2< GT, TDS > >::edge_descriptor |
The edge descriptor.
It is constructible from and convertible to Triangulation::Edge
. The edge descriptor is not a simple typedef, but a proper class, because in an undirected graph the edges (u,v)
and (v,u)
must be equal. This is not the case for the Edge type of the triangulation.
typedef unspecified_type boost::graph_traits< CGAL::Triangulation_2< GT, TDS > >::in_edge_iterator |
An iterator for the incoming edges incident to a vertex.
Its value type is edge_descriptor
.
typedef unspecified_type boost::graph_traits< CGAL::Triangulation_2< GT, TDS > >::out_edge_iterator |
An iterator for the outgoing edges incident to a vertex.
Its value type is edge_descriptor
.
typedef unspecified_type boost::graph_traits< CGAL::Triangulation_2< GT, TDS > >::vertex_iterator |
The vertex iterator type.
Its value type is vertex_descriptor
.