diff --git a/Arrangement_on_surface_2/include/CGAL/graph_traits_Arrangement_2.h b/Arrangement_on_surface_2/include/CGAL/graph_traits_Arrangement_2.h index 77f75138a73..f0240f3b12c 100644 --- a/Arrangement_on_surface_2/include/CGAL/graph_traits_Arrangement_2.h +++ b/Arrangement_on_surface_2/include/CGAL/graph_traits_Arrangement_2.h @@ -27,6 +27,7 @@ #include #include +#include #include #include #include @@ -75,7 +76,8 @@ private: public virtual boost::bidirectional_graph_tag, // This tag refines the // incidence_graph_tag. public virtual boost::vertex_list_graph_tag, // Can iterate over vertices. - public virtual boost::edge_list_graph_tag // Can iterate over edges. + public virtual boost::edge_list_graph_tag, // Can iterate over edges. + public virtual boost::adjacency_graph_tag {}; /*! \class @@ -232,7 +234,7 @@ public: typedef typename Arrangement_on_surface_2::Size edges_size_type; // Types not required by any of these concepts: - typedef void adjacency_iterator; + typedef CGAL::Vertex_around_target_iterator adjacency_iterator; /*! Constructor. */ graph_traits (const Arrangement_on_surface_2& arr) : @@ -411,6 +413,20 @@ out_edges (typename return std::make_pair (gt_arr.out_edges_begin (v), gt_arr.out_edges_end (v)); } +template +Iterator_range< typename + boost::graph_traits >:: + adjacency_iterator> +adjacent_vertices(typename + boost::graph_traits >:: + vertex_descriptor v, + const CGAL::Arrangement_on_surface_2& arr) +{ + return CGAL::vertices_around_target(v,arr); +} + /*! * Get the source vertex of an arrangement edge. * \param e The edge. diff --git a/BGL/doc/BGL/graph_traits.txt b/BGL/doc/BGL/graph_traits.txt index d6f87e7b868..bbcc04d6b62 100644 --- a/BGL/doc/BGL/graph_traits.txt +++ b/BGL/doc/BGL/graph_traits.txt @@ -36,7 +36,7 @@ The traits class `boost::graph_traits< CGAL::Surface_mesh >` provides the fol | `face_iterator` | `Surface_mesh::Face_iterator` | An iterator to traverse through the faces of the graph. Its value type is `face_descriptor`. | | `directed_category` | `boost::undirected_tag` | This graph is not directed. | | `edge_parallel_category` | `boost::disallow_parallel_edge_tag` | This graph does not support multiedges. | -| `traversal_category` | Inherits from `boost::bidirectional_graph_tag`, `boost::vertex_list_graph_tag`, and `boost::edge_list_graph_tag` | The ways in which the vertices in the graph can be traversed. | +| `traversal_category` | Inherits from `boost::bidirectional_graph_tag`, `boost::vertex_list_graph_tag`, `boost::edge_list_graph_tag`, and `boost::adjacency_graph_tag` | The ways in which the vertices in the graph can be traversed. | | `vertices_size_type` | `Surface_mesh::vertices_size_type` | The size type of the vertex list. | | `edges_size_type` | `Surface_mesh::edges_size_type` | The size type of the edge list. | | `degree_size_type` | `Surface_mesh::degree_size_type` | The size type of the adjacency list. | @@ -69,7 +69,7 @@ The traits class `boost::graph_traits< CGAL::Polyhedron_3 >` provides the fol | `face_iterator` | `unspecified_type` | An iterator to traverse through the faces of the graph. Its value type is `face_descriptor`. | | `directed_category` | `boost::undirected_tag` | This graph is not directed. | | `edge_parallel_category` | `boost::disallow_parallel_edge_tag` | This graph does not support multiedges. | -| `traversal_category` | Inherits from `boost::bidirectional_graph_tag`, `boost::vertex_list_graph_tag`, and `boost::edge_list_graph_tag` | The ways in which the vertices in the graph can be traversed. | +| `traversal_category` | Inherits from `boost::bidirectional_graph_tag`, `boost::vertex_list_graph_tag`, `boost::edge_list_graph_tag`, and`boost::adjacency_graph_tag` | The ways in which the vertices in the graph can be traversed. | | `vertices_size_type` | `Polyhedron_3::size_type` | The size type of the vertex list. | | `edges_size_type` | `Polyhedron_3::size_type` | The size type of the edge list. | | `degree_size_type` | `Polyhedron_3::size_type` | The size type of the adjacency list. | @@ -102,7 +102,7 @@ The traits class `boost::graph_traits` provides the following types: | `edge_iterator` | `unspecified_type` | Iterate through the edges of LCC.| | `halfedge_iterator` | `unspecified_type` | Iterate through the halfedges of LCC.| | `face_iterator` | `unspecified_type` | Iterate through the faces of LCC.| -| `directed_category` | Inherits from `boost::bidirectional_graph_tag`, `boost::vertex_list_graph_tag` and `boost::edge_list_graph_tag` | | +| `directed_category` | Inherits from `boost::bidirectional_graph_tag`, `boost::vertex_list_graph_tag`, `boost::edge_list_graph_tag`, and `boost::adjacency_graph_tag` | | | `edge_parallel_category` | `boost::disallow_parallel_edge_tag` | Indicates that this graph does not support multiedges | | `traversal_category` | `boost::bidirectional_graph_tag` | Indicates that this graph is bidirectional | | `vertices_size_type` | `LCC::size_type` | The size type of the vertex list | @@ -197,14 +197,14 @@ provides the following types: | :----------------------- | :----: | :---------- | | `vertex_descriptor` | `Arrangement_2::Vertex_handle` | Identify vertices in the graph. | | `edge_descriptor` | `Arrangement_2::Halfedge_handle` | Identify edges in the graph. | -| `adjacency_iterator` | Not provided| | +| `adjacency_iterator` | `Vertex_around_target_iterator`| An iterator to traverse through the vertices adjacent to a vertex. Its value type is `vertex_descriptor`.| | `out_edge_iterator` | `unspecified_type` | An edge iterator which only iterates over the outgoing halfedges around a vertex. It corresponds to a `Arrangement_2::Halfedge_around_vertex_circulator` with the difference that its value type is an edge descriptor and not `Arrangement_2::Halfedge`| | `in_edge_iterator` | `unspecified_type` | An edge iterator which only iterates over the incoming edges around a vertex. It corresponds to a `Arrangement_2::Halfedge_around_vertex_circulator` with the difference that its value type is an edge descriptor and not `Arrangement_2::Halfedge`| | `vertex_iterator` | `unspecified_type` | An iterator corresponding to `Arrangement_2::Vertex_iterator`, with the difference that its value type is a vertex descriptor and not `Arrangement_2::Vertex` | | `edge_iterator` | `unspecified_type` | An iterator corresponding to `Arrangement_2::Halfedge_iterator` with the difference that its value type is an edge descriptor and not `Arrangement_2::Halfedge`| | `directed_category` | `boost::directed_tag` | This graph is directed. | | `edge_parallel_category` | `boost::allow_parallel_edge_tag` | This graph supports multiedges. | -| `traversal_category` | Inherits from `boost::bidirectional_graph_tag`, `boost::vertex_list_graph_tag`, and `boost::edge_list_graph_tag` | The ways in which the vertices in the graph can be traversed. | +| `traversal_category` | Inherits from `boost::bidirectional_graph_tag`, `boost::vertex_list_graph_tag`, `boost::edge_list_graph_tag`, and `boost::adjacency_graph_tag` | The ways in which the vertices in the graph can be traversed. | | `vertices_size_type` | `Arrangement_2::Size` | The size type of the vertex list. | | `edges_size_type` | `Arrangement_2::Size` | The size type of the edge list. | | `degree_size_type` | `Arrangement_2::Size` | The size type of the adjacency list. | @@ -221,20 +221,20 @@ The traits class `boost::graph_traits >` prov | Member | Value | Description | | :----------------------- | :----: | :---------- | -| `vertex_descriptor` | `OpenMesh::PolyMesh_ArrayKernelT::VertexHandle` | Identify vertices in the graph. | +| `vertex_descriptor` | `OpenMesh::PolyMesh_ArrayKernelT::VertexHandle` | Identify vertices in the graph. | | `edge_descriptor` | `unspecified_type` | Identify edges in the graph. | -| `halfedge_descriptor` | `OpenMesh::PolyMesh_ArrayKernelT::HalfedgeHandle` | Identify halfedges in the graph. | -| `face_descriptor` | `OpenMesh::PolyMesh_ArrayKernelT::FaceHandle` | Identify faces in the graph. | -| `adjacency_iterator` | `unspecified_type` | An iterator to traverse through the vertices adjacent to a vertex. Its value type is `vertex_descriptor`. | +| `halfedge_descriptor` | `OpenMesh::PolyMesh_ArrayKernelT::HalfedgeHandle` | Identify halfedges in the graph. | +| `face_descriptor` | `OpenMesh::PolyMesh_ArrayKernelT::FaceHandle` | Identify faces in the graph. | +| `adjacency_iterator` | `CGAL::Vertex_around_target_iterator >` | An iterator to traverse through the vertices adjacent to a vertex. Its value type is `vertex_descriptor`. | | `out_edge_iterator` | `CGAL::Out_edge_iterator >` | An iterator to traverse through the outgoing edges incident to a vertex. Its value type is `edge_descriptor`. | | `in_edge_iterator` | `CGAL::In_edge_iterator >` | An iterator to traverse through the incoming edges incident to a vertex. Its value type is `edge_descriptor`. | -| `vertex_iterator` | `OpenMesh::PolyMesh_ArrayKernelT::VertexIter` | An iterator to traverse through the vertices of the graph. Its value type is `vertex_descriptor`. | +| `vertex_iterator` | `OpenMesh::PolyMesh_ArrayKernelT::VertexIter` | An iterator to traverse through the vertices of the graph. Its value type is `vertex_descriptor`. | | `edge_iterator` | `unspecified_type` | An iterator to traverse through the edges of the graph. Its value type is `edge_descriptor`. | -| `halfedge_iterator` | `OpenMesh::PolyMesh_ArrayKernelT::HalfedgeIter` | An iterator to traverse through the halfedges of the graph. Its value type is `halfedge_descriptor`. | -| `face_iterator` | `OpenMesh::PolyMesh_ArrayKernelT::FaceIter` | An iterator to traverse through the faces of the graph. Its value type is `face_descriptor`. | +| `halfedge_iterator` | `OpenMesh::PolyMesh_ArrayKernelT::HalfedgeIter` | An iterator to traverse through the halfedges of the graph. Its value type is `halfedge_descriptor`. | +| `face_iterator` | `OpenMesh::PolyMesh_ArrayKernelT::FaceIter` | An iterator to traverse through the faces of the graph. Its value type is `face_descriptor`. | | `directed_category` | `boost::undirected_tag` | This graph is not directed. | | `edge_parallel_category` | `boost::disallow_parallel_edge_tag` | This graph does not support multiedges. | -| `traversal_category` | Inherits from `boost::bidirectional_graph_tag`, `boost::vertex_list_graph_tag`, and `boost::edge_list_graph_tag` | The ways in which the vertices in the graph can be traversed. | +| `traversal_category` | Inherits from `boost::bidirectional_graph_tag`, `boost::vertex_list_graph_tag`,`boost::edge_list_graph_tag`, and`boost::adjacency_graph_tag` | The ways in which the vertices in the graph can be traversed. | | `vertices_size_type` | `unsigned int` | The size type of the vertex list. | | `edges_size_type` | `unsigned int` | The size type of the edge list. | | `degree_size_type` | `unsigned int` | The size type of the adjacency list. | @@ -251,20 +251,20 @@ The traits class `boost::graph_traits >` provi | Member | Value | Description | | :----------------------- | :----: | :---------- | -| `vertex_descriptor` | `OpenMesh::TriMesh_ArrayKernelT::VertexHandle` | Identify vertices in the graph. | +| `vertex_descriptor` | `OpenMesh::TriMesh_ArrayKernelT::VertexHandle` | Identify vertices in the graph. | | `edge_descriptor` | `unspecified_type` | Identify edges in the graph. | -| `halfedge_descriptor` | `OpenMesh::TriMesh_ArrayKernelT::HalfedgeHandle` | Identify halfedges in the graph. | -| `face_descriptor` | `OpenMesh::TriMesh_ArrayKernelT::FaceHandle` | Identify faces in the graph. | -| `adjacency_iterator` | `unspecified_type` | An iterator to traverse through the vertices adjacent to a vertex. Its value type is `vertex_descriptor`. | +| `halfedge_descriptor` | `OpenMesh::TriMesh_ArrayKernelT::HalfedgeHandle` | Identify halfedges in the graph. | +| `face_descriptor` | `OpenMesh::TriMesh_ArrayKernelT::FaceHandle` | Identify faces in the graph. | +| `adjacency_iterator` | `CGAL::Vertex_around_target_iterator >` | An iterator to traverse through the vertices adjacent to a vertex. Its value type is `vertex_descriptor`. | | `out_edge_iterator` | `CGAL::Out_edge_iterator >` | An iterator to traverse through the outgoing edges incident to a vertex. Its value type is `edge_descriptor`. | | `in_edge_iterator` | `CGAL::In_edge_iterator >` | An iterator to traverse through the incoming edges incident to a vertex. Its value type is `edge_descriptor`. | -| `vertex_iterator` | `OpenMesh::PolyMesh_ArrayKernelT::VertexIter` | An iterator to traverse through the vertices of the graph. Its value type is `vertex_descriptor`. | +| `vertex_iterator` | `OpenMesh::PolyMesh_ArrayKernelT::VertexIter` | An iterator to traverse through the vertices of the graph. Its value type is `vertex_descriptor`. | | `edge_iterator` | `unspecified_type` | An iterator to traverse through the edges of the graph. Its value type is `edge_descriptor`. | -| `halfedge_iterator` | `OpenMesh::TriMesh_ArrayKernelT::HalfedgeIter` | An iterator to traverse through the halfedges of the graph. Its value type is `halfedge_descriptor`. | -| `face_iterator` | `OpenMesh::TriMesh_ArrayKernelT::FaceIter` | An iterator to traverse through the faces of the graph. Its value type is `face_descriptor`. | +| `halfedge_iterator` | `OpenMesh::TriMesh_ArrayKernelT::HalfedgeIter` | An iterator to traverse through the halfedges of the graph. Its value type is `halfedge_descriptor`. | +| `face_iterator` | `OpenMesh::TriMesh_ArrayKernelT::FaceIter` | An iterator to traverse through the faces of the graph. Its value type is `face_descriptor`. | | `directed_category` | `boost::undirected_tag` | This graph is not directed. | | `edge_parallel_category` | `boost::disallow_parallel_edge_tag` | This graph does not support multiedges. | -| `traversal_category` | Inherits from `boost::bidirectional_graph_tag`, `boost::vertex_list_graph_tag`, and `boost::edge_list_graph_tag` | The ways in which the vertices in the graph can be traversed. | +| `traversal_category` | Inherits from `boost::bidirectional_graph_tag`, `boost::vertex_list_graph_tag`, `boost::edge_list_graph_tag`, and `boost::adjacency_graph_tag` | The ways in which the vertices in the graph can be traversed. | | `vertices_size_type` | `unsigned int` | The size type of the vertex list. | | `edges_size_type` | `unsigned int` | The size type of the edge list. | | `degree_size_type` | `unsigned int` | The size type of the adjacency list. |