From db346b1ad36f2bcc954f809018f74497b4a2a2e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 6 Jun 2014 15:36:27 +0200 Subject: [PATCH] add extra overload if c++11 is not enabled --- .../include/CGAL/mesh_segmentation.h | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) diff --git a/Surface_mesh_segmentation/include/CGAL/mesh_segmentation.h b/Surface_mesh_segmentation/include/CGAL/mesh_segmentation.h index 65c1b299cbc..0d4800e0d78 100644 --- a/Surface_mesh_segmentation/include/CGAL/mesh_segmentation.h +++ b/Surface_mesh_segmentation/include/CGAL/mesh_segmentation.h @@ -298,6 +298,91 @@ segmentation_via_sdf_values(const Polyhedron& polyhedron, /// \cond SKIP_IN_MANUAL +#ifdef CGAL_CFG_NO_CPP0X_DEFAULT_TEMPLATE_ARGUMENTS_FOR_FUNCTION_TEMPLATES +// we need these overloads for the default of the point property map +template +std::pair +sdf_values(const Polyhedron& polyhedron, + SDFPropertyMap sdf_values_map, + double cone_angle = 2.0 / 3.0 * CGAL_PI, + std::size_t number_of_rays = 25, + bool postprocess = true, + GeomTraits traits = GeomTraits() ) +{ + typedef typename boost::property_map::type Ppmap; + Ppmap ppmap = get(boost::vertex_point, const_cast(polyhedron)); + return sdf_values + (polyhedron, sdf_values_map, cone_angle, number_of_rays, postprocess, traits, ppmap); +} + +template < class Polyhedron, class SDFPropertyMap, class GeomTraits> +std::pair +sdf_values( const Polyhedron& polyhedron, + SDFPropertyMap sdf_values_map, + double cone_angle = 2.0 / 3.0 * CGAL_PI, + std::size_t number_of_rays = 25, + bool postprocess = true, + GeomTraits traits = GeomTraits() ) +{ + typedef typename boost::property_map::type Ppmap; + Ppmap ppmap = get(boost::vertex_point, const_cast(polyhedron)); + return sdf_values + (polyhedron, sdf_values_map, cone_angle, number_of_rays, postprocess, traits, ppmap); +} + +template +std::size_t +segmentation_from_sdf_values(const Polyhedron& polyhedron, + SDFPropertyMap sdf_values_map, + SegmentPropertyMap segment_ids, + std::size_t number_of_clusters = 5, + double smoothing_lambda = 0.26, + bool output_cluster_ids = false, + GeomTraits traits = GeomTraits() ) +{ + typedef typename boost::property_map::type Ppmap; + Ppmap ppmap = get(boost::vertex_point, const_cast(polyhedron)); + return segmentation_from_sdf_values + (polyhedron, sdf_values_map, segment_ids, number_of_clusters, smoothing_lambda, + output_cluster_ids, traits, ppmap); +} + +template +std::size_t +segmentation_via_sdf_values(const Polyhedron& polyhedron, + SegmentPropertyMap segment_ids, + double cone_angle = 2.0 / 3.0 * CGAL_PI, + std::size_t number_of_rays = 25, + std::size_t number_of_clusters = 5, + double smoothing_lambda = 0.26, + bool output_cluster_ids = false, + GeomTraits traits = GeomTraits() ) +{ + typedef typename boost::property_map::type Ppmap; + Ppmap ppmap = get(boost::vertex_point, const_cast(polyhedron)); + return segmentation_via_sdf_values< Fast_sdf_calculation_mode, Polyhedron, SegmentPropertyMap, GeomTraits, Ppmap> + (polyhedron, segment_ids, cone_angle, number_of_rays, number_of_clusters, + smoothing_lambda, output_cluster_ids, traits, ppmap); +} + +template +std::size_t +segmentation_via_sdf_values(const Polyhedron& polyhedron, + SegmentPropertyMap segment_ids, + double cone_angle = 2.0 / 3.0 * CGAL_PI, + std::size_t number_of_rays = 25, + std::size_t number_of_clusters = 5, + double smoothing_lambda = 0.26, + bool output_cluster_ids = false, + GeomTraits traits = GeomTraits() ) +{ + typedef typename boost::property_map::type Ppmap; + Ppmap ppmap = get(boost::vertex_point, const_cast(polyhedron)); + return segmentation_via_sdf_values + (polyhedron, segment_ids, cone_angle, number_of_rays, number_of_clusters, + smoothing_lambda, output_cluster_ids, traits, ppmap); +} +#endif // Even if CGAL_CFG_NO_CPP0X_DEFAULT_TEMPLATE_ARGUMENTS_FOR_FUNCTION_TEMPLATES is not defined, // we need these overloads for the default of the point property map template