From a743b4d572b82eb85b80c63e3d32c9807c107cda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=8Dlker=20Yaz?= Date: Thu, 16 Aug 2012 22:59:22 +0000 Subject: [PATCH] Small corrections on examples --- .../sdf_values_computation_example.cpp | 1 - .../surface_mesh_segmentation_example.cpp | 3 +-- ...ace_mesh_segmentation_from_sdf_values_example.cpp | 3 +-- .../include/CGAL/mesh_segmentation.h | 12 +++++++++--- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/sdf_values_computation_example.cpp b/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/sdf_values_computation_example.cpp index 963ff9078c2..d11d529fc7f 100644 --- a/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/sdf_values_computation_example.cpp +++ b/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/sdf_values_computation_example.cpp @@ -50,5 +50,4 @@ int main(int argc, char **argv) { std::cout << sdf_property_map[facet_it] - sdf_property_map_2[facet_it] << std::endl; } - } \ No newline at end of file diff --git a/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/surface_mesh_segmentation_example.cpp b/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/surface_mesh_segmentation_example.cpp index 1e0082e1f45..480b3aefaa0 100644 --- a/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/surface_mesh_segmentation_example.cpp +++ b/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/surface_mesh_segmentation_example.cpp @@ -20,7 +20,7 @@ int main(int argc, char **argv) std::ifstream(argv[1]) >> mesh; // create a property-map for segment-ids (it is an adaptor for this case) - typedef std::map Facet_int_map; + typedef std::map Facet_int_map; Facet_int_map internal_segment_map; boost::associative_property_map segment_property_map(internal_segment_map); @@ -33,5 +33,4 @@ int main(int argc, char **argv) { std::cout << segment_property_map[facet_it] << std::endl; } - } \ No newline at end of file diff --git a/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/surface_mesh_segmentation_from_sdf_values_example.cpp b/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/surface_mesh_segmentation_from_sdf_values_example.cpp index ddc495a8575..65c0bff0609 100644 --- a/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/surface_mesh_segmentation_from_sdf_values_example.cpp +++ b/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/surface_mesh_segmentation_from_sdf_values_example.cpp @@ -28,7 +28,7 @@ int main(int argc, char **argv) CGAL::sdf_values_computation(mesh, sdf_property_map); // create a property-map for segment-ids (it is an adaptor for this case) - typedef std::map Facet_int_map; + typedef std::map Facet_int_map; Facet_int_map internal_segment_map; boost::associative_property_map segment_property_map(internal_segment_map); @@ -49,5 +49,4 @@ int main(int argc, char **argv) // This feature becomes important when we want to segment the mesh several times with different parameters. CGAL::surface_mesh_segmentation_from_sdf_values( mesh, sdf_property_map, segment_property_map, number_of_levels, smoothing_lambda); - } \ No newline at end of file diff --git a/Surface_mesh_segmentation/include/CGAL/mesh_segmentation.h b/Surface_mesh_segmentation/include/CGAL/mesh_segmentation.h index 23778384a3e..79edf962f9e 100644 --- a/Surface_mesh_segmentation/include/CGAL/mesh_segmentation.h +++ b/Surface_mesh_segmentation/include/CGAL/mesh_segmentation.h @@ -89,9 +89,15 @@ void surface_mesh_segmentation(const Polyhedron& polyhedron, double smoothing_lambda = CGAL_DEFAULT_SMOOTHING_LAMBDA) { - Surface_mesh_segmentation algorithm(polyhedron); - algorithm.calculate_sdf_values(cone_angle, number_of_rays); - algorithm.partition(segment_ids, number_of_levels, smoothing_lambda); + typedef std::map Facet_double_map; + Facet_double_map internal_sdf_map; + boost::associative_property_map sdf_property_map( + internal_sdf_map); + + sdf_values_computation(polyhedron, sdf_property_map, cone_angle, + number_of_rays); + surface_mesh_segmentation_from_sdf_values( + polyhedron, sdf_property_map, segment_ids, number_of_levels, smoothing_lambda); } }//namespace CGAL