diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h b/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h index 7f344e37230..478cedf5340 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h @@ -258,7 +258,7 @@ CGAL_add_named_parameter(minimum_region_size_t, minimum_region_size, minimum_reg CGAL_add_named_parameter(sphere_radius_t, sphere_radius, sphere_radius) CGAL_add_named_parameter(k_neighbors_t, k_neighbors, k_neighbors) CGAL_add_named_parameter(item_map_t, item_map, item_map) -CGAL_add_named_parameter(cosine_value_t, cosine_value, cosine_value) +CGAL_add_named_parameter(cosine_of_maxium_angle_t, cosine_of_maxium_angle, cosine_of_maxium_angle) CGAL_add_named_parameter(minimum_radius_t, minimum_radius, minimum_radius) CGAL_add_named_parameter(maximum_radius_t, maximum_radius, maximum_radius) diff --git a/Shape_detection/include/CGAL/Polygon_mesh_processing/region_growing.h b/Shape_detection/include/CGAL/Polygon_mesh_processing/region_growing.h index 0d3357c3fde..fdd9ee64d47 100644 --- a/Shape_detection/include/CGAL/Polygon_mesh_processing/region_growing.h +++ b/Shape_detection/include/CGAL/Polygon_mesh_processing/region_growing.h @@ -53,9 +53,9 @@ namespace Polygon_mesh_processing { such that they are considered part of the same region} \cgalParamType{`GeomTraits::FT` with `GeomTraits` being the type of the parameter `geom_traits`} \cgalParamDefault{25 degrees} - \cgalParamExtra{this parameter and `cosine_value` are exclusive} + \cgalParamExtra{this parameter and `cosine_of_maxium_angle` are exclusive} \cgalParamNEnd - \cgalParamNBegin{cosine_value} + \cgalParamNBegin{cosine_of_maxium_angle} \cgalParamDescription{The maximum angle, given as a cosine, between the normal of the supporting planes of adjacent faces such that they are considered part of the same region} \cgalParamType{`GeomTraits::FT` with `GeomTraits` being the type of the parameter `geom_traits`} @@ -157,7 +157,7 @@ region_growing_of_planes_on_faces(const PolygonMesh& mesh, \cgalParamDescription{the maximum distance from a point to a line such that it is considered part of the region of the line} \cgalParamType{`GeomTraits::FT` with `GeomTraits` being the type of the parameter `geom_traits`} \cgalParamDefault{1} - \cgalParamExtra{this parameter and `cosine_value` are exclusive} + \cgalParamExtra{this parameter and `cosine_of_maxium_angle` are exclusive} \cgalParamNEnd \cgalParamNBegin{maximum_angle} \cgalParamDescription{the maximum angle in degrees between two adjacent segments @@ -165,7 +165,7 @@ region_growing_of_planes_on_faces(const PolygonMesh& mesh, \cgalParamType{`GeomTraits::FT` with `GeomTraits` being the type of the parameter `geom_traits`} \cgalParamDefault{25 degrees} \cgalParamNEnd - \cgalParamNBegin{cosine_value} + \cgalParamNBegin{cosine_of_maxium_angle} \cgalParamDescription{The maximum angle, given as a cosine, between two adjacent segments such that they are considered part of the same region} \cgalParamType{`GeomTraits::FT` with `GeomTraits` being the type of the parameter `geom_traits`} @@ -204,8 +204,7 @@ detect_corners_of_regions( using parameters::get_parameter; using parameters::is_default_parameter; - typedef typename GetGeomTraits::type Traits; - + using Traits = typename GetGeomTraits::type; using Graph_traits = boost::graph_traits; using halfedge_descriptor = typename Graph_traits::halfedge_descriptor; using edge_descriptor = typename Graph_traits::edge_descriptor; @@ -213,7 +212,7 @@ detect_corners_of_regions( using vertex_descriptor = typename Graph_traits::vertex_descriptor; using Default_ecm = typename boost::template property_map >::type; - using Ecm = internal_np::Lookup_named_param_def < + using Ecm = typename internal_np::Lookup_named_param_def < internal_np::edge_is_constrained_t, CGAL_NP_CLASS, Default_ecm @@ -238,6 +237,7 @@ detect_corners_of_regions( halfedge_descriptor h = halfedge(e, mesh); face_descriptor f1 = face(h, mesh); face_descriptor f2 = face(opposite(h, mesh), mesh); + // an edge is constrained if it is a border edge or if the regions assigned to the two faces are different if (f1 == Graph_traits::null_face() || f2 == Graph_traits::null_face() || get(region_map,f1)!=get(region_map,f2)) put(ecm, e, true); } diff --git a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Point_set/Least_squares_circle_fit_region.h b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Point_set/Least_squares_circle_fit_region.h index 05d8d4e9149..0aca9432166 100644 --- a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Point_set/Least_squares_circle_fit_region.h +++ b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Point_set/Least_squares_circle_fit_region.h @@ -129,7 +129,7 @@ namespace Point_set { \cgalParamType{`GeomTraits::FT`} \cgalParamDefault{25 degrees} \cgalParamNEnd - \cgalParamNBegin{cosine_value} + \cgalParamNBegin{cosine_of_maxium_angle} \cgalParamDescription{the cos value computed as `cos(maximum_angle * PI / 180)`, this parameter can be used instead of the `maximum_angle`} \cgalParamType{`GeomTraits::FT`} @@ -168,7 +168,7 @@ namespace Point_set { \pre `maximum_distance >= 0` \pre `maximum_angle >= 0 && maximum_angle <= 90` - \pre `cosine_value >= 0 && cosine_value <= 1` + \pre `cosine_of_maxium_angle >= 0 && cosine_of_maxium_angle <= 1` \pre `minimum_region_size > 0` \pre `minimum_radius >= 0` \pre `maximum_radius >= minimum_radius` @@ -198,7 +198,7 @@ namespace Point_set { const FT default_cos_value = static_cast(std::cos(CGAL::to_double( (max_angle * static_cast(CGAL_PI)) / FT(180)))); const FT cos_value = parameters::choose_parameter( - parameters::get_parameter(np, internal_np::cosine_value), default_cos_value); + parameters::get_parameter(np, internal_np::cosine_of_maxium_angle), default_cos_value); CGAL_precondition(cos_value >= FT(0) && cos_value <= FT(1)); m_cos_value_threshold = cos_value; diff --git a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Point_set/Least_squares_cylinder_fit_region.h b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Point_set/Least_squares_cylinder_fit_region.h index 59c9992656b..c1224eaeb1c 100644 --- a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Point_set/Least_squares_cylinder_fit_region.h +++ b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Point_set/Least_squares_cylinder_fit_region.h @@ -128,7 +128,7 @@ namespace Point_set { \cgalParamType{`GeomTraits::FT`} \cgalParamDefault{25 degrees} \cgalParamNEnd - \cgalParamNBegin{cosine_value} + \cgalParamNBegin{cosine_of_maxium_angle} \cgalParamDescription{the cos value computed as `cos(maximum_angle * PI / 180)`, this parameter can be used instead of the `maximum_angle`} \cgalParamType{`GeomTraits::FT`} @@ -167,7 +167,7 @@ namespace Point_set { \pre `maximum_distance >= 0` \pre `maximum_angle >= 0 && maximum_angle <= 90` - \pre `cosine_value >= 0 && cosine_value <= 1` + \pre `cosine_of_maxium_angle >= 0 && cosine_of_maxium_angle <= 1` \pre `minimum_region_size > 0` \pre `minimum_radius >= 0` \pre `maximum_radius >= minimum_radius` @@ -197,7 +197,7 @@ namespace Point_set { const FT default_cos_value = static_cast(std::cos(CGAL::to_double( (max_angle * static_cast(CGAL_PI)) / FT(180)))); const FT cos_value = parameters::choose_parameter( - parameters::get_parameter(np, internal_np::cosine_value), default_cos_value); + parameters::get_parameter(np, internal_np::cosine_of_maxium_angle), default_cos_value); CGAL_precondition(cos_value >= FT(0) && cos_value <= FT(1)); m_cos_value_threshold = cos_value; diff --git a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Point_set/Least_squares_line_fit_region.h b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Point_set/Least_squares_line_fit_region.h index 064b75421aa..6f04d915753 100644 --- a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Point_set/Least_squares_line_fit_region.h +++ b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Point_set/Least_squares_line_fit_region.h @@ -118,7 +118,7 @@ namespace Point_set { \cgalParamType{`GeomTraits::FT`} \cgalParamDefault{25 degrees} \cgalParamNEnd - \cgalParamNBegin{cosine_value} + \cgalParamNBegin{cosine_of_maxium_angle} \cgalParamDescription{the cos value computed as `cos(maximum_angle * PI / 180)`, this parameter can be used instead of the `maximum_angle`} \cgalParamType{`GeomTraits::FT`} @@ -145,7 +145,7 @@ namespace Point_set { \pre `maximum_distance >= 0` \pre `maximum_angle >= 0 && maximum_angle <= 90` - \pre `cosine_value >= 0 && cosine_value <= 1` + \pre `cosine_of_maxium_angle >= 0 && cosine_of_maxium_angle <= 1` \pre `minimum_region_size > 0` */ template @@ -174,7 +174,7 @@ namespace Point_set { const FT default_cos_value = static_cast(std::cos(CGAL::to_double( (max_angle * static_cast(CGAL_PI)) / FT(180)))); const FT cos_value = parameters::choose_parameter( - parameters::get_parameter(np, internal_np::cosine_value), default_cos_value); + parameters::get_parameter(np, internal_np::cosine_of_maxium_angle), default_cos_value); CGAL_precondition(cos_value >= FT(0) && cos_value <= FT(1)); m_cos_value_threshold = cos_value; } diff --git a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Point_set/Least_squares_plane_fit_region.h b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Point_set/Least_squares_plane_fit_region.h index 89b234bae07..b1fe82d706f 100644 --- a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Point_set/Least_squares_plane_fit_region.h +++ b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Point_set/Least_squares_plane_fit_region.h @@ -119,7 +119,7 @@ namespace Point_set { \cgalParamType{`GeomTraits::FT`} \cgalParamDefault{25 degrees} \cgalParamNEnd - \cgalParamNBegin{cosine_value} + \cgalParamNBegin{cosine_of_maxium_angle} \cgalParamDescription{the cos value computed as `cos(maximum_angle * PI / 180)`, this parameter can be used instead of the `maximum_angle`} \cgalParamType{`GeomTraits::FT`} @@ -146,7 +146,7 @@ namespace Point_set { \pre `maximum_distance >= 0` \pre `maximum_angle >= 0 && maximum_angle <= 90` - \pre `cosine_value >= 0 && cosine_value <= 1` + \pre `cosine_of_maxium_angle >= 0 && cosine_of_maxium_angle <= 1` \pre `minimum_region_size > 0` */ template @@ -175,7 +175,7 @@ namespace Point_set { const FT default_cos_value = static_cast(std::cos(CGAL::to_double( (max_angle * static_cast(CGAL_PI)) / FT(180)))); const FT cos_value = parameters::choose_parameter( - parameters::get_parameter(np, internal_np::cosine_value), default_cos_value); + parameters::get_parameter(np, internal_np::cosine_of_maxium_angle), default_cos_value); CGAL_precondition(cos_value >= FT(0) && cos_value <= FT(1)); m_cos_value_threshold = cos_value; } diff --git a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Point_set/Least_squares_sphere_fit_region.h b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Point_set/Least_squares_sphere_fit_region.h index d2689ca1a9e..68285b5777b 100644 --- a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Point_set/Least_squares_sphere_fit_region.h +++ b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Point_set/Least_squares_sphere_fit_region.h @@ -118,7 +118,7 @@ namespace Point_set { \cgalParamType{`GeomTraits::FT`} \cgalParamDefault{25 degrees} \cgalParamNEnd - \cgalParamNBegin{cosine_value} + \cgalParamNBegin{cosine_of_maxium_angle} \cgalParamDescription{the cos value computed as `cos(maximum_angle * PI / 180)`, this parameter can be used instead of the `maximum_angle`} \cgalParamType{`GeomTraits::FT`} @@ -157,7 +157,7 @@ namespace Point_set { \pre `maximum_distance >= 0` \pre `maximum_angle >= 0 && maximum_angle <= 90` - \pre `cosine_value >= 0 && cosine_value <= 1` + \pre `cosine_of_maxium_angle >= 0 && cosine_of_maxium_angle <= 1` \pre `minimum_region_size > 0` \pre `minimum_radius >= 0` \pre `maximum_radius >= minimum_radius` @@ -187,7 +187,7 @@ namespace Point_set { const FT default_cos_value = static_cast(std::cos(CGAL::to_double( (max_angle * static_cast(CGAL_PI)) / FT(180)))); const FT cos_value = parameters::choose_parameter( - parameters::get_parameter(np, internal_np::cosine_value), default_cos_value); + parameters::get_parameter(np, internal_np::cosine_of_maxium_angle), default_cos_value); CGAL_precondition(cos_value >= FT(0) && cos_value <= FT(1)); m_cos_value_threshold = cos_value; diff --git a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Polygon_mesh/Least_squares_plane_fit_region.h b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Polygon_mesh/Least_squares_plane_fit_region.h index bbdbeeb0dce..8a3e133c0b9 100644 --- a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Polygon_mesh/Least_squares_plane_fit_region.h +++ b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Polygon_mesh/Least_squares_plane_fit_region.h @@ -118,7 +118,7 @@ namespace Polygon_mesh { \cgalParamType{`GeomTraits::FT`} \cgalParamDefault{25 degrees} \cgalParamNEnd - \cgalParamNBegin{cosine_value} + \cgalParamNBegin{cosine_of_maxium_angle} \cgalParamDescription{the cos value computed as `cos(maximum_angle * PI / 180)`, this parameter can be used instead of the `maximum_angle`} \cgalParamType{`GeomTraits::FT`} @@ -143,7 +143,7 @@ namespace Polygon_mesh { \pre `faces(tmesh).size() > 0` \pre `maximum_distance >= 0` \pre `maximum_angle >= 0 && maximum_angle <= 90` - \pre `cosine_value >= 0 && cosine_value <= 1` + \pre `cosine_of_maxium_angle >= 0 && cosine_of_maxium_angle <= 1` \pre `minimum_region_size > 0` */ template @@ -176,7 +176,7 @@ namespace Polygon_mesh { const FT default_cos_value = static_cast(std::cos(CGAL::to_double( (max_angle * static_cast(CGAL_PI)) / FT(180)))); const FT cos_value = parameters::choose_parameter( - parameters::get_parameter(np, internal_np::cosine_value), default_cos_value); + parameters::get_parameter(np, internal_np::cosine_of_maxium_angle), default_cos_value); CGAL_precondition(cos_value >= FT(0) && cos_value <= FT(1)); m_cos_value_threshold = cos_value; } diff --git a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Segment_set/Least_squares_line_fit_region.h b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Segment_set/Least_squares_line_fit_region.h index 171dc0b7e38..70b2aa0026d 100644 --- a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Segment_set/Least_squares_line_fit_region.h +++ b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Segment_set/Least_squares_line_fit_region.h @@ -128,7 +128,7 @@ namespace Segment_set { \cgalParamType{`GeomTraits::FT`} \cgalParamDefault{25 degrees} \cgalParamNEnd - \cgalParamNBegin{cosine_value} + \cgalParamNBegin{cosine_of_maxium_angle} \cgalParamDescription{the cos value computed as `cos(maximum_angle * PI / 180)`, this parameter can be used instead of the `maximum_angle`} \cgalParamType{`GeomTraits::FT`} @@ -152,7 +152,7 @@ namespace Segment_set { \pre `maximum_distance >= 0` \pre `maximum_angle >= 0 && maximum_angle <= 90` - \pre `cosine_value >= 0 && cosine_value <= 1` + \pre `cosine_of_maxium_angle >= 0 && cosine_of_maxium_angle <= 1` \pre `minimum_region_size > 0` */ template @@ -182,7 +182,7 @@ namespace Segment_set { const FT default_cos_value = static_cast(std::cos(CGAL::to_double( (max_angle * static_cast(CGAL_PI)) / FT(180)))); const FT cos_value = parameters::choose_parameter( - parameters::get_parameter(np, internal_np::cosine_value), default_cos_value); + parameters::get_parameter(np, internal_np::cosine_of_maxium_angle), default_cos_value); CGAL_precondition(cos_value >= FT(0) && cos_value <= FT(1)); m_cos_value_threshold = cos_value; } diff --git a/Shape_detection/test/Shape_detection/test_validity_sampled_data.cpp b/Shape_detection/test/Shape_detection/test_validity_sampled_data.cpp index 3f65401eb3e..58424b53aa8 100644 --- a/Shape_detection/test/Shape_detection/test_validity_sampled_data.cpp +++ b/Shape_detection/test/Shape_detection/test_validity_sampled_data.cpp @@ -122,7 +122,7 @@ void test_copied_point_cloud (const Point_set& original_points, std::size_t nb) RG_region rg_region ( CGAL::parameters:: maximum_distance(parameters.epsilon). - cosine_value(parameters.normal_threshold). + cosine_of_maxium_angle(parameters.normal_threshold). minimum_region_size(parameters.min_points)); Region_growing region_growing (points, rg_query, rg_region); std::size_t nb_detected = 0;