Documentation for BGL and SMP

- Fixed the boost::graph_traits tables
- Seam mesh documentation
- Some minor changes to surface_mesh_parameterization's and ARAP's docs
This commit is contained in:
Mael Rouxel-Labbé 2016-11-11 19:00:27 +01:00
parent 7ce8fdf3f6
commit 40655269a2
6 changed files with 360 additions and 252 deletions

View File

@ -10,8 +10,6 @@
related to it. Models of the concept and their related functions
must be in the same namespace (they will be found by Koenig lookup).
\dot
digraph example {
node [shape=record, fontname=Helvetica, fontsize=10];
@ -54,8 +52,6 @@ Associated Type | Description
`boost::graph_traits<G>::%vertex_iterator` | %Iterator over all vertices.
`boost::graph_traits<G>::%vertices_size_type` | Unsigned integer type for number of vertices.
Valid Expression | returns | Description
----------------- | --------------- | -----------------------
`vertices(g)` | `std::pair<vertex_iterator, vertex_iterator>` | An iterator range over all vertices.
@ -71,7 +67,6 @@ Associated Type | Description
`boost::graph_traits<G>::%edge_iterator` | %Iterator over all edges.
`boost::graph_traits<G>::%edges_size_type` | Unsigned integer type for number of edges.
Valid Expression | returns | Description
----------------- | --------------- | -----------------------
`edges(g)` | `std::pair<edge_iterator, edge_iterator>` | An iterator range over all edges.
@ -130,7 +125,6 @@ Associated Type | Description
`boost::graph_traits<G>::%halfedge_iterator` | A `BidirectionalIterator` over all halfedges in a graph. Must be `DefaultConstructible`, `Assignable`, `EqualityComparable`.
`boost::graph_traits<G>::%halfedges_size_type` | A size type.
Valid Expression | Returns | Description
------------------------------------- | ------------------------------------------| -----------
`num_halfedges(g)` | `halfedges_size_type` | An upper bound of the number of halfedges of the graph.
@ -148,7 +142,6 @@ Associated Type | Description
-------------------------------------------- | ------------
`boost::graph_traits<G>::%face_descriptor` | A `face_descriptor` corresponds to a unique face in a graph. Must be `DefaultConstructible`, `Assignable`, `EqualityComparable` and `LessThanComparable`.
Valid Expression | Returns | Description
-------------------------------------- | ------------------------------------------------------------------------ | ------------------------
`face(h, g)` | `face_descriptor` | The face incident to halfedge `h`.
@ -156,7 +149,6 @@ Valid Expression | Returns
`degree(f,g)` | `degree_size_type` | The number of halfedges incident to face `f`.
`boost::graph_traits<G>::%null_face()` | `face_descriptor` | A special face that is not equal to any other face.
\cgalHeading{%MutableFaceGraph}
The concept `MutableFaceGraph` refines the concepts `FaceGraph` and `MutableHalfedgeGraph` and adds
@ -180,15 +172,11 @@ Associated Type | Description
`boost::graph_traits<G>::%face_iterator` | %Iterator over all faces.
`boost::graph_traits<G>::%faces_size_type` | Unsigned integer type for number of faces.
Valid Expression | returns | Description
----------------- | --------------- | -----------------------
`faces(g)` | `std::pair<face_iterator, face_iterator>` | An iterator range over all faces.
`num_faces(g)` | `faces_size_type` | An upper bound of the number of faces of the graph.
*/
/// The property tags model of the boost concept <a href="http://www.boost.org/libs/graph/doc/PropertyTag.html"><code>PropertyTag</code></a>.
@ -230,10 +218,10 @@ Most functions are in the header file `<CGAL/boost/graph/helpers.h>`
Several iterators and circulators are provided that enable, for example,
to iterate through the halfedges incident to a given face or vertex.
Starting at a halfedge `h`, applying several times `next(h,g)` brings us back
to the halfedge where we started. All halfedges traversed on the way are
Starting at a halfedge `h`, applying several times `next(h,g)` brings us back
to the halfedge where we started. All halfedges traversed on the way are
incident to the same face.
Using the composition of the `next(h,g)` and `opposite(h,g)` functions results
Using the composition of the `next(h,g)` and `opposite(h,g)` functions results
in another cycle, namely the cycle of halfedges which are incident to
the same vertex.
For convenience, two iterator and circulator types enable iterating through all the halfedges
@ -297,8 +285,9 @@ adapted types are listed here. The pages document which concepts they
model, the properties they support, and any possible caveats that a
user might encounter.
- `boost::graph_traits< CGAL::Surface_mesh<P> >`
- \link BGLPolyGT `boost::graph_traits< CGAL::Polyhedron_3<T> >` \endlink
- \link BGLSMGT `boost::graph_traits< CGAL::Surface_mesh<P> >` \endlink
- \link BGLPolyGT `boost::graph_traits< CGAL::Polyhedron_3<T> >` \endlink
- \link BGLSeam_meshGT `boost::graph_traits< CGAL::Seam_mesh<T> >` \endlink
- \link BGLT2GT `boost::graph_traits< CGAL::Triangulation_2<GT, TDS> >` \endlink
- \link BGLArgtGT `boost::graph_traits< CGAL::Arrangement_2<T,DC> >` \endlink
- \link BGLOMPAK `boost::graph_traits<OpenMesh::PolyMesh_ArrayKernelT<K> >` \endlink
@ -409,7 +398,7 @@ user might encounter.
/*!
\addtogroup PkgBGLEulerOperations
We call high level operations that maintain the validity of a halfedge graph <em>%Euler Operations</em>.
We call high level operations that maintain the validity of a halfedge graph <em>%Euler Operations</em>.
*/

View File

@ -3,25 +3,13 @@
\ingroup PkgBGL
\sc{Bgl} defines the class template
The \sc{Bgl} defines the class template
<A HREF="http://www.boost.org/libs/graph/doc/graph_traits.html">`boost::graph_traits`</A>
as a uniform interface to the properties and types of %graph types.
We provide specializations of this class template for several \cgal data structures.
\section BGLSeam_meshGT Specialization for the Seam_mesh Class
The traits class `boost::graph_traits< CGAL::Seam_mesh<T> >` provides the following types:
| Member | Value | Description |
| :----------------------- | :----: | :---------- |
| `vertex_descriptor` | `Surface_mesh::Vertex_index` | The vertex descriptor |
We provide specializations of this class template for several \cgal data structures.
\section BGLSMGT Specialization for the Surface_mesh Class
We provide partial specialization for the class `CGAL::Surface_mesh`, so that it is
model of the graph concept `FaceGraph`.
Defined in `<CGAL/boost/graph/graph_traits_Surface_mesh.h>`
We provide partial specialization for the class `CGAL::Surface_mesh` so that it is a model
@ -37,25 +25,23 @@ The traits class `boost::graph_traits< CGAL::Surface_mesh<T> >` provides the fol
| Member | Value | Description |
| :----------------------- | :----: | :---------- |
| `vertex_descriptor` | `Surface_mesh::Vertex_index` | The vertex descriptor |
| `edge_descriptor` | `Surface_mesh::Edge_index` | The edge descriptor |
| `halfedge_descriptor` | `Surface_mesh::Halfedge_index` | The halfedge descriptor |
| `face_descriptor` | `Surface_mesh::Face_index` | The face descriptor |
| `adjacency_iterator` | `CGAL::Vertex_around_target_iterator<Surface_mesh<P> >` | Iterates through adjacent vertices|
| `out_edge_iterator` | `CGAL::Out_edge_iterator<Surface_mesh<P> >` | Iterate through the out-edges of a vertex. |
| `in_edge_iterator` | `CGAL::Out_edge_iterator<Surface_mesh<P> >` | Iterate through the in-edges of a vertex. |
| `vertex_iterator` | `Surface_mesh::Vertex_iterator` | Iterate through the vertices of a polyhedron.|
| `edge_iterator` | `Surface_mesh::Edge_iterator` | Iterate through the edges of a polyhedron.|
| `halfedge_iterator` | `Surface_mesh::Halfedge_iterator` | Iterate through the halfedges of a polyhedron.|
| `face_iterator` | `Surface_mesh::Face_iterator` | Iterate through the faces of a polyhedron.|
| `directed_category` | Inherits from `boost::bidirectional_graph_tag`, `boost::vertex_list_graph_tag` and `boost::edge_list_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` | `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 |
| `vertex_descriptor` | `Surface_mesh::Vertex_index` | Identify vertices in the graph. |
| `edge_descriptor` | `Surface_mesh::Edge_index` | Identify edges in the graph. |
| `halfedge_descriptor` | `Surface_mesh::Halfedge_index` | Identify halfedges in the graph. |
| `face_descriptor` | `Surface_mesh::Face_index` | Identify faces in the graph. |
| `adjacency_iterator` | `CGAL::Vertex_around_target_iterator<Surface_mesh<P> >` | An iterator to traverse through the vertices adjacent to a vertex. Its value type is `vertex_descriptor`. |
| `out_edge_iterator` | `CGAL::Out_edge_iterator<Surface_mesh<P> >` | 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<Surface_mesh<P> >` | An iterator to traverse through the incoming edges incident to a vertex. Its value type is `edge_descriptor`. |
| `vertex_iterator` | `Surface_mesh::Vertex_iterator` | An iterator to traverse through the vertices of the graph. Its value type is `vertex_descriptor`. |
| `edge_iterator` | `Surface_mesh::Edge_iterator` | An iterator to traverse through the edges of the graph. Its value type is `edge_descriptor`. |
| `halfedge_iterator` | `Surface_mesh::Halfedge_iterator` | An iterator to traverse through the halfedges of the graph. Its value type is `halfedge_descriptor`. |
| `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. |
| `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. |
\section BGLPolyGT Specialization for the Polyhedron Class
@ -74,94 +60,58 @@ The traits class `boost::graph_traits< CGAL::Polyhedron_3<T> >` provides the fol
| Member | Value | Description |
| :----------------------- | :----: | :---------- |
| `vertex_descriptor` | `Polyhedron_3::Vertex_handle` | The vertex descriptor |
| `edge_descriptor` | `unspecified_type` | The edge descriptor |
| `halfedge_descriptor` | `Polyhedron_3::Halfedge_handle` | The halfedge descriptor |
| `face_descriptor` | `Polyhedron_3::Face_handle` | The face descriptor |
| `adjacency_iterator` | `CGAL::Vertex_around_target_iterator<Polyhedron_3<T> >` | Iterates through adjacent vertices|
| `out_edge_iterator` | `CGAL::Out_edge_iterator<Polyhedron_3<T> >` | Iterate through the out-edges of a vertex. |
| `in_edge_iterator` | `CGAL::Out_edge_iterator<Polyhedron_3<T> >` | Iterate through the in-edges of a vertex. |
| `vertex_iterator` | `unspecified_type` | Iterate through the vertices of a polyhedron.|
| `edge_iterator` | `unspecified_type` | Iterate through the edges of a polyhedron.|
| `halfedge_iterator` | `unspecified_type` | Iterate through the halfedges of a polyhedron.|
| `face_iterator` | `unspecified_type` | Iterate through the faces of a polyhedron.|
| `directed_category` | Inherits from `boost::bidirectional_graph_tag`, `boost::vertex_list_graph_tag` and `boost::edge_list_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` | `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 |
| `vertex_descriptor` | `Polyhedron_3::Vertex_handle` | Identify vertices in the graph. |
| `edge_descriptor` | `unspecified_type` | Identify edges in the graph. |
| `halfedge_descriptor` | `Polyhedron_3::Halfedge_handle` | Identify halfedges in the graph. |
| `face_descriptor` | `Polyhedron_3::Face_handle` | Identify faces in the graph. |
| `adjacency_iterator` | `CGAL::Vertex_around_target_iterator<Polyhedron_3<T> >` | An iterator to traverse through the vertices adjacent to a vertex. Its value type is `vertex_descriptor`. |
| `out_edge_iterator` | `CGAL::Out_edge_iterator<Polyhedron_3<T> >` | 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<Polyhedron_3<T> >` | An iterator to traverse through the incoming edges incident to a vertex. Its value type is `edge_descriptor`. |
| `vertex_iterator` | `unspecified_type` | 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` | `unspecified_type` | An iterator to traverse through the halfedges of the graph. Its value type is `halfedge_descriptor`. |
| `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. |
| `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. |
For convenience, the type `edge_descriptor` is hashable using the functor `CGAL::Handle_hash_function`
that is the default hash functor of `CGAL::Unique_hash_map`.
For convenience, the type `edge_descriptor` is hashable using the functor `CGAL::Handle_hash_function`,
which is the default hash functor of `CGAL::Unique_hash_map`.
\section BGLSeam_meshGT Specialization for the Seam_mesh Class
\section BGLOMPAK Specialization for the OpenMesh::PolyMesh_ArrayKernelT Class
Defined in `<CGAL/boost/graph/graph_traits_Seam_mesh.h>`
Defined in `<CGAL/boost/graph/graph_traits_PolyMesh_ArrayKernelT.h>`
We provide partial specialization for the class `OpenMesh::PolyMesh_ArrayKernelT` so that it is a model
We provide partial specialization for the class `CGAL::Seam_mesh` so that it is a model
of the graph concepts
<A HREF="http://www.boost.org/libs/graph/doc/BidirectionalGraph.html">`BidirectionalGraph`</A> and
<A HREF="http://www.boost.org/libs/graph/doc/VertexAndEdgeListGraph.html">`VertexAndEdgeListGraph`</A>
and of the concept `MutableFaceGraph`.
The traits class `boost::graph_traits<OpenMesh::PolyMesh_ArrayKernelT<K> >` provides the following types:
The traits class `boost::graph_traits< CGAL::Seam_mesh<T> >` provides the following types:
| Member | Value | Description |
| :----------------------- | :----: | :---------- |
| `vertex_descriptor` | `OpenMesh::PolyMesh_ArrayKernelT::VertexHandle` | The vertex descriptor |
| `edge_descriptor` | `unspecified_type` | The edge descriptor |
| `halfedge_descriptor` | `OpenMesh::PolyMesh_ArrayKernelT::HalfedgeHandle` | The halfedge descriptor |
| `face_descriptor` | `Surface_mesh::FaceHande` | The face descriptor |
| `adjacency_iterator` | `unspecified_type` | Iterates through adjacent vertices|
| `out_edge_iterator` | `unspecified_type` | Iterate through the out-edges of a vertex. |
| `in_edge_iterator` | `unspecified_type` | Iterate through the in-edges of a vertex. |
| `vertex_iterator` | `unspecified_type` | Iterate through the vertices of a polyhedron.|
| `edge_iterator` | `unspecified_type` | Iterate through the edges of a polyhedron.|
| `halfedge_iterator` | `OpenMesh::PolyMesh_ArrayKernelT::HalfedgeIter` | Iterate through the halfedges of a polyhedron.|
| `face_iterator` | `OpenMesh::PolyMesh_ArrayKernelT::FaceIter` | Iterate through the faces of a polyhedron.|
| `directed_category` | Inherits from `boost::bidirectional_graph_tag`, `boost::vertex_list_graph_tag` and `boost::edge_list_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` | `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` | The size type of the adjacency list |
\section BGLOMTMAK Specialization for the OpenMesh::TriMesh_ArrayKernelT Class
Defined in `<CGAL/boost/graph/graph_traits_TriMesh_ArrayKernelT.h>`
We provide partial specialization for the class `OpenMesh::TriMesh_ArrayKernelT` so that it is a model
of the graph concepts
<A HREF="http://www.boost.org/libs/graph/doc/BidirectionalGraph.html">`BidirectionalGraph`</A> and
<A HREF="http://www.boost.org/libs/graph/doc/VertexAndEdgeListGraph.html">`VertexAndEdgeListGraph`</A>
and of the concept `MutableFaceGraph`.
The traits class `boost::graph_traits<OpenMesh::TriMesh_ArrayKernelT<K> >` provides the following types:
| Member | Value | Description |
| :----------------------- | :----: | :---------- |
| `vertex_descriptor` | `OpenMesh::TriMesh_ArrayKernelT::VertexHandle` | The vertex descriptor |
| `edge_descriptor` | `unspecified_type` | The edge descriptor |
| `halfedge_descriptor` | `OpenMesh::TriMesh_ArrayKernelT::HalfedgeHandle` | The halfedge descriptor |
| `face_descriptor` | `Surface_mesh::FaceHande` | The face descriptor |
| `adjacency_iterator` | `unspecified_type` | Iterates through adjacent vertices|
| `out_edge_iterator` | `unspecified_type` | Iterate through the out-edges of a vertex. |
| `in_edge_iterator` | `unspecified_type` | Iterate through the in-edges of a vertex. |
| `vertex_iterator` | `unspecified_type` | Iterate through the vertices of a polyhedron.|
| `edge_iterator` | `unspecified_type` | Iterate through the edges of a polyhedron.|
| `halfedge_iterator` | `OpenMesh::TriMesh_ArrayKernelT::HalfedgeIter` | Iterate through the halfedges of a polyhedron.|
| `face_iterator` | `OpenMesh::TriMesh_ArrayKernelT::FaceIter` | Iterate through the faces of a polyhedron.|
| `directed_category` | Inherits from `boost::bidirectional_graph_tag`, `boost::vertex_list_graph_tag` and `boost::edge_list_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` | `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` | The size type of the adjacency list |
| `vertex_descriptor` | `Seam_mesh::vertex_descriptor` | Identify vertices in the graph. |
| `edge_descriptor` | `Seam_mesh::edge_descriptor` | Identify edges in the graph. |
| `halfedge_descriptor` | `Seam_mesh::halfedge_descriptor` | Identify halfedges in the graph. |
| `face_descriptor` | `Seam_mesh::face_descriptor` | Identify faces in the graph. |
| `adjacency_iterator` | `CGAL::Vertex_around_target_iterator<CGAL::Seam_mesh<T> >` | An iterator to traverse through the vertices adjacent to a vertex. Its value type is `vertex_descriptor`. |
| `out_edge_iterator` | `CGAL::Out_edge_iterator<CGAL::Seam_mesh<T> >` | 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<CGAL::Seam_mesh<T> >` | An iterator to traverse through the incoming edges incident to a vertex. Its value type is `edge_descriptor`. |
| `vertex_iterator` | `Seam_mesh::vertex_iterator` | An iterator to traverse through the vertices of the graph. Its value type is `vertex_descriptor`. |
| `edge_iterator` | `Seam_mesh::edge_iterator` | An iterator to traverse through the edges of the graph. Its value type is `edge_descriptor`. |
| `halfedge_iterator` | `Seam_mesh::halfedge_iterator` | An iterator to traverse through the halfedges of the graph. Its value type is `halfedge_descriptor`. |
| `face_iterator` | `Seam_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. |
| `vertices_size_type` | `Seam_mesh::vertices_size_type` | The size type of the vertex list. |
| `edges_size_type` | `Seam_mesh::edges_size_type` | The size type of the edge list. |
| `degree_size_type` | `Seam_mesh::degree_size_type` | The size type of the adjacency list. |
\section BGLT2GT Specializations for the 2D Triangulation Classes
@ -182,7 +132,6 @@ so that they are model of the graph concepts
<A HREF="http://www.boost.org/libs/graph/doc/BidirectionalGraph.html">`BidirectionalGraph`</A> and
<A HREF="http://www.boost.org/libs/graph/doc/VertexAndEdgeListGraph.html">`VertexAndEdgeListGraph`</A>.
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 \sc{Bgl} iterators is the vertex or edge descriptor,
@ -194,64 +143,129 @@ finite and infinite vertices and edges. As the edge weight computed
with the default property map of \sc{Bgl} algorithms (obtained with
`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
that make use of the edge weight, the user must therefore
define a <A HREF="http://www.boost.org/libs/graph/doc/filtered_graph.html">`boost::filtered_graph`</A> 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`
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.
The traits class `boost::graph_traits< CGAL::Triangulation_2<GT, TDS> >` and
The traits classes `boost::graph_traits< CGAL::Triangulation_2<GT, TDS> >` and
`boost::graph_traits< CGAL::Delaunay_triangulation_2<GT, TDS> >`
provide the following types:
| Member | Value | Description |
| :----------------------- | :----: | :---------- |
| `vertex_descriptor` | `Triangulation::Vertex_handle` | The vertex descriptor |
| `edge_descriptor` | `unspecified_type` | 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. |
| `adjacency_iterator` | `unspecified_type` | An iterator for the vertices adjacent to a vertex. Its value type is `vertex_descriptor` |
| `out_edge_iterator` | `unspecified_type` | An iterator for the outgoing edges incident to a vertex. Its value type is `edge_descriptor`. |
| `in_edge_iterator` | `unspecified_type` | An iterator for the incoming edges incident to a vertex. Its value type is `edge_descriptor`. |
| `vertex_iterator` | `unspecified_type` | The vertex iterator type. Its value type is `vertex_descriptor` |
| `edge_iterator` | `unspecified_type` | The edge iterator type, Its value type is `edge_descriptor` |
| `directed_category` | `boost::undirected_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` | `Triangulation::size_type` | The size type of the vertex list |
| `edges_size_type` | `Triangulation::size_type` | The size type of the edge list |
| `degree_size_type` | `Triangulation::size_type` | The size type of the adjacency list |
| `vertex_descriptor` | `Triangulation::Vertex_handle` | Identify vertices in the graph. |
| `edge_descriptor` | `unspecified_type` | Identify edges in the graph. It is constructible from and convertible to `Triangulation::Edge`. It 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. |
| `adjacency_iterator` | `unspecified_type` | An iterator to traverse through the vertices adjacent to a vertex. Its value type is `vertex_descriptor`. |
| `out_edge_iterator` | `unspecified_type` | An iterator to traverse through the outgoing edges incident to a vertex. Its value type is `edge_descriptor`. |
| `in_edge_iterator` | `unspecified_type` | An iterator to traverse through the incoming edges incident to a vertex. Its value type is `edge_descriptor`. |
| `vertex_iterator` | `unspecified_type` | 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`. |
| `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::adjacency_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.. |
| `vertices_size_type` | `Triangulation::size_type` | The size type of the vertex list. |
| `edges_size_type` | `Triangulation::size_type` | The size type of the edge list. |
| `degree_size_type` | `Triangulation::size_type` | The size type of the adjacency list. |
\section BGLArgtGT Specialization for the Arrangement Classes
Defined in `<CGAL/boost/graph/graph_traits_Arrangement_2.h>`
We provide partial specialization for the class `Arrangement_2`
We provide partial specialization for the class `CGAL::Arrangement_2`
so that it is model of the graph concepts
<A HREF="http://www.boost.org/libs/graph/doc/BidirectionalGraph.html">`BidirectionalGraph`</A> and
<A HREF="http://www.boost.org/libs/graph/doc/VertexAndEdgeListGraph.html">`VertexAndEdgeListGraph`</A>.
The const specialization, `boost::graph_traits< CGAL::Arrangement_2<Traits,Dcel> const>`
The const specialization, `boost::graph_traits< CGAL::Arrangement_2<Traits, Dcel> const>`
is also defined, using the constant handles in the arrangement.
The traits class `boost::graph_traits< CGAL::Arrangement_2<T, DC> >`
The traits class `boost::graph_traits< CGAL::Arrangement_2<T, Dcel> >`
provides the following types:
| Member | Value | Description |
| :----------------------- | :----: | :---------- |
| `vertex_descriptor` | `Arrangement_2::Vertex_handle` | The vertex descriptor |
| `edge_descriptor` | `Arrangement_2::Halfedge_handle` | The edge descriptor |
| `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| |
| `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` | |
| `edge_parallel_category` | `boost::disallow_parallel_edge_tag` | Indicates that this graph does support multiedges |
| `traversal_category` | `boost::bidirectional_graph_tag` | Indicates that this graph is bidirectional |
| `vertices_size_type` | `Arrangement_2::size_type` | The size type of the vertex list |
| `edges_size_type` | `Arrangement_2::size_type` | The size type of the edge list |
| `degree_size_type` | `Arrangement_2::size_type` | The size type of the adjacency list |
| `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. |
| `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. |
\section BGLOMPAK Specialization for the OpenMesh::PolyMesh_ArrayKernelT Class
Defined in `<CGAL/boost/graph/graph_traits_PolyMesh_ArrayKernelT.h>`
We provide partial specialization for the class `OpenMesh::PolyMesh_ArrayKernelT` so that it is a model
of the graph concepts
<A HREF="http://www.boost.org/libs/graph/doc/BidirectionalGraph.html">`BidirectionalGraph`</A> and
<A HREF="http://www.boost.org/libs/graph/doc/VertexAndEdgeListGraph.html">`VertexAndEdgeListGraph`</A>
and of the concept `MutableFaceGraph`.
The traits class `boost::graph_traits<OpenMesh::PolyMesh_ArrayKernelT<K> >` provides the following types:
| Member | Value | Description |
| :----------------------- | :----: | :---------- |
| `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`. |
| `out_edge_iterator` | `CGAL::Out_edge_iterator<OpenMesh::PolyMesh_ArrayKernelT<K> >` | 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<OpenMesh::PolyMesh_ArrayKernelT<K> >` | 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`. |
| `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`. |
| `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. |
| `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. |
\section BGLOMTMAK Specialization for the OpenMesh::TriMesh_ArrayKernelT Class
Defined in `<CGAL/boost/graph/graph_traits_TriMesh_ArrayKernelT.h>`
We provide partial specialization for the class `OpenMesh::TriMesh_ArrayKernelT` so that it is a model
of the graph concepts
<A HREF="http://www.boost.org/libs/graph/doc/BidirectionalGraph.html">`BidirectionalGraph`</A> and
<A HREF="http://www.boost.org/libs/graph/doc/VertexAndEdgeListGraph.html">`VertexAndEdgeListGraph`</A>
and of the concept `MutableFaceGraph`.
The traits class `boost::graph_traits<OpenMesh::TriMesh_ArrayKernelT<K> >` provides the following types:
| Member | Value | Description |
| :----------------------- | :----: | :---------- |
| `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`. |
| `out_edge_iterator` | `CGAL::Out_edge_iterator<OpenMesh::TriMesh_ArrayKernelT<K> >` | 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<OpenMesh::TriMesh_ArrayKernelT<K> >` | 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`. |
| `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`. |
| `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. |
| `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. |
*/

View File

@ -39,6 +39,7 @@
namespace CGAL {
#ifndef DOXYGEN_RUNNING
template <typename HD>
struct Seam_mesh_halfedge_descriptor
{
@ -91,24 +92,22 @@ struct Seam_mesh_halfedge_descriptor
return 2 * hash_value(hd.tmhd) + static_cast<std::size_t>(hd.seam);
}
};
#endif
/*!
\ingroup PkgBGLHelper
An adaptor for a triangle mesh which turns some marked edges into
boundary edges when exploring the seam mesh with the generic BGL style
functions.
\cgalModels `FaceGraph`
\tparam TM a model of `FaceGraph`
\tparam SEM a model of `ReadablePropertyMap` with `boost::graph_traits<TM>::%edge_descriptor` as key type and `bool` as value type.
\tparam SVM a model of `ReadablePropertyMap` with `boost::graph_traits<TM>::%vertex_descriptor` as key type and `bool` as value type.
\sa \link BGLSeam_meshGT `boost::graph_traits<Seam_mesh<TM> >` \endlink
*/
/// \ingroup PkgBGLHelper
///
/// This class is a data structure that takes a triangle mesh, further refered
/// to as `underlying mesh` and turns some marked edges of that mesh into
/// virtual boundary edges.
///
/// \cgalModels `FaceGraph`
///
/// \tparam TM a model of `FaceGraph`
/// \tparam SEM a model of `ReadablePropertyMap` with `boost::graph_traits<TM>::%edge_descriptor` as key type and `bool` as value type.
/// \tparam SVM a model of `ReadablePropertyMap` with `boost::graph_traits<TM>::%vertex_descriptor` as key type and `bool` as value type.
///
/// \sa \link BGLSeam_meshGT `boost::graph_traits<Seam_mesh<TM> >` \endlink
///
template <class TM, class SEM, class SVM>
class Seam_mesh
{
@ -125,13 +124,11 @@ class Seam_mesh
typedef boost::associative_property_map<Seam_vertex_uhm> Seam_vertex_pmap;
public:
/// @cond CGAL_DOCUMENT_INTERNALS
typedef typename boost::graph_traits<TM>::degree_size_type degree_size_type;
typedef typename boost::graph_traits<TM>::vertices_size_type vertices_size_type;
typedef typename boost::graph_traits<TM>::edges_size_type edges_size_type;
typedef typename boost::graph_traits<TM>::halfedges_size_type halfedges_size_type;
typedef typename boost::graph_traits<TM>::faces_size_type faces_size_type;
/// @endcond
typedef typename boost::graph_traits<TM>::degree_size_type degree_size_type;
typedef typename boost::graph_traits<TM>::vertices_size_type vertices_size_type;
typedef typename boost::graph_traits<TM>::edges_size_type edges_size_type;
typedef typename boost::graph_traits<TM>::halfedges_size_type halfedges_size_type;
typedef typename boost::graph_traits<TM>::faces_size_type faces_size_type;
private:
const TM& tm;
@ -145,19 +142,47 @@ private:
mutable vertices_size_type number_of_vertices;
public:
/// Return the underlying mesh.
/// returns the underlying mesh.
const TM& mesh() const
{
return tm;
}
/// @cond CGAL_DOCUMENT_INTERNALS
#ifdef DOXYGEN_RUNNING
/// This class represents a halfedge of the seam mesh.
///
/// It is composed of a halfedge of the mesh and a boolean to indicate whether
/// this halfedge is on the virtual border or not.
///
/// \cgalModels `descriptor`
/// \cgalModels `LessThanComparable`
/// \cgalModels `Hashable`
///
class halfedge_descriptor
{
public:
TM_halfedge_descriptor tmhd;
bool seam;
/// A halfedge
// descriptor
/// %Default constructor
halfedge_descriptor() : tmhd(), seam(false) { }
halfedge_descriptor(TM_halfedge_descriptor tmhd, bool seam = false)
: tmhd(tmhd), seam(seam)
{ }
/// Print the halfedge and if it is on a seam.
friend std::ostream& operator<<(std::ostream& os, const halfedge_descriptor& hd)
{
os << hd.tmhd << ((hd.seam)?" on seam":"");
return os;
}
};
#else
typedef Seam_mesh_halfedge_descriptor<TM_halfedge_descriptor> halfedge_descriptor;
#endif
// iterator
#ifndef DOXYGEN_RUNNING
struct halfedge_iterator
: public boost::iterator_facade<halfedge_iterator,
halfedge_descriptor,
@ -212,13 +237,23 @@ public:
return halfedge_descriptor(*hd, seam);
}
};
#endif
/// A vertex
// descriptor
/// This class represents a vertex of the seam mesh.
///
/// Implementation note: to properly duplicate vertices that are on seams,
/// a vertex_descriptor is in fact represented as an halfedge of the underlying
/// mesh.
///
/// \cgalModels `descriptor`
/// \cgalModels `LessThanComparable`
/// \cgalModels `Hashable`
///
struct vertex_descriptor
{
halfedge_descriptor hd;
/// %Default constructor
vertex_descriptor() { }
vertex_descriptor(const halfedge_descriptor& h)
@ -262,6 +297,7 @@ public:
};
// iterator
#ifndef DOXYGEN_RUNNING
class vertex_iterator
: public boost::iterator_facade<vertex_iterator,
vertex_descriptor,
@ -354,9 +390,12 @@ public:
return vertex_descriptor(*hd);
}
};
#endif
/// An edge
// descriptor
/// This class represents an edge of the seam mesh.
///
/// \cgalModels `descriptor`
///
struct edge_descriptor
{
halfedge_descriptor hd;
@ -373,6 +412,7 @@ public:
{ }
};
#ifndef DOXYGEN_RUNNING
// iterator
struct edge_iterator
: public boost::iterator_facade<edge_iterator,
@ -452,25 +492,35 @@ public:
return edge_descriptor(halfedge_descriptor(*hd, false));
}
};
#endif
/// A face
// descriptor
/// This class represents a face of the seam mesh.
///
/// \cgalModels `descriptor`
///
typedef typename boost::graph_traits<TM>::face_descriptor face_descriptor;
// iterator
#ifndef DOXYGEN_RUNNING
typedef typename boost::graph_traits<TM>::face_iterator face_iterator;
#endif
public:
/// Seam-related functions
/// \name Seam-related functions
/// @{
/// returns `true` if the vertex is on the seam.
bool has_on_seam(TM_vertex_descriptor vd) const
{
return get(svm, vd);
}
/// returns `true` if the edge is on the seam.
bool has_on_seam(TM_edge_descriptor ed) const
{
return get(sem, ed);
}
/// returns `true` if the halfedge is on the seam.
bool has_on_seam(TM_halfedge_descriptor tmhd) const
{
return get(sem, CGAL::edge(tmhd, tm));
@ -482,21 +532,41 @@ public:
return has_on_seam(CGAL::edge(hd, tm));
}
/// Return the number of seam edges in the seam mesh.
edges_size_type number_of_seam_edges() const
{
return number_of_seams;
}
/// Set the number of seam edges.
void set_seam_edges_number(const edges_size_type sn) const
{
number_of_seams = sn;
}
/// @}
public:
/// Iterators
// vertices()
/// \name Range Types
///
///@{
/// @cond CGAL_BEGIN_END
/// Start iterator for vertices.
vertex_iterator vertices_begin() const
{
Iterator_range<TM_halfedge_iterator> ir = CGAL::halfedges(tm);
return vertex_iterator(ir, this);
}
/// End iterator for vertices.
vertex_iterator vertices_end() const
{
Iterator_range<TM_halfedge_iterator> ir = CGAL::halfedges(tm);
return vertex_iterator(ir.second, this);
}
/// @endcond
/// returns the iterator range of the vertices of the mesh.
Iterator_range<vertex_iterator> vertices() const
{
Iterator_range<TM_halfedge_iterator> ir = CGAL::halfedges(tm);
@ -505,19 +575,24 @@ public:
return make_range(beg, end);
}
// halfedges()
/// @cond CGAL_BEGIN_END
/// Start iterator for halfedges.
halfedge_iterator halfedges_begin() const
{
Iterator_range<TM_halfedge_iterator> ir = CGAL::halfedges(tm);
return halfedge_iterator(ir, this);
}
/// End iterator for halfedges.
halfedge_iterator halfedges_end() const
{
Iterator_range<TM_halfedge_iterator> ir = CGAL::halfedges(tm);
return halfedge_iterator(ir.second, this);
}
/// @endcond
/// returns the iterator range of the halfedges of the mesh.
Iterator_range<halfedge_iterator> halfedges() const
{
Iterator_range<TM_halfedge_iterator> ir = CGAL::halfedges(tm);
@ -526,19 +601,23 @@ public:
return make_range(beg, end);
}
// edges()
/// @cond CGAL_BEGIN_END
/// Start iterator for edges.
edge_iterator edges_begin() const
{
Iterator_range<TM_halfedge_iterator> ir = CGAL::halfedges(tm);
return edge_iterator(ir, this);
}
/// End iterator for edges.
edge_iterator edges_end() const
{
Iterator_range<TM_halfedge_iterator> ir = CGAL::halfedges(tm);
return edge_iterator(ir.second, this);
}
/// @endcond
/// returns the iterator range of the edges of the mesh.
Iterator_range<edge_iterator> edges() const
{
Iterator_range<TM_halfedge_iterator> ir = CGAL::halfedges(tm);
@ -547,24 +626,32 @@ public:
return make_range(beg, end);
}
// faces()
/// @cond CGAL_BEGIN_END
/// Start iterator for faces.
face_iterator faces_begin() const
{
return CGAL::faces(tm).begin();
}
/// End iterator for faces.
face_iterator faces_end() const
{
return CGAL::faces(tm).end();
}
/// @endcond
/// returns the iterator range of the faces of the mesh.
Iterator_range<face_iterator> faces() const
{
return CGAL::faces(tm);
}
///@}
public:
/// Numbering
/// \name Memory Management
/// @{
/// returns the number of vertices in the seam mesh.
vertices_size_type num_vertices() const
{
if(number_of_vertices == static_cast<vertices_size_type>(-1)) {
@ -574,22 +661,30 @@ public:
return number_of_vertices;
}
/// returns the number of halfedges in the seam mesh.
halfedges_size_type num_halfedges() const
{
return CGAL::num_halfedges(tm) + 2 * number_of_seams;
}
/// returns the number of edges in the seam mesh.
halfedges_size_type num_edges() const
{
return CGAL::num_edges(tm) + number_of_seams;
}
/// returns the number of faces in the seam mesh.
faces_size_type num_faces() const
{
return CGAL::num_faces(tm);
}
/// @}
public:
/// \name Degree Functions
/// @{
/// returns the number of incident halfedges of vertex `v`.
degree_size_type degree(vertex_descriptor v) const
{
degree_size_type count(0);
@ -604,25 +699,41 @@ public:
return count;
}
/// @}
public:
/// Descriptors
/// \name Switching between Halfedges and Edges
///@{
/// returns the edge that contains halfedge `h` as one of its two halfedges.
edge_descriptor edge(halfedge_descriptor h) const
{
return h;
}
/// returns the halfedge corresponding to the edge `e`.
halfedge_descriptor halfedge(edge_descriptor e) const
{
return e.hd;
}
/// @}
/// \name Low-Level Connectivity Convenience Functions
///@{
/// returns an incoming halfedge of vertex `v`.
/// If `v` is a seam vertex, this will be a halfedge that points to `v` and
/// whose opposite is a seam halfedge.
/// Otherwise, the rules of the underlying meshes are followed.
/// \invariant `target(halfedge(v)) == v`
halfedge_descriptor halfedge(vertex_descriptor v) const
{
TM_halfedge_descriptor h(v);
return halfedge_descriptor(h, false /*not on seam*/);
}
/// finds a halfedge between two vertices. Returns a default constructed
/// `halfedge_descriptor`, if `source` and `target` are not connected.
std::pair<halfedge_descriptor, bool> halfedge(vertex_descriptor u,
vertex_descriptor v) const
{
@ -662,18 +773,22 @@ public:
return std::make_pair(halfedge_descriptor(), false/*invalid*/);
}
/// finds an edge between two vertices. Returns a default constructed
/// `edge`, if `source` and `target` are not connected.
std::pair<edge_descriptor, bool> edge(vertex_descriptor u, vertex_descriptor v) const
{
std::pair<halfedge_descriptor, bool> he = halfedge(u, v);
return std::make_pair(he.first, he.second);
}
/// returns a halfedge of face `f`.
halfedge_descriptor halfedge(face_descriptor f) const
{
TM_halfedge_descriptor hd = CGAL::halfedge(f, tm);
return halfedge_descriptor(hd, false/*not on seam*/);
}
/// returns the face incident to halfedge `h`.
face_descriptor face(halfedge_descriptor h) const
{
if(h.seam)
@ -683,7 +798,7 @@ public:
}
public:
/// halfedge traveling
/// returns the next halfedge within the incident face.
halfedge_descriptor next(const halfedge_descriptor& hd) const
{
if((!hd.seam) && (!is_border(hd.tmhd, tm)))
@ -698,6 +813,7 @@ public:
!is_border(CGAL::opposite(*hatc, tm), tm));
}
/// returns the previous halfedge within the incident face.
halfedge_descriptor prev(const halfedge_descriptor& hd) const
{
if((!hd.seam) && (!is_border(hd.tmhd, tm)))
@ -712,6 +828,7 @@ public:
!is_border(CGAL::opposite(*hatc, tm), tm));
}
/// returns the opposite halfedge of `hd`.
halfedge_descriptor opposite(const halfedge_descriptor& hd) const
{
if(!hd.seam)
@ -720,6 +837,7 @@ public:
return halfedge_descriptor(CGAL::opposite(hd.tmhd, tm), false /*not on seam*/);
}
/// returns the vertex the halfedge `h` emanates from.
vertex_descriptor target(halfedge_descriptor hd) const
{
TM_halfedge_descriptor tmhd(hd);
@ -739,6 +857,7 @@ public:
return vertex_descriptor(halfedge_descriptor(tmhd));
}
/// returns the vertex the halfedge `h` emanates from.
vertex_descriptor source(const halfedge_descriptor& hd) const
{
return target(opposite(hd));
@ -754,29 +873,18 @@ public:
return target(e.hd);
}
/// @endcond
/// @}
/// Return the number of seam edges in the seam mesh.
edges_size_type number_of_seam_edges() const
{
return number_of_seams;
}
/// Set the number of seam edges.
void set_seam_edges_number(const edges_size_type sn) const
{
number_of_seams = sn;
}
/// Add seams to the property maps of the seam mesh.
/// Add the seams to the property maps of the seam mesh.
///
/// In input, a seam edge is described by the pair of integers that correspond
/// to the indices of the extremeties (vertices) of the edge that one wishes
/// to mark as seam edge.
/// to the indices of the extremeties (vertices) of the edge that should be
/// marked as seam edge.
///
/// @pre filename should be the name of a CGAL selection file: seam edges
/// are given as pairs of integers, on the third line of the file
/// @pre A seam edge must be an edge of the graph
/// are given as pairs of integers, on the third line of the file.
/// @pre A seam edge must be an edge of the graph that is not on the boundary
/// of the mesh.
TM_halfedge_descriptor add_seams(const char* filename)
{
TM_halfedge_descriptor tmhd;
@ -856,7 +964,7 @@ public:
: tm(tm),
sem(sem), svm(svm),
number_of_seams(0), number_of_vertices(-1)
{ }
{ }
};
} // namespace CGAL

