diff --git a/.gitattributes b/.gitattributes index 026477051e3..650ab62826e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -362,7 +362,16 @@ Arrangement_of_spheres_3/test/Arrangement_of_spheres_3/data/simple.spheres -text Arrangement_of_spheres_3/test/Arrangement_of_spheres_3/data/two.spheres -text svneol=unset#application/octet-stream Arrangement_of_spheres_3/test/Arrangement_of_spheres_3/the_plan -text BGL/doc_tex/BGL.tex -text -BGL/doc_tex/BGL_ref/ConnectedPlanarGeometricGraph.tex -text +BGL/doc_tex/BGL/BGL.tex -text +BGL/doc_tex/BGL/PkgDescription.tex -text +BGL/doc_tex/BGL/main.tex -text +BGL/doc_tex/BGL_ref/ConnectedPlanarDirectedGeometricGraph.tex -text +BGL/doc_tex/BGL_ref/HalfedgeGraph.tex -text +BGL/doc_tex/BGL_ref/Polyhedron_geometric_graph_traits.tex -text +BGL/doc_tex/BGL_ref/Polyhedron_graph_traits.tex -text +BGL/doc_tex/BGL_ref/Polyhedron_graph_traits_const.tex -text +BGL/doc_tex/BGL_ref/Polyhedron_halfedge_graph_traits.tex -text +BGL/doc_tex/BGL_ref/Polyhedron_halfedge_graph_traits_const.tex -text BGL/doc_tex/BGL_ref/intro.tex -text BGL/doc_tex/BGL_ref/main.tex -text BGL/include/CGAL/boost/graph/HalfedgeDS_BGL_aux.h -text diff --git a/BGL/doc_tex/BGL.tex b/BGL/doc_tex/BGL.tex index cd4e0e31cbf..ec706836c99 100644 --- a/BGL/doc_tex/BGL.tex +++ b/BGL/doc_tex/BGL.tex @@ -6,7 +6,7 @@ \documentclass{book} \usepackage{Manual/cgal_manual} -\gdef\lciManualTitle{Boost Graph Library (\ccc{BGL}) interface to \cgal\} +\gdef\lciManualTitle{Boost Graph Library (BGL) interface to CGAL.} \makeindex @@ -15,7 +15,7 @@ \begin{document} -\cgaltitlepage{Boost Graph Library (\ccc{BGL}) interface to \cgal\} +\cgaltitlepage{Boost Graph Library (BGL) interface to CGAL. } \cleardoublepage \pagenumbering{roman} @@ -27,7 +27,7 @@ \setcounter{page}{1} \cgalchapters{ - %\entryleftright{\part{User Manual}}{\part{Reference Manual}} + \entryleftright{\part{User Manual}}{\part{Reference Manual}} \lcTex{\entryright{\listofrefpages}} \packageleftright{BGL}{BGL_ref} } diff --git a/BGL/doc_tex/BGL/BGL.tex b/BGL/doc_tex/BGL/BGL.tex new file mode 100644 index 00000000000..3f38ae17bc4 --- /dev/null +++ b/BGL/doc_tex/BGL/BGL.tex @@ -0,0 +1,26 @@ +%% Copyright (c) 2004 SciSoft. All rights reserved. +%% +%% This file is part of CGAL (www.cgal.org); you may redistribute it under +%% the terms of the Q Public License version 1.0. +%% See the file LICENSE.QPL distributed with CGAL. +%% +%% Licensees holding a valid commercial license may use this file in +%% accordance with the commercial license agreement provided with the software. +%% +%% This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +%% WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +%% +%% +%% +%% Author(s) : Fernando Cacciola + +\section{Introduction} + +This \cgal\ package provides a framework for interfacing \cgal\ data structures as \ccc{BGL} (Boost Graph Library) graphs. + +% +------------------------------------------------------------------------+ +%%RefPage: end of main body, begin of sfsooter +% EOF +% +------------------------------------------------------------------------+ + + diff --git a/BGL/doc_tex/BGL/PkgDescription.tex b/BGL/doc_tex/BGL/PkgDescription.tex new file mode 100644 index 00000000000..0d98d1ec0b7 --- /dev/null +++ b/BGL/doc_tex/BGL/PkgDescription.tex @@ -0,0 +1,7 @@ + +\begin{ccPkgDescription}{Boost Graph Library (BGL) interface to CGAL \label{Pkg:BGL}} +\ccPkgHowToCiteCgal{cgal:c-sspo2-06} +\ccPkgSummary{This package provides a framework for interfacing \cgal\ data structures as BGL graphs} +\ccPkgIntroducedInCGAL{3.3} +\ccPkgLicense{\ccLicenseQPL} +\end{ccPkgDescription} diff --git a/BGL/doc_tex/BGL/main.tex b/BGL/doc_tex/BGL/main.tex new file mode 100644 index 00000000000..f3ac3d38bb0 --- /dev/null +++ b/BGL/doc_tex/BGL/main.tex @@ -0,0 +1,18 @@ +% +------------------------------------------------------------------------+ +% | CBP Reference Manual: main.tex +% +------------------------------------------------------------------------+ +% | Automatically generated driver file for the reference manual chapter +% | of this package. Do not edit manually, you may loose your changes. +% +------------------------------------------------------------------------+ +% alfabatisch +\ccUserChapter{Boost Graph Library (BGL) interface to CGAL \label{chapter-BGL}} + +\ccChapterAuthor{Fernando Cacciola} + +%\input{Surface_mesh_simplification/PkgDescription.tex} + +\minitoc + +\input{BGL/BGL.tex} + +%% EOF diff --git a/BGL/doc_tex/BGL_ref/ConnectedPlanarDirectedGeometricGraph.tex b/BGL/doc_tex/BGL_ref/ConnectedPlanarDirectedGeometricGraph.tex new file mode 100644 index 00000000000..6158d751a6d --- /dev/null +++ b/BGL/doc_tex/BGL_ref/ConnectedPlanarDirectedGeometricGraph.tex @@ -0,0 +1,116 @@ +%% Copyright (c) 2004 SciSoft. All rights reserved. +%% +%% This file is part of CGAL (www.cgal.org); you may redistribute it under +%% the terms of the Q Public License version 1.0. +%% See the file LICENSE.QPL distributed with CGAL. +%% +%% Licensees holding a valid commercial license may use this file in +%% accordance with the commercial license agreement provided with the software. +%% +%% This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +%% WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +%% +%% +%% +%% Author(s) : Fernando Cacciola + +\begin{ccRefConcept}{ConnectedPlanarDirectedGeometricGraph} + +%% \ccHtmlCrossLink{} %% add further rules for cross referencing links +%% \ccHtmlIndexC[concept]{} %% add further index entries + +\ccDefinition + +The concept \ccRefName\ describes the requirements and constrians of a \ccc{Boost Graph} commonly found in geometric data structures. + +\ccHeading{Requirements} + +\begin{description} +\item[Connected] +Any vertex is connected to any other vertex via some path (a sequence of adjacent vertices). +The graph must be at least {\em 2-connected}. That is, it cannot have any {\em terminal} vertex (incident upon just 1 edge). + +\item[Planar] +The graph \textit{can} be drawn without crossing edges \textit{and} the straight line segments implicitely connecting the vertices do not intersect except at the vertices. + +\item[Directed] +All edges are {\em ordered} pair of vertices. + +\item[Geometric] +The vertices embeed geometric points (in any geometric dimension) and its edges are {\em implicitely assumed} to be straight line segments (even if a concrete model embeeds a different type of curve). + +\end{description} + +Additionally, the vertices and edges of this graph are required to have a distinguishible \ccc{null} state such that any default constructed vertex or edge is formally \ccc{null}. + +\ccRefines +\ccc{BidirectionalGraph} +\ccc{AdjacencyGraph} +\ccc{EdgeAndVertexListGraph} + +\ccTypes + \ccNestedType{Point}{The Point type of the vertex, in whatever dimension}{} + +\ccOperations + +Following the BGL interface, the following graph operations are defined as free rather than member functions. + + \ccFunction + {template + typename boost::graph_traits::edge_descriptor + opposite_edge(typename boost::graph_traits::edge_descriptor e, Graph const& g ); + } + {Given the edge \ccc{e: s->t}, returns the edge with opposite direction: \ccc{t->s}. + If the resulting edge does not belong to \ccc{g} the result is a \ccc{null} (default constructed) edge.\\ + [non-const version ommited] + } + + \ccFunction + {template + typename boost::graph_traits::edge_descriptor + next_edge_ccw(typename boost::graph_traits::edge_descriptor e, Graph const& g ); + } + {Given the edge \ccc{e} with source vertex \ccc{s}, returns the first edge with the same source vertex which + is found in a Counter-clockwise rotation around \ccc{s}. + Since a \ccRefName\ is required to be {\em 2-connected}, the result is always different from \ccc{e}. + } + + \ccFunction + {template + typename boost::graph_traits::edge_descriptor + next_edge_cw(typename boost::graph_traits::edge_descriptor e, Graph const& g ); + } + {Given the edge \ccc{e} with source vertex \ccc{s}, returns the first edge with the same source vertex which + is found in a Clockwise rotation around \ccc{s}. + Since a \ccRefName\ is required to be at least {\em 2-connected}, the result is always different from \ccc{e}. + } + + \ccFunction + {template + typename CGAL::geometric_graph_traits::Point const& + get_point(typename boost::graph_traits::vertex_descriptor v, Graph const& g ); + } + {Returns the point of the vertex \ccc{v} belonging to the graph \ccc{g}\\ + [non-const version ommited]. + } + + \ccFunction + {template + void set_point(typename boost::graph_traits::vertex_descriptor v + ,Graph& g + ,typename CGAL::geometric_graph_traits::Point p + ); + } + {Sets \ccc{p} as the point of the vertex \ccc{v} belonging to the graph \ccc{g}.} + +\ccHasModels +\ccRefIdfierPage{boost::graph_traits< CGAL::Polyhedron_3 const > }\\ +\ccRefIdfierPage{boost::graph_traits< CGAL::Polyhedron_3 > }\\ +\ccRefIdfierPage{CGAL::geometric_graph_traits< CGAL::Polyhedron_3 > }\\ + +\end{ccRefConcept} + +% +------------------------------------------------------------------------+ +%%RefPage: end of main body, begin of footer +% EOF +% +------------------------------------------------------------------------+ diff --git a/BGL/doc_tex/BGL_ref/ConnectedPlanarGeometricGraph.tex b/BGL/doc_tex/BGL_ref/ConnectedPlanarGeometricGraph.tex deleted file mode 100644 index 483e8f65728..00000000000 --- a/BGL/doc_tex/BGL_ref/ConnectedPlanarGeometricGraph.tex +++ /dev/null @@ -1,60 +0,0 @@ -%% Copyright (c) 2004 SciSoft. All rights reserved. -%% -%% This file is part of CGAL (www.cgal.org); you may redistribute it under -%% the terms of the Q Public License version 1.0. -%% See the file LICENSE.QPL distributed with CGAL. -%% -%% Licensees holding a valid commercial license may use this file in -%% accordance with the commercial license agreement provided with the software. -%% -%% This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -%% WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -%% -%% -%% -%% Author(s) : Fernando Cacciola - -\begin{ccRefConcept}{ConnectedPlanarGeometricGraph} - -%% \ccHtmlCrossLink{} %% add further rules for cross referencing links -%% \ccHtmlIndexC[concept]{} %% add further index entries - -\ccDefinition - -The concept \ccRefName\ describes the requirements and constrians of a \ccc{Boost Graph} commonly found in geometric data structures. - -This graph is {\em Geometric} meaning that its vertices embeed geometric points (in any geometric dimension) and its edges are {\em implicitely assumed} to be straight line segments (even if a concrete model embeeds a different type of curve). - -This graph is {\em Planar} meaning that it \textit{can} be drawn without crossing edges. The planarity requirement is only topological: there is no requirement that the straight line segments implicitely connecting the vertices do not intersect. - -The graph is {\em Connected} meaning that any vertex is connected to any other vertex via some path (a sequence of adjacent vertices). - -\ccRefines -\ccc{BidirectionalGraph} -\ccc{AdjacencyGraph} -\ccc{EdgeAndVertexListGraph} - -\ccTypes - \ccNestedType{TSM}{The type of the surface to simplify}{} -\ccGlue - \ccTypedef{typename Surface_geometric_traits::FT FT ;}{The FieldType that represents the collapse cost} -\ccGlue - \ccTypedef{typename Surface_geometric_traits::Point Point ;}{The Point type of the surface vertex} - -\ccCreation -\ccCreationVariable{g} %% choose variable name - -\ccOperations - \ccMethod{boost::get(boost::vertex_point_t(),g,voptional cost() const;}{The cached cost.} -\ccGlue - \ccMethod{boost::optional placement() const;}{The cached placement.} - -\ccHasModels -\ccRefIdfierPage{CGAL::Triangulated_surface_mesh::Simplification::Edge_collapse::Full_collapse_data}. - -\end{ccRefConcept} - -% +------------------------------------------------------------------------+ -%%RefPage: end of main body, begin of footer -% EOF -% +------------------------------------------------------------------------+ diff --git a/BGL/doc_tex/BGL_ref/HalfedgeGraph.tex b/BGL/doc_tex/BGL_ref/HalfedgeGraph.tex new file mode 100644 index 00000000000..8dfffc98b07 --- /dev/null +++ b/BGL/doc_tex/BGL_ref/HalfedgeGraph.tex @@ -0,0 +1,90 @@ +%% Copyright (c) 2004 SciSoft. All rights reserved. +%% +%% This file is part of CGAL (www.cgal.org); you may redistribute it under +%% the terms of the Q Public License version 1.0. +%% See the file LICENSE.QPL distributed with CGAL. +%% +%% Licensees holding a valid commercial license may use this file in +%% accordance with the commercial license agreement provided with the software. +%% +%% This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +%% WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +%% +%% +%% +%% Author(s) : Fernando Cacciola + +\begin{ccRefConcept}{HalfedgeGraph} + +%% \ccHtmlCrossLink{} %% add further rules for cross referencing links +%% \ccHtmlIndexC[concept]{} %% add further index entries + +\ccDefinition + +The concept \ccRefName\ describes the requirements and constrians of a \ccc{Boost Graph} representing a subset of a \ccc{HalfedgeDS}. + +This is a \ccc{ConnectedPlanarDirectedGeometricGraph} with the added requirement that for each directed edge \ccc{s->t} it's opposite edge \ccc{t->s} is part of the graph, that is, the directed edges are neccesarily symmetric. Furthermore, becasue the symmetry is mandatory, there is the added concept of an {\em undirected} edge which corresponds to both symmetric edges as a whole. + +The graph is strictly {\em 4-connected}, that is, each vertex has exactly 4 incident edges. Furthermore, it is strictly {\em 2-connected} in each direction, that is, each vertex has 2 {\em incoming} and 2 {\em outgoing} edges, and each incoming edge is followed by one outgoing edge.\\ +For every vertex \ccc{b} there are exactly 4 incident edges: \ccc{a->b}, \ccc{b->a}, \ccc{b->c} and \ccc{c->b} with \ccc{c!=a}. Edge \ccc{b->c} is called the {\em successor} of edge \ccc{a->b}, while edge \ccc{a->b} is called the {\em predeccesor} of edge \ccc{b->c}. Each and every edge is required to have a successor and a predecessor, hence the graph must have at least 3 vertices and 6 edges. + +For each pair of {\em symmetric directed edges} \ccc{s->t} and \ccc{t->s}, there is a correspoding {\em undirected} edge \ccc{s-t}. Therefore, the number of undirected edges is exactly half the number of directed edges. + +{\em Symmetric directed edges} are NOT called \ccc{halfedges} (as in a \ccc{HalfedgeDS}) because from the point of view of this graph, being a refinement of a BGL graph, each symmetric directed edge is a {\em whole} edge in itself. In other words, the unqualified term edge refers to one and only one symmetric directed edge and not both. The pair of opposing edges, seen as a unity, is an {\em undirected edge}. Such an undirected edge refers to the pair of opposing edges and this concept does not require the existence of a texplicit ype representing that. In other words, there is only one type of edge, hence only one \ccc{edge\_descriptor}, which refers to the directed edge. An undirected edge is implicitely addressed by an edge\_descriptor. There is no requirement about which of the directed edges of the pair must be used to refer to an undirected edge. + +All edges are {\em cyclically connected} and each cycle implicitely corresponds to a \ccc{facet} (or \ccc{face} or \ccc{cell}) of the underlying data structure (with the exception of the cycle(s) corresponding to the border(s) of the underlying DS, which might not have an associated facet). + + +\ccRefines +\ccc{ConnectedPlanarDirectedGeometricGraph} + +\ccTypes + \ccNestedType{undirected_edge_iterator}{An iterator that iterates over one and only one of the directed edges + in each opposing pair. This iterator accesses a directed edge (as represented by an \ccc{edge_descriptor}) + and not an undirected edge since there is no such kind of edge explicitely}{} + +\ccOperations + +Following the BGL interface, the following graph operations are defined as free rather than member functions. + + \ccFunction + {template + typename boost::graph_traits::edge_descriptor + next_edge(typename boost::graph_traits::edge_descriptor e, Graph const& g ); + } + {Returns the {\em successor} of \ccc{e}. + That is, given the edge \ccc{a->b} returns \ccc{b->c} such that \ccc{c != a}.\\ + [non-const version ommited] + } + + \ccFunction + {template + typename boost::graph_traits::edge_descriptor + prev_edge(typename boost::graph_traits::edge_descriptor e, Graph const& g ); + } + {Returns the {\em predecessor} of \ccc{e}. + That is, given the edge \ccc{b->c} returns \ccc{a->b} such that \ccc{c != a}\\ + [non-const version ommited] + } + + \ccFunction + {template + std::pair < typename boost::halfedge_graph_traits::edge_descriptor + ,typename boost::halfedge_graph_traits::edge_descriptor + > + undirected_edges(Graph const& g ); + } + {Returns a pair of iterators representing the range [begin,end) of undirected edges in this graph. + [non-const version ommited] + } + +\ccHasModels +\ccRefIdfierPage{CGAL::halfedge_graph_traits< CGAL::Polyhedron_3 const > }\\ +\ccRefIdfierPage{CGAL::halfedge_graph_traits< CGAL::Polyhedron_3 > }\\ + +\end{ccRefConcept} + +% +------------------------------------------------------------------------+ +%%RefPage: end of main body, begin of footer +% EOF +% +------------------------------------------------------------------------+ diff --git a/BGL/doc_tex/BGL_ref/Polyhedron_geometric_graph_traits.tex b/BGL/doc_tex/BGL_ref/Polyhedron_geometric_graph_traits.tex new file mode 100644 index 00000000000..c2abc238cb0 --- /dev/null +++ b/BGL/doc_tex/BGL_ref/Polyhedron_geometric_graph_traits.tex @@ -0,0 +1,44 @@ +%% Copyright (c) 2004 SciSoft. All rights reserved. +%% +%% This file is part of CGAL (www.cgal.org); you may redistribute it under +%% the terms of the Q Public License version 1.0. +%% See the file LICENSE.QPL distributed with CGAL. +%% +%% Licensees holding a valid commercial license may use this file in +%% accordance with the commercial license agreement provided with the software. +%% +%% This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +%% WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +%% +%% +%% +%% Author(s) : Fernando Cacciola + + +\begin{ccRefClass}{CGAL::geometric_graph_traits< CGAL::Polyhedron_3 >} + +%% add template arg's if necessary + +%% \ccHtmlCrossLink{} %% add further rules for cross referencing links +%% \ccHtmlIndexC[class]{} %% add further index entries +\ccDefinition + +The class \ccRefName\ and corresponding free-function overloads provides the specializations for \ccc{Polyhedron_3} required to make it a model of a \ccc{ConnectedPlanarDirectedGeometricGraph}. + +\ccInclude{CGAL/boost/graph/Polyhedron_geometric_graph_traits.h} + +\ccTypes + \ccTypedef{typename Polyhedron_3::Point_3 Point ;}{The 3D Point type of the vertex.} + +\ccIsModel +\ccc{ConnectedPlanarDirectedGeometricGraph} + +\ccSeeAlso + +\end{ccRefClass} + +% +------------------------------------------------------------------------+ +%%RefPage: end of main body, begin of footer +% EOF +% +------------------------------------------------------------------------+ + diff --git a/BGL/doc_tex/BGL_ref/Polyhedron_graph_traits.tex b/BGL/doc_tex/BGL_ref/Polyhedron_graph_traits.tex new file mode 100644 index 00000000000..7d5d9a057d2 --- /dev/null +++ b/BGL/doc_tex/BGL_ref/Polyhedron_graph_traits.tex @@ -0,0 +1,83 @@ +%% Copyright (c) 2004 SciSoft. All rights reserved. +%% +%% This file is part of CGAL (www.cgal.org); you may redistribute it under +%% the terms of the Q Public License version 1.0. +%% See the file LICENSE.QPL distributed with CGAL. +%% +%% Licensees holding a valid commercial license may use this file in +%% accordance with the commercial license agreement provided with the software. +%% +%% This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +%% WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +%% +%% +%% +%% Author(s) : Fernando Cacciola + + +\begin{ccRefClass}{boost::graph_traits< CGAL::Polyhedron_3 >} + +%% add template arg's if necessary + +%% \ccHtmlCrossLink{} %% add further rules for cross referencing links +%% \ccHtmlIndexC[class]{} %% add further index entries +\ccDefinition + +The class \ccRefName\ and corresponding free-function overloads provides the specializations for \ccc{Polyhedron_3} required to make it a {\em mutable} model of the Boost Graph types: \ccc{BidirectionalGraph}, \ccc{AdjacencyGraph} and \ccc{EdgeAndVertexListGraph}. + +\ccInclude{CGAL/boost/graph/Polyhedron_graph_traits.h} + +\ccTypes + \ccTypedef{typename Polyhedron_3::Vertex_handle vertex_descriptor;} + {The vertex descriptor.} + + \ccTypedef{typename Polyhedron_3::Halfedge_handle edge_descriptor;} + {The edges descriptor.} + + \ccTypedef{-implementation-defined- vertex_iterator;}{A \ccc{Polyhedron_3::Vertex_iterator} + wrapped to return a \ccc{Polyhedron_3::Vertex_handle} when dereferenced.} + + \ccTypedef{-implementation-defined- edge_iterator;}{A \ccc{Polyhedron_3::Halfedge_iterator} + wrapped to return a \ccc{Polyhedron_3::Halfedge_handle} when dereferenced.} + + \ccTypedef{-implementation-defined- in_edge_iterator;}{An edge iterator which only iterates over + the incoming \ccc{halfedges} around a vertex. It correspons to a + \ccc{Polyhedron_3::Halfedge_around_vertex_circulator} + wrapped to return an \ccc{Polyhedron_3::Halfege_handle} when dereferenced} + + \ccTypedef{-implementation-defined- out_edge_iterator;}{An edge iterator which only iterates over + the outgoing halfedges around a vertex. It correspons to a \ccc{Polyhedron_3::Halfedge_around_vertex_circulator} + wrapped to return an \ccc{Polyhedron_3::Halfege_handle} referring to the {\em opposite halfege} when + dereferenced.} + + \ccTypedef{boost::directed_tag directed_category;}{Indicates this is a directed graph.} + + \ccTypedef{boost::disallow_parallel_edge_tag edge_parallel_category;} + {Indicates this graph does not support multiedges.} + + \ccTypedef{boost::bidirectional_graph_tag traversal_category;} + {Indicates this graph is bidirectional.} + + \ccTypedef{typename Polyhedron_3::size_type vertices_size_type;} + {The size tye of the vertex list.} + + \ccTypedef{typename Polyhedron_3::size_type edges_size_type;} + {The size tye of the edge list.} + + \ccTypedef{typename Polyhedron_3::size_type degree_size_type;} + {The size tye of the adjacency list.} + +\ccIsModel +\ccc{BidirectionalGraph} +\ccc{AdjacencyGraph} +\ccc{EdgeAndVertexListGraph} + +\ccSeeAlso + +\end{ccRefClass} + +% +------------------------------------------------------------------------+ +%%RefPage: end of main body, begin of footer +% EOF +% +------------------------------------------------------------------------+ + diff --git a/BGL/doc_tex/BGL_ref/Polyhedron_graph_traits_const.tex b/BGL/doc_tex/BGL_ref/Polyhedron_graph_traits_const.tex new file mode 100644 index 00000000000..cc828da574a --- /dev/null +++ b/BGL/doc_tex/BGL_ref/Polyhedron_graph_traits_const.tex @@ -0,0 +1,85 @@ +%% Copyright (c) 2004 SciSoft. All rights reserved. +%% +%% This file is part of CGAL (www.cgal.org); you may redistribute it under +%% the terms of the Q Public License version 1.0. +%% See the file LICENSE.QPL distributed with CGAL. +%% +%% Licensees holding a valid commercial license may use this file in +%% accordance with the commercial license agreement provided with the software. +%% +%% This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +%% WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +%% +%% +%% +%% Author(s) : Fernando Cacciola + + +\begin{ccRefClass}{boost::graph_traits< CGAL::Polyhedron_3 const>} + +%% add template arg's if necessary + +%% \ccHtmlCrossLink{} %% add further rules for cross referencing links +%% \ccHtmlIndexC[class]{} %% add further index entries +\ccDefinition + +The class \ccRefName\ and corresponding free-function overloads provides the specializations for \ccc{Polyhedron_3 const} required to make it a {\em read-only} model of the Boost Graph types: \ccc{BidirectionalGraph}, \ccc{AdjacencyGraph} and \ccc{EdgeAndVertexListGraph}. + +\ccInclude{CGAL/boost/graph/Polyhedron_graph_traits.h} + +\ccTypes + \ccTypedef{typename Polyhedron_3::Vertex_const_handle vertex_descriptor;} + {The vertex descriptor.} + + \ccTypedef{typename Polyhedron_3::Halfedge_const_handle edge_descriptor;} + {The edges descriptor.} + + \ccTypedef{-implementation-defined- vertex_iterator;}{A \ccc{Polyhedron_3::Vertex_const_iterator} + wrapped to return a \ccc{Polyhedron_3::Vertex_const_handle} when dereferenced.} + + \ccTypedef{-implementation-defined- edge_iterator;}{A \ccc{Polyhedron_3::Halfedge_const_iterator} + wrapped to return a \ccc{Polyhedron_3::Halfedge_const_handle} when dereferenced.} + + \ccTypedef{-implementation-defined- in_edge_iterator;}{An edge iterator which only iterates over + the incoming \ccc{halfedges} around a vertex.\\It correspons to a + \ccc{Polyhedron_3::Halfedge_around_vertex_const_circulator} + wrapped to return an \ccc{Polyhedron_3::Halfege_const_handle} when dereferenced} + + \ccTypedef{-implementation-defined- out_edge_iterator;}{An edge iterator which only iterates over + the outgoing halfedges around a vertex. It correspons to a + \ccc{Polyhedron_3::Halfedge_around_vertex_const_circulator} + wrapped to return an \ccc{Polyhedron_3::Halfege_const_handle} referring to the + {\em opposite halfege} when dereferenced.} + + \ccTypedef{boost::directed_tag directed_category;} + {Indicates this is a directed graph.} + + \ccTypedef{boost::disallow_parallel_edge_tag edge_parallel_category;} + {Indicates this graph does not support multiedges.} + + \ccTypedef{boost::bidirectional_graph_tag traversal_category;} + {Indicates this graph is bidirectional.} + + \ccTypedef{typename Polyhedron_3::size_type vertices_size_type;} + {The size tye of the vertex list.} + + \ccTypedef{typename Polyhedron_3::size_type edges_size_type;} + {The size tye of the edge list.} + + \ccTypedef{typename Polyhedron_3::size_type degree_size_type;} + {The size tye of the adjacency list.} + +\ccIsModel +\ccc{BidirectionalGraph} +\ccc{AdjacencyGraph} +\ccc{EdgeAndVertexListGraph} + +\ccSeeAlso + +\end{ccRefClass} + +% +------------------------------------------------------------------------+ +%%RefPage: end of main body, begin of footer +% EOF +% +------------------------------------------------------------------------+ + diff --git a/BGL/doc_tex/BGL_ref/Polyhedron_halfedge_graph_traits.tex b/BGL/doc_tex/BGL_ref/Polyhedron_halfedge_graph_traits.tex new file mode 100644 index 00000000000..32960740b80 --- /dev/null +++ b/BGL/doc_tex/BGL_ref/Polyhedron_halfedge_graph_traits.tex @@ -0,0 +1,46 @@ +%% Copyright (c) 2004 SciSoft. All rights reserved. +%% +%% This file is part of CGAL (www.cgal.org); you may redistribute it under +%% the terms of the Q Public License version 1.0. +%% See the file LICENSE.QPL distributed with CGAL. +%% +%% Licensees holding a valid commercial license may use this file in +%% accordance with the commercial license agreement provided with the software. +%% +%% This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +%% WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +%% +%% +%% +%% Author(s) : Fernando Cacciola + + +\begin{ccRefClass}{CGAL::halfedge_graph_traits< CGAL::Polyhedron_3 >} + +%% add template arg's if necessary + +%% \ccHtmlCrossLink{} %% add further rules for cross referencing links +%% \ccHtmlIndexC[class]{} %% add further index entries +\ccDefinition + +The class \ccRefName\ and corresponding free-function overloads provides the specializations for \ccc{Polyhedron_3} required to make it a \ccc{mutable} model of a \ccc{HalfedgeGraph}. + +\ccInclude{CGAL/boost/graph/Polyhedron_halfedge_graph_traits.h} + +\ccTypes + \ccTypedef{typename -implementation-defined- undirected_edge_iterator;}{An edge iterator that iterates + over 1 out of 2 halfedges, each time pointing to one and only one of the halfedges for each opposing pair. + When dereferenced, it returns a \ccc{Polyhedron_3::Halfedge_const_handle}} + +\ccIsModel +\ccc{HalfedgeGraph} + +\ccSeeAlso + +\end{ccRefClass} + +% +------------------------------------------------------------------------+ +%%RefPage: end of main body, begin of footer +% EOF +% +------------------------------------------------------------------------+ + diff --git a/BGL/doc_tex/BGL_ref/Polyhedron_halfedge_graph_traits_const.tex b/BGL/doc_tex/BGL_ref/Polyhedron_halfedge_graph_traits_const.tex new file mode 100644 index 00000000000..5912264b5f6 --- /dev/null +++ b/BGL/doc_tex/BGL_ref/Polyhedron_halfedge_graph_traits_const.tex @@ -0,0 +1,46 @@ +%% Copyright (c) 2004 SciSoft. All rights reserved. +%% +%% This file is part of CGAL (www.cgal.org); you may redistribute it under +%% the terms of the Q Public License version 1.0. +%% See the file LICENSE.QPL distributed with CGAL. +%% +%% Licensees holding a valid commercial license may use this file in +%% accordance with the commercial license agreement provided with the software. +%% +%% This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +%% WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +%% +%% +%% +%% Author(s) : Fernando Cacciola + + +\begin{ccRefClass}{CGAL::halfedge_graph_traits< CGAL::Polyhedron_3 >} + +%% add template arg's if necessary + +%% \ccHtmlCrossLink{} %% add further rules for cross referencing links +%% \ccHtmlIndexC[class]{} %% add further index entries +\ccDefinition + +The class \ccRefName\ and corresponding free-function overloads provides the specializations for \ccc{Polyhedron_3} required to make it a model of a \ccc{HalfedgeGraph}. + +\ccInclude{CGAL/boost/graph/Polyhedron_halfedge_graph_traits.h} + +\ccTypes + \ccTypedef{typename -implementation-defined- undirected_edge_iterator;}{An edge iterator that iterates + over 1 out of 2 halfedges, each time pointing to one and only one of the halfedges for each opposing pair. + When dereferenced, it returns a \ccc{Polyhedron_3::Halfedge_handle}} + +\ccIsModel +\ccc{HalfedgeGraph} + +\ccSeeAlso + +\end{ccRefClass} + +% +------------------------------------------------------------------------+ +%%RefPage: end of main body, begin of footer +% EOF +% +------------------------------------------------------------------------+ + diff --git a/BGL/doc_tex/BGL_ref/intro.tex b/BGL/doc_tex/BGL_ref/intro.tex index 7456aab1d4a..1f88298ae22 100644 --- a/BGL/doc_tex/BGL_ref/intro.tex +++ b/BGL/doc_tex/BGL_ref/intro.tex @@ -14,20 +14,23 @@ %% %% Author(s) : Fernando Cacciola -\ccRefChapter{Boost Graph Library (\ccc{BGL}) interface to \cgal\ \label{ref-chapter-bgl}} +\ccRefChapter{Boost Graph Library (BGL) interface to CGAL \label{ref-chapter-BGL}} This chapter introduces the concepts and classes that correspond to the \cgal\ \ccc{BGL} package.\\ -The packages provides a framework for interfacing \cgal\ incidence data structures to BGL algorithms. +The packages provides a framework for interfacing \cgal\ data structures as \ccc{BGL} graphs. \section{Classified Reference Pages} \ccHeading{Concepts} -\ccRefConceptPage{ConnectedPlanarGraph} \\ -\ccRefConceptPage{ConnectedPlanarDirectedGraph} \\ +\ccRefConceptPage{ConnectedPlanarDirectedGeometricGraph} \\ +\ccRefConceptPage{HalfedgeGraph} \\ \ccHeading{Classes} +\ccRefIdfierPage{boost::graph_traits< CGAL::Polyhedron_3 const > }\\ \ccRefIdfierPage{boost::graph_traits< CGAL::Polyhedron_3 > }\\ -\ccRefIdfierPage{boost::graph_traits< CGAL::Polyhedron_3 const> }\\ +\ccRefIdfierPage{CGAL::geometric_graph_traits< CGAL::Polyhedron_3 > }\\ +\ccRefIdfierPage{CGAL::halfedge_graph_traits< CGAL::Polyhedron_3 const > }\\ +\ccRefIdfierPage{CGAL::halfedge_graph_traits< CGAL::Polyhedron_3 > }\\ % +------------------------------------------------------------------------+ %%RefPage: end of main body, begin of footer diff --git a/BGL/doc_tex/BGL_ref/main.tex b/BGL/doc_tex/BGL_ref/main.tex index 589ed5f1c76..b477b2743d0 100644 --- a/BGL/doc_tex/BGL_ref/main.tex +++ b/BGL/doc_tex/BGL_ref/main.tex @@ -6,5 +6,12 @@ % +------------------------------------------------------------------------+ % alfabatisch \input{BGL_ref/intro.tex} +\input{BGL_ref/ConnectedPlanarDirectedGeometricGraph.tex} +\input{BGL_ref/HalfedgeGraph.tex} +\input{BGL_ref/Polyhedron_graph_traits.tex} +\input{BGL_ref/Polyhedron_graph_traits_const.tex} +\input{BGL_ref/Polyhedron_geometric_graph_traits.tex} +\input{BGL_ref/Polyhedron_halfedge_graph_traits.tex} +\input{BGL_ref/Polyhedron_halfedge_graph_traits_const.tex} %% EOF diff --git a/BGL/include/CGAL/boost/graph/HalfedgeDS_BGL_aux.h b/BGL/include/CGAL/boost/graph/HalfedgeDS_BGL_aux.h index 00d90fb28ad..d375987ee6e 100644 --- a/BGL/include/CGAL/boost/graph/HalfedgeDS_BGL_aux.h +++ b/BGL/include/CGAL/boost/graph/HalfedgeDS_BGL_aux.h @@ -335,24 +335,24 @@ public : }; template -struct HDS_undirected_graph_traits +struct HDS_halfedge_graph_traits { public : typedef HDS_ HDS; - typedef HDS_all_undirected_edges_iterator edge_iterator; + typedef HDS_all_undirected_edges_iterator undirected_edge_iterator; }; template -struct HDS_undirected_graph_traits +struct HDS_halfedge_graph_traits { public : typedef HDS_ HDS; - typedef HDS_all_undirected_edges_const_iterator edge_iterator; + typedef HDS_all_undirected_edges_const_iterator undirected_edge_iterator; }; diff --git a/BGL/include/CGAL/boost/graph/Polyhedron_extended_BGL.h b/BGL/include/CGAL/boost/graph/Polyhedron_extended_BGL.h index 9733bde29d0..ba5f05c18c8 100644 --- a/BGL/include/CGAL/boost/graph/Polyhedron_extended_BGL.h +++ b/BGL/include/CGAL/boost/graph/Polyhedron_extended_BGL.h @@ -32,29 +32,31 @@ CGAL_BEGIN_NAMESPACE -template -typename boost::graph_traits< Polyhedron_3 const>::edges_size_type -num_undirected_edges(const Polyhedron_3& p) -{ - return p.size_of_halfedges() / 2 ; -} // // Const versions // template -struct undirected_graph_traits< CGAL::Polyhedron_3 const > - : CGAL::HDS_undirected_graph_traits< CGAL::Polyhedron_3 const> +struct geometric_graph_traits< CGAL::Polyhedron_3 const > +{ + typedef CGAL::Polyhedron_3 const Polyhedron ; + + typedef typename Polyhedron::Point_3 Point ; +}; + +template +struct halfedge_graph_traits< CGAL::Polyhedron_3 const > + : CGAL::HDS_halfedge_graph_traits< CGAL::Polyhedron_3 const> {}; template -inline std::pair const>::edge_iterator - ,typename undirected_graph_traits< Polyhedron_3 const>::edge_iterator +inline std::pair const>::undirected_edge_iterator + ,typename halfedge_graph_traits< Polyhedron_3 const>::undirected_edge_iterator > undirected_edges( Polyhedron_3 const& p ) { - typedef typename undirected_graph_traits< Polyhedron_3 const>::edge_iterator Iter; + typedef typename halfedge_graph_traits< Polyhedron_3 const>::undirected_edge_iterator Iter; return std::make_pair( Iter(p.edges_begin()), Iter(p.edges_end()) ); } @@ -105,42 +107,29 @@ next_edge_cw( typename boost::graph_traits< Polyhedron_3 const>::edg return outedge->opposite()->next(); } -template -typename boost::graph_traits< Polyhedron_3 const>::edge_descriptor -out_edge( typename boost::graph_traits< Polyhedron_3 const>::vertex_descriptor u - , Polyhedron_3 const& - ) -{ - HalfedgeDS_items_decorator< Polyhedron_3 > D ; - return D.get_vertex_edge(u)->opposite(); -} - -template -typename boost::graph_traits< Polyhedron_3 const>::edge_descriptor -in_edge( typename boost::graph_traits< Polyhedron_3 const>::vertex_descriptor u - , Polyhedron_3 const& - ) -{ - HalfedgeDS_items_decorator< Polyhedron_3 > D ; - return D.get_vertex_edge(u); -} - // // Non-Const versions // +template +struct geometric_graph_traits< CGAL::Polyhedron_3 > +{ + typedef CGAL::Polyhedron_3 Polyhedron ; + + typedef typename Polyhedron::Point_3 Point ; +}; template -struct undirected_graph_traits< CGAL::Polyhedron_3 > - : CGAL::HDS_undirected_graph_traits< CGAL::Polyhedron_3 > +struct halfedge_graph_traits< CGAL::Polyhedron_3 > + : CGAL::HDS_halfedge_graph_traits< CGAL::Polyhedron_3 > {}; template -inline std::pair >::edge_iterator - ,typename undirected_graph_traits< Polyhedron_3 >::edge_iterator +inline std::pair >::undirected_edge_iterator + ,typename halfedge_graph_traits< Polyhedron_3 >::undirected_edge_iterator > undirected_edges( Polyhedron_3& p ) { - typedef typename undirected_graph_traits< Polyhedron_3 >::edge_iterator Iter; + typedef typename halfedge_graph_traits< Polyhedron_3 >::undirected_edge_iterator Iter; return std::make_pair( Iter(p.edges_begin()), Iter(p.edges_end()) ); } @@ -196,28 +185,6 @@ next_edge_cw( typename boost::graph_traits< Polyhedron_3 >::edge_des } - -template -typename boost::graph_traits< Polyhedron_3 >::edge_descriptor -out_edge( typename boost::graph_traits< Polyhedron_3 >::vertex_descriptor u - , Polyhedron_3& - ) -{ - HalfedgeDS_items_decorator< Polyhedron_3 > D ; - return D.get_vertex_edge(u)->opposite(); -} - - -template -typename boost::graph_traits< Polyhedron_3 >::edge_descriptor -in_edge( typename boost::graph_traits< Polyhedron_3 >::vertex_descriptor u - , Polyhedron_3& - ) -{ - HalfedgeDS_items_decorator< Polyhedron_3 > D ; - return D.get_vertex_edge(u); -} - CGAL_END_NAMESPACE #undef CGAL_HDS_