diff --git a/Shape_regularization/benchmark/Shape_regularization/CMakeLists.txt b/Shape_regularization/benchmark/Shape_regularization/CMakeLists.txt index 3ef739d9468..51cc2032f5f 100644 --- a/Shape_regularization/benchmark/Shape_regularization/CMakeLists.txt +++ b/Shape_regularization/benchmark/Shape_regularization/CMakeLists.txt @@ -15,7 +15,8 @@ if(CGAL_FOUND) # Find OSQP library and headers. find_package(OSQP QUIET) - if(OSQP_FOUND) + include(CGAL_OSQP_support) + if(TARGET CGAL::OSQP_support) message(STATUS "Found OSQP") set(osqp_targets @@ -25,11 +26,9 @@ if(CGAL_FOUND) foreach(osqp_target ${osqp_targets}) create_single_source_cgal_program("${osqp_target}.cpp") if(TARGET ${osqp_target}) - target_link_libraries(${osqp_target} PUBLIC ${OSQP_LIBRARIES}) - target_compile_definitions(${osqp_target} PUBLIC -DCGAL_USE_OSQP) + target_link_libraries(${osqp_target} PUBLIC CGAL::OSQP_support) endif() endforeach() - else() message(STATUS "NOTICE: OSQP was not found. OSQP benchmarks won't be available.") endif() diff --git a/Shape_regularization/benchmark/Shape_regularization/benchmark_contours.cpp b/Shape_regularization/benchmark/Shape_regularization/benchmark_contours.cpp index 4974513f1bd..6ab83d57c11 100644 --- a/Shape_regularization/benchmark/Shape_regularization/benchmark_contours.cpp +++ b/Shape_regularization/benchmark/Shape_regularization/benchmark_contours.cpp @@ -124,7 +124,7 @@ void benchmark_contours( timer.start(); CD closed_directions(contour, true); timer.stop(); - const double longest_closed = timer.time(); + // const double longest_closed = timer.time(); timer.reset(); double closed_time = 0.0; @@ -144,7 +144,7 @@ void benchmark_contours( timer.start(); CD open_directions(contour, false); timer.stop(); - const double longest_open = timer.time(); + // const double longest_open = timer.time(); timer.reset(); double open_time = 0.0; @@ -168,7 +168,7 @@ void benchmark_contours( "closed/open): " << closed_time << "/" << open_time << " seconds" << std::endl; } -int main(int argc, char *argv[]) { +int main() { const std::size_t num_iters = 1; const std::vector ns = { diff --git a/Shape_regularization/benchmark/Shape_regularization/benchmark_qp_segments.cpp b/Shape_regularization/benchmark/Shape_regularization/benchmark_qp_segments.cpp index 8efe196ab37..84c50fab48d 100644 --- a/Shape_regularization/benchmark/Shape_regularization/benchmark_qp_segments.cpp +++ b/Shape_regularization/benchmark/Shape_regularization/benchmark_qp_segments.cpp @@ -145,7 +145,7 @@ void benchmark_qp_segments( } } timer.stop(); - const double delaunay_time = timer.time(); + // const double delaunay_time = timer.time(); timer.reset(); const FT max_angle_2 = FT(10); @@ -164,7 +164,7 @@ void benchmark_qp_segments( } } timer.stop(); - const double setup_angle_time = timer.time(); + // const double setup_angle_time = timer.time(); timer.reset(); double angle_time = 0.0; @@ -184,7 +184,7 @@ void benchmark_qp_segments( OR offset_regularization( segments, CGAL::parameters::max_offset(max_offset_2)); timer.stop(); - const double setup_offset_time = timer.time(); + // const double setup_offset_time = timer.time(); timer.reset(); timer.start(); @@ -192,7 +192,7 @@ void benchmark_qp_segments( angle_regularization.parallel_groups( std::back_inserter(pgroups)); timer.stop(); - const double init_group_time = timer.time(); + // const double init_group_time = timer.time(); timer.reset(); timer.start(); @@ -202,7 +202,7 @@ void benchmark_qp_segments( offset_regularization.add_group(pgroup); } timer.stop(); - const double add_group_time = timer.time(); + // const double add_group_time = timer.time(); timer.reset(); double offset_time = 0.0; @@ -239,7 +239,7 @@ void benchmark_qp_segments( } } -int main(int argc, char *argv[]) { +int main() { const std::size_t num_iters = 1; const std::vector ns = { diff --git a/Shape_regularization/examples/Shape_regularization/CMakeLists.txt b/Shape_regularization/examples/Shape_regularization/CMakeLists.txt index 255a97bf50f..d59cddb5660 100644 --- a/Shape_regularization/examples/Shape_regularization/CMakeLists.txt +++ b/Shape_regularization/examples/Shape_regularization/CMakeLists.txt @@ -15,7 +15,8 @@ if(CGAL_FOUND) # Find OSQP library and headers. find_package(OSQP QUIET) - if(OSQP_FOUND) + include(CGAL_OSQP_support) + if(TARGET CGAL::OSQP_support) message(STATUS "Found OSQP") set(osqp_targets @@ -27,8 +28,7 @@ if(CGAL_FOUND) foreach(osqp_target ${osqp_targets}) create_single_source_cgal_program("${osqp_target}.cpp") if(TARGET ${osqp_target}) - target_link_libraries(${osqp_target} PUBLIC ${OSQP_LIBRARIES}) - target_compile_definitions(${osqp_target} PUBLIC -DCGAL_USE_OSQP) + target_link_libraries(${osqp_target} PUBLIC CGAL::OSQP_support) endif() endforeach() @@ -38,9 +38,7 @@ if(CGAL_FOUND) if(TARGET CGAL::Eigen3_support) message(STATUS "Found Eigen") create_single_source_cgal_program("regularize_real_data_2.cpp") - target_link_libraries(regularize_real_data_2 PUBLIC CGAL::Eigen3_support ${OSQP_LIBRARIES}) - target_compile_definitions(regularize_real_data_2 PUBLIC -DCGAL_USE_OSQP) - + target_link_libraries(regularize_real_data_2 PUBLIC CGAL::Eigen3_support CGAL::OSQP_support) else() message(STATUS "NOTICE: Eigen was not found. Eigen examples won't be available.") endif() diff --git a/Shape_regularization/examples/Shape_regularization/regularize_planes.cpp b/Shape_regularization/examples/Shape_regularization/regularize_planes.cpp index a6310f08243..a470b643559 100644 --- a/Shape_regularization/examples/Shape_regularization/regularize_planes.cpp +++ b/Shape_regularization/examples/Shape_regularization/regularize_planes.cpp @@ -31,7 +31,7 @@ int main(int argc, char** argv) { file.precision(20); if (!file || - !CGAL::read_xyz_points( + !CGAL::IO::read_XYZ( file, std::back_inserter(points), CGAL::parameters::point_map(Point_map()). diff --git a/Shape_regularization/test/Shape_regularization/CMakeLists.txt b/Shape_regularization/test/Shape_regularization/CMakeLists.txt index 09a3462eeab..179c45c8efa 100644 --- a/Shape_regularization/test/Shape_regularization/CMakeLists.txt +++ b/Shape_regularization/test/Shape_regularization/CMakeLists.txt @@ -15,7 +15,8 @@ if(CGAL_FOUND) # Find OSQP library and headers. find_package(OSQP QUIET) - if(OSQP_FOUND) + include(CGAL_OSQP_support) + if(TARGET CGAL::OSQP_support) message(STATUS "Found OSQP") set(osqp_targets @@ -32,11 +33,9 @@ if(CGAL_FOUND) foreach(osqp_target ${osqp_targets}) create_single_source_cgal_program("${osqp_target}.cpp") if(TARGET ${osqp_target}) - target_link_libraries(${osqp_target} PUBLIC ${OSQP_LIBRARIES}) - target_compile_definitions(${osqp_target} PUBLIC -DCGAL_USE_OSQP) + target_link_libraries(${osqp_target} PUBLIC CGAL::OSQP_support) endif() endforeach() - else() message(STATUS "NOTICE: OSQP was not found. OSQP tests won't be available.") endif() diff --git a/Shape_regularization/test/Shape_regularization/test_0_segments.cpp b/Shape_regularization/test/Shape_regularization/test_0_segments.cpp index 86c40924170..a179a70d8de 100644 --- a/Shape_regularization/test/Shape_regularization/test_0_segments.cpp +++ b/Shape_regularization/test/Shape_regularization/test_0_segments.cpp @@ -11,7 +11,6 @@ template void test_0_segments() { using FT = typename Traits::FT; - using Point_2 = typename Traits::Point_2; using Segment_2 = typename Traits::Segment_2; using Segments = std::vector; using Indices = std::vector; diff --git a/Shape_regularization/test/Shape_regularization/test_closed_contour_10_edges.cpp b/Shape_regularization/test/Shape_regularization/test_closed_contour_10_edges.cpp index 136817c1de5..5781d7a293b 100644 --- a/Shape_regularization/test/Shape_regularization/test_closed_contour_10_edges.cpp +++ b/Shape_regularization/test/Shape_regularization/test_closed_contour_10_edges.cpp @@ -10,7 +10,6 @@ namespace SR = CGAL::Shape_regularization; template void test_closed_contour_10_edges() { - using FT = typename Traits::FT; using Point_2 = typename Traits::Point_2; using Contour = std::vector; using Saver = SR::Tests::Saver; diff --git a/Shape_regularization/test/Shape_regularization/test_closed_contour_3_edges.cpp b/Shape_regularization/test/Shape_regularization/test_closed_contour_3_edges.cpp index a2ff59e6e3e..eb660afbcb9 100644 --- a/Shape_regularization/test/Shape_regularization/test_closed_contour_3_edges.cpp +++ b/Shape_regularization/test/Shape_regularization/test_closed_contour_3_edges.cpp @@ -10,7 +10,6 @@ namespace SR = CGAL::Shape_regularization; template void test_closed_contour_3_edges() { - using FT = typename Traits::FT; using Point_2 = typename Traits::Point_2; using Contour = std::vector; using Saver = SR::Tests::Saver; diff --git a/Shape_regularization/test/Shape_regularization/test_closed_contour_4_edges.cpp b/Shape_regularization/test/Shape_regularization/test_closed_contour_4_edges.cpp index cf71c1421db..ae971ceb0c5 100644 --- a/Shape_regularization/test/Shape_regularization/test_closed_contour_4_edges.cpp +++ b/Shape_regularization/test/Shape_regularization/test_closed_contour_4_edges.cpp @@ -10,7 +10,6 @@ namespace SR = CGAL::Shape_regularization; template void test_closed_contour_4_edges() { - using FT = typename Traits::FT; using Point_2 = typename Traits::Point_2; using Contour = std::vector; using Saver = SR::Tests::Saver; diff --git a/Shape_regularization/test/Shape_regularization/test_directions_longest.cpp b/Shape_regularization/test/Shape_regularization/test_directions_longest.cpp index f8ba1fc4bcd..fac96e84023 100644 --- a/Shape_regularization/test/Shape_regularization/test_directions_longest.cpp +++ b/Shape_regularization/test/Shape_regularization/test_directions_longest.cpp @@ -10,7 +10,6 @@ namespace SR = CGAL::Shape_regularization; template void test_directions_longest() { - using FT = typename Traits::FT; using Point_2 = typename Traits::Point_2; using Direction_2 = typename Traits::Direction_2; using Contour = std::vector; diff --git a/Shape_regularization/test/Shape_regularization/test_directions_multiple_3.cpp b/Shape_regularization/test/Shape_regularization/test_directions_multiple_3.cpp index 2b55729de23..f91f42cf066 100644 --- a/Shape_regularization/test/Shape_regularization/test_directions_multiple_3.cpp +++ b/Shape_regularization/test/Shape_regularization/test_directions_multiple_3.cpp @@ -11,7 +11,6 @@ namespace SR = CGAL::Shape_regularization; template void test_directions_multiple_3() { - using FT = typename Traits::FT; using Point_2 = typename Traits::Point_2; using Contour = std::vector; using Saver = SR::Tests::Saver; diff --git a/Shape_regularization/test/Shape_regularization/test_neighbor_query.cpp b/Shape_regularization/test/Shape_regularization/test_neighbor_query.cpp index 2f96c54cfa1..57b6447303b 100644 --- a/Shape_regularization/test/Shape_regularization/test_neighbor_query.cpp +++ b/Shape_regularization/test/Shape_regularization/test_neighbor_query.cpp @@ -10,7 +10,6 @@ namespace SR = CGAL::Shape_regularization; template void test_neighbor_query() { - using FT = typename Traits::FT; using Point_2 = typename Traits::Point_2; using Segment_2 = typename Traits::Segment_2; using Segments = std::vector; diff --git a/Shape_regularization/test/Shape_regularization/test_open_contour_1_edge.cpp b/Shape_regularization/test/Shape_regularization/test_open_contour_1_edge.cpp index 012ee4046b1..527ddc9199a 100644 --- a/Shape_regularization/test/Shape_regularization/test_open_contour_1_edge.cpp +++ b/Shape_regularization/test/Shape_regularization/test_open_contour_1_edge.cpp @@ -10,7 +10,6 @@ namespace SR = CGAL::Shape_regularization; template void test_open_contour_1_edge() { - using FT = typename Traits::FT; using Point_2 = typename Traits::Point_2; using Contour = std::vector; using Saver = SR::Tests::Saver; diff --git a/Shape_regularization/test/Shape_regularization/test_open_contour_9_edges.cpp b/Shape_regularization/test/Shape_regularization/test_open_contour_9_edges.cpp index a96af72b490..5578d84db42 100644 --- a/Shape_regularization/test/Shape_regularization/test_open_contour_9_edges.cpp +++ b/Shape_regularization/test/Shape_regularization/test_open_contour_9_edges.cpp @@ -10,7 +10,6 @@ namespace SR = CGAL::Shape_regularization; template void test_open_contour_9_edges() { - using FT = typename Traits::FT; using Point_2 = typename Traits::Point_2; using Contour = std::vector; using Saver = SR::Tests::Saver; diff --git a/Shape_regularization/test/Shape_regularization/test_segments.cpp b/Shape_regularization/test/Shape_regularization/test_segments.cpp index df564fdf152..42d602a7a7e 100644 --- a/Shape_regularization/test/Shape_regularization/test_segments.cpp +++ b/Shape_regularization/test/Shape_regularization/test_segments.cpp @@ -34,7 +34,6 @@ bool has_no_difference( template void test_segments() { - using FT = typename Traits::FT; using Point_2 = typename Traits::Point_2; using Segment_2 = typename Traits::Segment_2; using Segments = std::vector; diff --git a/Shape_regularization/test/Shape_regularization/test_unique_segments.cpp b/Shape_regularization/test/Shape_regularization/test_unique_segments.cpp index d6b7f58053a..58849e08f5c 100644 --- a/Shape_regularization/test/Shape_regularization/test_unique_segments.cpp +++ b/Shape_regularization/test/Shape_regularization/test_unique_segments.cpp @@ -14,7 +14,6 @@ void test_unique_segments() { using Point_2 = typename Traits::Point_2; using Segment_2 = typename Traits::Segment_2; using Segments = std::vector; - using Indices = std::vector; using Saver = SR::Tests::Saver; Saver saver; diff --git a/Shape_regularization/todo.md b/Shape_regularization/todo.md index 93e76a82d43..3a15769dd1d 100644 --- a/Shape_regularization/todo.md +++ b/Shape_regularization/todo.md @@ -1,7 +1,6 @@ * Comment the code. * Spell check all files. * Check memory leaking. -* Check authors. * Install OSQP on all testing platforms. * Add a 3D version of the QP regularization algorithm.