View File

@ -230,6 +230,12 @@ namespace Polygon_mesh_processing {
}
/// Count the number of borders in the mesh.
///
/// @tparam PolygonMesh model of `HalfedgeGraph`.
///
/// @param pmesh the polygon mesh to which `faces` belong
///
template<typename PolygonMesh>
unsigned int number_of_borders(const PolygonMesh& pmesh)
{

View File

@ -89,17 +89,11 @@ The package performs the next checks:
- the border is mapped onto a convex polygon.
- the input mesh is triangular.
- the input mesh is a surface with one connected component.
- Postconditions:
- one-to-one mapping.
- For <i>free</i> border parameterizations:
- Preconditions:
- the input mesh is triangular.
- the input mesh is a surface with one connected component.
- Postconditions:
- one-to-one mapping.
*/
/// \defgroup PkgSurfaceParameterizationMainFunction Main Function
@ -146,11 +140,5 @@ This package implements all common border parameterization methods:
vertices).
*/
*/

View File

@ -1,7 +1,7 @@
namespace CGAL {
/*!
\mainpage User Manual
\mainpage User Manual
\anchor Chapter_Planar_Parameterization_of_Triangulated_Surface_Meshes
\anchor chapsurface_mesh_parameterization
@ -26,7 +26,7 @@ transparency, reflection or light modulation maps), fitting scattered
data, re-parameterizing spline surfaces, repairing CAD models,
approximating surfaces and remeshing.
This \cgal package implements
This \cgal package implements
surface parameterization methods, such as least squares conformal maps,
discrete conformal map, discrete authalic
parameterization, Floater mean value coordinates or Tutte barycentric
@ -41,7 +41,7 @@ classes of OpenMesh.
Since parameterizing meshes requires an efficient representation of sparse
matrices and efficient iterative or direct linear solvers, we provide
a unified interface to linear solvers as described in Chapter
a unified interface to linear solvers as described in Chapter
\ref PkgSolverSummary.
Note that linear solvers commonly use double precision floating point
@ -67,10 +67,10 @@ parameterize(TriangleMesh & mesh,
\endcode
The function `parameterize()` applies a default surface parameterization
method, namely Floater Mean Value Coordinates \cgalCite{cgal:f-mvc-03},
method, namely Floater Mean Value Coordinates \cgalCite{cgal:f-mvc-03},
to the connected component of the mesh of type `TriangleMesh` with the border given by the halfedge `bhd`.
This border is parameterized with an arc-length circular border parameterization.
The sparse linear solver of the \ref thirdpartyEigen library is used.
This border is parameterized with an arc-length circular border parameterization.
The sparse linear solver of the \ref thirdpartyEigen library is used.
The mesh of type `TriangleMesh` must be a model of the concept
`FaceGraph` and must additionally be triangulated, 2-manifold, oriented,
@ -117,7 +117,7 @@ using the `Surface_mesh` built-in property mechanism.
\cgalExample{Surface_mesh_parameterization/discrete_authalic.cpp}
\section secSurfaceParameterizationMethods Surface Parameterization Methods
\section secSurfaceParameterizationMethods Surface Parameterization Methods
This \cgal package implements surface parameterization methods, such
as Least Squares Conformal Maps, Discrete Conformal Map, Discrete
@ -134,7 +134,7 @@ Such border parameterizations are described in Section
\subsubsection Surface_mesh_parameterizationTutteBarycentric Tutte Barycentric Mapping
`Barycentric_mapping_parameterizer_3<TriangleMesh, BorderParameterizer_3, SparseLinearAlgebraTraits_d>`
`Barycentric_mapping_parameterizer_3<TriangleMesh, BorderParameterizer_3, SparseLinearAlgebraTraits_d>`
The Barycentric Mapping parameterization method has been introduced by
Tutte \cgalCite{t-hdg-63}. In parameter space, each vertex is
@ -155,7 +155,7 @@ Left: Tutte barycentric mapping parameterization (the red line depicts the cut g
\subsubsection Surface_mesh_parameterizationDiscreteConformal Discrete Conformal Map
`Discrete_conformal_map_parameterizer_3<TriangleMesh, BorderParameterizer_3, SparseLinearAlgebraTraits_d>`
`Discrete_conformal_map_parameterizer_3<TriangleMesh, BorderParameterizer_3, SparseLinearAlgebraTraits_d>`
Discrete conformal map parameterization has been introduced to the graphics community
by Eck et al. \cgalCite{cgal:eddhls-maam-95}. It attempts to
@ -177,7 +177,7 @@ Left: discrete conformal map. Right: parameter space.
\subsubsection Surface_mesh_parameterizationFloaterMean Floater Mean Value Coordinates
`Mean_value_coordinates_parameterizer_3<TriangleMesh, BorderParameterizer_3, SparseLinearAlgebraTraits_d>`
`Mean_value_coordinates_parameterizer_3<TriangleMesh, BorderParameterizer_3, SparseLinearAlgebraTraits_d>`
The mean value coordinates parameterization method has been introduced
by Floater \cgalCite{cgal:f-mvc-03}. Each vertex in parameter space is
@ -195,7 +195,7 @@ Floater Mean Value Coordinates
\subsubsection Surface_mesh_parameterizationDiscreteAuthalic Discrete Authalic Parameterization
`Discrete_authalic_parameterizer_3<TriangleMesh, BorderParameterizer_3, SparseLinearAlgebraTraits_d>`
`Discrete_authalic_parameterizer_3<TriangleMesh, BorderParameterizer_3, SparseLinearAlgebraTraits_d>`
The discrete authalic parameterization method has been introduced by
Desbrun et al. \cgalCite{cgal:dma-ipsm-02}. It corresponds to
@ -210,7 +210,7 @@ for both systems) is asymmetric.
Discrete Authalic Parameterization
\cgalFigureEnd
\subsection secBorderParameterizationsforFixedMethods Border Parameterizations for Fixed Methods
\subsection secBorderParameterizationsforFixedMethods Border Parameterizations for Fixed Methods
Parameterization methods for
borders are used as traits classes modifying the behavior of
@ -244,16 +244,19 @@ Left: Julius Cesar mask parameterization with Authalic/circular border. Right: J
All combinations of uniform/arc-length and circle/square are provided by
the following classes:
`Circular_border_arc_length_parameterizer_3<TriangleMesh>`
`Circular_border_uniform_parameterizer_3<TriangleMesh>`
`Square_border_arc_length_parameterizer_3<TriangleMesh>`
`Square_border_uniform_parameterizer_3<TriangleMesh>`
<UL>
<LI>`Circular_border_arc_length_parameterizer_3<TriangleMesh>`
<LI>`Circular_border_uniform_parameterizer_3<TriangleMesh>`
<LI>`Square_border_arc_length_parameterizer_3<TriangleMesh>`
<LI>`Square_border_uniform_parameterizer_3<TriangleMesh>`
</UL>
\subsection Surface_mesh_parameterizationFreeBorderSurface Free Border Surface Parameterizations
\subsubsection Surface_mesh_parameterizationLeastSquares Least Squares Conformal Maps
`LSCM_parameterizer_3<TriangleMesh, BorderParameterizer_3, SparseLinearAlgebraTraits_d>`
`LSCM_parameterizer_3<TriangleMesh, BorderParameterizer_3, SparseLinearAlgebraTraits_d>`
The Least Squares Conformal Maps (LSCM) parameterization method has
been introduced by L&eacute;vy et al. \cgalCite{cgal:lprm-lscm-02}.
@ -268,7 +271,7 @@ which implies solving a symmetric matrix.
Least squares conformal maps.
\cgalFigureEnd
\subsection secBorderParameterizationsforFreeMethods Border Parameterizations for Free Methods
\subsection secBorderParameterizationsforFreeMethods Border Parameterizations for Free Methods
Parameterization methods for
borders are used as traits classes modifying the behavior of
@ -278,7 +281,7 @@ parameterization methods define only two constraints: the pinned vertices.
<UL>
<LI>`Two_vertices_parameterizer_3<TriangleMesh>`
<LI>`Two_vertices_parameterizer_3<TriangleMesh>`
<I>Usage:</I> `Two_vertices_parameterizer_3<TriangleMesh>` is the default
free border parameterization, and is the only one available
@ -286,7 +289,7 @@ in the current version of this package.
</UL>
\section secCuttingaMesh Cutting a Mesh
\section secCuttingaMesh Cutting a Mesh
\subsection Surface_mesh_parameterizationComputingaCut Computing a Cut Graph
@ -372,6 +375,6 @@ a `FaceGraph`, and it replaces a wrapper which had a more complicated API.
*/
*/
} /* namespace CGAL */