diff --git a/BGL/include/CGAL/boost/graph/Dual.h b/BGL/include/CGAL/boost/graph/Dual.h index 22e29090e79..fd904a50d04 100644 --- a/BGL/include/CGAL/boost/graph/Dual.h +++ b/BGL/include/CGAL/boost/graph/Dual.h @@ -90,18 +90,60 @@ struct graph_traits< const CGAL::Dual

> : public graph_traits< CGAL::Dual

> {}; +namespace internal{ + +template +struct Dual_vertex_index_pmap{ + typedef typename boost::property_map::type Property_map; + Property_map m_pmap; + + typedef typename boost::graph_traits::face_descriptor key_type; + typedef typename Property_map::value_type value_type; + typedef typename Property_map::reference reference; + typedef typename Property_map::category category; + + Dual_vertex_index_pmap(const G& g) + : m_pmap( get(boost::face_index, g) ) + {} + + friend reference get(const Dual_vertex_index_pmap& pmap, key_type fd) { + return get(pmap.m_pmap, fd); + } +}; + +template +struct Dual_face_index_pmap{ + typedef typename boost::property_map::type Property_map; + Property_map m_pmap; + + typedef typename boost::graph_traits::vertex_descriptor key_type; + typedef typename Property_map::value_type value_type; + typedef typename Property_map::reference reference; + typedef typename Property_map::category category; + + Dual_face_index_pmap(const G& g) + : m_pmap( get(boost::vertex_index, g) ) + {} + + friend reference get(const Dual_face_index_pmap& pmap, key_type vd) { + return get(pmap.m_pmap, vd); + } +}; + +} //end of namespace internal + template struct property_map, boost::vertex_index_t> { - typedef typename property_map::type type; - typedef typename property_map::const_type const_type; + typedef internal::Dual_vertex_index_pmap

type; + typedef internal::Dual_vertex_index_pmap

const_type; }; template struct property_map, boost::face_index_t> { - typedef typename property_map::type type; - typedef typename property_map::const_type const_type; + typedef internal::Dual_face_index_pmap

type; + typedef internal::Dual_face_index_pmap

const_type; }; } // namespace boost @@ -110,20 +152,19 @@ struct property_map, boost::face_index_t> namespace CGAL { template -typename boost::property_map::type +typename boost::internal::Dual_vertex_index_pmap

get(boost::vertex_index_t, const Dual

& dual) { - return get(CGAL::face_index, dual.primal()); + return typename boost::internal::Dual_vertex_index_pmap

(dual.primal()); } template -typename boost::property_map::type +typename boost::internal::Dual_face_index_pmap

get(boost::face_index_t, const Dual

& dual) { - return get(boost::vertex_index, dual.primal()); + return typename boost::internal::Dual_face_index_pmap

(dual.primal()); } - template typename boost::graph_traits >::vertices_size_type num_vertices(const CGAL::Dual

& dual)