From c6cc177bfadcac9e79fa4d930290702271dc47cb Mon Sep 17 00:00:00 2001 From: iyaz Date: Sat, 12 Jan 2013 15:59:58 +0200 Subject: [PATCH] API function names are changed: old name -> new name sdf_values_computation -> compute_sdf_values surface_mesh_segmentation_from_sdf_values -> segment_from_sdf_values surface_mesh_segmentation -> compute_sdf_values_and_segment Also example code files are changed accordingly. --- ...ompute_sdf_values_and_segment_example.cmd} | 0 ...ompute_sdf_values_and_segment_example.cpp} | 89 ++++----- ...es_and_segment_with_facet_ids_example.cmd} | 0 ...es_and_segment_with_facet_ids_example.cpp} | 169 +++++++++--------- ...ple.cmd => compute_sdf_values_example.cmd} | 0 ...ple.cpp => compute_sdf_values_example.cpp} | 124 ++++++------- ...md => segment_from_sdf_values_example.cmd} | 0 ...pp => segment_from_sdf_values_example.cpp} | 123 +++++++------ .../include/CGAL/mesh_segmentation.h | 82 ++++----- 9 files changed, 295 insertions(+), 292 deletions(-) rename Surface_mesh_segmentation/examples/Surface_mesh_segmentation/{sdf_values_computation_example.cmd => compute_sdf_values_and_segment_example.cmd} (100%) rename Surface_mesh_segmentation/examples/Surface_mesh_segmentation/{surface_mesh_segmentation_example.cpp => compute_sdf_values_and_segment_example.cpp} (84%) rename Surface_mesh_segmentation/examples/Surface_mesh_segmentation/{surface_mesh_segmentation_example.cmd => compute_sdf_values_and_segment_with_facet_ids_example.cmd} (100%) rename Surface_mesh_segmentation/examples/Surface_mesh_segmentation/{surface_mesh_segmentation_with_facet_ids_example.cpp => compute_sdf_values_and_segment_with_facet_ids_example.cpp} (81%) rename Surface_mesh_segmentation/examples/Surface_mesh_segmentation/{surface_mesh_segmentation_from_sdf_values_example.cmd => compute_sdf_values_example.cmd} (100%) rename Surface_mesh_segmentation/examples/Surface_mesh_segmentation/{sdf_values_computation_example.cpp => compute_sdf_values_example.cpp} (77%) rename Surface_mesh_segmentation/examples/Surface_mesh_segmentation/{surface_mesh_segmentation_with_facet_ids_example.cmd => segment_from_sdf_values_example.cmd} (100%) rename Surface_mesh_segmentation/examples/Surface_mesh_segmentation/{surface_mesh_segmentation_from_sdf_values_example.cpp => segment_from_sdf_values_example.cpp} (76%) diff --git a/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/sdf_values_computation_example.cmd b/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/compute_sdf_values_and_segment_example.cmd similarity index 100% rename from Surface_mesh_segmentation/examples/Surface_mesh_segmentation/sdf_values_computation_example.cmd rename to Surface_mesh_segmentation/examples/Surface_mesh_segmentation/compute_sdf_values_and_segment_example.cmd diff --git a/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/surface_mesh_segmentation_example.cpp b/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/compute_sdf_values_and_segment_example.cpp similarity index 84% rename from Surface_mesh_segmentation/examples/Surface_mesh_segmentation/surface_mesh_segmentation_example.cpp rename to Surface_mesh_segmentation/examples/Surface_mesh_segmentation/compute_sdf_values_and_segment_example.cpp index dc5c6165fef..73b8a365060 100644 --- a/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/surface_mesh_segmentation_example.cpp +++ b/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/compute_sdf_values_and_segment_example.cpp @@ -1,45 +1,46 @@ -#include -#include -#include -#include - -#include - -#include -#include - -typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; -typedef CGAL::Polyhedron_3 Polyhedron; - -int main(int argc, char **argv) -{ - if (argc !=2){ - std::cerr << "Usage: " << argv[0] << " input.off\n"; - return 1; - } - - // create and read Polyhedron - Polyhedron mesh; - std::ifstream input(argv[1]); - - if ( !input || !(input >> mesh) || mesh.empty() ){ - std::cerr << argv[1] << " is not a valid off file.\n"; - return 1; - } - - // create a property-map for segment-ids (it is an adaptor for this case) - typedef std::map Facet_int_map; - Facet_int_map internal_segment_map; - boost::associative_property_map segment_property_map(internal_segment_map); - - // calculate SDF values and segment the mesh using default parameters. - int number_of_segments = CGAL::surface_mesh_segmentation(mesh, segment_property_map); - - std::cout << "Number of segments: " << number_of_segments << std::endl; - // print segment-ids - for(Polyhedron::Facet_const_iterator facet_it = mesh.facets_begin(); - facet_it != mesh.facets_end(); ++facet_it) - { - std::cout << segment_property_map[facet_it] << std::endl; - } +#include +#include +#include +#include + +#include + +#include +#include + +typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; +typedef CGAL::Polyhedron_3 Polyhedron; + +int main(int argc, char **argv) +{ + if (argc !=2){ + std::cerr << "Usage: " << argv[0] << " input.OFF" << std::endl; + return 1; + } + + // create and read Polyhedron + Polyhedron mesh; + std::ifstream input(argv[1]); + + if ( !input || !(input >> mesh) || mesh.empty() ){ + std::cerr << argv[1] << " is not a valid off file." << std::endl; + return 1; + } + + // create a property-map for segment-ids (it is an adaptor for this case) + typedef std::map Facet_int_map; + Facet_int_map internal_segment_map; + boost::associative_property_map segment_property_map(internal_segment_map); + + // calculate SDF values and segment the mesh using default parameters. + int number_of_segments = CGAL::compute_sdf_values_and_segment(mesh, segment_property_map); + + std::cout << "Number of segments: " << number_of_segments << std::endl; + + // print segment-ids + for(Polyhedron::Facet_const_iterator facet_it = mesh.facets_begin(); + facet_it != mesh.facets_end(); ++facet_it) + { + 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_example.cmd b/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/compute_sdf_values_and_segment_with_facet_ids_example.cmd similarity index 100% rename from Surface_mesh_segmentation/examples/Surface_mesh_segmentation/surface_mesh_segmentation_example.cmd rename to Surface_mesh_segmentation/examples/Surface_mesh_segmentation/compute_sdf_values_and_segment_with_facet_ids_example.cmd diff --git a/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/surface_mesh_segmentation_with_facet_ids_example.cpp b/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/compute_sdf_values_and_segment_with_facet_ids_example.cpp similarity index 81% rename from Surface_mesh_segmentation/examples/Surface_mesh_segmentation/surface_mesh_segmentation_with_facet_ids_example.cpp rename to Surface_mesh_segmentation/examples/Surface_mesh_segmentation/compute_sdf_values_and_segment_with_facet_ids_example.cpp index 4d4db390f53..8a2eb1d6c0e 100644 --- a/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/surface_mesh_segmentation_with_facet_ids_example.cpp +++ b/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/compute_sdf_values_and_segment_with_facet_ids_example.cpp @@ -1,85 +1,86 @@ -#include -#include -#include -#include -#include - -#include - -#include -#include - -typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; -typedef CGAL::Polyhedron_3 Polyhedron; - -// Property map using the fact that each facet is assigned an integer -// to store associated information into a vector -template -struct Polyhedron_with_id_to_vector_property_map - : public boost::put_get_helper > -{ -public: - typedef typename PolyhedronWithId::Facet_const_handle key_type; - typedef ValueType value_type; - typedef value_type& reference; - typedef boost::lvalue_property_map_tag category; - - Polyhedron_with_id_to_vector_property_map() : internal_vector(NULL) { } - Polyhedron_with_id_to_vector_property_map(std::vector* internal_vector) - : internal_vector(internal_vector) { } - - reference operator[](key_type key) const { return (*internal_vector)[key->id()]; } -private: - std::vector* internal_vector; -}; - -int main(int argc, char **argv) -{ - if (argc !=2){ - std::cerr << "Usage: " << argv[0] << " input.off\n"; - return 1; - } - - // create and read Polyhedron - Polyhedron mesh; - std::ifstream input(argv[1]); - - if ( !input || !(input >> mesh) || mesh.empty() ){ - std::cerr << argv[1] << " is not a valid off file.\n"; - return 1; - } - - // assign id field for each facet - int facet_id = 0; - for(Polyhedron::Facet_iterator facet_it = mesh.facets_begin(); - facet_it != mesh.facets_end(); ++facet_it, ++facet_id) - { - facet_it->id() = facet_id; - } - - // create a property-map for sdf values - std::vector sdf_values(mesh.size_of_facets()); - Polyhedron_with_id_to_vector_property_map sdf_property_map(&sdf_values); - - CGAL::sdf_values_computation(mesh, sdf_property_map); - // access sdf values (with constant-complexity) either via sdf_values or sdf_property_map - for(Polyhedron::Facet_const_iterator facet_it = mesh.facets_begin(); - facet_it != mesh.facets_end(); ++facet_it) - { - std::cout << (sdf_property_map[facet_it] == sdf_values[facet_it->id()]) << std::endl; - } - - // create a property-map for segment-ids - std::vector segment_ids(mesh.size_of_facets()); - Polyhedron_with_id_to_vector_property_map segment_property_map(&segment_ids); - - CGAL::surface_mesh_segmentation_from_sdf_values(mesh, sdf_property_map, segment_property_map); - - // access segment-ids (with constant-complexity) either via segment_ids or segment_property_map - for(Polyhedron::Facet_const_iterator facet_it = mesh.facets_begin(); - facet_it != mesh.facets_end(); ++facet_it) - { - std::cout << (segment_property_map[facet_it] == segment_ids[facet_it->id()]) << std::endl; - } +#include +#include +#include +#include +#include + +#include + +#include +#include + +typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; +typedef CGAL::Polyhedron_3 Polyhedron; + +// Property map using the fact that each facet is assigned an integer +// to store associated information into a vector +template +struct Polyhedron_with_id_to_vector_property_map + : public boost::put_get_helper > +{ +public: + typedef typename PolyhedronWithId::Facet_const_handle key_type; + typedef ValueType value_type; + typedef value_type& reference; + typedef boost::lvalue_property_map_tag category; + + Polyhedron_with_id_to_vector_property_map() : internal_vector(NULL) { } + Polyhedron_with_id_to_vector_property_map(std::vector* internal_vector) + : internal_vector(internal_vector) { } + + reference operator[](key_type key) const { return (*internal_vector)[key->id()]; } +private: + std::vector* internal_vector; +}; + +int main(int argc, char **argv) +{ + if (argc !=2){ + std::cerr << "Usage: " << argv[0] << " input.OFF" << std::endl; + return 1; + } + + // create and read Polyhedron + Polyhedron mesh; + std::ifstream input(argv[1]); + + if ( !input || !(input >> mesh) || mesh.empty() ){ + std::cerr << argv[1] << " is not a valid off file." << std::endl; + return 1; + } + + // assign id field for each facet + int facet_id = 0; + for(Polyhedron::Facet_iterator facet_it = mesh.facets_begin(); + facet_it != mesh.facets_end(); ++facet_it, ++facet_id) + { + facet_it->id() = facet_id; + } + + // create a property-map for sdf values + std::vector sdf_values(mesh.size_of_facets()); + Polyhedron_with_id_to_vector_property_map sdf_property_map(&sdf_values); + + CGAL::compute_sdf_values(mesh, sdf_property_map); + + // access sdf values (with constant-complexity) either via sdf_values or sdf_property_map + for(Polyhedron::Facet_const_iterator facet_it = mesh.facets_begin(); + facet_it != mesh.facets_end(); ++facet_it) + { + std::cout << sdf_property_map[facet_it] << std::endl; // or segment_ids[facet_it->id()] + } + + // create a property-map for segment-ids + std::vector segment_ids(mesh.size_of_facets()); + Polyhedron_with_id_to_vector_property_map segment_property_map(&segment_ids); + + CGAL::segment_from_sdf_values(mesh, sdf_property_map, segment_property_map); + + // access segment-ids (with constant-complexity) either via segment_ids or segment_property_map + for(Polyhedron::Facet_const_iterator facet_it = mesh.facets_begin(); + facet_it != mesh.facets_end(); ++facet_it) + { + std::cout << segment_property_map[facet_it] << std::endl; // or segment_ids[facet_it->id()] + } } \ No newline at end of file diff --git a/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/surface_mesh_segmentation_from_sdf_values_example.cmd b/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/compute_sdf_values_example.cmd similarity index 100% rename from Surface_mesh_segmentation/examples/Surface_mesh_segmentation/surface_mesh_segmentation_from_sdf_values_example.cmd rename to Surface_mesh_segmentation/examples/Surface_mesh_segmentation/compute_sdf_values_example.cmd diff --git a/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/sdf_values_computation_example.cpp b/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/compute_sdf_values_example.cpp similarity index 77% rename from Surface_mesh_segmentation/examples/Surface_mesh_segmentation/sdf_values_computation_example.cpp rename to Surface_mesh_segmentation/examples/Surface_mesh_segmentation/compute_sdf_values_example.cpp index 749fe9d6491..853ceb5d99b 100644 --- a/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/sdf_values_computation_example.cpp +++ b/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/compute_sdf_values_example.cpp @@ -1,62 +1,64 @@ -#include -#include -#include -#include - -#include - -#include -#include - -typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; -typedef CGAL::Polyhedron_3 Polyhedron; - -int main(int argc, char **argv) -{ - if (argc !=2){ - std::cerr << "Usage: " << argv[0] << " input.off\n"; - return 1; - } - - // create and read Polyhedron - Polyhedron mesh; - std::ifstream input(argv[1]); - - if ( !input || !(input >> mesh) || mesh.empty() ){ - std::cerr << argv[1] << " is not a valid off file.\n"; - return 1; - } - - // create a property-map (it is an adaptor for this case) - typedef std::map Facet_double_map; - Facet_double_map internal_map; - boost::associative_property_map sdf_property_map(internal_map); - - // compute sdf values using default parameters for number of rays, and cone angle - std::pair min_max_sdf = CGAL::sdf_values_computation(mesh, sdf_property_map); - // print minimum & maximum sdf values - std::cout << "minimum sdf: " << min_max_sdf.first << " maximum sdf: " << min_max_sdf.second << std::endl; - // print sdf values - for(Polyhedron::Facet_const_iterator facet_it = mesh.facets_begin(); - facet_it != mesh.facets_end(); ++facet_it) - { - std::cout << sdf_property_map[facet_it] << std::endl; - } - - int number_of_rays = 30; // cast 30 rays per facet - double cone_angle = (1.0 / 2.0) * CGAL_PI; // use 90 degrees for cone opening-angle - - // create another property-map - Facet_double_map internal_map_2; - boost::associative_property_map sdf_property_map_2(internal_map_2); - - // use custom parameters for number of rays, and cone angle. - CGAL::sdf_values_computation(mesh, sdf_property_map_2, cone_angle, number_of_rays); - - // print differences - for(Polyhedron::Facet_const_iterator facet_it = mesh.facets_begin(); - facet_it != mesh.facets_end(); ++facet_it) - { - std::cout << sdf_property_map[facet_it] - sdf_property_map_2[facet_it] << std::endl; - } +#include +#include +#include +#include + +#include + +#include +#include + +typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; +typedef CGAL::Polyhedron_3 Polyhedron; + +int main(int argc, char **argv) +{ + if (argc !=2){ + std::cerr << "Usage: " << argv[0] << " input.off" << std::endl; + return 1; + } + + // create and read Polyhedron + Polyhedron mesh; + std::ifstream input(argv[1]); + + if ( !input || !(input >> mesh) || mesh.empty() ){ + std::cerr << argv[1] << " is not a valid off file." << std::endl; + return 1; + } + + // create a property-map (it is an adaptor for this case) + typedef std::map Facet_double_map; + Facet_double_map internal_map; + boost::associative_property_map sdf_property_map(internal_map); + + // compute sdf values using default parameters for number of rays, and cone angle + std::pair min_max_sdf = CGAL::compute_sdf_values(mesh, sdf_property_map); + + // print minimum & maximum sdf values + std::cout << "minimum sdf: " << min_max_sdf.first << " maximum sdf: " << min_max_sdf.second << std::endl; + + // print sdf values + for(Polyhedron::Facet_const_iterator facet_it = mesh.facets_begin(); + facet_it != mesh.facets_end(); ++facet_it) + { + std::cout << sdf_property_map[facet_it] << std::endl; + } + + const int number_of_rays = 30; // cast 30 rays per facet + const double cone_angle = (1.0 / 2.0) * CGAL_PI; // use 90 degrees for cone opening-angle + + // create another property-map + Facet_double_map internal_map_2; + boost::associative_property_map sdf_property_map_2(internal_map_2); + + // use custom parameters for number of rays, and cone angle. + CGAL::compute_sdf_values(mesh, sdf_property_map_2, cone_angle, number_of_rays); + + // print differences + for(Polyhedron::Facet_const_iterator facet_it = mesh.facets_begin(); + facet_it != mesh.facets_end(); ++facet_it) + { + 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_with_facet_ids_example.cmd b/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/segment_from_sdf_values_example.cmd similarity index 100% rename from Surface_mesh_segmentation/examples/Surface_mesh_segmentation/surface_mesh_segmentation_with_facet_ids_example.cmd rename to Surface_mesh_segmentation/examples/Surface_mesh_segmentation/segment_from_sdf_values_example.cmd 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/segment_from_sdf_values_example.cpp similarity index 76% rename from Surface_mesh_segmentation/examples/Surface_mesh_segmentation/surface_mesh_segmentation_from_sdf_values_example.cpp rename to Surface_mesh_segmentation/examples/Surface_mesh_segmentation/segment_from_sdf_values_example.cpp index 76951c19f81..eb7a9e31ff5 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/segment_from_sdf_values_example.cpp @@ -1,63 +1,62 @@ - -#include -#include -#include -#include - -#include - -#include -#include - -typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; -typedef CGAL::Polyhedron_3 Polyhedron; - -int main(int argc, char **argv) -{ - if (argc !=2){ - std::cerr << "Usage: " << argv[0] << " input.off\n"; - return 1; - } - - // create and read Polyhedron - Polyhedron mesh; - std::ifstream input(argv[1]); - - if ( !input || !(input >> mesh) || mesh.empty() ){ - std::cerr << argv[1] << " is not a valid off file.\n"; - return 1; - } - - // create a property-map for sdf values (it is an adaptor for this case) - typedef std::map Facet_double_map; - Facet_double_map internal_sdf_map; - boost::associative_property_map sdf_property_map(internal_sdf_map); - - // compute sdf values using default parameters for number of rays, and cone angle - 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; - Facet_int_map internal_segment_map; - boost::associative_property_map segment_property_map(internal_segment_map); - - // segment the mesh using default parameters for number of levels, and smoothing lambda - int number_of_segments = CGAL::surface_mesh_segmentation_from_sdf_values(mesh, sdf_property_map, segment_property_map); - - std::cout << "Number of segments: " << number_of_segments << std::endl; - // print segment-ids - for(Polyhedron::Facet_const_iterator facet_it = mesh.facets_begin(); - facet_it != mesh.facets_end(); ++facet_it) - { - // ids are between [0, number_of_segments -1] - std::cout << segment_property_map[facet_it] << std::endl; - } - - int number_of_levels = 4; // use 4 clusters in soft clustering - double smoothing_lambda = 0.3; // importance of surface features, between [0,1] - - // Note that we can use same sdf values (sdf_property_map) over and over again for segmentation. - // 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); +#include +#include +#include +#include + +#include + +#include +#include + +typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; +typedef CGAL::Polyhedron_3 Polyhedron; + +int main(int argc, char **argv) +{ + if (argc !=2){ + std::cerr << "Usage: " << argv[0] << " input.OFF" << std::endl; + return 1; + } + + // create and read Polyhedron + Polyhedron mesh; + std::ifstream input(argv[1]); + + if ( !input || !(input >> mesh) || mesh.empty() ){ + std::cerr << argv[1] << " is not a valid off file." << std::endl; + return 1; + } + + // create a property-map for sdf values (it is an adaptor for this case) + typedef std::map Facet_double_map; + Facet_double_map internal_sdf_map; + boost::associative_property_map sdf_property_map(internal_sdf_map); + + // compute sdf values using default parameters for number of rays, and cone angle + CGAL::compute_sdf_values(mesh, sdf_property_map); + + // create a property-map for segment-ids (it is an adaptor for this case) + typedef std::map Facet_int_map; + Facet_int_map internal_segment_map; + boost::associative_property_map segment_property_map(internal_segment_map); + + // segment the mesh using default parameters for number of levels, and smoothing lambda + int number_of_segments = CGAL::segment_from_sdf_values(mesh, sdf_property_map, segment_property_map); + + std::cout << "Number of segments: " << number_of_segments << std::endl; + // print segment-ids + for(Polyhedron::Facet_const_iterator facet_it = mesh.facets_begin(); + facet_it != mesh.facets_end(); ++facet_it) + { + // ids are between [0, number_of_segments -1] + std::cout << segment_property_map[facet_it] << std::endl; + } + + const int number_of_levels = 4; // use 4 clusters in soft clustering + const double smoothing_lambda = 0.3; // importance of surface features, between [0,1] + + // Note that we can use same sdf values (sdf_property_map) over and over again for segmentation. + // This feature becomes important when we want to segment the mesh several times with different parameters. + CGAL::segment_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 8499d7e1389..b299c920bf6 100644 --- a/Surface_mesh_segmentation/include/CGAL/mesh_segmentation.h +++ b/Surface_mesh_segmentation/include/CGAL/mesh_segmentation.h @@ -40,11 +40,11 @@ template std::pair -sdf_values_computation(const Polyhedron& polyhedron, - SDFPropertyMap sdf_values, - double cone_angle = 2.0 / 3.0 * CGAL_PI, - int number_of_rays = 25, - GeomTraits traits = GeomTraits()) +compute_sdf_values(const Polyhedron& polyhedron, + SDFPropertyMap sdf_values, + double cone_angle = 2.0 / 3.0 * CGAL_PI, + int number_of_rays = 25, + GeomTraits traits = GeomTraits()) { internal::Surface_mesh_segmentation algorithm( polyhedron, traits); @@ -81,12 +81,12 @@ template int -surface_mesh_segmentation_from_sdf_values(const Polyhedron& polyhedron, - SDFPropertyMap sdf_values, - SegmentPropertyMap segment_ids, - int number_of_levels = 5, - double smoothing_lambda = 0.26, - GeomTraits traits = GeomTraits()) +segment_from_sdf_values(const Polyhedron& polyhedron, + SDFPropertyMap sdf_values, + SegmentPropertyMap segment_ids, + int number_of_levels = 5, + double smoothing_lambda = 0.26, + GeomTraits traits = GeomTraits()) { smoothing_lambda = (std::max)(0.0, (std::min)(1.0, smoothing_lambda)); // clip into [0-1] @@ -126,13 +126,13 @@ template < class Polyhedron, class SegmentPropertyMap, class GeomTraits #endif > int -surface_mesh_segmentation(const Polyhedron& polyhedron, - SegmentPropertyMap segment_ids, - double cone_angle = 2.0 / 3.0 * CGAL_PI, - int number_of_rays = 25, - int number_of_levels = 5, - double smoothing_lambda = 0.26, - GeomTraits traits = GeomTraits()) +compute_sdf_values_and_segment(const Polyhedron& polyhedron, + SegmentPropertyMap segment_ids, + double cone_angle = 2.0 / 3.0 * CGAL_PI, + int number_of_rays = 25, + int number_of_levels = 5, + double smoothing_lambda = 0.26, + GeomTraits traits = GeomTraits()) { smoothing_lambda = (std::max)(0.0, (std::min)(1.0, smoothing_lambda)); // clip into [0-1] @@ -143,9 +143,9 @@ surface_mesh_segmentation(const Polyhedron& polyhedron, boost::associative_property_map sdf_property_map( internal_sdf_map); - sdf_values_computation, GeomTraits> + compute_sdf_values, GeomTraits> (polyhedron, sdf_property_map, cone_angle, number_of_rays, traits); - return surface_mesh_segmentation_from_sdf_values, SegmentPropertyMap, GeomTraits> + return segment_from_sdf_values, SegmentPropertyMap, GeomTraits> (polyhedron, sdf_property_map, segment_ids, number_of_levels, smoothing_lambda, traits); } @@ -154,41 +154,41 @@ surface_mesh_segmentation(const Polyhedron& polyhedron, #ifdef BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS template std::pair -sdf_values_computation(const Polyhedron& polyhedron, - SDFPropertyMap sdf_values, - double cone_angle = 2.0 / 3.0 * CGAL_PI, - int number_of_rays = 25, - typename Polyhedron::Traits traits = typename Polyhedron::Traits()) +compute_sdf_values(const Polyhedron& polyhedron, + SDFPropertyMap sdf_values, + double cone_angle = 2.0 / 3.0 * CGAL_PI, + int number_of_rays = 25, + typename Polyhedron::Traits traits = typename Polyhedron::Traits()) { - return sdf_values_computation + return compute_sdf_values (polyhedron, sdf_values, cone_angle, number_of_rays, traits); } template int -surface_mesh_segmentation_from_sdf_values(const Polyhedron& polyhedron, - SDFPropertyMap sdf_values, - SegmentPropertyMap segment_ids, - int number_of_levels = 5, - double smoothing_lambda = 0.26, - typename Polyhedron::Traits traits = typename Polyhedron::Traits()) +segment_from_sdf_values(const Polyhedron& polyhedron, + SDFPropertyMap sdf_values, + SegmentPropertyMap segment_ids, + int number_of_levels = 5, + double smoothing_lambda = 0.26, + typename Polyhedron::Traits traits = typename Polyhedron::Traits()) { - return surface_mesh_segmentation_from_sdf_values + return segment_from_sdf_values (polyhedron, sdf_values, segment_ids, number_of_levels, smoothing_lambda, traits); } template int -surface_mesh_segmentation(const Polyhedron& polyhedron, - SegmentPropertyMap segment_ids, - double cone_angle = 2.0 / 3.0 * CGAL_PI, - int number_of_rays = 25, - int number_of_levels = 5, - double smoothing_lambda = 0.26, - typename Polyhedron::Traits traits = typename Polyhedron::Traits()) +compute_sdf_values_and_segment(const Polyhedron& polyhedron, + SegmentPropertyMap segment_ids, + double cone_angle = 2.0 / 3.0 * CGAL_PI, + int number_of_rays = 25, + int number_of_levels = 5, + double smoothing_lambda = 0.26, + typename Polyhedron::Traits traits = typename Polyhedron::Traits()) { - return surface_mesh_segmentation + return compute_sdf_values_and_segment (polyhedron, segment_ids, cone_angle, number_of_rays, number_of_levels, smoothing_lambda, traits); }