From 705cb65c1c24b4375395e91bca1822cfd07672cd Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 11 Dec 2014 09:12:34 +0100 Subject: [PATCH] Fix sm_bgl.cpp I am not yet lucky with the API, as member functions return a pair --- .../boost/graph/properties_Surface_mesh.h | 45 +++++++++++-------- Surface_mesh/examples/Surface_mesh/sm_bgl.cpp | 2 +- 2 files changed, 27 insertions(+), 20 deletions(-) diff --git a/BGL/include/CGAL/boost/graph/properties_Surface_mesh.h b/BGL/include/CGAL/boost/graph/properties_Surface_mesh.h index 16a25d81d8a..03826cfdec0 100644 --- a/BGL/include/CGAL/boost/graph/properties_Surface_mesh.h +++ b/BGL/include/CGAL/boost/graph/properties_Surface_mesh.h @@ -90,26 +90,7 @@ struct property_map, boost::vertex_property_t > typedef type const_type; }; -template -typename property_map, boost::vertex_property_t >::const_type -get(boost::vertex_property_t vprop, const CGAL::Surface_mesh& sm) -{ - return sm.template get_property_map::Vertex_index, T>(vprop.s); -} -template -typename property_map, boost::vertex_property_t >::const_type -add(boost::vertex_property_t vprop, CGAL::Surface_mesh& sm) -{ - return sm.template add_property_map::Vertex_index, T>(vprop.s, vprop.t); -} - - template -void - remove(typename CGAL::Surface_mesh

::template Property_map pm, CGAL::Surface_mesh

& sm) -{ - return sm.remove_property_map(pm); -} #endif @@ -268,4 +249,30 @@ put(CGAL::vertex_point_t p, const CGAL::Surface_mesh& g, } // boost +#if 1 +// +namespace CGAL { +template +typename boost::property_map, boost::vertex_property_t >::const_type +get(boost::vertex_property_t vprop, const CGAL::Surface_mesh& sm) +{ + return sm.template get_property_map::Vertex_index, T>(vprop.s).first; +} + +template +typename boost::property_map, boost::vertex_property_t >::const_type +add(boost::vertex_property_t vprop, CGAL::Surface_mesh& sm) +{ + return sm.template add_property_map::Vertex_index, T>(vprop.s, vprop.t).first; +} + +template +void +remove(Pmap pm, CGAL::Surface_mesh

& sm) +{ + return sm.remove_property_map(pm); +} +} // namespace CGAL +#endif + #endif /* CGAL_PROPERTIES_SURFACE_MESH_H */ diff --git a/Surface_mesh/examples/Surface_mesh/sm_bgl.cpp b/Surface_mesh/examples/Surface_mesh/sm_bgl.cpp index 251fe456900..db696108e08 100644 --- a/Surface_mesh/examples/Surface_mesh/sm_bgl.cpp +++ b/Surface_mesh/examples/Surface_mesh/sm_bgl.cpp @@ -42,7 +42,7 @@ int main() std::cerr << "Error: vertex property map named 'visited' already exists\n"; } - remove_property(vs_pm, m); + remove(vs_pm, m); return 0; }