// Copyright (c) 2006 Geometry Factory (France). // 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. // // $URL: $ // $Id: $ // // // Author(s) : Fernando Caccciola #ifndef CGAL_POLYHEDRON_EXTENDED_BGL_H #define CGAL_POLYHEDRON_EXTENDED_BGL_H #include #include #ifndef CGAL_CFG_NO_TMPL_IN_TMPL_PARAM # define CGAL_HDS_PARAM_ template < class Traits, class Items, class Alloc> class HDS #else # define CGAL_HDS_PARAM_ class HDS #endif CGAL_BEGIN_NAMESPACE // // Const versions // template inline std::pair const>::edge_iterator ,typename boost::undirected_graph_traits< Polyhedron_3 const>::edge_iterator > undirected_edges( Polyhedron_3 const& p ) { typedef typename boost::undirected_graph_traits< Polyhedron_3 const>::edge_iterator Iter; return std::make_pair( Iter(p.edges_begin()), Iter(p.edges_end()) ); } template typename boost::graph_traits< Polyhedron_3 const>::edge_descriptor next_edge( typename boost::graph_traits< Polyhedron_3 const>::edge_descriptor outedge , Polyhedron_3 const& ) { return outedge->next(); } template typename boost::graph_traits< Polyhedron_3 const>::edge_descriptor prev_edge( typename boost::graph_traits< Polyhedron_3 const>::edge_descriptor outedge , Polyhedron_3 const& ) { HalfedgeDS_items_decorator< Polyhedron_3 > D ; return D.get_prev(outedge); } template typename boost::graph_traits< Polyhedron_3 const>::edge_descriptor opposite_edge( typename boost::graph_traits< Polyhedron_3 const>::edge_descriptor e , Polyhedron_3 const& ) { return e->opposite(); } template typename boost::graph_traits< Polyhedron_3 const>::edge_descriptor next_edge_ccw( typename boost::graph_traits< Polyhedron_3 const>::edge_descriptor outedge , Polyhedron_3 const& ) { HalfedgeDS_items_decorator< Polyhedron_3 > D ; return D.get_prev(outedge)->opposite(); } template typename boost::graph_traits< Polyhedron_3 const>::edge_descriptor next_edge_cw( typename boost::graph_traits< Polyhedron_3 const>::edge_descriptor outedge , Polyhedron_3 const& ) { 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 inline std::pair >::edge_iterator ,typename boost::undirected_graph_traits< Polyhedron_3 >::edge_iterator > undirected_edges( Polyhedron_3& p ) { typedef typename boost::undirected_graph_traits< Polyhedron_3 >::edge_iterator Iter; return std::make_pair( Iter(p.edges_begin()), Iter(p.edges_end()) ); } template typename boost::graph_traits< Polyhedron_3 >::edge_descriptor next_edge( typename boost::graph_traits< Polyhedron_3 >::edge_descriptor outedge , Polyhedron_3& ) { return outedge->next(); } template typename boost::graph_traits< Polyhedron_3 >::edge_descriptor prev_edge( typename boost::graph_traits< Polyhedron_3 >::edge_descriptor outedge , Polyhedron_3& p ) { CGAL::HalfedgeDS_items_decorator< Polyhedron_3 > D ; return D.get_prev(outedge); } template typename boost::graph_traits< Polyhedron_3 >::edge_descriptor opposite_edge( typename boost::graph_traits< Polyhedron_3 >::edge_descriptor e , Polyhedron_3& ) { return e->opposite(); } template typename boost::graph_traits< Polyhedron_3 >::edge_descriptor next_edge_ccw( typename boost::graph_traits< Polyhedron_3 >::edge_descriptor outedge , Polyhedron_3& ) { HalfedgeDS_items_decorator< Polyhedron_3 > D ; return D.get_prev(outedge)->opposite(); } template typename boost::graph_traits< Polyhedron_3 >::edge_descriptor next_edge_cw( typename boost::graph_traits< Polyhedron_3 >::edge_descriptor outedge , Polyhedron_3& ) { return outedge->opposite()->next(); } 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_ #endif // CGAL_POLYHEDRON_EXTENDED_BGL_H