diff --git a/Surface_mesh_segmentation/doc/Surface_mesh_segmentation/Surface_Mesh_Segmentation.txt b/Surface_mesh_segmentation/doc/Surface_mesh_segmentation/Surface_Mesh_Segmentation.txt index fb0af95425f..f23289bce39 100644 --- a/Surface_mesh_segmentation/doc/Surface_mesh_segmentation/Surface_Mesh_Segmentation.txt +++ b/Surface_mesh_segmentation/doc/Surface_mesh_segmentation/Surface_Mesh_Segmentation.txt @@ -142,7 +142,7 @@ Influence of the smoothness parameter lambda over the segmentation (using 10 clu The hard clustering assigns a cluster id to each facet (see \cgalFigureRef{Cluster_vs_segment} (a)). A segment consists in a set of connected facets in the same cluster (see \cgalFigureRef{Cluster_vs_segment} (b)). By default the function `segment_from_sdf_values()` assigns to each facet the id of its segment. -It assigns to each facet the id of its cluster when set `extract_segments` is set to `false`. +It assigns to each facet the id of its cluster when `output_cluster_ids` is set to `true`. \cgalFigureBegin{Cluster_vs_segment,cluster_vs_segment.png} diff --git a/Surface_mesh_segmentation/include/CGAL/mesh_segmentation.h b/Surface_mesh_segmentation/include/CGAL/mesh_segmentation.h index 093a1812ec9..2e3f00827ba 100644 --- a/Surface_mesh_segmentation/include/CGAL/mesh_segmentation.h +++ b/Surface_mesh_segmentation/include/CGAL/mesh_segmentation.h @@ -51,7 +51,7 @@ compute_sdf_values( const Polyhedron& polyhedron, * @param polyhedron surface mesh on which SDF values are computed * @param[out] sdf_values the SDF value of each facet * @param cone_angle opening angle in radians for the cone of each facet - * @param number_of_rays number of rays picked in the cone of each facet. In our experiments, we observe that increasing the number of rays beyond the default has a little effect on the quality of the segmentation result + * @param number_of_rays number of rays picked in the cone of each facet. In our experiments, we observe that increasing the number of rays beyond the default has little effect on the quality of the segmentation result * @param postprocess if `true`, `CGAL::postprocess_sdf_values` is called on raw SDF value computed. * @param traits traits class * @@ -138,10 +138,10 @@ postprocess_sdf_values(const Polyhedron& polyhedron, SDFPropertyMap sdf_values) * @param[out] segment_ids the segment or cluster id of each facet * @param number_of_clusters number of clusters for the soft clustering * @param smoothing_lambda factor which indicates the importance of the surface features for the energy minimization. It is recommended to choose a value in the interval [0,1]. See the section \ref Surface_mesh_segmentationGraphCut for more details. - * @param extract_segments if `true` fill `segment_ids` with segment-ids and cluster-ids otherwise (see \cgalFigureRef{Cluster_vs_segment}) + * @param output_cluster_ids if `false` fill `segment_ids` with segment-ids, and with cluster-ids otherwise (see \cgalFigureRef{Cluster_vs_segment}) * @param traits traits class * - * @return number of segments if `extract_segments` is set to `true` and `number_of_clusters` otherwise + * @return number of segments if `output_cluster_ids` is set to `false` and `number_of_clusters` otherwise */ template algorithm( polyhedron, traits); return algorithm.partition(number_of_clusters, smoothing_lambda, sdf_values, - segment_ids, extract_segments); + segment_ids, !output_cluster_ids); } ///\cond SKIP_IN_MANUAL @@ -178,7 +178,7 @@ compute_sdf_values_and_segment(const Polyhedron& polyhedron, int number_of_rays = 25, int number_of_clusters = 5, double smoothing_lambda = 0.26, - bool extract_segments = true, + bool output_cluster_ids = false, GeomTraits traits = GeomTraits()) { typedef std::map< typename Polyhedron::Facet_const_handle, double> @@ -191,7 +191,7 @@ compute_sdf_values_and_segment(const Polyhedron& polyhedron, (polyhedron, sdf_property_map, cone_angle, number_of_rays, true, traits); return segment_from_sdf_values, SegmentPropertyMap, GeomTraits> (polyhedron, sdf_property_map, segment_ids, number_of_clusters, - smoothing_lambda, extract_segments, traits); + smoothing_lambda, output_cluster_ids, traits); } /// \endcond @@ -222,10 +222,10 @@ compute_sdf_values_and_segment(const Polyhedron& polyhedron, * @param number_of_rays number of rays picked in the cone of each facet. In our experiments, we observe that increasing the number of rays beyond the default has a little effect on the quality of the segmentation result * @param number_of_clusters number of clusters for the soft clustering * @param smoothing_lambda factor which indicates the importance of the surface features for the energy minimization. It is recommended to choose a value in the interval [0,1]. See the section \ref Surface_mesh_segmentationGraphCut for more details. - * @param extract_segments if `true` fill `segment_ids` with segment-ids and cluster-ids otherwise (see \cgalFigureRef{Cluster_vs_segment}) + * @param output_cluster_ids if `false` fill `segment_ids` with segment-ids, and with cluster-ids otherwise (see \cgalFigureRef{Cluster_vs_segment}) * @param traits traits class * - * @return number of segments if `extract_segments` is set to `true` and `number_of_clusters` otherwise + * @return number of segments if `output_cluster_ids` is set to `false` and `number_of_clusters` otherwise */ template < class Polyhedron, class SegmentPropertyMap, class GeomTraits #ifndef BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS @@ -239,12 +239,12 @@ compute_sdf_values_and_segment(const Polyhedron& polyhedron, int number_of_rays = 25, int number_of_clusters = 5, double smoothing_lambda = 0.26, - bool extract_segments = true, + bool output_cluster_ids = false, GeomTraits traits = GeomTraits()) { return compute_sdf_values_and_segment (polyhedron, segment_ids, cone_angle, number_of_rays, number_of_clusters, - smoothing_lambda, extract_segments, traits); + smoothing_lambda, output_cluster_ids, traits); } @@ -282,12 +282,12 @@ segment_from_sdf_values(const Polyhedron& polyhedron, SegmentPropertyMap segment_ids, int number_of_clusters = 5, double smoothing_lambda = 0.26, - bool extract_segments = true, + bool output_cluster_ids = false, typename Polyhedron::Traits traits = typename Polyhedron::Traits()) { return segment_from_sdf_values (polyhedron, sdf_values, segment_ids, number_of_clusters, smoothing_lambda, - extract_segments, traits); + output_cluster_ids, traits); } template @@ -298,12 +298,12 @@ compute_sdf_values_and_segment(const Polyhedron& polyhedron, int number_of_rays = 25, int number_of_clusters = 5, double smoothing_lambda = 0.26, - bool extract_segments = true, + bool output_cluster_ids = false, typename Polyhedron::Traits traits = typename Polyhedron::Traits()) { return compute_sdf_values_and_segment< Fast_sdf_calculation_mode, Polyhedron, SegmentPropertyMap, typename Polyhedron::Traits> (polyhedron, segment_ids, cone_angle, number_of_rays, number_of_clusters, - smoothing_lambda, extract_segments, traits); + smoothing_lambda, output_cluster_ids, traits); } template @@ -314,12 +314,12 @@ compute_sdf_values_and_segment(const Polyhedron& polyhedron, int number_of_rays = 25, int number_of_clusters = 5, double smoothing_lambda = 0.26, - bool extract_segments = true, + bool output_cluster_ids = false, typename Polyhedron::Traits traits = typename Polyhedron::Traits()) { return compute_sdf_values_and_segment (polyhedron, segment_ids, cone_angle, number_of_rays, number_of_clusters, - smoothing_lambda, extract_segments, traits); + smoothing_lambda, output_cluster_ids, traits); }