From c8307dc0d66ff1aa6f7e47e94e0ac0ff9bbae24d Mon Sep 17 00:00:00 2001 From: Dmitry Anisimov Date: Thu, 29 Apr 2021 15:23:38 +0200 Subject: [PATCH 01/49] added support for GenericDescriptorOutlierFilter to the CGAL libpointmatcher interface --- .../CGAL/boost/graph/named_params_helper.h | 24 +++++++++ .../CGAL/boost/graph/parameters_interface.h | 1 + .../registration_with_pointmatcher.cpp | 18 +++++-- .../compute_registration_transformation.h | 52 ++++++++++++++++--- 4 files changed, 84 insertions(+), 11 deletions(-) diff --git a/BGL/include/CGAL/boost/graph/named_params_helper.h b/BGL/include/CGAL/boost/graph/named_params_helper.h index b3a32e15dc4..53969a90367 100644 --- a/BGL/include/CGAL/boost/graph/named_params_helper.h +++ b/BGL/include/CGAL/boost/graph/named_params_helper.h @@ -435,6 +435,30 @@ CGAL_DEF_GET_INITIALIZED_INDEX_MAP(face, typename boost::graph_traits::fa > ::type type; }; + template + class GetScalarMap + { + struct DummyScalarMap + { + typedef typename std::iterator_traits::value_type key_type; + typedef typename GetK::Kernel::FT value_type; + typedef value_type reference; + typedef boost::read_write_property_map_tag category; + + typedef DummyScalarMap Self; + friend reference get(const Self&, const key_type&) { return value_type(1); } + friend void put(const Self&, const key_type&, const value_type&) { } + }; + + public: + typedef DummyScalarMap NoMap; + typedef typename internal_np::Lookup_named_param_def < + internal_np::scalar_t, + NamedParameters, + DummyScalarMap // default + > ::type type; + }; + template class GetPlaneMap { diff --git a/BGL/include/CGAL/boost/graph/parameters_interface.h b/BGL/include/CGAL/boost/graph/parameters_interface.h index a1fe60c5f75..cf944feb899 100644 --- a/BGL/include/CGAL/boost/graph/parameters_interface.h +++ b/BGL/include/CGAL/boost/graph/parameters_interface.h @@ -174,6 +174,7 @@ CGAL_add_named_parameter(pointmatcher_config_t, pointmatcher_config, pointmatche CGAL_add_named_parameter(adjacencies_t, adjacencies, adjacencies) CGAL_add_named_parameter(scan_angle_t, scan_angle_map, scan_angle_map) CGAL_add_named_parameter(scanline_id_t, scanline_id_map, scanline_id_map) +CGAL_add_named_parameter(scalar_t, scalar_map, scalar_map) // List of named parameters used in Surface_mesh_approximation package CGAL_add_named_parameter(verbose_level_t, verbose_level, verbose_level) diff --git a/Point_set_processing_3/examples/Point_set_processing_3/registration_with_pointmatcher.cpp b/Point_set_processing_3/examples/Point_set_processing_3/registration_with_pointmatcher.cpp index cfbb6463d16..c4893acaa01 100644 --- a/Point_set_processing_3/examples/Point_set_processing_3/registration_with_pointmatcher.cpp +++ b/Point_set_processing_3/examples/Point_set_processing_3/registration_with_pointmatcher.cpp @@ -21,6 +21,17 @@ typedef std::pair Pwn; typedef CGAL::First_of_pair_property_map Point_map; typedef CGAL::Second_of_pair_property_map Normal_map; +struct Weight_map +{ + typedef Pwn key_type; + typedef typename K::FT value_type; + typedef value_type reference; + typedef boost::readable_property_map_tag category; + + typedef Weight_map Self; + friend reference get(const Self&, const key_type&) { return value_type(1); } +}; + namespace params = CGAL::parameters; int main(int argc, const char** argv) @@ -63,12 +74,13 @@ int main(int argc, const char** argv) point_set_2_filters.push_back( ICP_config { /*.name=*/"MinDistDataPointsFilter" , /*.params=*/{ {"minDist", "0.5" }} } ); point_set_2_filters.push_back( ICP_config { /*.name=*/"RandomSamplingDataPointsFilter", /*.params=*/{ {"prob" , "0.05"}} } ); - // Prepare matcher function + // Prepare matcher function ICP_config matcher { /*.name=*/"KDTreeMatcher", /*.params=*/{ {"knn", "1"}, {"epsilon", "3.16"} } }; // Prepare outlier filters std::vector outlier_filters; outlier_filters.push_back( ICP_config { /*.name=*/"TrimmedDistOutlierFilter", /*.params=*/{ {"ratio", "0.75" }} } ); + outlier_filters.push_back( ICP_config { /*.name=*/"GenericDescriptorOutlierFilter", /*.params=*/{ {"descName", "weights" }} } ); // Prepare error minimizer ICP_config error_minimizer { /*.name=*/"PointToPointErrorMinimizer"}; @@ -92,7 +104,7 @@ int main(int argc, const char** argv) std::pair res = CGAL::pointmatcher::compute_registration_transformation (pwns1, pwns2, - params::point_map(Point_map()).normal_map(Normal_map()) + params::point_map(Point_map()).normal_map(Normal_map()).scalar_map(Weight_map()) .point_set_filters(point_set_1_filters) .matcher(matcher) .outlier_filters(outlier_filters) @@ -100,7 +112,7 @@ int main(int argc, const char** argv) .transformation_checkers(transformation_checkers) .inspector(inspector) .logger(logger), - params::point_map(Point_map()).normal_map(Normal_map()) + params::point_map(Point_map()).normal_map(Normal_map()).scalar_map(Weight_map()) .point_set_filters(point_set_2_filters) .transformation(identity_transform) /* initial transform for pwns2. * default value is already identity transform. diff --git a/Point_set_processing_3/include/CGAL/pointmatcher/compute_registration_transformation.h b/Point_set_processing_3/include/CGAL/pointmatcher/compute_registration_transformation.h index d561b3b26a4..735414a3766 100644 --- a/Point_set_processing_3/include/CGAL/pointmatcher/compute_registration_transformation.h +++ b/Point_set_processing_3/include/CGAL/pointmatcher/compute_registration_transformation.h @@ -220,10 +220,11 @@ template void copy_cgal_points_to_pm_matrix -(const PointRange& prange, PointMap point_map, VectorMap vector_map, PM_matrix& pm_points, PM_matrix& pm_normals) +(const PointRange& prange, PointMap point_map, VectorMap vector_map, ScalarMap scalar_map, PM_matrix& pm_points, PM_matrix& pm_normals, PM_matrix& pm_weights) { int idx = 0; for(const auto& p : prange) @@ -236,11 +237,15 @@ copy_cgal_points_to_pm_matrix pm_points(3, idx) = Scalar(1.); // normal - const auto& normal = get (vector_map, p); + const auto& normal = get(vector_map, p); pm_normals(0, idx) = normal.x(); pm_normals(1, idx) = normal.y(); pm_normals(2, idx) = normal.z(); + // weight + const auto& weight = get(scalar_map, p); + pm_weights(0, idx) = weight; + ++idx; } } @@ -251,11 +256,14 @@ template + class VectorMap2, + class ScalarMap1, + class ScalarMap2> std::pair compute_registration_transformation(const PointRange1& range1, const PointRange2& range2, PointMap1 point_map1, PointMap2 point_map2, VectorMap1 vector_map1, VectorMap2 vector_map2, + ScalarMap1 scalar_map1, ScalarMap2 scalar_map2, const typename Kernel::Aff_transformation_3& initial_transform, ICP icp) { @@ -273,8 +281,10 @@ compute_registration_transformation(const PointRange1& range1, const PointRange2 PM_matrix ref_points_pos_matrix = PM_matrix (4, nb_ref_points); PM_matrix ref_points_normal_matrix = PM_matrix (3, nb_ref_points); + PM_matrix ref_points_weight_matrix = PM_matrix (1, nb_ref_points); PM_matrix points_pos_matrix = PM_matrix (4, nb_points); PM_matrix points_normal_matrix = PM_matrix (3, nb_points); + PM_matrix points_weight_matrix = PM_matrix (1, nb_points); // In CGAL, point_set_1 is the reference while point_set_2 is the data @@ -282,16 +292,20 @@ compute_registration_transformation(const PointRange1& range1, const PointRange2 internal::copy_cgal_points_to_pm_matrix(range1, point_map1, vector_map1, + scalar_map1, ref_points_pos_matrix, // out - ref_points_normal_matrix); // out + ref_points_normal_matrix, // out + ref_points_weight_matrix); // out internal::copy_cgal_points_to_pm_matrix(range2, point_map2, vector_map2, + scalar_map2, points_pos_matrix, // out - points_normal_matrix); // out + points_normal_matrix, // out + points_weight_matrix); // out - auto construct_PM_cloud = [](const PM_matrix& positions, const PM_matrix& normals) -> PM_cloud + auto construct_PM_cloud = [](const PM_matrix& positions, const PM_matrix& normals, const PM_matrix& weights) -> PM_cloud { PM_cloud cloud; @@ -300,12 +314,13 @@ compute_registration_transformation(const PointRange1& range1, const PointRange2 cloud.addFeature("z", positions.row(2)); cloud.addFeature("pad", positions.row(3)); cloud.addDescriptor("normals", normals); + cloud.addDescriptor("weights", weights); return cloud; }; - PM_cloud ref_cloud = construct_PM_cloud(ref_points_pos_matrix, ref_points_normal_matrix); - PM_cloud cloud = construct_PM_cloud(points_pos_matrix, points_normal_matrix); + PM_cloud ref_cloud = construct_PM_cloud(ref_points_pos_matrix, ref_points_normal_matrix, ref_points_weight_matrix); + PM_cloud cloud = construct_PM_cloud(points_pos_matrix, points_normal_matrix, points_weight_matrix); PM_transform_params pm_transform_params = PM_transform_params::Identity(4,4); @@ -385,6 +400,12 @@ compute_registration_transformation(const PointRange1& range1, const PointRange2 of the iterator of `PointRange1` and whose value type is `geom_traits::Vector_3`} \cgalParamNEnd + \cgalParamNBegin{scalar_map} + \cgalParamDescription{a property map associating 1D values - scalars to the elements of the point set `point_set_1`} + \cgalParamType{a model of `ReadablePropertyMap` whose key type is the value type + of the iterator of `PointRange1` and whose value type is `geom_traits::FT`} + \cgalParamNEnd + \cgalParamNBegin{point_set_filters} \cgalParamDescription{a chain of filters to be applied to the point set} \cgalParamType{a class model of `Range`. The value type of its iterator must be `ICP_config`.} @@ -510,6 +531,12 @@ compute_registration_transformation(const PointRange1& range1, const PointRange2 of the iterator of `PointRange2` and whose value type is `geom_traits::Vector_3`} \cgalParamNEnd + \cgalParamNBegin{scalar_map} + \cgalParamDescription{a property map associating 1D values - scalars to the elements of the point set `point_set_2`} + \cgalParamType{a model of `ReadablePropertyMap` whose key type is the value type + of the iterator of `PointRange2` and whose value type is `geom_traits::FT`} + \cgalParamNEnd + \cgalParamNBegin{point_set_filters} \cgalParamDescription{a chain of filters to be applied to the point set} \cgalParamType{a class model of `Range`. The value type of its iterator must be `ICP_config`.} @@ -576,14 +603,22 @@ compute_registration_transformation (const PointRange1& point_set_1, const Point typename boost::property_traits::value_type> ::value), "The vector type of input ranges must be the same"); + typedef typename PSP::GetScalarMap::type WeightMap1; + typedef typename PSP::GetScalarMap::type WeightMap2; + CGAL_static_assertion_msg((boost::is_same< typename boost::property_traits::value_type, + typename boost::property_traits::value_type> ::value), + "The scalar type of input ranges must be the same"); + typedef typename PSP::GetK::Kernel Kernel; typedef typename Kernel::FT Scalar; typedef typename Kernel::Aff_transformation_3 Transformation; PointMap1 point_map1 = choose_parameter(get_parameter(np1, internal_np::point_map), PointMap1()); NormalMap1 normal_map1 = choose_parameter(get_parameter(np1, internal_np::normal_map), NormalMap1()); + WeightMap1 weight_map1 = choose_parameter(get_parameter(np1, internal_np::scalar_map), WeightMap1()); PointMap2 point_map2 = choose_parameter(get_parameter(np2, internal_np::point_map), PointMap2()); NormalMap2 normal_map2 = choose_parameter(get_parameter(np2, internal_np::normal_map), NormalMap2()); + WeightMap2 weight_map2 = choose_parameter(get_parameter(np2, internal_np::scalar_map), WeightMap2()); // initial transformation Transformation initial_transformation @@ -592,6 +627,7 @@ compute_registration_transformation (const PointRange1& point_set_1, const Point return internal::compute_registration_transformation(point_set_1, point_set_2, point_map1, point_map2, normal_map1, normal_map2, + weight_map1, weight_map2, initial_transformation, internal::construct_icp(np1, np2)); } From cb0e72049b18b04c012c9ed220f582a62be7bebc Mon Sep 17 00:00:00 2001 From: Dmitry Anisimov Date: Thu, 29 Apr 2021 18:07:01 +0200 Subject: [PATCH 02/49] using constant property map instead of new get scalar value class --- .../CGAL/boost/graph/named_params_helper.h | 24 ----------------- .../compute_registration_transformation.h | 26 ++++++++++++------- 2 files changed, 16 insertions(+), 34 deletions(-) diff --git a/BGL/include/CGAL/boost/graph/named_params_helper.h b/BGL/include/CGAL/boost/graph/named_params_helper.h index 53969a90367..b3a32e15dc4 100644 --- a/BGL/include/CGAL/boost/graph/named_params_helper.h +++ b/BGL/include/CGAL/boost/graph/named_params_helper.h @@ -435,30 +435,6 @@ CGAL_DEF_GET_INITIALIZED_INDEX_MAP(face, typename boost::graph_traits::fa > ::type type; }; - template - class GetScalarMap - { - struct DummyScalarMap - { - typedef typename std::iterator_traits::value_type key_type; - typedef typename GetK::Kernel::FT value_type; - typedef value_type reference; - typedef boost::read_write_property_map_tag category; - - typedef DummyScalarMap Self; - friend reference get(const Self&, const key_type&) { return value_type(1); } - friend void put(const Self&, const key_type&, const value_type&) { } - }; - - public: - typedef DummyScalarMap NoMap; - typedef typename internal_np::Lookup_named_param_def < - internal_np::scalar_t, - NamedParameters, - DummyScalarMap // default - > ::type type; - }; - template class GetPlaneMap { diff --git a/Point_set_processing_3/include/CGAL/pointmatcher/compute_registration_transformation.h b/Point_set_processing_3/include/CGAL/pointmatcher/compute_registration_transformation.h index 735414a3766..fbc6fb82a79 100644 --- a/Point_set_processing_3/include/CGAL/pointmatcher/compute_registration_transformation.h +++ b/Point_set_processing_3/include/CGAL/pointmatcher/compute_registration_transformation.h @@ -21,6 +21,7 @@ #include #include #include +#include #include @@ -590,6 +591,11 @@ compute_registration_transformation (const PointRange1& point_set_1, const Point namespace PSP = CGAL::Point_set_processing_3; + // basic types + typedef typename PSP::GetK::Kernel Kernel; + typedef typename Kernel::FT Scalar; + typedef typename Kernel::Aff_transformation_3 Transformation; + // property map types typedef typename CGAL::GetPointMap::type PointMap1; typedef typename CGAL::GetPointMap::type PointMap2; @@ -603,22 +609,22 @@ compute_registration_transformation (const PointRange1& point_set_1, const Point typename boost::property_traits::value_type> ::value), "The vector type of input ranges must be the same"); - typedef typename PSP::GetScalarMap::type WeightMap1; - typedef typename PSP::GetScalarMap::type WeightMap2; - CGAL_static_assertion_msg((boost::is_same< typename boost::property_traits::value_type, - typename boost::property_traits::value_type> ::value), - "The scalar type of input ranges must be the same"); + typedef typename std::iterator_traits::value_type key_type1; + typedef typename std::iterator_traits::value_type key_type2; - typedef typename PSP::GetK::Kernel Kernel; - typedef typename Kernel::FT Scalar; - typedef typename Kernel::Aff_transformation_3 Transformation; + typedef typename CGAL::Constant_property_map DefaultWeightMap1; + typedef typename CGAL::Constant_property_map DefaultWeightMap2; PointMap1 point_map1 = choose_parameter(get_parameter(np1, internal_np::point_map), PointMap1()); NormalMap1 normal_map1 = choose_parameter(get_parameter(np1, internal_np::normal_map), NormalMap1()); - WeightMap1 weight_map1 = choose_parameter(get_parameter(np1, internal_np::scalar_map), WeightMap1()); + auto weight_map1 = choose_parameter(get_parameter(np1, internal_np::scalar_map), DefaultWeightMap1(Scalar(1))); PointMap2 point_map2 = choose_parameter(get_parameter(np2, internal_np::point_map), PointMap2()); NormalMap2 normal_map2 = choose_parameter(get_parameter(np2, internal_np::normal_map), NormalMap2()); - WeightMap2 weight_map2 = choose_parameter(get_parameter(np2, internal_np::scalar_map), WeightMap2()); + auto weight_map2 = choose_parameter(get_parameter(np2, internal_np::scalar_map), DefaultWeightMap2(Scalar(1))); + + CGAL_static_assertion_msg((boost::is_same< typename boost::property_traits::value_type, + typename boost::property_traits::value_type> ::value), + "The scalar type of input ranges must be the same"); // initial transformation Transformation initial_transformation From 330a161e553ce73bcb2c82b89c48e8d5ff111462 Mon Sep 17 00:00:00 2001 From: Dmitry Anisimov Date: Fri, 30 Apr 2021 09:42:55 +0200 Subject: [PATCH 03/49] fixed uninitialized field warnings --- .../registration_with_pointmatcher.cpp | 6 +++--- .../CGAL/pointmatcher/compute_registration_transformation.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Point_set_processing_3/examples/Point_set_processing_3/registration_with_pointmatcher.cpp b/Point_set_processing_3/examples/Point_set_processing_3/registration_with_pointmatcher.cpp index c4893acaa01..bcc7a219548 100644 --- a/Point_set_processing_3/examples/Point_set_processing_3/registration_with_pointmatcher.cpp +++ b/Point_set_processing_3/examples/Point_set_processing_3/registration_with_pointmatcher.cpp @@ -83,7 +83,7 @@ int main(int argc, const char** argv) outlier_filters.push_back( ICP_config { /*.name=*/"GenericDescriptorOutlierFilter", /*.params=*/{ {"descName", "weights" }} } ); // Prepare error minimizer - ICP_config error_minimizer { /*.name=*/"PointToPointErrorMinimizer"}; + ICP_config error_minimizer { /*.name=*/"PointToPointErrorMinimizer", /*.params=*/{ } }; // Prepare transformation checker std::vector transformation_checkers; @@ -93,10 +93,10 @@ int main(int argc, const char** argv) {"smoothLength" , "4" } } } ); // Prepare inspector - ICP_config inspector { /*.name=*/"NullInspector" }; + ICP_config inspector { /*.name=*/"NullInspector", /*.params=*/{ } }; // Prepare logger - ICP_config logger { /*.name=*/"FileLogger" }; + ICP_config logger { /*.name=*/"FileLogger", /*.params=*/{ } }; const K::Aff_transformation_3 identity_transform = K::Aff_transformation_3(CGAL::Identity_transformation()); diff --git a/Point_set_processing_3/include/CGAL/pointmatcher/compute_registration_transformation.h b/Point_set_processing_3/include/CGAL/pointmatcher/compute_registration_transformation.h index fbc6fb82a79..d3b25447aa7 100644 --- a/Point_set_processing_3/include/CGAL/pointmatcher/compute_registration_transformation.h +++ b/Point_set_processing_3/include/CGAL/pointmatcher/compute_registration_transformation.h @@ -79,7 +79,7 @@ construct_icp(const NamedParameters1& np1, const NamedParameters2& np2) icp.setDefault(); - const ICP_config null_config { "_null_pm_config_in_cgal" }; + const ICP_config null_config { /*.name=*/"_null_pm_config_in_cgal", /*.params=*/{ } }; const std::vector null_config_chain { null_config }; auto is_null_config = [&](const ICP_config& c) { return !c.name.compare(null_config.name); }; From 0cdd91e98a4822c4bbdb300b6bc2d77d37ce9a6a Mon Sep 17 00:00:00 2001 From: Dmitry Anisimov Date: Fri, 30 Apr 2021 16:32:48 +0200 Subject: [PATCH 04/49] explained default value in the named parameters --- .../CGAL/pointmatcher/compute_registration_transformation.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Point_set_processing_3/include/CGAL/pointmatcher/compute_registration_transformation.h b/Point_set_processing_3/include/CGAL/pointmatcher/compute_registration_transformation.h index d3b25447aa7..1ba4ae98f76 100644 --- a/Point_set_processing_3/include/CGAL/pointmatcher/compute_registration_transformation.h +++ b/Point_set_processing_3/include/CGAL/pointmatcher/compute_registration_transformation.h @@ -405,6 +405,7 @@ compute_registration_transformation(const PointRange1& range1, const PointRange2 \cgalParamDescription{a property map associating 1D values - scalars to the elements of the point set `point_set_1`} \cgalParamType{a model of `ReadablePropertyMap` whose key type is the value type of the iterator of `PointRange1` and whose value type is `geom_traits::FT`} + \cgalParamDefault{`CGAL::Constant_property_map` with the value = 1 for all scalars} \cgalParamNEnd \cgalParamNBegin{point_set_filters} @@ -536,6 +537,7 @@ compute_registration_transformation(const PointRange1& range1, const PointRange2 \cgalParamDescription{a property map associating 1D values - scalars to the elements of the point set `point_set_2`} \cgalParamType{a model of `ReadablePropertyMap` whose key type is the value type of the iterator of `PointRange2` and whose value type is `geom_traits::FT`} + \cgalParamDefault{`CGAL::Constant_property_map` with the value = 1 for all scalars} \cgalParamNEnd \cgalParamNBegin{point_set_filters} From 20d1629e1b271d94bfc8cc84d38a5abf3f4329b6 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 30 Apr 2021 17:39:57 +0200 Subject: [PATCH 05/49] Add compare_slope with 4 points --- .../include/CGAL/Cartesian/function_objects.h | 10 ++++ .../CGAL/Homogeneous/function_objects.h | 52 +++++++++++-------- .../Concepts/FunctionObjectConcepts.h | 10 ++++ .../include/CGAL/Kernel/global_functions_2.h | 9 ++++ .../CGAL/Kernel/global_functions_internal_2.h | 11 ++++ .../test/Kernel_23/include/CGAL/_test_new_2.h | 3 +- 6 files changed, 72 insertions(+), 23 deletions(-) diff --git a/Cartesian_kernel/include/CGAL/Cartesian/function_objects.h b/Cartesian_kernel/include/CGAL/Cartesian/function_objects.h index 7bc920bd961..2508e6f8f81 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/function_objects.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/function_objects.h @@ -606,6 +606,7 @@ namespace CartesianKernelFunctors { template class Compare_slope_2 { + typedef typename K::Point_2 Point_2; typedef typename K::Line_2 Line_2; typedef typename K::Segment_2 Segment_2; public: @@ -625,6 +626,15 @@ namespace CartesianKernelFunctors { s2.source().x(), s2.source().y(), s2.target().x(), s2.target().y()); } + + result_type + operator()(const Point_2& s1s, const Point_2& s1t, const Point_2& s2s, const Point_2& s2t) const + { + return compare_slopesC2(s1s.x(), s1s.y(), + s1t.x(), s1t.y(), + s2s.x(), s2s.y(), + s2t.x(), s2t.y()); + } }; template diff --git a/Homogeneous_kernel/include/CGAL/Homogeneous/function_objects.h b/Homogeneous_kernel/include/CGAL/Homogeneous/function_objects.h index 2868dd8f7d2..7123511b4d5 100644 --- a/Homogeneous_kernel/include/CGAL/Homogeneous/function_objects.h +++ b/Homogeneous_kernel/include/CGAL/Homogeneous/function_objects.h @@ -810,6 +810,7 @@ namespace HomogeneousKernelFunctors { template class Compare_slope_2 { + typedef typename K::Point_2 Point_2; typedef typename K::Line_2 Line_2; typedef typename K::Segment_2 Segment_2; public: @@ -842,48 +843,55 @@ namespace HomogeneousKernelFunctors { result_type operator()(const Segment_2& s1, const Segment_2& s2) const + { + return (*this)(s1.source(), s1.target(), + s2.source(), s2.target()); + } + + result_type + operator()(const Point_2& s1s, const Point_2& s1t, const Point_2& s2s, const Point_2& s2t) const { typedef typename K::FT FT; - typename K::Comparison_result cmp_y1 = compare_y(s1.source(), s1.target()); + typename K::Comparison_result cmp_y1 = compare_y(s1s, s1t); if (cmp_y1 == EQUAL) // horizontal { - typename K::Comparison_result cmp_x2 = compare_x(s2.source(), s2.target()); + typename K::Comparison_result cmp_x2 = compare_x(s2s, s2t); if (cmp_x2 == EQUAL) return SMALLER; - FT s_hw = s2.source().hw(); - FT t_hw = s2.target().hw(); - return - CGAL_NTS sign(s2.source().hy()*t_hw - s2.target().hy()*s_hw) * - CGAL_NTS sign(s2.source().hx()*t_hw - s2.target().hx()*s_hw); + FT s_hw = s2s.hw(); + FT t_hw = s2t.hw(); + return - CGAL_NTS sign(s2s.hy()*t_hw - s2t.hy()*s_hw) * + CGAL_NTS sign(s2s.hx()*t_hw - s2t.hx()*s_hw); } - typename K::Comparison_result cmp_y2 = compare_y(s2.source(), s2.target()); + typename K::Comparison_result cmp_y2 = compare_y(s2s, s2t); if (cmp_y2 == EQUAL) { - typename K::Comparison_result cmp_x1 = compare_x(s1.source(), s1.target()); + typename K::Comparison_result cmp_x1 = compare_x(s1s, s1t); if (cmp_x1 == EQUAL) return LARGER; - FT s_hw = s1.source().hw(); - FT t_hw = s1.target().hw(); - return CGAL_NTS sign(s1.source().hy()*t_hw - s1.target().hy()*s_hw) * - CGAL_NTS sign(s1.source().hx()*t_hw - s1.target().hx()*s_hw); + FT s_hw = s1s.hw(); + FT t_hw = s1t.hw(); + return CGAL_NTS sign(s1s.hy()*t_hw - s1t.hy()*s_hw) * + CGAL_NTS sign(s1s.hx()*t_hw - s1t.hx()*s_hw); } - typename K::Comparison_result cmp_x1 = compare_x(s1.source(), s1.target()); - typename K::Comparison_result cmp_x2 = compare_x(s2.source(), s2.target()); + typename K::Comparison_result cmp_x1 = compare_x(s1s, s1t); + typename K::Comparison_result cmp_x2 = compare_x(s2s, s2t); if (cmp_x1 == EQUAL) return cmp_x2 == EQUAL ? EQUAL : LARGER; if (cmp_x2 == EQUAL) return SMALLER; - FT s1_s_hw = s1.source().hw(); - FT s1_t_hw = s1.target().hw(); - FT s2_s_hw = s2.source().hw(); - FT s2_t_hw = s2.target().hw(); - FT s1_xdiff = s1.source().hx()*s1_t_hw - s1.target().hx()*s1_s_hw; - FT s1_ydiff = s1.source().hy()*s1_t_hw - s1.target().hy()*s1_s_hw; - FT s2_xdiff = s2.source().hx()*s2_t_hw - s2.target().hx()*s2_s_hw; - FT s2_ydiff = s2.source().hy()*s2_t_hw - s2.target().hy()*s2_s_hw; + FT s1_s_hw = s1s.hw(); + FT s1_t_hw = s1t.hw(); + FT s2_s_hw = s2s.hw(); + FT s2_t_hw = s2t.hw(); + FT s1_xdiff = s1s.hx()*s1_t_hw - s1t.hx()*s1_s_hw; + FT s1_ydiff = s1s.hy()*s1_t_hw - s1t.hy()*s1_s_hw; + FT s2_xdiff = s2s.hx()*s2_t_hw - s2t.hx()*s2_s_hw; + FT s2_ydiff = s2s.hy()*s2_t_hw - s2t.hy()*s2_s_hw; typename K::Sign s1_sign = CGAL_NTS sign(s1_ydiff * s1_xdiff); typename K::Sign s2_sign = CGAL_NTS sign(s2_ydiff * s2_xdiff); diff --git a/Kernel_23/doc/Kernel_23/Concepts/FunctionObjectConcepts.h b/Kernel_23/doc/Kernel_23/Concepts/FunctionObjectConcepts.h index 43441f7fac7..20ef94b7df1 100644 --- a/Kernel_23/doc/Kernel_23/Concepts/FunctionObjectConcepts.h +++ b/Kernel_23/doc/Kernel_23/Concepts/FunctionObjectConcepts.h @@ -1040,6 +1040,16 @@ public: */ Comparison_result operator()(const Kernel::Segment_2& s1, const Kernel::Segment_2& s2); + + /*! + compares the slopes of the segments `(s1s,s1t)` and `(s2s,s2t)`, + where the slope is the variation of the `y`-coordinate + from the left to the right endpoint of the segments. + */ + Comparison_result operator()(const Kernel::Point_2& s1s, + const Kernel::Point_2& s1t, + const Kernel::Point_2& s2s, + const Kernel::Point_2& s2t)); /// @} diff --git a/Kernel_23/include/CGAL/Kernel/global_functions_2.h b/Kernel_23/include/CGAL/Kernel/global_functions_2.h index 0e736be48d6..a3a173a4446 100644 --- a/Kernel_23/include/CGAL/Kernel/global_functions_2.h +++ b/Kernel_23/include/CGAL/Kernel/global_functions_2.h @@ -347,6 +347,15 @@ compare_slope(const Segment_2 &s1, const Segment_2 &s2) return internal::compare_slope(s1, s2, K()); } +template < class K > +inline +typename K::Comparison_result +compare_slope(const Point_2 &s1s, const Point_2 &s1t, + const Point_2 &s2s, const Point_2 &s2t) +{ + return internal::compare_slope(s1s, s1t, s2s, s2t, K()); +} + #ifndef CGAL_NO_DEPRECATED_CODE // kept for backward compatibility diff --git a/Kernel_23/include/CGAL/Kernel/global_functions_internal_2.h b/Kernel_23/include/CGAL/Kernel/global_functions_internal_2.h index 42c1ac639ca..d25ad829947 100644 --- a/Kernel_23/include/CGAL/Kernel/global_functions_internal_2.h +++ b/Kernel_23/include/CGAL/Kernel/global_functions_internal_2.h @@ -373,6 +373,17 @@ compare_slope(const typename K::Segment_2 &s1, return k.compare_slope_2_object()(s1, s2); } +template < class K > +inline +typename K::Comparison_result +compare_slope(const typename K::Point_2 &s1s, + const typename K::Point_2 &s1t, + const typename K::Point_2 &s2s, + const typename K::Point_2 &s2t,const K& k) +{ + return k.compare_slope_2_object()(s1s, s1t, s2s, s2t); +} + template < class K > inline typename K::Comparison_result diff --git a/Kernel_23/test/Kernel_23/include/CGAL/_test_new_2.h b/Kernel_23/test/Kernel_23/include/CGAL/_test_new_2.h index efbae8e7e89..367be24d322 100644 --- a/Kernel_23/test/Kernel_23/include/CGAL/_test_new_2.h +++ b/Kernel_23/test/Kernel_23/include/CGAL/_test_new_2.h @@ -477,6 +477,7 @@ test_new_2(const R& rep) = rep.compare_slope_2_object(); Comparison_result tmp34ee = compare_slope(l1, l2); Comparison_result tmp34ff = compare_slope(s1, s2); + Comparison_result tmp34gg = compare_slope(p3, p5, p2, p3); typename R::Less_distance_to_point_2 less_distance_to_point = rep.less_distance_to_point_2_object(); @@ -680,7 +681,7 @@ test_new_2(const R& rep) use(tmp32a); use(tmp31d); use(tmp31c); use(tmp31b); use(tmp31a); use(tmp30); use(tmp26); use(tmp25); use(tmp24); use(tmp29); use(tmp28); use(tmp33a); use(tmp33b); use(tmp34ab); use(tmp34ac); - use(tmp34ff); use(tmp34ee); use(tmp34dd); use(tmp34cc); use(tmp34bb); + use(tmp34ff); use(tmp34gg); use(tmp34ee); use(tmp34dd); use(tmp34cc); use(tmp34bb); use(tmp34aa); use(tmp39a); use(tmp36a); use(tmp48c); use(tmp49c); use(tmp50c); use(tmp24a); use(tmp24b); use(tmp24c); use(tmp24d); use(tmp24e); use(tmp24f); From 4e1ebec30abe20562c7735d2f093965b76c90882 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Sat, 1 May 2021 17:04:52 +0200 Subject: [PATCH 06/49] untabify --- Cartesian_kernel/include/CGAL/Cartesian/function_objects.h | 6 +++--- .../include/CGAL/Homogeneous/function_objects.h | 2 +- Kernel_23/doc/Kernel_23/Concepts/FunctionObjectConcepts.h | 3 +-- Kernel_23/include/CGAL/Kernel/global_functions_2.h | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Cartesian_kernel/include/CGAL/Cartesian/function_objects.h b/Cartesian_kernel/include/CGAL/Cartesian/function_objects.h index 2508e6f8f81..75fbbc0389f 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/function_objects.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/function_objects.h @@ -631,9 +631,9 @@ namespace CartesianKernelFunctors { operator()(const Point_2& s1s, const Point_2& s1t, const Point_2& s2s, const Point_2& s2t) const { return compare_slopesC2(s1s.x(), s1s.y(), - s1t.x(), s1t.y(), - s2s.x(), s2s.y(), - s2t.x(), s2t.y()); + s1t.x(), s1t.y(), + s2s.x(), s2s.y(), + s2t.x(), s2t.y()); } }; diff --git a/Homogeneous_kernel/include/CGAL/Homogeneous/function_objects.h b/Homogeneous_kernel/include/CGAL/Homogeneous/function_objects.h index 7123511b4d5..a099ce851d0 100644 --- a/Homogeneous_kernel/include/CGAL/Homogeneous/function_objects.h +++ b/Homogeneous_kernel/include/CGAL/Homogeneous/function_objects.h @@ -845,7 +845,7 @@ namespace HomogeneousKernelFunctors { operator()(const Segment_2& s1, const Segment_2& s2) const { return (*this)(s1.source(), s1.target(), - s2.source(), s2.target()); + s2.source(), s2.target()); } result_type diff --git a/Kernel_23/doc/Kernel_23/Concepts/FunctionObjectConcepts.h b/Kernel_23/doc/Kernel_23/Concepts/FunctionObjectConcepts.h index 20ef94b7df1..d4e17a99bfb 100644 --- a/Kernel_23/doc/Kernel_23/Concepts/FunctionObjectConcepts.h +++ b/Kernel_23/doc/Kernel_23/Concepts/FunctionObjectConcepts.h @@ -1048,7 +1048,7 @@ public: */ Comparison_result operator()(const Kernel::Point_2& s1s, const Kernel::Point_2& s1t, - const Kernel::Point_2& s2s, + const Kernel::Point_2& s2s, const Kernel::Point_2& s2t)); /// @} @@ -9713,7 +9713,6 @@ public: const Kernel::Point_3&s, const Kernel::Point_3&t); - /// @} }; /* end Kernel::SideOfOrientedSphere_3 */ diff --git a/Kernel_23/include/CGAL/Kernel/global_functions_2.h b/Kernel_23/include/CGAL/Kernel/global_functions_2.h index a3a173a4446..a9a02be637f 100644 --- a/Kernel_23/include/CGAL/Kernel/global_functions_2.h +++ b/Kernel_23/include/CGAL/Kernel/global_functions_2.h @@ -351,7 +351,7 @@ template < class K > inline typename K::Comparison_result compare_slope(const Point_2 &s1s, const Point_2 &s1t, - const Point_2 &s2s, const Point_2 &s2t) + const Point_2 &s2s, const Point_2 &s2t) { return internal::compare_slope(s1s, s1t, s2s, s2t, K()); } From b2bb10710cd847e53e0a3abadf68d1af0b00f36c Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Sat, 1 May 2021 17:10:22 +0200 Subject: [PATCH 07/49] untabify --- Kernel_23/include/CGAL/Kernel/global_functions_internal_2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kernel_23/include/CGAL/Kernel/global_functions_internal_2.h b/Kernel_23/include/CGAL/Kernel/global_functions_internal_2.h index d25ad829947..45a1c71ae7d 100644 --- a/Kernel_23/include/CGAL/Kernel/global_functions_internal_2.h +++ b/Kernel_23/include/CGAL/Kernel/global_functions_internal_2.h @@ -378,7 +378,7 @@ inline typename K::Comparison_result compare_slope(const typename K::Point_2 &s1s, const typename K::Point_2 &s1t, - const typename K::Point_2 &s2s, + const typename K::Point_2 &s2s, const typename K::Point_2 &s2t,const K& k) { return k.compare_slope_2_object()(s1s, s1t, s2s, s2t); From 431c0713b39ca3323705b5af82c8e5d00693dc3c Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Mon, 3 May 2021 16:37:16 +0200 Subject: [PATCH 08/49] remove trailing whitespace --- Kernel_23/doc/Kernel_23/Concepts/FunctionObjectConcepts.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kernel_23/doc/Kernel_23/Concepts/FunctionObjectConcepts.h b/Kernel_23/doc/Kernel_23/Concepts/FunctionObjectConcepts.h index d4e17a99bfb..21cd2ee2812 100644 --- a/Kernel_23/doc/Kernel_23/Concepts/FunctionObjectConcepts.h +++ b/Kernel_23/doc/Kernel_23/Concepts/FunctionObjectConcepts.h @@ -1040,7 +1040,7 @@ public: */ Comparison_result operator()(const Kernel::Segment_2& s1, const Kernel::Segment_2& s2); - + /*! compares the slopes of the segments `(s1s,s1t)` and `(s2s,s2t)`, where the slope is the variation of the `y`-coordinate From 6aeb4eea0801cefa4ce2b16ef765891cabd5f79d Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Mon, 3 May 2021 16:42:30 +0200 Subject: [PATCH 09/49] remove trailing whitespace --- Cartesian_kernel/include/CGAL/Cartesian/function_objects.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cartesian_kernel/include/CGAL/Cartesian/function_objects.h b/Cartesian_kernel/include/CGAL/Cartesian/function_objects.h index 75fbbc0389f..1cd5dea4740 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/function_objects.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/function_objects.h @@ -626,7 +626,7 @@ namespace CartesianKernelFunctors { s2.source().x(), s2.source().y(), s2.target().x(), s2.target().y()); } - + result_type operator()(const Point_2& s1s, const Point_2& s1t, const Point_2& s2s, const Point_2& s2t) const { From 3efa4316d1882fd76fc3650096de5620de126259 Mon Sep 17 00:00:00 2001 From: Dmitry Anisimov Date: Tue, 4 May 2021 10:37:58 +0200 Subject: [PATCH 10/49] added extra info to the scalar map NP and a comment in the example --- .../registration_with_pointmatcher.cpp | 1 + .../CGAL/pointmatcher/compute_registration_transformation.h | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/Point_set_processing_3/examples/Point_set_processing_3/registration_with_pointmatcher.cpp b/Point_set_processing_3/examples/Point_set_processing_3/registration_with_pointmatcher.cpp index bcc7a219548..0e43c3fc704 100644 --- a/Point_set_processing_3/examples/Point_set_processing_3/registration_with_pointmatcher.cpp +++ b/Point_set_processing_3/examples/Point_set_processing_3/registration_with_pointmatcher.cpp @@ -78,6 +78,7 @@ int main(int argc, const char** argv) ICP_config matcher { /*.name=*/"KDTreeMatcher", /*.params=*/{ {"knn", "1"}, {"epsilon", "3.16"} } }; // Prepare outlier filters + // NOTE: `GenericDescriptorOutlierFilter` supports only one `descName` that is `weights`! std::vector outlier_filters; outlier_filters.push_back( ICP_config { /*.name=*/"TrimmedDistOutlierFilter", /*.params=*/{ {"ratio", "0.75" }} } ); outlier_filters.push_back( ICP_config { /*.name=*/"GenericDescriptorOutlierFilter", /*.params=*/{ {"descName", "weights" }} } ); diff --git a/Point_set_processing_3/include/CGAL/pointmatcher/compute_registration_transformation.h b/Point_set_processing_3/include/CGAL/pointmatcher/compute_registration_transformation.h index 1ba4ae98f76..066d233cede 100644 --- a/Point_set_processing_3/include/CGAL/pointmatcher/compute_registration_transformation.h +++ b/Point_set_processing_3/include/CGAL/pointmatcher/compute_registration_transformation.h @@ -406,6 +406,9 @@ compute_registration_transformation(const PointRange1& range1, const PointRange2 \cgalParamType{a model of `ReadablePropertyMap` whose key type is the value type of the iterator of `PointRange1` and whose value type is `geom_traits::FT`} \cgalParamDefault{`CGAL::Constant_property_map` with the value = 1 for all scalars} + \cgalParamExtra{These scalars, sometimes called weights, can be provided through the `GenericDescriptorOutlierFilter` + of \ref thirdpartylibpointmatcher library, where the `descName = weights`. + See `outlier_filters` below and `registration_with_pointmatcher.cpp` for more details.} \cgalParamNEnd \cgalParamNBegin{point_set_filters} @@ -538,6 +541,8 @@ compute_registration_transformation(const PointRange1& range1, const PointRange2 \cgalParamType{a model of `ReadablePropertyMap` whose key type is the value type of the iterator of `PointRange2` and whose value type is `geom_traits::FT`} \cgalParamDefault{`CGAL::Constant_property_map` with the value = 1 for all scalars} + \cgalParamExtra{These scalars, sometimes called weights, can be provided through the `GenericDescriptorOutlierFilter` + of \ref thirdpartylibpointmatcher library, where the `descName = weights`.} \cgalParamNEnd \cgalParamNBegin{point_set_filters} From 34c29156378fc053cd1460c3d7567d251a0b2240 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 12 May 2021 14:45:53 +0200 Subject: [PATCH 11/49] Add a new debugging macro CGAL_MESH_2_DEBUG_REFINEMENT_POINTS --- .../CGAL/Delaunay_mesh_vertex_base_2.h | 12 +++++++-- Mesh_2/include/CGAL/Mesh_2/Refine_edges.h | 8 ++++++ .../CGAL/Mesh_2/Refine_edges_with_clusters.h | 27 ++++++++++++++++++- Mesh_2/include/CGAL/Mesh_2/Refine_faces.h | 13 +++++++-- 4 files changed, 55 insertions(+), 5 deletions(-) diff --git a/Mesh_2/include/CGAL/Delaunay_mesh_vertex_base_2.h b/Mesh_2/include/CGAL/Delaunay_mesh_vertex_base_2.h index 4fdddb26cb3..21133750f6e 100644 --- a/Mesh_2/include/CGAL/Delaunay_mesh_vertex_base_2.h +++ b/Mesh_2/include/CGAL/Delaunay_mesh_vertex_base_2.h @@ -15,7 +15,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0+ -// +// // // Author(s) : Jane Tournois @@ -65,11 +65,19 @@ public: {} void set_sizing_info(const FT& s) - { + { sizing_info_ = s; } const FT& sizing_info() const { return sizing_info_; } +#ifdef CGAL_MESH_2_DEBUG_REFINEMENT_POINTS + typedef Tag_true Has_timestamp; + std::size_t time_stamp() const { return time_stamp_; } + + void set_time_stamp(const std::size_t& ts) { time_stamp_ = ts; } + + std::size_t time_stamp_; +#endif // CGAL_MESH_2_DEBUG_REFINEMENT_POINTS }; } // namespace CGAL diff --git a/Mesh_2/include/CGAL/Mesh_2/Refine_edges.h b/Mesh_2/include/CGAL/Mesh_2/Refine_edges.h index 983c552cc7f..8382994f8cd 100644 --- a/Mesh_2/include/CGAL/Mesh_2/Refine_edges.h +++ b/Mesh_2/include/CGAL/Mesh_2/Refine_edges.h @@ -513,6 +513,14 @@ public: va = edge.first->vertex(tr.cw (edge.second)); vb = edge.first->vertex(tr.ccw(edge.second)); +#ifdef CGAL_MESH_2_DEBUG_REFINEMENT_POINTS + std::cerr << "refinement_point_impl(" + << "#" << va->time_stamp() << ": " << va->point() << ", " + << "#" << vb->time_stamp() << ": " << vb->point() << ") = "; + auto p = midpoint(va->point(), vb->point()); + std::cerr << p << '\n'; + return p; +#endif // CGAL_MESH_2_DEBUG_BAD_FACES return midpoint(va->point(), vb->point()); } diff --git a/Mesh_2/include/CGAL/Mesh_2/Refine_edges_with_clusters.h b/Mesh_2/include/CGAL/Mesh_2/Refine_edges_with_clusters.h index 2036c70d929..cfad7fd1f66 100644 --- a/Mesh_2/include/CGAL/Mesh_2/Refine_edges_with_clusters.h +++ b/Mesh_2/include/CGAL/Mesh_2/Refine_edges_with_clusters.h @@ -80,9 +80,9 @@ class Refine_edges_base_with_clusters : Cluster ca, cb; clusters_iterator ca_it, cb_it; +public: using Super::triangulation_ref_impl; -public: /** \name CONSTRUCTORS */ Refine_edges_base_with_clusters(Tr& tr_, Clusters& c_) @@ -100,6 +100,11 @@ public: this->va = edge.first->vertex(Tr::cw (edge.second)); this->vb = edge.first->vertex(Tr::ccw(edge.second)); +#ifdef CGAL_MESH_2_DEBUG_REFINEMENT_POINTS + std::cerr << "refinement_point_impl(" + << "#" << this->va->time_stamp() << ": " << this->va->point() << ", " + << "#" << this->vb->time_stamp() << ": " << this->vb->point() << ") = "; +#endif // CGAL_MESH_2_DEBUG_BAD_FACES // std::cerr << "refinement_point_impl\n" << this->va->point() << " / " // << this->vb->point() << std::endl; @@ -119,17 +124,32 @@ public: std::cerr << "midpoint(" << this->va->point() << " , " << this->vb->point() << ")\n"; #endif // CGAL_MESH_2_DEBUG_CLUSTERS +#ifdef CGAL_MESH_2_DEBUG_REFINEMENT_POINTS + auto p = midpoint(this->va->point(), this->vb->point()); + std::cerr << p << '\n'; + return p; +#endif // CGAL_MESH_2_DEBUG_BAD_FACES return midpoint(this->va->point(), this->vb->point()); } else { // va only is a cluster va_has_a_cluster = true; +#ifdef CGAL_MESH_2_DEBUG_REFINEMENT_POINTS + auto p = split_cluster_point(this->va,this->vb,ca); + std::cerr << p << '\n'; + return p; +#endif // CGAL_MESH_2_DEBUG_BAD_FACES return split_cluster_point(this->va,this->vb,ca); } } else if( clusters.get_cluster(this->vb,this->va,cb,cb_it) ){ // vb only is a cluster vb_has_a_cluster = true; +#ifdef CGAL_MESH_2_DEBUG_REFINEMENT_POINTS + auto p = split_cluster_point(this->vb,this->va,cb); + std::cerr << p << '\n'; + return p; +#endif // CGAL_MESH_2_DEBUG_BAD_FACES return split_cluster_point(this->vb,this->va,cb); }else{ // no cluster @@ -137,6 +157,11 @@ public: std::cerr << "midpoint(" << this->va->point() << " , " << this->vb->point() << ")\n"; #endif // CGAL_MESH_2_DEBUG_CLUSTERS +#ifdef CGAL_MESH_2_DEBUG_REFINEMENT_POINTS + auto p = midpoint(this->va->point(), this->vb->point()); + std::cerr << p << '\n'; + return p; +#endif // CGAL_MESH_2_DEBUG_BAD_FACES return midpoint(this->va->point(), this->vb->point()); } }; diff --git a/Mesh_2/include/CGAL/Mesh_2/Refine_faces.h b/Mesh_2/include/CGAL/Mesh_2/Refine_faces.h index 7c4ef737e9d..b9c2ff29c8b 100644 --- a/Mesh_2/include/CGAL/Mesh_2/Refine_faces.h +++ b/Mesh_2/include/CGAL/Mesh_2/Refine_faces.h @@ -24,7 +24,7 @@ #include - +#include #include #include #include @@ -90,7 +90,7 @@ protected: // --- PROTECTED TYPES --- typedef CGAL::Double_map Bad_faces; protected: - // --- PROTECTED MEMBER DATAS --- + // --- PROTECTED MEMBER DATA --- Criteria& criteria; /**vertex(0)->time_stamp() << ": " << f->vertex(0)->point() << ", " + << "#" << f->vertex(1)->time_stamp() << ": " << f->vertex(1)->point() << ", " + << "#" << f->vertex(2)->time_stamp() << ": " << f->vertex(2)->point() << ") = "; + auto p = triangulation_ref_impl().circumcenter(f); + std::cerr << p << '\n'; + return p; +#endif // CGAL_MESH_2_DEBUG_BAD_FACES return triangulation_ref_impl().circumcenter(f); } From 8a90d68d173e994c4009950b4d569c1fa5d25068 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 28 May 2021 11:23:05 +0200 Subject: [PATCH 12/49] Circular_kernel_2: Cleanup --- .../test_Lazy_circular_kernel.cpp | 46 ------------------- 1 file changed, 46 deletions(-) delete mode 100644 Circular_kernel_2/test/Circular_kernel_2/test_Lazy_circular_kernel.cpp diff --git a/Circular_kernel_2/test/Circular_kernel_2/test_Lazy_circular_kernel.cpp b/Circular_kernel_2/test/Circular_kernel_2/test_Lazy_circular_kernel.cpp deleted file mode 100644 index cffb1ddbba2..00000000000 --- a/Circular_kernel_2/test/Circular_kernel_2/test_Lazy_circular_kernel.cpp +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) 2003-2008 INRIA Sophia-Antipolis (France). -// All rights reserved. -// -// This file is part of CGAL (www.cgal.org). -// -// $URL$ -// $Id$ -// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// -// Author(s) : Monique Teillaud, Sylvain Pion, Pedro Machado - -// Partially supported by the IST Programme of the EU as a Shared-cost -// RTD (FET Open) Project under Contract No IST-2000-26473 -// (ECG - Effective Computational Geometry for Curves and Surfaces) -// and a STREP (FET Open) Project under Contract No IST-006413 -// (ACS -- Algorithms for Complex Shapes) - -#include - -#include -#include -#include -#include -#include - - -typedef CGAL::Exact_predicates_exact_constructions_kernel Linear_k1; -typedef CGAL::Algebraic_kernel_for_circles_2_2 Algebraic_k1; -typedef CGAL::Circular_kernel_2 CK; -CK ck; - - -#include -#include -#include - -int main() { - - _test_circle_predicat(ck); - _test_circle_construct(ck); - _test_circle_bbox(ck); - _test_circular_arc_bbox(ck); - _test_has_on(ck); - - return 0; -} From e813d9fe3aaa5b3beb6fa8f3a2ac229bacddd7ea Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 28 May 2021 11:25:01 +0200 Subject: [PATCH 13/49] Circular_kernel_2: Cleanup --- .../include/CGAL/Exact_circular_kernel_2.h | 20 ++++++------------- .../test/Circular_kernel_2/CMakeLists.txt | 1 - 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/Circular_kernel_2/include/CGAL/Exact_circular_kernel_2.h b/Circular_kernel_2/include/CGAL/Exact_circular_kernel_2.h index 6cc7710f289..ced750303bc 100644 --- a/Circular_kernel_2/include/CGAL/Exact_circular_kernel_2.h +++ b/Circular_kernel_2/include/CGAL/Exact_circular_kernel_2.h @@ -44,28 +44,20 @@ namespace CGAL { namespace internal { #ifdef CGAL_USE_GMP - typedef CGAL::Gmpq NT1; + typedef CGAL::Gmpq NT; #else - typedef Quotient NT1; + typedef Quotient NT; #endif - typedef Cartesian Linear_k1; - typedef Algebraic_kernel_for_circles_2_2 Algebraic_k1; - typedef Circular_kernel_2 CK1; - -// typedef CGAL::Interval_nt_advanced NT2; -// typedef CGAL::Cartesian Linear_k2; -// typedef CGAL::Algebraic_kernel_for_circles_2_2 Algebraic_k2; -// typedef CGAL::Circular_kernel_2 CK2; - -// typedef CGAL::Lazy_circular_kernel_2 -// Exact_circular_kernel_2; + typedef Cartesian Linear_k; + typedef Algebraic_kernel_for_circles_2_2 Algebraic_k; + typedef Circular_kernel_2 CK; } // namespace internal -typedef Filtered_bbox_circular_kernel_2 Exact_circular_kernel_2; +typedef Filtered_bbox_circular_kernel_2 Exact_circular_kernel_2; } //namespace CGAL diff --git a/Circular_kernel_2/test/Circular_kernel_2/CMakeLists.txt b/Circular_kernel_2/test/Circular_kernel_2/CMakeLists.txt index adb6ce0ef65..1ed29d17602 100644 --- a/Circular_kernel_2/test/Circular_kernel_2/CMakeLists.txt +++ b/Circular_kernel_2/test/Circular_kernel_2/CMakeLists.txt @@ -16,7 +16,6 @@ include_directories(BEFORE ../../../Kernel_23/test/Kernel_23/include) include_directories(BEFORE ../Kernel_23/include) create_single_source_cgal_program("test_Circular_kernel.cpp") -create_single_source_cgal_program("test_Lazy_circular_kernel.cpp") create_single_source_cgal_program("test_Exact_circular_kernel.cpp") create_single_source_cgal_program("test_Filtered_bbox_circular_kernel.cpp") create_single_source_cgal_program("test_Line_arc.cpp") From d11533c9e454ad442d94da9e5f3dcf3dffd2823a Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 28 May 2021 11:58:33 +0200 Subject: [PATCH 14/49] Removal of non-existing code in benchark (without testing what remains) --- .../benchmarks_arrangement.cpp | 132 --------- .../benchmark/README_benchmark_CK2.txt | 6 - .../benchmarks_arrangement.cpp | 269 ------------------ Circular_kernel_2/benchmark/benchmark_CK2.cpp | 40 --- .../benchmark/benchmarks_arrangement.cpp | 225 --------------- .../benchmark/bff_reader/Breader.cpp | 5 - .../benchmarks_arrangement.cpp | 205 ------------- 7 files changed, 882 deletions(-) diff --git a/Circular_kernel_2/benchmark/DxfArrayBenchmarks/benchmarks_arrangement.cpp b/Circular_kernel_2/benchmark/DxfArrayBenchmarks/benchmarks_arrangement.cpp index 8d34709288f..674e5a0ea53 100644 --- a/Circular_kernel_2/benchmark/DxfArrayBenchmarks/benchmarks_arrangement.cpp +++ b/Circular_kernel_2/benchmark/DxfArrayBenchmarks/benchmarks_arrangement.cpp @@ -1,11 +1,7 @@ #define CGAL_CAST_INT #define CIRCULAR_KERNEL_2 -#define LAZY_CURVED_KERNEL_2 -//#define CIRCULAR_KERNEL_2_FILTERED_HEXAGON -//#define LAZY_CURVED_KERNEL_2_FILTERED_HEXAGON // #define CIRCULAR_KERNEL_2_FILTERED_BBOX -//#define LAZY_CURVED_KERNEL_2_FILTERED_BBOX #define CGAL_CAST_INT #include @@ -22,9 +18,7 @@ #include #include -#include -#include #include @@ -88,80 +82,7 @@ for(i=1;i<6;i++){ //bench.Compute_dxf(Dxffilename[i]); #endif -/*------------------------------------------------------------------------------------------------------------------------- - !!!!!!!!!!!Lazy_curved_Kernel!!!!!!!!!!!!!!!!!! - -------------------------------------------------------------------------------------------------------------------------*/ - #ifdef LAZY_CURVED_KERNEL_2 -// typedef CGAL::Quotient NT2; - typedef CGAL::Gmpq NT2; - typedef CGAL::Cartesian Linear_k2; - typedef CGAL::Algebraic_kernel_for_circles_2_2 Algebraic_k2; - typedef CGAL::Circular_kernel_2 CK2_; - - - typedef CGAL::Interval_nt_advanced NT3; - typedef CGAL::Cartesian Linear_k3; - typedef CGAL::Algebraic_kernel_for_circles_2_2 Algebraic_k3; - typedef CGAL::Circular_kernel_2 CK3_; - - - typedef CGAL::Lazy_circular_kernel_2 LazyCurvedK; - - - - typedef LazyCurvedK::Circular_arc_2 Circular_arc_3; - typedef LazyCurvedK::Line_arc_2 Line_arc_3; - typedef boost::variant LazyVarArc; - typedef std::vector LazyVarContainer; - typedef CGAL::Variant_traits LazyCurvedK_Variant_Traits; - - bench.kernel("LazyK. VarTraits"); - - bench.ComputeArrayDxf(dxffilenames); - //bench.Compute_dxf(Dxffilename[i]); - - #endif - /*------------------------------------------------------------------------------------------------------------------------- - !!!!!!!!!!!Filtered_hexagone_Circular_kernel!!!!!!!!!!!!!!!!!! - - -------------------------------------------------------------------------------------------------------------------------*/ - #ifdef CIRCULAR_KERNEL_2_FILTERED_HEXAGON - - typedef CGAL::Filtered_hexagon_circular_kernel_2 CircularKernelHexagon; - - typedef CircularKernelHexagon::Circular_arc_2 Circular_arc_4; - typedef CircularKernelHexagon::Line_arc_2 Line_arc_4; - typedef boost::variant< Circular_arc_4, Line_arc_4 > CircularKernHexVarArc; - typedef std::vector CircularKernHexVarArcContainer; - typedef CGAL::Variant_traits CircularKernHex_Variant_Traits; - - bench.kernel("CK Hex VarTraits"); - - // bench.Compute(Dxffilename[i]); - bench.Compute_no_dxf(); - - - #endif - /*------------------------------------------------------------------------------------------------------------------------- - !!!!!!!!!!!Filtered_hexagone_Lazy_Circular_kernel!!!!!!!!!!!!!!!!!! - - -------------------------------------------------------------------------------------------------------------------------*/ - #ifdef LAZY_CURVED_KERNEL_2_FILTERED_HEXAGON - - typedef CGAL::Filtered_hexagon_curved_kernel LazyKernelHexagon; - - typedef LazyKernelHexagon::Circular_arc_2 Circular_arc_5; - typedef LazyKernelHexagon::Line_arc_2 Line_arc_5; - typedef boost::variant HxLazyVarArc; - typedef std::vector HxLazyVarContainer; - typedef CGAL::Variant_traits HxLazyVariantTraits; - - bench.kernel("LazyK Hex VarTraits") ; - - //bench.Compute(Dxffilename[i]); -bench.Compute_no_dxf(); - #endif /*------------------------------------------------------------------------------------------------------------------------- !!!!!!!!!!!bbox_filtered_Circular_kernel!!!!!!!!!!!!!!!!!! @@ -182,58 +103,7 @@ bench.Compute_no_dxf() // bench.Compute_no_dxf(); #endif - /*------------------------------------------------------------------------------------------------------------------------- - !!!!!!!!!!!bbox_hexagone_Lazy_Circular_kernel!!!!!!!!!!!!!!!!!! - -------------------------------------------------------------------------------------------------------------------------*/ - #ifdef LAZY_CURVED_KERNEL_2_FILTERED_BBOX - - typedef CGAL::Filtered_bbox_curved_kernel BBLazyCurvedK; - - typedef BBLazyCurvedK::Circular_arc_2 Circular_arc_7; - typedef BBLazyCurvedK::Line_arc_2 Line_arc_7; - typedef boost::variant BBLazyVarArc; - typedef std::vector< BBLazyVarArc> BBLazyVarContainer; - typedef CGAL::Variant_traits BBLazyVariantTraits; - - bench.kernel("LLazyK BBox VarTraits") ; - - bench.Compute(Dxffilename[i]); - //bench.Compute_no_dxf(); - - - #endif - /*------------------------------------------------------------------------------------------------------------------------- - !!!!!!!!!!!bbox_filtered_Filtered_hexagone_Circular_kernel!!!!!!!!!!!!!!!!!! - - -------------------------------------------------------------------------------------------------------------------------*/ - /* - typedef CGAL::Filtered_bbox_curved_kernel BBCircKHexagon ; - - #ifndef CGAL_CURVED_KERNEL_DEBUG - typedef CGAL::Circular_arc_traits BBCircKHexagonCATraits; - #else - typedef CGAL::Circular_arc_traits Traits0_7; - typedef CGAL::Circular_arc_traits_tracer BBCircKHexagonCATraits; - #endif - typedef BBCircKHexagon::Circular_arc_2 BBCircKHexagonArc; - typedef std::vector BBCircKHexagonArcCont; - bench.kernel("BBox Circular kernel filtered Hexagon CircArcTraits"); - - bench.Compute_no_dxf(); - - typedef BBCircularKernelHexagon::Circular_arc_2 Circular_arc_8; - typedef BBCircularKernelHexagon::Line_arc_2 Line_arc_8; - typedef boost::variant BBCircularKernelHexagonVarArc; - typedef std::vector BBCircularKernelHexagonVarContainer; - typedef CGAL::Variant_traits BBCircularKernelHexagonVariantTraits; - - bench.kernel("BBox Circular kernel filtered Hexagon VarTraits") ; - - //bench.Compute(Dxffilename[i]); - bench.Compute_no_dxf();*/ - /*-------------------------------------------------------------------------------------------------------------------------- - -----------------------------------------------------------------------------------------------------------------------------*/ dxffilenames.erase(dxffilenames.begin(),dxffilenames.end()); if (i<5){ for(int n = 3*(i+1)-3; n < 3*(i+1); n++){ @@ -245,5 +115,3 @@ for(int n = 3*(i+1)-3; n < 3*(i+1); n++){ return 0; }; - - diff --git a/Circular_kernel_2/benchmark/README_benchmark_CK2.txt b/Circular_kernel_2/benchmark/README_benchmark_CK2.txt index a60be41c135..16dbab068e1 100644 --- a/Circular_kernel_2/benchmark/README_benchmark_CK2.txt +++ b/Circular_kernel_2/benchmark/README_benchmark_CK2.txt @@ -3,13 +3,9 @@ The usage is: where alpha: 1: means to bench the BBox(CK) with Vartraits -2: means to bench the Lazy(CK) with Vartraits 3: means to bench the CK with Vartraits -4: means to bench the Bbox(Lazy(CK)) with Vartraits 5: means to bench the BBox(CK) with Circulartraits -6: means to bench the Lazy(CK) with Circulartraits 7: means to bench the CK(CK) with Circulartraits -8: means to bench the Bbox(Lazy(CK)) Circulartraits (le 0 est interne) beta: @@ -74,5 +70,3 @@ with 5 <= a <= 8 and 0 <= b <= 8, we cannot use the Circulartraits to handle th Compile with -DCGAL_INTERSECTION_MAP_FOR_SUPPORTING_CIRCLES if you want to benchmark with the same kernel, but with an additional map for supporting circles. - - diff --git a/Circular_kernel_2/benchmark/arrangement_traits/benchmarks_arrangement.cpp b/Circular_kernel_2/benchmark/arrangement_traits/benchmarks_arrangement.cpp index 22bba806cbc..5ebf26838bc 100644 --- a/Circular_kernel_2/benchmark/arrangement_traits/benchmarks_arrangement.cpp +++ b/Circular_kernel_2/benchmark/arrangement_traits/benchmarks_arrangement.cpp @@ -15,10 +15,6 @@ #include #include -#include - -#include - #include #include @@ -141,75 +137,13 @@ Bench bench(Htmlfilename,Texfilename,Dxffilename[i]); } fin.close(); -/*------------------------------------------------------------------------------------------------------------------------- - !!!!!!!!!!!Place for tests!!!!!!!!!!!!!!!!!! - -------------------------------------------------------------------------------------------------------------------------*/ -// typedef CGAL::Lazy_exact_nt > NT4; -// typedef CGAL::Cartesian Linear_k4; -// typedef CGAL::Algebraic_kernel_2_2 Algebraic_k4; -// typedef CGAL::Curved_kernel CK4; -// -// #ifndef CGAL_CURVED_KERNEL_DEBUG -// typedef CGAL::Circular_arc_traits CircularK_CA_Traits; -// #else -// typedef CGAL::Circular_arc_traits Traits0; -// typedef CGAL::Circular_arc_traits_tracer CircularK_CA_Traits; -// #endif -// -// typedef CK4::Circular_arc_2 CircularKArc; -// typedef std::vector CircularKArcContainer; -// bench.kernel("Circular kernel Circular arc traits"); -// -// typedef CircularK_CA_Traits::Curve_2 Conic_arc_2; -// typedef CGAL::Arrangement_2 Pmwx; -// typedef CGAL::Arr_naive_point_location Point_location; -// -// typedef CircularK_CA_Traits::X_monotone_curve_2 X_monotone_curve_2; -// typedef CK4::Point_2 Point_2; -// typedef CK4::Circle_2 Circle_2; -// typedef CK4::Circular_arc_2 Circular_arc_2; -// -// -// CGAL::Random generatorOfgenerator; -// int random_seed = generatorOfgenerator.get_int(0, 123456); -// std::cout << "random_seed = " << random_seed << std::endl; -// CGAL::Random theRandom(random_seed); -// int random_max = 128; -// int random_min = -128; -// CircularKArcContainer ac; -// int x; -// int y; -// int r; -// for(int i = 0; i < 20; i++){ -// x = theRandom.get_int(random_min,random_max); -// y = theRandom.get_int(random_min,random_max); -// r = theRandom.get_int(1,random_max); -// ac.push_back( Circle_2( Point_2(x,y), r*r)); -// } -// -// // Pmwx _pm; -// // Point_location _pl(_pm); -// // try{ -// // bench.start(); -// // for (typename ArcContainer::const_iterator it=ac.begin(); -// // it != ac.end(); ++it) { -// // //insert(_pm,_pl,*it); -// // insert(_pm,*it,_pl); -// // }; -// // bench.stop(); -// // bench.summarize(_pm.number_of_vertices(),_pm.number_of_halfedges()); -// // } -// // catch (...) { -// // bench.fail(); -// // } /*------------------------------------------------------------------------------------------------------------------------- !!!!!!!!!!!Circular_Kernel!!!!!!!!!!!!!!!!!! -------------------------------------------------------------------------------------------------------------------------*/ typedef CGAL::Quotient NT1; - //typedef CGAL::Lazy_exact_nt > NT1; typedef CGAL::Cartesian Linear_k1; typedef CGAL::Algebraic_kernel_for_circles_2_2 Algebraic_k1; typedef CGAL::Circular_kernel_2 CircularKernel; @@ -240,208 +174,6 @@ Bench bench(Htmlfilename,Texfilename,Dxffilename[i]); bench.Compute(Dxffilename[i]); // bench.Compute_dxf(Dxffilename[i]); -/*------------------------------------------------------------------------------------------------------------------------- - !!!!!!!!!!!Lazy_curved_Kernel!!!!!!!!!!!!!!!!!! - - -------------------------------------------------------------------------------------------------------------------------*/ - /* - typedef CGAL::Quotient NT2; - // typedef CGAL::Lazy_exact_nt > NT2; - typedef CGAL::Cartesian Linear_k2; - typedef CGAL::Algebraic_kernel_2_2 Algebraic_k2; - typedef CGAL::Curved_kernel CK2_; - - //typedef CGAL::Interval_nt<> NT2; - typedef CGAL::Interval_nt_advanced NT3; - typedef CGAL::Cartesian Linear_k3; - typedef CGAL::Algebraic_kernel_2_2 Algebraic_k3; - typedef CGAL::Curved_kernel CK3_; - - - typedef CGAL::Lazy_curved_kernel LazyCurvedK; - - #ifndef CGAL_CURVED_KERNEL_DEBUG - typedef CGAL::Circular_arc_traits LazyCurvedK_CA_Traits; - #else - typedef CGAL::Circular_arc_traits Traits0_2; - typedef CGAL::Circular_arc_traits_tracer LazyCurved_kTraits; - #endif - - typedef LazyCurvedK::Circular_arc_2 LazyArc; - typedef std::vector LazyArcContainer; - - bench.kernel("Lazy curved kernel Circular arc traits") ; - - bench.Compute_no_dxf(); - - - typedef LazyCurvedK::Circular_arc_2 Circular_arc_3; - typedef LazyCurvedK::Line_arc_2 Line_arc_3; - typedef boost::variant LazyVarArc; - typedef std::vector LazyVarContainer; - typedef CGAL::Variant_traits LazyCurvedK_Variant_Traits; - - bench.kernel("Lazy curved kernel Variant traits"); - - bench.Compute(Dxffilename[i]); - //bench.Compute_dxf(Dxffilename[i]); - /*------------------------------------------------------------------------------------------------------------------------- - !!!!!!!!!!!Filtered_hexagone_Circular_kernel!!!!!!!!!!!!!!!!!! - - -------------------------------------------------------------------------------------------------------------------------*/ - -/* - typedef CGAL::Filtered_hexagon_curved_kernel CircularKernelHexagon; - - #ifndef CGAL_CURVED_KERNEL_DEBUG - typedef CGAL::Circular_arc_traits CircularKernHex_CA_Traits; - #else - typedef CGAL::Circular_arc_traits Traits0_3; - typedef CGAL::Circular_arc_traits_tracer CircularKernHex_CA_Traits; - #endif - - typedef CircularKernelHexagon::Circular_arc_2 CircularKernHexArc; - typedef std::vector CircularKernHexArcContainer; - bench.kernel("Circular kernel filtered hexagon Circular arc traits"); - - bench.Compute_no_dxf(); - - - typedef CircularKernelHexagon::Circular_arc_2 Circular_arc_4; - typedef CircularKernelHexagon::Line_arc_2 Line_arc_4; - typedef boost::variant< Circular_arc_4, Line_arc_4 > CircularKernHexVarArc; - typedef std::vector CircularKernHexVarArcContainer; - typedef CGAL::Variant_traits CircularKernHex_Variant_Traits; - - bench.kernel("Circular kernel filtered hexagon Variants traits"); - - //bench.Compute(Dxffilename[i]); - bench.Compute_no_dxf(); - - - - /*------------------------------------------------------------------------------------------------------------------------- - !!!!!!!!!!!Filtered_hexagone_Lazy_Circular_kernel!!!!!!!!!!!!!!!!!! - - -------------------------------------------------------------------------------------------------------------------------*/ - /* - typedef CGAL::Filtered_hexagon_curved_kernel LazyKernelHexagon; - - #ifndef CGAL_CURVED_KERNEL_DEBUG - typedef CGAL::Circular_arc_traits LazyKernelHexagon_CA_Traits; - #else - typedef CGAL::Circular_arc_traits Traits0_4; - typedef CGAL::Circular_arc_traits_tracer LazyKernelHexagon_CA_Traits; - #endif - typedef LazyKernelHexagon::Circular_arc_2 LazyKernelHexagonArc; - typedef std::vector LazyKernelHexagonArcContainer; - bench.kernel("Lazy curved kernel filtered hexagon Circular arc traits"); - - bench.Compute_no_dxf(); - - typedef LazyKernelHexagon::Circular_arc_2 Circular_arc_5; - typedef LazyKernelHexagon::Line_arc_2 Line_arc_5; - typedef boost::variant HxLazyVarArc; - typedef std::vector HxLazyVarContainer; - typedef CGAL::Variant_traits HxLazyVariantTraits; - - bench.kernel("Lazy curved kernel filtered hexagon Variants traits") ; - - //bench.Compute(Dxffilename[i]); -bench.Compute_no_dxf(); - - /*------------------------------------------------------------------------------------------------------------------------- - !!!!!!!!!!!bbox_filtered_Circular_kernel!!!!!!!!!!!!!!!!!! - - -------------------------------------------------------------------------------------------------------------------------*/ - /* - typedef CGAL::Filtered_bbox_curved_kernel BBCircularKernel ; - - #ifndef CGAL_CURVED_KERNEL_DEBUG - typedef CGAL::Circular_arc_traits BBCircularKernel_CA_Traits; - #else - typedef CGAL::Circular_arc_traits Traits0_5; - typedef CGAL::Circular_arc_traits_tracer BBCircularKernel_CA_Traits; - #endif - typedef BBCircularKernel::Circular_arc_2 BBCircularKernelArc; - typedef std::vector BBCircularKernelArcContainer; - bench.kernel("Circular kernel filtered bbox Circular arc traits"); - - bench.Compute_no_dxf(); - - typedef BBCircularKernel::Circular_arc_2 Circular_arc_6; - typedef BBCircularKernel::Line_arc_2 Line_arc_6; - typedef boost::variant BBCircVarArc; - typedef std::vector BBCircVarContainer; - typedef CGAL::Variant_traits BBCircVariantTraits; - - bench.kernel("Circular kernel filtered bbox Variants traits") ; - - // bench.Compute(Dxffilename[i]); - bench.Compute_no_dxf(); - - /*------------------------------------------------------------------------------------------------------------------------- - !!!!!!!!!!!bbox_hexagone_Lazy_Circular_kernel!!!!!!!!!!!!!!!!!! - - -------------------------------------------------------------------------------------------------------------------------*/ - /* - typedef CGAL::Filtered_bbox_curved_kernel BBLazyCurvedK; - - #ifndef CGAL_CURVED_KERNEL_DEBUG - typedef CGAL::Circular_arc_traits BBLazyCurvedK_CA_Traits; - #else - typedef CGAL::Circular_arc_traits Traits0_6; - typedef CGAL::Circular_arc_traits_tracer BBLazyCurvedK_CA_Traits; - #endif - typedef BBLazyCurvedK::Circular_arc_2 BBLazyCurvedKArc; - typedef std::vector BBLazyCurvedKArcContainer; - bench.kernel("Lazy curved kernel filtered bbox Circular arc traits"); - - bench.Compute_no_dxf(); - - - typedef BBLazyCurvedK::Circular_arc_2 Circular_arc_7; - typedef BBLazyCurvedK::Line_arc_2 Line_arc_7; - typedef boost::variant BBLazyVarArc; - typedef std::vector< BBLazyVarArc> BBLazyVarContainer; - typedef CGAL::Variant_traits BBLazyVariantTraits; - - bench.kernel("Lazy curved kernel filtered bbox Variants traits") ; - - //bench.Compute(Dxffilename[i]); - bench.Compute_no_dxf(); - - /*------------------------------------------------------------------------------------------------------------------------- - !!!!!!!!!!!bbox_filtered_Filtered_hexagone_Circular_kernel!!!!!!!!!!!!!!!!!! - - -------------------------------------------------------------------------------------------------------------------------*/ - /* - typedef CGAL::Filtered_bbox_curved_kernel BBCircKHexagon ; - - #ifndef CGAL_CURVED_KERNEL_DEBUG - typedef CGAL::Circular_arc_traits BBCircKHexagonCATraits; - #else - typedef CGAL::Circular_arc_traits Traits0_7; - typedef CGAL::Circular_arc_traits_tracer BBCircKHexagonCATraits; - #endif - typedef BBCircKHexagon::Circular_arc_2 BBCircKHexagonArc; - typedef std::vector BBCircKHexagonArcCont; - bench.kernel("BBox Circular kernel filtered bbox Circular arc traits"); - - bench.Compute_no_dxf(); - - typedef BBCircularKernelHexagon::Circular_arc_2 Circular_arc_8; - typedef BBCircularKernelHexagon::Line_arc_2 Line_arc_8; - typedef boost::variant BBCircularKernelHexagonVarArc; - typedef std::vector BBCircularKernelHexagonVarContainer; - typedef CGAL::Variant_traits BBCircularKernelHexagonVariantTraits; - - bench.kernel("BBox Circular kernel filtered bbox Variants traits") ; - - //bench.Compute(Dxffilename[i]); - bench.Compute_no_dxf();*/ - /*-------------------------------------------------------------------------------------------------------------------------- - -----------------------------------------------------------------------------------------------------------------------------*/ if (i+1<15) { if (strcmp(Dxffilename[i+1],"")) @@ -460,4 +192,3 @@ bench.infotable(); return 0; } - diff --git a/Circular_kernel_2/benchmark/benchmark_CK2.cpp b/Circular_kernel_2/benchmark/benchmark_CK2.cpp index cbec320b58f..54a4137e4ce 100644 --- a/Circular_kernel_2/benchmark/benchmark_CK2.cpp +++ b/Circular_kernel_2/benchmark/benchmark_CK2.cpp @@ -11,7 +11,6 @@ #include #include #include -#include #include #include #include @@ -42,21 +41,6 @@ typedef CGAL::Arr_circular_line_arc_traits_2 CircularK_Variant typedef boost::variant< Circular_arc_2, Line_arc_2 > CircularKVarArc; typedef std::vector CircularKVarArcContainer; -// LAZY KERNEL TYPEDEFS -typedef CGAL::Interval_nt_advanced NT3; -typedef CGAL::Cartesian Linear_k3; -typedef CGAL::Algebraic_kernel_for_circles_2_2 Algebraic_k3; -typedef CGAL::Circular_kernel_2 CK3_; -typedef CGAL::Lazy_circular_kernel_2 LazyCurvedK; -typedef CGAL::Arr_circular_arc_traits_2 LazyCurvedK_CA_Traits; -typedef LazyCurvedK::Circular_arc_2 LazyArc; -typedef std::vector LazyArcContainer; -typedef LazyCurvedK::Circular_arc_2 Circular_arc_3; -typedef LazyCurvedK::Line_arc_2 Line_arc_3; -typedef boost::variant LazyVarArc; -typedef std::vector LazyVarContainer; -//~ typedef CGAL::Arr_circular_line_arc_traits_2 LazyCurvedK_Variant_Traits; -typedef CGAL::Arr_circular_line_arc_traits_2 LazyCurvedK_Variant_Traits; // BBOX TYPEDEFS typedef CGAL::Filtered_bbox_circular_kernel_2 @@ -77,24 +61,6 @@ typedef std::vector BBCircVarContainer; typedef CGAL::Arr_circular_line_arc_traits_2 BBCircVariantTraits; -// BBOX(LAZY) -typedef CGAL::Filtered_bbox_circular_kernel_2 - BBLazyKernel ; -typedef CGAL::Arr_circular_arc_traits_2 - BBLazyKernel_CA_Traits; -typedef BBLazyKernel::Circular_arc_2 - BBLazyKernelArc; -typedef std::vector - BBLazyKernelArcContainer; -typedef BBLazyKernel::Circular_arc_2 - Circular_arc_lazybb; -typedef BBLazyKernel::Line_arc_2 - Line_arc_lazybb; -typedef boost::variant - BBLazyVarArc; -typedef std::vector - BBLazyVarContainer; -typedef CGAL::Arr_circular_line_arc_traits_2 BBLazyVariantTraits; template void do_main(const char *s) { @@ -243,9 +209,7 @@ int main(int argc, char* argv[]){ int j = argv[2][0]-'0'; if((j >= 0 && j < 9)) { if(i == 1) do_main(dxf_filename[j]); - if(i == 2) do_main(dxf_filename[j]); if(i == 3) do_main(dxf_filename[j]); - if(i == 4) do_main(dxf_filename[j]); if((i >= 5) || (i <= 0)) std::cout << "INVALID PARAMETERS" << std::endl; } else { int k = -1; @@ -255,13 +219,9 @@ int main(int argc, char* argv[]){ if(j == ('c'-'0')) k = 3; if(j == ('d'-'0')) k = 4; if(i == 1) do_main(k); - if(i == 2) do_main(k); if(i == 3) do_main(k); - if(i == 4) do_main(k); if(i == 5) do_main(k); - if(i == 6) do_main(k); if(i == 7) do_main(k); - if(i == 8) do_main(k); } } else std::cout << "INVALID PARAMETERS" << std::endl; diff --git a/Circular_kernel_2/benchmark/benchmarks_arrangement.cpp b/Circular_kernel_2/benchmark/benchmarks_arrangement.cpp index 728f8c18040..c0c627086a4 100644 --- a/Circular_kernel_2/benchmark/benchmarks_arrangement.cpp +++ b/Circular_kernel_2/benchmark/benchmarks_arrangement.cpp @@ -1,18 +1,13 @@ #define CGAL_CAST_INT #define CIRCULAR_KERNEL_2 -#define LAZY_CURVED_KERNEL_2 #define CIRCULAR_KERNEL_2_FILTERED_HEXAGON -#define LAZY_CURVED_KERNEL_2_FILTERED_HEXAGON #define CIRCULAR_KERNEL_2_FILTERED_BBOX -#define LAZY_CURVED_KERNEL_2_FILTERED_BBOX #include #include #include -#include - #include #include @@ -21,11 +16,6 @@ #include //#include -#include - -#ifdef CIRCULAR_KERNEL_2_FILTERED_HEXAGON -#include -#endif #include @@ -184,123 +174,7 @@ Bench bench; //If you want create table with all datasets bench.Compute_no_dxf(); #endif -/*------------------------------------------------------------------------------------------------------------------------- - !!!!!!!!!!!Lazy_curved_Kernel!!!!!!!!!!!!!!!!!! - -------------------------------------------------------------------------------------------------------------------------*/ - #ifdef LAZY_CURVED_KERNEL_2 - - typedef CGAL::Quotient NT2; - typedef CGAL::Cartesian Linear_k2; - typedef CGAL::Algebraic_kernel_for_circles_2_2 Algebraic_k2; - typedef CGAL::Circular_kernel_2 CK2_; - - - typedef CGAL::Interval_nt_advanced NT3; - typedef CGAL::Cartesian Linear_k3; - typedef CGAL::Algebraic_kernel_for_circles_2_2 Algebraic_k3; - typedef CGAL::Circular_kernel_2 CK3_; - - - typedef CGAL::Lazy_circular_kernel_2 LazyCurvedK; - -// #ifndef CGAL_CURVED_KERNEL_DEBUG - typedef CGAL::Arr_circular_arc_traits_2 LazyCurvedK_CA_Traits; -// #else -// typedef CGAL::Circular_arc_traits Traits0_2; -// typedef CGAL::Circular_arc_traits_tracer LazyCurved_kTraits; -// #endif - - typedef LazyCurvedK::Circular_arc_2 LazyArc; - typedef std::vector LazyArcContainer; - - bench.kernel("LazyCircArc") ; - - bench.Compute_no_dxf(); - - - typedef LazyCurvedK::Circular_arc_2 Circular_arc_3; - typedef LazyCurvedK::Line_arc_2 Line_arc_3; - typedef boost::variant LazyVarArc; - typedef std::vector LazyVarContainer; - typedef CGAL::Arr_circular_line_arc_traits_2 LazyCurvedK_Variant_Traits; - - bench.kernel("LazyKVar"); - - //bench.Compute(Dxffilename[i]); - //bench.Compute_dxf(Dxffilename[i]); - bench.Compute_no_dxf(); - - #endif - /*------------------------------------------------------------------------------------------------------------------------- - !!!!!!!!!!!Filtered_hexagone_Circular_kernel!!!!!!!!!!!!!!!!!! - - -------------------------------------------------------------------------------------------------------------------------*/ - #ifdef CIRCULAR_KERNEL_2_FILTERED_HEXAGON - - typedef CGAL::Filtered_hexagon_circular_kernel_2 CircularKernelHexagon; - -// #ifndef CGAL_CURVED_KERNEL_DEBUG - typedef CGAL::Arr_circular_arc_traits_2 CircularKernHex_CA_Traits; -// #else -// typedef CGAL::Circular_arc_traits Traits0_3; -// typedef CGAL::Circular_arc_traits_tracer CircularKernHex_CA_Traits; -// #endif - - typedef CircularKernelHexagon::Circular_arc_2 CircularKernHexArc; - typedef std::vector CircularKernHexArcContainer; - bench.kernel("CK Hex CircArcTraits"); - - bench.Compute_no_dxf(); - - - typedef CircularKernelHexagon::Circular_arc_2 Circular_arc_4; - typedef CircularKernelHexagon::Line_arc_2 Line_arc_4; - typedef boost::variant< Circular_arc_4, Line_arc_4 > CircularKernHexVarArc; - typedef std::vector CircularKernHexVarArcContainer; - typedef CGAL::Arr_circular_line_arc_traits_2 CircularKernHex_Variant_Traits; - - bench.kernel("CK Hex VarTraits"); - - // bench.Compute(Dxffilename[i]); - bench.Compute_no_dxf(); - - - #endif - /*------------------------------------------------------------------------------------------------------------------------- - !!!!!!!!!!!Filtered_hexagone_Lazy_Circular_kernel!!!!!!!!!!!!!!!!!! - - -------------------------------------------------------------------------------------------------------------------------*/ - #ifdef LAZY_CURVED_KERNEL_2_FILTERED_HEXAGON - - - typedef CGAL::Filtered_hexagon_circular_kernel_2 LazyKernelHexagon; - -// #ifndef CGAL_CURVED_KERNEL_DEBUG - typedef CGAL::Arr_circular_arc_traits_2 LazyKernelHexagon_CA_Traits; -// #else -// typedef CGAL::Circular_arc_traits Traits0_4; -// typedef CGAL::Circular_arc_traits_tracer LazyKernelHexagon_CA_Traits; -// #endif - - typedef LazyKernelHexagon::Circular_arc_2 LazyKernelHexagonArc; - typedef std::vector LazyKernelHexagonArcContainer; - bench.kernel("LazyK Hex CircArcTraits"); - - bench.Compute_no_dxf(); - - typedef LazyKernelHexagon::Circular_arc_2 Circular_arc_5; - typedef LazyKernelHexagon::Line_arc_2 Line_arc_5; - typedef boost::variant HxLazyVarArc; - typedef std::vector HxLazyVarContainer; - typedef CGAL::Arr_circular_line_arc_traits_2 HxLazyVariantTraits; - - bench.kernel("LazyK Hex VarTraits") ; - - //bench.Compute(Dxffilename[i]); -bench.Compute_no_dxf(); - - #endif /*------------------------------------------------------------------------------------------------------------------------- !!!!!!!!!!!bbox_filtered_Circular_kernel!!!!!!!!!!!!!!!!!! @@ -333,105 +207,6 @@ bench.Compute_no_dxf() bench.Compute_no_dxf(); #endif - /*------------------------------------------------------------------------------------------------------------------------- - !!!!!!!!!!!bbox_hexagone_Lazy_Circular_kernel!!!!!!!!!!!!!!!!!! - - -------------------------------------------------------------------------------------------------------------------------*/ - #ifdef LAZY_CURVED_KERNEL_2_FILTERED_BBOX - - typedef CGAL::Filtered_bbox_circular_kernel_2 BBLazyCurvedK; - -// #ifndef CGAL_CURVED_KERNEL_DEBUG - typedef CGAL::Arr_circular_arc_traits_2 BBLazyCurvedK_CA_Traits; -// #else -// typedef CGAL::Circular_arc_traits Traits0_6; -// typedef CGAL::Circular_arc_traits_tracer BBLazyCurvedK_CA_Traits; -// #endif - - typedef BBLazyCurvedK::Circular_arc_2 BBLazyCurvedKArc; - typedef std::vector BBLazyCurvedKArcContainer; - bench.kernel("LLazyK BBox CircArcTraits"); - - bench.Compute_no_dxf(); - - - typedef BBLazyCurvedK::Circular_arc_2 Circular_arc_7; - typedef BBLazyCurvedK::Line_arc_2 Line_arc_7; - typedef boost::variant BBLazyVarArc; - typedef std::vector< BBLazyVarArc> BBLazyVarContainer; - typedef CGAL::Arr_circular_line_arc_traits_2 BBLazyVariantTraits; - - bench.kernel("LLazyK BBox VarTraits") ; - - //bench.Compute(Dxffilename[i]); - bench.Compute_no_dxf(); - - #endif - /*------------------------------------------------------------------------------------------------------------------------- - !!!!!!!!!!!bbox_filtered_Filtered_hexagone_Circular_kernel!!!!!!!!!!!!!!!!!! - - -------------------------------------------------------------------------------------------------------------------------*/ - /* - typedef CGAL::Filtered_bbox_curved_kernel BBCircKHexagon ; - - #ifndef CGAL_CURVED_KERNEL_DEBUG - typedef CGAL::Circular_arc_traits BBCircKHexagonCATraits; - #else - typedef CGAL::Circular_arc_traits Traits0_7; - typedef CGAL::Circular_arc_traits_tracer BBCircKHexagonCATraits; - #endif - typedef BBCircKHexagon::Circular_arc_2 BBCircKHexagonArc; - typedef std::vector BBCircKHexagonArcCont; - bench.kernel("BBox Circular kernel filtered Hexagon CircArcTraits"); - - bench.Compute_no_dxf(); - - typedef BBCircularKernelHexagon::Circular_arc_2 Circular_arc_8; - typedef BBCircularKernelHexagon::Line_arc_2 Line_arc_8; - typedef boost::variant BBCircularKernelHexagonVarArc; - typedef std::vector BBCircularKernelHexagonVarContainer; - typedef CGAL::Variant_traits BBCircularKernelHexagonVariantTraits; - - bench.kernel("BBox Circular kernel filtered Hexagon VarTraits") ; - - //bench.Compute(Dxffilename[i]); - bench.Compute_no_dxf();*/ - /*-------------------------------------------------------------------------------------------------------------------------- - -----------------------------------------------------------------------------------------------------------------------------*/ -// if (i+1<2) -// { -// try{ -// if (strcmp(Dxffilename[i+1],"")) -// { -// try{ -// fin.open (Dxffilename[i]); -// } -// catch(...){ -// std::cout<<"error"< #include -#include - -#include - #include #include @@ -225,4 +221,3 @@ int exit_status = 0; return exit_status; } - diff --git a/Circular_kernel_2/benchmark/incremental_insertion/benchmarks_arrangement.cpp b/Circular_kernel_2/benchmark/incremental_insertion/benchmarks_arrangement.cpp index 61527c6040f..8895b11f372 100644 --- a/Circular_kernel_2/benchmark/incremental_insertion/benchmarks_arrangement.cpp +++ b/Circular_kernel_2/benchmark/incremental_insertion/benchmarks_arrangement.cpp @@ -13,10 +13,6 @@ #include #include -#include - -#include - #include #include @@ -169,207 +165,7 @@ Bench bench(Htmlfilename,Texfilename,Dxffilename[i],true); // bench.Compute(Dxffilename[i]); bench.Compute_dxf(Dxffilename[i]); -/*------------------------------------------------------------------------------------------------------------------------- - !!!!!!!!!!!Lazy_curved_Kernel!!!!!!!!!!!!!!!!!! - -------------------------------------------------------------------------------------------------------------------------*/ - - typedef CGAL::Quotient NT2; - typedef CGAL::Cartesian Linear_k2; - typedef CGAL::Algebraic_kernel_for_circles_2_2 Algebraic_k2; - typedef CGAL::Circular_kernel_2 CK2_; - - //typedef CGAL::Interval_nt<> NT2; - typedef CGAL::Interval_nt_advanced NT3; - typedef CGAL::Cartesian Linear_k3; - typedef CGAL::Algebraic_kernel_2_2 Algebraic_k3; - typedef CGAL::Curved_kernel CK3_; - - - typedef CGAL::Lazy_circular_kernel_2 LazyCurvedK; - -// #ifndef CGAL_CURVED_KERNEL_DEBUG -// typedef CGAL::Circular_arc_traits LazyCurvedK_CA_Traits; -// #else -// typedef CGAL::Circular_arc_traits Traits0_2; -// typedef CGAL::Circular_arc_traits_tracer LazyCurved_kTraits; -// #endif -// -// typedef LazyCurvedK::Circular_arc_2 LazyArc; -// typedef std::vector LazyArcContainer; -// -// bench.kernel("Lazy curved kernel Circular arc traits") ; -// -// bench.Compute_no_dxf(); - - - typedef LazyCurvedK::Circular_arc_2 Circular_arc_3; - typedef LazyCurvedK::Line_arc_2 Line_arc_3; - typedef boost::variant LazyVarArc; - typedef std::vector LazyVarContainer; - typedef CGAL::Variant_traits LazyCurvedK_Variant_Traits; - - bench.kernel("Lazy curved kernel Variant traits"); - - // bench.Compute(Dxffilename[i]); - // bench.Compute_dxf(Dxffilename[i]); - /*------------------------------------------------------------------------------------------------------------------------- - !!!!!!!!!!!Filtered_hexagone_Circular_kernel!!!!!!!!!!!!!!!!!! - - -------------------------------------------------------------------------------------------------------------------------*/ - /* -asdashhhhhhhhhhhhfhjhdghdf - typedef CGAL::Filtered_hexagon_curved_kernel CircularKernelHexagon; - - #ifndef CGAL_CURVED_KERNEL_DEBUG - typedef CGAL::Circular_arc_traits CircularKernHex_CA_Traits; - #else - typedef CGAL::Circular_arc_traits Traits0_3; - typedef CGAL::Circular_arc_traits_tracer CircularKernHex_CA_Traits; - #endif - - typedef CircularKernelHexagon::Circular_arc_2 CircularKernHexArc; - typedef std::vector CircularKernHexArcContainer; - bench.kernel("Circular kernel filtered hexagon Circular arc traits"); - - bench.Compute_no_dxf(); - - - typedef CircularKernelHexagon::Circular_arc_2 Circular_arc_4; - typedef CircularKernelHexagon::Line_arc_2 Line_arc_4; - typedef boost::variant< Circular_arc_4, Line_arc_4 > CircularKernHexVarArc; - typedef std::vector CircularKernHexVarArcContainer; - typedef CGAL::Variant_traits CircularKernHex_Variant_Traits; - - bench.kernel("Circular kernel filtered hexagon Variants traits"); - - bench.Compute(Dxffilename[i]); - // bench.Compute_no_dxf(); - - - */ - /*------------------------------------------------------------------------------------------------------------------------- - !!!!!!!!!!!Filtered_hexagone_Lazy_Circular_kernel!!!!!!!!!!!!!!!!!! - - -------------------------------------------------------------------------------------------------------------------------*/ - /* - typedef CGAL::Filtered_hexagon_curved_kernel LazyKernelHexagon; - - #ifndef CGAL_CURVED_KERNEL_DEBUG - typedef CGAL::Circular_arc_traits LazyKernelHexagon_CA_Traits; - #else - typedef CGAL::Circular_arc_traits Traits0_4; - typedef CGAL::Circular_arc_traits_tracer LazyKernelHexagon_CA_Traits; - #endif - typedef LazyKernelHexagon::Circular_arc_2 LazyKernelHexagonArc; - typedef std::vector LazyKernelHexagonArcContainer; - bench.kernel("Lazy curved kernel filtered hexagon Circular arc traits"); - - bench.Compute_no_dxf(); - - typedef LazyKernelHexagon::Circular_arc_2 Circular_arc_5; - typedef LazyKernelHexagon::Line_arc_2 Line_arc_5; - typedef boost::variant HxLazyVarArc; - typedef std::vector HxLazyVarContainer; - typedef CGAL::Variant_traits HxLazyVariantTraits; - - bench.kernel("Lazy curved kernel filtered hexagon Variants traits") ; - - bench.Compute(Dxffilename[i]); -//bench.Compute_no_dxf(); -*/ - /*------------------------------------------------------------------------------------------------------------------------- - !!!!!!!!!!!bbox_filtered_Circular_kernel!!!!!!!!!!!!!!!!!! - - -------------------------------------------------------------------------------------------------------------------------*/ - /* - typedef CGAL::Filtered_bbox_curved_kernel BBCircularKernel ; - - #ifndef CGAL_CURVED_KERNEL_DEBUG - typedef CGAL::Circular_arc_traits BBCircularKernel_CA_Traits; - #else - typedef CGAL::Circular_arc_traits Traits0_5; - typedef CGAL::Circular_arc_traits_tracer BBCircularKernel_CA_Traits; - #endif - typedef BBCircularKernel::Circular_arc_2 BBCircularKernelArc; - typedef std::vector BBCircularKernelArcContainer; - bench.kernel("Circular kernel filtered bbox Circular arc traits"); - - bench.Compute_no_dxf(); - - typedef BBCircularKernel::Circular_arc_2 Circular_arc_6; - typedef BBCircularKernel::Line_arc_2 Line_arc_6; - typedef boost::variant BBCircVarArc; - typedef std::vector BBCircVarContainer; - typedef CGAL::Variant_traits BBCircVariantTraits; - - bench.kernel("Circular kernel filtered bbox Variants traits") ; - - bench.Compute(Dxffilename[i]); - // bench.Compute_no_dxf(); - */ - /*------------------------------------------------------------------------------------------------------------------------- - !!!!!!!!!!!bbox_hexagone_Lazy_Circular_kernel!!!!!!!!!!!!!!!!!! - - -------------------------------------------------------------------------------------------------------------------------*/ - /* - typedef CGAL::Filtered_bbox_curved_kernel BBLazyCurvedK; - - #ifndef CGAL_CURVED_KERNEL_DEBUG - typedef CGAL::Circular_arc_traits BBLazyCurvedK_CA_Traits; - #else - typedef CGAL::Circular_arc_traits Traits0_6; - typedef CGAL::Circular_arc_traits_tracer BBLazyCurvedK_CA_Traits; - #endif - typedef BBLazyCurvedK::Circular_arc_2 BBLazyCurvedKArc; - typedef std::vector BBLazyCurvedKArcContainer; - bench.kernel("Lazy curved kernel filtered bbox Circular arc traits"); - - bench.Compute_no_dxf(); - - - typedef BBLazyCurvedK::Circular_arc_2 Circular_arc_7; - typedef BBLazyCurvedK::Line_arc_2 Line_arc_7; - typedef boost::variant BBLazyVarArc; - typedef std::vector< BBLazyVarArc> BBLazyVarContainer; - typedef CGAL::Variant_traits BBLazyVariantTraits; - - bench.kernel("Lazy curved kernel filtered bbox Variants traits") ; - - bench.Compute(Dxffilename[i]); - //bench.Compute_no_dxf(); - */ - /*------------------------------------------------------------------------------------------------------------------------- - !!!!!!!!!!!bbox_filtered_Filtered_hexagone_Circular_kernel!!!!!!!!!!!!!!!!!! - - -------------------------------------------------------------------------------------------------------------------------*/ - /* - typedef CGAL::Filtered_bbox_curved_kernel BBCircKHexagon ; - - #ifndef CGAL_CURVED_KERNEL_DEBUG - typedef CGAL::Circular_arc_traits BBCircKHexagonCATraits; - #else - typedef CGAL::Circular_arc_traits Traits0_7; - typedef CGAL::Circular_arc_traits_tracer BBCircKHexagonCATraits; - #endif - typedef BBCircKHexagon::Circular_arc_2 BBCircKHexagonArc; - typedef std::vector BBCircKHexagonArcCont; - bench.kernel("BBox Circular kernel filtered bbox Circular arc traits"); - - bench.Compute_no_dxf(); - - typedef BBCircularKernelHexagon::Circular_arc_2 Circular_arc_8; - typedef BBCircularKernelHexagon::Line_arc_2 Line_arc_8; - typedef boost::variant BBCircularKernelHexagonVarArc; - typedef std::vector BBCircularKernelHexagonVarContainer; - typedef CGAL::Variant_traits BBCircularKernelHexagonVariantTraits; - - bench.kernel("BBox Circular kernel filtered bbox Variants traits") ; - - //bench.Compute(Dxffilename[i]); - bench.Compute_no_dxf();*/ - /*-------------------------------------------------------------------------------------------------------------------------- - -----------------------------------------------------------------------------------------------------------------------------*/ if (i+1<15) { if (strcmp(Dxffilename[i+1],"")) @@ -388,4 +184,3 @@ bench.infotable(); return 0; } - From 2a90c31f77ac18cd394c71d3898bb1a8de3e6912 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Thu, 24 Jun 2021 12:08:05 +0200 Subject: [PATCH 15/49] document the new named parameters --- .../CGAL/Polygon_mesh_processing/remesh.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/remesh.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/remesh.h index b3257693e8c..b011b2d61b6 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/remesh.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/remesh.h @@ -132,6 +132,24 @@ namespace Polygon_mesh_processing { * \cgalParamExtra{The map is updated during the remeshing process while new faces are created.} * \cgalParamNEnd * +* \cgalParamNBegin{do_split} +* \cgalParamDescription{whether edges that are too long with respect to the given sizing are split} +* \cgalParamType{Boolean} +* \cgalParamDefault{`true`} +* \cgalParamNEnd +* +* \cgalParamNBegin{do_collapse} +* \cgalParamDescription{whether edges that are too short with respect to the given sizing are collapsed} +* \cgalParamType{Boolean} +* \cgalParamDefault{`true`} +* \cgalParamNEnd +* +* \cgalParamNBegin{do_flip} +* \cgalParamDescription{whether edge flips are performed to improve shape and valence} +* \cgalParamType{Boolean} +* \cgalParamDefault{`true`} +* \cgalParamNEnd +* * \cgalParamNBegin{number_of_relaxation_steps} * \cgalParamDescription{the number of iterations of tangential relaxation that are performed * at each iteration of the remeshing process} From 52016d14352e573bb5ea1a4f5641b4a20a745f7f Mon Sep 17 00:00:00 2001 From: Dmitry Anisimov Date: Thu, 1 Jul 2021 12:38:09 +0200 Subject: [PATCH 16/49] updated changes.md --- Installation/CHANGES.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Installation/CHANGES.md b/Installation/CHANGES.md index 38102e7205f..cebb3904db1 100644 --- a/Installation/CHANGES.md +++ b/Installation/CHANGES.md @@ -1,6 +1,12 @@ Release History =============== +### [Point Set Processing](https://doc.cgal.org/5.4/Manual/packages.html#PkgPointSetProcessing3) + +- Added support for `libpointmatcher::GenericDescriptorOutlierFilter` + that enables to provide a map from a point to a weight associated with this point. + + [Release 5.3](https://github.com/CGAL/cgal/releases/tag/v5.3) ----------- From 5e616f74e604abe11e199246c41ee3fe80187197 Mon Sep 17 00:00:00 2001 From: Dmitry Anisimov Date: Thu, 8 Jul 2021 17:30:26 +0200 Subject: [PATCH 17/49] fixed leaks in ransac related to callback --- .../efficient_RANSAC_with_callback.cpp | 1 + .../Efficient_RANSAC/Efficient_RANSAC.h | 88 +++++++++++++++---- 2 files changed, 73 insertions(+), 16 deletions(-) diff --git a/Shape_detection/examples/Shape_detection/efficient_RANSAC_with_callback.cpp b/Shape_detection/examples/Shape_detection/efficient_RANSAC_with_callback.cpp index e17aae6482b..e54b520530b 100644 --- a/Shape_detection/examples/Shape_detection/efficient_RANSAC_with_callback.cpp +++ b/Shape_detection/examples/Shape_detection/efficient_RANSAC_with_callback.cpp @@ -82,6 +82,7 @@ int main (int argc, char** argv) { // Detect registered shapes with the default parameters. ransac.detect(Efficient_ransac::Parameters(), timeout_callback); + assert(ransac.shapes().size() > 0); return EXIT_SUCCESS; } diff --git a/Shape_detection/include/CGAL/Shape_detection/Efficient_RANSAC/Efficient_RANSAC.h b/Shape_detection/include/CGAL/Shape_detection/Efficient_RANSAC/Efficient_RANSAC.h index 4a796a0ac5d..5d6c1895b16 100644 --- a/Shape_detection/include/CGAL/Shape_detection/Efficient_RANSAC/Efficient_RANSAC.h +++ b/Shape_detection/include/CGAL/Shape_detection/Efficient_RANSAC/Efficient_RANSAC.h @@ -480,8 +480,11 @@ public: return false; } - if (callback && !callback(0.)) + if (callback && !callback(0.)) { + clear_octrees(); + clear_shape_factories(); return false; + } // Reset data structures possibly used by former search m_extracted_shapes = @@ -580,8 +583,13 @@ public: m_shape_index, m_required_samples); - if (callback && !callback(num_invalid / double(m_num_total_points))) + if (callback && !callback(num_invalid / double(m_num_total_points))) { + clear_octrees(); + clear_shape_factories(); + clear_candidates(candidates); + m_num_available_points -= num_invalid; return false; + } } while (m_shape_index[first_sample] != -1 || !done); @@ -591,8 +599,13 @@ public: bool candidate_success = false; for(typename std::vector::iterator it = m_shape_factories.begin(); it != m_shape_factories.end(); it++) { - if (callback && !callback(num_invalid / double(m_num_total_points))) + if (callback && !callback(num_invalid / double(m_num_total_points))) { + clear_octrees(); + clear_shape_factories(); + clear_candidates(candidates); + m_num_available_points -= num_invalid; return false; + } Shape *p = (Shape *) (*it)(); //compute the primitive and says if the candidate is valid p->compute(indices, @@ -659,8 +672,13 @@ public: Shape *best_candidate = get_best_candidate(candidates, m_num_available_points - num_invalid); - if (callback && !callback(num_invalid / double(m_num_total_points))) + if (callback && !callback(num_invalid / double(m_num_total_points))) { + clear_octrees(); + clear_shape_factories(); + clear_candidates(candidates); + m_num_available_points -= num_invalid; return false; + } // If search is done and the best candidate is too small, we are done. if (!keep_searching && best_candidate->m_score < m_options.min_points) @@ -683,8 +701,13 @@ public: best_candidate->connected_component(best_candidate->m_indices, m_options.cluster_epsilon); - if (callback && !callback(num_invalid / double(m_num_total_points))) + if (callback && !callback(num_invalid / double(m_num_total_points))) { + clear_octrees(); + clear_shape_factories(); + clear_candidates(candidates); + m_num_available_points -= num_invalid; return false; + } // check score against min_points and clear out candidates if too low if (best_candidate->indices_of_assigned_points().size() < m_options.min_points) { @@ -700,8 +723,13 @@ public: delete best_candidate; best_candidate = nullptr; - if (callback && !callback(num_invalid / double(m_num_total_points))) + if (callback && !callback(num_invalid / double(m_num_total_points))) { + clear_octrees(); + clear_shape_factories(); + clear_candidates(candidates); + m_num_available_points -= num_invalid; return false; + } // Trimming candidates list std::size_t empty = 0, occupied = 0; @@ -727,8 +755,13 @@ public: candidates.resize(empty); - if (callback && !callback(num_invalid / double(m_num_total_points))) + if (callback && !callback(num_invalid / double(m_num_total_points))) { + clear_octrees(); + clear_shape_factories(); + clear_candidates(candidates); + m_num_available_points -= num_invalid; return false; + } } else if (stop_probability((std::size_t) best_candidate->expected_value(), (m_num_available_points - num_invalid), generated_candidates, @@ -742,8 +775,13 @@ public: m_extracted_shapes->push_back( boost::shared_ptr(best_candidate)); - if (callback && !callback(num_invalid / double(m_num_total_points))) + if (callback && !callback(num_invalid / double(m_num_total_points))) { + clear_octrees(); + clear_shape_factories(); + clear_candidates(candidates); + m_num_available_points -= num_invalid; return false; + } //2. remove the points const std::vector &indices_points_best_candidate = @@ -777,8 +815,13 @@ public: failed_candidates = 0; best_expected = 0; - if (callback && !callback(num_invalid / double(m_num_total_points))) + if (callback && !callback(num_invalid / double(m_num_total_points))) { + clear_octrees(); + clear_shape_factories(); + clear_candidates(candidates); + m_num_available_points -= num_invalid; return false; + } std::vector subset_sizes(m_num_subsets); subset_sizes[0] = m_available_octree_sizes[0]; @@ -807,8 +850,13 @@ public: } } - if (callback && !callback(num_invalid / double(m_num_total_points))) + if (callback && !callback(num_invalid / double(m_num_total_points))) { + clear_octrees(); + clear_shape_factories(); + clear_candidates(candidates); + m_num_available_points -= num_invalid; return false; + } std::size_t start = 0, end = candidates.size() - 1; while (start < end) { @@ -828,8 +876,13 @@ public: } else if (!keep_searching) ++generated_candidates; - if (callback && !callback(num_invalid / double(m_num_total_points))) + if (callback && !callback(num_invalid / double(m_num_total_points))) { + clear_octrees(); + clear_shape_factories(); + clear_candidates(candidates); + m_num_available_points -= num_invalid; return false; + } keep_searching = (stop_probability(m_options.min_points, m_num_available_points - num_invalid, @@ -841,11 +894,7 @@ public: || best_expected >= m_options.min_points); // Clean up remaining candidates. - for (std::size_t i = 0; i < candidates.size(); i++) - delete candidates[i]; - - candidates.resize(0); - + clear_candidates(candidates); m_num_available_points -= num_invalid; return true; @@ -912,6 +961,13 @@ public: /// @} private: + void clear_candidates(std::vector& candidates) { + for (std::size_t i = 0; i < candidates.size(); i++) { + delete candidates[i]; + } + candidates.resize(0); + } + int select_random_octree_level() { auto upper_bound = static_cast(m_global_octree->maxLevel() + 1); return (int) get_default_random()(upper_bound); From 9a5805839e389c85043401e98b1a968999a72f2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Mon, 19 Jul 2021 15:54:46 +0200 Subject: [PATCH 18/49] Do not set irrelevant neighbors with garbage (dim -1) In dim -1, there is only one vertex and one face, no neighbor in position '0' to set. --- .../CGAL/Triangulation_data_structure_2.h | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/TDS_2/include/CGAL/Triangulation_data_structure_2.h b/TDS_2/include/CGAL/Triangulation_data_structure_2.h index a9d7a057439..a50bfdd9262 100644 --- a/TDS_2/include/CGAL/Triangulation_data_structure_2.h +++ b/TDS_2/include/CGAL/Triangulation_data_structure_2.h @@ -1984,13 +1984,16 @@ copy_tds(const TDS_src& tds_src, CGAL_triangulation_precondition( tds_src.is_vertex(vert)); clear(); - size_type n = tds_src.number_of_vertices(); set_dimension(tds_src.dimension()); - // Number of pointers to cell/vertex to copy per cell. - int dim = (std::max)(1, dimension() + 1); + if(tds_src.number_of_vertices() == 0) + return Vertex_handle(); - if(n == 0) {return Vertex_handle();} + // Number of pointers to face/vertex to copy per face. + const int dim = (std::max)(1, dimension() + 1); + + // Number of neighbors to set in each face (dim -1 has a single face) + const int nn = (std::max)(0, dimension() + 1); //initializes maps Unique_hash_map vmap; @@ -2012,7 +2015,7 @@ copy_tds(const TDS_src& tds_src, convert_face(*fit1, *fh); } - //link vertices to a cell + //link vertices to a face vit1 = tds_src.vertices_begin(); for ( ; vit1 != tds_src.vertices_end(); vit1++) { vmap[vit1]->set_face(fmap[vit1->face()]); @@ -2021,10 +2024,10 @@ copy_tds(const TDS_src& tds_src, //update vertices and neighbor pointers fit1 = tds_src.faces().begin(); for ( ; fit1 != tds_src.faces_end(); ++fit1) { - for (int j = 0; j < dim ; ++j) { + for (int j = 0; j < dim ; ++j) fmap[fit1]->set_vertex(j, vmap[fit1->vertex(j)] ); + for (int j = 0; j < nn ; ++j) fmap[fit1]->set_neighbor(j, fmap[fit1->neighbor(j)]); - } } // remove the post condition because it is false when copying the From 1fc3050e0b0fb1890ea6449ae7fa217fead3ced6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Mon, 19 Jul 2021 15:55:47 +0200 Subject: [PATCH 19/49] Avoid UB with default constructed handle See also f9c9cfa40bdad5c5f250e4d600c43aa2f0d50021 --- TDS_2/include/CGAL/Triangulation_ds_face_base_2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TDS_2/include/CGAL/Triangulation_ds_face_base_2.h b/TDS_2/include/CGAL/Triangulation_ds_face_base_2.h index cbe8b8e1d49..2a7d1e3a850 100644 --- a/TDS_2/include/CGAL/Triangulation_ds_face_base_2.h +++ b/TDS_2/include/CGAL/Triangulation_ds_face_base_2.h @@ -235,7 +235,7 @@ Triangulation_ds_face_base_2 :: set_neighbor(int i, Face_handle n) { CGAL_triangulation_precondition( i == 0 || i == 1 || i == 2); - CGAL_triangulation_precondition( this != &*n ); + CGAL_triangulation_precondition( this != n.operator->() ); N[i] = n; } From 8727fd17af7683624e20c25ca7c0a3c2ead81911 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Mon, 19 Jul 2021 15:57:24 +0200 Subject: [PATCH 20/49] Avoid needless containers in TDS3::copy_tds() --- .../CGAL/Triangulation_data_structure_3.h | 28 +++++++------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/TDS_3/include/CGAL/Triangulation_data_structure_3.h b/TDS_3/include/CGAL/Triangulation_data_structure_3.h index 7c01149ab44..946c028f9a8 100644 --- a/TDS_3/include/CGAL/Triangulation_data_structure_3.h +++ b/TDS_3/include/CGAL/Triangulation_data_structure_3.h @@ -4039,32 +4039,24 @@ copy_tds(const TDS_src& tds, || tds.is_vertex(vert) ); clear(); - - size_type n = tds.number_of_vertices(); set_dimension(tds.dimension()); - if (n == 0) return Vertex_handle(); + if(tds.number_of_vertices() == 0) + return Vertex_handle(); // Number of pointers to cell/vertex to copy per cell. - int dim = (std::max)(1, dimension() + 1); - - // Create the vertices. - std::vector TV(n); - size_type i = 0; - - for (typename TDS_src::Vertex_iterator vit = tds.vertices_begin(); - vit != tds.vertices_end(); ++vit) - TV[i++] = vit; - - CGAL_triangulation_assertion( i == n ); + const int dim = (std::max)(1, dimension() + 1); + // Initializes maps Unique_hash_map< typename TDS_src::Vertex_handle,Vertex_handle > V; Unique_hash_map< typename TDS_src::Cell_handle,Cell_handle > F; - for (i=0; i <= n-1; ++i){ - Vertex_handle vh=create_vertex( convert_vertex(*TV[i]) ); - V[ TV[i] ] = vh; - convert_vertex(*TV[i],*vh); + // Create the vertices. + for (typename TDS_src::Vertex_iterator vit = tds.vertices_begin(); + vit != tds.vertices_end(); ++vit) { + Vertex_handle vh = create_vertex( convert_vertex(*vit) ); + V[vit] = vh; + convert_vertex(*vit,*vh); } // Create the cells. From 3fcae5244dcb65d7b0e11fa7dda60ea7588296e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Mon, 19 Jul 2021 15:58:10 +0200 Subject: [PATCH 21/49] Add a few more tests --- .../include/CGAL/_test_cls_triangulation_2.h | 17 +++++++++++++++-- .../include/CGAL/_test_cls_triangulation_3.h | 16 +++++++++++++++- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_triangulation_2.h b/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_triangulation_2.h index 348428439f7..e9fcc57d555 100644 --- a/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_triangulation_2.h +++ b/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_triangulation_2.h @@ -132,9 +132,14 @@ _test_cls_triangulation_2( const Triangul & ) assert( T1.number_of_vertices() == 0 ); Triangul T3(T1); - Triangul T4 = T1; - T3.swap(T1); + assert(T3.tds().vertices().size() == T1.tds().vertices().size()); + assert(T3.tds().faces().size() == T1.tds().faces().size()); + Triangul T4 = T1; + assert(T4.tds().vertices().size() == T1.tds().vertices().size()); + assert(T4.tds().faces().size() == T1.tds().faces().size()); + + T3.swap(T1); /**************************/ /******* INSERTIONS *******/ @@ -162,6 +167,10 @@ _test_cls_triangulation_2( const Triangul & ) assert( T0_1.number_of_faces() == 0); assert( T0_1.is_valid() ); + Triangul T0_1b(T0_1); + assert(T0_1b.tds().vertices().size() == T0_1.tds().vertices().size()); + assert(T0_1b.tds().faces().size() == T0_1.tds().faces().size()); + // test insert_first() Triangul T0_2; Vertex_handle v0_2_0 = T0_2.insert_first(p0); @@ -184,6 +193,10 @@ _test_cls_triangulation_2( const Triangul & ) assert( T1_2.number_of_faces() == 0 ); assert( T1_2.is_valid() ); + Triangul T1_2b(T1_2); + assert(T1_2b.tds().vertices().size() == T1_2.tds().vertices().size()); + assert(T1_2b.tds().faces().size() == T1_2.tds().faces().size()); + // p1,p3,p2 [endpoints first] Triangul T1_3_0; Vertex_handle v1_3_0_1 = T1_3_0.insert(p1); assert( v1_3_0_1 != NULL ); diff --git a/Triangulation_3/test/Triangulation_3/include/CGAL/_test_cls_triangulation_3.h b/Triangulation_3/test/Triangulation_3/include/CGAL/_test_cls_triangulation_3.h index a2afe749131..5bca6985c83 100644 --- a/Triangulation_3/test/Triangulation_3/include/CGAL/_test_cls_triangulation_3.h +++ b/Triangulation_3/test/Triangulation_3/include/CGAL/_test_cls_triangulation_3.h @@ -190,7 +190,21 @@ _test_cls_triangulation_3(const Triangulation &) //######################################################################## - /**************CONSTRUCTORS (1)*********************/ + /************** CONSTRUCTORS (1)********************/ + + Cls Tm1; + assert( Tm1.dimension() == -1 ); + assert( Tm1.number_of_vertices() == 0 ); + + Cls Tm3(Tm1); + assert(Tm3 == Tm1); + + Cls Tm4 = Tm1; + assert(Tm4 == Tm1); + + Tm3.swap(Tm1); + + /************** INSERTIONS *************************/ /************** and I/O ****************************/ std::cout << " Constructor " << std::endl; From cc790a8a6c158590103880471fd3775fd2073029 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Mon, 19 Jul 2021 22:01:21 +0200 Subject: [PATCH 22/49] Do not set irrelevant neighbors with garbage (T3) --- TDS_3/include/CGAL/Triangulation_data_structure_3.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/TDS_3/include/CGAL/Triangulation_data_structure_3.h b/TDS_3/include/CGAL/Triangulation_data_structure_3.h index 946c028f9a8..a65d211d549 100644 --- a/TDS_3/include/CGAL/Triangulation_data_structure_3.h +++ b/TDS_3/include/CGAL/Triangulation_data_structure_3.h @@ -4047,6 +4047,9 @@ copy_tds(const TDS_src& tds, // Number of pointers to cell/vertex to copy per cell. const int dim = (std::max)(1, dimension() + 1); + // Number of neighbors to set + const int nn = (std::max)(0, dimension() + 1); + // Initializes maps Unique_hash_map< typename TDS_src::Vertex_handle,Vertex_handle > V; Unique_hash_map< typename TDS_src::Cell_handle,Cell_handle > F; @@ -4077,7 +4080,7 @@ copy_tds(const TDS_src& tds, // Hook neighbor pointers of the cells. for (typename TDS_src::Cell_iterator cit2 = tds.cells().begin(); cit2 != tds.cells_end(); ++cit2) { - for (int j = 0; j < dim; j++) + for (int j = 0; j < nn; j++) F[cit2]->set_neighbor(j, F[cit2->neighbor(j)] ); } From b14fbe18753579745bfc07744fe4d0f0b107b042 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Mon, 19 Jul 2021 22:01:45 +0200 Subject: [PATCH 23/49] Add more tests --- .../include/CGAL/_test_cls_triangulation_3.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Triangulation_3/test/Triangulation_3/include/CGAL/_test_cls_triangulation_3.h b/Triangulation_3/test/Triangulation_3/include/CGAL/_test_cls_triangulation_3.h index 5bca6985c83..275ec2a2ae4 100644 --- a/Triangulation_3/test/Triangulation_3/include/CGAL/_test_cls_triangulation_3.h +++ b/Triangulation_3/test/Triangulation_3/include/CGAL/_test_cls_triangulation_3.h @@ -228,6 +228,9 @@ _test_cls_triangulation_3(const Triangulation &) assert(T0.number_of_vertices() == 1); assert(T0.is_valid()); + Cls T0d0(T0); + assert(T0 == T0d0); + if (! del) // to avoid doing the following tests for both Delaunay // and non Delaunay triangulations { @@ -242,6 +245,9 @@ _test_cls_triangulation_3(const Triangulation &) assert(T0.number_of_vertices() == 2); assert(T0.is_valid()); + Cls T0d1(T0); + assert(T0 == T0d1); + if (! del) // to avoid doing the following tests for both Delaunay // and non Delaunay triangulations { @@ -256,6 +262,9 @@ _test_cls_triangulation_3(const Triangulation &) assert(T0.number_of_vertices() == 3); assert(T0.is_valid()); + Cls T0d2(T0); + assert(T0 == T0d2); + if (! del) // to avoid doing the following tests for both Delaunay // and non Delaunay triangulations { @@ -270,6 +279,9 @@ _test_cls_triangulation_3(const Triangulation &) assert(T0.number_of_vertices() == 4); assert(T0.is_valid()); + Cls T0d3(T0); + assert(T0 == T0d3); + if (! del) // to avoid doing the following tests for both Delaunay // and non Delaunay triangulations { From 2c1ad28853bb2b3edc2eb71e2cdbcbf95fd61d94 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 28 Jul 2021 12:18:26 +0200 Subject: [PATCH 24/49] Add the documentation of the global function --- .../doc/Kernel_23/CGAL/Kernel/global_functions.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Kernel_23/doc/Kernel_23/CGAL/Kernel/global_functions.h b/Kernel_23/doc/Kernel_23/CGAL/Kernel/global_functions.h index bb63612593e..78604d064ab 100644 --- a/Kernel_23/doc/Kernel_23/CGAL/Kernel/global_functions.h +++ b/Kernel_23/doc/Kernel_23/CGAL/Kernel/global_functions.h @@ -852,7 +852,7 @@ const CGAL::Point_3& t); -/// \defgroup compare_slopes_grp CGAL::compare_slopes() +/// \defgroup compare_slopes_grp CGAL::compare_slope() /// \ingroup kernel_global_function /// @{ @@ -870,9 +870,20 @@ from the left to the right endpoint of the segments. */ template Comparison_result compare_slope(const CGAL::Segment_2 &s1, -const CGAL::Segment_2 &s2); + const CGAL::Segment_2 &s2); /*! +compares the slopes of the segments `(s1s,s1t)` and `(s2s,s2t)`, +where the slope is the variation of the `y`-coordinate +from the left to the right endpoint of the segments. +*/ +template +Comparison_result compare_slope(const CGAL::Point_2 &s1s, + const CGAL::Point_2 &s1t, + const CGAL::Point_2 &s2s, + const CGAL::Point_2 &s2t); + + /*! compares the slopes of the segments `(p,q)` and `(r,s)`, where the slope is the variation of the `z`-coordinate from the first to the second point of the segment divided by the length of the segment. From 0da1e5690eaad2ebb572861cecde3e648d8f92ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 29 Jul 2021 10:07:44 +0200 Subject: [PATCH 25/49] copyright.txt -> copyright --- .../package_info/Classification/{copyright.txt => copyright} | 0 .../package_info/Cone_spanners_2/{copyright.txt => copyright} | 0 .../package_info/Heat_method_3/{copyright.txt => copyright} | 0 Orthtree/package_info/Orthtree/{copyright.txt => copyright} | 0 Point_set_3/package_info/Point_set_3/{copyright.txt => copyright} | 0 .../Surface_mesh_shortest_path/{copyright.txt => copyright} | 0 Three/package_info/Three/{copyright.txt => copyright} | 0 7 files changed, 0 insertions(+), 0 deletions(-) rename Classification/package_info/Classification/{copyright.txt => copyright} (100%) rename Cone_spanners_2/package_info/Cone_spanners_2/{copyright.txt => copyright} (100%) rename Heat_method_3/package_info/Heat_method_3/{copyright.txt => copyright} (100%) rename Orthtree/package_info/Orthtree/{copyright.txt => copyright} (100%) rename Point_set_3/package_info/Point_set_3/{copyright.txt => copyright} (100%) rename Surface_mesh_shortest_path/package_info/Surface_mesh_shortest_path/{copyright.txt => copyright} (100%) rename Three/package_info/Three/{copyright.txt => copyright} (100%) diff --git a/Classification/package_info/Classification/copyright.txt b/Classification/package_info/Classification/copyright similarity index 100% rename from Classification/package_info/Classification/copyright.txt rename to Classification/package_info/Classification/copyright diff --git a/Cone_spanners_2/package_info/Cone_spanners_2/copyright.txt b/Cone_spanners_2/package_info/Cone_spanners_2/copyright similarity index 100% rename from Cone_spanners_2/package_info/Cone_spanners_2/copyright.txt rename to Cone_spanners_2/package_info/Cone_spanners_2/copyright diff --git a/Heat_method_3/package_info/Heat_method_3/copyright.txt b/Heat_method_3/package_info/Heat_method_3/copyright similarity index 100% rename from Heat_method_3/package_info/Heat_method_3/copyright.txt rename to Heat_method_3/package_info/Heat_method_3/copyright diff --git a/Orthtree/package_info/Orthtree/copyright.txt b/Orthtree/package_info/Orthtree/copyright similarity index 100% rename from Orthtree/package_info/Orthtree/copyright.txt rename to Orthtree/package_info/Orthtree/copyright diff --git a/Point_set_3/package_info/Point_set_3/copyright.txt b/Point_set_3/package_info/Point_set_3/copyright similarity index 100% rename from Point_set_3/package_info/Point_set_3/copyright.txt rename to Point_set_3/package_info/Point_set_3/copyright diff --git a/Surface_mesh_shortest_path/package_info/Surface_mesh_shortest_path/copyright.txt b/Surface_mesh_shortest_path/package_info/Surface_mesh_shortest_path/copyright similarity index 100% rename from Surface_mesh_shortest_path/package_info/Surface_mesh_shortest_path/copyright.txt rename to Surface_mesh_shortest_path/package_info/Surface_mesh_shortest_path/copyright diff --git a/Three/package_info/Three/copyright.txt b/Three/package_info/Three/copyright similarity index 100% rename from Three/package_info/Three/copyright.txt rename to Three/package_info/Three/copyright From 2948b47e661c38960d43621976df16b8e8bddaa7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 29 Jul 2021 10:17:10 +0200 Subject: [PATCH 26/49] add missing copyright files --- Point_set_2/package_info/Point_set_2/copyright | 1 + Skin_surface_3/package_info/Skin_surface_3/copyright | 1 + .../package_info/Surface_mesh_topology/copyright | 1 + Triangulation/package_info/Triangulation/copyright | 1 + Voronoi_diagram_2/package_info/Voronoi_diagram_2/copyright | 1 + 5 files changed, 5 insertions(+) create mode 100644 Point_set_2/package_info/Point_set_2/copyright create mode 100644 Skin_surface_3/package_info/Skin_surface_3/copyright create mode 100644 Surface_mesh_topology/package_info/Surface_mesh_topology/copyright create mode 100644 Triangulation/package_info/Triangulation/copyright create mode 100644 Voronoi_diagram_2/package_info/Voronoi_diagram_2/copyright diff --git a/Point_set_2/package_info/Point_set_2/copyright b/Point_set_2/package_info/Point_set_2/copyright new file mode 100644 index 00000000000..2d3aff3e5b9 --- /dev/null +++ b/Point_set_2/package_info/Point_set_2/copyright @@ -0,0 +1 @@ +Max-Planck-Institute Saarbruecken (Germany) diff --git a/Skin_surface_3/package_info/Skin_surface_3/copyright b/Skin_surface_3/package_info/Skin_surface_3/copyright new file mode 100644 index 00000000000..71aca79bcd0 --- /dev/null +++ b/Skin_surface_3/package_info/Skin_surface_3/copyright @@ -0,0 +1 @@ +Rijksuniversiteit Groningen (Netherlands) diff --git a/Surface_mesh_topology/package_info/Surface_mesh_topology/copyright b/Surface_mesh_topology/package_info/Surface_mesh_topology/copyright new file mode 100644 index 00000000000..3c616b4b377 --- /dev/null +++ b/Surface_mesh_topology/package_info/Surface_mesh_topology/copyright @@ -0,0 +1 @@ +CNRS and LIRIS' Establishments (France) diff --git a/Triangulation/package_info/Triangulation/copyright b/Triangulation/package_info/Triangulation/copyright new file mode 100644 index 00000000000..434d5723b62 --- /dev/null +++ b/Triangulation/package_info/Triangulation/copyright @@ -0,0 +1 @@ +INRIA Sophia-Antipolis (France) diff --git a/Voronoi_diagram_2/package_info/Voronoi_diagram_2/copyright b/Voronoi_diagram_2/package_info/Voronoi_diagram_2/copyright new file mode 100644 index 00000000000..ca00e0cdf39 --- /dev/null +++ b/Voronoi_diagram_2/package_info/Voronoi_diagram_2/copyright @@ -0,0 +1 @@ +Foundation for Research and Technology-Hellas (Greece) From 7f6c39e89888a37138e4e0cfb8bf64b437c64126 Mon Sep 17 00:00:00 2001 From: Simon Lopez Date: Fri, 23 Jul 2021 18:16:40 +0200 Subject: [PATCH 27/49] Skip shared edges which are border edges --- .../include/CGAL/Polygon_mesh_processing/clip.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/clip.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/clip.h index dd9672e4a35..886b2fed92a 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/clip.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/clip.h @@ -316,6 +316,7 @@ void split_along_edges(TriangleMesh& tm, std::set extra_border_hedges; for(std::size_t k=0; k Date: Thu, 29 Jul 2021 13:21:16 +0200 Subject: [PATCH 28/49] add split case with a plane containing border edges --- .../Polygon_mesh_processing/test_pmp_clip.cpp | 42 ++++++++++++++++++- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_clip.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_clip.cpp index b1e123f3472..cad344d72cf 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_clip.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_clip.cpp @@ -502,7 +502,7 @@ void test() template void test_split_plane() { - // test with a clipper mesh +//test with a splitter mesh Mesh tm1; std::ifstream input("data-coref/elephant.off"); input >> tm1; @@ -529,7 +529,45 @@ void test_split_plane() CGAL::clear(tm1); meshes.clear(); - //test with SI +//test with a non-closed splitter mesh (border edges in the plane) + input.open("data-coref/open_large_cube.off"); + input >> tm1; + + if(!input) + { + std::cerr<<"File not found. Aborting."<> tm1; + + if(!input) + { + std::cerr<<"File not found. Aborting."<> tm1; if(num_vertices(tm1) == 0) { From 37dcf522de44381be861558bd5911f7fcd644c5a Mon Sep 17 00:00:00 2001 From: Dmitry Anisimov Date: Thu, 29 Jul 2021 13:57:44 +0200 Subject: [PATCH 29/49] refactoring the clear function --- .../Efficient_RANSAC/Efficient_RANSAC.h | 66 +++++++------------ 1 file changed, 22 insertions(+), 44 deletions(-) diff --git a/Shape_detection/include/CGAL/Shape_detection/Efficient_RANSAC/Efficient_RANSAC.h b/Shape_detection/include/CGAL/Shape_detection/Efficient_RANSAC/Efficient_RANSAC.h index 5d6c1895b16..e5ea249e825 100644 --- a/Shape_detection/include/CGAL/Shape_detection/Efficient_RANSAC/Efficient_RANSAC.h +++ b/Shape_detection/include/CGAL/Shape_detection/Efficient_RANSAC/Efficient_RANSAC.h @@ -584,10 +584,7 @@ public: m_required_samples); if (callback && !callback(num_invalid / double(m_num_total_points))) { - clear_octrees(); - clear_shape_factories(); - clear_candidates(candidates); - m_num_available_points -= num_invalid; + clear(num_invalid); return false; } @@ -600,10 +597,7 @@ public: for(typename std::vector::iterator it = m_shape_factories.begin(); it != m_shape_factories.end(); it++) { if (callback && !callback(num_invalid / double(m_num_total_points))) { - clear_octrees(); - clear_shape_factories(); - clear_candidates(candidates); - m_num_available_points -= num_invalid; + clear(num_invalid); return false; } Shape *p = (Shape *) (*it)(); @@ -673,10 +667,7 @@ public: get_best_candidate(candidates, m_num_available_points - num_invalid); if (callback && !callback(num_invalid / double(m_num_total_points))) { - clear_octrees(); - clear_shape_factories(); - clear_candidates(candidates); - m_num_available_points -= num_invalid; + clear(num_invalid); return false; } @@ -702,10 +693,7 @@ public: m_options.cluster_epsilon); if (callback && !callback(num_invalid / double(m_num_total_points))) { - clear_octrees(); - clear_shape_factories(); - clear_candidates(candidates); - m_num_available_points -= num_invalid; + clear(num_invalid); return false; } // check score against min_points and clear out candidates if too low @@ -724,10 +712,7 @@ public: best_candidate = nullptr; if (callback && !callback(num_invalid / double(m_num_total_points))) { - clear_octrees(); - clear_shape_factories(); - clear_candidates(candidates); - m_num_available_points -= num_invalid; + clear(num_invalid); return false; } @@ -756,10 +741,7 @@ public: candidates.resize(empty); if (callback && !callback(num_invalid / double(m_num_total_points))) { - clear_octrees(); - clear_shape_factories(); - clear_candidates(candidates); - m_num_available_points -= num_invalid; + clear(num_invalid); return false; } } else if (stop_probability((std::size_t) best_candidate->expected_value(), @@ -776,10 +758,7 @@ public: boost::shared_ptr(best_candidate)); if (callback && !callback(num_invalid / double(m_num_total_points))) { - clear_octrees(); - clear_shape_factories(); - clear_candidates(candidates); - m_num_available_points -= num_invalid; + clear(num_invalid); return false; } @@ -816,10 +795,7 @@ public: best_expected = 0; if (callback && !callback(num_invalid / double(m_num_total_points))) { - clear_octrees(); - clear_shape_factories(); - clear_candidates(candidates); - m_num_available_points -= num_invalid; + clear(num_invalid); return false; } @@ -851,10 +827,7 @@ public: } if (callback && !callback(num_invalid / double(m_num_total_points))) { - clear_octrees(); - clear_shape_factories(); - clear_candidates(candidates); - m_num_available_points -= num_invalid; + clear(num_invalid); return false; } @@ -877,10 +850,7 @@ public: ++generated_candidates; if (callback && !callback(num_invalid / double(m_num_total_points))) { - clear_octrees(); - clear_shape_factories(); - clear_candidates(candidates); - m_num_available_points -= num_invalid; + clear(num_invalid); return false; } @@ -894,9 +864,7 @@ public: || best_expected >= m_options.min_points); // Clean up remaining candidates. - clear_candidates(candidates); - m_num_available_points -= num_invalid; - + clear_candidates(num_invalid, candidates); return true; } @@ -961,11 +929,21 @@ public: /// @} private: - void clear_candidates(std::vector& candidates) { + void clear(const std::size_t num_invalid) { + + clear_octrees(); + clear_shape_factories(); + clear_candidates(num_invalid, candidates); + } + + void clear_candidates( + const std::size_t num_invalid, std::vector& candidates) { + for (std::size_t i = 0; i < candidates.size(); i++) { delete candidates[i]; } candidates.resize(0); + m_num_available_points -= num_invalid; } int select_random_octree_level() { From 5f0ed6ba7b0b60defbbb6a9dfc06582af3449a6a Mon Sep 17 00:00:00 2001 From: Dmitry Anisimov Date: Thu, 29 Jul 2021 15:26:22 +0200 Subject: [PATCH 30/49] fixed missing param --- .../Efficient_RANSAC/Efficient_RANSAC.h | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/Shape_detection/include/CGAL/Shape_detection/Efficient_RANSAC/Efficient_RANSAC.h b/Shape_detection/include/CGAL/Shape_detection/Efficient_RANSAC/Efficient_RANSAC.h index e5ea249e825..53331b8d709 100644 --- a/Shape_detection/include/CGAL/Shape_detection/Efficient_RANSAC/Efficient_RANSAC.h +++ b/Shape_detection/include/CGAL/Shape_detection/Efficient_RANSAC/Efficient_RANSAC.h @@ -584,7 +584,7 @@ public: m_required_samples); if (callback && !callback(num_invalid / double(m_num_total_points))) { - clear(num_invalid); + clear(num_invalid, candidates); return false; } @@ -597,7 +597,7 @@ public: for(typename std::vector::iterator it = m_shape_factories.begin(); it != m_shape_factories.end(); it++) { if (callback && !callback(num_invalid / double(m_num_total_points))) { - clear(num_invalid); + clear(num_invalid, candidates); return false; } Shape *p = (Shape *) (*it)(); @@ -667,7 +667,7 @@ public: get_best_candidate(candidates, m_num_available_points - num_invalid); if (callback && !callback(num_invalid / double(m_num_total_points))) { - clear(num_invalid); + clear(num_invalid, candidates); return false; } @@ -693,7 +693,7 @@ public: m_options.cluster_epsilon); if (callback && !callback(num_invalid / double(m_num_total_points))) { - clear(num_invalid); + clear(num_invalid, candidates); return false; } // check score against min_points and clear out candidates if too low @@ -712,7 +712,7 @@ public: best_candidate = nullptr; if (callback && !callback(num_invalid / double(m_num_total_points))) { - clear(num_invalid); + clear(num_invalid, candidates); return false; } @@ -741,7 +741,7 @@ public: candidates.resize(empty); if (callback && !callback(num_invalid / double(m_num_total_points))) { - clear(num_invalid); + clear(num_invalid, candidates); return false; } } else if (stop_probability((std::size_t) best_candidate->expected_value(), @@ -758,7 +758,7 @@ public: boost::shared_ptr(best_candidate)); if (callback && !callback(num_invalid / double(m_num_total_points))) { - clear(num_invalid); + clear(num_invalid, candidates); return false; } @@ -795,7 +795,7 @@ public: best_expected = 0; if (callback && !callback(num_invalid / double(m_num_total_points))) { - clear(num_invalid); + clear(num_invalid, candidates); return false; } @@ -827,7 +827,7 @@ public: } if (callback && !callback(num_invalid / double(m_num_total_points))) { - clear(num_invalid); + clear(num_invalid, candidates); return false; } @@ -850,7 +850,7 @@ public: ++generated_candidates; if (callback && !callback(num_invalid / double(m_num_total_points))) { - clear(num_invalid); + clear(num_invalid, candidates); return false; } @@ -929,7 +929,8 @@ public: /// @} private: - void clear(const std::size_t num_invalid) { + void clear( + const std::size_t num_invalid, std::vector& candidates) { clear_octrees(); clear_shape_factories(); From 10ed1a058e2b407282bcc05f4c6b4f2db2bc66dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 29 Jul 2021 17:22:37 +0200 Subject: [PATCH 31/49] add more tests --- .../Polygon_mesh_processing/test_pmp_clip.cpp | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_clip.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_clip.cpp index cad344d72cf..5d188bdf3f1 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_clip.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_clip.cpp @@ -497,6 +497,64 @@ void test() PMP::clip(tm1, K::Plane_3(0,-1,0,0)); assert(vertices(tm1).size() == 7); } + + { + TriangleMesh tm1; + std::ifstream("data-coref/open_large_cube.off") >> tm1; + PMP::clip(tm1, K::Plane_3(0,0,1,-1), CGAL::parameters::use_compact_clipper(false)); + assert(vertices(tm1).size()==753); + } + + { + TriangleMesh tm1; + std::ifstream("data-coref/open_large_cube.off") >> tm1; + std::size_t nbv = vertices(tm1).size(); + PMP::clip(tm1, K::Plane_3(0,0,1,-1), CGAL::parameters::use_compact_clipper(true)); + assert(vertices(tm1).size()==nbv+2); // because of the plane diagonal + } + + { + TriangleMesh tm1; + std::ifstream("data-coref/open_large_cube.off") >> tm1; + PMP::clip(tm1, K::Plane_3(0,0,1,-1), CGAL::parameters::use_compact_clipper(false).allow_self_intersections(true)); + assert(vertices(tm1).size()==753); + } + + { + TriangleMesh tm1; + std::ifstream("data-coref/open_large_cube.off") >> tm1; + std::size_t nbv = vertices(tm1).size(); + PMP::clip(tm1, K::Plane_3(0,0,1,-1), CGAL::parameters::use_compact_clipper(true).allow_self_intersections(true)); + assert(vertices(tm1).size()==nbv+2); // because of the plane diagonal + } + + { + TriangleMesh tm1; + std::ifstream("data-coref/open_large_cube.off") >> tm1; + PMP::clip(tm1, K::Plane_3(0,0,-1,1), CGAL::parameters::use_compact_clipper(false)); + assert(vertices(tm1).size()==0); + } + + { + TriangleMesh tm1; + std::ifstream("data-coref/open_large_cube.off") >> tm1; + PMP::clip(tm1, K::Plane_3(0,0,-1,1), CGAL::parameters::use_compact_clipper(true)); + assert(vertices(tm1).size()==176); + } + + { + TriangleMesh tm1; + std::ifstream("data-coref/open_large_cube.off") >> tm1; + PMP::clip(tm1, K::Plane_3(0,0,-1,1), CGAL::parameters::use_compact_clipper(false).allow_self_intersections(true)); + assert(vertices(tm1).size()==0); + } + + { + TriangleMesh tm1; + std::ifstream("data-coref/open_large_cube.off") >> tm1; + PMP::clip(tm1, K::Plane_3(0,0,-1,1), CGAL::parameters::use_compact_clipper(true).allow_self_intersections(true)); + assert(vertices(tm1).size()==176); + } } template From aee767b2e3dba2755cac68f3bdcb9307ec23926d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 30 Jul 2021 10:07:33 +0200 Subject: [PATCH 32/49] update to valid format --- BGL/test/BGL/data/colored_tetra.ply | 4 ++-- BGL/test/BGL/data/invalid_cut.ply | 4 ++-- BGL/test/BGL/data/invalid_nv.ply | 4 ++-- Stream_support/test/Stream_support/data/colored_tetra.ply | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/BGL/test/BGL/data/colored_tetra.ply b/BGL/test/BGL/data/colored_tetra.ply index 7ec622125d1..0512db6f502 100644 --- a/BGL/test/BGL/data/colored_tetra.ply +++ b/BGL/test/BGL/data/colored_tetra.ply @@ -18,8 +18,8 @@ property uchar green property uchar blue property int label element edge 6 -property int v0 -property int v1 +property int vertex1 +property int vertex2 property float confidence end_header 0 0 0 -0.5 -0.5 -0.5 255 255 0 0 diff --git a/BGL/test/BGL/data/invalid_cut.ply b/BGL/test/BGL/data/invalid_cut.ply index a158f142b37..c50bb6c56ad 100644 --- a/BGL/test/BGL/data/invalid_cut.ply +++ b/BGL/test/BGL/data/invalid_cut.ply @@ -18,8 +18,8 @@ property uchar green property uchar blue property int label element edge 6 -property int v0 -property int v1 +property int vertex1 +property int vertex2 property float confidence end_header 0 0 0 -0.5 -0.5 -0.5 255 255 0 0 diff --git a/BGL/test/BGL/data/invalid_nv.ply b/BGL/test/BGL/data/invalid_nv.ply index e6a3ca46bb2..18903f10b96 100644 --- a/BGL/test/BGL/data/invalid_nv.ply +++ b/BGL/test/BGL/data/invalid_nv.ply @@ -18,8 +18,8 @@ property uchar green property uchar blue property int label element edge 6 -property int v0 -property int v1 +property int vertex1 +property int vertex2 property float confidence end_header 0 0 0 -0.5 -0.5 -0.5 0 diff --git a/Stream_support/test/Stream_support/data/colored_tetra.ply b/Stream_support/test/Stream_support/data/colored_tetra.ply index 7ec622125d1..0512db6f502 100644 --- a/Stream_support/test/Stream_support/data/colored_tetra.ply +++ b/Stream_support/test/Stream_support/data/colored_tetra.ply @@ -18,8 +18,8 @@ property uchar green property uchar blue property int label element edge 6 -property int v0 -property int v1 +property int vertex1 +property int vertex2 property float confidence end_header 0 0 0 -0.5 -0.5 -0.5 255 255 0 0 From 149b5af81f05af9c337b586aed2dda37ba165524 Mon Sep 17 00:00:00 2001 From: Dan Bumbarger Date: Thu, 29 Jul 2021 16:02:14 -0700 Subject: [PATCH 33/49] Update PLY.h Aligned Edge property to PLY standard --- Surface_mesh/include/CGAL/Surface_mesh/IO/PLY.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Surface_mesh/include/CGAL/Surface_mesh/IO/PLY.h b/Surface_mesh/include/CGAL/Surface_mesh/IO/PLY.h index 9a9d242b7b7..a6660baa2f9 100644 --- a/Surface_mesh/include/CGAL/Surface_mesh/IO/PLY.h +++ b/Surface_mesh/include/CGAL/Surface_mesh/IO/PLY.h @@ -162,7 +162,7 @@ public: bool has_simplex_specific_property (internal::PLY::PLY_read_number* property, Edge_index) { const std::string& name = property->name(); - if (name == "v0" || name == "v1") + if(name == "vertex1" || name == "vertex2") return true; return false; } @@ -368,8 +368,8 @@ public: void process_line (PLY_element& element, Edge_index& ei) { IntType v0, v1; - element.assign (v0, "v0"); - element.assign (v1, "v1"); + element.assign(v0, "vertex1"); + element.assign(v1, "vertex2"); Halfedge_index hi = m_mesh.halfedge(m_map_v2v[std::size_t(v0)], m_map_v2v[std::size_t(v1)]); From 65f3803bab18faddc3a47a1b55b2c7ff204e76f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 30 Jul 2021 10:13:26 +0200 Subject: [PATCH 34/49] compatibility for files written with the old code --- Surface_mesh/include/CGAL/Surface_mesh/IO/PLY.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Surface_mesh/include/CGAL/Surface_mesh/IO/PLY.h b/Surface_mesh/include/CGAL/Surface_mesh/IO/PLY.h index a6660baa2f9..bde524f6242 100644 --- a/Surface_mesh/include/CGAL/Surface_mesh/IO/PLY.h +++ b/Surface_mesh/include/CGAL/Surface_mesh/IO/PLY.h @@ -164,6 +164,10 @@ public: const std::string& name = property->name(); if(name == "vertex1" || name == "vertex2") return true; +#ifndef CGAL_NO_DEPRECATED_CODE + if(name == "v0" || name == "v1") + return true; +#endif return false; } From 49e720068ff57f5cea69aecaf0d33f8180657c2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 30 Jul 2021 10:03:10 +0200 Subject: [PATCH 35/49] update to valid format --- Surface_mesh/test/Surface_mesh/colored_tetra.ply | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Surface_mesh/test/Surface_mesh/colored_tetra.ply b/Surface_mesh/test/Surface_mesh/colored_tetra.ply index 7ec622125d1..0512db6f502 100644 --- a/Surface_mesh/test/Surface_mesh/colored_tetra.ply +++ b/Surface_mesh/test/Surface_mesh/colored_tetra.ply @@ -18,8 +18,8 @@ property uchar green property uchar blue property int label element edge 6 -property int v0 -property int v1 +property int vertex1 +property int vertex2 property float confidence end_header 0 0 0 -0.5 -0.5 -0.5 255 255 0 0 From 8123a841f2a5bef73720eb38e11b92b050b7161e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 30 Jul 2021 10:16:58 +0200 Subject: [PATCH 36/49] update to valid format --- Surface_mesh/include/CGAL/Surface_mesh/IO/PLY.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Surface_mesh/include/CGAL/Surface_mesh/IO/PLY.h b/Surface_mesh/include/CGAL/Surface_mesh/IO/PLY.h index b6196d5908c..599ab894517 100644 --- a/Surface_mesh/include/CGAL/Surface_mesh/IO/PLY.h +++ b/Surface_mesh/include/CGAL/Surface_mesh/IO/PLY.h @@ -961,8 +961,8 @@ bool write_PLY(std::ostream& os, if(!eprinters.empty()) { os << "element edge " << sm.number_of_edges() << std::endl; - os << "property int v0" << std::endl; - os << "property int v1" << std::endl; + os << "property int vertex1" << std::endl; + os << "property int vertex2" << std::endl; os << oss.str(); } } From 32b2354ac1a8910faebb82e0d3b33163f35e46b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Fri, 30 Jul 2021 10:35:10 +0200 Subject: [PATCH 37/49] Fix may-be-used-uninitialized warning --- BGL/test/BGL/test_split.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/BGL/test/BGL/test_split.cpp b/BGL/test/BGL/test_split.cpp index f9b6fff3ced..9c13a2d0307 100644 --- a/BGL/test/BGL/test_split.cpp +++ b/BGL/test/BGL/test_split.cpp @@ -24,7 +24,8 @@ typedef std::vector Polyline_2; // inserts a polyline into a graph void insert(const std::vector& poly, Graph& graph, Point_vertex_map& pvmap) { - vertex_descriptor u, v; + vertex_descriptor u = boost::graph_traits::null_vertex(); + vertex_descriptor v; for (std::size_t i = 0; i < poly.size(); i++) { // check if the point is not yet in the graph if (pvmap.find(poly[i]) == pvmap.end()) { From 9dc3f84d730cd3ddc208a31698dea11d2df62222 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 3 Aug 2021 14:16:29 +0200 Subject: [PATCH 38/49] try to workaround non-determinism --- .../Polygon_mesh_processing/test_pmp_clip.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_clip.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_clip.cpp index 5d188bdf3f1..8fe4562d8b7 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_clip.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_clip.cpp @@ -831,12 +831,15 @@ void test_isocuboid() .allow_self_intersections(true)); PMP::split_connected_components(tm, meshes, params::all_default()); assert(meshes.size() == 4); - //if the order is not deterministc, put the num_vertices in a list and check - //if the list does contain all those numbers. - assert(vertices(meshes[0]).size() == 22); - assert(vertices(meshes[1]).size() == 23); - assert(vertices(meshes[2]).size() == 7); - assert(vertices(meshes[3]).size() == 4); + + std::set sizes; + for (int i=0; i<4; ++i) + sizes.insert(vertices(meshes[i]).size()); + + assert(sizes.count(22)==1); + assert(sizes.count(23)==1); + assert(sizes.count(7)==1); + assert(sizes.count(4)==1); CGAL::clear(tm); meshes.clear(); From 8043e62f62a2668444dfe9a41b0df38a8dd23f89 Mon Sep 17 00:00:00 2001 From: Dmitry Anisimov Date: Tue, 3 Aug 2021 16:57:18 +0200 Subject: [PATCH 39/49] removed erroneous assert --- .../examples/Shape_detection/efficient_RANSAC_with_callback.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/Shape_detection/examples/Shape_detection/efficient_RANSAC_with_callback.cpp b/Shape_detection/examples/Shape_detection/efficient_RANSAC_with_callback.cpp index e54b520530b..e17aae6482b 100644 --- a/Shape_detection/examples/Shape_detection/efficient_RANSAC_with_callback.cpp +++ b/Shape_detection/examples/Shape_detection/efficient_RANSAC_with_callback.cpp @@ -82,7 +82,6 @@ int main (int argc, char** argv) { // Detect registered shapes with the default parameters. ransac.detect(Efficient_ransac::Parameters(), timeout_callback); - assert(ransac.shapes().size() > 0); return EXIT_SUCCESS; } From 0361a83cd31d3744dc788bc65d42824160cc239d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 4 Aug 2021 15:22:14 +0200 Subject: [PATCH 40/49] fix degree of an isolated vertex --- Polyhedron/include/CGAL/Polyhedron_3.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Polyhedron/include/CGAL/Polyhedron_3.h b/Polyhedron/include/CGAL/Polyhedron_3.h index 278d3b9b8a2..922c5110e69 100644 --- a/Polyhedron/include/CGAL/Polyhedron_3.h +++ b/Polyhedron/include/CGAL/Polyhedron_3.h @@ -111,7 +111,8 @@ public: // the degree of the vertex, i.e., edges emanating from this vertex std::size_t vertex_degree() const { - return this->halfedge()->vertex_degree(); + return this->halfedge()!=Halfedge_const_handle() + ? this->halfedge()->vertex_degree() : 0; } size_type degree() const { return vertex_degree(); } //backwards compatible From 84fac01b0683fe9e3f72aaa334d97d6f856c2748 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 4 Aug 2021 15:29:22 +0200 Subject: [PATCH 41/49] fix doc: constants -> functions since e3e0efb --- Stream_support/doc/Stream_support/IOstream.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Stream_support/doc/Stream_support/IOstream.txt b/Stream_support/doc/Stream_support/IOstream.txt index 6f0f73ba7a2..4d262edeaf2 100644 --- a/Stream_support/doc/Stream_support/IOstream.txt +++ b/Stream_support/doc/Stream_support/IOstream.txt @@ -224,10 +224,10 @@ for drawing operations in many \cgal output streams. Each color is defined by a triple of integers `(r,g,b)` with 0 \f$ \le \f$ r,g,b \f$ \le \f$ 255, the so-called rgb-value of the color. -There are a 11 predefined `Color` constants available: -`BLACK`, `WHITE`, `GRAY`, `RED`, `GREEN`, -`DEEPBLUE`, `BLUE`, `PURPLE`, `VIOLET`, `ORANGE`, -and `YELLOW`. +There are a 11 predefined `Color` functions available: +`black()`, `white()`, `gray()`, `red()`, `green()`, +`deep_blue()`, `blue()`, `purple()`, `violet()`, `orange()`, +and `yellow()`. From f0c0c90f850c17cb3bde7dfe07d87ab557e53360 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 4 Aug 2021 20:37:04 +0200 Subject: [PATCH 42/49] fix doc errors --- Weights/doc/Weights/PackageDescription.txt | 72 ++++++++++++++++------ 1 file changed, 54 insertions(+), 18 deletions(-) diff --git a/Weights/doc/Weights/PackageDescription.txt b/Weights/doc/Weights/PackageDescription.txt index fa3ba620891..1fc97c0ee1f 100644 --- a/Weights/doc/Weights/PackageDescription.txt +++ b/Weights/doc/Weights/PackageDescription.txt @@ -19,7 +19,9 @@ Models and functions that can be used to compute weights which have a simple ana \defgroup PkgWeightsRefUniformWeights Uniform Weight \ingroup PkgWeightsRefAnalytic -`#include ` +\verbatim +#include +\endverbatim This weight is always equal to 1. @@ -33,7 +35,9 @@ a model of `AnalyticWeightTraits_3` for 3D points \defgroup PkgWeightsRefShepardWeights Shepard Weight \ingroup PkgWeightsRefAnalytic -`#include ` +\verbatim +#include +\endverbatim This weight is computed as \f$w = \frac{1}{d^a}\f$ @@ -61,7 +65,9 @@ a model of `AnalyticWeightTraits_3` for 3D points \defgroup PkgWeightsRefInverseDistanceWeights Inverse Distance Weight \ingroup PkgWeightsRefAnalytic -`#include ` +\verbatim +#include +\endverbatim This weight is computed as \f$w = \frac{1}{d}\f$ @@ -90,7 +96,9 @@ a model of `AnalyticWeightTraits_3` for 3D points \defgroup PkgWeightsRefThreePointFamilyWeights Three Point Family Weight \ingroup PkgWeightsRefAnalytic -`#include ` +\verbatim +#include +\endverbatim This weight is computed as \f$w = \frac{d_2^a A_1 - d^a B + d_1^a A_2}{A_1 A_2}\f$ @@ -129,7 +137,9 @@ a model of `AnalyticWeightTraits_3` for 3D points \defgroup PkgWeightsRefWachspressWeights Wachspress Weight \ingroup PkgWeightsRefAnalytic -`#include ` +\verbatim +#include +\endverbatim This weight is computed as \f$w = \frac{C}{A_1 A_2}\f$ @@ -160,7 +170,9 @@ a model of `AnalyticWeightTraits_3` for 3D points \defgroup PkgWeightsRefAuthalicWeights Authalic Weight \ingroup PkgWeightsRefAnalytic -`#include ` +\verbatim +#include +\endverbatim This weight is computed as \f$w = 2 \frac{\cot\beta + \cot\gamma}{d^2}\f$ @@ -190,7 +202,9 @@ a model of `AnalyticWeightTraits_3` for 3D points \defgroup PkgWeightsRefMeanValueWeights Mean Value Weight \ingroup PkgWeightsRefAnalytic -`#include ` +\verbatim +#include +\endverbatim This weight is computed as \f$w = \pm 2 \sqrt{\frac{2 (d_1 d_2 - D)}{(d d_1 + D_1)(d d_2 + D_2)}}\f$ @@ -227,7 +241,9 @@ a model of `AnalyticWeightTraits_3` for 3D points \defgroup PkgWeightsRefTangentWeights Tangent Weight \ingroup PkgWeightsRefAnalytic -`#include ` +\verbatim +#include +\endverbatim This weight is computed as \f$w = 2 \frac{t_1 + t_2}{d}\f$, where @@ -262,7 +278,9 @@ a model of `AnalyticWeightTraits_3` for 3D points \defgroup PkgWeightsRefDiscreteHarmonicWeights Discrete Harmonic Weight \ingroup PkgWeightsRefAnalytic -`#include ` +\verbatim +#include +\endverbatim This weight is computed as \f$w = \frac{d_2^2 A_1 - d^2 B + d_1^2 A_2}{A_1 A_2}\f$ @@ -293,7 +311,9 @@ a model of `AnalyticWeightTraits_3` for 3D points \defgroup PkgWeightsRefCotangentWeights Cotangent Weight \ingroup PkgWeightsRefAnalytic -`#include ` +\verbatim +#include +\endverbatim This weight is computed as \f$w = 2 (\cot\beta + \cot\gamma)\f$ @@ -328,7 +348,9 @@ to polygons. These weights are then normalized in order to obtain barycentric co \defgroup PkgWeightsRefBarycentricWachspressWeights Wachspress Weights \ingroup PkgWeightsRefBarycentric -`#include ` +\verbatim +#include +\endverbatim Wachspress weights which can be computed for a query point with respect to the vertices of a strictly convex polygon. @@ -339,7 +361,9 @@ vertices of a strictly convex polygon. \defgroup PkgWeightsRefBarycentricMeanValueWeights Mean Value Weights \ingroup PkgWeightsRefBarycentric -`#include ` +\verbatim +#include +\endverbatim Mean value weights which can be computed for a query point with respect to the vertices of a simple polygon. @@ -350,7 +374,9 @@ vertices of a simple polygon. \defgroup PkgWeightsRefBarycentricDiscreteHarmonicWeights Discrete Harmonic Weights \ingroup PkgWeightsRefBarycentric -`#include ` +\verbatim +#include +\endverbatim Discrete Harmonic weights which can be computed for a query point with respect to the vertices of a strictly convex polygon. @@ -368,7 +394,9 @@ used to balance other weights. \defgroup PkgWeightsRefUniformRegionWeights Uniform Region Weight \ingroup PkgWeightsRefRegions -`#include ` +\verbatim +#include +\endverbatim This weight is always equal to 1. @@ -382,7 +410,9 @@ a model of `AnalyticWeightTraits_3` for 3D points \defgroup PkgWeightsRefTriangularRegionWeights Triangular Region Weight \ingroup PkgWeightsRefRegions -`#include ` +\verbatim +#include +\endverbatim This weight is the area of the shaded region in the figure below. The region is the triangle `[p, q, r]`. @@ -401,7 +431,9 @@ a model of `AnalyticWeightTraits_3` for 3D points \defgroup PkgWeightsRefBarycentricRegionWeights Barycentric Region Weight \ingroup PkgWeightsRefRegions -`#include ` +\verbatim +#include +\endverbatim This weight is the area of the shaded region in the figure below. The region is formed by the two midpoints of the edges incident to `q` and the barycenter of @@ -421,7 +453,9 @@ a model of `AnalyticWeightTraits_3` for 3D points \defgroup PkgWeightsRefVoronoiRegionWeights Voronoi Region Weight \ingroup PkgWeightsRefRegions -`#include ` +\verbatim +#include +\endverbatim This weight is the area of the shaded region in the figure below. The region is formed by the two midpoints of the edges incident to `q` and the circumcenter of @@ -443,7 +477,9 @@ a model of `AnalyticWeightTraits_3` for 3D points \defgroup PkgWeightsRefMixedVoronoiRegionWeights Mixed Voronoi Region Weight \ingroup PkgWeightsRefRegions -`#include ` +\verbatim +#include +\endverbatim This weight is the area of the shaded region in the figure below. The region is formed by the two midpoints of the edges incident to `q` and the circumcenter of From 5b6f3abac2464158a8a0c7027bd0f7aa61993a95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 4 Aug 2021 20:58:53 +0200 Subject: [PATCH 43/49] fix iteration up to the end --- Documentation/doc/scripts/testsuite.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/doc/scripts/testsuite.py b/Documentation/doc/scripts/testsuite.py index 4e9e7393552..f303a6e3c98 100755 --- a/Documentation/doc/scripts/testsuite.py +++ b/Documentation/doc/scripts/testsuite.py @@ -150,7 +150,7 @@ body {color: black; background-color: #C0C0D0; font-family: sans-serif;} for index in range(0, len(results1)): result = [('./build_logs', './build_logs', (0,1))] results_master.extend(result) - for index in range(0, len(results1)-1): + for index in range(0, len(results1)): status='class="package-good"' no_errors = True no_warn = True From b579d9bd3c0ec5e60427360844b9f21d6f5ec73f Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Mon, 9 Aug 2021 14:16:50 +0200 Subject: [PATCH 44/49] Remove the platforms before starting the filter testsuite --- Scripts/developer_scripts/run_testsuite_from_branch_name.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Scripts/developer_scripts/run_testsuite_from_branch_name.sh b/Scripts/developer_scripts/run_testsuite_from_branch_name.sh index b5ce2554e68..be40a4b3dea 100644 --- a/Scripts/developer_scripts/run_testsuite_from_branch_name.sh +++ b/Scripts/developer_scripts/run_testsuite_from_branch_name.sh @@ -63,6 +63,9 @@ cd ${CGAL_ROOT} if [ -L CGAL-I ]; then rm CGAL-I; fi ln -s $PWD/CGAL-TEST/$DEST CGAL-I +if [ -d CGAL-I/cmake/platforms ]; then + rm -rf CGAL-I/cmake/platforms/* +fi echo "starting testsuite..." ./autotest_cgal -c From 4ceb5fbb1f9706a1a3c07f260549c9ef5fffedb6 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Mon, 9 Aug 2021 15:19:12 +0200 Subject: [PATCH 45/49] filter diff --- Scripts/developer_scripts/run_testsuite_from_branch_name.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scripts/developer_scripts/run_testsuite_from_branch_name.sh b/Scripts/developer_scripts/run_testsuite_from_branch_name.sh index be40a4b3dea..ca19d91d43f 100644 --- a/Scripts/developer_scripts/run_testsuite_from_branch_name.sh +++ b/Scripts/developer_scripts/run_testsuite_from_branch_name.sh @@ -33,7 +33,7 @@ git fetch $USER_REPO git checkout $BRANCH_NAME git reset --hard $USER_REPO/$BRANCH_NAME #setup the list_test_packages -TMP_LIST=$(git diff --name-only cgal/$BASE_NAME...HEAD |cut -s -d/ -f1 |sort -u | xargs -I {} ls -d {}/package_info 2>/dev/null |cut -d/ -f1 |egrep -v Installation||true) +TMP_LIST=$(git diff --name-only cgal/$BASE_NAME...HEAD |egrep -v /doc |egrep "*\.h"\|"*\.cpp" |cut -s -d/ -f1 |sort -u | xargs -I {} ls -d {}/package_info 2>/dev/null |cut -d/ -f1 |egrep -v Installation||true) LIST_OF_PKGS="" for PKG in $(ls) ; do From 5c608f0c83f158b223502585fdb1a239bc851834 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Mon, 9 Aug 2021 15:40:13 +0200 Subject: [PATCH 46/49] FIx repetition operator for mac. --- Scripts/developer_scripts/run_testsuite_from_branch_name.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scripts/developer_scripts/run_testsuite_from_branch_name.sh b/Scripts/developer_scripts/run_testsuite_from_branch_name.sh index ca19d91d43f..33801202328 100644 --- a/Scripts/developer_scripts/run_testsuite_from_branch_name.sh +++ b/Scripts/developer_scripts/run_testsuite_from_branch_name.sh @@ -33,7 +33,7 @@ git fetch $USER_REPO git checkout $BRANCH_NAME git reset --hard $USER_REPO/$BRANCH_NAME #setup the list_test_packages -TMP_LIST=$(git diff --name-only cgal/$BASE_NAME...HEAD |egrep -v /doc |egrep "*\.h"\|"*\.cpp" |cut -s -d/ -f1 |sort -u | xargs -I {} ls -d {}/package_info 2>/dev/null |cut -d/ -f1 |egrep -v Installation||true) +TMP_LIST=$(git diff --name-only cgal/$BASE_NAME...HEAD |egrep -v /doc |egrep "\.h"\|"\.cpp" |cut -s -d/ -f1 |sort -u | xargs -I {} ls -d {}/package_info 2>/dev/null |cut -d/ -f1 |egrep -v Installation||true) LIST_OF_PKGS="" for PKG in $(ls) ; do From c9780d93e49116bfe721037cf7cf5fc6902557c8 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 10 Aug 2021 13:11:42 +0200 Subject: [PATCH 47/49] For the moment, documentation_parser.py is a python2 script --- Documentation/doc/scripts/compare_testsuites.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/doc/scripts/compare_testsuites.sh b/Documentation/doc/scripts/compare_testsuites.sh index 1c5a594ce1b..140dd9a94db 100644 --- a/Documentation/doc/scripts/compare_testsuites.sh +++ b/Documentation/doc/scripts/compare_testsuites.sh @@ -28,7 +28,7 @@ FAILURES=() for dir in $PATH_TO_DOC/* do OUTPUT=$(basename $dir) - python ../documentation_parser.py $dir/xml > ./"$OUTPUT.txt" + python2 ../documentation_parser.py $dir/xml > ./"$OUTPUT.txt" if [ $? -eq 0 ]; then echo "$dir OK" else From 97fb041ad5ee39ad4041f3dbb564e398bb93bbaf Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 10 Aug 2021 13:34:40 +0200 Subject: [PATCH 48/49] Port documentation_parser.py to Python3 My attempt with python2 on Ubuntu 20.04 failed. Let's move to Python3, at least for this script. --- .../doc/scripts/compare_testsuites.sh | 2 +- .../doc/scripts/documentation_parser.py | 38 ++++++++++--------- 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/Documentation/doc/scripts/compare_testsuites.sh b/Documentation/doc/scripts/compare_testsuites.sh index 140dd9a94db..0181e8166cc 100644 --- a/Documentation/doc/scripts/compare_testsuites.sh +++ b/Documentation/doc/scripts/compare_testsuites.sh @@ -28,7 +28,7 @@ FAILURES=() for dir in $PATH_TO_DOC/* do OUTPUT=$(basename $dir) - python2 ../documentation_parser.py $dir/xml > ./"$OUTPUT.txt" + python3 ../documentation_parser.py $dir/xml > ./"$OUTPUT.txt" if [ $? -eq 0 ]; then echo "$dir OK" else diff --git a/Documentation/doc/scripts/documentation_parser.py b/Documentation/doc/scripts/documentation_parser.py index 187b175bf4f..462291efae6 100644 --- a/Documentation/doc/scripts/documentation_parser.py +++ b/Documentation/doc/scripts/documentation_parser.py @@ -1,3 +1,5 @@ +#/usr/bin/env python3 + from pyquery import PyQuery as pq from collections import defaultdict from sys import argv @@ -12,17 +14,17 @@ def check_type(_in, args): root_path=argv[1] d = pq(filename=op.join(op.sep, root_path,'index.xml'), parser="xml") -compounds=[p.text() for p in d('compound').items()] -types=[p.attr('kind') for p in d('compound').items()] +compounds=[p.text() for p in list(d('compound').items())] +types=[p.attr('kind') for p in list(d('compound').items())] type_map = defaultdict(list) #map dict_map = defaultdict(dict)#map > #FOREACH compounds : fill maps -for i in xrange(0,len(compounds)): +for i in range(0,len(compounds)): if check_type(types[i], "typedef"): types[i]="type" name=d('compound').children("name").eq(i).text() - members=[p.text() for p in d('compound').eq(i).children("member").items()] - m_types=[p.attr('kind') for p in d('compound').eq(i).children("member").items()] + members=[p.text() for p in list(d('compound').eq(i).children("member").items())] + m_types=[p.attr('kind') for p in list(d('compound').eq(i).children("member").items())] if (not check_type(types[i], ['example', 'file', 'dir', 'page', 'group']) and not (types[i] == "namespace" and len(members) == 0) and not (types[i] == "enum" and len(members) == 0) ): @@ -32,7 +34,7 @@ for i in xrange(0,len(compounds)): total_path=op.join(op.sep, root_path,filepath) if(op.isfile(total_path)): e = pq(filename=total_path, parser="xml") - compoundnames=[p.text() for p in e('includes').items()] + compoundnames=[p.text() for p in list(e('includes').items())] if(len(compoundnames) > 1 and compoundnames[0].find("Concept") != -1): types[i] = 'Concept '+types[i].lower() @@ -41,7 +43,7 @@ for i in xrange(0,len(compounds)): mtype_map = defaultdict(list)# map #FOREACH member : - for j in xrange(0,len(members)): + for j in range(0,len(members)): if(check_type(types[i], ['class', 'Concept class']) and m_types[j] == "function"): m_types[j]="method" @@ -62,7 +64,7 @@ for btype in type_map: out=btype if btype.endswith('s'): out+='e' - print out.title()+'s' + print(out.title()+'s') indent+=" " #FOREACH name for name in type_map[btype]: @@ -74,7 +76,7 @@ for btype in type_map: templates=[] if op.isfile(op.join(op.sep, root_path,filepath)): f=pq(filename=op.join(op.sep, root_path,filepath), parser="xml") - templateparams=f("compounddef").children("templateparamlist").eq(0).children("param").items() + templateparams=list(f("compounddef").children("templateparamlist").eq(0).children("param").items()) for param in templateparams: template_type="" template_name="" @@ -91,7 +93,7 @@ for btype in type_map: complete_template+=' = '+template_defval templates.append(complete_template) if templates==[]:#if no child was found, just take param.text() - templates=[t.text() for t in param.items()] + templates=[t.text() for t in list(param.items())] suffix="<" #as template got type, defname and declname, name is twice in template. keep only one of them. to_remove=[""] @@ -101,7 +103,7 @@ for btype in type_map: suffix="" if suffix.endswith(', '): suffix = suffix[:-2]+'>' - print indent+name+suffix + print(indent+name+suffix) indent+=" " #FOREACH mtype @@ -109,7 +111,7 @@ for btype in type_map: out=mtype if mtype.endswith('s'): out+='e' - print indent+out.title()+'s' + print(indent+out.title()+'s') indent+=" " #FOREACH member overload_map = defaultdict(int) #contains the number of times a member has appeared (to manage the overloads) @@ -123,16 +125,16 @@ for btype in type_map: if op.isfile(op.join(op.sep, root_path,filepath)): f=pq(filename=op.join(op.sep, root_path,filepath), parser="xml") index=0 - memberdefs=[m.text() for m in f("memberdef").items()] - for i in xrange(0,len(memberdefs)): - member_names=[member_name.text() for member_name in f('memberdef').eq(i).children("name").items()] + memberdefs=[m.text() for m in list(f("memberdef").items())] + for i in range(0,len(memberdefs)): + member_names=[member_name.text() for member_name in list(f('memberdef').eq(i).children("name").items())] if f('memberdef').eq(i).children("name").text() == member: if (index < overload_map[member]): index+=1 elif (index == overload_map[member]): if check_type(mtype, ['function', 'method']): args=[f('memberdef').eq(i).children("argsstring").text()] - templateparams=f('memberdef').eq(i).children("templateparamlist").children("param").items() + templateparams=list(f('memberdef').eq(i).children("templateparamlist").children("param").items()) if check_type(mtype, ['function', 'method', 'type', 'variable']): return_type=[f('memberdef').eq(i).children("type").text()] break; @@ -158,7 +160,7 @@ for btype in type_map: complete_template+=' = '+template_defval templates.append(complete_template) if templates==[]:#if no child was found, just take param.text() - templates=[t.text() for t in param.items()] + templates=[t.text() for t in list(param.items())] prefix="template <" for template in templates: @@ -171,7 +173,7 @@ for btype in type_map: prefix+=definition if(prefix != ""): prefix+=" " - print indent+prefix+member+arguments + print(indent+prefix+member+arguments) overload_map[member]+=1 #END foreach member indent=indent[:-2] From 89aec88abca8db9a9b6c26da7720efec1f3f0137 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 12 Aug 2021 11:40:51 +0200 Subject: [PATCH 49/49] add missing entry --- Documentation/doc/Documentation/packages.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/doc/Documentation/packages.txt b/Documentation/doc/Documentation/packages.txt index 1ce8cb797a6..ba2cbad23b3 100644 --- a/Documentation/doc/Documentation/packages.txt +++ b/Documentation/doc/Documentation/packages.txt @@ -153,6 +153,7 @@ \package_listing{BGL} \package_listing{Solver_interface} \package_listing{Property_map} +\package_listing{Weights} \package_listing{Cone_spanners_2} \package_listing{Circulator} \package_listing{Generator}