diff --git a/AABB_tree/benchmark/AABB_tree/CMakeLists.txt b/AABB_tree/benchmark/AABB_tree/CMakeLists.txt index 162d8cd9a15..b6ae8fdc0e2 100644 --- a/AABB_tree/benchmark/AABB_tree/CMakeLists.txt +++ b/AABB_tree/benchmark/AABB_tree/CMakeLists.txt @@ -6,12 +6,14 @@ project(AABB_traits_benchmark) find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Core) -# google benchmark -find_package(benchmark) - -if (benchmark_FOUND) - create_single_source_cgal_program("tree_creation.cpp") - target_link_libraries(tree_creation benchmark::benchmark) -endif() create_single_source_cgal_program("test.cpp") create_single_source_cgal_program("tree_construction.cpp") + +# google benchmark +find_package(benchmark QUIET) +if(benchmark_FOUND) + create_single_source_cgal_program("tree_creation.cpp") + target_link_libraries(tree_creation benchmark::benchmark) +else() + message(STATUS "NOTICE: The benchmark 'tree_creation.cpp' requires the Google benchmark library, and will not be compiled.") +endif() diff --git a/AABB_tree/demo/AABB_tree/CMakeLists.txt b/AABB_tree/demo/AABB_tree/CMakeLists.txt index 8cc6c27c3f8..c777eba1798 100644 --- a/AABB_tree/demo/AABB_tree/CMakeLists.txt +++ b/AABB_tree/demo/AABB_tree/CMakeLists.txt @@ -5,6 +5,7 @@ project(AABB_tree_Demo) # Find includes in corresponding build directories set(CMAKE_INCLUDE_CURRENT_DIR ON) + # Instruct CMake to run moc automatically when needed. set(CMAKE_AUTOMOC ON) if(NOT POLICY CMP0070 AND POLICY CMP0053) @@ -31,10 +32,8 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND) include(AddFileDependencies) - qt5_generate_moc("MainWindow.h" - "${CMAKE_CURRENT_BINARY_DIR}/MainWindow_moc.cpp") - add_file_dependencies(MainWindow_moc.cpp - "${CMAKE_CURRENT_SOURCE_DIR}/MainWindow.h") + qt5_generate_moc("MainWindow.h" "${CMAKE_CURRENT_BINARY_DIR}/MainWindow_moc.cpp") + add_file_dependencies(MainWindow_moc.cpp "${CMAKE_CURRENT_SOURCE_DIR}/MainWindow.h") qt5_generate_moc("Viewer.h" "${CMAKE_CURRENT_BINARY_DIR}/Viewer_moc.cpp") add_file_dependencies(Viewer_moc.cpp "${CMAKE_CURRENT_SOURCE_DIR}/Viewer.h") @@ -62,8 +61,7 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND) include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) cgal_add_compilation_test(AABB_demo) -else(CGAL_Qt5_FOUND - AND Qt5_FOUND) +else(CGAL_Qt5_FOUND AND Qt5_FOUND) set(AABB_MISSING_DEPS "") @@ -75,11 +73,6 @@ else(CGAL_Qt5_FOUND set(AABB_MISSING_DEPS "Qt5, ${AABB_MISSING_DEPS}") endif() - message( - STATUS - "NOTICE: This demo requires ${AABB_MISSING_DEPS}and will not be compiled." - ) + message("NOTICE: This demo requires ${AABB_MISSING_DEPS}, and will not be compiled.") -endif( - CGAL_Qt5_FOUND - AND Qt5_FOUND) +endif(CGAL_Qt5_FOUND AND Qt5_FOUND) diff --git a/Algebraic_kernel_d/examples/Algebraic_kernel_d/CMakeLists.txt b/Algebraic_kernel_d/examples/Algebraic_kernel_d/CMakeLists.txt index de5a1876957..696fdabc10a 100644 --- a/Algebraic_kernel_d/examples/Algebraic_kernel_d/CMakeLists.txt +++ b/Algebraic_kernel_d/examples/Algebraic_kernel_d/CMakeLists.txt @@ -4,15 +4,13 @@ project(Algebraic_kernel_d_Examples) find_package(CGAL REQUIRED COMPONENTS Core) find_package(MPFI QUIET) - if(MPFI_FOUND AND NOT CGAL_DISABLE_GMP) include(${MPFI_USE_FILE}) - include(CGAL_VersionUtils) create_single_source_cgal_program("Compare_1.cpp") create_single_source_cgal_program("Construct_algebraic_real_1.cpp") create_single_source_cgal_program("Isolate_1.cpp") create_single_source_cgal_program("Sign_at_1.cpp") create_single_source_cgal_program("Solve_1.cpp") else() - message(STATUS "This program requires the CGAL, CGAL_Core and MPFI libraries, and will not be compiled.") + message("NOTICE: This project requires the MPFI library and GMP support, and will not be compiled.") endif() diff --git a/Algebraic_kernel_d/test/Algebraic_kernel_d/CMakeLists.txt b/Algebraic_kernel_d/test/Algebraic_kernel_d/CMakeLists.txt index 78210e47045..33e96b365e9 100644 --- a/Algebraic_kernel_d/test/Algebraic_kernel_d/CMakeLists.txt +++ b/Algebraic_kernel_d/test/Algebraic_kernel_d/CMakeLists.txt @@ -4,48 +4,33 @@ project(Algebraic_kernel_d_Tests) # CGAL and its components find_package(CGAL REQUIRED COMPONENTS Core) -find_package(RS3 QUIET) - +find_package(MPFI QUIET) if(MPFI_FOUND) + message(STATUS "Found MPFI") include(${MPFI_USE_FILE}) endif() + +find_package(RS3 QUIET) if(RS3_FOUND) + message(STATUS "Found RS3") include(${RS3_USE_FILE}) endif() -# Boost and its components -find_package(Boost) - -if(NOT Boost_FOUND) - - message( - STATUS "This project requires the Boost library, and will not be compiled.") - - return() - -endif() - # include for local directory include_directories(BEFORE include) -# Creating entries for all .cpp/.C files with "main" routine -# ########################################################## - create_single_source_cgal_program("cyclic.cpp") create_single_source_cgal_program("Descartes.cpp") + if(NOT CGAL_DISABLE_GMP) create_single_source_cgal_program("Algebraic_curve_kernel_2.cpp") create_single_source_cgal_program("algebraic_curve_kernel_2_tools.cpp") create_single_source_cgal_program("Algebraic_kernel_d_1_LEDA.cpp") - create_single_source_cgal_program( - "Algebraic_kernel_d_1_CORE_Integer_rational.cpp") - create_single_source_cgal_program( - "Algebraic_kernel_d_1_CORE_SqrtII_rational.cpp") - create_single_source_cgal_program( - "Algebraic_kernel_d_1_CORE_SqrtRI_rational.cpp") - create_single_source_cgal_program( - "Algebraic_kernel_d_1_CORE_SqrtRR_rational.cpp") + create_single_source_cgal_program("Algebraic_kernel_d_1_CORE_Integer_rational.cpp") + create_single_source_cgal_program("Algebraic_kernel_d_1_CORE_SqrtII_rational.cpp") + create_single_source_cgal_program("Algebraic_kernel_d_1_CORE_SqrtRI_rational.cpp") + create_single_source_cgal_program("Algebraic_kernel_d_1_CORE_SqrtRR_rational.cpp") create_single_source_cgal_program("Algebraic_kernel_d_1_GMP.cpp") create_single_source_cgal_program("Algebraic_kernel_d_2.cpp") @@ -54,14 +39,13 @@ if(NOT CGAL_DISABLE_GMP) create_single_source_cgal_program("Curve_analysis_2.cpp") create_single_source_cgal_program("Curve_pair_analysis_2.cpp") create_single_source_cgal_program("Real_embeddable_traits_extension.cpp") + if(RS_FOUND) create_single_source_cgal_program("Algebraic_kernel_rs_gmpq_d_1.cpp") create_single_source_cgal_program("Algebraic_kernel_rs_gmpz_d_1.cpp") else() - message( - STATUS - "NOTICE: Some tests require the RS library, and will not be compiled.") + message(STATUS "NOTICE: Some tests require the RS library, and will not be compiled.") endif() else() - message(STATUS "NOTICE: Some tests require the CGAL_Core library, and will not be compiled.") + message(STATUS "NOTICE: Some tests require GMP support, and will not be compiled.") endif() diff --git a/Alpha_shapes_3/demo/Alpha_shapes_3/CMakeLists.txt b/Alpha_shapes_3/demo/Alpha_shapes_3/CMakeLists.txt index a20424c7b5b..ec2a2a8dbb4 100644 --- a/Alpha_shapes_3/demo/Alpha_shapes_3/CMakeLists.txt +++ b/Alpha_shapes_3/demo/Alpha_shapes_3/CMakeLists.txt @@ -6,6 +6,7 @@ project(Alpha_shapes_3_Demo) # Find includes in corresponding build directories set(CMAKE_INCLUDE_CURRENT_DIR ON) + # Instruct CMake to run moc automatically when needed. set(CMAKE_AUTOMOC ON) if(NOT POLICY CMP0070 AND POLICY CMP0053) @@ -46,8 +47,6 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND) else() - message( - STATUS "NOTICE: This demo requires CGAL, and Qt5, and will not be compiled." - ) + message("NOTICE: This demo requires CGAL and Qt5, and will not be compiled.") endif() diff --git a/Arithmetic_kernel/test/Arithmetic_kernel/CMakeLists.txt b/Arithmetic_kernel/test/Arithmetic_kernel/CMakeLists.txt index 3c1e32fa19f..08d054ea54c 100644 --- a/Arithmetic_kernel/test/Arithmetic_kernel/CMakeLists.txt +++ b/Arithmetic_kernel/test/Arithmetic_kernel/CMakeLists.txt @@ -6,7 +6,7 @@ project(Arithmetic_kernel_Tests) find_package(CGAL REQUIRED COMPONENTS Core) -find_package(GMP QUIET) +find_package(GMP) if(GMP_FOUND) @@ -18,7 +18,7 @@ if(GMP_FOUND) include_directories(include) - find_package(MPFI) + find_package(MPFI QUIET) if(MPFI_FOUND) include(${MPFI_USE_FILE}) @@ -27,16 +27,13 @@ if(GMP_FOUND) # version needs GMP>=4.2, so we require this dependency only here and # not in FindMPFI.cmake if(_IS_GMP_VERSION_TO_LOW) - message( - STATUS - "MPFI tests need GMP>=4.2, some of the tests will not be compiled") + message(STATUS "NOTICE: MPFI tests need GMP>=4.2, some of the tests will not be compiled") else(_IS_GMP_VERSION_TO_LOW) include(${MPFI_USE_FILE}) create_single_source_cgal_program("GMP_arithmetic_kernel.cpp") endif(_IS_GMP_VERSION_TO_LOW) else(MPFI_FOUND) - message( - STATUS "MPFI is not present, some of the tests will not be compiled.") + message(STATUS "NOTICE: MPFI is not present, some of the tests will not be compiled.") endif(MPFI_FOUND) create_single_source_cgal_program("Arithmetic_kernel.cpp") @@ -46,7 +43,6 @@ if(GMP_FOUND) else() - message( - STATUS "This program requires the CGAL library, and will not be compiled.") + message("NOTICE: This project requires GMP support, and will not be compiled.") endif() diff --git a/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/lexical_cast.hpp b/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/lexical_cast.hpp index 79d885905ef..d16d9e378a8 100644 --- a/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/lexical_cast.hpp +++ b/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/lexical_cast.hpp @@ -1,7 +1,7 @@ #ifndef LEXICAL_CAST_HPP #define LEXICAL_CAST_HPP -/*! This files provides lexical casts from std::string to any one of the number +/*! This file provides lexical casts from std::string to any one of the number * types we intend to use in the benchmark, and a lexical cast does not exist. * It is inspired by boost::lexical_cast */ diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/CMakeLists.txt b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/CMakeLists.txt index e91295a5d90..82e33197dae 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/CMakeLists.txt +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/CMakeLists.txt @@ -12,10 +12,10 @@ if(POLICY CMP0071) cmake_policy(SET CMP0071 NEW) endif() -find_package(CGAL QUIET COMPONENTS Qt5 OPTIONAL_COMPONENTS Core) +find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Core Qt5) find_package(Qt5 QUIET COMPONENTS Gui Widgets) -if (CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND) +if (CGAL_Qt5_FOUND AND Qt5_FOUND) include(${CGAL_USE_FILE}) add_compile_definitions(QT_NO_KEYWORDS) include_directories( BEFORE ./ ) @@ -110,10 +110,10 @@ if (CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND) ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) - target_link_libraries(arrangement_2 Qt5::Core Qt5::Gui Qt5::Widgets) - target_link_libraries(arrangement_2 CGAL::CGAL CGAL::CGAL_Qt5) + target_link_libraries(arrangement_2 PRIVATE Qt5::Core Qt5::Gui Qt5::Widgets) + target_link_libraries(arrangement_2 PRIVATE CGAL::CGAL CGAL::CGAL_Qt5) if(CGAL_Core_FOUND) - target_link_libraries(arrangement_2 CGAL::CGAL_Core) + target_link_libraries(arrangement_2 PRIVATE CGAL::CGAL_Core) endif() add_to_cached_list(CGAL_EXECUTABLE_TARGETS arrangement_2) @@ -124,15 +124,11 @@ if (CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND) else() set(MISSING_DEPS "") - if(NOT CGAL_FOUND) - set(MISSING_DEPS "CGAL, ${MISSING_DEPS}") - endif() if(NOT CGAL_Qt5_FOUND) set(MISSING_DEPS "the CGAL Qt5 library, ${MISSING_DEPS}") endif() if(NOT Qt5_FOUND) set(MISSING_DEPS "Qt5, ${MISSING_DEPS}") endif() - message(STATUS - "NOTICE: This demo requires ${MISSING_DEPS} and will not be compiled.") + message("NOTICE: This demo requires ${MISSING_DEPS} and will not be compiled.") endif() diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_configuration.h b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_configuration.h index dfd25a01536..2a4baa7609b 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_configuration.h +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_configuration.h @@ -1,7 +1,7 @@ #ifndef CGAL_TEST_CONFIGURATION_H #define CGAL_TEST_CONFIGURATION_H -/*! This files contains define statements, include statement, and typedef +/*! This file contains define statements, include statement, and typedef * of the number types, kernel, and traits used. * */ diff --git a/BGL/examples/BGL_LCC/CMakeLists.txt b/BGL/examples/BGL_LCC/CMakeLists.txt index 9264e681521..f9230373e23 100644 --- a/BGL/examples/BGL_LCC/CMakeLists.txt +++ b/BGL/examples/BGL_LCC/CMakeLists.txt @@ -7,23 +7,6 @@ project(BGL_LCC_Examples) # CGAL and its components find_package(CGAL REQUIRED) -# Boost and its components -find_package(Boost REQUIRED) - -if(NOT Boost_FOUND) - - message( - STATUS "This project requires the Boost library, and will not be compiled.") - - return() - -endif() - -# include for local directory - -# Creating entries for all C++ files with "main" routine -# ########################################################## - # create a target per cppfile file( GLOB_RECURSE cppfiles diff --git a/BGL/examples/BGL_OpenMesh/CMakeLists.txt b/BGL/examples/BGL_OpenMesh/CMakeLists.txt index ca213799b53..aa4e0e208f2 100644 --- a/BGL/examples/BGL_OpenMesh/CMakeLists.txt +++ b/BGL/examples/BGL_OpenMesh/CMakeLists.txt @@ -7,38 +7,11 @@ project(BGL_OpenMesh_Examples) # CGAL and its components find_package(CGAL REQUIRED) -# Boost and its components -find_package(Boost REQUIRED) - -if(NOT Boost_FOUND) - - message( - STATUS "This project requires the Boost library, and will not be compiled.") - - return() - -endif() - -find_package(OpenMesh QUIET) - +find_package(OpenMesh) if(OpenMesh_FOUND) include(UseOpenMesh) -else() - - message( - STATUS "NOTICE: These examples require OpenMesh and will not be compiled.") - return() - -endif() - -# include for local directory - -# include for local package - -# Creating entries for all C++ files with "main" routine -# ########################################################## - -if(OpenMesh_FOUND) create_single_source_cgal_program("TriMesh.cpp") target_link_libraries(TriMesh PRIVATE ${OPENMESH_LIBRARIES}) +else() + message("NOTICE: This project requires OpenMesh and will not be compiled.") endif() diff --git a/BGL/examples/BGL_graphcut/CMakeLists.txt b/BGL/examples/BGL_graphcut/CMakeLists.txt index c9385bee6d9..af873296cab 100644 --- a/BGL/examples/BGL_graphcut/CMakeLists.txt +++ b/BGL/examples/BGL_graphcut/CMakeLists.txt @@ -8,25 +8,5 @@ project(BGL_graphcut_Examples) # CGAL and its components find_package(CGAL REQUIRED) -# Boost and its components -find_package(Boost REQUIRED) - -if(NOT Boost_FOUND) - - message( - STATUS "This project requires the Boost library, and will not be compiled.") - - return() - -endif() - -# include for local directory - -# include for local package - -# Creating entries for all C++ files with "main" routine -# ########################################################## - create_single_source_cgal_program("alpha_expansion_example.cpp") -create_single_source_cgal_program( - "face_selection_borders_regularization_example.cpp") +create_single_source_cgal_program("face_selection_borders_regularization_example.cpp") diff --git a/BGL/examples/BGL_polyhedron_3/CMakeLists.txt b/BGL/examples/BGL_polyhedron_3/CMakeLists.txt index 4179ca63745..9fbe55b6e75 100644 --- a/BGL/examples/BGL_polyhedron_3/CMakeLists.txt +++ b/BGL/examples/BGL_polyhedron_3/CMakeLists.txt @@ -7,54 +7,28 @@ project(BGL_polyhedron_3_Examples) # CGAL and its components find_package(CGAL REQUIRED) -# Boost and its components -find_package(Boost REQUIRED) - -if(NOT Boost_FOUND) - - message( - STATUS "This project requires the Boost library, and will not be compiled.") - - return() - -endif() - -# include for local directory - -# include for local package - -# Creating entries for all C++ files with "main" routine -# ########################################################## - create_single_source_cgal_program("distance.cpp") - create_single_source_cgal_program("incident_vertices.cpp") - create_single_source_cgal_program("kruskal.cpp") - create_single_source_cgal_program("kruskal_with_stored_id.cpp") - create_single_source_cgal_program("normals.cpp") - create_single_source_cgal_program("range.cpp") - create_single_source_cgal_program("transform_iterator.cpp") - create_single_source_cgal_program("copy_polyhedron.cpp") -find_package( OpenMesh QUIET ) +find_package(OpenMesh QUIET) if(OpenMesh_FOUND) - target_link_libraries( copy_polyhedron PRIVATE ${OPENMESH_LIBRARIES} ) - target_compile_definitions( copy_polyhedron PRIVATE -DCGAL_USE_OPENMESH ) + target_link_libraries(copy_polyhedron PRIVATE ${OPENMESH_LIBRARIES}) + target_compile_definitions(copy_polyhedron PRIVATE -DCGAL_USE_OPENMESH) else() - message(STATUS "Examples that use OpenMesh will not be compiled.") + message(STATUS "NOTICE: The example 'copy_polyhedron' will not use OpenMesh.") endif() -find_package( METIS ) +find_package(METIS QUIET) include(CGAL_METIS_support) -if( TARGET CGAL::METIS_support ) - create_single_source_cgal_program( "polyhedron_partition.cpp" ) - target_link_libraries( polyhedron_partition PUBLIC CGAL::METIS_support) +if(TARGET CGAL::METIS_support) + create_single_source_cgal_program("polyhedron_partition.cpp") + target_link_libraries(polyhedron_partition PUBLIC CGAL::METIS_support) else() - message( STATUS "Examples that use the METIS library will not be compiled." ) + message(STATUS "NOTICE: The example 'polyhedron_partition' requires the METIS library, and will not be compiled.") endif() diff --git a/BGL/examples/BGL_surface_mesh/CMakeLists.txt b/BGL/examples/BGL_surface_mesh/CMakeLists.txt index b96ec0308e1..551484979a1 100644 --- a/BGL/examples/BGL_surface_mesh/CMakeLists.txt +++ b/BGL/examples/BGL_surface_mesh/CMakeLists.txt @@ -3,8 +3,6 @@ project(BGL_surface_mesh_Examples) find_package(CGAL REQUIRED) -# include for local package - create_single_source_cgal_program("prim.cpp") create_single_source_cgal_program("gwdwg.cpp") create_single_source_cgal_program("seam_mesh.cpp") @@ -12,11 +10,11 @@ create_single_source_cgal_program("write_inp.cpp") create_single_source_cgal_program("surface_mesh_dual.cpp") create_single_source_cgal_program("connected_components.cpp") -find_package(METIS) +find_package(METIS QUIET) include(CGAL_METIS_support) -if( TARGET CGAL::METIS_support ) - create_single_source_cgal_program( "surface_mesh_partition.cpp" ) - target_link_libraries( surface_mesh_partition PUBLIC CGAL::METIS_support ) +if(TARGET CGAL::METIS_support) + create_single_source_cgal_program("surface_mesh_partition.cpp") + target_link_libraries(surface_mesh_partition PUBLIC CGAL::METIS_support) else() - message(STATUS "Examples that use the METIS library will not be compiled.") + message(STATUS "NOTICE: Examples that use the METIS library will not be compiled.") endif() diff --git a/BGL/test/BGL/CMakeLists.txt b/BGL/test/BGL/CMakeLists.txt index da8baf25ccb..3f81213dd21 100644 --- a/BGL/test/BGL/CMakeLists.txt +++ b/BGL/test/BGL/CMakeLists.txt @@ -7,100 +7,44 @@ project(BGL_Tests) # CGAL and its components find_package(CGAL REQUIRED) -# Boost and its components -find_package(Boost) - -if(NOT Boost_FOUND) - message( - STATUS "This project requires the Boost library, and will not be compiled.") - return() -endif() +create_single_source_cgal_program("test_split.cpp") +create_single_source_cgal_program("next.cpp") +create_single_source_cgal_program("test_circulator.cpp") +create_single_source_cgal_program("test_Gwdwg.cpp") +create_single_source_cgal_program("test_bgl_dual.cpp") +create_single_source_cgal_program("graph_concept_Polyhedron_3.cpp") +create_single_source_cgal_program("graph_concept_Dual.cpp") +create_single_source_cgal_program("graph_concept_Triangulation_2.cpp") +create_single_source_cgal_program("graph_concept_Surface_mesh.cpp") +create_single_source_cgal_program("graph_concept_Seam_mesh_Surface_mesh.cpp") +create_single_source_cgal_program("graph_concept_Gwdwg_Surface_mesh.cpp") +create_single_source_cgal_program("graph_concept_Linear_cell_complex.cpp") +create_single_source_cgal_program("graph_concept_Arrangement_2.cpp") +create_single_source_cgal_program("graph_concept_Derived.cpp" ) +create_single_source_cgal_program("test_clear.cpp" ) +create_single_source_cgal_program("test_helpers.cpp") +create_single_source_cgal_program("test_Has_member_clear.cpp") +create_single_source_cgal_program("test_Has_member_id.cpp") +create_single_source_cgal_program("test_bgl_read_write.cpp") +create_single_source_cgal_program("graph_concept_Face_filtered_graph.cpp") +create_single_source_cgal_program("test_Manifold_face_removal.cpp") +create_single_source_cgal_program("test_Regularize_face_selection_borders.cpp") +create_single_source_cgal_program("test_Face_filtered_graph.cpp") +create_single_source_cgal_program("test_Euler_operations.cpp") +create_single_source_cgal_program("test_test_face.cpp" ) +create_single_source_cgal_program("test_Collapse_edge.cpp" ) +create_single_source_cgal_program("test_Collapse_edge_with_constraints.cpp" ) +create_single_source_cgal_program("test_graph_traits.cpp") +create_single_source_cgal_program("test_Properties.cpp") +create_single_source_cgal_program("bench_read_from_stream_vs_add_face_and_add_faces.cpp") +create_single_source_cgal_program("graph_traits_inheritance.cpp" ) +create_single_source_cgal_program("test_deprecated_io.cpp") find_package(OpenMesh QUIET) - if(OpenMesh_FOUND) include(UseOpenMesh) add_definitions(-DCGAL_USE_OPENMESH) -else() - message(STATUS "Tests that use OpenMesh will not be compiled.") -endif() -# include for local package - -# Creating entries for all .cpp/.C files with "main" routine -# ########################################################## - -if(OpenMesh_FOUND) - create_single_source_cgal_program("graph_concept_OpenMesh.cpp") - target_link_libraries(graph_concept_OpenMesh PRIVATE ${OPENMESH_LIBRARIES}) -endif() - -create_single_source_cgal_program("test_split.cpp") - -create_single_source_cgal_program("next.cpp") - -create_single_source_cgal_program("test_circulator.cpp") - -create_single_source_cgal_program("test_Gwdwg.cpp") - -create_single_source_cgal_program("test_bgl_dual.cpp") - -create_single_source_cgal_program("graph_concept_Polyhedron_3.cpp") - -create_single_source_cgal_program("graph_concept_Dual.cpp") - -create_single_source_cgal_program("graph_concept_Triangulation_2.cpp") - -create_single_source_cgal_program("graph_concept_Surface_mesh.cpp") - -create_single_source_cgal_program("graph_concept_Seam_mesh_Surface_mesh.cpp") - -create_single_source_cgal_program("graph_concept_Gwdwg_Surface_mesh.cpp") - -create_single_source_cgal_program("graph_concept_Linear_cell_complex.cpp") - -create_single_source_cgal_program("graph_concept_Arrangement_2.cpp") - -create_single_source_cgal_program( "graph_concept_Derived.cpp" ) - -create_single_source_cgal_program( "test_clear.cpp" ) - -create_single_source_cgal_program("test_helpers.cpp") - -create_single_source_cgal_program("test_Has_member_clear.cpp") - -create_single_source_cgal_program("test_Has_member_id.cpp") - -create_single_source_cgal_program("test_bgl_read_write.cpp") - -create_single_source_cgal_program("graph_concept_Face_filtered_graph.cpp") - -create_single_source_cgal_program("test_Manifold_face_removal.cpp") - -create_single_source_cgal_program("test_Regularize_face_selection_borders.cpp") - -create_single_source_cgal_program("test_Face_filtered_graph.cpp") - -create_single_source_cgal_program("test_Euler_operations.cpp") - -create_single_source_cgal_program( "test_test_face.cpp" ) - -create_single_source_cgal_program( "test_Collapse_edge.cpp" ) - -create_single_source_cgal_program( "test_Collapse_edge_with_constraints.cpp" ) - -create_single_source_cgal_program("test_graph_traits.cpp") - -create_single_source_cgal_program("test_Properties.cpp") - -create_single_source_cgal_program( - "bench_read_from_stream_vs_add_face_and_add_faces.cpp") - -create_single_source_cgal_program( "graph_traits_inheritance.cpp" ) - -create_single_source_cgal_program("test_deprecated_io.cpp") - -if(OpenMesh_FOUND) target_link_libraries(test_clear PRIVATE ${OPENMESH_LIBRARIES}) target_compile_definitions(test_clear PRIVATE -DCGAL_USE_OPENMESH) target_link_libraries(test_Euler_operations PRIVATE ${OPENMESH_LIBRARIES}) @@ -115,6 +59,11 @@ if(OpenMesh_FOUND) target_compile_definitions(test_Properties PRIVATE -DCGAL_USE_OPENMESH) target_link_libraries(test_bgl_read_write PRIVATE ${OPENMESH_LIBRARIES}) target_compile_definitions(test_bgl_read_write PRIVATE -DCGAL_USE_OPENMESH) + + create_single_source_cgal_program("graph_concept_OpenMesh.cpp") + target_link_libraries(graph_concept_OpenMesh PRIVATE ${OPENMESH_LIBRARIES}) +else() + message(STATUS "NOTICE: Tests that use OpenMesh will not be compiled.") endif() find_package(VTK QUIET COMPONENTS vtkCommonCore vtkIOCore vtkIOLegacy vtkIOXML vtkFiltersCore vtkFiltersSources) @@ -150,5 +99,5 @@ if(3MF_LIBRARIES AND 3MF_INCLUDE_DIR AND EXISTS "${3MF_INCLUDE_DIR}/Model/COM/N target_link_libraries(test_3mf_to_sm PRIVATE ${3MF_LIBRARIES}) target_compile_definitions(test_3mf_to_sm PRIVATE -DCGAL_LINKED_WITH_3MF) else() - message(STATUS "NOTICE : This program requires the lib3MF library, and will not be compiled.") + message(STATUS "NOTICE: The test 'test_3mf_to_sm' requires the lib3MF library, and will not be compiled.") endif() diff --git a/Barycentric_coordinates_2/benchmark/Barycentric_coordinates_2/CMakeLists.txt b/Barycentric_coordinates_2/benchmark/Barycentric_coordinates_2/CMakeLists.txt index f8b37af9c4b..c7341df3d11 100644 --- a/Barycentric_coordinates_2/benchmark/Barycentric_coordinates_2/CMakeLists.txt +++ b/Barycentric_coordinates_2/benchmark/Barycentric_coordinates_2/CMakeLists.txt @@ -6,8 +6,6 @@ project(Barycentric_coordinates_2_Benchmarks) cmake_minimum_required(VERSION 3.1...3.23) find_package(CGAL REQUIRED COMPONENTS Core) -include(${CGAL_USE_FILE}) -include(CGAL_CreateSingleSourceCGALProgram) create_single_source_cgal_program("benchmark_segment_coordinates.cpp") create_single_source_cgal_program("benchmark_triangle_coordinates.cpp") @@ -19,12 +17,10 @@ create_single_source_cgal_program("benchmark_mv_34_vertices.cpp") find_package(Eigen3 3.1.0 QUIET) # (3.1.0 or greater) include(CGAL_Eigen3_support) if(TARGET CGAL::Eigen3_support) - create_single_source_cgal_program("benchmark_hm_4_vertices.cpp") target_link_libraries(benchmark_hm_4_vertices PUBLIC CGAL::Eigen3_support) create_single_source_cgal_program("benchmark_hm_n_vertices.cpp") target_link_libraries(benchmark_hm_n_vertices PUBLIC CGAL::Eigen3_support) - else() - message(NOTICE "Several coordinates require the Eigen library, and will not be compiled.") + message(STATUS "NOTICE: Several benchmarks require the Eigen library, and will not be compiled.") endif() diff --git a/Barycentric_coordinates_2/examples/Barycentric_coordinates_2/CMakeLists.txt b/Barycentric_coordinates_2/examples/Barycentric_coordinates_2/CMakeLists.txt index d5d5974e3b3..7708fc685df 100644 --- a/Barycentric_coordinates_2/examples/Barycentric_coordinates_2/CMakeLists.txt +++ b/Barycentric_coordinates_2/examples/Barycentric_coordinates_2/CMakeLists.txt @@ -20,14 +20,12 @@ create_single_source_cgal_program("deprecated_coordinates.cpp") find_package(Eigen3 3.1.0 QUIET) # (3.1.0 or greater) include(CGAL_Eigen3_support) if(TARGET CGAL::Eigen3_support) - create_single_source_cgal_program("affine_coordinates.cpp") target_link_libraries(affine_coordinates PUBLIC CGAL::Eigen3_support) create_single_source_cgal_program("harmonic_coordinates.cpp") target_link_libraries(harmonic_coordinates PUBLIC CGAL::Eigen3_support) create_single_source_cgal_program("shape_deformation.cpp") target_link_libraries(shape_deformation PUBLIC CGAL::Eigen3_support) - else() - message(NOTICE "Several coordinates require the Eigen library, and will not be compiled.") + message(STATUS "NOTICE: Several examples require the Eigen library, and will not be compiled.") endif() diff --git a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/CMakeLists.txt b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/CMakeLists.txt index 8884394ec83..d1dcba597f7 100644 --- a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/CMakeLists.txt +++ b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/CMakeLists.txt @@ -45,7 +45,6 @@ create_single_source_cgal_program("test_dh_deprecated_api.cpp") find_package(Eigen3 3.1.0 QUIET) # (3.1.0 or greater) include(CGAL_Eigen3_support) if(TARGET CGAL::Eigen3_support) - create_single_source_cgal_program("test_hm_unit_square.cpp") target_link_libraries(test_hm_unit_square PUBLIC CGAL::Eigen3_support) create_single_source_cgal_program("test_hm_const_linear_precision.cpp") @@ -56,7 +55,6 @@ if(TARGET CGAL::Eigen3_support) target_link_libraries(test_bc_projection_traits PUBLIC CGAL::Eigen3_support) create_single_source_cgal_program("test_bc_all_coordinates.cpp") target_link_libraries(test_bc_all_coordinates PUBLIC CGAL::Eigen3_support) - else() - message(NOTICE "Several coordinates require the Eigen library, and will not be compiled.") + message(STATUS "NOTICE: Several tests require the Eigen library, and will not be compiled.") endif() diff --git a/Boolean_set_operations_2/examples/Boolean_set_operations_2/CMakeLists.txt b/Boolean_set_operations_2/examples/Boolean_set_operations_2/CMakeLists.txt index 73a02373208..f24ead2e8bd 100644 --- a/Boolean_set_operations_2/examples/Boolean_set_operations_2/CMakeLists.txt +++ b/Boolean_set_operations_2/examples/Boolean_set_operations_2/CMakeLists.txt @@ -18,8 +18,5 @@ endforeach() if(CGAL_Qt5_FOUND) target_link_libraries(draw_polygon_set PUBLIC CGAL::CGAL_Basic_viewer) else() - message( - STATUS - "NOTICE: The example draw_polygon_set requires Qt and drawing will be disabled." - ) + message(STATUS "NOTICE: The example 'draw_polygon_set' requires Qt and drawing will be disabled.") endif() diff --git a/Box_intersection_d/test/Box_intersection_d/CMakeLists.txt b/Box_intersection_d/test/Box_intersection_d/CMakeLists.txt index 1d331fd485f..56fa8d95856 100644 --- a/Box_intersection_d/test/Box_intersection_d/CMakeLists.txt +++ b/Box_intersection_d/test/Box_intersection_d/CMakeLists.txt @@ -6,18 +6,16 @@ project(Box_intersection_d_Tests) find_package(CGAL REQUIRED) -find_package(TBB) -include(CGAL_TBB_support) - create_single_source_cgal_program("automated_test.cpp") create_single_source_cgal_program("benchmark_box_intersection.cpp") create_single_source_cgal_program("random_set_test.cpp") create_single_source_cgal_program("test_box_grid.cpp") create_single_source_cgal_program("test_Has_member_report.cpp") +find_package(TBB QUIET) +include(CGAL_TBB_support) if(TARGET CGAL::TBB_support) target_link_libraries(test_box_grid PUBLIC CGAL::TBB_support) else() - message( - STATUS "NOTICE: Intel TBB was not found. Sequential code will be used.") + message(STATUS "NOTICE: Intel TBB was not found. Parallel code will not be used.") endif() diff --git a/CGAL_Core/examples/Core/CMakeLists.txt b/CGAL_Core/examples/Core/CMakeLists.txt index 77eaec4e81c..d4513e22dea 100644 --- a/CGAL_Core/examples/Core/CMakeLists.txt +++ b/CGAL_Core/examples/Core/CMakeLists.txt @@ -5,27 +5,8 @@ project(Core_Examples) find_package(CGAL REQUIRED COMPONENTS Core) if(NOT CGAL_Core_FOUND) - - message( - STATUS - "This project requires the CGAL_Core library, and will not be compiled.") + message("NOTICE: This project requires the CGAL_Core library, and will not be compiled.") return() - endif() -# Boost and its components -find_package(Boost) - -if(NOT Boost_FOUND) - - message( - STATUS "This project requires the Boost library, and will not be compiled.") - - return() - -endif() - -# Creating entries for all .cpp/.C files with "main" routine -# ########################################################## - create_single_source_cgal_program("delaunay.cpp") diff --git a/CGAL_ImageIO/examples/CGALimageIO/CMakeLists.txt b/CGAL_ImageIO/examples/CGALimageIO/CMakeLists.txt index a5d95b3fd05..a9e95aef718 100644 --- a/CGAL_ImageIO/examples/CGALimageIO/CMakeLists.txt +++ b/CGAL_ImageIO/examples/CGALimageIO/CMakeLists.txt @@ -6,15 +6,7 @@ project(CGALimageIO_Examples) find_package(CGAL REQUIRED COMPONENTS ImageIO) -if(CGAL_ImageIO_FOUND) - - create_single_source_cgal_program("convert_raw_image_to_inr.cpp") - create_single_source_cgal_program("test_imageio.cpp") - create_single_source_cgal_program("extract_a_sub_image.cpp") - create_single_source_cgal_program("slice_image.cpp") -else() - message( - STATUS - "NOTICE: This demo needs the CGAL ImageIO library, and will not be compiled." - ) -endif() +create_single_source_cgal_program("convert_raw_image_to_inr.cpp") +create_single_source_cgal_program("test_imageio.cpp") +create_single_source_cgal_program("extract_a_sub_image.cpp") +create_single_source_cgal_program("slice_image.cpp") diff --git a/CGAL_ImageIO/test/CGAL_ImageIO/CMakeLists.txt b/CGAL_ImageIO/test/CGAL_ImageIO/CMakeLists.txt index 8e2edfb8f13..81349809977 100644 --- a/CGAL_ImageIO/test/CGAL_ImageIO/CMakeLists.txt +++ b/CGAL_ImageIO/test/CGAL_ImageIO/CMakeLists.txt @@ -9,8 +9,5 @@ find_package(CGAL REQUIRED COMPONENTS ImageIO) if(WITH_CGAL_ImageIO) create_single_source_cgal_program("test_trilinear_interpolation.cpp") else() - message( - STATUS - "NOTICE: Some tests require the CGAL_ImageIO library, and will not be compiled." - ) + message("NOTICE: This project requires the CGAL_ImageIO library, and will not be compiled.") endif() diff --git a/CGAL_ipelets/demo/CGAL_ipelets/CMakeLists.txt b/CGAL_ipelets/demo/CGAL_ipelets/CMakeLists.txt index 0cffb49018c..f017575dd85 100644 --- a/CGAL_ipelets/demo/CGAL_ipelets/CMakeLists.txt +++ b/CGAL_ipelets/demo/CGAL_ipelets/CMakeLists.txt @@ -22,26 +22,21 @@ find_package(CGAL REQUIRED COMPONENTS Core) include(${CGAL_USE_FILE}) -find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) +find_package(Eigen3 3.1.0 QUIET) #(requires 3.1.0 or greater) include(CGAL_Eigen3_support) if(NOT TARGET CGAL::Eigen3_support) - message( - STATUS - "NOTICE: This project requires the Eigen library, and will not be compiled." - ) + message("NOTICE: This project requires the Eigen library, and will not be compiled.") return() endif() find_package(IPE 7) - if(IPE_FOUND) - if ( NOT ${IPE_VERSION} EQUAL "7") - message("-- Error: ${IPE_VERSION} is not a supported version of IPE (only 7 is).") + if(NOT ${IPE_VERSION} EQUAL "7") + message("NOTICE: ${IPE_VERSION} is not a supported version of IPE (only 7 is).") set(IPE_FOUND FALSE) endif() endif() - if(IPE_FOUND AND IPE_VERSION) message("-- Using IPE version ${IPE_VERSION} compatibility.") @@ -119,5 +114,5 @@ if(IPE_FOUND AND IPE_VERSION) cgal_add_compilation_test(simple_triangulation) else() - message(STATUS "NOTICE: This program requires the Ipe include files and library, and will not be compiled.") + message("NOTICE: This project requires the Ipe include files and library, and will not be compiled.") endif() diff --git a/Circular_kernel_3/demo/Circular_kernel_3/CMakeLists.txt b/Circular_kernel_3/demo/Circular_kernel_3/CMakeLists.txt index 651458bf5c0..54c3be3aba4 100644 --- a/Circular_kernel_3/demo/Circular_kernel_3/CMakeLists.txt +++ b/Circular_kernel_3/demo/Circular_kernel_3/CMakeLists.txt @@ -33,8 +33,6 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND) else() - message( - STATUS "NOTICE: This demo requires CGAL, and Qt5, and will not be compiled." - ) + message("NOTICE: This demo requires CGAL and Qt5, and will not be compiled.") endif() diff --git a/Circulator/include/CGAL/circulator.h b/Circulator/include/CGAL/circulator.h index 144de51cd54..2b1556218f0 100644 --- a/Circulator/include/CGAL/circulator.h +++ b/Circulator/include/CGAL/circulator.h @@ -701,7 +701,13 @@ typedef Iterator_from_circulator< C, const_reference, const_pointer> template class Circulator_from_container { typedef Circulator_from_container Self; - typedef typename Container::iterator iterator; + typedef typename Container::iterator container_iterator; + typedef typename Container::const_iterator container_const_iterator; + typedef std::conditional_t< + std::is_const::value, + container_const_iterator, + container_iterator + > iterator; typedef std::iterator_traits iterator_traits; public: typedef typename iterator_traits::value_type value_type; diff --git a/Classification/examples/Classification/CMakeLists.txt b/Classification/examples/Classification/CMakeLists.txt index aef4c8b5952..daf1223226e 100644 --- a/Classification/examples/Classification/CMakeLists.txt +++ b/Classification/examples/Classification/CMakeLists.txt @@ -7,15 +7,6 @@ project(Classification_Examples) # CGAL and its components find_package(CGAL REQUIRED) -# Boost and its components -find_package(Boost REQUIRED) - -if(NOT Boost_FOUND) - message( - STATUS "This project requires the Boost library, and will not be compiled.") - return() -endif() - set(Classification_dependencies_met TRUE) find_package(Boost OPTIONAL_COMPONENTS serialization iostreams) @@ -23,44 +14,29 @@ include(CGAL_Boost_serialization_support) include(CGAL_Boost_iostreams_support) if(NOT TARGET CGAL::Boost_serialization_support) - message( - STATUS - "NOTICE: This project requires Boost Serialization, and will not be compiled." - ) + message("NOTICE: This project requires Boost Serialization, and will not be compiled.") set(Classification_dependencies_met FALSE) endif() + if(NOT TARGET CGAL::Boost_iostreams_support) - message( - STATUS - "NOTICE: This project requires Boost IO Streams, and will not be compiled." - ) + message("NOTICE: This project requires Boost IO Streams, and will not be compiled.") set(Classification_dependencies_met FALSE) endif() -find_package(OpenCV QUIET COMPONENTS core ml) # Need core + machine learning -include(CGAL_OpenCV_support) -if(NOT TARGET CGAL::OpenCV_support) - message( - STATUS - "NOTICE: OpenCV was not found. OpenCV random forest predicate for classification won't be available." - ) -endif() - -find_package(Eigen3 3.1.0 REQUIRED) #(3.1.0 or greater) +find_package(Eigen3 3.1.0 QUIET) #(3.1.0 or greater) include(CGAL_Eigen3_support) if(NOT TARGET CGAL::Eigen3_support) - message( - STATUS "This project requires the Eigen library, and will not be compiled.") + message("NOTICE: This project requires the Eigen library, and will not be compiled.") set(Classification_dependencies_met FALSE) endif() -find_package(TBB QUIET) -include(CGAL_TBB_support) - if(NOT Classification_dependencies_met) return() endif() +find_package(TBB QUIET) +include(CGAL_TBB_support) + create_single_source_cgal_program( "example_classification.cpp" ) create_single_source_cgal_program( "example_ethz_random_forest.cpp" ) create_single_source_cgal_program( "example_feature.cpp" ) @@ -70,10 +46,15 @@ create_single_source_cgal_program( "example_cluster_classification.cpp" ) create_single_source_cgal_program( "gis_tutorial_example.cpp" ) create_single_source_cgal_program( "example_deprecated_conversion.cpp" ) -if (TARGET CGAL::OpenCV_support) +find_package(OpenCV QUIET COMPONENTS core ml) # Need core + machine learning +include(CGAL_OpenCV_support) +if(TARGET CGAL::OpenCV_support) + message(STATUS "Found OpenCV") + create_single_source_cgal_program( "example_opencv_random_forest.cpp" ) - target_link_libraries(example_opencv_random_forest - PUBLIC CGAL::OpenCV_support) + target_link_libraries(example_opencv_random_forest PUBLIC CGAL::OpenCV_support) +else() + message("NOTICE: OpenCV was not found. OpenCV random forest predicate for classification won't be available.") endif() foreach(target @@ -87,9 +68,9 @@ foreach(target gis_tutorial_example example_deprecated_conversion) if(TARGET ${target}) - target_link_libraries( - ${target} PUBLIC CGAL::Eigen3_support CGAL::Boost_iostreams_support - CGAL::Boost_serialization_support) + target_link_libraries(${target} PUBLIC CGAL::Eigen3_support + CGAL::Boost_iostreams_support + CGAL::Boost_serialization_support) if(TARGET CGAL::TBB_support) target_link_libraries(${target} PUBLIC CGAL::TBB_support) endif() diff --git a/Classification/test/Classification/CMakeLists.txt b/Classification/test/Classification/CMakeLists.txt index f45464cb3ad..6e179f78144 100644 --- a/Classification/test/Classification/CMakeLists.txt +++ b/Classification/test/Classification/CMakeLists.txt @@ -7,15 +7,6 @@ project(Classification_Tests) # CGAL and its components find_package(CGAL REQUIRED) -# Boost and its components -find_package(Boost REQUIRED) - -if(NOT Boost_FOUND) - message( - STATUS "This project requires the Boost library, and will not be compiled.") - return() -endif() - set(Classification_dependencies_met TRUE) find_package(Boost OPTIONAL_COMPONENTS serialization iostreams) @@ -23,42 +14,36 @@ include(CGAL_Boost_serialization_support) include(CGAL_Boost_iostreams_support) if(NOT TARGET CGAL::Boost_serialization_support) - message( - STATUS - "NOTICE: This project requires Boost Serialization, and will not be compiled." - ) - set(Classification_dependencies_met FALSE) -endif() -if(NOT TARGET CGAL::Boost_iostreams_support) - message( - STATUS - "NOTICE: This project requires Boost IO Streams, and will not be compiled." - ) + message("NOTICE: This project requires Boost Serialization, and will not be compiled.") set(Classification_dependencies_met FALSE) endif() -find_package(Eigen3 3.1.0 REQUIRED) #(3.1.0 or greater) +if(NOT TARGET CGAL::Boost_iostreams_support) + message("NOTICE: This project requires Boost IO Streams, and will not be compiled.") + set(Classification_dependencies_met FALSE) +endif() + +find_package(Eigen3 3.1.0 QUIET) #(3.1.0 or greater) include(CGAL_Eigen3_support) if(NOT TARGET CGAL::Eigen3_support) - message( - STATUS "This project requires the Eigen library, and will not be compiled.") + message("NOTICE: This project requires the Eigen library, and will not be compiled.") set(Classification_dependencies_met FALSE) endif() -find_package(TBB QUIET) -include(CGAL_TBB_support) - if(NOT Classification_dependencies_met) return() endif() +find_package(TBB QUIET) +include(CGAL_TBB_support) + create_single_source_cgal_program("test_classification_point_set.cpp") create_single_source_cgal_program("test_classification_io.cpp") foreach(target test_classification_point_set test_classification_io) - target_link_libraries( - ${target} PUBLIC CGAL::Eigen3_support CGAL::Boost_iostreams_support - CGAL::Boost_serialization_support) + target_link_libraries(${target} PUBLIC CGAL::Eigen3_support + CGAL::Boost_iostreams_support + CGAL::Boost_serialization_support) if(TARGET CGAL::TBB_support) target_link_libraries(${target} PUBLIC CGAL::TBB_support) endif() diff --git a/Combinatorial_map/test/Combinatorial_map/CMakeLists.txt b/Combinatorial_map/test/Combinatorial_map/CMakeLists.txt index 94b110c4ac7..f38888d60e5 100644 --- a/Combinatorial_map/test/Combinatorial_map/CMakeLists.txt +++ b/Combinatorial_map/test/Combinatorial_map/CMakeLists.txt @@ -27,6 +27,12 @@ cgal_add_compilation_test(Combinatorial_map_copy_test_index) # Link with OpenMesh if possible find_package(OpenMesh QUIET) if(TARGET OpenMesh::OpenMesh) + message(STATUS "Found OpenMesh") + target_link_libraries(Combinatorial_map_copy_test PRIVATE OpenMesh::OpenMesh) + target_compile_definitions(Combinatorial_map_copy_test PRIVATE -DCGAL_USE_OPENMESH) target_link_libraries(Combinatorial_map_copy_test_index PRIVATE OpenMesh::OpenMesh) + target_compile_definitions(Combinatorial_map_copy_test_index PRIVATE -DCGAL_USE_OPENMESH) +else() + message(STATUS "NOTICE: Tests will not use OpenMesh.") endif() diff --git a/Cone_spanners_2/examples/Cone_spanners_2/CMakeLists.txt b/Cone_spanners_2/examples/Cone_spanners_2/CMakeLists.txt index 7bb7268e27e..ded37dfad08 100644 --- a/Cone_spanners_2/examples/Cone_spanners_2/CMakeLists.txt +++ b/Cone_spanners_2/examples/Cone_spanners_2/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.1...3.23) project(Cone_spanners_2_Examples) -find_package(CGAL REQUIRED QUIET OPTIONAL_COMPONENTS Core) +find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Core) find_package(LEDA QUIET) if(CGAL_Core_FOUND OR LEDA_FOUND) @@ -20,12 +20,6 @@ if(CGAL_Core_FOUND OR LEDA_FOUND) foreach(cppfile ${cppfiles}) create_single_source_cgal_program("${cppfile}") endforeach() - else() - - message( - STATUS - "This program requires the CGAL_Core library (or LEDA), and will not be compiled." - ) - + message("NOTICE: This program requires the CGAL_Core library (or LEDA), and will not be compiled.") endif() diff --git a/Cone_spanners_2/test/Cone_spanners_2/CMakeLists.txt b/Cone_spanners_2/test/Cone_spanners_2/CMakeLists.txt index ac3d47b8f6d..462edfc7819 100644 --- a/Cone_spanners_2/test/Cone_spanners_2/CMakeLists.txt +++ b/Cone_spanners_2/test/Cone_spanners_2/CMakeLists.txt @@ -6,23 +6,11 @@ project(Cone_spanners_2_Tests) find_package(CGAL REQUIRED COMPONENTS Core) -if(CGAL_Core_FOUND) - include_directories(BEFORE "include") - - # create a target per cppfile - file( - GLOB cppfiles - RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program("${cppfile}") - endforeach() - -else() - - message( - STATUS - "This program requires the CGAL and CGAL_Core libraries, and will not be compiled." - ) - -endif() +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Convex_hull_3/examples/Convex_hull_3/CMakeLists.txt b/Convex_hull_3/examples/Convex_hull_3/CMakeLists.txt index 0a7e6ea7968..2b436e6ea29 100644 --- a/Convex_hull_3/examples/Convex_hull_3/CMakeLists.txt +++ b/Convex_hull_3/examples/Convex_hull_3/CMakeLists.txt @@ -7,59 +7,27 @@ project(Convex_hull_3_Examples) # CGAL and its components find_package(CGAL REQUIRED) -# Boost and its components -find_package(Boost REQUIRED) - -if(NOT Boost_FOUND) - - message( - STATUS "This project requires the Boost library, and will not be compiled.") - - return() - -endif() - -find_package(OpenMesh QUIET) - -if(OpenMesh_FOUND) - include(UseOpenMesh) -else() - message(STATUS "Examples that use OpenMesh will not be compiled.") -endif() - -# include for local directory - -# include for local package - -# Creating entries for all C++ files with "main" routine -# ########################################################## - create_single_source_cgal_program("quickhull_indexed_triangle_set_3.cpp") - create_single_source_cgal_program("dynamic_hull_3.cpp") - create_single_source_cgal_program("dynamic_hull_LCC_3.cpp") - create_single_source_cgal_program("dynamic_hull_SM_3.cpp") - create_single_source_cgal_program("halfspace_intersection_3.cpp") - create_single_source_cgal_program("lloyd_algorithm.cpp") - create_single_source_cgal_program("quickhull_3.cpp") - create_single_source_cgal_program("graph_hull_3.cpp") - create_single_source_cgal_program("quickhull_any_dim_3.cpp") - create_single_source_cgal_program("extreme_points_3_sm.cpp") - create_single_source_cgal_program("extreme_indices_3.cpp") +find_package(OpenMesh QUIET) if(OpenMesh_FOUND) - create_single_source_cgal_program("quickhull_OM_3.cpp") - create_single_source_cgal_program("dynamic_hull_OM_3.cpp") + include(UseOpenMesh) + message(STATUS "Found OpenMesh") + create_single_source_cgal_program("quickhull_OM_3.cpp") target_link_libraries(quickhull_OM_3 PRIVATE ${OPENMESH_LIBRARIES}) + create_single_source_cgal_program("dynamic_hull_OM_3.cpp") target_link_libraries(dynamic_hull_OM_3 PRIVATE ${OPENMESH_LIBRARIES}) +else() + message(STATUS "NOTICE: Examples that use OpenMesh will not be compiled.") endif() diff --git a/Convex_hull_3/test/Convex_hull_3/CMakeLists.txt b/Convex_hull_3/test/Convex_hull_3/CMakeLists.txt index 27325c0a8c7..3a728d3500a 100644 --- a/Convex_hull_3/test/Convex_hull_3/CMakeLists.txt +++ b/Convex_hull_3/test/Convex_hull_3/CMakeLists.txt @@ -6,14 +6,6 @@ project(Convex_hull_3_Tests) find_package(CGAL REQUIRED) -find_package(OpenMesh QUIET) - -if(OpenMesh_FOUND) - include(UseOpenMesh) -else() - message(STATUS "Examples that use OpenMesh will not be compiled.") -endif() - include_directories(BEFORE "include") # create a target per cppfile diff --git a/Documentation/doc/Documentation/Developer_manual/create_and_use_a_cmakelist.txt b/Documentation/doc/Documentation/Developer_manual/create_and_use_a_cmakelist.txt index 44baf0d84aa..02ff32da6bc 100644 --- a/Documentation/doc/Documentation/Developer_manual/create_and_use_a_cmakelist.txt +++ b/Documentation/doc/Documentation/Developer_manual/create_and_use_a_cmakelist.txt @@ -6,7 +6,7 @@ A base can be created using the script `cgal_create_CMakeLists`. Its usage is de \section seclink Linking with CGAL To link with the \cgal library, use the following: \code -find_package(CGAL) +find_package(CGAL REQUIRED) add_executable(my_executable my_source_file.cpp) target_link_libraries(my_executable CGAL::CGAL) \endcode diff --git a/Filtered_kernel/benchmark/Filtered_kernel/CMakeLists.txt b/Filtered_kernel/benchmark/Filtered_kernel/CMakeLists.txt index 50d11049a6b..b894f739229 100644 --- a/Filtered_kernel/benchmark/Filtered_kernel/CMakeLists.txt +++ b/Filtered_kernel/benchmark/Filtered_kernel/CMakeLists.txt @@ -8,8 +8,6 @@ add_executable(bench_simple_comparisons bench_simple_comparisons.cpp) find_package(CGAL REQUIRED COMPONENTS Core) -include(${CGAL_USE_FILE}) - add_executable(bench_orientation_3 "orientation_3.cpp") target_link_libraries(bench_orientation_3 ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES}) diff --git a/Generalized_map/test/Generalized_map/CMakeLists.txt b/Generalized_map/test/Generalized_map/CMakeLists.txt index d712bb061dc..642815d6c08 100644 --- a/Generalized_map/test/Generalized_map/CMakeLists.txt +++ b/Generalized_map/test/Generalized_map/CMakeLists.txt @@ -7,20 +7,10 @@ project(Generalized_map_Tests) # CGAL and its components find_package(CGAL REQUIRED) -# Boost and its components -find_package(Boost REQUIRED) - -if(NOT Boost_FOUND) - - message( - STATUS "This project requires the Boost library, and will not be compiled.") - - return() - -endif() - -set(hfiles Generalized_map_2_test.h Generalized_map_3_test.h - Generalized_map_4_test.h GMap_test_insertions.h) +set(hfiles Generalized_map_2_test.h + Generalized_map_3_test.h + Generalized_map_4_test.h + GMap_test_insertions.h) create_single_source_cgal_program("Generalized_map_test.cpp" ${hfiles}) diff --git a/Generator/benchmark/Generator/CMakeLists.txt b/Generator/benchmark/Generator/CMakeLists.txt index 37b35229acf..7cc0116c64b 100644 --- a/Generator/benchmark/Generator/CMakeLists.txt +++ b/Generator/benchmark/Generator/CMakeLists.txt @@ -6,12 +6,17 @@ project(Generator_example) find_package(CGAL REQUIRED COMPONENTS Core) -include(${CGAL_USE_FILE}) - -find_package(Boost REQUIRED program_options) -include_directories(${Boost_PROGRAM_OPTIONS_INCLUDE_DIR}) -add_definitions("-DCGAL_USE_BOOST_PROGRAM_OPTIONS") -list(APPEND CGAL_3RD_PARTY_LIBRARIES ${Boost_PROGRAM_OPTIONS_LIBRARY}) - -create_single_source_cgal_program("random_grid.cpp") -create_single_source_cgal_program("random_disc_2.cpp") +find_package(Boost COMPONENTS program_options) +if(Boost_PROGRAM_OPTIONS_FOUND) + create_single_source_cgal_program("random_grid.cpp") + create_single_source_cgal_program("random_disc_2.cpp") + if(TARGET Boost::program_options) + target_link_libraries(random_grid PRIVATE Boost::program_options) + target_link_libraries(random_disc_2 PRIVATE Boost::program_options) + else() + target_link_libraries(random_grid PRIVATE ${Boost_PROGRAM_OPTIONS_LIBRARY}) + target_link_libraries(random_disc_2 PRIVATE ${Boost_PROGRAM_OPTIONS_LIBRARY}) + endif() +else() + message("NOTICE: The benchmarks requires Boost Program Options, and will not be compiled.") +endif() diff --git a/Generator/examples/Generator/CMakeLists.txt b/Generator/examples/Generator/CMakeLists.txt index f9239ce0dbb..0e9f4189a2e 100644 --- a/Generator/examples/Generator/CMakeLists.txt +++ b/Generator/examples/Generator/CMakeLists.txt @@ -6,23 +6,34 @@ project(Generator_Examples) find_package(CGAL REQUIRED) -# Use Eigen +create_single_source_cgal_program("ball_d.cpp") +create_single_source_cgal_program("combination_enumerator.cpp") +create_single_source_cgal_program("cube_d.cpp") +create_single_source_cgal_program("grid_d.cpp") +create_single_source_cgal_program("name_pairs.cpp") +create_single_source_cgal_program("random_convex_hull_2.cpp") +create_single_source_cgal_program("random_convex_set.cpp") +create_single_source_cgal_program("random_degenerate_point_set.cpp") +create_single_source_cgal_program("random_grid.cpp") +create_single_source_cgal_program("random_points_in_triangles_2.cpp") +create_single_source_cgal_program("random_points_in_triangles_3.cpp") +create_single_source_cgal_program("random_points_on_triangle_mesh_2.cpp") +create_single_source_cgal_program("random_points_on_triangle_mesh_3.cpp") +create_single_source_cgal_program("random_points_tetrahedron_and_triangle_3.cpp") +create_single_source_cgal_program("random_points_triangle_2.cpp") +create_single_source_cgal_program("random_polygon2.cpp") +create_single_source_cgal_program("random_polygon.cpp") +create_single_source_cgal_program("random_segments1.cpp") +create_single_source_cgal_program("random_segments2.cpp") +create_single_source_cgal_program("sphere_d.cpp") + find_package(Eigen3 3.1.0 QUIET) #(3.1.0 or greater) include(CGAL_Eigen3_support) - -# create a target per cppfile -file( - GLOB cppfiles - RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) -foreach(cppfile ${cppfiles}) - if(NOT (${cppfile} STREQUAL "random_points_in_tetrahedral_mesh_3.cpp") - OR NOT (${cppfile} STREQUAL "random_points_on_tetrahedral_mesh_3.cpp") - OR TARGET CGAL::Eigen3_support) - create_single_source_cgal_program("${cppfile}") - if(TARGET CGAL::Eigen3_support) - get_filename_component(target ${cppfile} NAME_WE) - target_link_libraries(${target} PUBLIC CGAL::Eigen3_support) - endif() - endif() -endforeach() +if(TARGET CGAL::Eigen3_support) + create_single_source_cgal_program("random_points_in_tetrahedral_mesh_3.cpp") + target_link_libraries(random_points_in_tetrahedral_mesh_3 PRIVATE CGAL::Eigen3_support) + create_single_source_cgal_program("random_points_on_tetrahedral_mesh_3.cpp") + target_link_libraries(random_points_on_tetrahedral_mesh_3 PRIVATE CGAL::Eigen3_support) +else() + message(STATUS "NOTICE: Some examples use Eigen, and will not be compiled.") +endif() diff --git a/Generator/test/Generator/CMakeLists.txt b/Generator/test/Generator/CMakeLists.txt index 50edd9f6e5c..5bd1befed5e 100644 --- a/Generator/test/Generator/CMakeLists.txt +++ b/Generator/test/Generator/CMakeLists.txt @@ -6,22 +6,20 @@ project(Generator_Tests) find_package(CGAL REQUIRED) -# Use Eigen +create_single_source_cgal_program("random_hull_test.cpp") +create_single_source_cgal_program("random_poly_test.cpp") +create_single_source_cgal_program("rcs_test.cpp") +create_single_source_cgal_program("test_combination_enumerator.cpp") +create_single_source_cgal_program("test_generators.cpp") +create_single_source_cgal_program("test_tetrahedron_3.cpp") +create_single_source_cgal_program("test_triangle_2.cpp") +create_single_source_cgal_program("test_triangle_3.cpp") + find_package(Eigen3 3.1.0 QUIET) #(3.1.0 or greater) include(CGAL_Eigen3_support) - -# create a target per cppfile -file( - GLOB cppfiles - RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) -foreach(cppfile ${cppfiles}) - if(NOT (${cppfile} STREQUAL "generic_random_test.cpp") OR TARGET - CGAL::Eigen3_support) - create_single_source_cgal_program("${cppfile}") - if(TARGET CGAL::Eigen3_support) - get_filename_component(target ${cppfile} NAME_WE) - target_link_libraries(${target} PUBLIC CGAL::Eigen3_support) - endif() - endif() -endforeach() +if(TARGET CGAL::Eigen3_support) + create_single_source_cgal_program("generic_random_test.cpp") + target_link_libraries(generic_random_test PRIVATE CGAL::Eigen3_support) +else() + message(STATUS "NOTICE: The test 'generic_random_test' uses Eigen, and will not be compiled.") +endif() diff --git a/GraphicsView/demo/Alpha_shapes_2/CMakeLists.txt b/GraphicsView/demo/Alpha_shapes_2/CMakeLists.txt index af2ccbeeca2..ca4a58c5958 100644 --- a/GraphicsView/demo/Alpha_shapes_2/CMakeLists.txt +++ b/GraphicsView/demo/Alpha_shapes_2/CMakeLists.txt @@ -22,9 +22,7 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND) add_definitions(-DQT_NO_KEYWORDS) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) - #-------------------------------- - # The "Delaunay" demo: Alpha_shapes_2 - #-------------------------------- + # UI files (Qt Designer files) qt5_wrap_ui(DT_UI_FILES Alpha_shapes_2.ui) @@ -46,10 +44,6 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND) include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) cgal_add_compilation_test(Alpha_shapes_2) - else() - - message( - STATUS "NOTICE: This demo requires CGAL and Qt5, and will not be compiled.") - + message("NOTICE: This demo requires CGAL and Qt5, and will not be compiled.") endif() diff --git a/GraphicsView/demo/Apollonius_graph_2/CMakeLists.txt b/GraphicsView/demo/Apollonius_graph_2/CMakeLists.txt index 3433ff6e691..ab0f43011f9 100644 --- a/GraphicsView/demo/Apollonius_graph_2/CMakeLists.txt +++ b/GraphicsView/demo/Apollonius_graph_2/CMakeLists.txt @@ -45,10 +45,6 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND) include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) cgal_add_compilation_test(Apollonius_graph_2) - else() - - message( - STATUS "NOTICE: This demo requires CGAL and Qt5, and will not be compiled.") - + message("NOTICE: This demo requires CGAL and Qt5, and will not be compiled.") endif() diff --git a/GraphicsView/demo/Bounding_volumes/CMakeLists.txt b/GraphicsView/demo/Bounding_volumes/CMakeLists.txt index 311b31d8e25..69a30838cea 100644 --- a/GraphicsView/demo/Bounding_volumes/CMakeLists.txt +++ b/GraphicsView/demo/Bounding_volumes/CMakeLists.txt @@ -24,9 +24,6 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND) add_definitions(-DQT_NO_KEYWORDS) set(CMAKE_AUTOMOC ON) - #---------------------------------------------- - # The "Bounding volumes" demo: Bounding_volumes - #---------------------------------------------- # UI files (Qt Designer files) qt5_wrap_ui(DT_UI_FILES Bounding_volumes.ui) @@ -53,7 +50,6 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND) else() - message( - STATUS "NOTICE: This demo requires CGAL and Qt5, and will not be compiled.") + message("NOTICE: This demo requires CGAL and Qt5, and will not be compiled.") endif() diff --git a/GraphicsView/demo/Circular_kernel_2/CMakeLists.txt b/GraphicsView/demo/Circular_kernel_2/CMakeLists.txt index 6426853a664..eb2e2b79011 100644 --- a/GraphicsView/demo/Circular_kernel_2/CMakeLists.txt +++ b/GraphicsView/demo/Circular_kernel_2/CMakeLists.txt @@ -22,9 +22,6 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) - #-------------------------------- - # The demo: Circular_kernel_2 - #-------------------------------- # UI files (Qt Designer files) qt5_wrap_ui(DT_UI_FILES Circular_kernel_2.ui) @@ -51,7 +48,6 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND) else() - message( - STATUS "NOTICE: This demo requires CGAL and Qt5, and will not be compiled.") + message("NOTICE: This demo requires CGAL and Qt5, and will not be compiled.") endif() diff --git a/GraphicsView/demo/Generator/CMakeLists.txt b/GraphicsView/demo/Generator/CMakeLists.txt index 984dd76b770..3be28ec735d 100644 --- a/GraphicsView/demo/Generator/CMakeLists.txt +++ b/GraphicsView/demo/Generator/CMakeLists.txt @@ -22,9 +22,6 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) - #-------------------------------- - # Demo: Generator_2 - #-------------------------------- # UI files (Qt Designer files) qt5_wrap_ui(DT_UI_FILES Generator_2.ui) @@ -45,8 +42,6 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND) cgal_add_compilation_test(Generator_2) else() - message( - STATUS "NOTICE: This demo requires CGAL, and Qt5, and will not be compiled." - ) + message("NOTICE: This demo requires CGAL and Qt5, and will not be compiled.") endif() diff --git a/GraphicsView/demo/GraphicsView/CMakeLists.txt b/GraphicsView/demo/GraphicsView/CMakeLists.txt index f21185f0fbd..51617b00b87 100644 --- a/GraphicsView/demo/GraphicsView/CMakeLists.txt +++ b/GraphicsView/demo/GraphicsView/CMakeLists.txt @@ -31,7 +31,6 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND) cgal_add_compilation_test(min) else() - message( - STATUS "NOTICE: This demo requires CGAL and Qt5, and will not be compiled.") + message("NOTICE: This demo requires CGAL and Qt5, and will not be compiled.") endif() diff --git a/GraphicsView/demo/L1_Voronoi_diagram_2/CMakeLists.txt b/GraphicsView/demo/L1_Voronoi_diagram_2/CMakeLists.txt index f853f269b66..432cb655369 100644 --- a/GraphicsView/demo/L1_Voronoi_diagram_2/CMakeLists.txt +++ b/GraphicsView/demo/L1_Voronoi_diagram_2/CMakeLists.txt @@ -24,9 +24,6 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) - #-------------------------------- - # The "L1 Voronoi diagram" demo: L1_voronoi_diagram_2 - #-------------------------------- # UI files (Qt Designer files) qt5_wrap_ui(DT_UI_FILES L1_voronoi_diagram_2.ui) @@ -51,7 +48,6 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND) else() - message( - STATUS "NOTICE: This demo requires CGAL and Qt5, and will not be compiled.") + message("NOTICE: This demo requires CGAL and Qt5, and will not be compiled.") endif() diff --git a/GraphicsView/demo/Largest_empty_rect_2/CMakeLists.txt b/GraphicsView/demo/Largest_empty_rect_2/CMakeLists.txt index 02e1504bfa2..a6de2468c40 100644 --- a/GraphicsView/demo/Largest_empty_rect_2/CMakeLists.txt +++ b/GraphicsView/demo/Largest_empty_rect_2/CMakeLists.txt @@ -23,9 +23,6 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) - #-------------------------------- - # Demo: Largest_empty_rectangle_2 - #-------------------------------- # UI files (Qt Designer files) qt5_wrap_ui(DT_UI_FILES Largest_empty_rectangle_2.ui) @@ -46,8 +43,6 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND) cgal_add_compilation_test(Largest_empty_rectangle_2) else() - message( - STATUS "NOTICE: This demo requires CGAL, and Qt5, and will not be compiled." - ) + message("NOTICE: This demo requires CGAL and Qt5, and will not be compiled.") endif() diff --git a/GraphicsView/demo/Largest_empty_rect_2/Largest_empty_rectangle_2.cpp b/GraphicsView/demo/Largest_empty_rect_2/Largest_empty_rectangle_2.cpp index 012ef71d3e5..67e4f336075 100644 --- a/GraphicsView/demo/Largest_empty_rect_2/Largest_empty_rectangle_2.cpp +++ b/GraphicsView/demo/Largest_empty_rect_2/Largest_empty_rectangle_2.cpp @@ -98,6 +98,8 @@ public Q_SLOTS: void on_actionClear_triggered(); + void on_actionOpen_triggered(); + void processInput(CGAL::Object); void on_actionRecenter_triggered(); @@ -105,7 +107,7 @@ public Q_SLOTS: void on_actionGeneratePointsInSquare_triggered(); void on_actionGeneratePointsInDisc_triggered(); void clear(); - + void open(QString fileName); void update_largest_empty_rectangle(); Q_SIGNALS: @@ -229,6 +231,50 @@ MainWindow::on_actionClear_triggered() Q_EMIT( changed()); } +void +MainWindow::on_actionOpen_triggered() +{ + QString fileName = QFileDialog::getOpenFileName(this, + tr("Open points file"), + "." + ,tr("xy files (*.xy)") + ); + if(! fileName.isEmpty()){ + open(fileName); + } + +} + +void +MainWindow::open(QString fileName) +{ + // wait cursor + QApplication::setOverrideCursor(Qt::WaitCursor); + std::ifstream ifs(qPrintable(fileName)); + + clear(); + + Point_2 p; + while(ifs >> p){ + points.push_back(p); + } + + CGAL::Bbox_2 bbox = CGAL::bbox_2(points.begin(), points.end()); + square = Iso_rectangle_2(bbox); + + ler = Largest_empty_iso_rectangle_2(square); + ler.insert(points.begin(), points.end()); + + frame[0]->setLine(convert(Segment_2(square.vertex(0),square.vertex(1)))); + frame[1]->setLine(convert(Segment_2(square.vertex(1), square.vertex(2)))); + frame[2]->setLine(convert(Segment_2(square.vertex(2), square.vertex(3)))); + frame[3]->setLine(convert(Segment_2(square.vertex(3), square.vertex(0)))); + + QApplication::restoreOverrideCursor(); + on_actionRecenter_triggered(); + Q_EMIT( changed()); +} + void MainWindow::on_actionRecenter_triggered() { diff --git a/GraphicsView/demo/Largest_empty_rect_2/Largest_empty_rectangle_2.ui b/GraphicsView/demo/Largest_empty_rect_2/Largest_empty_rectangle_2.ui index 19c46f07374..a6ddf170ca2 100644 --- a/GraphicsView/demo/Largest_empty_rect_2/Largest_empty_rectangle_2.ui +++ b/GraphicsView/demo/Largest_empty_rect_2/Largest_empty_rectangle_2.ui @@ -80,7 +80,7 @@ 0 0 500 - 26 + 22 @@ -90,6 +90,7 @@ + @@ -199,6 +200,11 @@ Generate Segment Fans + + + Open + + diff --git a/GraphicsView/demo/Periodic_2_triangulation_2/CMakeLists.txt b/GraphicsView/demo/Periodic_2_triangulation_2/CMakeLists.txt index 1fcba00f1bb..2f964941bb0 100644 --- a/GraphicsView/demo/Periodic_2_triangulation_2/CMakeLists.txt +++ b/GraphicsView/demo/Periodic_2_triangulation_2/CMakeLists.txt @@ -21,9 +21,6 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) - #-------------------------------- - # The "2D Periodic triangulation" demo: Periodic_2_triangulation_2 - #-------------------------------- # UI files (Qt Designer files) qt5_wrap_ui(DT_UI_FILES Periodic_2_triangulation_2.ui) @@ -58,7 +55,6 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND) cgal_add_compilation_test(Periodic_2_Delaunay_triangulation_2) else() - message( - STATUS "NOTICE: This demo requires CGAL and Qt5, and will not be compiled.") + message("NOTICE: This demo requires CGAL and Qt5, and will not be compiled.") endif() diff --git a/GraphicsView/demo/Polygon/CMakeLists.txt b/GraphicsView/demo/Polygon/CMakeLists.txt index d59836a1962..8314d618d2f 100644 --- a/GraphicsView/demo/Polygon/CMakeLists.txt +++ b/GraphicsView/demo/Polygon/CMakeLists.txt @@ -15,13 +15,10 @@ endif() find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5 Core) -find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) +find_package(Eigen3 3.1.0 QUIET) #(requires 3.1.0 or greater) include(CGAL_Eigen3_support) if(NOT TARGET CGAL::Eigen3_support) - message( - STATUS - "NOTICE: This project requires the Eigen library, and will not be compiled." - ) + message("NOTICE: This demo requires the Eigen library, and will not be compiled.") return() endif() @@ -36,9 +33,6 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND) add_definitions(-DCGAL_USE_CORE) endif() - #-------------------------------- - # Demo: Polygon_2 - #-------------------------------- # UI files (Qt Designer files) qt5_wrap_ui(DT_UI_FILES Polygon_2.ui) @@ -60,10 +54,5 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND) include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) cgal_add_compilation_test(Polygon_2) else() - - message( - STATUS - "NOTICE: This demo requires CGAL, CGAL_Core, and Qt5, and will not be compiled." - ) - + message("NOTICE: This demo requires CGAL, CGAL_Core, and Qt5, and will not be compiled.") endif() diff --git a/GraphicsView/demo/Segment_Delaunay_graph_2/CMakeLists.txt b/GraphicsView/demo/Segment_Delaunay_graph_2/CMakeLists.txt index 33153f23df0..745fbb09ed0 100644 --- a/GraphicsView/demo/Segment_Delaunay_graph_2/CMakeLists.txt +++ b/GraphicsView/demo/Segment_Delaunay_graph_2/CMakeLists.txt @@ -29,9 +29,6 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND) include(${CGAL_USE_FILE}) add_definitions(-DQT_NO_KEYWORDS) - #-------------------------------- - # The "Segment Voronoi" demo: Segment_voronoi_2 - #-------------------------------- # UI files (Qt Designer files) qt5_wrap_ui(CDT_UI_FILES Segment_voronoi_2.ui) @@ -50,10 +47,6 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND) include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) cgal_add_compilation_test(Segment_voronoi_2) - else() - - message( - STATUS "NOTICE: This demo requires CGAL and Qt5, and will not be compiled.") - + message("NOTICE: This demo requires CGAL and Qt5, and will not be compiled.") endif() diff --git a/GraphicsView/demo/Segment_Delaunay_graph_Linf_2/CMakeLists.txt b/GraphicsView/demo/Segment_Delaunay_graph_Linf_2/CMakeLists.txt index 2c46585863c..f1d5e4fbbd4 100644 --- a/GraphicsView/demo/Segment_Delaunay_graph_Linf_2/CMakeLists.txt +++ b/GraphicsView/demo/Segment_Delaunay_graph_Linf_2/CMakeLists.txt @@ -28,9 +28,6 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND) include(${CGAL_USE_FILE}) add_definitions(-DQT_NO_KEYWORDS) - #-------------------------------- - # The "Segment Voronoi Linf" demo: Segment_voronoi_linf_2 - #-------------------------------- # UI files (Qt Designer files) qt5_wrap_ui(CDT_UI_FILES Segment_voronoi_2.ui) @@ -50,8 +47,5 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND) include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) cgal_add_compilation_test(Segment_voronoi_linf_2) else() - - message( - STATUS "NOTICE: This demo requires CGAL and Qt5, and will not be compiled.") - + message("NOTICE: This demo requires CGAL and Qt5, and will not be compiled.") endif() diff --git a/GraphicsView/demo/Snap_rounding_2/CMakeLists.txt b/GraphicsView/demo/Snap_rounding_2/CMakeLists.txt index 6aa164e6d86..0b7ebdeb6d8 100644 --- a/GraphicsView/demo/Snap_rounding_2/CMakeLists.txt +++ b/GraphicsView/demo/Snap_rounding_2/CMakeLists.txt @@ -22,7 +22,6 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND) add_definitions(-DQT_NO_KEYWORDS) set(CMAKE_INCLUDE_CURRENT_DIR ON) - #-------------------------------- # UI files (Qt Designer files) qt5_wrap_ui(DT_UI_FILES Snap_rounding_2.ui) @@ -44,10 +43,6 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND) include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) cgal_add_compilation_test(Snap_rounding_2) - else() - - message( - STATUS "NOTICE: This demo requires CGAL and Qt5, and will not be compiled.") - + message("NOTICE: This demo requires CGAL and Qt5, and will not be compiled.") endif() diff --git a/GraphicsView/demo/Spatial_searching_2/CMakeLists.txt b/GraphicsView/demo/Spatial_searching_2/CMakeLists.txt index 9fb9c869f2b..f5d5aad6d14 100644 --- a/GraphicsView/demo/Spatial_searching_2/CMakeLists.txt +++ b/GraphicsView/demo/Spatial_searching_2/CMakeLists.txt @@ -23,9 +23,6 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) - #-------------------------------- - # Demo: Spatial_searching_2 - #-------------------------------- # UI files (Qt Designer files) qt5_wrap_ui(DT_UI_FILES Spatial_searching_2.ui) @@ -46,8 +43,6 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND) cgal_add_compilation_test(Spatial_searching_2) else() - message( - STATUS "NOTICE: This demo requires CGAL, and Qt5, and will not be compiled." - ) + message("NOTICE: This demo requires CGAL and Qt5, and will not be compiled.") endif() diff --git a/GraphicsView/demo/Stream_lines_2/CMakeLists.txt b/GraphicsView/demo/Stream_lines_2/CMakeLists.txt index 36f479ebe4d..0067351b4e1 100644 --- a/GraphicsView/demo/Stream_lines_2/CMakeLists.txt +++ b/GraphicsView/demo/Stream_lines_2/CMakeLists.txt @@ -23,7 +23,6 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) - #-------------------------------- # UI files (Qt Designer files) qt5_wrap_ui(DT_UI_FILES Stream_lines_2.ui) @@ -48,7 +47,6 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND) else() - message( - STATUS "NOTICE: This demo requires CGAL and Qt5, and will not be compiled.") + message("NOTICE: This demo requires CGAL and Qt5, and will not be compiled.") endif() diff --git a/GraphicsView/demo/Triangulation_2/CMakeLists.txt b/GraphicsView/demo/Triangulation_2/CMakeLists.txt index fdf6a86dd26..4560bc339dc 100644 --- a/GraphicsView/demo/Triangulation_2/CMakeLists.txt +++ b/GraphicsView/demo/Triangulation_2/CMakeLists.txt @@ -19,10 +19,8 @@ set(CMAKE_INCLUDE_CURRENT_DIR TRUE) find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) find_package(Qt5 QUIET COMPONENTS Widgets) -if(NOT CGAL_Qt5_FOUND - OR NOT Qt5_FOUND) - message( - STATUS "NOTICE: This demo requires CGAL and Qt5, and will not be compiled.") +if(NOT CGAL_Qt5_FOUND OR NOT Qt5_FOUND) + message("NOTICE: This demo requires CGAL and Qt5, and will not be compiled.") return() endif() diff --git a/Hash_map/benchmark/Hash_map/CMakeLists.txt b/Hash_map/benchmark/Hash_map/CMakeLists.txt index 0d2e366b101..6aaaab62124 100644 --- a/Hash_map/benchmark/Hash_map/CMakeLists.txt +++ b/Hash_map/benchmark/Hash_map/CMakeLists.txt @@ -7,25 +7,6 @@ project(Hash_map) # CGAL and its components find_package(CGAL REQUIRED) -# Boost and its components -find_package(Boost REQUIRED) - -if(NOT Boost_FOUND) - - message( - STATUS "This project requires the Boost library, and will not be compiled.") - - return() - -endif() - -# include for local directory - -# include for local package - -# Creating entries for all .cpp/.C files with "main" routine -# ########################################################## - create_single_source_cgal_program("hm.cpp") create_single_source_cgal_program("foreach.cpp") create_single_source_cgal_program("triangulation.cpp") diff --git a/Heat_method_3/examples/Heat_method_3/CMakeLists.txt b/Heat_method_3/examples/Heat_method_3/CMakeLists.txt index b766023186e..42c7c498369 100644 --- a/Heat_method_3/examples/Heat_method_3/CMakeLists.txt +++ b/Heat_method_3/examples/Heat_method_3/CMakeLists.txt @@ -7,35 +7,16 @@ project(Heat_method_3_Examples) # CGAL and its components find_package(CGAL REQUIRED) -# Boost and its components -find_package(Boost REQUIRED) - -if(NOT Boost_FOUND) - - message( - STATUS "This project requires the Boost library, and will not be compiled.") - - return() - -endif() - -find_package(Eigen3 3.3.0) +find_package(Eigen3 3.3.0 QUIET) include(CGAL_Eigen3_support) - if(NOT TARGET CGAL::Eigen3_support) - message( - STATUS - "This project requires the Eigen library (3.3 or greater), and will not be compiled." - ) + message("NOTICE: These examples require the Eigen library (3.3 or greater), and will not be compiled.") return() endif() # include for local directory include_directories(BEFORE include) -# Creating entries for all C++ files with "main" routine -# ########################################################## - create_single_source_cgal_program("heat_method.cpp") target_link_libraries(heat_method PUBLIC CGAL::Eigen3_support) create_single_source_cgal_program("heat_method_polyhedron.cpp") @@ -43,5 +24,4 @@ target_link_libraries(heat_method_polyhedron PUBLIC CGAL::Eigen3_support) create_single_source_cgal_program("heat_method_surface_mesh.cpp") target_link_libraries(heat_method_surface_mesh PUBLIC CGAL::Eigen3_support) create_single_source_cgal_program("heat_method_surface_mesh_direct.cpp") -target_link_libraries(heat_method_surface_mesh_direct - PUBLIC CGAL::Eigen3_support) +target_link_libraries(heat_method_surface_mesh_direct PUBLIC CGAL::Eigen3_support) diff --git a/Heat_method_3/test/Heat_method_3/CMakeLists.txt b/Heat_method_3/test/Heat_method_3/CMakeLists.txt index b096f0338c6..bd1f923430e 100644 --- a/Heat_method_3/test/Heat_method_3/CMakeLists.txt +++ b/Heat_method_3/test/Heat_method_3/CMakeLists.txt @@ -7,42 +7,21 @@ project(Heat_method_3_Tests) # CGAL and its components find_package(CGAL REQUIRED) -# Boost and its components -find_package(Boost REQUIRED) - -if(NOT Boost_FOUND) - - message( - STATUS "This project requires the Boost library, and will not be compiled.") - - return() - -endif() - -find_package(Eigen3 3.3.0) +find_package(Eigen3 3.3.0 QUIET) include(CGAL_Eigen3_support) - if(NOT TARGET CGAL::Eigen3_support) - message( - STATUS - "This project requires the Eigen library (3.3 or greater), and will not be compiled." - ) + message("NOTICE: These tests require the Eigen library (3.3 or greater), and will not be compiled.") return() endif() # include for local directory include_directories(BEFORE include) -# Creating entries for all C++ files with "main" routine -# ########################################################## - create_single_source_cgal_program("heat_method_concept.cpp") target_link_libraries(heat_method_concept PUBLIC CGAL::Eigen3_support) create_single_source_cgal_program("heat_method_surface_mesh_test.cpp") target_link_libraries(heat_method_surface_mesh_test PUBLIC CGAL::Eigen3_support) create_single_source_cgal_program("heat_method_surface_mesh_direct_test.cpp") -target_link_libraries(heat_method_surface_mesh_direct_test - PUBLIC CGAL::Eigen3_support) +target_link_libraries(heat_method_surface_mesh_direct_test PUBLIC CGAL::Eigen3_support) create_single_source_cgal_program("heat_method_surface_mesh_intrinsic_test.cpp") -target_link_libraries(heat_method_surface_mesh_intrinsic_test - PUBLIC CGAL::Eigen3_support) +target_link_libraries(heat_method_surface_mesh_intrinsic_test PUBLIC CGAL::Eigen3_support) diff --git a/Hyperbolic_triangulation_2/benchmark/Hyperbolic_triangulation_2/CMakeLists.txt b/Hyperbolic_triangulation_2/benchmark/Hyperbolic_triangulation_2/CMakeLists.txt index 8c5ab3d473f..bb1b77b196f 100644 --- a/Hyperbolic_triangulation_2/benchmark/Hyperbolic_triangulation_2/CMakeLists.txt +++ b/Hyperbolic_triangulation_2/benchmark/Hyperbolic_triangulation_2/CMakeLists.txt @@ -6,8 +6,4 @@ project(Hyperbolic_triangulation_2_benchmark) find_package(CGAL REQUIRED COMPONENTS Core) -include(${CGAL_USE_FILE}) - -include(CGAL_CreateSingleSourceCGALProgram) - create_single_source_cgal_program("bench_insertion_with_different_kernels.cpp") diff --git a/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/CMakeLists.txt b/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/CMakeLists.txt index 13f97548589..fbdf3791ccb 100644 --- a/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/CMakeLists.txt +++ b/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/CMakeLists.txt @@ -11,13 +11,12 @@ if(POLICY CMP0071) cmake_policy(SET CMP0071 NEW) endif() -find_package(CGAL REQUIRED QUIET OPTIONAL_COMPONENTS Core Qt5) +find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Core Qt5) find_package(LEDA QUIET) # Find Qt5 itself find_package(Qt5 QUIET COMPONENTS OpenGL Gui) - if(CGAL_Qt5_FOUND AND Qt5_FOUND AND (CGAL_Core_FOUND OR LEDA_FOUND)) @@ -40,8 +39,5 @@ if(CGAL_Qt5_FOUND include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) cgal_add_compilation_test( HDT2 ) else() - message( - STATUS - "NOTICE: This demo requires CGAL, CGAL_Core (or LEDA), and Qt5 and will not be compiled." - ) + message("NOTICE: This demo requires CGAL_Core (or LEDA), and Qt5 and will not be compiled.") endif() diff --git a/Inscribed_areas/doc/Inscribed_areas/CGAL/Largest_empty_iso_rectangle_2.h b/Inscribed_areas/doc/Inscribed_areas/CGAL/Largest_empty_iso_rectangle_2.h index f11af4ccdf1..080fc203bfb 100644 --- a/Inscribed_areas/doc/Inscribed_areas/CGAL/Largest_empty_iso_rectangle_2.h +++ b/Inscribed_areas/doc/Inscribed_areas/CGAL/Largest_empty_iso_rectangle_2.h @@ -142,9 +142,11 @@ Iso_rectangle_2 get_bounding_box(); /// @{ /*! -Inserts point `p` in the point set, if it is not already in the set. +Inserts point `p` in the point set, if it is not already in the set +and on the bounded side of the bounding rectangle. +\note Points on the boundary can be ignored as they lead to the same result. */ -void +bool insert(const Point_2& p); /*! diff --git a/Inscribed_areas/examples/Inscribed_areas/largest_empty_rectangle.cpp b/Inscribed_areas/examples/Inscribed_areas/largest_empty_rectangle.cpp index 5128e958d84..bbf8989b7b8 100644 --- a/Inscribed_areas/examples/Inscribed_areas/largest_empty_rectangle.cpp +++ b/Inscribed_areas/examples/Inscribed_areas/largest_empty_rectangle.cpp @@ -1,8 +1,7 @@ #include -#include #include -#include +#include typedef double Number_Type; typedef CGAL::Simple_cartesian K; diff --git a/Inscribed_areas/include/CGAL/Largest_empty_iso_rectangle_2.h b/Inscribed_areas/include/CGAL/Largest_empty_iso_rectangle_2.h index 95391cd85a5..4ef236892ab 100644 --- a/Inscribed_areas/include/CGAL/Largest_empty_iso_rectangle_2.h +++ b/Inscribed_areas/include/CGAL/Largest_empty_iso_rectangle_2.h @@ -762,7 +762,7 @@ bool Largest_empty_iso_rectangle_2::insert(const Point_2& _p) { // check that the point is inside the bounding box - if(bbox_p.has_on_unbounded_side(_p)) { + if(! bbox_p.has_on_bounded_side(_p)) { return(false); } diff --git a/Installation/CHANGES.md b/Installation/CHANGES.md index bc36fee6658..b7cccb78915 100644 --- a/Installation/CHANGES.md +++ b/Installation/CHANGES.md @@ -14,6 +14,9 @@ Release date: June 2023 - Added a version that uses indices instead of handles as dart and attribute descriptors. As the indices are integers convertible from and to `std::size_t`, they can be used as index into vectors which store properties. To use the index version, `Use_index` must be defined and be equal to `CGAL::Tag_true` in the item class. +### [Linear Cell Complex](https://doc.cgal.org/5.6/Manual/packages.html#PkgLinearCellComplex) +- Added the class `Linear_cell_complex_incremental_builder_3`. + ### [Polygon Mesh Processing](https://doc.cgal.org/5.6/Manual/packages.html#PkgPolygonMeshProcessing) - **Breaking change**: Deprecated the overloads of functions `CGAL::Polygon_mesh_processing::triangulate_hole()`, @@ -26,6 +29,9 @@ Release date: June 2023 - Added the function `CGAL::Polygon_mesh_processing::surface_Delaunay_remeshing()`, that remeshes a surface triangle mesh following the CGAL tetrahedral Delaunay refinement algorithm. +- Added the function `CGAL::Polygon_mesh_processing::surface_Delaunay_remeshing()`, that remeshes a surface triangle mesh using + the Delaunay refinement algorithm from the 3D Mesh Generation package. + - Added the function `CGAL::Polygon_mesh_processing::remove_almost_degenerate_faces()` to remove badly shaped triangles faces in a mesh. ### [3D Simplicial Mesh Data Structure](https://doc.cgal.org/5.6/Manual/packages.html#PkgSMDS3) (new package) diff --git a/Installation/CMakeLists.txt b/Installation/CMakeLists.txt index 8d48e93b39f..0a521d9dd2c 100644 --- a/Installation/CMakeLists.txt +++ b/Installation/CMakeLists.txt @@ -24,8 +24,7 @@ include(GNUInstallDirs) if(CGAL_BRANCH_BUILD) - message( - STATUS "Build CGAL from ${CGAL_SCM_NAME}-branch: ${CGAL_SCM_BRANCH_NAME}") + message(STATUS "Build CGAL from ${CGAL_SCM_NAME}-branch: ${CGAL_SCM_BRANCH_NAME}") # list packages file( @@ -75,10 +74,8 @@ if(CGAL_BRANCH_BUILD) "${CGAL_SOURCE_DIR}/GraphicsView" CACHE INTERNAL "Directory containing the GraphicsView package") - message( - STATUS "Installation package directory: ${CGAL_INSTALLATION_PACKAGE_DIR}") - message( - STATUS "Maintenance package directory: ${CGAL_MAINTENANCE_PACKAGE_DIR}") + message(STATUS "Installation package directory: ${CGAL_INSTALLATION_PACKAGE_DIR}") + message(STATUS "Maintenance package directory: ${CGAL_MAINTENANCE_PACKAGE_DIR}") message(STATUS "Core package directory: ${CGAL_CORE_PACKAGE_DIR}") else(CGAL_BRANCH_BUILD) diff --git a/Installation/cmake/modules/CGAL_Macros.cmake b/Installation/cmake/modules/CGAL_Macros.cmake index 12daadbe567..8ca618abcd4 100644 --- a/Installation/cmake/modules/CGAL_Macros.cmake +++ b/Installation/cmake/modules/CGAL_Macros.cmake @@ -360,7 +360,7 @@ if( NOT CGAL_MACROS_FILE_INCLUDED ) VERSION "${CGAL_MAJOR_VERSION}.${CGAL_MINOR_VERSION}.${CGAL_BUGFIX_VERSION}" COMPATIBILITY SameMajorVersion) - # There is also a version of CGALConfig.cmake that is prepared in case CGAL in installed in CMAKE_INSTALL_PREFIX. + # There is also a version of CGALConfig.cmake that is prepared in case CGAL is installed in CMAKE_INSTALL_PREFIX. configure_file("${CGAL_MODULES_DIR}/CGALConfig_install.cmake.in" "${CMAKE_BINARY_DIR}/config/CGALConfig.cmake" @ONLY) #write prefix exceptions diff --git a/Installation/cmake/modules/CGAL_pointmatcher_support.cmake b/Installation/cmake/modules/CGAL_pointmatcher_support.cmake index ab55c3b86f9..19ca4ed14de 100644 --- a/Installation/cmake/modules/CGAL_pointmatcher_support.cmake +++ b/Installation/cmake/modules/CGAL_pointmatcher_support.cmake @@ -11,6 +11,6 @@ if(libpointmatcher_FOUND AND NOT TARGET CGAL::pointmatcher_support) target_include_directories(CGAL::pointmatcher_support INTERFACE "${libpointmatcher_INCLUDE_DIR}") target_link_libraries(CGAL::pointmatcher_support INTERFACE ${libpointmatcher_LIBRARIES}) else() - message(STATUS "NOTICE : the libpointmatcher library requires the following boost components: thread filesystem system program_options date_time chrono.") + message(STATUS "NOTICE: the libpointmatcher library requires the following boost components: thread filesystem system program_options date_time chrono.") endif() endif() diff --git a/Installation/lib/cmake/CGAL/CGALConfig.cmake b/Installation/lib/cmake/CGAL/CGALConfig.cmake index b807ad3c412..b9030ecc4dc 100644 --- a/Installation/lib/cmake/CGAL/CGALConfig.cmake +++ b/Installation/lib/cmake/CGAL/CGALConfig.cmake @@ -115,6 +115,18 @@ include(${CGAL_MODULES_DIR}/CGAL_enable_end_of_configuration_hook.cmake) set(CGAL_USE_FILE ${CGAL_MODULES_DIR}/UseCGAL.cmake) +include(${CGAL_CONFIG_DIR}/CGALConfigVersion.cmake) + +# Temporary? Change the CMAKE module path +cgal_setup_module_path() + +include(${CGAL_MODULES_DIR}/CGAL_target_use_TBB.cmake) + +if( CGAL_DEV_MODE OR RUNNING_CGAL_AUTO_TEST OR CGAL_TEST_SUITE ) + # Do not use -isystem for CGAL include paths + set(CMAKE_NO_SYSTEM_FROM_IMPORTED TRUE) +endif() + foreach(comp ${CGAL_FIND_COMPONENTS}) if(NOT comp MATCHES "Core|ImageIO|Qt5") message(FATAL_ERROR "The requested CGAL component ${comp} does not exist!") @@ -184,19 +196,3 @@ if (NOT TARGET CGAL::CGAL_Basic_viewer) INTERFACE_LINK_LIBRARIES CGAL::CGAL_Qt5) endif() -include(${CGAL_CONFIG_DIR}/CGALConfigVersion.cmake) - -# -# -# - -# Temporary? Change the CMAKE module path -cgal_setup_module_path() - -set(CGAL_USE_FILE ${CGAL_MODULES_DIR}/UseCGAL.cmake) -include(${CGAL_MODULES_DIR}/CGAL_target_use_TBB.cmake) - -if( CGAL_DEV_MODE OR RUNNING_CGAL_AUTO_TEST OR CGAL_TEST_SUITE ) - # Do not use -isystem for CGAL include paths - set(CMAKE_NO_SYSTEM_FROM_IMPORTED TRUE) -endif() diff --git a/Intersections_2/include/CGAL/Intersections_2/Segment_2_Segment_2.h b/Intersections_2/include/CGAL/Intersections_2/Segment_2_Segment_2.h index 57f2e31b5bb..28d7920bd2a 100644 --- a/Intersections_2/include/CGAL/Intersections_2/Segment_2_Segment_2.h +++ b/Intersections_2/include/CGAL/Intersections_2/Segment_2_Segment_2.h @@ -435,6 +435,22 @@ Segment_2_Segment_2_pair::intersection_type() const : CGAL::make_array( _seg2->point(s2s2_id[c][2]), _seg2->point(s2s2_id[c][3]), _seg1->point(s2s2_id[c][0]), _seg1->point(s2s2_id[c][1]) ); + // special case for vertical and horizontal segments + if (std::is_floating_point::value && + std::is_same::value) + { + if (pts[0].x()==pts[1].x() && pts[2].y()==pts[3].y()) + { + _intersection_point = K().construct_point_2_object()(pts[0].x(), pts[2].y()); + return _result; + } + if (pts[0].y()==pts[1].y() && pts[2].x()==pts[3].x()) + { + _intersection_point = K().construct_point_2_object()(pts[2].x(), pts[0].y()); + return _result; + } + } + typename K::FT alpha = s2s2_alpha(pts[0].x(), pts[0].y(), pts[1].x(), pts[1].y(), pts[2].x(), pts[2].y(), pts[3].x(), pts[3].y()); _intersection_point = K().construct_barycenter_2_object()(pts[0], alpha, pts[1]); diff --git a/Jet_fitting_3/examples/Jet_fitting_3/CMakeLists.txt b/Jet_fitting_3/examples/Jet_fitting_3/CMakeLists.txt index 37576cd9dce..b68d6a52fd0 100644 --- a/Jet_fitting_3/examples/Jet_fitting_3/CMakeLists.txt +++ b/Jet_fitting_3/examples/Jet_fitting_3/CMakeLists.txt @@ -7,33 +7,27 @@ project(Jet_fitting_3_Examples) find_package(CGAL REQUIRED) # use Eigen -find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) +find_package(Eigen3 3.1.0 QUIET) #(requires 3.1.0 or greater) include(CGAL_Eigen3_support) if(TARGET CGAL::Eigen3_support) + # Link with Boost.ProgramOptions (optional) find_package(Boost QUIET COMPONENTS program_options) - if(Boost_PROGRAM_OPTIONS_FOUND) create_single_source_cgal_program("Mesh_estimation.cpp") target_link_libraries(Mesh_estimation PUBLIC CGAL::Eigen3_support) - if(TARGET Boost::filesystem) + if(TARGET Boost::program_options) target_link_libraries(Mesh_estimation PRIVATE Boost::program_options) else() target_link_libraries(Mesh_estimation PRIVATE ${Boost_PROGRAM_OPTIONS_LIBRARY}) endif() else() - message( - STATUS - "NOTICE: This program requires Boost Program Options and will not be compiled." - ) + message(STATUS "NOTICE: The example 'Mesh_estimation' requires Boost Program Options, and will not be compiled.") endif() create_single_source_cgal_program("Single_estimation.cpp") target_link_libraries(Single_estimation PUBLIC CGAL::Eigen3_support) else() - message( - STATUS - "NOTICE: This program requires Eigen 3.1 (or greater) and will not be compiled." - ) + message("NOTICE: These examples require Eigen 3.1 (or greater), and will not be compiled.") endif() diff --git a/Jet_fitting_3/test/Jet_fitting_3/CMakeLists.txt b/Jet_fitting_3/test/Jet_fitting_3/CMakeLists.txt index 55604c4c554..008acda4622 100644 --- a/Jet_fitting_3/test/Jet_fitting_3/CMakeLists.txt +++ b/Jet_fitting_3/test/Jet_fitting_3/CMakeLists.txt @@ -7,14 +7,11 @@ project(Jet_fitting_3_Tests) find_package(CGAL REQUIRED) # use Eigen -find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) +find_package(Eigen3 3.1.0 QUIET) #(requires 3.1.0 or greater) include(CGAL_Eigen3_support) if(TARGET CGAL::Eigen3_support) create_single_source_cgal_program("blind_1pt.cpp") target_link_libraries(blind_1pt PUBLIC CGAL::Eigen3_support) else() - message( - STATUS - "NOTICE: This program requires Eigen 3.1 (or greater) and will not be compiled." - ) + message("NOTICE: This project requires Eigen 3.1 (or greater), and will not be compiled.") endif() diff --git a/Kernel_23/benchmark/Kernel_23/CMakeLists.txt b/Kernel_23/benchmark/Kernel_23/CMakeLists.txt index 409561c1b6e..862b98b2152 100644 --- a/Kernel_23/benchmark/Kernel_23/CMakeLists.txt +++ b/Kernel_23/benchmark/Kernel_23/CMakeLists.txt @@ -2,11 +2,8 @@ # This is the CMake script for compiling a CGAL application. cmake_minimum_required(VERSION 3.1...3.23) -project( benchmark ) +project(Kernel_23_benchmark) -find_package(CGAL REQUIRED QUIET OPTIONAL_COMPONENTS Core ) - - include_directories (BEFORE "../include") +find_package(CGAL QUIET OPTIONAL_COMPONENTS Core) create_single_source_cgal_program( "cmp_epeck_points.cpp" ) - diff --git a/Linear_cell_complex/benchmark/Linear_cell_complex_3/CMakeLists.txt b/Linear_cell_complex/benchmark/Linear_cell_complex_3/CMakeLists.txt index bc7fb931661..4b65e2ee3c5 100644 --- a/Linear_cell_complex/benchmark/Linear_cell_complex_3/CMakeLists.txt +++ b/Linear_cell_complex/benchmark/Linear_cell_complex_3/CMakeLists.txt @@ -8,13 +8,6 @@ endif() find_package(CGAL REQUIRED) -find_package(Boost 1.43.0) -if(Boost_FOUND) - include_directories(${Boost_INCLUDE_DIRS}) -else() - set(USE_IN_SOURCE_TREE_BOOST true) -endif() - add_subdirectory(openvolumemesh) include_directories(BEFORE openvolumemesh/src) diff --git a/Linear_cell_complex/demo/Linear_cell_complex/CMakeLists.txt b/Linear_cell_complex/demo/Linear_cell_complex/CMakeLists.txt index ff0021a78bb..66c6e7088aa 100644 --- a/Linear_cell_complex/demo/Linear_cell_complex/CMakeLists.txt +++ b/Linear_cell_complex/demo/Linear_cell_complex/CMakeLists.txt @@ -48,8 +48,7 @@ if(NOT (CGAL_Qt5_FOUND AND Qt5_FOUND)) - message(STATUS "NOTICE: This demo requires CGAL, " - "and Qt5, and will not be compiled.") + message("NOTICE: This demo requires CGAL and Qt5, and will not be compiled.") else() diff --git a/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Linear_cell_complex_incremental_builder_3.h b/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Linear_cell_complex_incremental_builder_3.h new file mode 100644 index 00000000000..a2c950d46d6 --- /dev/null +++ b/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Linear_cell_complex_incremental_builder_3.h @@ -0,0 +1,99 @@ + +namespace CGAL { + +/*! +\ingroup PkgLinearCellComplexClasses + +The auxiliary class `Linear_cell_complex_incremental_builder_3` supports the incremental +construction of linear cell complexes. + +\tparam LCC must be a model of the concept `LinearCellComplex` +*/ + +template < class LCC > +class Linear_cell_complex_incremental_builder_3 +{ + public: + typedef LCC_ LCC; + typedef typename LCC::Dart_descriptor DH; + typedef typename LCC::Vertex_attribute_descriptor VAH; + typedef typename LCC::Point Point_3; + typedef typename LCC::size_type size_type; + + /// \name Creation + /// @{ + + /*! + * Constructor + */ + Linear_cell_complex_incremental_builder_3(LCC & alcc); + +/// @} + + /*! +\name Surface Creation + +To build a linear cell complex, the following regular expression gives +the correct and allowed order and nesting of method calls from this +section: + +\code +begin_surface ( add_vertex | ( begin_facet add_vertex_to_facet end_facet ) ) end_surface +\endcode + +When an edge is added in a facet, if the same edge exists in another facet of the same surface, then the two facets are glued along this edge. + +When a facet is added, if the same facet exists in another surface, the two surfaces are glued along this facet. +*/ +/// @{ + + + /*! + * starts a new surface. + */ + void begin_surface(); + + + /*! + * adds a new vertex for `p` and returns its handle. + */ + VAH add_vertex(const Point_3& p); + + /*! + * starts a new facet. + */ + void begin_facet(); + + /*! + * adds vertex `i` at the end of the current facet. + */ + void add_vertex_to_facet(size_type i); + + /*! + * ends the construction of the facet and returns the first dart of this facet. + */ + DH end_facet(); + + + /*! + * ends the construction of the surface and returns one dart of the created surface. + */ + DH end_surface(); + +/// @} + +/// \name Additional Operations +/// @{ + +/*! + * is a synonym for `begin_facet()`, a call to `add_vertex_to_facet()` for each + * value in the range `[first,beyond)`, and a call to `end_facet()`. + */ + DH add_facet(std::initializer_list l); + + +/// @} + + }; + +} // namespace CGAL diff --git a/Linear_cell_complex/doc/Linear_cell_complex/Linear_cell_complex.txt b/Linear_cell_complex/doc/Linear_cell_complex/Linear_cell_complex.txt index 925e269a738..6eae9275a75 100644 --- a/Linear_cell_complex/doc/Linear_cell_complex/Linear_cell_complex.txt +++ b/Linear_cell_complex/doc/Linear_cell_complex/Linear_cell_complex.txt @@ -141,6 +141,14 @@ Some examples of use of these operations are given in Section \ref ssec5dexample If \link GenericMap::set_automatic_attributes_management `set_automatic_attributes_management(false)`\endlink is called, all the future insertion or removal operations will not update non void attributes. These attributes will be updated latter by the call to \link GenericMap::set_automatic_attributes_management `set_automatic_attributes_management(true)`\endlink. This can be useful to speed up an algorithm which uses several successive insertion and removal operations. See example \ref ssecAttributesManagement "Automatic attributes management". \cgalAdvancedEnd + +\subsection Linear_cell_complexIncrementalBuilder Incremental Builder + +A utility class `Linear_cell_complex_incremental_builder_3` helps in creating 2D and 3D linear cell complexes +from a list of points followed by a list of facets that are represented as indices into the point list. +Note that, compared to `Polyhedron_incremental_builder_3` it has only absolute indexing and no rollback +mechanism. + \section Linear_cell_complexExamples Examples \subsection Linear_cell_complexA3DLinearCellComplex A 3D Linear Cell Complex @@ -264,10 +272,16 @@ Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt5 Result of the run of the draw_linear_cell_complex program. A window shows two 3D cubes and allows to navigate through the 3D scene. \cgalFigureEnd +\subsection Linear_cell_complexIncrementalBuilderExample Incremental Builder + +The following example shows the incremental builder. + +\cgalExample{Linear_cell_complex/linear_cell_complex_3_incremental_builder.cpp} + + \section Linear_cell_complexDesign Design and Implementation History This package was developed by Guillaume Damiand, with the help of Andreas Fabri, Sébastien Loriot and Laurent Rineau. Monique Teillaud and Bernd Gärtner contributed to the manual. */ } /* namespace CGAL */ - diff --git a/Linear_cell_complex/doc/Linear_cell_complex/PackageDescription.txt b/Linear_cell_complex/doc/Linear_cell_complex/PackageDescription.txt index 42da9fd9276..d8cc1ad2fbd 100644 --- a/Linear_cell_complex/doc/Linear_cell_complex/PackageDescription.txt +++ b/Linear_cell_complex/doc/Linear_cell_complex/PackageDescription.txt @@ -62,7 +62,7 @@ - `CGAL::Linear_cell_complex_traits` - `CGAL::Cell_attribute_with_point` - `CGAL::Cell_attribute_with_point_and_id` -- `CGAL::Linear_cell_complex` +- `CGAL::Linear_cell_complex_incremental_builder_3` \cgalCRPSection{Global Functions} \cgalCRPSubsection{Constructions for Linear Cell Complex} @@ -78,4 +78,3 @@ - \link PkgDrawLinearCellComplex CGAL::draw() \endlink */ - diff --git a/Linear_cell_complex/doc/Linear_cell_complex/examples.txt b/Linear_cell_complex/doc/Linear_cell_complex/examples.txt index f41e9b41af0..4f178f666d1 100644 --- a/Linear_cell_complex/doc/Linear_cell_complex/examples.txt +++ b/Linear_cell_complex/doc/Linear_cell_complex/examples.txt @@ -3,5 +3,6 @@ \example Linear_cell_complex/linear_cell_complex_3.cpp \example Linear_cell_complex/linear_cell_complex_4.cpp \example Linear_cell_complex/linear_cell_complex_3_attributes_management.cpp +\example Linear_cell_complex/linear_cell_complex_3_incremental_builder.cpp \example Linear_cell_complex/draw_linear_cell_complex.cpp */ diff --git a/Linear_cell_complex/examples/Linear_cell_complex/CMakeLists.txt b/Linear_cell_complex/examples/Linear_cell_complex/CMakeLists.txt index 1ee1208d461..d0ed1c3a028 100644 --- a/Linear_cell_complex/examples/Linear_cell_complex/CMakeLists.txt +++ b/Linear_cell_complex/examples/Linear_cell_complex/CMakeLists.txt @@ -21,6 +21,7 @@ create_single_source_cgal_program("linear_cell_complex_3_operations.cpp") create_single_source_cgal_program( "linear_cell_complex_3_with_colored_vertices.cpp") create_single_source_cgal_program("linear_cell_complex_3_with_mypoint.cpp") +create_single_source_cgal_program("linear_cell_complex_3_incremental_builder.cpp") create_single_source_cgal_program("linear_cell_complex_4.cpp") create_single_source_cgal_program("plane_graph_to_lcc_2.cpp") create_single_source_cgal_program("voronoi_2.cpp") @@ -29,4 +30,5 @@ create_single_source_cgal_program("voronoi_3.cpp") create_single_source_cgal_program("draw_linear_cell_complex.cpp") if(CGAL_Qt5_FOUND) target_link_libraries(draw_linear_cell_complex PUBLIC CGAL::CGAL_Basic_viewer) + target_link_libraries(linear_cell_complex_3_incremental_builder PUBLIC CGAL::CGAL_Basic_viewer) endif() diff --git a/Linear_cell_complex/examples/Linear_cell_complex/linear_cell_complex_3_incremental_builder.cpp b/Linear_cell_complex/examples/Linear_cell_complex/linear_cell_complex_3_incremental_builder.cpp new file mode 100644 index 00000000000..414be85978a --- /dev/null +++ b/Linear_cell_complex/examples/Linear_cell_complex/linear_cell_complex_3_incremental_builder.cpp @@ -0,0 +1,71 @@ +#include +#include +#include + +typedef CGAL::Linear_cell_complex_for_combinatorial_map<3, 3> LCC_3; +using Point=LCC_3::Point; + + +int main() +{ + LCC_3 lcc; + CGAL::Linear_cell_complex_incremental_builder_3 ib(lcc); + + ib.add_vertex(Point(0,0,0)); // vertex 0 + ib.add_vertex(Point(1,0,0)); // vertex 1 + ib.add_vertex(Point(1,1,0)); // vertex 2 + ib.add_vertex(Point(0,1,0)); // vertex 3 + + ib.add_vertex(Point(0,1,1)); // vertex 4 + ib.add_vertex(Point(0,0,1)); // vertex 5 + ib.add_vertex(Point(1,0,1)); // vertex 6 + ib.add_vertex(Point(1,1,1)); // vertex 7 + + // Create a cube + ib.begin_surface(); + ib.add_facet({0,1,2,3}); // Create a new facet version 1: given all of its indices + ib.add_facet({1,0,5,6}); + ib.add_facet({2,1,6,7}); + ib.add_facet({3,2,7,4}); + ib.add_facet({5,4,7,6}); + + ib.begin_facet(); // Create a new facet version 2: begin facet + ib.add_vertex_to_facet(0); // add sucessively its indices + ib.add_vertex_to_facet(3); + ib.add_vertex_to_facet(4); + ib.add_vertex_to_facet(5); + ib.end_facet(); + + ib.end_surface(); + + ib.add_vertex(Point(-1, 0.5, 0.5)); // vertex 8 + + // Create a pyramid, sharing one of its facets with a facet of the cube + ib.begin_surface(); + ib.add_facet({3,0,5,4}); + ib.add_facet({0,3,8}); + ib.add_facet({3,4,8}); + ib.add_facet({4,5,8}); + ib.add_facet({5,0,8}); + ib.end_surface(); + + + LCC_3::One_dart_per_cell_range<3,3> cells = lcc.one_dart_per_cell<3>(); + for (auto c = cells.begin(); c != cells.end(); ++c) { + std::cout << "a cell"<< std::endl; + LCC_3::One_dart_per_incident_cell_range<2,3> faces = lcc.one_dart_per_incident_cell<2,3>(c); + for (auto f = faces.begin(); f != faces.end(); ++f) { + std::cout << " a face"<< std::endl; + LCC_3::One_dart_per_incident_cell_range<0,2> vertices = lcc.one_dart_per_incident_cell<0,2>(f); + for(auto v = vertices.begin(); v!= vertices.end(); ++v){ + std::cout << " " << lcc.point(v) << std::endl; + } + } + } + + // Draw the lcc and display its characteristics + lcc.display_characteristics(std::cout)< -#include +#include #include #include diff --git a/Linear_cell_complex/include/CGAL/Linear_cell_complex_incremental_builder.h b/Linear_cell_complex/include/CGAL/Linear_cell_complex_incremental_builder_3.h similarity index 93% rename from Linear_cell_complex/include/CGAL/Linear_cell_complex_incremental_builder.h rename to Linear_cell_complex/include/CGAL/Linear_cell_complex_incremental_builder_3.h index 087b3da7944..8efa806a91e 100644 --- a/Linear_cell_complex/include/CGAL/Linear_cell_complex_incremental_builder.h +++ b/Linear_cell_complex/include/CGAL/Linear_cell_complex_incremental_builder_3.h @@ -9,8 +9,8 @@ // // Author(s) : Guillaume Damiand // -#ifndef CGAL_LINEAR_CELL_COMPLEX_INCREMENTAL_BUILDER_H -#define CGAL_LINEAR_CELL_COMPLEX_INCREMENTAL_BUILDER_H 1 +#ifndef CGAL_LINEAR_CELL_COMPLEX_INCREMENTAL_BUILDER_3_H +#define CGAL_LINEAR_CELL_COMPLEX_INCREMENTAL_BUILDER_3_H 1 #include #include @@ -127,7 +127,7 @@ struct Find_opposite_2_with_control { if (!lcc.template is_free<2>(res)) { // Here a dart vah1->vah2 already exists, and it was already 2-sewn. - std::cerr<<"ERROR in My_linear_cell_complex_incremental_builder_3: try to use a same oriented edge twice."< vertex_to_dart_map_in_surface, vah2, vah1)!=lcc.null_descriptor) { // Here a dart vah1->vah2 already exists (but it was not already 2-sewn). - std::cerr<<"ERROR in My_linear_cell_complex_incremental_builder_3: try to use a same oriented edge twice."< { if (!lcc.template is_free<2>(res)) { // Here a dart vah1->vah2 already exists, and it was already 2-sewn. - std::cerr<<"ERROR in My_linear_cell_complex_incremental_builder_3: try to use a same oriented edge twice."< }; /////////////////////////////////////////////////////////////////////////////// template -struct Sew3_for_LCC_incremental_builder +struct Sew3_for_LCC_incremental_builder_3 { static void run(LCC_& lcc, typename LCC_::Dart_descriptor dh1, typename LCC_::Dart_descriptor dh2) @@ -218,8 +218,8 @@ struct Sew3_for_LCC_incremental_builder { if(!lcc.template is_free<3>(dh1)) { - std::cerr<<"ERROR in My_linear_cell_complex_incremental_builder_3: " - <<"it exists more than 2 faces with same indices."<(lcc.other_orientation(dh1), dh2); } @@ -227,7 +227,7 @@ struct Sew3_for_LCC_incremental_builder } }; template -struct Sew3_for_LCC_incremental_builder +struct Sew3_for_LCC_incremental_builder_3 { static void run(LCC_&, typename LCC_::Dart_descriptor, typename LCC_::Dart_descriptor) {} @@ -319,7 +319,7 @@ public: if(LCC::dimension>2) { opposite=opposite_face(); - Sew3_for_LCC_incremental_builder::run(lcc, opposite, min_dart); + Sew3_for_LCC_incremental_builder_3::run(lcc, opposite, min_dart); add_face_in_array(); } return first_dart; @@ -404,5 +404,5 @@ private: } //namespace CGAL -#endif // CGAL_LINEAR_CELL_COMPLEX_INCREMENTAL_BUILDER_H // +#endif // CGAL_LINEAR_CELL_COMPLEX_INCREMENTAL_BUILDER_3_H // // EOF // diff --git a/Linear_cell_complex/test/Linear_cell_complex/LCC_3_incremental_builder_test.cpp b/Linear_cell_complex/test/Linear_cell_complex/LCC_3_incremental_builder_test.cpp index 2569b0f929b..03d6bf55922 100644 --- a/Linear_cell_complex/test/Linear_cell_complex/LCC_3_incremental_builder_test.cpp +++ b/Linear_cell_complex/test/Linear_cell_complex/LCC_3_incremental_builder_test.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include #include #include "Linear_cell_complex_3_test.h" diff --git a/Maintenance/infrastructure/cgal.geometryfactory.com/crontab b/Maintenance/infrastructure/cgal.geometryfactory.com/crontab index ce30c5ee6d7..03e9c354bc3 100644 --- a/Maintenance/infrastructure/cgal.geometryfactory.com/crontab +++ b/Maintenance/infrastructure/cgal.geometryfactory.com/crontab @@ -21,11 +21,11 @@ LC_CTYPE=en_US.UTF-8 # "master" alone 0 21 * * Sun cd $HOME/CGAL/create_internal_release && /usr/bin/time scl enable rh-git29 -- $HOME/bin/create_release $HOME/CGAL/branches/master.git --do-it --public || echo ERROR # "integration" -0 21 * * Mon,Tue,Wed,Thu cd $HOME/CGAL/create_internal_release && /usr/bin/time scl enable rh-git29 -- $HOME/bin/create_release $HOME/CGAL/branches/integration.git $HOME/CGAL/branches/empty-dir --do-it || echo ERROR +0 21 * * Mon,Tue,Wed cd $HOME/CGAL/create_internal_release && /usr/bin/time scl enable rh-git29 -- $HOME/bin/create_release $HOME/CGAL/branches/integration.git $HOME/CGAL/branches/empty-dir --do-it || echo ERROR # from branch 5.5 0 21 * * Fri cd $HOME/CGAL/create_internal_release-5.5-branch && /usr/bin/time scl enable rh-git29 -- $HOME/bin/create_release $HOME/CGAL/branches/CGAL-5.5-branch.git --public --do-it || echo ERROR # from branch 5.4 -0 21 * * Sat cd $HOME/CGAL/create_internal_release-5.4-branch && /usr/bin/time scl enable rh-git29 -- $HOME/bin/create_release $HOME/CGAL/branches/CGAL-5.4-branch.git --public --do-it || echo ERROR +0 21 * * Sat,Thu cd $HOME/CGAL/create_internal_release-5.4-branch && /usr/bin/time scl enable rh-git29 -- $HOME/bin/create_release $HOME/CGAL/branches/CGAL-5.4-branch.git --public --do-it || echo ERROR ## Older stuff diff --git a/Mesh_3/benchmark/Mesh_3/CMakeLists.txt b/Mesh_3/benchmark/Mesh_3/CMakeLists.txt index 26d56becb15..50b7730178e 100644 --- a/Mesh_3/benchmark/Mesh_3/CMakeLists.txt +++ b/Mesh_3/benchmark/Mesh_3/CMakeLists.txt @@ -66,31 +66,20 @@ else() endif(LINK_WITH_TBB) endif() +# Compilable benchmark +set(BENCHMARK_SOURCE_FILES "concurrency.cpp") +add_msvc_precompiled_header("StdAfx.h" "StdAfx.cpp" BENCHMARK_SOURCE_FILES) +create_single_source_cgal_program(${BENCHMARK_SOURCE_FILES}) +if(TARGET CGAL::TBB_support) + target_link_libraries(concurrency PUBLIC CGAL::TBB_support) +endif() + # Link with Boost.ProgramOptions (optional) find_package(Boost QUIET COMPONENTS program_options) if(Boost_PROGRAM_OPTIONS_FOUND) - if(CGAL_AUTO_LINK_ENABLED) - message(STATUS "Boost.ProgramOptions library: found") + if(TARGET Boost::program_options) + target_link_libraries(concurrency PRIVATE Boost::program_options) else() - message( - STATUS "Boost.ProgramOptions library: ${Boost_PROGRAM_OPTIONS_LIBRARY}") + target_link_libraries(concurrency PRIVATE ${Boost_PROGRAM_OPTIONS_LIBRARY}) endif() - add_definitions("-DCGAL_USE_BOOST_PROGRAM_OPTIONS") - list(APPEND CGAL_3RD_PARTY_LIBRARIES ${Boost_LIBRARIES}) -endif() - -if(Boost_FOUND ) - # Compilable benchmark - set(BENCHMARK_SOURCE_FILES "concurrency.cpp") - add_msvc_precompiled_header("StdAfx.h" "StdAfx.cpp" BENCHMARK_SOURCE_FILES) - create_single_source_cgal_program(${BENCHMARK_SOURCE_FILES}) - if(TARGET CGAL::TBB_support) - target_link_libraries(concurrency PUBLIC CGAL::TBB_support) - endif() - -else() - message( - STATUS - "NOTICE: This program requires Boost >= 1.34.1, and will not be compiled." - ) endif() diff --git a/Mesh_3/examples/Mesh_3/CMakeLists.txt b/Mesh_3/examples/Mesh_3/CMakeLists.txt index 6f848c2c657..335e98aa0de 100644 --- a/Mesh_3/examples/Mesh_3/CMakeLists.txt +++ b/Mesh_3/examples/Mesh_3/CMakeLists.txt @@ -9,7 +9,6 @@ if(CGAL_MESH_3_VERBOSE) endif() find_package(CGAL REQUIRED COMPONENTS ImageIO) -find_package(Boost) option(CGAL_ACTIVATE_CONCURRENT_MESH_3 "Activate parallelism in Mesh_3" OFF) @@ -23,9 +22,9 @@ endif() find_package(Eigen3 3.1.0 QUIET) #(3.1.0 or greater) include(CGAL_Eigen3_support) if(NOT TARGET CGAL::Eigen3_support) - message( STATUS "NOTICE: All examples need the Eigen3 library, and will not be compiled." ) + message("NOTICE: All examples require the Eigen3 library, and will not be compiled.") return() -endif() #CGAL::Eigen_3_support +endif() find_package(VTK QUIET COMPONENTS vtkImagingGeneral vtkIOImage NO_MODULE) if(VTK_FOUND) @@ -51,12 +50,10 @@ create_single_source_cgal_program("mesh_implicit_sphere.cpp") target_link_libraries(mesh_implicit_sphere PUBLIC CGAL::Eigen3_support) create_single_source_cgal_program("mesh_implicit_sphere_variable_size.cpp") -target_link_libraries(mesh_implicit_sphere_variable_size - PUBLIC CGAL::Eigen3_support) +target_link_libraries(mesh_implicit_sphere_variable_size PUBLIC CGAL::Eigen3_support) create_single_source_cgal_program("mesh_two_implicit_spheres_with_balls.cpp") -target_link_libraries(mesh_two_implicit_spheres_with_balls - PUBLIC CGAL::Eigen3_support) +target_link_libraries(mesh_two_implicit_spheres_with_balls PUBLIC CGAL::Eigen3_support) create_single_source_cgal_program("mesh_implicit_domains_2.cpp" "implicit_functions.cpp") @@ -66,8 +63,7 @@ create_single_source_cgal_program("mesh_cubes_intersection.cpp") target_link_libraries(mesh_cubes_intersection PUBLIC CGAL::Eigen3_support) create_single_source_cgal_program("mesh_cubes_intersection_with_features.cpp") -target_link_libraries(mesh_cubes_intersection_with_features - PUBLIC CGAL::Eigen3_support) +target_link_libraries(mesh_cubes_intersection_with_features PUBLIC CGAL::Eigen3_support) create_single_source_cgal_program("mesh_implicit_domains.cpp" "implicit_functions.cpp") @@ -169,21 +165,15 @@ if(TARGET CGAL::CGAL_ImageIO) target_link_libraries(mesh_3D_weighted_image PUBLIC CGAL::Eigen3_support CGAL::ITK_support) else(ITK_FOUND) - message(STATUS "NOTICE: The examples that need ITK will not be compiled.") + message(STATUS "NOTICE: The examples that need ITK will not be compiled.") endif(ITK_FOUND) else() - message( - STATUS - "NOTICE: The examples mesh_3D_image.cpp, mesh_3D_weighted_image.cpp, mesh_3D_image_variable_size.cpp, mesh_optimization_example.cpp and mesh_optimization_lloyd_example.cpp need CGAL_ImageIO to be configured with ZLIB support, and will not be compiled." - ) + message(STATUS "NOTICE: The examples mesh_3D_image.cpp, mesh_3D_weighted_image.cpp, mesh_3D_image_variable_size.cpp, mesh_optimization_example.cpp and mesh_optimization_lloyd_example.cpp need CGAL_ImageIO to be configured with ZLIB support, and will not be compiled.") endif() else() - message( - STATUS - "NOTICE: Some examples need the CGAL_ImageIO library, and will not be compiled." - ) + message(STATUS "NOTICE: Some examples need the CGAL_ImageIO library, and will not be compiled.") endif() if(CGAL_ACTIVATE_CONCURRENT_MESH_3 AND TARGET CGAL::TBB_support) diff --git a/Mesh_3/test/Mesh_3/CMakeLists.txt b/Mesh_3/test/Mesh_3/CMakeLists.txt index a776e87da72..e1bc8829add 100644 --- a/Mesh_3/test/Mesh_3/CMakeLists.txt +++ b/Mesh_3/test/Mesh_3/CMakeLists.txt @@ -1,151 +1,146 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.23) project( Mesh_3_Tests ) -find_package(CGAL QUIET COMPONENTS ImageIO) +find_package(CGAL REQUIRED COMPONENTS ImageIO) -if ( CGAL_FOUND ) +# Use Eigen +find_package(Eigen3 3.1.0 QUIET) #(3.1.0 or greater) +include(CGAL_Eigen3_support) +if (NOT TARGET CGAL::Eigen3_support) + message("NOTICE: This project requires the Eigen library, and will not be compiled.") + return() +endif() - find_package( TBB QUIET ) - include(CGAL_TBB_support) +find_package(TBB QUIET) +include(CGAL_TBB_support) - find_package( ITT QUIET ) +find_package(ITT QUIET) - # Use Eigen - find_package(Eigen3 3.1.0 REQUIRED) #(3.1.0 or greater) - include(CGAL_Eigen3_support) - if (NOT TARGET CGAL::Eigen3_support) - message(STATUS "This project requires the Eigen library, and will not be compiled.") - return() +create_single_source_cgal_program( "test_boost_has_xxx.cpp" ) +create_single_source_cgal_program( "test_mesh_capsule_var_distance_bound.cpp" ) +create_single_source_cgal_program( "test_implicit_multi_domain_to_labeling_function_wrapper.cpp" ) +create_single_source_cgal_program( "test_criteria.cpp" ) +create_single_source_cgal_program( "test_domain_with_polyline_features.cpp" ) +create_single_source_cgal_program( "test_labeled_mesh_domain_3.cpp" ) +create_single_source_cgal_program( "test_mesh_criteria_creation.cpp" ) +create_single_source_cgal_program( "test_without_detect_features.cpp" ) + +if(CGAL_ImageIO_USE_ZLIB) + create_single_source_cgal_program( "test_meshing_3D_image.cpp" ) + create_single_source_cgal_program( "test_meshing_3D_image_deprecated.cpp" ) + create_single_source_cgal_program( "test_meshing_3D_gray_image.cpp" ) + create_single_source_cgal_program( "test_meshing_3D_gray_image_deprecated.cpp" ) +else() + message(STATUS "NOTICE: The test 'test_meshing_3D_image' requires the ZLIB library, and will not be compiled.") +endif() + +create_single_source_cgal_program( "test_meshing_implicit_function.cpp" ) +create_single_source_cgal_program( "test_meshing_implicit_function_deprecated.cpp" ) +create_single_source_cgal_program( "test_meshing_polyhedral_complex.cpp" ) +create_single_source_cgal_program( "test_meshing_polyhedron.cpp" ) +create_single_source_cgal_program( "test_meshing_polylines_only.cpp" ) +create_single_source_cgal_program( "test_meshing_polyhedron_with_features.cpp" ) +create_single_source_cgal_program( "test_meshing_verbose.cpp" ) +create_single_source_cgal_program( "test_meshing_unit_tetrahedron.cpp" ) +create_single_source_cgal_program( "test_meshing_with_default_edge_size.cpp" ) +create_single_source_cgal_program( "test_meshing_determinism.cpp" ) +create_single_source_cgal_program( "test_meshing_without_features_determinism.cpp" ) +create_single_source_cgal_program( "test_mesh_3_issue_1554.cpp" ) +create_single_source_cgal_program( "test_mesh_polyhedral_domain_with_features_deprecated.cpp" ) +create_single_source_cgal_program( "test_meshing_with_one_step.cpp" ) +create_single_source_cgal_program( "test_mesh_cell_base_3.cpp") + +foreach(target + test_boost_has_xxx + test_mesh_capsule_var_distance_bound + test_implicit_multi_domain_to_labeling_function_wrapper + test_criteria + test_domain_with_polyline_features + test_labeled_mesh_domain_3 + test_mesh_criteria_creation + test_without_detect_features + test_meshing_3D_image + test_meshing_3D_image_deprecated + test_meshing_3D_gray_image + test_meshing_3D_gray_image_deprecated + test_meshing_implicit_function + test_meshing_implicit_function_deprecated + test_meshing_polyhedral_complex + test_meshing_polyhedron + test_meshing_polylines_only + test_meshing_polyhedron_with_features + test_meshing_verbose + test_meshing_unit_tetrahedron + test_meshing_with_default_edge_size + test_meshing_determinism + test_meshing_without_features_determinism + test_mesh_3_issue_1554 + test_mesh_polyhedral_domain_with_features_deprecated + test_mesh_cell_base_3 + test_meshing_with_one_step.cpp) + if(TARGET ${target}) + target_link_libraries(${target} PUBLIC CGAL::Eigen3_support) endif() +endforeach() - create_single_source_cgal_program( "test_boost_has_xxx.cpp" ) - create_single_source_cgal_program( "test_mesh_capsule_var_distance_bound.cpp" ) - create_single_source_cgal_program( "test_implicit_multi_domain_to_labeling_function_wrapper.cpp" ) - create_single_source_cgal_program( "test_criteria.cpp" ) - create_single_source_cgal_program( "test_domain_with_polyline_features.cpp" ) - create_single_source_cgal_program( "test_labeled_mesh_domain_3.cpp" ) - create_single_source_cgal_program( "test_mesh_criteria_creation.cpp" ) - create_single_source_cgal_program( "test_without_detect_features.cpp" ) - if(CGAL_ImageIO_USE_ZLIB) - create_single_source_cgal_program( "test_meshing_3D_image.cpp" ) - create_single_source_cgal_program( "test_meshing_3D_image_deprecated.cpp" ) - create_single_source_cgal_program( "test_meshing_3D_gray_image.cpp" ) - create_single_source_cgal_program( "test_meshing_3D_gray_image_deprecated.cpp" ) - else() - message(STATUS "test_meshing_3D_image requires the ZLIB library, and will not be compiled.") - endif() - create_single_source_cgal_program( "test_meshing_implicit_function.cpp" ) - create_single_source_cgal_program( "test_meshing_implicit_function_deprecated.cpp" ) - create_single_source_cgal_program( "test_meshing_polyhedral_complex.cpp" ) - create_single_source_cgal_program( "test_meshing_polyhedron.cpp" ) - create_single_source_cgal_program( "test_meshing_polylines_only.cpp" ) - create_single_source_cgal_program( "test_meshing_polyhedron_with_features.cpp" ) - create_single_source_cgal_program( "test_meshing_verbose.cpp" ) - create_single_source_cgal_program( "test_meshing_unit_tetrahedron.cpp" ) - create_single_source_cgal_program( "test_meshing_with_default_edge_size.cpp" ) - create_single_source_cgal_program( "test_meshing_determinism.cpp" ) - create_single_source_cgal_program( "test_meshing_without_features_determinism.cpp" ) - create_single_source_cgal_program( "test_mesh_3_issue_1554.cpp" ) - create_single_source_cgal_program( "test_mesh_polyhedral_domain_with_features_deprecated.cpp" ) - create_single_source_cgal_program( "test_meshing_with_one_step.cpp" ) - create_single_source_cgal_program( "test_mesh_cell_base_3.cpp") - +if(TARGET CGAL::TBB_support) foreach(target - test_boost_has_xxx - test_mesh_capsule_var_distance_bound - test_implicit_multi_domain_to_labeling_function_wrapper - test_criteria - test_domain_with_polyline_features - test_labeled_mesh_domain_3 - test_mesh_criteria_creation - test_without_detect_features - test_meshing_3D_image - test_meshing_3D_image_deprecated - test_meshing_3D_gray_image - test_meshing_3D_gray_image_deprecated - test_meshing_implicit_function - test_meshing_implicit_function_deprecated - test_meshing_polyhedral_complex - test_meshing_polyhedron - test_meshing_polylines_only - test_meshing_polyhedron_with_features test_meshing_verbose + test_meshing_polyhedron_with_features + test_meshing_utilities.h + test_meshing_implicit_function + test_meshing_3D_image + test_meshing_3D_gray_image test_meshing_unit_tetrahedron - test_meshing_with_default_edge_size + test_meshing_polyhedron + test_meshing_polyhedral_complex + test_mesh_capsule_var_distance_bound test_meshing_determinism test_meshing_without_features_determinism test_mesh_3_issue_1554 test_mesh_polyhedral_domain_with_features_deprecated test_mesh_cell_base_3 - test_meshing_with_one_step.cpp) + ) if(TARGET ${target}) - target_link_libraries(${target} PUBLIC CGAL::Eigen3_support) + target_link_libraries(${target} PUBLIC CGAL::TBB_support) endif() endforeach() - if(TARGET CGAL::TBB_support) - foreach(target - test_meshing_verbose - test_meshing_polyhedron_with_features - test_meshing_utilities.h - test_meshing_implicit_function - test_meshing_3D_image - test_meshing_3D_gray_image - test_meshing_unit_tetrahedron - test_meshing_polyhedron - test_meshing_polyhedral_complex - test_mesh_capsule_var_distance_bound - test_meshing_determinism - test_meshing_without_features_determinism - test_mesh_3_issue_1554 - test_mesh_polyhedral_domain_with_features_deprecated - test_mesh_cell_base_3 - ) - if(TARGET ${target}) - target_link_libraries(${target} PUBLIC CGAL::TBB_support) - endif() - endforeach() - - if(BUILD_TESTING) + if(BUILD_TESTING) + set_property(TEST + execution___of__test_meshing_verbose + execution___of__test_meshing_polyhedron_with_features + execution___of__test_meshing_implicit_function + execution___of__test_meshing_unit_tetrahedron + execution___of__test_meshing_polyhedron + execution___of__test_meshing_polyhedral_complex + execution___of__test_mesh_capsule_var_distance_bound + execution___of__test_mesh_3_issue_1554 + execution___of__test_mesh_polyhedral_domain_with_features_deprecated + execution___of__test_mesh_cell_base_3 + PROPERTY RUN_SERIAL 1) + if(TARGET test_meshing_3D_image) set_property(TEST - execution___of__test_meshing_verbose - execution___of__test_meshing_polyhedron_with_features - execution___of__test_meshing_implicit_function - execution___of__test_meshing_unit_tetrahedron - execution___of__test_meshing_polyhedron - execution___of__test_meshing_polyhedral_complex - execution___of__test_mesh_capsule_var_distance_bound - execution___of__test_mesh_3_issue_1554 - execution___of__test_mesh_polyhedral_domain_with_features_deprecated - execution___of__test_mesh_cell_base_3 + execution___of__test_meshing_3D_image + execution___of__test_meshing_3D_gray_image PROPERTY RUN_SERIAL 1) - if(TARGET test_meshing_3D_image) - set_property(TEST - execution___of__test_meshing_3D_image - execution___of__test_meshing_3D_gray_image - PROPERTY RUN_SERIAL 1) - endif() endif() endif() - if(TARGET ITT::ITT) - target_link_libraries(test_meshing_polyhedron_with_features PRIVATE ITT::ITT) - target_compile_definitions(test_meshing_polyhedron_with_features PRIVATE CGAL_MESH_3_USE_INTEL_ITT) - target_link_libraries(test_meshing_verbose PRIVATE ITT::ITT) - target_compile_definitions(test_meshing_verbose PRIVATE CGAL_MESH_3_USE_INTEL_ITT) - endif() - - if(BUILD_TESTING) - set_tests_properties( - execution___of__test_meshing_polyhedron_with_features - execution___of__test_meshing_verbose - PROPERTIES RESOURCE_LOCK Mesh_3_Tests_IO) - endif() -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - +endif() + +if(TARGET ITT::ITT) + target_link_libraries(test_meshing_polyhedron_with_features PRIVATE ITT::ITT) + target_compile_definitions(test_meshing_polyhedron_with_features PRIVATE CGAL_MESH_3_USE_INTEL_ITT) + target_link_libraries(test_meshing_verbose PRIVATE ITT::ITT) + target_compile_definitions(test_meshing_verbose PRIVATE CGAL_MESH_3_USE_INTEL_ITT) +endif() + +if(BUILD_TESTING) + set_tests_properties( + execution___of__test_meshing_polyhedron_with_features + execution___of__test_meshing_verbose + PROPERTIES RESOURCE_LOCK Mesh_3_Tests_IO) endif() diff --git a/Minkowski_sum_2/test/Minkowski_sum_2/CMakeLists.txt b/Minkowski_sum_2/test/Minkowski_sum_2/CMakeLists.txt index 723acfc1282..be75477e286 100644 --- a/Minkowski_sum_2/test/Minkowski_sum_2/CMakeLists.txt +++ b/Minkowski_sum_2/test/Minkowski_sum_2/CMakeLists.txt @@ -4,13 +4,6 @@ cmake_minimum_required(VERSION 3.1...3.23) project(Minkowski_sum_2_Tests) -# Commented out C++11 for now -# list(FIND CMAKE_CXX_COMPILE_FEATURES cxx_generalized_initializers has_cpp11) -# if (has_cpp11 LESS 0) -# message(STATUS "NOTICE: These examples requires a C++11 compiler and will not be compiled.") -# return() -# endif() - find_package(CGAL REQUIRED COMPONENTS Core) # create a target per cppfile diff --git a/NewKernel_d/test/NewKernel_d/CMakeLists.txt b/NewKernel_d/test/NewKernel_d/CMakeLists.txt index c8d8f00f844..bb66aa77eb3 100644 --- a/NewKernel_d/test/NewKernel_d/CMakeLists.txt +++ b/NewKernel_d/test/NewKernel_d/CMakeLists.txt @@ -6,16 +6,13 @@ cmake_minimum_required(VERSION 3.1...3.23) project(NewKernel_d_Tests) if(CMAKE_COMPILER_IS_GNUCCX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.4) - message( - STATUS - "NOTICE: this directory requires a version of gcc >= 4.4, and will not be compiled." - ) + message("NOTICE: this directory requires a version of gcc >= 4.4, and will not be compiled.") return() endif() find_package(CGAL REQUIRED) -find_package(Eigen3) +find_package(Eigen3 QUIET) include(CGAL_Eigen3_support) if(TARGET CGAL::Eigen3_support) file( @@ -28,10 +25,5 @@ if(TARGET CGAL::Eigen3_support) target_link_libraries(${target} PUBLIC CGAL::Eigen3_support) endforeach() else() - - message( - STATUS - "NOTICE: These programs require the Eigen3 library, and will not be compiled." - ) - + message("NOTICE: These programs require the Eigen3 library, and will not be compiled.") endif() diff --git a/Number_types/include/CGAL/Sqrt_extension/convert_to_bfi.h b/Number_types/include/CGAL/Sqrt_extension/convert_to_bfi.h index 727a8270d68..406941b3287 100644 --- a/Number_types/include/CGAL/Sqrt_extension/convert_to_bfi.h +++ b/Number_types/include/CGAL/Sqrt_extension/convert_to_bfi.h @@ -10,7 +10,7 @@ // // Author(s) : Michael Hemmer -// This files adds an optional static cache to convert_to_bfi for Sqrt_extension +// This file adds an optional static cache to convert_to_bfi for Sqrt_extension #ifndef CGAL_SQRT_EXTENSION_CONVERT_TO_BFI_H #define CGAL_SQRT_EXTENSION_CONVERT_TO_BFI_H diff --git a/Number_types/test/Number_types/CMakeLists.txt b/Number_types/test/Number_types/CMakeLists.txt index 49b8cd31ba3..1fb8b4aff34 100644 --- a/Number_types/test/Number_types/CMakeLists.txt +++ b/Number_types/test/Number_types/CMakeLists.txt @@ -8,11 +8,8 @@ project(Number_types_Tests) find_package(CGAL REQUIRED COMPONENTS Core) -include(CGAL_VersionUtils) - include_directories(BEFORE include) - create_single_source_cgal_program("bench_interval.cpp") create_single_source_cgal_program("constant.cpp") create_single_source_cgal_program("CORE_BigFloat.cpp") @@ -65,19 +62,21 @@ create_single_source_cgal_program("_test_valid_finite_float.cpp") create_single_source_cgal_program("to_interval_test.cpp") create_single_source_cgal_program("unsigned.cpp") create_single_source_cgal_program("utilities.cpp") + find_package( GMP ) if( GMP_FOUND AND NOT CGAL_DISABLE_GMP ) create_single_source_cgal_program( "CORE_Expr_ticket_4296.cpp" ) - find_package( MPFI ) + find_package(MPFI QUIET) if( MPFI_FOUND ) include( ${MPFI_USE_FILE} ) endif() #MPFI_FOUND endif() #GMP_FOUND AND NOT CGAL_DISABLE_GMP + if(NOT CGAL_DISABLE_GMP) create_single_source_cgal_program( "Gmpfi.cpp" ) create_single_source_cgal_program( "Gmpfr_bug.cpp" ) create_single_source_cgal_program( "test_eigen.cpp" ) - find_package(Eigen3 3.2.0) #(requires 3.2.0 or greater) + find_package(Eigen3 3.2.0 QUIET) #(requires 3.2.0 or greater) include(CGAL_Eigen3_support) if (TARGET CGAL::Eigen3_support) target_link_libraries(test_eigen PUBLIC CGAL::Eigen3_support) @@ -85,11 +84,8 @@ if(NOT CGAL_DISABLE_GMP) else()#NOT CGAL_DISABLE_GMP message(STATUS "NOTICE: Some tests require the CGAL_Core library, and will not be compiled.") endif()#NOT CGAL_DISABLE_GMP + # all the programs below will be linked against MPFI in case it is present create_single_source_cgal_program("Quotient_new.cpp") create_single_source_cgal_program("test_nt_Coercion_traits.cpp") - -find_package(Boost) -if(Boost_FOUND) create_single_source_cgal_program("to_interval_test_boost.cpp") -endif() diff --git a/Optimal_bounding_box/benchmark/Optimal_bounding_box/CMakeLists.txt b/Optimal_bounding_box/benchmark/Optimal_bounding_box/CMakeLists.txt index d7c0b148f90..0bbc27d0aa8 100644 --- a/Optimal_bounding_box/benchmark/Optimal_bounding_box/CMakeLists.txt +++ b/Optimal_bounding_box/benchmark/Optimal_bounding_box/CMakeLists.txt @@ -7,14 +7,10 @@ project(Optimal_bounding_box_Benchmark) # CGAL and its components find_package(CGAL REQUIRED) -# include helper file -include(${CGAL_USE_FILE}) - -find_package(Eigen3 3.1.0 REQUIRED) #(3.1.0 or greater) +find_package(Eigen3 3.1.0 QUIET) #(3.1.0 or greater) include(CGAL_Eigen3_support) if(NOT TARGET CGAL::Eigen3_support) - message( - STATUS "This project requires the Eigen library, and will not be compiled.") + message("NOTICE: This project requires the Eigen library, and will not be compiled.") return() endif() diff --git a/Optimal_bounding_box/examples/Optimal_bounding_box/CMakeLists.txt b/Optimal_bounding_box/examples/Optimal_bounding_box/CMakeLists.txt index 822eb0d43c4..d771e4440e4 100644 --- a/Optimal_bounding_box/examples/Optimal_bounding_box/CMakeLists.txt +++ b/Optimal_bounding_box/examples/Optimal_bounding_box/CMakeLists.txt @@ -6,11 +6,10 @@ project(Optimal_bounding_box_Examples) find_package(CGAL REQUIRED) -find_package(Eigen3 3.1.0 REQUIRED) #(3.1.0 or greater) +find_package(Eigen3 3.1.0 QUIET) #(3.1.0 or greater) include(CGAL_Eigen3_support) if(NOT TARGET CGAL::Eigen3_support) - message( - STATUS "This project requires the Eigen library, and will not be compiled.") + message("NOTICE: This project requires the Eigen library, and will not be compiled.") return() endif() @@ -18,7 +17,6 @@ create_single_source_cgal_program("obb_example.cpp") create_single_source_cgal_program("obb_with_point_maps_example.cpp") create_single_source_cgal_program("rotated_aabb_tree_example.cpp") -foreach(target obb_example obb_with_point_maps_example - rotated_aabb_tree_example) +foreach(target obb_example obb_with_point_maps_example rotated_aabb_tree_example) target_link_libraries(${target} PUBLIC CGAL::Eigen3_support) endforeach() diff --git a/Optimal_bounding_box/test/Optimal_bounding_box/CMakeLists.txt b/Optimal_bounding_box/test/Optimal_bounding_box/CMakeLists.txt index e3f74be5219..0bbca049598 100644 --- a/Optimal_bounding_box/test/Optimal_bounding_box/CMakeLists.txt +++ b/Optimal_bounding_box/test/Optimal_bounding_box/CMakeLists.txt @@ -6,11 +6,10 @@ project(Optimal_bounding_box_Tests) find_package(CGAL REQUIRED) -find_package(Eigen3 3.1.0 REQUIRED) #(3.1.0 or greater) +find_package(Eigen3 3.1.0 QUIET) #(3.1.0 or greater) include(CGAL_Eigen3_support) if(NOT TARGET CGAL::Eigen3_support) - message( - STATUS "This project requires the Eigen library, and will not be compiled.") + message("NOTICE: This project requires the Eigen library, and will not be compiled.") return() endif() diff --git a/Optimal_transportation_reconstruction_2/demo/Optimal_transportation_reconstruction_2/CMakeLists.txt b/Optimal_transportation_reconstruction_2/demo/Optimal_transportation_reconstruction_2/CMakeLists.txt index fe35cc31bb4..96eb570c9c9 100644 --- a/Optimal_transportation_reconstruction_2/demo/Optimal_transportation_reconstruction_2/CMakeLists.txt +++ b/Optimal_transportation_reconstruction_2/demo/Optimal_transportation_reconstruction_2/CMakeLists.txt @@ -33,14 +33,10 @@ find_path( DOC "Path to the header of the CImg library") if(CIMG_INCLUDE_DIR) - message( - STATUS "CImg library found, the demo can load point set from image files.") + message(STATUS "NOTICE: CImg library found, the demo can load point set from image files.") else() - message( - STATUS - "CImg library was not found, the demo will not be able to load point set from image files. " - "Try setting the environment variable CIMG_INC_DIR to point to the path of the directory containing CImg.h." - ) + message(STATUS "CImg library was not found, the demo will not be able to load point set from image files. " + "Try setting the environment variable CIMG_INC_DIR to point to the path of the directory containing CImg.h.") endif() if(CGAL_Qt5_FOUND AND Qt5_FOUND) @@ -81,7 +77,7 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND) target_include_directories(Otr2_demo PRIVATE ${CIMG_INCLUDE_DIR}) # Is pthread around? If yes, we need to link against it set(CMAKE_THREAD_PREFER_PTHREAD TRUE) - find_package(Threads) + find_package(Threads QUIET) if(CMAKE_USE_PTHREADS_INIT) target_link_libraries(Otr2_demo PRIVATE ${CMAKE_THREAD_LIBS_INIT}) endif() @@ -105,10 +101,7 @@ else( set(OTR2_MISSING_DEPS "Qt5.4, ${OTR2_MISSING_DEPS}") endif() - message( - STATUS - "NOTICE: This demo requires ${OTR2_MISSING_DEPS}and will not be compiled." - ) + message("NOTICE: This demo requires ${OTR2_MISSING_DEPS} and will not be compiled.") endif( CGAL_Qt5_FOUND diff --git a/Orthtree/benchmark/Orthtree/CMakeLists.txt b/Orthtree/benchmark/Orthtree/CMakeLists.txt index 06cea796719..24274ae62b8 100644 --- a/Orthtree/benchmark/Orthtree/CMakeLists.txt +++ b/Orthtree/benchmark/Orthtree/CMakeLists.txt @@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.1...3.23) project(Orthtree_benchmarks) -find_package(CGAL REQUIRED QUIET OPTIONAL_COMPONENTS Core) +find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Core) create_single_source_cgal_program("construction.cpp") create_single_source_cgal_program("nearest_neighbor.cpp") diff --git a/Orthtree/examples/Orthtree/CMakeLists.txt b/Orthtree/examples/Orthtree/CMakeLists.txt index 09026783dab..432d99b21c4 100644 --- a/Orthtree/examples/Orthtree/CMakeLists.txt +++ b/Orthtree/examples/Orthtree/CMakeLists.txt @@ -4,27 +4,21 @@ cmake_minimum_required(VERSION 3.1...3.23) project(Orthtree_Examples) -find_package(CGAL REQUIRED QUIET OPTIONAL_COMPONENTS Core) -if (CGAL_FOUND) +find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Core) - create_single_source_cgal_program("octree_build_from_point_set.cpp") - create_single_source_cgal_program("octree_build_from_point_vector.cpp") - create_single_source_cgal_program("octree_build_with_custom_split.cpp") - create_single_source_cgal_program("octree_find_nearest_neighbor.cpp") - create_single_source_cgal_program("octree_traversal_custom.cpp") - create_single_source_cgal_program("octree_traversal_manual.cpp") - create_single_source_cgal_program("octree_traversal_preorder.cpp") - create_single_source_cgal_program("octree_grade.cpp") - create_single_source_cgal_program("quadtree_build_from_point_vector.cpp") +create_single_source_cgal_program("octree_build_from_point_set.cpp") +create_single_source_cgal_program("octree_build_from_point_vector.cpp") +create_single_source_cgal_program("octree_build_with_custom_split.cpp") +create_single_source_cgal_program("octree_find_nearest_neighbor.cpp") +create_single_source_cgal_program("octree_traversal_custom.cpp") +create_single_source_cgal_program("octree_traversal_manual.cpp") +create_single_source_cgal_program("octree_traversal_preorder.cpp") +create_single_source_cgal_program("octree_grade.cpp") +create_single_source_cgal_program("quadtree_build_from_point_vector.cpp") - find_package(Eigen3 3.1.91) #(requires 3.2.0 or greater) - include(CGAL_Eigen_support) - if (TARGET CGAL::Eigen_support) - create_single_source_cgal_program("orthtree_build.cpp") - target_link_libraries(orthtree_build PUBLIC CGAL::Eigen_support) - endif() - -else () - message(WARNING - "This program requires the CGAL library, and will not be compiled.") -endif () +find_package(Eigen3 3.1.91 QUIET) #(requires 3.1.91 or greater) +include(CGAL_Eigen_support) +if (TARGET CGAL::Eigen_support) + create_single_source_cgal_program("orthtree_build.cpp") + target_link_libraries(orthtree_build PUBLIC CGAL::Eigen_support) +endif() diff --git a/Orthtree/test/Orthtree/CMakeLists.txt b/Orthtree/test/Orthtree/CMakeLists.txt index 6ffe9220aaf..6776af02157 100644 --- a/Orthtree/test/Orthtree/CMakeLists.txt +++ b/Orthtree/test/Orthtree/CMakeLists.txt @@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.1...3.23) project(Orthtree_Tests) -find_package(CGAL REQUIRED QUIET OPTIONAL_COMPONENTS Core) +find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Core) create_single_source_cgal_program("test_octree_equality.cpp") create_single_source_cgal_program("test_octree_refine.cpp") diff --git a/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/CMakeLists.txt b/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/CMakeLists.txt index 61362c53923..e27c0b7afff 100644 --- a/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/CMakeLists.txt +++ b/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/CMakeLists.txt @@ -5,31 +5,16 @@ cmake_minimum_required(VERSION 3.1...3.23) project(Periodic_3_mesh_3_Examples) # CGAL and its components -find_package(CGAL REQUIRED COMPONENTS ImageIO) - -# include for local package +find_package(CGAL REQUIRED) # Use Eigen -find_package(Eigen3 3.1.0 REQUIRED) #(3.1.0 or greater) +find_package(Eigen3 3.1.0 QUIET) #(3.1.0 or greater) include(CGAL_Eigen3_support) if(NOT TARGET CGAL::Eigen3_support) - message( - STATUS "This project requires the Eigen library, and will not be compiled.") + message("NOTICE: This project requires the Eigen library, and will not be compiled.") return() endif() -# Boost and its components -find_package(Boost) - -if(NOT Boost_FOUND) - message( - STATUS "This project requires the Boost library, and will not be compiled.") - return() -endif() - -# Creating entries for all C++ files with "main" routine -# ########################################################## - create_single_source_cgal_program("mesh_implicit_shape.cpp") create_single_source_cgal_program("mesh_implicit_multi_domain.cpp") create_single_source_cgal_program("mesh_implicit_shape_with_subdomains.cpp") diff --git a/Periodic_3_mesh_3/test/Periodic_3_mesh_3/CMakeLists.txt b/Periodic_3_mesh_3/test/Periodic_3_mesh_3/CMakeLists.txt index 25990ad8479..9f8d277a28a 100644 --- a/Periodic_3_mesh_3/test/Periodic_3_mesh_3/CMakeLists.txt +++ b/Periodic_3_mesh_3/test/Periodic_3_mesh_3/CMakeLists.txt @@ -7,19 +7,16 @@ project(Periodic_3_mesh_3_Tests) find_package(CGAL REQUIRED COMPONENTS ImageIO) # Use Eigen -find_package(Eigen3 3.1.0 REQUIRED) #(3.1.0 or greater) +find_package(Eigen3 3.1.0 QUIET) #(3.1.0 or greater) include(CGAL_Eigen3_support) if(NOT TARGET CGAL::Eigen3_support) - message( - STATUS "This project requires the Eigen library, and will not be compiled.") + message("NOTICE: This project requires the Eigen library, and will not be compiled.") return() endif() create_single_source_cgal_program("test_implicit_shapes_bunch.cpp") target_link_libraries(test_implicit_shapes_bunch PUBLIC CGAL::Eigen3_support) create_single_source_cgal_program("test_implicit_shapes_with_features.cpp") -target_link_libraries(test_implicit_shapes_with_features - PUBLIC CGAL::Eigen3_support) +target_link_libraries(test_implicit_shapes_with_features PUBLIC CGAL::Eigen3_support) create_single_source_cgal_program("test_triply_periodic_minimal_surfaces.cpp") -target_link_libraries(test_triply_periodic_minimal_surfaces - PUBLIC CGAL::Eigen3_support) +target_link_libraries(test_triply_periodic_minimal_surfaces PUBLIC CGAL::Eigen3_support) diff --git a/Periodic_3_triangulation_3/demo/Periodic_3_triangulation_3/CMakeLists.txt b/Periodic_3_triangulation_3/demo/Periodic_3_triangulation_3/CMakeLists.txt index b763183740b..3692008579e 100644 --- a/Periodic_3_triangulation_3/demo/Periodic_3_triangulation_3/CMakeLists.txt +++ b/Periodic_3_triangulation_3/demo/Periodic_3_triangulation_3/CMakeLists.txt @@ -97,9 +97,6 @@ else() ) endif() - message( - STATUS - "NOTICE: This demo requires ${PERIODIC_TRIANGULATION_MISSING_DEPS}and will not be compiled." - ) + message("NOTICE: This demo requires ${PERIODIC_TRIANGULATION_MISSING_DEPS}and will not be compiled.") endif() diff --git a/Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/CMakeLists.txt b/Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/CMakeLists.txt index dab9ad4ecd9..63284a9ba62 100644 --- a/Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/CMakeLists.txt +++ b/Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/CMakeLists.txt @@ -92,9 +92,6 @@ else(CGAL_Qt5_FOUND "${CGAL_QCOLLECTIONGENERATOR_TARGET}, ${PERIODIC_LLOYD_MISSING_DEPS}") endif() - message( - STATUS - "NOTICE: This demo requires ${PERIODIC_LLOYD_MISSING_DEPS}and will not be compiled." - ) + message("NOTICE: This demo requires ${PERIODIC_LLOYD_MISSING_DEPS} and will not be compiled.") endif() diff --git a/Periodic_4_hyperbolic_triangulation_2/benchmark/Periodic_4_hyperbolic_triangulation_2/CMakeLists.txt b/Periodic_4_hyperbolic_triangulation_2/benchmark/Periodic_4_hyperbolic_triangulation_2/CMakeLists.txt index 02ee6e0849a..e83a7c4a836 100644 --- a/Periodic_4_hyperbolic_triangulation_2/benchmark/Periodic_4_hyperbolic_triangulation_2/CMakeLists.txt +++ b/Periodic_4_hyperbolic_triangulation_2/benchmark/Periodic_4_hyperbolic_triangulation_2/CMakeLists.txt @@ -6,10 +6,6 @@ project(Periodic_4_hyperbolic_triangulation_2_Benchmarks) find_package(CGAL REQUIRED COMPONENTS Core) -include(${CGAL_USE_FILE}) - -include(CGAL_CreateSingleSourceCGALProgram) - create_single_source_cgal_program("bench_p4ht2_hyperbolic_vs_euclidean.cpp") create_single_source_cgal_program("bench_p4ht2_insertion.cpp") create_single_source_cgal_program("bench_p4ht2_remove_dummy_points.cpp") diff --git a/Periodic_4_hyperbolic_triangulation_2/demo/Periodic_4_hyperbolic_triangulation_2/CMakeLists.txt b/Periodic_4_hyperbolic_triangulation_2/demo/Periodic_4_hyperbolic_triangulation_2/CMakeLists.txt index 013be0260c8..a2b4110a07f 100644 --- a/Periodic_4_hyperbolic_triangulation_2/demo/Periodic_4_hyperbolic_triangulation_2/CMakeLists.txt +++ b/Periodic_4_hyperbolic_triangulation_2/demo/Periodic_4_hyperbolic_triangulation_2/CMakeLists.txt @@ -41,5 +41,5 @@ if((CGAL_Core_FOUND OR LEDA_FOUND) include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) cgal_add_compilation_test(P4HDT2) else() - message(STATUS "NOTICE: This demo requires Qt5 and will not be compiled.") + message("NOTICE: This demo requires Qt5 and will not be compiled.") endif() diff --git a/Periodic_4_hyperbolic_triangulation_2/examples/Periodic_4_hyperbolic_triangulation_2/CMakeLists.txt b/Periodic_4_hyperbolic_triangulation_2/examples/Periodic_4_hyperbolic_triangulation_2/CMakeLists.txt index ddabef6c10d..a4ee8805749 100644 --- a/Periodic_4_hyperbolic_triangulation_2/examples/Periodic_4_hyperbolic_triangulation_2/CMakeLists.txt +++ b/Periodic_4_hyperbolic_triangulation_2/examples/Periodic_4_hyperbolic_triangulation_2/CMakeLists.txt @@ -1,16 +1,11 @@ cmake_minimum_required(VERSION 3.1...3.23) project(Periodic_4_hyperbolic_triangulation_2_Examples) -find_package(CGAL REQUIRED QUIET OPTIONAL_COMPONENTS Core) +find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Core) + find_package(LEDA QUIET) - -if((CGAL_Core_FOUND OR LEDA_FOUND)) - +if(CGAL_Core_FOUND OR LEDA_FOUND) create_single_source_cgal_program("p4ht2_example_insertion.cpp") - else() - - message( - STATUS "This program requires the CGAL library, and will not be compiled.") - + message("NOTICE: This program requires the CGAL library, and will not be compiled.") endif() diff --git a/Periodic_4_hyperbolic_triangulation_2/test/Periodic_4_hyperbolic_triangulation_2/CMakeLists.txt b/Periodic_4_hyperbolic_triangulation_2/test/Periodic_4_hyperbolic_triangulation_2/CMakeLists.txt index f62e869c177..ef5923f844c 100644 --- a/Periodic_4_hyperbolic_triangulation_2/test/Periodic_4_hyperbolic_triangulation_2/CMakeLists.txt +++ b/Periodic_4_hyperbolic_triangulation_2/test/Periodic_4_hyperbolic_triangulation_2/CMakeLists.txt @@ -1,11 +1,10 @@ cmake_minimum_required(VERSION 3.1...3.23) project(Periodic_4_hyperbolic_triangulation_2_Tests) -find_package(CGAL REQUIRED QUIET OPTIONAL_COMPONENTS Core) +find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Core) + find_package(LEDA QUIET) - -if((CGAL_Core_FOUND OR LEDA_FOUND)) - +if(CGAL_Core_FOUND OR LEDA_FOUND) create_single_source_cgal_program("test_p4ht2_construct_point_2.cpp") create_single_source_cgal_program("test_p4ht2_exact_complex_numbers.cpp") create_single_source_cgal_program("test_p4ht2_intersections.cpp") @@ -14,12 +13,6 @@ if((CGAL_Core_FOUND OR LEDA_FOUND)) create_single_source_cgal_program("test_p4ht2_removal_iterator.cpp") create_single_source_cgal_program("test_p4ht2_removal.cpp") create_single_source_cgal_program("test_p4ht2_insert_degenerate.cpp") - else() - - message( - STATUS - "This program requires the CGAL library and the GMP library, and will not be compiled." - ) - + message("NOTICE: This program requires the CGAL library and the GMP library, and will not be compiled.") endif() diff --git a/Point_set_3/examples/Point_set_3/CMakeLists.txt b/Point_set_3/examples/Point_set_3/CMakeLists.txt index 7fde9c1408d..b26633c293a 100644 --- a/Point_set_3/examples/Point_set_3/CMakeLists.txt +++ b/Point_set_3/examples/Point_set_3/CMakeLists.txt @@ -7,35 +7,21 @@ project(Point_set_3_Examples) # CGAL and its components find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) -# Boost and its components -find_package(Boost REQUIRED) - -if(NOT Boost_FOUND) - - message( - STATUS "This project requires the Boost library, and will not be compiled.") - - return() - -endif() - -# Creating entries for all C++ files with "main" routine -# ########################################################## - create_single_source_cgal_program("point_set.cpp") create_single_source_cgal_program("point_set_property.cpp") create_single_source_cgal_program("point_set_read_xyz.cpp") create_single_source_cgal_program("point_set_advanced.cpp") set(needed_cxx_features cxx_rvalue_references cxx_variadic_templates) -create_single_source_cgal_program("point_set_read_ply.cpp" CXX_FEATURES - ${needed_cxx_features}) +create_single_source_cgal_program("point_set_read_ply.cpp" CXX_FEATURES ${needed_cxx_features}) -find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) +find_package(Eigen3 3.1.0 QUIET) #(requires 3.1.0 or greater) include(CGAL_Eigen3_support) -if(EIGEN3_FOUND) +if(TARGET CGAL::Eigen3_support) create_single_source_cgal_program("point_set_algo.cpp") target_link_libraries(point_set_algo PUBLIC CGAL::Eigen3_support) +else() + message(STATUS "NOTICE: The example 'point_set_algo' requires the Eigen library, and will not be compiled.") endif() create_single_source_cgal_program("draw_point_set_3.cpp") diff --git a/Point_set_3/test/Point_set_3/CMakeLists.txt b/Point_set_3/test/Point_set_3/CMakeLists.txt index bb283d43771..4daea00a56b 100644 --- a/Point_set_3/test/Point_set_3/CMakeLists.txt +++ b/Point_set_3/test/Point_set_3/CMakeLists.txt @@ -7,25 +7,6 @@ project(Point_set_3_Tests) # CGAL and its components find_package(CGAL REQUIRED) -# Boost and its components -find_package(Boost REQUIRED) - -if(NOT Boost_FOUND) - - message( - STATUS "This project requires the Boost library, and will not be compiled.") - - return() - -endif() - -# include for local directory - -# include for local package - -# Creating entries for all C++ files with "main" routine -# ########################################################## - create_single_source_cgal_program("point_set_test.cpp") create_single_source_cgal_program("point_set_test_join.cpp") create_single_source_cgal_program("test_deprecated_io_ps.cpp") @@ -33,13 +14,13 @@ create_single_source_cgal_program("test_deprecated_io_ps.cpp") #Use LAS #disable if MSVC 2017 if(NOT MSVC_VERSION OR (MSVC_VERSION GREATER_EQUAL 1919 AND MSVC_VERSION LESS 1910)) - find_package(LASLIB) + find_package(LASLIB QUIET) include(CGAL_LASLIB_support) if (TARGET CGAL::LASLIB_support) target_link_libraries(test_deprecated_io_ps PUBLIC CGAL::LASLIB_support) else() - message(STATUS "NOTICE : the LAS reader test requires LASlib and will not be compiled.") + message(STATUS "NOTICE: the LAS reader test requires LASlib, and will not be compiled.") endif() else() - message(STATUS "NOTICE : the LAS reader does not work with Visual Studio 2017.") + message(STATUS "NOTICE: the LAS reader does not work with Visual Studio 2017.") endif() diff --git a/Point_set_processing_3/examples/Point_set_processing_3/CMakeLists.txt b/Point_set_processing_3/examples/Point_set_processing_3/CMakeLists.txt index c3ccee0d7a4..ac5e71b1aa1 100644 --- a/Point_set_processing_3/examples/Point_set_processing_3/CMakeLists.txt +++ b/Point_set_processing_3/examples/Point_set_processing_3/CMakeLists.txt @@ -6,8 +6,6 @@ project(Point_set_processing_3_Examples) # Find CGAL find_package(CGAL REQUIRED) -find_package(Boost QUIET) - # VisualC++ optimization for applications dealing with large data if(MSVC) # Quit warning in the lasreader @@ -18,21 +16,10 @@ if(MSVC) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE") endif() # Prints new compilation options - message( - STATUS - "USING DEBUG CXXFLAGS = '${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG}'") - message( - STATUS - "USING DEBUG EXEFLAGS = '${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_DEBUG}'" - ) - message( - STATUS - "USING RELEASE CXXFLAGS = '${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE}'" - ) - message( - STATUS - "USING RELEASE EXEFLAGS = '${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_RELEASE}'" - ) + message(STATUS "USING DEBUG CXXFLAGS = '${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG}'") + message(STATUS "USING DEBUG EXEFLAGS = '${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_DEBUG}'") + message(STATUS "USING RELEASE CXXFLAGS = '${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE}'") + message(STATUS "USING RELEASE EXEFLAGS = '${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_RELEASE}'") endif() # Activate concurrency? @@ -67,19 +54,17 @@ foreach( target_link_libraries(${target} PRIVATE ${CGAL_libs}) endforeach() -find_package(LASLIB) +find_package(LASLIB QUIET) include(CGAL_LASLIB_support) if(TARGET CGAL::LASLIB_support) create_single_source_cgal_program("read_las_example.cpp") target_link_libraries(read_las_example PRIVATE ${CGAL_libs} CGAL::LASLIB_support) else() - message( - STATUS - "NOTICE : the LAS reader test requires LASlib and will not be compiled.") + message(STATUS "NOTICE: the LAS reader example requires LASlib and will not be compiled.") endif() # Use Eigen -find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) +find_package(Eigen3 3.1.0 QUIET) #(requires 3.1.0 or greater) include(CGAL_Eigen3_support) if(TARGET CGAL::Eigen3_support) set(CGAL_libs ${CGAL_libs} CGAL::Eigen3_support) @@ -104,6 +89,7 @@ if(TARGET CGAL::Eigen3_support) target_link_libraries(orient_scanlines_example PRIVATE ${CGAL_libs} CGAL::Eigen3_support CGAL::LASLIB_support) endif() + # Executables that require libpointmatcher find_package(libpointmatcher QUIET) include(CGAL_pointmatcher_support) @@ -112,11 +98,9 @@ if(TARGET CGAL::Eigen3_support) target_link_libraries(registration_with_pointmatcher PRIVATE ${CGAL_libs} CGAL::pointmatcher_support) else() - message( - STATUS - "NOTICE : the registration_with_pointmatcher test requires libpointmatcher and will not be compiled." - ) + message(STATUS "NOTICE: registration with pointmatcher requires libpointmatcher and will not be compiled.") endif() + # Executables that require OpenGR find_package(OpenGR QUIET) include(CGAL_OpenGR_support) @@ -125,10 +109,7 @@ if(TARGET CGAL::Eigen3_support) target_link_libraries(registration_with_OpenGR PRIVATE ${CGAL_libs} CGAL::OpenGR_support) else() - message( - STATUS - "NOTICE : registration_with_OpenGR requires OpenGR, and will not be compiled." - ) + message(STATUS "NOTICE: registration_with_OpenGR requires OpenGR, and will not be compiled.") endif() # Executables that require both libpointmatcher and OpenGR @@ -139,15 +120,9 @@ if(TARGET CGAL::Eigen3_support) registration_with_opengr_pointmatcher_pipeline PRIVATE ${CGAL_libs} CGAL::pointmatcher_support CGAL::OpenGR_support) else() - message( - STATUS - "NOTICE : registration_with_opengr_pointmatcher_pipeline requires libpointmatcher and OpenGR, and will not be compiled." - ) + message(STATUS "NOTICE: registration with OpenGR and pointmatcher requires both libpointmatcher and OpenGR, and will not be compiled.") endif() else() - message( - STATUS - "NOTICE: Some of the executables in this directory need Eigen 3.1 (or greater) and will not be compiled." - ) + message(STATUS "NOTICE: Some of the executables in this directory require Eigen 3.1 (or greater), and will not be compiled.") endif() diff --git a/Point_set_processing_3/test/Point_set_processing_3/CMakeLists.txt b/Point_set_processing_3/test/Point_set_processing_3/CMakeLists.txt index 895fae52907..3f5583bb8b8 100644 --- a/Point_set_processing_3/test/Point_set_processing_3/CMakeLists.txt +++ b/Point_set_processing_3/test/Point_set_processing_3/CMakeLists.txt @@ -19,12 +19,6 @@ if (MSVC) message( STATUS "USING RELEASE EXEFLAGS = '${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_RELEASE}'" ) endif() -# Temporary debugging stuff -ADD_DEFINITIONS( "-DDEBUG_TRACE" ) - -find_package( TBB QUIET ) -include(CGAL_TBB_support) - # Executables that do *not* require Eigen create_single_source_cgal_program( "read_test.cpp" ) create_single_source_cgal_program( "test_read_write_point_set.cpp" ) @@ -40,29 +34,28 @@ create_single_source_cgal_program( "structuring_test.cpp" ) #Use LAS #disable if MSVC 2017 if(NOT MSVC_VERSION OR (MSVC_VERSION GREATER_EQUAL 1919 AND MSVC_VERSION LESS 1910)) - find_package(LASLIB) + find_package(LASLIB QUIET) include(CGAL_LASLIB_support) if (TARGET CGAL::LASLIB_support) target_link_libraries(test_read_write_point_set PUBLIC ${CGAL_libs} CGAL::LASLIB_support) target_link_libraries(test_deprecated_io_point_set PUBLIC ${CGAL_libs} CGAL::LASLIB_support) else() - message(STATUS "NOTICE : the LAS reader test requires LASlib and will not be compiled.") + message(STATUS "NOTICE: the LAS reader test requires LASlib and will not be compiled.") endif() else() - message(STATUS "NOTICE : the LAS reader does not work with Visual Studio 2017.") + message(STATUS "NOTICE: the LAS reader does not work with Visual Studio 2017.") endif() # Use Eigen -find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) +find_package(Eigen3 3.1.0 QUIET) #(requires 3.1.0 or greater) include(CGAL_Eigen3_support) -if (EIGEN3_FOUND) +if(TARGET CGAL::Eigen3_support) # Executables that require Eigen create_single_source_cgal_program( "normal_estimation_test.cpp" ) target_link_libraries(normal_estimation_test PUBLIC CGAL::Eigen3_support) create_single_source_cgal_program("hierarchy_simplification_test.cpp") - target_link_libraries(hierarchy_simplification_test - PUBLIC CGAL::Eigen3_support) + target_link_libraries(hierarchy_simplification_test PUBLIC CGAL::Eigen3_support) create_single_source_cgal_program("smoothing_test.cpp") target_link_libraries(smoothing_test PUBLIC CGAL::Eigen3_support) @@ -76,12 +69,11 @@ if (EIGEN3_FOUND) create_single_source_cgal_program("jet_pointer_as_property_map.cpp") target_link_libraries(jet_pointer_as_property_map PUBLIC CGAL::Eigen3_support) else() - message( - STATUS - "NOTICE: This program requires Eigen 3.1 (or greater) and will not be compiled." - ) + message(STATUS "NOTICE: Some tests require Eigen 3.1 (or greater), and will not be compiled.") endif() +find_package(TBB QUIET) +include(CGAL_TBB_support) if(TARGET CGAL::TBB_support) foreach( target @@ -92,4 +84,6 @@ if(TARGET CGAL::TBB_support) target_link_libraries(${target} PUBLIC CGAL::TBB_support) endif() endforeach() +else() + message(STATUS "NOTICE: Tests are not using TBB.") endif() diff --git a/Poisson_surface_reconstruction_3/examples/Poisson_surface_reconstruction_3/CMakeLists.txt b/Poisson_surface_reconstruction_3/examples/Poisson_surface_reconstruction_3/CMakeLists.txt index 044b462442d..d62b4bccd03 100644 --- a/Poisson_surface_reconstruction_3/examples/Poisson_surface_reconstruction_3/CMakeLists.txt +++ b/Poisson_surface_reconstruction_3/examples/Poisson_surface_reconstruction_3/CMakeLists.txt @@ -12,40 +12,25 @@ if(MSVC) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE") # Print new compilation options - message( - STATUS - "USING DEBUG CXXFLAGS = '${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG}'") - message( - STATUS - "USING DEBUG EXEFLAGS = '${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_DEBUG}'" - ) - message( - STATUS - "USING RELEASE CXXFLAGS = '${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE}'" - ) - message( - STATUS - "USING RELEASE EXEFLAGS = '${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_RELEASE}'" - ) + message(STATUS "USING DEBUG CXXFLAGS = '${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG}'") + message(STATUS "USING DEBUG EXEFLAGS = '${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_DEBUG}'") + message(STATUS "USING RELEASE CXXFLAGS = '${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE}'") + message(STATUS "USING RELEASE EXEFLAGS = '${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_RELEASE}'") endif() # Find Eigen3 (requires 3.1.0 or greater) -find_package(Eigen3 3.1.0) +find_package(Eigen3 3.1.0 QUIET) include(CGAL_Eigen3_support) if(TARGET CGAL::Eigen3_support) # Executables that require Eigen 3 create_single_source_cgal_program("poisson_reconstruction_example.cpp") - target_link_libraries(poisson_reconstruction_example - PUBLIC CGAL::Eigen3_support) + target_link_libraries(poisson_reconstruction_example PUBLIC CGAL::Eigen3_support) create_single_source_cgal_program("poisson_reconstruction.cpp") target_link_libraries(poisson_reconstruction PUBLIC CGAL::Eigen3_support) create_single_source_cgal_program("poisson_reconstruction_function.cpp") - target_link_libraries(poisson_reconstruction_function - PUBLIC CGAL::Eigen3_support) + target_link_libraries(poisson_reconstruction_function PUBLIC CGAL::Eigen3_support) create_single_source_cgal_program("tutorial_example.cpp") target_link_libraries(tutorial_example PUBLIC CGAL::Eigen3_support) else() - message( - STATUS - "NOTICE: The examples need Eigen 3.1 (or greater) will not be compiled.") + message("NOTICE: The examples require Eigen 3.1 (or greater) will not be compiled.") endif() diff --git a/Poisson_surface_reconstruction_3/test/Poisson_surface_reconstruction_3/CMakeLists.txt b/Poisson_surface_reconstruction_3/test/Poisson_surface_reconstruction_3/CMakeLists.txt index e3adcb68d37..efd978ee3a3 100644 --- a/Poisson_surface_reconstruction_3/test/Poisson_surface_reconstruction_3/CMakeLists.txt +++ b/Poisson_surface_reconstruction_3/test/Poisson_surface_reconstruction_3/CMakeLists.txt @@ -12,37 +12,27 @@ if(MSVC) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE") # Prints new compilation options - message( - STATUS - "USING DEBUG CXXFLAGS = '${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG}'") - message( - STATUS - "USING DEBUG EXEFLAGS = '${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_DEBUG}'" - ) - message( - STATUS - "USING RELEASE CXXFLAGS = '${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE}'" - ) - message( - STATUS - "USING RELEASE EXEFLAGS = '${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_RELEASE}'" - ) + message(STATUS "USING DEBUG CXXFLAGS = '${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG}'") + message(STATUS "USING DEBUG EXEFLAGS = '${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_DEBUG}'") + message(STATUS "USING RELEASE CXXFLAGS = '${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE}'") + message(STATUS "USING RELEASE EXEFLAGS = '${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_RELEASE}'") endif() - # Temporary debugging stuff - find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) - include(CGAL_Eigen3_support) - if(TARGET CGAL::Eigen3_support) - # Executables that require Eigen 3.1 - create_single_source_cgal_program("poisson_reconstruction_test.cpp") - target_link_libraries(poisson_reconstruction_test PUBLIC CGAL::Eigen3_support) - find_package(TBB) - include(CGAL_TBB_support) - if (TBB_FOUND) - create_single_source_cgal_program( "poisson_and_parallel_mesh_3.cpp" ) - target_link_libraries(poisson_and_parallel_mesh_3 PUBLIC CGAL::Eigen3_support CGAL::TBB_support) - else() - message(STATUS "NOTICE: test with parallel Mesh_3 needs TBB and will not be compiled.") - endif() + +find_package(Eigen3 3.1.0 QUIET) #(requires 3.1.0 or greater) +include(CGAL_Eigen3_support) +if(TARGET CGAL::Eigen3_support) + # Executables that require Eigen 3.1 + create_single_source_cgal_program("poisson_reconstruction_test.cpp") + target_link_libraries(poisson_reconstruction_test PUBLIC CGAL::Eigen3_support) + + find_package(TBB QUIET) + include(CGAL_TBB_support) + if (TBB_FOUND) + create_single_source_cgal_program( "poisson_and_parallel_mesh_3.cpp" ) + target_link_libraries(poisson_and_parallel_mesh_3 PUBLIC CGAL::Eigen3_support CGAL::TBB_support) else() - message(STATUS "NOTICE: Some of the executables in this directory need Eigen 3.1 (or greater) and will not be compiled.") + message(STATUS "NOTICE: The test 'poisson_and_parallel_mesh_3' requires TBB, and will not be compiled.") + endif() +else() + message("NOTICE: Tests in this directory require Eigen 3.1 (or greater), and will not be compiled.") endif() diff --git a/Polygon/include/CGAL/Polygon_2.h b/Polygon/include/CGAL/Polygon_2.h index e4305cccfed..b2b7ab7340a 100644 --- a/Polygon/include/CGAL/Polygon_2.h +++ b/Polygon/include/CGAL/Polygon_2.h @@ -242,8 +242,11 @@ class Polygon_2 { /// Erases the vertex pointed to by `i`. Vertex_circulator erase(Vertex_circulator i) { - return Vertex_circulator(&d_container, - d_container.erase(i.mod_iterator())); + auto it = d_container.erase(i.mod_iterator()); + if(it == d_container.end()){ + it = d_container.begin(); + } + return Vertex_circulator(&d_container, it); } /// Erases the vertices in the range `[first, last)`. diff --git a/Polygon/test/Polygon/issue7228.cpp b/Polygon/test/Polygon/issue7228.cpp new file mode 100644 index 00000000000..623a8633130 --- /dev/null +++ b/Polygon/test/Polygon/issue7228.cpp @@ -0,0 +1,29 @@ +#include +#include + +#include +#include +#include + +typedef CGAL::Simple_cartesian K; +typedef K::Point_2 Point; +typedef CGAL::Polygon_2 Polygon_2; +typedef Polygon_2::Vertex_circulator Vertex_circulator; + +int main() +{ + std::array points = { Point(0,0), Point(1,0), Point(1,1), Point(0,1) }; + Polygon_2 poly(points.begin(), points.end()); + + Vertex_circulator vc = poly.vertices_circulator(); + + ++vc; + ++vc; + ++vc; + + vc = poly.erase(vc); + + assert(*vc == Point(0,0)); + + return 0; +} diff --git a/Polygon_mesh_processing/benchmark/Polygon_mesh_processing/CMakeLists.txt b/Polygon_mesh_processing/benchmark/Polygon_mesh_processing/CMakeLists.txt index 44b2282519a..5fcd1fc630a 100644 --- a/Polygon_mesh_processing/benchmark/Polygon_mesh_processing/CMakeLists.txt +++ b/Polygon_mesh_processing/benchmark/Polygon_mesh_processing/CMakeLists.txt @@ -7,33 +7,19 @@ project(Polygon_mesh_processing) # CGAL and its components find_package(CGAL REQUIRED) -# Boost and its components -find_package(Boost REQUIRED) - -if(NOT Boost_FOUND) - - message( - STATUS "This project requires the Boost library, and will not be compiled.") - - return() - -endif() - -# include for local directory - -# include for local package -find_package(Eigen3 REQUIRED 3.2.0) #(requires 3.2.0 or greater) +find_package(Eigen3 3.2.0 QUIET) #(requires 3.2.0 or greater) include(CGAL_Eigen3_support) - -# Creating entries for all .cpp/.C files with "main" routine -# ########################################################## +if(NOT TARGET CGAL::Eigen3_support) + message("NOTICE: Benchmarks require Eigen 3.2 (or greater), and will not be compiled") + return() +endif() set(FAST_ENVELOPE_BUILD_DIR "" CACHE PATH "Path to fast-evelope build directory") if (FAST_ENVELOPE_BUILD_DIR) message(STATUS "Using ${FAST_ENVELOPE_BUILD_DIR} as build directory of fast-evelope") include_directories("${FAST_ENVELOPE_BUILD_DIR}/include") - link_directories ( "${FAST_ENVELOPE_BUILD_DIR}/lib" "${FAST_ENVELOPE_BUILD_DIR}" "${FAST_ENVELOPE_BUILD_DIR}/tbb" ) + link_directories ( "${FAST_ENVELOPE_BUILD_DIR}/lib" "${FAST_ENVELOPE_BUILD_DIR}" "${FAST_ENVELOPE_BUILD_DIR}/tbb") find_package(OpenMP) if (OPENMP_FOUND) @@ -42,18 +28,16 @@ if (FAST_ENVELOPE_BUILD_DIR) set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}") endif() - create_single_source_cgal_program( "fastE.cpp" ) + create_single_source_cgal_program("fastE.cpp") target_link_libraries( fastE PUBLIC CGAL::Eigen3_support) target_link_libraries( fastE PUBLIC FastEnvelope IndirectPredicates geogram) else() - message(STATUS "Cmake variable FAST_ENVELOPE_BUILD_DIR is not defined fastE will not be built") + message(STATUS "CMake variable FAST_ENVELOPE_BUILD_DIR is not defined; benchmark 'fastE' will not be built") endif() -create_single_source_cgal_program( "fast.cpp" ) +create_single_source_cgal_program("fast.cpp") + create_single_source_cgal_program("polygon_mesh_slicer.cpp") +target_link_libraries(polygon_mesh_slicer PUBLIC CGAL::Eigen3_support) - -if(TARGET CGAL::Eigen3_support) - target_link_libraries(polygon_mesh_slicer PUBLIC CGAL::Eigen3_support) -endif() diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/CMakeLists.txt b/Polygon_mesh_processing/examples/Polygon_mesh_processing/CMakeLists.txt index baa4d41677a..192e7d29b74 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/CMakeLists.txt +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/CMakeLists.txt @@ -7,38 +7,52 @@ project(Polygon_mesh_processing_Examples) # CGAL and its components find_package(CGAL REQUIRED) -# Boost and its components -find_package(Boost REQUIRED) - -if(NOT Boost_FOUND) - - message( - STATUS "This project requires the Boost library, and will not be compiled.") - - return() - -endif() - -find_package(OpenMesh QUIET) - -if(OpenMesh_FOUND) - include(UseOpenMesh) -else() - message(STATUS "Examples that use OpenMesh will not be compiled.") -endif() - -# include for local directory - -# include for local package -find_package(Eigen3 3.2.0) #(requires 3.2.0 or greater) -include(CGAL_Eigen3_support) - -# Creating entries for all .cpp/.C files with "main" routine -# ########################################################## - +create_single_source_cgal_program("extrude.cpp" ) +create_single_source_cgal_program("polyhedral_envelope.cpp" ) +create_single_source_cgal_program("polyhedral_envelope_of_triangle_soup.cpp" ) +create_single_source_cgal_program("polyhedral_envelope_mesh_containment.cpp" ) +create_single_source_cgal_program("self_intersections_example.cpp" ) +create_single_source_cgal_program("stitch_borders_example.cpp" ) +create_single_source_cgal_program("compute_normals_example_Polyhedron.cpp" CXX_FEATURES cxx_range_for ) +create_single_source_cgal_program("compute_normals_example.cpp" CXX_FEATURES cxx_range_for cxx_auto_type ) +create_single_source_cgal_program("point_inside_example.cpp") +create_single_source_cgal_program("triangulate_faces_example.cpp") +create_single_source_cgal_program("triangulate_faces_split_visitor_example.cpp") +create_single_source_cgal_program("connected_components_example.cpp") +create_single_source_cgal_program( "face_filtered_graph_example.cpp") +create_single_source_cgal_program("orient_polygon_soup_example.cpp") +create_single_source_cgal_program("triangulate_polyline_example.cpp") +create_single_source_cgal_program("mesh_slicer_example.cpp") +#create_single_source_cgal_program( "remove_degeneracies_example.cpp") +create_single_source_cgal_program("isotropic_remeshing_example.cpp") +create_single_source_cgal_program("isotropic_remeshing_of_patch_example.cpp") +create_single_source_cgal_program("tangential_relaxation_example.cpp") +create_single_source_cgal_program("surface_mesh_intersection.cpp") +create_single_source_cgal_program("corefinement_SM.cpp") +create_single_source_cgal_program("corefinement_consecutive_bool_op.cpp") +create_single_source_cgal_program("corefinement_difference_remeshed.cpp") +create_single_source_cgal_program("corefinement_mesh_union.cpp") +create_single_source_cgal_program("corefinement_mesh_union_progress.cpp") +create_single_source_cgal_program("corefinement_mesh_union_and_intersection.cpp") +create_single_source_cgal_program("corefinement_mesh_union_with_attributes.cpp") +create_single_source_cgal_program("corefinement_polyhedron_union.cpp") +create_single_source_cgal_program("random_perturbation_SM_example.cpp") +create_single_source_cgal_program("corefinement_LCC.cpp") +create_single_source_cgal_program("detect_features_example.cpp") +create_single_source_cgal_program("volume_connected_components.cpp") +create_single_source_cgal_program("manifoldness_repair_example.cpp") +create_single_source_cgal_program("repair_polygon_soup_example.cpp") +create_single_source_cgal_program("locate_example.cpp") +create_single_source_cgal_program("orientation_pipeline_example.cpp") +#create_single_source_cgal_program("self_snapping_example.cpp") +#create_single_source_cgal_program("snapping_example.cpp") +create_single_source_cgal_program("match_faces.cpp") +create_single_source_cgal_program("cc_compatible_orientations.cpp") create_single_source_cgal_program("hausdorff_distance_remeshing_example.cpp") -create_single_source_cgal_program( "hausdorff_bounded_error_distance_example.cpp") +create_single_source_cgal_program("hausdorff_bounded_error_distance_example.cpp") +find_package(Eigen3 3.2.0 QUIET) #(requires 3.2.0 or greater) +include(CGAL_Eigen3_support) if(TARGET CGAL::Eigen3_support) create_single_source_cgal_program("hole_filling_example.cpp") target_link_libraries(hole_filling_example PUBLIC CGAL::Eigen3_support) @@ -56,65 +70,22 @@ if(TARGET CGAL::Eigen3_support) target_link_libraries(mesh_smoothing_example PUBLIC CGAL::Eigen3_support) create_single_source_cgal_program("delaunay_remeshing_example.cpp") target_link_libraries(delaunay_remeshing_example PUBLIC CGAL::Eigen3_support) +else() + message(STATUS "NOTICE: Examples that use Eigen will not be compiled.") endif() -create_single_source_cgal_program( "extrude.cpp" ) -create_single_source_cgal_program( "polyhedral_envelope.cpp" ) -create_single_source_cgal_program( "polyhedral_envelope_of_triangle_soup.cpp" ) -create_single_source_cgal_program( "polyhedral_envelope_mesh_containment.cpp" ) -create_single_source_cgal_program( "self_intersections_example.cpp" ) -create_single_source_cgal_program( "stitch_borders_example.cpp" ) -create_single_source_cgal_program( "compute_normals_example_Polyhedron.cpp" CXX_FEATURES cxx_range_for ) -create_single_source_cgal_program( "compute_normals_example.cpp" CXX_FEATURES cxx_range_for cxx_auto_type ) -create_single_source_cgal_program( "point_inside_example.cpp") -create_single_source_cgal_program( "triangulate_faces_example.cpp") -create_single_source_cgal_program( "triangulate_faces_split_visitor_example.cpp") -create_single_source_cgal_program( "connected_components_example.cpp") -create_single_source_cgal_program( "face_filtered_graph_example.cpp") -create_single_source_cgal_program( "orient_polygon_soup_example.cpp") -create_single_source_cgal_program( "triangulate_polyline_example.cpp") -create_single_source_cgal_program( "mesh_slicer_example.cpp") -#create_single_source_cgal_program( "remove_degeneracies_example.cpp") -create_single_source_cgal_program("isotropic_remeshing_example.cpp") -create_single_source_cgal_program("isotropic_remeshing_of_patch_example.cpp") -create_single_source_cgal_program("tangential_relaxation_example.cpp") -create_single_source_cgal_program("surface_mesh_intersection.cpp") -create_single_source_cgal_program("corefinement_SM.cpp") -create_single_source_cgal_program("corefinement_consecutive_bool_op.cpp") -create_single_source_cgal_program("corefinement_difference_remeshed.cpp") -create_single_source_cgal_program("corefinement_mesh_union.cpp") -create_single_source_cgal_program("corefinement_mesh_union_progress.cpp") -create_single_source_cgal_program( - "corefinement_mesh_union_and_intersection.cpp") -create_single_source_cgal_program("corefinement_mesh_union_with_attributes.cpp") -create_single_source_cgal_program("corefinement_polyhedron_union.cpp") -create_single_source_cgal_program("random_perturbation_SM_example.cpp") -create_single_source_cgal_program("corefinement_LCC.cpp") -create_single_source_cgal_program("detect_features_example.cpp") -create_single_source_cgal_program("volume_connected_components.cpp") -create_single_source_cgal_program("manifoldness_repair_example.cpp") -create_single_source_cgal_program("repair_polygon_soup_example.cpp") -create_single_source_cgal_program("locate_example.cpp") -create_single_source_cgal_program("orientation_pipeline_example.cpp") -#create_single_source_cgal_program( "self_snapping_example.cpp") -#create_single_source_cgal_program( "snapping_example.cpp") -create_single_source_cgal_program("match_faces.cpp") -create_single_source_cgal_program("cc_compatible_orientations.cpp") - +find_package(OpenMesh QUIET) if(OpenMesh_FOUND) + include(UseOpenMesh) create_single_source_cgal_program("compute_normals_example_OM.cpp") - target_link_libraries(compute_normals_example_OM - PRIVATE ${OPENMESH_LIBRARIES}) - + target_link_libraries(compute_normals_example_OM PRIVATE ${OPENMESH_LIBRARIES}) create_single_source_cgal_program("corefinement_OM_union.cpp") - target_link_libraries(corefinement_OM_union - PRIVATE ${OPENMESH_LIBRARIES}) + target_link_libraries(corefinement_OM_union PRIVATE ${OPENMESH_LIBRARIES}) if(TARGET CGAL::Eigen3_support) create_single_source_cgal_program("hole_filling_example_OM.cpp") - target_link_libraries(hole_filling_example_OM PRIVATE CGAL::Eigen3_support - ${OPENMESH_LIBRARIES}) + target_link_libraries(hole_filling_example_OM PRIVATE CGAL::Eigen3_support ${OPENMESH_LIBRARIES}) endif() create_single_source_cgal_program("point_inside_example_OM.cpp") @@ -123,41 +94,41 @@ if(OpenMesh_FOUND) create_single_source_cgal_program("stitch_borders_example_OM.cpp") target_link_libraries(stitch_borders_example_OM PRIVATE ${OPENMESH_LIBRARIES}) - #create_single_source_cgal_program( "remove_degeneracies_example.cpp") - #target_link_libraries( remove_degeneracies_example PRIVATE ${OPENMESH_LIBRARIES} ) + #create_single_source_cgal_program("remove_degeneracies_example.cpp") + #target_link_libraries(remove_degeneracies_example PRIVATE ${OPENMESH_LIBRARIES}) + #target_compile_definitions(remove_degeneracies_example PRIVATE -DCGAL_USE_OPENMESH) create_single_source_cgal_program("triangulate_faces_example_OM.cpp") - target_link_libraries(triangulate_faces_example_OM - PRIVATE ${OPENMESH_LIBRARIES}) -endif(OpenMesh_FOUND) + target_link_libraries(triangulate_faces_example_OM PRIVATE ${OPENMESH_LIBRARIES}) +else() + message(STATUS "NOTICE: Examples that use OpenMesh will not be compiled.") +endif() -find_package(METIS) +find_package(METIS QUIET) include(CGAL_METIS_support) if(TARGET CGAL::METIS_support) target_link_libraries(hausdorff_bounded_error_distance_example PUBLIC CGAL::METIS_support) else() - message(STATUS "Tests, which use the METIS library will not be compiled.") + message(STATUS "NOTICE: Examples that use the METIS library will not be compiled.") endif() -find_package(TBB) +find_package(TBB QUIET) include(CGAL_TBB_support) if(TARGET CGAL::TBB_support) target_link_libraries(self_intersections_example PUBLIC CGAL::TBB_support) - target_link_libraries(hausdorff_distance_remeshing_example - PUBLIC CGAL::TBB_support) - target_link_libraries(hausdorff_bounded_error_distance_example - PUBLIC CGAL::TBB_support) - + target_link_libraries(hausdorff_distance_remeshing_example PUBLIC CGAL::TBB_support) + target_link_libraries(hausdorff_bounded_error_distance_example PUBLIC CGAL::TBB_support) create_single_source_cgal_program("corefinement_parallel_union_meshes.cpp") target_link_libraries(corefinement_parallel_union_meshes PUBLIC CGAL::TBB_support) else() - message( - STATUS "NOTICE: Intel TBB was not found. Sequential code will be used.") + message(STATUS "NOTICE: Intel TBB was not found. Sequential code will be used.") endif() find_package(Ceres QUIET) include(CGAL_Ceres_support) if(TARGET CGAL::Ceres_support) target_link_libraries(mesh_smoothing_example PUBLIC CGAL::Ceres_support) -endif(TARGET CGAL::Ceres_support) +else() + message(STATUS "NOTICE: The example 'mesh_smoothing_example' uses the Ceres library, and will not be compiled.") +endif() diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/isotropic_remeshing_example.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/isotropic_remeshing_example.cpp index 048739c136f..159ff7cd708 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/isotropic_remeshing_example.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/isotropic_remeshing_example.cpp @@ -43,7 +43,7 @@ int main(int argc, char* argv[]) } double target_edge_length = (argc > 2) ? std::stod(std::string(argv[2])) : 0.04; - unsigned int nb_iter = 3; + unsigned int nb_iter = (argc > 3) ? std::stoi(std::string(argv[3])) : 10; std::cout << "Split border..."; @@ -59,6 +59,8 @@ int main(int argc, char* argv[]) CGAL::parameters::number_of_iterations(nb_iter) .protect_constraints(true)); //i.e. protect border, here + CGAL::IO::write_polygon_mesh("out.off", mesh, CGAL::parameters::stream_precision(17)); + std::cout << "Remeshing done." << std::endl; return 0; diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/refine_impl.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/refine_impl.h index 54369aee910..06ddc868f0d 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/refine_impl.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/refine_impl.h @@ -15,12 +15,6 @@ #include - -#include -#include -#include -#include - #include #ifdef CGAL_PMP_FAIR_DEBUG #include @@ -30,8 +24,14 @@ #include #include #include +#include #include +#include +#include +#include +#include + namespace CGAL { namespace Polygon_mesh_processing { @@ -49,15 +49,28 @@ class Refine_Polyhedron_3 { typedef Halfedge_around_face_circulator Halfedge_around_facet_circulator; typedef Halfedge_around_target_circulator Halfedge_around_vertex_circulator; + typedef typename CGAL::Kernel_traits::type Traits; + private: PolygonMesh& pmesh; VertexPointMap vpmap; + Traits traits = {}; - bool flippable(halfedge_descriptor h) { + bool flippable(halfedge_descriptor h) + { // this check is added so that edge flip does not break manifoldness // it might happen when there is an edge where flip_edge(h) will be placed (i.e. two edges collide after flip) vertex_descriptor v_tip_0 = target(next(h,pmesh),pmesh); vertex_descriptor v_tip_1 = target(next(opposite(h,pmesh),pmesh),pmesh); + +#ifdef CGAL_PMP_REFINE_DEBUG_PP + std::cout << "flippable() " << h << std::endl; + std::cout << "\t" << source(h, pmesh) << ": " << pmesh.point(source(h, pmesh)) << std::endl; + std::cout << "\t" << target(h, pmesh) << ": " << pmesh.point(target(h, pmesh)) << std::endl; + std::cout << "\t" << v_tip_0 << ": " << pmesh.point(v_tip_0) << std::endl; + std::cout << "\t" << v_tip_1 << ": " << pmesh.point(v_tip_1) << std::endl; +#endif + Halfedge_around_vertex_circulator v_cir(next(h,pmesh), pmesh), v_end(v_cir); do { if(target(opposite(*v_cir, pmesh),pmesh) == v_tip_1) { return false; } @@ -74,13 +87,21 @@ private: bool relax(halfedge_descriptor h) { +#ifdef CGAL_PMP_REFINE_DEBUG_PP typedef typename boost::property_traits::reference Point_3_ref; - Point_3_ref p = get(vpmap, target(h,pmesh)); - Point_3_ref q = get(vpmap, target(opposite(h,pmesh),pmesh)); + Point_3_ref p = get(vpmap, source(h,pmesh)); + Point_3_ref q = get(vpmap, target(h,pmesh)); Point_3_ref r = get(vpmap, target(next(h,pmesh),pmesh)); Point_3_ref s = get(vpmap, target(next(opposite(h,pmesh),pmesh),pmesh)); - if( (CGAL::ON_UNBOUNDED_SIDE != CGAL::side_of_bounded_sphere(p,q,r,s)) || - (CGAL::ON_UNBOUNDED_SIDE != CGAL::side_of_bounded_sphere(p,q,s,r)) ) + + std::cout << "relax() " << h << std::endl; + std::cout << "\t" << source(h, pmesh) << ": " << p << std::endl; + std::cout << "\t" << target(h, pmesh) << ": " << q << std::endl; + std::cout << "\t" << target(next(h,pmesh),pmesh) << ": " << r << std::endl; + std::cout << "\t" << target(next(opposite(h,pmesh),pmesh),pmesh) << ": " << s << std::endl; +#endif + + if(internal::should_flip(edge(h, pmesh), pmesh, vpmap, traits)) { if(flippable(h)) { Euler::flip_edge(h,pmesh); @@ -238,8 +259,7 @@ private: Halfedge_around_face_circulator circ(halfedge(fd,pmesh),pmesh), done(circ); do { vertex_descriptor v = target(*circ,pmesh); - std::pair::iterator, bool> v_insert - = scale_attribute.insert(std::make_pair(v, 0)); + auto v_insert = scale_attribute.emplace(v, 0); if(!v_insert.second) { continue; } // already calculated v_insert.first->second = average_length(v, interior_map, accept_internal_facets); } while(++circ != done); diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_degeneracies.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_degeneracies.h index bb7e48292a6..798499f430b 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_degeneracies.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_degeneracies.h @@ -294,7 +294,6 @@ get_best_edge_orientation(typename boost::graph_traits::edge_descr return boost::graph_traits::null_halfedge(); } -// adapted from triangulate_faces template bool should_flip(typename boost::graph_traits::edge_descriptor e, const TriangleMesh& tmesh, @@ -303,49 +302,23 @@ bool should_flip(typename boost::graph_traits::edge_descriptor e, { typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; - typedef typename Traits::FT FT; + typedef typename Traits:: FT FT; typedef typename boost::property_traits::reference Point_ref; - typedef typename Traits::Vector_3 Vector_3; CGAL_precondition(!is_border(e, tmesh)); - halfedge_descriptor h = halfedge(e, tmesh); + typename Traits::Compute_approximate_angle_3 angle = gt.compute_approximate_angle_3_object(); - Point_ref p0 = get(vpm, target(h, tmesh)); - Point_ref p1 = get(vpm, target(next(h, tmesh), tmesh)); - Point_ref p2 = get(vpm, source(h, tmesh)); - Point_ref p3 = get(vpm, target(next(opposite(h, tmesh), tmesh), tmesh)); + const halfedge_descriptor h = halfedge(e, tmesh); - /* Chooses the diagonal that will split the quad in two triangles that maximize - * the scalar product of of the un-normalized normals of the two triangles. - * The lengths of the un-normalized normals (computed using cross-products of two vectors) - * are proportional to the area of the triangles. - * Maximize the scalar product of the two normals will avoid skinny triangles, - * and will also taken into account the cosine of the angle between the two normals. - * In particular, if the two triangles are oriented in different directions, - * the scalar product will be negative. - */ + const Point_ref p0 = get(vpm, target(h, tmesh)); + const Point_ref p1 = get(vpm, target(next(h, tmesh), tmesh)); + const Point_ref p2 = get(vpm, source(h, tmesh)); + const Point_ref p3 = get(vpm, target(next(opposite(h, tmesh), tmesh), tmesh)); -// CGAL::cross_product(p2-p1, p3-p2) * CGAL::cross_product(p0-p3, p1-p0); -// CGAL::cross_product(p1-p0, p1-p2) * CGAL::cross_product(p3-p2, p3-p0); - - const Vector_3 v01 = gt.construct_vector_3_object()(p0, p1); - const Vector_3 v12 = gt.construct_vector_3_object()(p1, p2); - const Vector_3 v23 = gt.construct_vector_3_object()(p2, p3); - const Vector_3 v30 = gt.construct_vector_3_object()(p3, p0); - - const FT p1p3 = gt.compute_scalar_product_3_object()( - gt.construct_cross_product_vector_3_object()(v12, v23), - gt.construct_cross_product_vector_3_object()(v30, v01)); - - const Vector_3 v21 = gt.construct_opposite_vector_3_object()(v12); - const Vector_3 v03 = gt.construct_opposite_vector_3_object()(v30); - - const FT p0p2 = gt.compute_scalar_product_3_object()( - gt.construct_cross_product_vector_3_object()(v01, v21), - gt.construct_cross_product_vector_3_object()(v23, v03)); - - return p0p2 <= p1p3; + const FT ap1 = angle(p0,p1,p2); + const FT ap3 = angle(p2,p3,p0); + return (ap1 + ap3 > FT(180)); } template diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/CMakeLists.txt b/Polygon_mesh_processing/test/Polygon_mesh_processing/CMakeLists.txt index 909dd292063..d3fc45f270e 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/CMakeLists.txt +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/CMakeLists.txt @@ -7,52 +7,6 @@ project(Polygon_mesh_processing_Tests) # CGAL and its components find_package(CGAL REQUIRED COMPONENTS Core) -# Boost and its components -find_package(Boost REQUIRED) - -if(NOT Boost_FOUND) - - message( - STATUS "This project requires the Boost library, and will not be compiled.") - - return() - -endif() - -# include for local directory - -# include for local package -find_package(Eigen3 3.2.0) #(requires 3.2.0 or greater) -include(CGAL_Eigen3_support) - -find_package(TBB) -include(CGAL_TBB_support) - -if(TARGET CGAL::Eigen3_support) - # Creating entries for all .cpp/.C files with "main" routine - # ########################################################## - create_single_source_cgal_program("fairing_test.cpp") - target_link_libraries(fairing_test PUBLIC CGAL::Eigen3_support) - create_single_source_cgal_program( - "triangulate_hole_Polyhedron_3_no_delaunay_test.cpp") - target_link_libraries(triangulate_hole_Polyhedron_3_no_delaunay_test - PUBLIC CGAL::Eigen3_support) - create_single_source_cgal_program("triangulate_hole_Polyhedron_3_test.cpp") - target_link_libraries(triangulate_hole_Polyhedron_3_test - PUBLIC CGAL::Eigen3_support) - create_single_source_cgal_program("test_shape_smoothing.cpp") - target_link_libraries(test_shape_smoothing PUBLIC CGAL::Eigen3_support) - create_single_source_cgal_program("delaunay_remeshing_test.cpp") - target_link_libraries(delaunay_remeshing_test PUBLIC CGAL::Eigen3_support) -endif() - -find_package(OpenMesh QUIET) -if(OpenMesh_FOUND) - include(UseOpenMesh) -else() - message(STATUS "Examples that use OpenMesh will not be compiled.") -endif() - create_single_source_cgal_program("test_pmp_triangle.cpp") create_single_source_cgal_program("test_hausdorff_bounded_error_distance.cpp") create_single_source_cgal_program("test_pmp_read_polygon_mesh.cpp") @@ -112,41 +66,61 @@ create_single_source_cgal_program("test_pmp_np_function.cpp") create_single_source_cgal_program("test_degenerate_pmp_clip_split_corefine.cpp") # create_single_source_cgal_program("test_pmp_repair_self_intersections.cpp") -find_package(METIS) +find_package(Eigen3 3.2.0 QUIET) #(requires 3.2.0 or greater) +include(CGAL_Eigen3_support) +if(TARGET CGAL::Eigen3_support) + create_single_source_cgal_program("fairing_test.cpp") + target_link_libraries(fairing_test PUBLIC CGAL::Eigen3_support) + create_single_source_cgal_program("triangulate_hole_Polyhedron_3_no_delaunay_test.cpp") + target_link_libraries(triangulate_hole_Polyhedron_3_no_delaunay_test PUBLIC CGAL::Eigen3_support) + create_single_source_cgal_program("triangulate_hole_Polyhedron_3_test.cpp") + target_link_libraries(triangulate_hole_Polyhedron_3_test PUBLIC CGAL::Eigen3_support) + create_single_source_cgal_program("test_shape_smoothing.cpp") + target_link_libraries(test_shape_smoothing PUBLIC CGAL::Eigen3_support) + create_single_source_cgal_program("delaunay_remeshing_test.cpp") + target_link_libraries(delaunay_remeshing_test PUBLIC CGAL::Eigen3_support) +else() + message(STATUS "NOTICE: Tests that use the Eigen library will not be compiled.") +endif() + +find_package(METIS QUIET) include(CGAL_METIS_support) if(TARGET CGAL::METIS_support) target_link_libraries(test_hausdorff_bounded_error_distance PUBLIC CGAL::METIS_support) else() - message(STATUS "Tests, which use the METIS library will not be compiled.") + message(STATUS "NOTICE: Tests are not using METIS.") endif() +find_package(TBB QUIET) +include(CGAL_TBB_support) if(TARGET CGAL::TBB_support) target_link_libraries(test_hausdorff_bounded_error_distance PUBLIC CGAL::TBB_support) target_link_libraries(test_pmp_distance PUBLIC CGAL::TBB_support) target_link_libraries(orient_polygon_soup_test PUBLIC CGAL::TBB_support) - target_link_libraries(self_intersection_surface_mesh_test - PUBLIC CGAL::TBB_support) + target_link_libraries(self_intersection_surface_mesh_test PUBLIC CGAL::TBB_support) else() - message( - STATUS - "NOTICE: Intel TBB was not found. test_pmp_distance will use sequential code." - ) + message(STATUS "NOTICE: Intel TBB was not found. Tests will use sequential code.") endif() +find_package(OpenMesh QUIET) if(OpenMesh_FOUND) + include(UseOpenMesh) create_single_source_cgal_program("remeshing_test_P_SM_OM.cpp") target_link_libraries(remeshing_test_P_SM_OM PRIVATE ${OPENMESH_LIBRARIES}) +else() + message(STATUS "NOTICE: Tests that use OpenMesh will not be compiled.") endif() find_package(Ceres QUIET) include(CGAL_Ceres_support) - if(TARGET CGAL::Ceres_support AND TARGET CGAL::Eigen3_support) - target_link_libraries( test_mesh_smoothing PUBLIC CGAL::Eigen3_support CGAL::Ceres_support) + target_link_libraries(test_mesh_smoothing PUBLIC CGAL::Eigen3_support CGAL::Ceres_support) -# target_compile_definitions( test_pmp_repair_self_intersections PRIVATE CGAL_PMP_USE_CERES_SOLVER ) -# target_link_libraries( test_pmp_repair_self_intersections PRIVATE ceres ) -endif(TARGET CGAL::Ceres_support AND TARGET CGAL::Eigen3_support) +# target_compile_definitions(test_pmp_repair_self_intersections PUBLIC CGAL_PMP_USE_CERES_SOLVER) +# target_link_libraries(test_pmp_repair_self_intersections PUBLIC CGAL::Eigen3_support CGAL::Ceres_support) +else() + message(STATUS "NOTICE: Tests are not using Ceres.") +endif() if(BUILD_TESTING) set_tests_properties( diff --git a/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/CMakeLists.txt b/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/CMakeLists.txt index 040445e7b0e..bc49569944f 100644 --- a/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/CMakeLists.txt +++ b/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/CMakeLists.txt @@ -8,30 +8,10 @@ project(Polygonal_surface_reconstruction_Examples) # CGAL and its components find_package(CGAL REQUIRED) -# Boost and its components -find_package(Boost REQUIRED) - -if(NOT Boost_FOUND) - - message( - STATUS - "NOTICE: This project requires the Boost library, and will not be compiled." - ) - - return() - -endif() - -# Creating entries for all C++ files with "main" routine -# ########################################################## - -find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) +find_package(Eigen3 3.1.0 QUIET) #(requires 3.1.0 or greater) include(CGAL_Eigen3_support) if(NOT TARGET CGAL::Eigen3_support) - message( - STATUS - "NOTICE: This project requires Eigen 3.1 (or greater) and will not be compiled." - ) + message("NOTICE: This project requires Eigen 3.1 (or greater), and will not be compiled.") return() endif() @@ -41,10 +21,7 @@ if(NOT TARGET CGAL::SCIP_support) find_package(GLPK QUIET) include(CGAL_GLPK_support) if(NOT TARGET CGAL::GLPK_support) - message( - STATUS - "NOTICE: This project requires either SCIP or GLPK, and will not be compiled." - ) + message("NOTICE: This project requires either SCIP or GLPK, and will not be compiled.") return() endif() endif() diff --git a/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_model_complexity_control.cpp b/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_model_complexity_control.cpp index e132d62975d..cf1ce77b8b1 100644 --- a/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_model_complexity_control.cpp +++ b/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_model_complexity_control.cpp @@ -39,9 +39,9 @@ typedef CGAL::Nth_of_tuple_property_map<2, PNI> * candidate generation are cached and reused. */ -int main() +int main(int argc, char* argv[]) { - const std::string& input_file(CGAL::data_file_path("points_3/building.ply")); + const std::string input_file = (argc > 1) ? argv[1] : CGAL::data_file_path("points_3/building.ply"); std::ifstream input_stream(input_file.c_str()); std::vector points; // store points diff --git a/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_user_provided_planes.cpp b/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_user_provided_planes.cpp index 2f2ed2df2c9..5db8d3f3700 100644 --- a/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_user_provided_planes.cpp +++ b/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_user_provided_planes.cpp @@ -39,9 +39,9 @@ typedef CGAL::Nth_of_tuple_property_map<2, PNI> * the point is not assigned to a plane). */ -int main() +int main(int argc, char* argv[]) { - const std::string& input_file(CGAL::data_file_path("points_3/ball.ply")); + const std::string input_file = (argc > 1) ? argv[1] : CGAL::data_file_path("points_3/ball.ply"); std::ifstream input_stream(input_file.c_str()); std::vector points; // store points diff --git a/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_with_region_growing.cpp b/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_with_region_growing.cpp index 6735d0ed821..8f3876b581d 100644 --- a/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_with_region_growing.cpp +++ b/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_with_region_growing.cpp @@ -83,13 +83,13 @@ private: * the surface model from the planes. */ -int main() +int main(int argc, char* argv[]) { Point_vector points; // Load point set from a file. - const std::string input_file(CGAL::data_file_path("points_3/cube.pwn")); - std::ifstream input_stream(input_file.c_str()); + const std::string input_file = (argc > 1) ? argv[1] : CGAL::data_file_path("points_3/cube.pwn"); + std::ifstream input_stream(input_file.c_str()); if (input_stream.fail()) { std::cerr << "Failed open file \'" << input_file << "\'" << std::endl; return EXIT_FAILURE; diff --git a/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_without_input_planes.cpp b/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_without_input_planes.cpp index 4b2ed8f91a4..d14411babd1 100644 --- a/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_without_input_planes.cpp +++ b/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_without_input_planes.cpp @@ -52,13 +52,13 @@ typedef CGAL::Surface_mesh * the surface model from the planes. */ -int main() +int main(int argc, char* argv[]) { Point_vector points; // Loads point set from a file. - const std::string input_file(CGAL::data_file_path("points_3/cube.pwn")); - std::ifstream input_stream(input_file.c_str()); + const std::string input_file = (argc > 1) ? argv[1] : CGAL::data_file_path("points_3/cube.pwn"); + std::ifstream input_stream(input_file.c_str()); if (input_stream.fail()) { std::cerr << "failed open file \'" <///lib/cmake/Qt5" -) + DESCRIPTION "To find this package, it should be sufficient to fill the Qt5_DIR variable with: ///lib/cmake/Qt5") if(Qt5_FOUND) - add_definitions(-DQT_NO_KEYWORDS) add_definitions(-DSCENE_IMAGE_GL_BUFFERS_AVAILABLE) endif(Qt5_FOUND) -find_package(Eigen3 3.2.0) #(requires 3.2.0 or greater) +find_package(Eigen3 3.2.0 QUIET) #(requires 3.2.0 or greater) set_package_properties( Eigen3 PROPERTIES - DESCRIPTION "A library for mathematical tools." - PURPOSE - "Required for the Polyhedron Edit, Parameterization, Jet fitting, Classification plugin, Surface reconstruction, Normal estimation, Smoothing, Average spacing, Feature detection, Hole Filling and Fairing plugins ." -) + DESCRIPTION "A library for linear algebra." + PURPOSE "Required for most plugins (Meshing, Mesh and Point Set Processing, etc.).") include(CGAL_Eigen3_support) +if(NOT TARGET CGAL::Eigen3_support) + message(STATUS "NOTICE: Eigen was not found.") +endif() -find_package(METIS) +find_package(METIS QUIET) include(CGAL_METIS_support) set_package_properties( METIS PROPERTIES - DESCRIPTION "A library for partitioning." + DESCRIPTION "A library for graph partitioning." PURPOSE "Required for the partition plugin.") # Activate concurrency? option(POLYHEDRON_DEMO_ACTIVATE_CONCURRENCY "Enable concurrency" ON) - if(POLYHEDRON_DEMO_ACTIVATE_CONCURRENCY) - find_package(TBB) + find_package(TBB QUIET) include(CGAL_TBB_support) if(NOT TARGET CGAL::TBB_support) - message( - STATUS - "NOTICE: Intel TBB was not found. Bilateral smoothing and WLOP plugins are faster if TBB is linked." - ) + message(STATUS "NOTICE: Intel TBB was not found. Bilateral smoothing and WLOP plugins are faster if TBB is linked.") endif() endif() #find libssh for scene sharing -find_package(LibSSH) +find_package(LibSSH QUIET) set_package_properties( LibSSH PROPERTIES - DESCRIPTION "A library used to enable the SSH features. " + DESCRIPTION "A library implementing the SSH protocol on client and server side. " PURPOSE "Required for loading (saving) a scene to (from) a distant server.") - if(NOT LIBSSH_FOUND) - message("NOTICE : The SSH features will be disabled.") + message(STATUS "NOTICE: The SSH features will be disabled.") endif() # Activate concurrency ? (turned OFF by default) @@ -119,15 +103,11 @@ if(CGAL_ACTIVATE_CONCURRENT_MESH_3 OR "$ENV{CGAL_ACTIVATE_CONCURRENT_MESH_3}") find_package(TBB REQUIRED) include(CGAL_TBB_support) if(NOT TARGET CGAL::TBB_support) - message( - STATUS - "NOTICE: Intel TBB was not found. Mesh_3 is faster if TBB is linked.") + message(STATUS "NOTICE: Intel TBB was not found. Mesh_3 is faster if TBB is linked.") endif() endif() - else(CGAL_ACTIVATE_CONCURRENT_MESH_3 OR "$ENV{CGAL_ACTIVATE_CONCURRENT_MESH_3}") - option(LINK_WITH_TBB - "Link with TBB anyway so we can use TBB timers for profiling" ON) + option(LINK_WITH_TBB "Link with TBB anyway so we can use TBB timers for profiling" ON) if(LINK_WITH_TBB) find_package(TBB) include(CGAL_TBB_support) @@ -136,9 +116,8 @@ endif() set_package_properties( TBB PROPERTIES - DESCRIPTION - "A library for parallelism. Mesh_3, Bilateral smoothing and WLOP plugins are faster if TBB is linked." - PURPOSE "Required for running some algorithms in parallel.") + DESCRIPTION "A library for parallel programming." + PURPOSE "Plugins such as Mesh_3, Bilateral smoothing, and WLOP are faster if TBB is linked.") if(CGAL_Qt5_FOUND AND Qt5_FOUND) include(${CGAL_USE_FILE}) @@ -184,7 +163,7 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND) # AUXILIARY LIBRARIES - # put s (which are shared libraries) at the same location as + # put plugins (which are shared libraries) at the same location as # executable files set(CGAL_POLYHEDRON_DEMO_PLUGINS_DIR "${RUNTIME_OUTPUT_PATH}") set(LIBRARY_OUTPUT_PATH "${CGAL_POLYHEDRON_DEMO_PLUGINS_DIR}") @@ -216,8 +195,7 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND) Qt5::Script CGAL::CGAL_Qt5) if(TARGET Qt5::WebSockets) target_link_libraries(demo_framework PUBLIC Qt5::WebSockets) - message( - STATUS "Qt5WebSockets was found. Using WebSockets is therefore possible.") + message(STATUS "Qt5WebSockets was found. Using WebSockets is therefore possible.") endif() #compilation_of__demo_framework is defined in polyhedron_demo_macros.cmake @@ -387,10 +365,7 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND) if(TARGET Qt5::ScriptTools) target_link_libraries(polyhedron_demo PUBLIC Qt5::ScriptTools) else() - message( - STATUS - "POLYHEDRON_QTSCRIPT_DEBUGGER is set to TRUE but the Qt5 ScriptTools library was not found." - ) + message(STATUS "POLYHEDRON_QTSCRIPT_DEBUGGER is set to TRUE but the Qt5 ScriptTools library was not found.") endif() endif() target_link_libraries(Polyhedron_3 PRIVATE demo_framework) @@ -437,8 +412,7 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND) if(TARGET Qt5::WebSockets AND TARGET Qt5::Network) add_executable(WS_server Server_ws.cpp) target_link_libraries(WS_server PUBLIC Qt5::WebSockets Qt5::Widgets Qt5::Network) - message( - STATUS "Qt5WebSockets was found. Using WebSockets is therefore possible.") + message(STATUS "Qt5WebSockets was found. Using WebSockets is therefore possible.") endif() # # Exporting @@ -478,30 +452,25 @@ else(CGAL_Qt5_FOUND AND Qt5_FOUND) set(POLYHEDRON_MISSING_DEPS "") if(NOT CGAL_Qt5_FOUND) - set(POLYHEDRON_MISSING_DEPS - "the CGAL Qt5 library, ${POLYHEDRON_MISSING_DEPS}") + set(POLYHEDRON_MISSING_DEPS "the CGAL Qt5 library, ${POLYHEDRON_MISSING_DEPS}") endif() if(NOT Qt5_FOUND) set(POLYHEDRON_MISSING_DEPS "Qt5, ${POLYHEDRON_MISSING_DEPS}") endif() - message( - STATUS - "NOTICE: This demo requires ${POLYHEDRON_MISSING_DEPS}and will not be compiled." - ) + message("NOTICE: This demo requires ${POLYHEDRON_MISSING_DEPS} and will not be compiled.") endif(CGAL_Qt5_FOUND AND Qt5_FOUND) feature_summary( WHAT REQUIRED_PACKAGES_NOT_FOUND INCLUDE_QUIET_PACKAGES - DESCRIPTION - "NOTICE: Missing required packages that prevent the demo from being compiled:" + DESCRIPTION "NOTICE: Missing required packages that prevent the demo from being compiled:" QUIET_ON_EMPTY VAR NotFound_REQ_PACKAGES) if(NOT ${NotFound_REQ_PACKAGES} STREQUAL "") - message(STATUS "${NotFound_REQ_PACKAGES}") + message("${NotFound_REQ_PACKAGES}") endif() feature_summary( diff --git a/Polyhedron/demo/Polyhedron/Plugins/Classification/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/Classification/CMakeLists.txt index a44ae7fd8b4..86d60a56319 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Classification/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/Classification/CMakeLists.txt @@ -2,28 +2,22 @@ include(polyhedron_demo_macros) if(TARGET CGAL::Eigen3_support) - find_package(Boost OPTIONAL_COMPONENTS serialization iostreams) + find_package(Boost QUIET OPTIONAL_COMPONENTS serialization iostreams) include(CGAL_Boost_serialization_support) include(CGAL_Boost_iostreams_support) if(NOT TARGET CGAL::Boost_serialization_support OR NOT TARGET CGAL::Boost_iostreams_support) - message( - STATUS - "NOTICE: Boost IO Streams and/or Serialization not found, reading deprecated Classification config files won't be possible." - ) + message(STATUS "NOTICE: Boost IO Streams and/or Serialization not found, reading deprecated Classification config files won't be possible.") endif() find_package(OpenCV QUIET COMPONENTS core ml) # Need core + machine learning set_package_properties( OpenCV PROPERTIES - DESCRIPTION "A library for real-time computer vision." + DESCRIPTION "A library for real-time computer vision." PURPOSE "Enables the random forest predicate for the classification plugin." ) include(CGAL_OpenCV_support) if(NOT TARGET CGAL::OpenCV_support) - message( - STATUS - "NOTICE: OpenCV was not found. OpenCV random forest predicate for classification won't be available." - ) + message(STATUS "NOTICE: OpenCV was not found. OpenCV random forest predicate for classification won't be available.") endif() qt5_wrap_ui(classificationUI_FILES Classification_widget.ui @@ -54,9 +48,8 @@ if(TARGET CGAL::Eigen3_support) endif() if(TARGET CGAL::Boost_serialization_support AND TARGET CGAL::Boost_iostreams_support) - target_link_libraries(classification_plugin PUBLIC - CGAL::Boost_serialization_support - CGAL::Boost_iostreams_support) + target_link_libraries(classification_plugin PUBLIC CGAL::Boost_serialization_support + CGAL::Boost_iostreams_support) endif() if(TARGET CGAL::OpenCV_support) @@ -67,12 +60,8 @@ if(TARGET CGAL::Eigen3_support) target_link_libraries(classification_plugin PUBLIC CGAL::TBB_support) endif() - add_dependencies(classification_plugin point_set_selection_plugin - selection_plugin) + add_dependencies(classification_plugin point_set_selection_plugin selection_plugin) else() - message( - STATUS - "NOTICE: Eigen 3.1 (or greater) was not found. Classification plugin will not be available." - ) + message(STATUS "NOTICE: Eigen 3.1 (or greater) was not found. Classification plugin will not be available.") endif() diff --git a/Polyhedron/demo/Polyhedron/Plugins/IO/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/IO/CMakeLists.txt index 73c99106598..fefcc2706b4 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/IO/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/IO/CMakeLists.txt @@ -1,9 +1,9 @@ include(polyhedron_demo_macros) -find_package(LASLIB) +find_package(LASLIB QUIET) set_package_properties( LASLIB PROPERTIES - DESCRIPTION "A library for some I/O." + DESCRIPTION "A library for LIDAR I/O." PURPOSE "Required for reading or writing LAS files.") include(CGAL_LASLIB_support) @@ -68,22 +68,13 @@ if(VTK_FOUND) ${VTK_LIBRARIES}) target_compile_definitions(vtk_plugin PRIVATE -DCGAL_USE_VTK) else() - message( - STATUS - "NOTICE : the vtk IO plugin needs VTK libraries and will not be compiled." - ) + message(STATUS "NOTICE: the vtk IO plugin needs VTK libraries and will not be compiled.") endif() else() - message( - STATUS - "NOTICE : the vtk IO plugin needs VTK 6.0 or greater and will not be compiled (incorrect version found)." - ) + message(STATUS "NOTICE: the vtk IO plugin needs VTK 6.0 or greater and will not be compiled (incorrect version found).") endif() else() - message( - STATUS - "NOTICE : the vtk IO plugin needs VTK 6.0 or greater and will not be compiled." - ) + message(STATUS "NOTICE: the vtk IO plugin needs VTK 6.0 or greater and will not be compiled.") endif() polyhedron_demo_plugin(xyz_plugin XYZ_io_plugin KEYWORDS Viewer PointSetProcessing Classification) target_link_libraries(xyz_plugin PUBLIC scene_points_with_normal_item) @@ -92,10 +83,7 @@ list(FIND CMAKE_CXX_COMPILE_FEATURES cxx_rvalue_references has_cxx_rvalues) list(FIND CMAKE_CXX_COMPILE_FEATURES cxx_variadic_templates has_cxx_variadic) if(has_cxx_rvalues LESS 0 OR has_cxx_variadic LESS 0) - message( - STATUS - "NOTICE : LAS/PLY IO examples require a C++11 compiler and will not be compiled." - ) + message(STATUS "NOTICE: LAS/PLY IO examples require a C++11 compiler and will not be compiled.") else() set(needed_cxx_features cxx_rvalue_references cxx_variadic_templates) @@ -113,10 +101,7 @@ else() PUBLIC "-D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS") endif() else() - message( - STATUS - "NOTICE : the LAS IO plugin needs LAS libraries and will not be compiled." - ) + message(STATUS "NOTICE: the LAS IO plugin needs LAS libraries and will not be compiled.") endif() endif() @@ -138,8 +123,5 @@ if(3MF_LIBRARIES target_link_libraries(io_3mf_plugin PRIVATE scene_surface_mesh_item scene_points_with_normal_item scene_polylines_item ${3MF_LIBRARIES}) target_compile_definitions(io_3mf_plugin PRIVATE -DCGAL_LINKED_WITH_3MF) else() - message( - STATUS - "NOTICE : The 3mf_io_plugin requires the lib3MF library in a version < 2.0, and will not be compiled." - ) + message(STATUS "NOTICE: The 3mf_io_plugin requires the lib3MF library in a version < 2.0, and will not be compiled.") endif() diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/CMakeLists.txt index 89d05476c46..ab8d02e1d80 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/CMakeLists.txt @@ -44,22 +44,13 @@ if(VTK_FOUND) set(VTK_LIBRARIES VTK::IOImage VTK::ImagingGeneral) endif() if(NOT VTK_LIBRARIES) - message( - STATUS - "NOTICE : the DICOM files (.dcm) need VTK libraries to be open and will not be able to." - ) + message(STATUS "NOTICE: DICOM files (.dcm) require the VTK libraries, and will not be readable.") endif() else() - message( - STATUS - "NOTICE : the DICOM files (.dcm) need VTK libraries to be open and will not be able to." - ) + message(STATUS "NOTICE: DICOM files (.dcm) require the VTK libraries, and will not be readable.") endif() else() - message( - STATUS - "NOTICE : the DICOM files (.dcm) need VTK libraries to be open and will not be able to." - ) + message(STATUS "NOTICE: DICOM files (.dcm) require the VTK libraries, and will not be readable.") endif() find_package(Boost QUIET OPTIONAL_COMPONENTS filesystem system) @@ -82,10 +73,7 @@ if(Boost_FILESYSTEM_FOUND) target_link_libraries(io_image_plugin PUBLIC ${Boost_LIBRARIES}) endif() else() - message( - STATUS - "NOTICE : the Io_image_plugin needs boost-filesystem to work and will not be compiled" - ) + message(STATUS "NOTICE: the Io_image_plugin requires boost-filesystem, and will not be compiled") endif() polyhedron_demo_plugin( mesh_3_optimization_plugin @@ -101,17 +89,14 @@ target_link_libraries( scene_implicit_function_item) # Use Eigen -find_package(Eigen3 3.1.0 REQUIRED) #(3.1.0 or greater) +find_package(Eigen3 3.1.0 QUIET) #(3.1.0 or greater) include(CGAL_Eigen3_support) - if(TARGET CGAL::Eigen3_support) target_link_libraries(mesh_3_optimization_plugin PUBLIC CGAL::Eigen3_support) -else() #eigen - message( - STATUS - "The Mesh_3_optimization_plugin requires Eigen, which was not found, and will use a deprecated class to replace it. Warnings are to be expected." - ) -endif() #eigen +else() + message(STATUS "NOTICE: The Mesh_3_optimization_plugin requires Eigen, which was not found." + "A deprecated class will be used to replace it. Warnings are to be expected.") +endif() polyhedron_demo_plugin(c3t3_io_plugin C3t3_io_plugin KEYWORDS Viewer Mesh_3) target_link_libraries(c3t3_io_plugin PUBLIC scene_c3t3_item) diff --git a/Polyhedron/demo/Polyhedron/Plugins/Operations_on_polyhedra/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/Operations_on_polyhedra/CMakeLists.txt index 82d8554f6e3..628d00b72d3 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Operations_on_polyhedra/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/Operations_on_polyhedra/CMakeLists.txt @@ -25,7 +25,5 @@ target_link_libraries(diff_between_meshes_plugin PUBLIC scene_surface_mesh_item) polyhedron_demo_plugin(partition_plugin Partition_graph_plugin ${partitionUI_FILES}) target_link_libraries(partition_plugin PUBLIC scene_surface_mesh_item CGAL::METIS_support ) else() - message( - "NOTICE : the Partition plugin needs METIS libraries and will not be compiled." - ) + message(STATUS "NOTICE: the Partition plugin needs METIS libraries and will not be compiled.") endif() diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/PMP/CMakeLists.txt index 53cfdc9b825..adcd4f7f02b 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/CMakeLists.txt @@ -1,16 +1,12 @@ include(polyhedron_demo_macros) -if(TARGET CGAL::Eigen3_support) +if(TARGET CGAL::Eigen3_support) polyhedron_demo_plugin(jet_fitting_plugin Jet_fitting_plugin) target_link_libraries( jet_fitting_plugin PUBLIC scene_surface_mesh_item scene_polylines_item CGAL::Eigen3_support) - else() - message( - STATUS - "NOTICE: Eigen 3.1 (or greater) was not found. Jet fitting plugin will not be available." - ) + message(STATUS "NOTICE: Eigen 3.1 (or greater) was not found. Jet fitting plugin will not be available.") endif() polyhedron_demo_plugin(extrude_plugin Extrude_plugin KEYWORDS PMP) @@ -64,17 +60,10 @@ if(TARGET CGAL::Eigen3_support) PROPERTIES RESOURCE_LOCK Selection_test_resources) endif() else() - message( - STATUS - "NOTICE: The hole filling and fairing plugins require Eigen 3.2 (or higher) and will not be available." - ) + message(STATUS "NOTICE: The hole filling and fairing plugins require Eigen 3.2 (or higher) and will not be available.") endif() - -else(EIGEN3_FOUND) - message( - STATUS - "NOTICE: The hole filling and fairing plugins require Eigen 3.2 (or higher) and will not be available." - ) +else() + message(STATUS "NOTICE: The hole filling and fairing plugins require Eigen 3.2 (or higher) and will not be available.") endif() qt5_wrap_ui(soupUI_FILES Repair_soup.ui) diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Isotropic_remeshing_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Isotropic_remeshing_plugin.cpp index ee9c3fa0e69..a15e1f14dfd 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Isotropic_remeshing_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Isotropic_remeshing_plugin.cpp @@ -347,8 +347,7 @@ public Q_SLOTS: } // Create dialog box QDialog dialog(mw); - Ui::Isotropic_remeshing_dialog ui - = remeshing_dialog(&dialog, poly_item, selection_item); + initialize_remeshing_dialog(&dialog, poly_item, selection_item); // Get values int i = dialog.exec(); @@ -357,6 +356,7 @@ public Q_SLOTS: std::cout << "Remeshing aborted" << std::endl; return; } + bool edges_only = ui.splitEdgesOnly_checkbox->isChecked(); bool preserve_duplicates = ui.preserveDuplicates_checkbox->isChecked(); double target_length = ui.edgeLength_dspinbox->value(); @@ -710,7 +710,7 @@ public Q_SLOTS: if (target_length == 0.)//parameters have not been set yet { QDialog dialog(mw); - Ui::Isotropic_remeshing_dialog ui = remeshing_dialog(&dialog, poly_item); + initialize_remeshing_dialog(&dialog, poly_item); ui.objectName->setText(QString::number(scene->selectionIndices().size()) .append(QString(" items to be remeshed"))); int i = dialog.exec(); @@ -937,32 +937,73 @@ private: }; #endif - Ui::Isotropic_remeshing_dialog - remeshing_dialog(QDialog* dialog, - Scene_facegraph_item* poly_item, - Scene_polyhedron_selection_item* selection_item = nullptr) +public Q_SLOTS: + void update_after_protect_checkbox_click() + { + if(ui.protect_checkbox->isChecked()) + { + ui.smooth1D_label->setEnabled(false); + ui.smooth1D_checkbox->setEnabled(false); + ui.smooth1D_checkbox->setChecked(false); + } + else + { + ui.smooth1D_label->setEnabled(true); + ui.smooth1D_checkbox->setEnabled(true); + } + } + + void update_after_splitEdgesOnly_click() + { + if(ui.splitEdgesOnly_checkbox->isChecked()) + { + ui.nbIterations_label->setEnabled(false); + ui.nbIterations_spinbox->setEnabled(false); + ui.nbSmoothing_label->setEnabled(false); + ui.nbSmoothing_spinbox->setEnabled(false); + + ui.protect_label->setEnabled(false); + ui.protect_checkbox->setEnabled(false); + ui.protect_checkbox->setChecked(false); + + ui.smooth1D_label->setEnabled(false); + ui.smooth1D_checkbox->setEnabled(false); + ui.smooth1D_checkbox->setChecked(false); + } + else + { + ui.nbIterations_label->setEnabled(true); + ui.nbIterations_spinbox->setEnabled(true); + ui.nbSmoothing_label->setEnabled(true); + ui.nbSmoothing_spinbox->setEnabled(true); + + ui.protect_label->setEnabled(true); + ui.protect_checkbox->setEnabled(true); + + ui.smooth1D_label->setEnabled(true); + ui.smooth1D_checkbox->setEnabled(true); + } + } + +public: + void + initialize_remeshing_dialog(QDialog* dialog, + Scene_facegraph_item* poly_item, + Scene_polyhedron_selection_item* selection_item = nullptr) { - Ui::Isotropic_remeshing_dialog ui; ui.setupUi(dialog); connect(ui.buttonBox, SIGNAL(accepted()), dialog, SLOT(accept())); connect(ui.buttonBox, SIGNAL(rejected()), dialog, SLOT(reject())); //connect checkbox to spinbox - connect(ui.splitEdgesOnly_checkbox, SIGNAL(toggled(bool)), - ui.nbIterations_spinbox, SLOT(setDisabled(bool))); - connect(ui.splitEdgesOnly_checkbox, SIGNAL(toggled(bool)), - ui.protect_checkbox, SLOT(setDisabled(bool))); - connect(ui.splitEdgesOnly_checkbox, SIGNAL(toggled(bool)), - ui.smooth1D_checkbox, SLOT(setDisabled(bool))); - connect(ui.splitEdgesOnly_checkbox, SIGNAL(toggled(bool)), - ui.nbSmoothing_spinbox, SLOT(setDisabled(bool))); - connect(ui.protect_checkbox, SIGNAL(toggled(bool)), - ui.smooth1D_checkbox, SLOT(setDisabled(bool))); connect(ui.preserveDuplicates_checkbox, SIGNAL(toggled(bool)), ui.protect_checkbox, SLOT(setChecked(bool))); connect(ui.preserveDuplicates_checkbox, SIGNAL(toggled(bool)), ui.protect_checkbox, SLOT(setDisabled(bool))); + connect(ui.protect_checkbox, SIGNAL(clicked(bool)), this, SLOT(update_after_protect_checkbox_click())); + connect(ui.splitEdgesOnly_checkbox, SIGNAL(clicked(bool)), this, SLOT(update_after_splitEdgesOnly_click())); + //Set default parameters Scene_interface::Bbox bbox = poly_item != nullptr ? poly_item->bbox() : (selection_item != nullptr ? selection_item->bbox() @@ -1003,14 +1044,12 @@ private: ui.preserveDuplicates_checkbox->setDisabled(true); ui.preserveDuplicates_checkbox->setChecked(false); } - - return ui; } private: QAction* actionIsotropicRemeshing_; - + Ui::Isotropic_remeshing_dialog ui; }; // end Polyhedron_demo_isotropic_remeshing_plugin #include "Isotropic_remeshing_plugin.moc" diff --git a/Polyhedron/demo/Polyhedron/Plugins/Point_set/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/Point_set/CMakeLists.txt index 0c562c8a6f2..1955755b2db 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Point_set/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/Point_set/CMakeLists.txt @@ -1,13 +1,12 @@ include(polyhedron_demo_macros) -if(TARGET CGAL::Eigen3_support) +if(TARGET CGAL::Eigen3_support) find_package(SCIP QUIET) set_package_properties( SCIP PROPERTIES - DESCRIPTION "A solver." - PURPOSE - "Can be used as a solver in the surface_reconstruction_plugin plugin.") + DESCRIPTION "A solver for mixed integer programming." + PURPOSE "Can be used as a solver in the surface_reconstruction_plugin plugin.") include(CGAL_SCIP_support) if(NOT TARGET CGAL::SCIP_support) @@ -16,17 +15,13 @@ if(TARGET CGAL::Eigen3_support) set_package_properties( GLPK PROPERTIES DESCRIPTION "An alternative for SCIP." - PURPOSE - "Can be used as a solver in the surface_reconstruction_plugin plugin.") + PURPOSE "Can be used as a solver in the surface_reconstruction_plugin plugin.") include(CGAL_GLPK_support) endif() if(NOT TARGET CGAL::SCIP_support AND NOT TARGET CGAL::GLPK_support) - message( - STATUS - "NOTICE: SCIP and GLPK were not found. Polygonal surface reconstruction will not be available." - ) + message(STATUS "NOTICE: SCIP and GLPK were not found. Polygonal surface reconstruction will not be available.") endif() qt5_wrap_ui(surface_reconstructionUI_FILES Surface_reconstruction_plugin.ui) @@ -46,11 +41,9 @@ if(TARGET CGAL::Eigen3_support) scene_points_with_normal_item CGAL::Eigen3_support) if(TARGET CGAL::SCIP_support) - target_link_libraries(surface_reconstruction_plugin - PUBLIC CGAL::SCIP_support) + target_link_libraries(surface_reconstruction_plugin PUBLIC CGAL::SCIP_support) elseif(TARGET CGAL::GLPK_support) - target_link_libraries(surface_reconstruction_plugin - PUBLIC CGAL::GLPK_support) + target_link_libraries(surface_reconstruction_plugin PUBLIC CGAL::GLPK_support) endif() qt5_wrap_ui(point_set_normal_estimationUI_FILES @@ -120,33 +113,14 @@ if(TARGET CGAL::Eigen3_support) PUBLIC CGAL::pointmatcher_support) endif() else() - message( - STATUS - "NOTICE: OpenGR and libpointmatcher were not found. Registration plugin will not be available." - ) + message(STATUS "NOTICE: OpenGR and libpointmatcher were not found. Registration plugin will not be available.") endif() - -else(EIGEN3_FOUND) - message( - STATUS - "NOTICE: Eigen 3.1 (or greater) was not found. Surface reconstruction plugin will not be available." - ) - message( - STATUS - "NOTICE: Eigen 3.1 (or greater) was not found. Normal estimation plugins will not be available." - ) - message( - STATUS - "NOTICE: Eigen 3.1 (or greater) was not found. Smoothing plugin will not be available." - ) - message( - STATUS - "NOTICE: Eigen 3.1 (or greater) was not found. Average spacing plugin will not be available." - ) - message( - STATUS - "NOTICE: Eigen 3.1 (or greater) was not found. Feature detection plugin will not be available." - ) +else() + message(STATUS "NOTICE: Eigen 3.1 (or greater) was not found. Surface reconstruction plugin will not be available.") + message(STATUS "NOTICE: Eigen 3.1 (or greater) was not found. Normal estimation plugins will not be available.") + message(STATUS "NOTICE: Eigen 3.1 (or greater) was not found. Smoothing plugin will not be available.") + message(STATUS "NOTICE: Eigen 3.1 (or greater) was not found. Average spacing plugin will not be available.") + message(STATUS "NOTICE: Eigen 3.1 (or greater) was not found. Feature detection plugin will not be available.") endif() qt5_wrap_ui(point_set_bilateral_smoothingUI_FILES diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/CMakeLists.txt index 682998322e0..4e553fbde16 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/CMakeLists.txt @@ -23,10 +23,7 @@ if(NOT CGAL_DISABLE_GMP) endif() else() - message( - STATUS - "NOTICE: Eigen 3.1 (or greater) was not found. The Parameterization plugin will not be available." - ) + message(STATUS "NOTICE: Eigen 3.1 (or greater) was not found. The Parameterization plugin will not be available.") endif() qt5_wrap_ui(segmentationUI_FILES Mesh_segmentation_widget.ui) diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/CMakeLists.txt index 0954a8c13c3..876ccbd0f36 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/CMakeLists.txt @@ -1,5 +1,6 @@ include(polyhedron_demo_macros) -if(EIGEN3_FOUND AND "${EIGEN3_VERSION}" VERSION_GREATER "3.1.90") + +if(TARGET CGAL::Eigen3_support AND "${EIGEN3_VERSION}" VERSION_GREATER "3.1.90") polyhedron_demo_plugin(edit_plugin Edit_polyhedron_plugin Deform_mesh.ui) target_link_libraries(edit_plugin PUBLIC scene_surface_mesh_item @@ -12,8 +13,5 @@ if(EIGEN3_FOUND AND "${EIGEN3_VERSION}" VERSION_GREATER "3.1.90") endif() else() - message( - STATUS - "NOTICE: The polyhedron edit plugin require Eigen 3.2 (or higher) and will not be available." - ) + message(STATUS "NOTICE: The polyhedron edit plugin requires Eigen 3.2 (or higher) and will not be available.") endif() diff --git a/Polyhedron/demo/Polyhedron/Plugins/Three_examples/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/Three_examples/CMakeLists.txt index db5531c9454..a3b77b8e452 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Three_examples/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/Three_examples/CMakeLists.txt @@ -12,10 +12,9 @@ set(CMAKE_AUTOMOC ON) #Find CGAL find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5 ImageIO) # Find Qt5 itself -find_package( - Qt5 QUIET - COMPONENTS OpenGL Script Svg - OPTIONAL_COMPONENTS ScriptTools WebSockets) +find_package(Qt5 QUIET + COMPONENTS OpenGL Script Svg + OPTIONAL_COMPONENTS ScriptTools WebSockets) if(RUNNING_CGAL_AUTO_TEST OR CGAL_TEST_SUITE) if(Qt5_FOUND) diff --git a/Polyhedron/demo/Polyhedron/implicit_functions/CMakeLists.txt b/Polyhedron/demo/Polyhedron/implicit_functions/CMakeLists.txt index f11de800034..98faad76be3 100644 --- a/Polyhedron/demo/Polyhedron/implicit_functions/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/implicit_functions/CMakeLists.txt @@ -59,9 +59,6 @@ else(CGAL_Qt5_FOUND AND Qt5_FOUND) set(MESH_3_MISSING_DEPS "Qt5, ${MESH_3_MISSING_DEPS}") endif() - message( - STATUS - "NOTICE: This demo requires ${MESH_3_MISSING_DEPS}and will not be compiled." - ) + message("NOTICE: This demo requires ${MESH_3_MISSING_DEPS} and will not be compiled.") endif(CGAL_Qt5_FOUND AND Qt5_FOUND) diff --git a/Polyline_simplification_2/demo/Polyline_simplification_2/CMakeLists.txt b/Polyline_simplification_2/demo/Polyline_simplification_2/CMakeLists.txt index d920d36fcc7..002fd913902 100644 --- a/Polyline_simplification_2/demo/Polyline_simplification_2/CMakeLists.txt +++ b/Polyline_simplification_2/demo/Polyline_simplification_2/CMakeLists.txt @@ -48,7 +48,6 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND) else() - message( - STATUS "NOTICE: This demo requires CGAL and Qt5, and will not be compiled.") + message("NOTICE: This demo requires CGAL and Qt5, and will not be compiled.") endif() diff --git a/Polyline_simplification_2/test/Polyline_simplification_2/CMakeLists.txt b/Polyline_simplification_2/test/Polyline_simplification_2/CMakeLists.txt index 4be14be6b2a..954afd626ab 100644 --- a/Polyline_simplification_2/test/Polyline_simplification_2/CMakeLists.txt +++ b/Polyline_simplification_2/test/Polyline_simplification_2/CMakeLists.txt @@ -7,26 +7,6 @@ project(Polyline_simplification_2_Tests) # CGAL and its components find_package(CGAL REQUIRED) -# Boost and its components -find_package(Boost) - -if(NOT Boost_FOUND) - - message( - STATUS "This project requires the Boost library, and will not be compiled.") - - return() - -endif() - -# include for local directory - -# include for local package - -# Creating entries for all .cpp/.C files with "main" routine -# ########################################################## - create_single_source_cgal_program( "issue-5774.cpp" ) create_single_source_cgal_program( "simplify_polygon_test.cpp" ) - create_single_source_cgal_program( "simplify_polyline_with_duplicate_points.cpp" ) diff --git a/Principal_component_analysis/demo/Principal_component_analysis/CMakeLists.txt b/Principal_component_analysis/demo/Principal_component_analysis/CMakeLists.txt index d1ee8325335..6ec0024f3a5 100644 --- a/Principal_component_analysis/demo/Principal_component_analysis/CMakeLists.txt +++ b/Principal_component_analysis/demo/Principal_component_analysis/CMakeLists.txt @@ -17,13 +17,10 @@ include_directories(./) # Find CGAL and CGAL Qt5 find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) -find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) +find_package(Eigen3 3.1.0 QUIET) #(requires 3.1.0 or greater) include(CGAL_Eigen3_support) if(NOT TARGET CGAL::Eigen3_support) - message( - STATUS - "NOTICE: This project requires the Eigen library, and will not be compiled." - ) + message("NOTICE: This project requires the Eigen library, and will not be compiled.") return() endif() @@ -73,9 +70,6 @@ else(CGAL_Qt5_FOUND AND Qt5_FOUND) set(PCA_MISSING_DEPS "Qt5, ${PCA_MISSING_DEPS}") endif() - message( - STATUS - "NOTICE: This demo requires ${PCA_MISSING_DEPS} and will not be compiled." - ) + message("NOTICE: This demo requires ${PCA_MISSING_DEPS} and will not be compiled.") endif(CGAL_Qt5_FOUND AND Qt5_FOUND) diff --git a/Principal_component_analysis/examples/Principal_component_analysis/CMakeLists.txt b/Principal_component_analysis/examples/Principal_component_analysis/CMakeLists.txt index 01bbb5c99af..5eaeeee35a3 100644 --- a/Principal_component_analysis/examples/Principal_component_analysis/CMakeLists.txt +++ b/Principal_component_analysis/examples/Principal_component_analysis/CMakeLists.txt @@ -7,10 +7,10 @@ project(Principal_component_analysis_Examples) find_package(CGAL REQUIRED) # Use Eigen -find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) +find_package(Eigen3 3.1.0 QUIET) #(requires 3.1.0 or greater) include(CGAL_Eigen3_support) if(NOT TARGET CGAL::Eigen3_support) - message(STATUS "NOTICE: This project requires Eigen 3.1 (or greater) and will not be compiled.") + message("NOTICE: This project requires Eigen 3.1 (or greater), and will not be compiled.") return() endif() diff --git a/Principal_component_analysis/test/Principal_component_analysis/CMakeLists.txt b/Principal_component_analysis/test/Principal_component_analysis/CMakeLists.txt index a4ea754853f..8a4078ffd37 100644 --- a/Principal_component_analysis/test/Principal_component_analysis/CMakeLists.txt +++ b/Principal_component_analysis/test/Principal_component_analysis/CMakeLists.txt @@ -7,10 +7,10 @@ project(Principal_component_analysis_Tests) find_package(CGAL REQUIRED) # Use Eigen -find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) +find_package(Eigen3 3.1.0 QUIET) #(requires 3.1.0 or greater) include(CGAL_Eigen3_support) if(NOT TARGET CGAL::Eigen3_support) - message(STATUS "NOTICE: This project requires Eigen 3.1 (or greater) and will not be compiled.") + message("NOTICE: This project requires Eigen 3.1 (or greater), and will not be compiled.") return() endif() diff --git a/Property_map/examples/Property_map/CMakeLists.txt b/Property_map/examples/Property_map/CMakeLists.txt index b33ebc34768..4cc28458f81 100644 --- a/Property_map/examples/Property_map/CMakeLists.txt +++ b/Property_map/examples/Property_map/CMakeLists.txt @@ -4,28 +4,13 @@ project(Property_map_Examples) # CGAL and its components find_package(CGAL REQUIRED) -# Boost and its components -find_package(Boost REQUIRED) - -if(NOT Boost_FOUND) - - message( - STATUS "This project requires the Boost library, and will not be compiled.") - - return() - -endif() - -# include for local directory - -# Creating entries for all C++ files with "main" routine -# ########################################################## - create_single_source_cgal_program("dynamic_properties.cpp") -find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) +find_package(Eigen3 3.1.0 QUIET) #(requires 3.1.0 or greater) include(CGAL_Eigen3_support) if(TARGET CGAL::Eigen3_support) create_single_source_cgal_program("custom_property_map.cpp") target_link_libraries(custom_property_map PUBLIC CGAL::Eigen3_support) +else() + message(STATUS "NOTICE: The example 'custom_property_map' requires Eigen 3.1 (or greater), and will not be compiled.") endif() diff --git a/Property_map/test/Property_map/CMakeLists.txt b/Property_map/test/Property_map/CMakeLists.txt index fe00b2bf83a..b0480bfa209 100644 --- a/Property_map/test/Property_map/CMakeLists.txt +++ b/Property_map/test/Property_map/CMakeLists.txt @@ -4,42 +4,18 @@ project(Property_map_Tests) # CGAL and its components find_package(CGAL REQUIRED) -# Boost and its components -find_package(Boost REQUIRED) - -if(NOT Boost_FOUND) - - message( - STATUS "This project requires the Boost library, and will not be compiled.") - - return() - -endif() - -find_package(OpenMesh QUIET) - -if(OpenMesh_FOUND) - include(UseOpenMesh) - add_definitions(-DCGAL_USE_OPENMESH) -else() - message(STATUS "Examples that use OpenMesh will not be compiled.") -endif() - -# include for local directory - -# include for local package - -# Creating entries for all C++ files with "main" routine -# ########################################################## - create_single_source_cgal_program("test_property_map.cpp") - create_single_source_cgal_program("dynamic_property_map.cpp") - create_single_source_cgal_program("dynamic_properties_test.cpp") - create_single_source_cgal_program("kernel_converter_properties_test.cpp") +find_package(OpenMesh QUIET) if(OpenMesh_FOUND) + message(STATUS "Found OpenMesh") + include(UseOpenMesh) + target_link_libraries(dynamic_properties_test PRIVATE ${OPENMESH_LIBRARIES}) + target_compile_definitions(dynamic_properties_test PRIVATE -DCGAL_USE_OPENMESH) +else() + message(STATUS "NOTICE: Tests will not use OpenMesh.") endif() diff --git a/Ridges_3/examples/Ridges_3/CMakeLists.txt b/Ridges_3/examples/Ridges_3/CMakeLists.txt index 707e5835f9d..fa1c4c35ff6 100644 --- a/Ridges_3/examples/Ridges_3/CMakeLists.txt +++ b/Ridges_3/examples/Ridges_3/CMakeLists.txt @@ -4,14 +4,12 @@ project(Ridges_3_Examples) find_package(CGAL REQUIRED) -# use either Eigen -find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) +find_package(Eigen3 3.1.0 QUIET) #(requires 3.1.0 or greater) include(CGAL_Eigen3_support) if(TARGET CGAL::Eigen3_support) # Link with Boost.ProgramOptions (optional) - find_package(Boost QUIET COMPONENTS program_options) - + find_package(Boost COMPONENTS program_options) if(Boost_PROGRAM_OPTIONS_FOUND) create_single_source_cgal_program(Compute_Ridges_Umbilics.cpp) target_link_libraries(Compute_Ridges_Umbilics PUBLIC CGAL::Eigen3_support) @@ -19,6 +17,7 @@ if(TARGET CGAL::Eigen3_support) target_link_libraries(Ridges_Umbilics_SM PUBLIC CGAL::Eigen3_support) create_single_source_cgal_program(Ridges_Umbilics_LCC.cpp) target_link_libraries(Ridges_Umbilics_LCC PUBLIC CGAL::Eigen3_support) + add_definitions("-DCGAL_USE_BOOST_PROGRAM_OPTIONS") if(TARGET Boost::program_options) target_link_libraries(Compute_Ridges_Umbilics PRIVATE Boost::program_options) @@ -30,14 +29,8 @@ if(TARGET CGAL::Eigen3_support) target_link_libraries(Ridges_Umbilics_LCC PRIVATE ${Boost_PROGRAM_OPTIONS_LIBRARY}) endif() else() - message( - STATUS - "NOTICE: This programs require Boost Program Options and will not be compiled." - ) + message("NOTICE: This project requires Boost Program Options and will not be compiled.") endif() else() - message( - STATUS - "NOTICE: This program requires Eigen 3.1 (or greater) and will not be compiled." - ) + message("NOTICE: This project requires Eigen 3.1 (or greater), and will not be compiled.") endif() diff --git a/Ridges_3/test/Ridges_3/CMakeLists.txt b/Ridges_3/test/Ridges_3/CMakeLists.txt index ae33dbe2534..f47bdeca10a 100644 --- a/Ridges_3/test/Ridges_3/CMakeLists.txt +++ b/Ridges_3/test/Ridges_3/CMakeLists.txt @@ -6,17 +6,11 @@ project(Ridges_3_Tests) find_package(CGAL REQUIRED) -# use either Eigen -find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) +find_package(Eigen3 3.1.0 QUIET) #(requires 3.1.0 or greater) include(CGAL_Eigen3_support) if(TARGET CGAL::Eigen3_support) create_single_source_cgal_program("ridge_test.cpp") target_link_libraries(ridge_test PUBLIC CGAL::Eigen3_support) else() - - message( - STATUS - "NOTICE: This program requires Eigen 3.1 (or greater) and will not be compiled." - ) - + message("NOTICE: This project requires Eigen 3.1 (or greater), and will not be compiled.") endif() diff --git a/SMDS_3/examples/SMDS_3/CMakeLists.txt b/SMDS_3/examples/SMDS_3/CMakeLists.txt index 54bb8f0ecf1..a1d23ab87ab 100644 --- a/SMDS_3/examples/SMDS_3/CMakeLists.txt +++ b/SMDS_3/examples/SMDS_3/CMakeLists.txt @@ -8,10 +8,5 @@ project(SMDS_3_Examples) # CGAL and its components find_package(CGAL REQUIRED) -# Boost and its components -find_package(Boost REQUIRED) - -# Creating entries for all C++ files with "main" routine -# ########################################################## -create_single_source_cgal_program( "c3t3_example.cpp" ) -create_single_source_cgal_program( "tetrahedron_soup_to_c3t3_example.cpp" ) +create_single_source_cgal_program("c3t3_example.cpp") +create_single_source_cgal_program("tetrahedron_soup_to_c3t3_example.cpp") diff --git a/SMDS_3/test/SMDS_3/CMakeLists.txt b/SMDS_3/test/SMDS_3/CMakeLists.txt index 43cea5fc098..7124b808434 100644 --- a/SMDS_3/test/SMDS_3/CMakeLists.txt +++ b/SMDS_3/test/SMDS_3/CMakeLists.txt @@ -2,29 +2,33 @@ # This is the CMake script for compiling a CGAL application. cmake_minimum_required(VERSION 3.1...3.20) -project( SMDS_3_Tests ) +project(SMDS_3_Tests) find_package(CGAL REQUIRED) -# Use Eigen -find_package(Eigen3 3.1.0 REQUIRED) #(requires 3.1.0 or greater) -include(CGAL_Eigen3_support) - -create_single_source_cgal_program( "test_c3t3.cpp" ) -create_single_source_cgal_program( "test_c3t3_io.cpp" ) -create_single_source_cgal_program( "test_c3t3_with_features.cpp" ) -create_single_source_cgal_program( "test_c3t3_into_facegraph.cpp" ) -create_single_source_cgal_program( "test_c3t3_extract_subdomains_boundaries.cpp" ) -create_single_source_cgal_program( "test_c3t3_io_MEDIT.cpp" ) create_single_source_cgal_program( "test_simplicial_cb_vb.cpp") -foreach(target - test_c3t3 - test_c3t3_io - test_c3t3_with_features - test_c3t3_into_facegraph - test_c3t3_extract_subdomains_boundaries) - if(TARGET ${target}) - target_link_libraries(${target} PUBLIC CGAL::Eigen3_support) - endif() -endforeach() +find_package(Eigen3 3.1.0 QUIET) #(requires 3.1.0 or greater) +include(CGAL_Eigen3_support) +if(TARGET CGAL::Eigen3_support) + create_single_source_cgal_program( "test_c3t3.cpp" ) + create_single_source_cgal_program( "test_c3t3_io.cpp" ) + create_single_source_cgal_program( "test_c3t3_with_features.cpp" ) + create_single_source_cgal_program( "test_c3t3_into_facegraph.cpp" ) + create_single_source_cgal_program( "test_c3t3_extract_subdomains_boundaries.cpp" ) + create_single_source_cgal_program( "test_c3t3_io_MEDIT.cpp" ) + + foreach(target + test_c3t3 + test_c3t3_io + test_c3t3_with_features + test_c3t3_into_facegraph + test_c3t3_extract_subdomains_boundaries + test_c3t3_io_MEDIT) + if(TARGET ${target}) + target_link_libraries(${target} PUBLIC CGAL::Eigen3_support) + endif() + endforeach() +else() + message(STATUS "NOTICE: Some tests require Eigen 3.1 (or greater), and will not be compiled.") +endif() diff --git a/STL_Extension/benchmark/compact_container_benchmark/CMakeLists.txt b/STL_Extension/benchmark/compact_container_benchmark/CMakeLists.txt index 29f55d23097..4771b63fe10 100644 --- a/STL_Extension/benchmark/compact_container_benchmark/CMakeLists.txt +++ b/STL_Extension/benchmark/compact_container_benchmark/CMakeLists.txt @@ -3,9 +3,12 @@ project(Compact_container_benchmark) find_package(CGAL REQUIRED) -find_package(TBB) +find_package(TBB QUIET) include(CGAL_TBB_support) + create_single_source_cgal_program("cc_benchmark.cpp") + if(TARGET CGAL::TBB_support) + message(STATUS "Found TBB") target_link_libraries(cc_benchmark PUBLIC CGAL::TBB_support) endif() diff --git a/STL_Extension/benchmark/copy_n_benchmark/CMakeLists.txt b/STL_Extension/benchmark/copy_n_benchmark/CMakeLists.txt index 34e2b2e9691..f84da4862f9 100644 --- a/STL_Extension/benchmark/copy_n_benchmark/CMakeLists.txt +++ b/STL_Extension/benchmark/copy_n_benchmark/CMakeLists.txt @@ -6,8 +6,5 @@ project(copy_n_benchmark_example) find_package(CGAL REQUIRED COMPONENTS Core) -include(${CGAL_USE_FILE}) - create_single_source_cgal_program("copy_n_benchmark.cpp") - create_single_source_cgal_program("copy_n_use_case_benchmark.cpp") diff --git a/STL_Extension/include/CGAL/Base_with_time_stamp.h b/STL_Extension/include/CGAL/Base_with_time_stamp.h new file mode 100644 index 00000000000..cbed66de81f --- /dev/null +++ b/STL_Extension/include/CGAL/Base_with_time_stamp.h @@ -0,0 +1,41 @@ +// Copyright (c) 2023 GeometryFactory Sarl (France). +// All rights reserved. +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// +// Author(s) : Laurent Rineau + +#ifndef CGAL_BASE_WITH_TIME_STAMP_H +#define CGAL_BASE_WITH_TIME_STAMP_H + +#include // for Tag_true +#include // for std::size_t +#include // for std::forward + +namespace CGAL { + +template +class Base_with_time_stamp : public Base { + std::size_t time_stamp_ = -1; +public: + typedef CGAL::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; + } + + template < class TDS > + struct Rebind_TDS { + typedef typename Base::template Rebind_TDS::Other Base2; + typedef Base_with_time_stamp Other; + }; +}; + +} // namespace CGAL + +#endif // CGAL_BASE_WITH_TIME_STAMP_H diff --git a/STL_Extension/include/CGAL/Compact_container.h b/STL_Extension/include/CGAL/Compact_container.h index b8c1cb0769c..24f7ef91c72 100644 --- a/STL_Extension/include/CGAL/Compact_container.h +++ b/STL_Extension/include/CGAL/Compact_container.h @@ -33,6 +33,7 @@ #include #include #include +#include #include @@ -1153,6 +1154,20 @@ namespace handle { } // namespace internal +template +class Output_rep > { +protected: + using CC_iterator = CGAL::internal::CC_iterator; + using Compact_container = typename CC_iterator::CC; + using Time_stamper = typename Compact_container::Time_stamper; + CC_iterator it; +public: + Output_rep( const CC_iterator it) : it(it) {} + std::ostream& operator()( std::ostream& out) const { + return (out << Time_stamper::display_id(it.operator->())); + } +}; + } //namespace CGAL namespace std { diff --git a/STL_Extension/include/CGAL/Time_stamper.h b/STL_Extension/include/CGAL/Time_stamper.h index 8d346516a27..f48f5307ef0 100644 --- a/STL_Extension/include/CGAL/Time_stamper.h +++ b/STL_Extension/include/CGAL/Time_stamper.h @@ -13,6 +13,7 @@ #define CGAL_TIME_STAMPER_H #include +#include namespace CGAL { @@ -66,6 +67,11 @@ struct Time_stamper return pt->time_stamp(); } + static auto display_id(const T* pt) + { + return std::string("#") + std::to_string(pt->time_stamp()); + } + static std::size_t hash_value(const T* p) { if(nullptr == p) return std::size_t(-1); @@ -101,6 +107,11 @@ public: return 0; } + static auto display_id(const T* pt) + { + return static_cast(pt); + } + static std::size_t hash_value(const T* p) { constexpr std::size_t shift = internal::rounded_down_log2(sizeof(T)); diff --git a/STL_Extension/test/STL_Extension/CMakeLists.txt b/STL_Extension/test/STL_Extension/CMakeLists.txt index 2eba3848727..d2590609109 100644 --- a/STL_Extension/test/STL_Extension/CMakeLists.txt +++ b/STL_Extension/test/STL_Extension/CMakeLists.txt @@ -2,66 +2,66 @@ # This is the CMake script for compiling a CGAL application. cmake_minimum_required(VERSION 3.1...3.23) -project( STL_Extension_Tests ) - +project(STL_Extension_Tests) find_package(CGAL REQUIRED) -find_package( TBB QUIET ) + +find_package(TBB QUIET) include(CGAL_TBB_support) - -find_package(OpenMesh QUIET) - -if(OpenMesh_FOUND) - include(UseOpenMesh) - add_definitions(-DCGAL_USE_OPENMESH) -else() - message(STATUS "Tests that use OpenMesh will not be compiled.") +if(NOT TARGET CGAL::TBB_support) + message(STATUS "NOTICE: Tests are not using TBB.") endif() - -create_single_source_cgal_program( "test_Boolean_tag.cpp" ) -create_single_source_cgal_program( "test_Cache.cpp" ) -create_single_source_cgal_program( "test_Compact_container.cpp" ) -create_single_source_cgal_program( "test_Compact_container_is_used.cpp" ) -create_single_source_cgal_program( "test_complexity_tags.cpp" ) -create_single_source_cgal_program( "test_composition.cpp" ) -create_single_source_cgal_program( "test_Concatenate_iterator.cpp" ) -create_single_source_cgal_program( "test_Concurrent_compact_container.cpp" ) +create_single_source_cgal_program("test_Boolean_tag.cpp") +create_single_source_cgal_program("test_Cache.cpp") +create_single_source_cgal_program("test_Compact_container.cpp") +create_single_source_cgal_program("test_Compact_container_is_used.cpp") +create_single_source_cgal_program("test_complexity_tags.cpp") +create_single_source_cgal_program("test_composition.cpp") +create_single_source_cgal_program("test_Concatenate_iterator.cpp") +create_single_source_cgal_program("test_Concurrent_compact_container.cpp") if(TARGET CGAL::TBB_support) target_link_libraries(test_Concurrent_compact_container PUBLIC CGAL::TBB_support) endif() -create_single_source_cgal_program( "test_dispatch_output.cpp" ) -create_single_source_cgal_program( "test_Flattening_iterator.cpp" ) -create_single_source_cgal_program( "test_Handle_with_policy.cpp" ) -create_single_source_cgal_program( "test_In_place_list.cpp" ) -create_single_source_cgal_program( "test_is_iterator.cpp" ) -create_single_source_cgal_program( "test_is_streamable.cpp" ) -create_single_source_cgal_program( "test_lexcompare_outputrange.cpp" ) -create_single_source_cgal_program( "test_Modifiable_priority_queue.cpp" ) -create_single_source_cgal_program( "test_multiset.cpp" ) +create_single_source_cgal_program("test_dispatch_output.cpp") +create_single_source_cgal_program("test_Flattening_iterator.cpp") +create_single_source_cgal_program("test_Handle_with_policy.cpp") +create_single_source_cgal_program("test_In_place_list.cpp") +create_single_source_cgal_program("test_is_iterator.cpp") +create_single_source_cgal_program("test_is_streamable.cpp") +create_single_source_cgal_program("test_lexcompare_outputrange.cpp") +create_single_source_cgal_program("test_Modifiable_priority_queue.cpp") +create_single_source_cgal_program("test_multiset.cpp") create_single_source_cgal_program("test_cgal_named_params.cpp") -add_executable( test_multiset_cc "test_multiset.cpp" ) -target_link_libraries( test_multiset_cc PUBLIC CGAL::CGAL ) -target_compile_options( test_multiset_cc PUBLIC -DCGAL_MULTISET_USE_COMPACT_CONTAINER_AS_DEFAULT ) -cgal_add_test(test_multiset_cc ) +add_executable(test_multiset_cc "test_multiset.cpp") +target_link_libraries(test_multiset_cc PUBLIC CGAL::CGAL) +target_compile_options(test_multiset_cc PUBLIC -DCGAL_MULTISET_USE_COMPACT_CONTAINER_AS_DEFAULT) +cgal_add_test(test_multiset_cc) add_to_cached_list(CGAL_EXECUTABLE_TARGETS test_multiset_cc) -create_single_source_cgal_program( "test_N_tuple.cpp" ) -create_single_source_cgal_program( "test_namespaces.cpp" ) -create_single_source_cgal_program( "test_Nested_iterator.cpp" ) -create_single_source_cgal_program( "test_Object.cpp" ) -create_single_source_cgal_program( "test_stl_extension.cpp" ) -create_single_source_cgal_program( "test_type_traits.cpp" ) -create_single_source_cgal_program( "test_Uncertain.cpp" ) -create_single_source_cgal_program( "test_vector.cpp" ) -create_single_source_cgal_program( "test_join_iterators.cpp" ) -create_single_source_cgal_program( "test_for_each.cpp" ) +create_single_source_cgal_program("test_N_tuple.cpp") +create_single_source_cgal_program("test_namespaces.cpp") +create_single_source_cgal_program("test_Nested_iterator.cpp") +create_single_source_cgal_program("test_Object.cpp") +create_single_source_cgal_program("test_stl_extension.cpp") +create_single_source_cgal_program("test_type_traits.cpp") +create_single_source_cgal_program("test_Uncertain.cpp") +create_single_source_cgal_program("test_vector.cpp") +create_single_source_cgal_program("test_join_iterators.cpp") +create_single_source_cgal_program("test_for_each.cpp") if(TARGET CGAL::TBB_support) + message(STATUS "Found TBB") target_link_libraries(test_for_each PUBLIC CGAL::TBB_support) endif() +find_package(OpenMesh QUIET) if(OpenMesh_FOUND) + message(STATUS "Found OpenMesh") + include(UseOpenMesh) + create_single_source_cgal_program("test_hash_OpenMesh.cpp") target_link_libraries(test_hash_OpenMesh PRIVATE ${OPENMESH_LIBRARIES}) +else() + message(STATUS "NOTICE: Tests that use OpenMesh will not be compiled.") endif() diff --git a/Scale_space_reconstruction_3/examples/Scale_space_reconstruction_3/CMakeLists.txt b/Scale_space_reconstruction_3/examples/Scale_space_reconstruction_3/CMakeLists.txt index 4c1714d2ace..8a7397b76d3 100644 --- a/Scale_space_reconstruction_3/examples/Scale_space_reconstruction_3/CMakeLists.txt +++ b/Scale_space_reconstruction_3/examples/Scale_space_reconstruction_3/CMakeLists.txt @@ -7,16 +7,14 @@ find_package(CGAL REQUIRED) option(ACTIVATE_CONCURRENCY "Enable concurrency" ON) if(ACTIVATE_CONCURRENCY) - find_package(TBB) + find_package(TBB QUIET) include(CGAL_TBB_support) if(NOT TARGET CGAL::TBB_support) - message( - STATUS - "NOTICE: Intel TBB NOT found! The example is faster if TBB is linked.") + message(STATUS "NOTICE: Intel TBB not found. Examples are faster if TBB is linked.") endif() endif() -find_package(Eigen3 3.1.0) +find_package(Eigen3 3.1.0 QUIET) include(CGAL_Eigen3_support) if(TARGET CGAL::Eigen3_support) create_single_source_cgal_program("scale_space.cpp") @@ -27,15 +25,15 @@ if(TARGET CGAL::Eigen3_support) target_link_libraries(scale_space_manifold PUBLIC CGAL::Eigen3_support) create_single_source_cgal_program("scale_space_advancing_front.cpp") target_link_libraries(scale_space_advancing_front PUBLIC CGAL::Eigen3_support) + if(ACTIVATE_CONCURRENCY AND TARGET CGAL::TBB_support) + message(STATUS "Found TBB") + target_link_libraries(scale_space PUBLIC CGAL::TBB_support) target_link_libraries(scale_space_incremental PUBLIC CGAL::TBB_support) target_link_libraries(scale_space_manifold PUBLIC CGAL::TBB_support) target_link_libraries(scale_space_advancing_front PUBLIC CGAL::TBB_support) endif() else() - message( - STATUS - "NOTICE: The example needs Eigen 3.1 (or greater) and will not be compiled." - ) + message("NOTICE: Examples require Eigen 3.1 (or greater), and will not be compiled.") endif() diff --git a/Segment_Delaunay_graph_2/benchmark/Segment_Delaunay_graph_2/CMakeLists.txt b/Segment_Delaunay_graph_2/benchmark/Segment_Delaunay_graph_2/CMakeLists.txt index 016a4545fc0..c46aa5c84de 100644 --- a/Segment_Delaunay_graph_2/benchmark/Segment_Delaunay_graph_2/CMakeLists.txt +++ b/Segment_Delaunay_graph_2/benchmark/Segment_Delaunay_graph_2/CMakeLists.txt @@ -6,8 +6,6 @@ project(Segment_Delaunay_graph_2_example) find_package(CGAL REQUIRED COMPONENTS Core) -include(${CGAL_USE_FILE}) - create_single_source_cgal_program("benchmark.cpp") create_single_source_cgal_program("benchmark_nox.cpp") create_single_source_cgal_program("double.cpp") diff --git a/Segment_Delaunay_graph_Linf_2/benchmark/Segment_Delaunay_graph_Linf_2/CMakeLists.txt b/Segment_Delaunay_graph_Linf_2/benchmark/Segment_Delaunay_graph_Linf_2/CMakeLists.txt index 4d6aa5dae0a..806bec1f95d 100644 --- a/Segment_Delaunay_graph_Linf_2/benchmark/Segment_Delaunay_graph_Linf_2/CMakeLists.txt +++ b/Segment_Delaunay_graph_Linf_2/benchmark/Segment_Delaunay_graph_Linf_2/CMakeLists.txt @@ -6,8 +6,6 @@ project(Segment_Delaunay_graph_2_example) find_package(CGAL REQUIRED COMPONENTS Core) -include(${CGAL_USE_FILE}) - create_single_source_cgal_program("sdg-creation-time.cpp") create_single_source_cgal_program("benchmark-gen.cpp") create_single_source_cgal_program("incirc.cpp") diff --git a/Set_movable_separability_2/examples/Set_movable_separability_2/CMakeLists.txt b/Set_movable_separability_2/examples/Set_movable_separability_2/CMakeLists.txt index a679f950cba..5f5008878f6 100644 --- a/Set_movable_separability_2/examples/Set_movable_separability_2/CMakeLists.txt +++ b/Set_movable_separability_2/examples/Set_movable_separability_2/CMakeLists.txt @@ -4,20 +4,8 @@ cmake_minimum_required(VERSION 3.1...3.23) project(Set_movable_separability_2_Examples) -list(FIND CMAKE_CXX_COMPILE_FEATURES cxx_generalized_initializers has_cpp11) -if(has_cpp11 LESS 0) - message( - STATUS - "NOTICE: These examples requires a C++11 compiler and will not be compiled." - ) - return() -endif() - - find_package(CGAL REQUIRED) create_single_source_cgal_program("top_edges_single_mold_trans_cast.cpp") -create_single_source_cgal_program( - "is_pullout_direction_single_mold_trans_cast.cpp") -create_single_source_cgal_program( - "pullout_directions_single_mold_trans_cast.cpp") +create_single_source_cgal_program("is_pullout_direction_single_mold_trans_cast.cpp") +create_single_source_cgal_program("pullout_directions_single_mold_trans_cast.cpp") diff --git a/Set_movable_separability_2/test/Set_movable_separability_2/CMakeLists.txt b/Set_movable_separability_2/test/Set_movable_separability_2/CMakeLists.txt index 782b87fd820..b06dec3dfef 100644 --- a/Set_movable_separability_2/test/Set_movable_separability_2/CMakeLists.txt +++ b/Set_movable_separability_2/test/Set_movable_separability_2/CMakeLists.txt @@ -11,18 +11,7 @@ if(CGAL_DIR) # Just to avoid a warning from CMake when that variable is set on the command line... endif() -list(FIND CMAKE_CXX_COMPILE_FEATURES cxx_generalized_initializers has_cpp11) -if(has_cpp11 LESS 0) - message( - STATUS - "NOTICE: These examples requires a C++11 compiler and will not be compiled." - ) - return() -endif() - - find_package(CGAL REQUIRED) create_single_source_cgal_program("test_top_edges_single_mold_trans_cast.cpp") -create_single_source_cgal_program( - "test_is_pullout_directions_single_mold_trans_cast.cpp") +create_single_source_cgal_program("test_is_pullout_directions_single_mold_trans_cast.cpp") diff --git a/Shape_detection/benchmark/Shape_detection/CMakeLists.txt b/Shape_detection/benchmark/Shape_detection/CMakeLists.txt index 8baea2fa532..eb5185726dc 100644 --- a/Shape_detection/benchmark/Shape_detection/CMakeLists.txt +++ b/Shape_detection/benchmark/Shape_detection/CMakeLists.txt @@ -6,23 +6,13 @@ project(Shape_detection_Benchmarks) find_package(CGAL REQUIRED COMPONENTS Core) -include(${CGAL_USE_FILE}) -include(CGAL_CreateSingleSourceCGALProgram) - -# Use Eigen. find_package(Eigen3 3.1.0 QUIET) # (3.1.0 or greater) include(CGAL_Eigen3_support) if(TARGET CGAL::Eigen3_support) - message(STATUS "Found Eigen 3") - - create_single_source_cgal_program( - "benchmark_region_growing_on_point_set_2.cpp") - target_link_libraries( - benchmark_region_growing_on_point_set_2 - PUBLIC CGAL::Eigen3_support) - create_single_source_cgal_program( - "benchmark_region_growing_on_point_set_3.cpp") - target_link_libraries( - benchmark_region_growing_on_point_set_3 - PUBLIC CGAL::Eigen3_support) + create_single_source_cgal_program("benchmark_region_growing_on_point_set_2.cpp") + target_link_libraries(benchmark_region_growing_on_point_set_2 PUBLIC CGAL::Eigen3_support) + create_single_source_cgal_program("benchmark_region_growing_on_point_set_3.cpp") + target_link_libraries(benchmark_region_growing_on_point_set_3 PUBLIC CGAL::Eigen3_support) +else() + message("NOTICE: This project requires Eigen 3.1 (or greater), and will not be compiled.") endif() diff --git a/Shape_detection/examples/Shape_detection/CMakeLists.txt b/Shape_detection/examples/Shape_detection/CMakeLists.txt index 6a4f1049fda..928e332d3cc 100644 --- a/Shape_detection/examples/Shape_detection/CMakeLists.txt +++ b/Shape_detection/examples/Shape_detection/CMakeLists.txt @@ -6,7 +6,10 @@ project(Shape_detection_Examples) find_package(CGAL REQUIRED COMPONENTS Core) -# Use Eigen. +create_single_source_cgal_program("efficient_RANSAC_with_custom_shape.cpp") +create_single_source_cgal_program("efficient_RANSAC_with_parameters.cpp") +create_single_source_cgal_program("efficient_RANSAC_with_point_access.cpp") + find_package(Eigen3 3.1.0 QUIET) # (3.1.0 or greater) include(CGAL_Eigen3_support) if(TARGET CGAL::Eigen3_support) @@ -42,7 +45,3 @@ if(TARGET CGAL::Eigen3_support) target_link_libraries(${target} PUBLIC CGAL::Eigen3_support) endforeach() endif() - -create_single_source_cgal_program("efficient_RANSAC_with_custom_shape.cpp") -create_single_source_cgal_program("efficient_RANSAC_with_parameters.cpp") -create_single_source_cgal_program("efficient_RANSAC_with_point_access.cpp") diff --git a/Shape_detection/test/Shape_detection/CMakeLists.txt b/Shape_detection/test/Shape_detection/CMakeLists.txt index cbf67b762ce..ac4e28e2877 100644 --- a/Shape_detection/test/Shape_detection/CMakeLists.txt +++ b/Shape_detection/test/Shape_detection/CMakeLists.txt @@ -6,11 +6,21 @@ project(Shape_detection_Tests) find_package(CGAL REQUIRED COMPONENTS Core) -# Use Eigen. +create_single_source_cgal_program("test_efficient_RANSAC_cone_connected_component.cpp") +create_single_source_cgal_program("test_efficient_RANSAC_cone_parameters.cpp") +create_single_source_cgal_program("test_efficient_RANSAC_cylinder_connected_component.cpp") +create_single_source_cgal_program("test_efficient_RANSAC_cylinder_parameters.cpp") +create_single_source_cgal_program("test_efficient_RANSAC_plane_connected_component.cpp") +create_single_source_cgal_program("test_efficient_RANSAC_plane_parameters.cpp") +create_single_source_cgal_program("test_efficient_RANSAC_sphere_connected_component.cpp") +create_single_source_cgal_program("test_efficient_RANSAC_sphere_parameters.cpp") +create_single_source_cgal_program("test_efficient_RANSAC_torus_connected_component.cpp") +create_single_source_cgal_program("test_efficient_RANSAC_torus_parameters.cpp") +create_single_source_cgal_program("test_efficient_RANSAC_scene.cpp") + find_package(Eigen3 3.1.0 QUIET) # (3.1.0 or greater) include(CGAL_Eigen3_support) -if(EIGEN3_FOUND) - message(STATUS "Found Eigen 3") +if(TARGET CGAL::Eigen3_support) create_single_source_cgal_program("test_region_growing_basic.cpp") create_single_source_cgal_program("test_region_growing_strict.cpp") @@ -22,6 +32,7 @@ if(EIGEN3_FOUND) create_single_source_cgal_program("test_region_growing_on_point_set_3_with_sorting.cpp") create_single_source_cgal_program("test_region_growing_on_polygon_mesh_with_sorting.cpp") create_single_source_cgal_program("test_region_growing_on_degenerated_mesh.cpp") + foreach( target test_region_growing_basic @@ -38,7 +49,7 @@ if(EIGEN3_FOUND) endforeach() set(RANSAC_PROTO_DIR CACHE PATH "") - if (NOT RANSAC_PROTO_DIR STREQUAL "") + if(NOT RANSAC_PROTO_DIR STREQUAL "") add_definitions(-DPOINTSWITHINDEX -DCGAL_TEST_RANSAC_PROTOTYPE) include_directories(${RANSAC_PROTO_DIR}) include_directories(${RANSAC_PROTO_DIR}/MiscLib/) @@ -52,16 +63,6 @@ if(EIGEN3_FOUND) target_link_libraries(test_validity_sampled_data CGAL::CGAL CGAL::Data CGAL::Eigen3_support) endif() cgal_add_test(test_validity_sampled_data) +else() + message(STATUS "NOTICE: Some tests require Eigen 3.1 (or greater), and will not be compiled.") endif() - -create_single_source_cgal_program("test_efficient_RANSAC_cone_connected_component.cpp") -create_single_source_cgal_program("test_efficient_RANSAC_cone_parameters.cpp") -create_single_source_cgal_program("test_efficient_RANSAC_cylinder_connected_component.cpp") -create_single_source_cgal_program("test_efficient_RANSAC_cylinder_parameters.cpp") -create_single_source_cgal_program("test_efficient_RANSAC_plane_connected_component.cpp") -create_single_source_cgal_program("test_efficient_RANSAC_plane_parameters.cpp") -create_single_source_cgal_program("test_efficient_RANSAC_sphere_connected_component.cpp") -create_single_source_cgal_program("test_efficient_RANSAC_sphere_parameters.cpp") -create_single_source_cgal_program("test_efficient_RANSAC_torus_connected_component.cpp") -create_single_source_cgal_program("test_efficient_RANSAC_torus_parameters.cpp") -create_single_source_cgal_program("test_efficient_RANSAC_scene.cpp") diff --git a/Shape_regularization/benchmark/Shape_regularization/CMakeLists.txt b/Shape_regularization/benchmark/Shape_regularization/CMakeLists.txt index e0c8987322e..06073318cbc 100644 --- a/Shape_regularization/benchmark/Shape_regularization/CMakeLists.txt +++ b/Shape_regularization/benchmark/Shape_regularization/CMakeLists.txt @@ -7,19 +7,13 @@ cmake_minimum_required(VERSION 3.1...3.23) find_package(CGAL REQUIRED COMPONENTS Core) -include(${CGAL_USE_FILE}) -include(CGAL_CreateSingleSourceCGALProgram) - # Find OSQP library and headers. find_package(OSQP QUIET) include(CGAL_OSQP_support) if(TARGET CGAL::OSQP_support) message(STATUS "Found OSQP") - set(osqp_targets - benchmark_contours - benchmark_qp_segments) - + set(osqp_targets benchmark_contours benchmark_qp_segments) foreach(osqp_target ${osqp_targets}) create_single_source_cgal_program("${osqp_target}.cpp") if(TARGET ${osqp_target}) @@ -27,5 +21,5 @@ if(TARGET CGAL::OSQP_support) endif() endforeach() else() - message(NOTICE "OSQP was not found. OSQP benchmarks won't be available.") + message("NOTICE: OSQP was not found. OSQP benchmarks won't be available.") endif() diff --git a/Shape_regularization/examples/Shape_regularization/CMakeLists.txt b/Shape_regularization/examples/Shape_regularization/CMakeLists.txt index 951cf0d3a9f..52206f94312 100644 --- a/Shape_regularization/examples/Shape_regularization/CMakeLists.txt +++ b/Shape_regularization/examples/Shape_regularization/CMakeLists.txt @@ -31,13 +31,14 @@ if(TARGET CGAL::OSQP_support) include(CGAL_Eigen3_support) 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 CGAL::OSQP_support) else() - message(NOTICE "Eigen was not found. Eigen examples won't be available.") + message(STATUS "NOTICE: Eigen was not found. Eigen examples won't be available.") endif() else() - message(NOTICE "OSQP was not found. OSQP examples won't be available.") + message(STATUS "NOTICE: OSQP was not found. OSQP examples won't be available.") endif() create_single_source_cgal_program("regularize_framework.cpp") diff --git a/Shape_regularization/test/Shape_regularization/CMakeLists.txt b/Shape_regularization/test/Shape_regularization/CMakeLists.txt index deb8fea32be..ddaa6f3ea31 100644 --- a/Shape_regularization/test/Shape_regularization/CMakeLists.txt +++ b/Shape_regularization/test/Shape_regularization/CMakeLists.txt @@ -31,7 +31,7 @@ if(TARGET CGAL::OSQP_support) endif() endforeach() else() - message(NOTICE "OSQP was not found. OSQP tests won't be available.") + message(STATUS "NOTICE: OSQP was not found. OSQP tests won't be available.") endif() set(targets diff --git a/Skin_surface_3/examples/Skin_surface_3/CMakeLists.txt b/Skin_surface_3/examples/Skin_surface_3/CMakeLists.txt index 3de1179c2f5..f637565bc51 100644 --- a/Skin_surface_3/examples/Skin_surface_3/CMakeLists.txt +++ b/Skin_surface_3/examples/Skin_surface_3/CMakeLists.txt @@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.1...3.23) project(Skin_surface_3_Examples) -find_package(CGAL) +find_package(CGAL REQUIRED) include_directories(BEFORE include) @@ -20,13 +20,11 @@ create_single_source_cgal_program("skin_surface_subdiv_with_normals.cpp") create_single_source_cgal_program("union_of_balls_simple.cpp") create_single_source_cgal_program("union_of_balls_subdiv.cpp") -find_package(ESBTL) +find_package(ESBTL QUIET) if(ESBTL_FOUND) + message(STATUS "Found ESBTL") include_directories(${ESBTL_INCLUDE_DIR}) create_single_source_cgal_program("skin_surface_pdb_reader.cpp") else(ESBTL_FOUND) - message( - STATUS - "NOTICE: skin_surface_pdb_reader.cpp requires ESBTL library, and will not be compiled." - ) + message(STATUS "NOTICE: skin_surface_pdb_reader.cpp requires ESBTL library, and will not be compiled.") endif(ESBTL_FOUND) diff --git a/Solver_interface/examples/Solver_interface/CMakeLists.txt b/Solver_interface/examples/Solver_interface/CMakeLists.txt index b65e4965bb5..cf7fafadd89 100644 --- a/Solver_interface/examples/Solver_interface/CMakeLists.txt +++ b/Solver_interface/examples/Solver_interface/CMakeLists.txt @@ -7,9 +7,8 @@ project(Solver_interface_Examples) find_package(CGAL REQUIRED) # Use Eigen -find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) +find_package(Eigen3 3.1.0 QUIET) #(requires 3.1.0 or greater) include(CGAL_Eigen3_support) - if(TARGET CGAL::Eigen3_support) create_single_source_cgal_program("singular_value_decomposition.cpp") target_link_libraries(singular_value_decomposition PUBLIC CGAL::Eigen3_support) @@ -17,51 +16,41 @@ if(TARGET CGAL::Eigen3_support) target_link_libraries(sparse_solvers PUBLIC CGAL::Eigen3_support) create_single_source_cgal_program("diagonalize_matrix.cpp") target_link_libraries(diagonalize_matrix PUBLIC CGAL::Eigen3_support) +else() + message(STATUS "NOTICE: Eigen3 was not found. Some examples won't be available.") endif() find_package(OSQP QUIET) include(CGAL_OSQP_support) - if(TARGET CGAL::OSQP_support) + message(STATUS "Found OSQP") create_single_source_cgal_program("osqp_quadratic_program.cpp") target_link_libraries(osqp_quadratic_program PUBLIC CGAL::OSQP_support) - message("OSQP found and used") - + message(STATUS "OSQP found and used") else() - message(STATUS "NOTICE: OSQP was not found. OSQP examples won't be available.") - endif() find_package(SCIP QUIET) include(CGAL_SCIP_support) - if(TARGET CGAL::SCIP_support) + message(STATUS "Found SCIP") create_single_source_cgal_program("mixed_integer_program.cpp") target_link_libraries(mixed_integer_program PUBLIC CGAL::SCIP_support) - message("SCIP found and used") - + message(STATUS "SCIP found and used") else() - find_package(GLPK QUIET) include(CGAL_GLPK_support) - if(TARGET CGAL::GLPK_support) + message(STATUS "Found GLPK") create_single_source_cgal_program("mixed_integer_program.cpp") target_link_libraries(mixed_integer_program PUBLIC CGAL::GLPK_support) - message("GLPK found and used") - + message(STATUS "GLPK found and used") else() - - message( - STATUS - "NOTICE : This project requires either SCIP or GLPK, and will not be compiled. " - "Please provide either 'SCIP_DIR' or 'GLPK_INCLUDE_DIR' and 'GLPK_LIBRARIES'" - ) - + message(STATUS "NOTICE: This project requires either SCIP or GLPK, and will not be compiled. " + "Please provide either 'SCIP_DIR' or 'GLPK_INCLUDE_DIR' and 'GLPK_LIBRARIES'") endif() - endif() diff --git a/Spatial_searching/benchmark/Spatial_searching/CMakeLists.txt b/Spatial_searching/benchmark/Spatial_searching/CMakeLists.txt index 0585028eec8..cc0ac42097f 100644 --- a/Spatial_searching/benchmark/Spatial_searching/CMakeLists.txt +++ b/Spatial_searching/benchmark/Spatial_searching/CMakeLists.txt @@ -6,13 +6,15 @@ project(Spatial_searching_) find_package(CGAL REQUIRED COMPONENTS Core) -include(${CGAL_USE_FILE}) - -find_package(Eigen3 3.1.91) # (requires 3.2.0 or greater) -include(CGAL_Eigen3_support) - include_directories(BEFORE "include") +find_package(Eigen3 3.1.91 QUIET) # (requires 3.1.91 or greater) +include(CGAL_Eigen3_support) +if(NOT TARGET CGAL::Eigen3_support) + message("NOTICE: These benchmarks require Eigen 3.1.91 (or greater), and will not be compiled.") + return() +endif() + # create_single_source_cgal_program("Compare_ANN_STANN_CGAL.cpp") # does not compile, missing dependency create_single_source_cgal_program("nanoflan.cpp") create_single_source_cgal_program("binary.cpp") diff --git a/Spatial_searching/benchmark/Spatial_searching/tools/CMakeLists.txt b/Spatial_searching/benchmark/Spatial_searching/tools/CMakeLists.txt index 3d751e686bd..20d5ad1bb2d 100644 --- a/Spatial_searching/benchmark/Spatial_searching/tools/CMakeLists.txt +++ b/Spatial_searching/benchmark/Spatial_searching/tools/CMakeLists.txt @@ -6,7 +6,4 @@ project(tools_) find_package(CGAL REQUIRED COMPONENTS Core) -include(${CGAL_USE_FILE}) -include_directories(BEFORE "../include") - create_single_source_cgal_program("points_in_bbox.cpp") diff --git a/Spatial_searching/examples/Spatial_searching/CMakeLists.txt b/Spatial_searching/examples/Spatial_searching/CMakeLists.txt index ab2d67334d4..33a3969adc6 100644 --- a/Spatial_searching/examples/Spatial_searching/CMakeLists.txt +++ b/Spatial_searching/examples/Spatial_searching/CMakeLists.txt @@ -7,75 +7,47 @@ project(Spatial_searching_Examples) # CGAL and its components find_package(CGAL REQUIRED) -find_package(Eigen3 3.1.91) #(requires 3.2.0 or greater) -include(CGAL_Eigen3_support) - if(MSVC) # Turn off VC++ warning set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4244") endif() -# include for local directory - -# include for local package - -# Creating entries for all .cpp/.C files with "main" routine -# ########################################################## - create_single_source_cgal_program("circular_query.cpp") - create_single_source_cgal_program("distance_browsing.cpp") - create_single_source_cgal_program("iso_rectangle_2_query.cpp") - create_single_source_cgal_program("iso_rectangle_2_query_projection.cpp") - create_single_source_cgal_program("nearest_neighbor_searching.cpp") - create_single_source_cgal_program("searching_with_circular_query.cpp") - create_single_source_cgal_program("searching_with_point_with_info.cpp") - create_single_source_cgal_program("searching_with_point_with_info_inplace.cpp") - create_single_source_cgal_program("searching_with_point_with_info_pmap.cpp") - create_single_source_cgal_program("searching_surface_mesh_vertices.cpp") - create_single_source_cgal_program("searching_polyhedron_vertices.cpp") - -create_single_source_cgal_program( - "searching_polyhedron_vertices_with_fuzzy_sphere.cpp") - +create_single_source_cgal_program("searching_polyhedron_vertices_with_fuzzy_sphere.cpp") create_single_source_cgal_program("user_defined_point_and_distance.cpp") - create_single_source_cgal_program("using_fair_splitting_rule.cpp") - create_single_source_cgal_program("weighted_Minkowski_distance.cpp") +find_package(Eigen3 3.1.91 QUIET) #(requires 3.1.91 or greater) +include(CGAL_Eigen3_support) if(TARGET CGAL::Eigen3_support) - create_single_source_cgal_program("fuzzy_range_query.cpp") target_link_libraries(fuzzy_range_query PUBLIC CGAL::Eigen3_support) create_single_source_cgal_program("general_neighbor_searching.cpp") target_link_libraries(general_neighbor_searching PUBLIC CGAL::Eigen3_support) - else() - - message(STATUS "fuzzy_range_query.cpp and general_neighbor_searching.cpp") - message( - STATUS - "will not be compiled as they use CGAL::Epick_d which requires the Eigen library." - ) - + message(STATUS "NOTICE: The examples 'fuzzy_range_query' and 'general_neighbor_searching'") + message(STATUS "will not be compiled as they use CGAL::Epick_d, which requires the Eigen library.") endif() find_package(TBB QUIET) include(CGAL_TBB_support) if(TARGET CGAL::TBB_support) + message(STATUS "Found TBB") + create_single_source_cgal_program("parallel_kdtree.cpp") target_link_libraries(parallel_kdtree PUBLIC CGAL::TBB_support) else() - message(STATUS "parallel_kdtree.cpp requires TBB and will not be compiled") + message(STATUS "NOTICE: The example 'parallel_kdtree' requires TBB, and will not be compiled") endif() diff --git a/Spatial_sorting/benchmark/Spatial_sorting/CMakeLists.txt b/Spatial_sorting/benchmark/Spatial_sorting/CMakeLists.txt index 69fb787285b..9cd0fbfc6ba 100644 --- a/Spatial_sorting/benchmark/Spatial_sorting/CMakeLists.txt +++ b/Spatial_sorting/benchmark/Spatial_sorting/CMakeLists.txt @@ -6,5 +6,4 @@ project(Spatial_sorting_) find_package(CGAL REQUIRED COMPONENTS Core) -include(${CGAL_USE_FILE}) create_single_source_cgal_program("simple.cpp") diff --git a/Spatial_sorting/examples/Spatial_sorting/CMakeLists.txt b/Spatial_sorting/examples/Spatial_sorting/CMakeLists.txt index e1fd380977a..e8cd7e05df7 100644 --- a/Spatial_sorting/examples/Spatial_sorting/CMakeLists.txt +++ b/Spatial_sorting/examples/Spatial_sorting/CMakeLists.txt @@ -17,5 +17,6 @@ endforeach() find_package(TBB QUIET) include(CGAL_TBB_support) if(TARGET CGAL::TBB_support) + message(STATUS "Found TBB") target_link_libraries(parallel_spatial_sort_3 PUBLIC CGAL::TBB_support) endif() diff --git a/Spatial_sorting/test/Spatial_sorting/CMakeLists.txt b/Spatial_sorting/test/Spatial_sorting/CMakeLists.txt index 7ac68ead263..e7f809cb086 100644 --- a/Spatial_sorting/test/Spatial_sorting/CMakeLists.txt +++ b/Spatial_sorting/test/Spatial_sorting/CMakeLists.txt @@ -12,5 +12,6 @@ create_single_source_cgal_program("test_multiscale.cpp") find_package(TBB QUIET) include(CGAL_TBB_support) if(TARGET CGAL::TBB_support) + message(STATUS "Found TBB") target_link_libraries(test_hilbert PUBLIC CGAL::TBB_support) endif() diff --git a/Straight_skeleton_2/examples/Straight_skeleton_2/CMakeLists.txt b/Straight_skeleton_2/examples/Straight_skeleton_2/CMakeLists.txt index 56b2fffadd5..c6e8c6c0d51 100644 --- a/Straight_skeleton_2/examples/Straight_skeleton_2/CMakeLists.txt +++ b/Straight_skeleton_2/examples/Straight_skeleton_2/CMakeLists.txt @@ -17,5 +17,5 @@ if(CGAL_Qt5_FOUND) target_link_libraries(draw_straight_skeleton_2 PUBLIC CGAL::CGAL_Basic_viewer) target_link_libraries(exterior_offset_of_multiple_polygons_with_holes PUBLIC CGAL::CGAL_Basic_viewer) else() - message(STATUS "NOTICE: The example draw_straight_skeleton_2 requires Qt and will not be compiled.") + message(STATUS "NOTICE: The example 'draw_straight_skeleton_2' requires Qt and will not be compiled.") endif() diff --git a/Stream_support/benchmark/Stream_support/CMakeLists.txt b/Stream_support/benchmark/Stream_support/CMakeLists.txt index 1a060090fb6..8d03f6b673a 100644 --- a/Stream_support/benchmark/Stream_support/CMakeLists.txt +++ b/Stream_support/benchmark/Stream_support/CMakeLists.txt @@ -7,24 +7,5 @@ project(Stream_support) # CGAL and its components find_package(CGAL REQUIRED) -# Boost and its components -find_package(Boost REQUIRED) - -if(NOT Boost_FOUND) - - message( - STATUS "This project requires the Boost library, and will not be compiled.") - - return() - -endif() - -# include for local directory - -# include for local package - -# Creating entries for all .cpp/.C files with "main" routine -# ########################################################## - create_single_source_cgal_program("read_doubles.cpp") create_single_source_cgal_program("read_points.cpp") diff --git a/Stream_support/include/CGAL/IO/OFF/File_scanner_OFF.h b/Stream_support/include/CGAL/IO/OFF/File_scanner_OFF.h index 25a9223c968..80629599818 100644 --- a/Stream_support/include/CGAL/IO/OFF/File_scanner_OFF.h +++ b/Stream_support/include/CGAL/IO/OFF/File_scanner_OFF.h @@ -25,6 +25,7 @@ #include +#include #include #include #include diff --git a/Stream_support/test/Stream_support/CMakeLists.txt b/Stream_support/test/Stream_support/CMakeLists.txt index ade4d2c88f8..15c115bd3fa 100644 --- a/Stream_support/test/Stream_support/CMakeLists.txt +++ b/Stream_support/test/Stream_support/CMakeLists.txt @@ -27,10 +27,7 @@ foreach(cppfile ${cppfiles}) create_single_source_cgal_program("${cppfile}") target_link_libraries(test_3mf_to_sm PRIVATE ${3MF_LIBRARIES}) else() - message( - STATUS - "NOTICE : This program requires the lib3MF library, and will not be compiled." - ) + message(STATUS "NOTICE: Some tests require the lib3MF library, and will not be compiled.") endif() else() create_single_source_cgal_program("${cppfile}") diff --git a/Surface_mesh/benchmark/CMakeLists.txt b/Surface_mesh/benchmark/CMakeLists.txt index 31f48865d7f..33ae6c84569 100644 --- a/Surface_mesh/benchmark/CMakeLists.txt +++ b/Surface_mesh/benchmark/CMakeLists.txt @@ -3,8 +3,6 @@ project(Surface_mesh_performance) find_package(CGAL REQUIRED) -include_directories(BEFORE "../include") - # For profilling with gprof #add_definitions("-pg") #SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pg") @@ -14,12 +12,12 @@ add_definitions("-std=c++1y") # Polyhedron add_executable(polyhedron_performance performance_2.h polyhedron_performance.h polyhedron_performance.cpp) -target_link_libraries(polyhedron_performance ${CGAL_LIBRARIES}) +target_link_libraries(polyhedron_performance PRIVATE ${CGAL_LIBRARIES}) # LCC_2 add_executable(lcc_performance_2 performance_2.h lcc_performance_2.h lcc_performance_2.cpp) -target_link_libraries(lcc_performance_2 ${CGAL_LIBRARIES}) +target_link_libraries(lcc_performance_2 PRIVATE ${CGAL_LIBRARIES}) # Surface_mesh add_executable( @@ -31,7 +29,7 @@ add_executable( performance_2 performance_2.cpp performance_2.h polyhedron_performance.h surface_mesh_performance.h lcc_performance_2.h) -target_link_libraries(performance_2 ${CGAL_LIBRARIES}) +target_link_libraries(performance_2 PRIVATE ${CGAL_LIBRARIES}) create_single_source_cgal_program("sm_sms.cpp") create_single_source_cgal_program("poly_sms.cpp") diff --git a/Surface_mesh/test/Surface_mesh/CMakeLists.txt b/Surface_mesh/test/Surface_mesh/CMakeLists.txt index 0796515d99d..ce006010e98 100644 --- a/Surface_mesh/test/Surface_mesh/CMakeLists.txt +++ b/Surface_mesh/test/Surface_mesh/CMakeLists.txt @@ -25,5 +25,5 @@ if(3MF_LIBRARIES AND 3MF_INCLUDE_DIR AND EXISTS "${3MF_INCLUDE_DIR}/Model/COM/N target_link_libraries(test_deprecated_io_sm PRIVATE ${3MF_LIBRARIES}) target_compile_definitions(test_deprecated_io_sm PRIVATE -DCGAL_LINKED_WITH_3MF) else() - message(STATUS "NOTICE : read_3mf requires the lib3MF library, and will not be tested.") + message(STATUS "NOTICE: read_3mf requires the lib3MF library, and will not be tested.") endif() diff --git a/Surface_mesh_approximation/benchmark/Surface_mesh_approximation/CMakeLists.txt b/Surface_mesh_approximation/benchmark/Surface_mesh_approximation/CMakeLists.txt index 70482a41b01..a4eea6abf69 100644 --- a/Surface_mesh_approximation/benchmark/Surface_mesh_approximation/CMakeLists.txt +++ b/Surface_mesh_approximation/benchmark/Surface_mesh_approximation/CMakeLists.txt @@ -7,31 +7,5 @@ project(Surface_mesh_approximation_Benchmarks) # CGAL and its components find_package(CGAL REQUIRED) -# include helper file -include(${CGAL_USE_FILE}) - -# Boost and its components -find_package(Boost REQUIRED) - -if(NOT Boost_FOUND) - - message( - STATUS "This project requires the Boost library, and will not be compiled.") - - return() - -endif() - -# include for local directory - -# include for local package -include_directories(BEFORE ../../include) - -# Creating entries for all C++ files with "main" routine -# ########################################################## - -include(CGAL_CreateSingleSourceCGALProgram) - create_single_source_cgal_program("vsa_autoinit_timing_benchmark.cpp") - create_single_source_cgal_program("vsa_timing_benchmark.cpp") diff --git a/Surface_mesh_approximation/examples/Surface_mesh_approximation/CMakeLists.txt b/Surface_mesh_approximation/examples/Surface_mesh_approximation/CMakeLists.txt index e6f30275b74..e61a9141b62 100644 --- a/Surface_mesh_approximation/examples/Surface_mesh_approximation/CMakeLists.txt +++ b/Surface_mesh_approximation/examples/Surface_mesh_approximation/CMakeLists.txt @@ -7,26 +7,14 @@ project(Surface_mesh_approximation_Examples) # CGAL and its components find_package(CGAL REQUIRED) -# Boost -find_package(Boost) -if(NOT Boost_FOUND) - message( - STATUS "This project requires the Boost library, and will not be compiled.") - return() -endif() - # Use Eigen (for PCA) -find_package(Eigen3 3.1.0 REQUIRED) #(3.1.0 or greater) +find_package(Eigen3 3.1.0 QUIET) #(3.1.0 or greater) include(CGAL_Eigen3_support) if(NOT TARGET CGAL::Eigen3_support) - message( - STATUS "This project requires the Eigen library, and will not be compiled.") + message("NOTICE: This project requires Eigen 3.1 (or greater), and will not be compiled.") return() endif() -# Creating entries for all C++ files with "main" routine -# ########################################################## - create_single_source_cgal_program("vsa_approximation_2_example.cpp") target_link_libraries(vsa_approximation_2_example PUBLIC CGAL::Eigen3_support) @@ -43,5 +31,4 @@ create_single_source_cgal_program("vsa_segmentation_example.cpp") target_link_libraries(vsa_segmentation_example PUBLIC CGAL::Eigen3_support) create_single_source_cgal_program("vsa_simple_approximation_example.cpp") -target_link_libraries(vsa_simple_approximation_example - PUBLIC CGAL::Eigen3_support) +target_link_libraries(vsa_simple_approximation_example PUBLIC CGAL::Eigen3_support) diff --git a/Surface_mesh_approximation/test/Surface_mesh_approximation/CMakeLists.txt b/Surface_mesh_approximation/test/Surface_mesh_approximation/CMakeLists.txt index 64fb53467a0..0c269600668 100644 --- a/Surface_mesh_approximation/test/Surface_mesh_approximation/CMakeLists.txt +++ b/Surface_mesh_approximation/test/Surface_mesh_approximation/CMakeLists.txt @@ -7,26 +7,14 @@ project(Surface_mesh_approximation_Tests) # CGAL and its components find_package(CGAL REQUIRED) -# Boost -find_package(Boost) -if(NOT Boost_FOUND) - message( - STATUS "This project requires the Boost library, and will not be compiled.") - return() -endif() - # Use Eigen (for PCA) -find_package(Eigen3 3.1.0 REQUIRED) #(3.1.0 or greater) +find_package(Eigen3 3.1.0 QUIET) #(3.1.0 or greater) include(CGAL_Eigen3_support) if(NOT TARGET CGAL::Eigen3_support) - message( - STATUS "This project requires the Eigen library, and will not be compiled.") + message("NOTICE: This project requires Eigen 3.1 (or greater), and will not be compiled.") return() endif() -# Creating entries for all C++ files with "main" routine -# ########################################################## - create_single_source_cgal_program("vsa_class_interface_test.cpp") target_link_libraries(vsa_class_interface_test PUBLIC CGAL::Eigen3_support) diff --git a/Surface_mesh_deformation/benchmark/Surface_mesh_deformation/optimal_rotation/CMakeLists.txt b/Surface_mesh_deformation/benchmark/Surface_mesh_deformation/optimal_rotation/CMakeLists.txt index 625c8fbcbcd..15ec2c40838 100644 --- a/Surface_mesh_deformation/benchmark/Surface_mesh_deformation/optimal_rotation/CMakeLists.txt +++ b/Surface_mesh_deformation/benchmark/Surface_mesh_deformation/optimal_rotation/CMakeLists.txt @@ -3,16 +3,11 @@ project(benchmark_for_closest_rotation) find_package(CGAL REQUIRED COMPONENTS Core) -include(${CGAL_USE_FILE}) - -find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) +find_package(Eigen3 3.1.0 QUIET) #(requires 3.1.0 or greater) include(CGAL_Eigen3_support) if(TARGET CGAL::Eigen3_support) create_single_source_cgal_program("benchmark_for_concept_models.cpp") target_link_libraries(benchmark_for_concept_models PUBLIC CGAL::Eigen3_support) else() - message( - STATUS - "This program requires the Eigen library, version 3.1 or later and will not be compiled." - ) + message("NOTICE: This program requires requires Eigen 3.1 (or greater) or later and will not be compiled.") endif() diff --git a/Surface_mesh_deformation/demo/Surface_mesh_deformation/CMakeLists.txt b/Surface_mesh_deformation/demo/Surface_mesh_deformation/CMakeLists.txt index 778b63e37ec..33263a81543 100644 --- a/Surface_mesh_deformation/demo/Surface_mesh_deformation/CMakeLists.txt +++ b/Surface_mesh_deformation/demo/Surface_mesh_deformation/CMakeLists.txt @@ -13,15 +13,11 @@ set_property(DIRECTORY PROPERTY CGAL_NO_TESTING TRUE) find_package(CGAL REQUIRED) -find_package(Eigen3 3.1.91) #(requires 3.2.0 or greater) +find_package(Eigen3 3.1.91 QUIET) #(requires 3.1.91 or greater) include(CGAL_Eigen3_support) if(TARGET CGAL::Eigen3_support) create_single_source_cgal_program("deform_mesh_for_botsch08_format.cpp") - target_link_libraries(deform_mesh_for_botsch08_format - PUBLIC CGAL::Eigen3_support) + target_link_libraries(deform_mesh_for_botsch08_format PUBLIC CGAL::Eigen3_support) else() - message( - STATUS - "NOTICE: This program requires the Eigen library, version 3.2 or later and will not be compiled." - ) + message("NOTICE: This program requires requires Eigen 3.1.91 (or greater) or later and will not be compiled.") endif() diff --git a/Surface_mesh_deformation/examples/Surface_mesh_deformation/CMakeLists.txt b/Surface_mesh_deformation/examples/Surface_mesh_deformation/CMakeLists.txt index 7ddddf95188..e61a3546eb2 100644 --- a/Surface_mesh_deformation/examples/Surface_mesh_deformation/CMakeLists.txt +++ b/Surface_mesh_deformation/examples/Surface_mesh_deformation/CMakeLists.txt @@ -6,21 +6,17 @@ project(Surface_mesh_deformation_Examples) find_package(CGAL REQUIRED) -find_package(Eigen3 3.1.91) #(requires 3.2.0 or greater) +find_package(Eigen3 3.1.91 QUIET) #(requires 3.1.91 or greater) include(CGAL_Eigen3_support) if(TARGET CGAL::Eigen3_support) create_single_source_cgal_program("all_roi_assign_example.cpp") - create_single_source_cgal_program( - "all_roi_assign_example_custom_polyhedron.cpp") + create_single_source_cgal_program("all_roi_assign_example_custom_polyhedron.cpp") create_single_source_cgal_program("all_roi_assign_example_Surface_mesh.cpp") create_single_source_cgal_program("custom_weight_for_edges_example.cpp") - create_single_source_cgal_program( - "deform_polyhedron_with_custom_pmap_example.cpp") + create_single_source_cgal_program("deform_polyhedron_with_custom_pmap_example.cpp") create_single_source_cgal_program("k_ring_roi_translate_rotate_example.cpp") - create_single_source_cgal_program( - "k_ring_roi_translate_rotate_Surface_mesh.cpp") - create_single_source_cgal_program( - "deform_mesh_for_botsch08_format_sre_arap.cpp") + create_single_source_cgal_program("k_ring_roi_translate_rotate_Surface_mesh.cpp") + create_single_source_cgal_program("deform_mesh_for_botsch08_format_sre_arap.cpp") foreach( target @@ -38,17 +34,15 @@ if(TARGET CGAL::Eigen3_support) find_package(OpenMesh QUIET) if(OpenMesh_FOUND) include(UseOpenMesh) - create_single_source_cgal_program( - "all_roi_assign_example_with_OpenMesh.cpp") + message(STATUS "Found OpenMesh") + + create_single_source_cgal_program("all_roi_assign_example_with_OpenMesh.cpp") target_link_libraries(all_roi_assign_example_with_OpenMesh PRIVATE ${OPENMESH_LIBRARIES} CGAL::Eigen3_support) else() - message(STATUS "Example that use OpenMesh will not be compiled.") + message(STATUS "NOTICE: Examples that use OpenMesh will not be compiled.") endif() else() - message( - STATUS - "NOTICE: These examples require the Eigen library, version 3.2 or later and will not be compiled." - ) + message("NOTICE: These examples require Eigen 3.1.91 (or greater) or later and will not be compiled.") endif() diff --git a/Surface_mesh_deformation/test/Surface_mesh_deformation/CMakeLists.txt b/Surface_mesh_deformation/test/Surface_mesh_deformation/CMakeLists.txt index 001902d0187..b903ca3bcf0 100644 --- a/Surface_mesh_deformation/test/Surface_mesh_deformation/CMakeLists.txt +++ b/Surface_mesh_deformation/test/Surface_mesh_deformation/CMakeLists.txt @@ -6,7 +6,7 @@ project(Surface_mesh_deformation_Tests) find_package(CGAL REQUIRED) -find_package(Eigen3 3.1.91) #(requires 3.2.0 or greater) +find_package(Eigen3 3.1.91 QUIET) #(requires 3.1.91 or greater) include(CGAL_Eigen3_support) if(TARGET CGAL::Eigen3_support) create_single_source_cgal_program("Cactus_deformation_session.cpp") @@ -19,15 +19,14 @@ if(TARGET CGAL::Eigen3_support) find_package(OpenMesh QUIET) if(OpenMesh_FOUND) include(UseOpenMesh) + message(STATUS "Found OpenMesh") + create_single_source_cgal_program("Cactus_deformation_session_OpenMesh.cpp") target_link_libraries(Cactus_deformation_session_OpenMesh PRIVATE ${OPENMESH_LIBRARIES} CGAL::Eigen3_support) else() - message(STATUS "Example that use OpenMesh will not be compiled.") + message(STATUS "NOTICE: Examples that use OpenMesh will not be compiled.") endif() else() - message( - STATUS - "NOTICE: These tests require the Eigen library, version 3.2 or later and will not be compiled." - ) + message("NOTICE: These tests require the Eigen library, version 3.1.91 or later and will not be compiled.") endif() diff --git a/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/CMakeLists.txt b/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/CMakeLists.txt index 5f6da12cea2..988f875425e 100644 --- a/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/CMakeLists.txt +++ b/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/CMakeLists.txt @@ -3,10 +3,9 @@ cmake_minimum_required(VERSION 3.1...3.23) project(Surface_mesh_parameterization_Examples) -# Find CGAL find_package(CGAL REQUIRED) -find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) +find_package(Eigen3 3.1.0 QUIET) #(requires 3.1.0 or greater) include(CGAL_Eigen3_support) if(TARGET CGAL::Eigen3_support) # Executables that require Eigen 3.1 @@ -18,8 +17,7 @@ if(TARGET CGAL::Eigen3_support) # ------------------------------------------------------------------ set(SuiteSparse_USE_LAPACK_BLAS ON) - find_package(SuiteSparse QUIET NO_MODULE - )# 1st: Try to locate the *config.cmake file. + find_package(SuiteSparse QUIET NO_MODULE)# 1st: Try to locate the *config.cmake file. if(NOT SuiteSparse_FOUND) set(SuiteSparse_VERBOSE ON) find_package(SuiteSparse QUIET) # 2nd: Use FindSuiteSparse.cmake module @@ -37,16 +35,10 @@ if(TARGET CGAL::Eigen3_support) add_definitions(-DEIGEN_DONT_ALIGN_STATICALLY) add_definitions(-DCGAL_SMP_USE_SPARSESUITE_SOLVERS) else() - message( - STATUS - "NOTICE: The example `orbifold.cpp` will be compiled without the Sparsesuite library and UmfPack. Try setting SuiteSparse_UMF_INCLUDE_DIR and at least one of SuiteSparse_UMFPACK_LIBRARY_RELEASE and SuiteSparse_UMFPACK_LIBRARY_DEBUG to you UMFPACK installation." - ) + message(STATUS "NOTICE: The example `orbifold.cpp` will be compiled without the Sparsesuite library and UmfPack. Try setting SuiteSparse_UMF_INCLUDE_DIR and at least one of SuiteSparse_UMFPACK_LIBRARY_RELEASE and SuiteSparse_UMFPACK_LIBRARY_DEBUG to you UMFPACK installation.") endif() else(SuiteSparse_FOUND) - message( - STATUS - "NOTICE: The example `orbifold.cpp` will be compiled without the Sparsesuite library." - ) + message(STATUS "NOTICE: The example `orbifold.cpp` will be compiled without the Sparsesuite library.") endif(SuiteSparse_FOUND) # ------------------------------------------------------------------ @@ -75,8 +67,5 @@ if(TARGET CGAL::Eigen3_support) endif() else() - message( - STATUS - "NOTICE: The examples require Eigen 3.1 (or greater) and will not be compiled." - ) + message("NOTICE: The examples require Eigen 3.1 (or greater), and will not be compiled.") endif() diff --git a/Surface_mesh_parameterization/test/Surface_mesh_parameterization/CMakeLists.txt b/Surface_mesh_parameterization/test/Surface_mesh_parameterization/CMakeLists.txt index b8567b47ad3..ab08e517ccd 100644 --- a/Surface_mesh_parameterization/test/Surface_mesh_parameterization/CMakeLists.txt +++ b/Surface_mesh_parameterization/test/Surface_mesh_parameterization/CMakeLists.txt @@ -6,15 +6,11 @@ project(Surface_mesh_parameterization_Tests) # Find CGAL find_package(CGAL REQUIRED) -find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) +find_package(Eigen3 3.1.0 QUIET) #(requires 3.1.0 or greater) include(CGAL_Eigen3_support) if(TARGET CGAL::Eigen3_support) create_single_source_cgal_program("extensive_parameterization_test.cpp") - target_link_libraries(extensive_parameterization_test - PUBLIC CGAL::Eigen3_support) + target_link_libraries(extensive_parameterization_test PUBLIC CGAL::Eigen3_support) else() - message( - STATUS - "NOTICE: The tests require Eigen 3.1 (or greater) and will not be compiled." - ) + message("NOTICE: The tests require Eigen 3.1 (or greater), and will not be compiled.") endif() diff --git a/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/CMakeLists.txt b/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/CMakeLists.txt index 56243f443ec..b319050e6a5 100644 --- a/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/CMakeLists.txt +++ b/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/CMakeLists.txt @@ -7,48 +7,21 @@ project(Surface_mesh_segmentation_Examples) # CGAL and its components find_package(CGAL REQUIRED) -# Boost and its components -find_package(Boost) - -if(NOT Boost_FOUND) - - message( - STATUS "This project requires the Boost library, and will not be compiled.") - - return() - -endif() - -find_package(OpenMesh QUIET) - -if(OpenMesh_FOUND) - include(UseOpenMesh) -else() - message(STATUS "Examples that use OpenMesh will not be compiled.") -endif() - -# include for local package - -# Creating entries for all .cpp/.C files with "main" routine -# ########################################################## - create_single_source_cgal_program("sdf_values_example.cpp") - create_single_source_cgal_program("segmentation_from_sdf_values_example.cpp") - create_single_source_cgal_program("segmentation_via_sdf_values_example.cpp") - create_single_source_cgal_program("segmentation_with_facet_ids_example.cpp") - create_single_source_cgal_program("segmentation_from_sdf_values_SM_example.cpp") -create_single_source_cgal_program( - "segmentation_from_sdf_values_LCC_example.cpp") - +create_single_source_cgal_program("segmentation_from_sdf_values_LCC_example.cpp") create_single_source_cgal_program("extract_segmentation_into_mesh_example.cpp") +find_package(OpenMesh QUIET) if(OpenMesh_FOUND) - create_single_source_cgal_program( - "segmentation_from_sdf_values_OpenMesh_example.cpp") - target_link_libraries(segmentation_from_sdf_values_OpenMesh_example - PRIVATE ${OPENMESH_LIBRARIES}) + include(UseOpenMesh) + message(STATUS "Found OpenMesh") + + create_single_source_cgal_program("segmentation_from_sdf_values_OpenMesh_example.cpp") + target_link_libraries(segmentation_from_sdf_values_OpenMesh_example PRIVATE ${OPENMESH_LIBRARIES}) +else() + message(STATUS "NOTICE: Examples that use OpenMesh will not be compiled.") endif() diff --git a/Surface_mesh_shortest_path/examples/Surface_mesh_shortest_path/CMakeLists.txt b/Surface_mesh_shortest_path/examples/Surface_mesh_shortest_path/CMakeLists.txt index 86cfaeb0351..763fb37b61a 100644 --- a/Surface_mesh_shortest_path/examples/Surface_mesh_shortest_path/CMakeLists.txt +++ b/Surface_mesh_shortest_path/examples/Surface_mesh_shortest_path/CMakeLists.txt @@ -16,8 +16,10 @@ create_single_source_cgal_program("shortest_path_with_locate.cpp") find_package(OpenMesh QUIET) if(OpenMesh_FOUND) include(UseOpenMesh) + message(STATUS "Found OpenMesh") + create_single_source_cgal_program("shortest_paths_OpenMesh.cpp") target_link_libraries(shortest_paths_OpenMesh PRIVATE ${OPENMESH_LIBRARIES}) else() - message(STATUS "Examples that use OpenMesh will not be compiled.") + message(STATUS "NOTICE: Examples that use OpenMesh will not be compiled.") endif() diff --git a/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/CMakeLists.txt b/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/CMakeLists.txt index 973af0b75e3..f3184c37609 100644 --- a/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/CMakeLists.txt +++ b/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/CMakeLists.txt @@ -3,8 +3,6 @@ project(Surface_mesh_shortest_path_Tests) find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Core) -find_package(LEDA QUIET) - include_directories(BEFORE "include") create_single_source_cgal_program("Surface_mesh_shortest_path_test_1.cpp") @@ -15,25 +13,25 @@ create_single_source_cgal_program("Surface_mesh_shortest_path_test_5.cpp") create_single_source_cgal_program("Surface_mesh_shortest_path_test_6.cpp") create_single_source_cgal_program("Surface_mesh_shortest_path_traits_test.cpp") +find_package(LEDA QUIET) +if(LEDA_FOUND) + message(STATUS "Found LEDA") +endif() + # Link with Boost.ProgramOptions (optional) find_package(Boost QUIET COMPONENTS program_options) if(Boost_PROGRAM_OPTIONS_FOUND) + message(STATUS "Found Boost program_options") if(CGAL_Core_FOUND OR LEDA_FOUND) create_single_source_cgal_program("TestMesh.cpp") - if(TARGET Boost::filesystem) + if(TARGET Boost::program_options) target_link_libraries(TestMesh PRIVATE Boost::program_options) else() target_link_libraries(TestMesh PRIVATE ${Boost_PROGRAM_OPTIONS_LIBRARY}) endif() else() - message( - STATUS - "NOTICE: Example TestMesh.cpp requires the CGAL_Core library (or LEDA) and will not be compiled." - ) + message(STATUS "NOTICE: The example TestMesh.cpp requires the CGAL_Core library (or LEDA) and will not be compiled.") endif() else() - message( - STATUS - "NOTICE: Example TestMesh.cpp requires boost program_option and will not be compiled." - ) + message(STATUS "NOTICE: The example TestMesh.cpp requires boost program_option and will not be compiled.") endif() diff --git a/Surface_mesh_simplification/examples/Surface_mesh_simplification/CMakeLists.txt b/Surface_mesh_simplification/examples/Surface_mesh_simplification/CMakeLists.txt index 2af41a74f0a..4b2c37925e1 100644 --- a/Surface_mesh_simplification/examples/Surface_mesh_simplification/CMakeLists.txt +++ b/Surface_mesh_simplification/examples/Surface_mesh_simplification/CMakeLists.txt @@ -7,25 +7,6 @@ project(Surface_mesh_simplification_Examples) # CGAL and its components find_package(CGAL REQUIRED) -# Boost and its components -find_package(Boost) -if(NOT Boost_FOUND) - message( - STATUS "This project requires the Boost library, and will not be compiled.") - return() -endif() - -find_package(OpenMesh QUIET) - -if(OpenMesh_FOUND) - include(UseOpenMesh) -else() - message(STATUS "Examples that use OpenMesh will not be compiled.") -endif() - -# Creating entries for all .cpp/.C files with "main" routine -# ########################################################## - create_single_source_cgal_program("edge_collapse_envelope.cpp") create_single_source_cgal_program("edge_collapse_constrain_sharp_edges.cpp") create_single_source_cgal_program("edge_collapse_constrained_border_polyhedron.cpp") @@ -47,20 +28,27 @@ else() message(STATUS "NOTICE: Garland-Heckbert polices require the Eigen library, which has not been found; related examples will not be compiled.") endif() +find_package(OpenMesh QUIET) if(OpenMesh_FOUND) + include(UseOpenMesh) + message(STATUS "Found OpenMesh") + create_single_source_cgal_program("edge_collapse_OpenMesh.cpp") target_link_libraries(edge_collapse_OpenMesh PRIVATE ${OPENMESH_LIBRARIES}) +else() + message(STATUS "NOTICE: Examples that use OpenMesh will not be compiled.") endif() -find_package(METIS) +find_package(METIS QUIET) include(CGAL_METIS_support) -find_package(TBB) +find_package(TBB QUIET) include(CGAL_TBB_support) - if(TARGET CGAL::TBB_support AND TARGET CGAL::METIS_support) + message(STATUS "Found METIS & TBB") + create_single_source_cgal_program("collapse_small_edges_in_parallel.cpp") target_link_libraries(collapse_small_edges_in_parallel PUBLIC CGAL::TBB_support CGAL::METIS_support) else() - message(STATUS "collapse_small_edges_in_parallel, which use the METIS and TBB libraries will not be compiled.") + message(STATUS "NOTICE: The example 'collapse_small_edges_in_parallel' uses the METIS and TBB libraries, and will not be compiled.") endif() diff --git a/Surface_mesh_skeletonization/benchmark/Surface_mesh_skeletonization/CMakeLists.txt b/Surface_mesh_skeletonization/benchmark/Surface_mesh_skeletonization/CMakeLists.txt index 0eb517e341d..280cc828112 100644 --- a/Surface_mesh_skeletonization/benchmark/Surface_mesh_skeletonization/CMakeLists.txt +++ b/Surface_mesh_skeletonization/benchmark/Surface_mesh_skeletonization/CMakeLists.txt @@ -4,39 +4,16 @@ cmake_minimum_required(VERSION 3.1...3.23) project(Mean_curvature_skeleton) -#SET(CMAKE_BUILD_TYPE "Debug") -#SET(GCC_COVERAGE_COMPILE_FLAGS "-fprofile-arcs -ftest-coverage") -#SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_COVERAGE_COMPILE_FLAGS}" ) - # CGAL and its components find_package(CGAL REQUIRED) -# Boost and its components -find_package(Boost REQUIRED) - -if(NOT Boost_FOUND) - - message( - STATUS "This project requires the Boost library, and will not be compiled.") - - return() - -endif() - -# include for local directory - -# include for local package -find_package(Eigen3 3.2.0) #(requires 3.2.0 or greater) +find_package(Eigen3 3.2.0 QUIET) #(requires 3.2.0 or greater) include(CGAL_Eigen3_support) - -if(NOT TARGET CGAL::Eigen3_support) - message(STATUS "NOTICE: Eigen 3.2 (or greater) is not found.") +if(TARGET CGAL::Eigen3_support) + create_single_source_cgal_program("solver_benchmark.cpp") + target_link_libraries(solver_benchmark PUBLIC CGAL::Eigen3_support) + create_single_source_cgal_program("mcf_scale_invariance.cpp") + target_link_libraries(mcf_scale_invariance PUBLIC CGAL::Eigen3_support) +else() + message("NOTICE: This project requires Eigen 3.2.0 (or greater), and will not be compiled.") endif() - -# Creating entries for all .cpp/.C files with "main" routine -# ########################################################## - -create_single_source_cgal_program("solver_benchmark.cpp") -target_link_libraries(solver_benchmark PUBLIC CGAL::Eigen3_support) -create_single_source_cgal_program("mcf_scale_invariance.cpp") -target_link_libraries(mcf_scale_invariance PUBLIC CGAL::Eigen3_support) diff --git a/Surface_mesh_skeletonization/examples/Surface_mesh_skeletonization/CMakeLists.txt b/Surface_mesh_skeletonization/examples/Surface_mesh_skeletonization/CMakeLists.txt index e66903608e9..798977cdd1b 100644 --- a/Surface_mesh_skeletonization/examples/Surface_mesh_skeletonization/CMakeLists.txt +++ b/Surface_mesh_skeletonization/examples/Surface_mesh_skeletonization/CMakeLists.txt @@ -6,17 +6,8 @@ project(Surface_mesh_skeletonization_Examples) find_package(CGAL REQUIRED) -find_package(Eigen3 3.2.0) #(requires 3.2.0 or greater) +find_package(Eigen3 3.2.0 QUIET) #(requires 3.2.0 or greater) include(CGAL_Eigen3_support) - -find_package(OpenMesh QUIET) - -if(OpenMesh_FOUND) - include(UseOpenMesh) -else() - message(STATUS "Examples that use OpenMesh will not be compiled.") -endif() - if(TARGET CGAL::Eigen3_support) create_single_source_cgal_program("simple_mcfskel_example.cpp") create_single_source_cgal_program("simple_mcfskel_sm_example.cpp") @@ -25,6 +16,7 @@ if(TARGET CGAL::Eigen3_support) create_single_source_cgal_program("MCF_Skeleton_sm_example.cpp") create_single_source_cgal_program("MCF_Skeleton_LCC_example.cpp") create_single_source_cgal_program("segmentation_example.cpp") + foreach( target simple_mcfskel_example @@ -37,13 +29,16 @@ if(TARGET CGAL::Eigen3_support) target_link_libraries(${target} PUBLIC CGAL::Eigen3_support) endforeach() + find_package(OpenMesh QUIET) if(OpenMesh_FOUND) + include(UseOpenMesh) + message(STATUS "Found OpenMesh") + create_single_source_cgal_program("MCF_Skeleton_om_example.cpp") - target_link_libraries( MCF_Skeleton_om_example PUBLIC CGAL::Eigen3_support PRIVATE ${OPENMESH_LIBRARIES}) + target_link_libraries(MCF_Skeleton_om_example PUBLIC CGAL::Eigen3_support PRIVATE ${OPENMESH_LIBRARIES}) + else() + message(STATUS "NOTICE: Examples that use OpenMesh will not be compiled.") endif() else() - message( - STATUS - "These programs require the Eigen library (3.2 or greater), and will not be compiled." - ) + message("NOTICE: These programs require the Eigen library (3.2 or greater), and will not be compiled.") endif() diff --git a/Surface_mesh_skeletonization/test/Surface_mesh_skeletonization/CMakeLists.txt b/Surface_mesh_skeletonization/test/Surface_mesh_skeletonization/CMakeLists.txt index 91a2c82d39a..a44eb1af3eb 100644 --- a/Surface_mesh_skeletonization/test/Surface_mesh_skeletonization/CMakeLists.txt +++ b/Surface_mesh_skeletonization/test/Surface_mesh_skeletonization/CMakeLists.txt @@ -6,17 +6,13 @@ project(Surface_mesh_skeletonization_Tests) find_package(CGAL REQUIRED) -find_package(Eigen3 3.2.0) #(requires 3.2.0 or greater) +find_package(Eigen3 3.2.0 QUIET) #(requires 3.2.0 or greater) include(CGAL_Eigen3_support) - if(TARGET CGAL::Eigen3_support) create_single_source_cgal_program("MCF_Skeleton_test.cpp") target_link_libraries(MCF_Skeleton_test PUBLIC CGAL::Eigen3_support) create_single_source_cgal_program("skeleton_connectivity_test.cpp") target_link_libraries(skeleton_connectivity_test PUBLIC CGAL::Eigen3_support) else() - message( - STATUS - "These tests require the Eigen library (3.2 or greater), and will not be compiled." - ) + message("NOTICE: These tests require the Eigen library (3.2 or greater), and will not be compiled.") endif() diff --git a/Surface_mesh_topology/benchmark/Surface_mesh_topology/CMakeLists.txt b/Surface_mesh_topology/benchmark/Surface_mesh_topology/CMakeLists.txt index d0521ebfc51..1eaee1642bc 100644 --- a/Surface_mesh_topology/benchmark/Surface_mesh_topology/CMakeLists.txt +++ b/Surface_mesh_topology/benchmark/Surface_mesh_topology/CMakeLists.txt @@ -2,7 +2,7 @@ project(Surface_mesh_topology_Benchmarks) cmake_minimum_required(VERSION 3.1...3.23) -find_package(CGAL) +find_package(CGAL REQUIRED) # add_definitions(-DCGAL_TRACE_PATH_TESTS) # add_definitions(-DCGAL_TRACE_CMAP_TOOLS) diff --git a/Surface_mesher/examples/Surface_mesher/CMakeLists.txt b/Surface_mesher/examples/Surface_mesher/CMakeLists.txt index 6f74259ab17..f167c9a13da 100644 --- a/Surface_mesher/examples/Surface_mesher/CMakeLists.txt +++ b/Surface_mesher/examples/Surface_mesher/CMakeLists.txt @@ -15,9 +15,6 @@ else() # Just to avoid a warning from CMake if that variable is set on the command line... endif() - message( - STATUS - "NOTICE: This program requires the CGAL and CGAL ImageIO libraries, and will not be compiled." - ) + message("NOTICE: This project requires the CGAL and CGAL ImageIO libraries, and will not be compiled.") endif() diff --git a/Surface_sweep_2/examples/Surface_sweep_2/CMakeLists.txt b/Surface_sweep_2/examples/Surface_sweep_2/CMakeLists.txt index c7cba6d622b..37472e6b921 100644 --- a/Surface_sweep_2/examples/Surface_sweep_2/CMakeLists.txt +++ b/Surface_sweep_2/examples/Surface_sweep_2/CMakeLists.txt @@ -7,23 +7,4 @@ project(Surface_sweep_2_Examples) # CGAL and its components find_package(CGAL REQUIRED) -# Boost and its components -find_package(Boost REQUIRED) - -if(NOT Boost_FOUND) - - message( - STATUS "This project requires the Boost library, and will not be compiled.") - - return() - -endif() - -# include for local directory - -# include for local package - -# Creating entries for all .cpp/.C files with "main" routine -# ########################################################## - create_single_source_cgal_program("plane_sweep.cpp") diff --git a/TDS_3/test/TDS_3/CMakeLists.txt b/TDS_3/test/TDS_3/CMakeLists.txt index 1e2256ba348..a80cd824ea3 100644 --- a/TDS_3/test/TDS_3/CMakeLists.txt +++ b/TDS_3/test/TDS_3/CMakeLists.txt @@ -7,8 +7,11 @@ include_directories(BEFORE "./include") find_package(TBB QUIET) include(CGAL_TBB_support) + create_single_source_cgal_program("test_triangulation_tds_3.cpp") create_single_source_cgal_program("test_io_tds3.cpp") + if(TARGET CGAL::TBB_support) + message(STATUS "Found TBB") target_link_libraries(test_triangulation_tds_3 PUBLIC CGAL::TBB_support) endif() diff --git a/Testsuite/test/collect_cgal_testresults_from_cmake b/Testsuite/test/collect_cgal_testresults_from_cmake index a7098c435e0..b8e3370abee 100755 --- a/Testsuite/test/collect_cgal_testresults_from_cmake +++ b/Testsuite/test/collect_cgal_testresults_from_cmake @@ -60,7 +60,7 @@ print_testresult() RESULT="t" fi else - if grep -E -q 'NOTICE: .*(need|require|incompatible).*will not be' CompilerOutput_$1 + if grep -E -q 'NOTICE: .*(need|require|incompatible|not found).*will not be' CompilerOutput_$1 then RESULT="r" else diff --git a/Tetrahedral_remeshing/examples/Tetrahedral_remeshing/CMakeLists.txt b/Tetrahedral_remeshing/examples/Tetrahedral_remeshing/CMakeLists.txt index 380b7ff60d7..b5c4c1da2ab 100644 --- a/Tetrahedral_remeshing/examples/Tetrahedral_remeshing/CMakeLists.txt +++ b/Tetrahedral_remeshing/examples/Tetrahedral_remeshing/CMakeLists.txt @@ -8,19 +8,10 @@ project(Tetrahedral_remeshing_Examples) # CGAL and its components find_package(CGAL REQUIRED) -# Boost and its components -find_package(Boost REQUIRED) -if(NOT Boost_FOUND) - message( - STATUS "This project requires the Boost library, and will not be compiled.") - return() -endif() - -# Use Eigen for Mesh_3 -find_package(Eigen3 3.1.0 REQUIRED) #(3.1.0 or greater) -include(CGAL_Eigen3_support) -find_package(TBB QUIET) -include(CGAL_TBB_support) +create_single_source_cgal_program("tetrahedral_remeshing_example.cpp" ) +create_single_source_cgal_program("tetrahedral_remeshing_with_features.cpp") +create_single_source_cgal_program("tetrahedral_remeshing_of_one_subdomain.cpp") +create_single_source_cgal_program("tetrahedral_remeshing_from_mesh.cpp") # Concurrent Mesh_3 option(CGAL_ACTIVATE_CONCURRENT_MESH_3 "Activate parallelism in Mesh_3" OFF) @@ -28,22 +19,23 @@ if(CGAL_ACTIVATE_CONCURRENT_MESH_3 OR "$ENV{CGAL_ACTIVATE_CONCURRENT_MESH_3}") add_definitions(-DCGAL_CONCURRENT_MESH_3) find_package(TBB REQUIRED) include(CGAL_TBB_support) +else() + find_package(TBB QUIET) + include(CGAL_TBB_support) endif() -# Creating entries for all C++ files with "main" routine -# ########################################################## -create_single_source_cgal_program( "tetrahedral_remeshing_example.cpp" ) -create_single_source_cgal_program( "tetrahedral_remeshing_with_features.cpp") -create_single_source_cgal_program( "tetrahedral_remeshing_of_one_subdomain.cpp") -create_single_source_cgal_program( "tetrahedral_remeshing_from_mesh.cpp") - +# Use Eigen for Mesh_3 +find_package(Eigen3 3.1.0 QUIET) #(3.1.0 or greater) +include(CGAL_Eigen3_support) if(TARGET CGAL::Eigen3_support) -create_single_source_cgal_program( "mesh_and_remesh_polyhedral_domain_with_features.cpp" ) + create_single_source_cgal_program( "mesh_and_remesh_polyhedral_domain_with_features.cpp" ) target_link_libraries(mesh_and_remesh_polyhedral_domain_with_features PUBLIC CGAL::Eigen3_support) + if(CGAL_ACTIVATE_CONCURRENT_MESH_3 AND TARGET CGAL::TBB_support) + message(STATUS "Found TBB") target_link_libraries(mesh_and_remesh_polyhedral_domain_with_features PRIVATE CGAL::TBB_support) endif() else() - message(STATUS "Some examples need the Eigen3 library, and will not be compiled.") + message(STATUS "NOTICE: Some examples require Eigen 3.1 (or greater), and will not be compiled.") endif() diff --git a/Tetrahedral_remeshing/test/Tetrahedral_remeshing/CMakeLists.txt b/Tetrahedral_remeshing/test/Tetrahedral_remeshing/CMakeLists.txt index 6cebbe30e7e..a47c71cd04f 100644 --- a/Tetrahedral_remeshing/test/Tetrahedral_remeshing/CMakeLists.txt +++ b/Tetrahedral_remeshing/test/Tetrahedral_remeshing/CMakeLists.txt @@ -8,40 +8,25 @@ project(Tetrahedral_remeshing_Tests) # CGAL and its components find_package(CGAL REQUIRED COMPONENTS ImageIO) -# Boost and its components -find_package(Boost REQUIRED) -if(NOT Boost_FOUND) - message( - STATUS "This project requires the Boost library, and will not be compiled.") - return() -endif() - -# Creating entries for all C++ files with "main" routine -# ########################################################## create_single_source_cgal_program("test_tetrahedral_remeshing.cpp") -create_single_source_cgal_program( - "test_tetrahedral_remeshing_with_features.cpp") -create_single_source_cgal_program( - "test_tetrahedral_remeshing_of_one_subdomain.cpp") +create_single_source_cgal_program("test_tetrahedral_remeshing_with_features.cpp") +create_single_source_cgal_program("test_tetrahedral_remeshing_of_one_subdomain.cpp") create_single_source_cgal_program("test_tetrahedral_remeshing_io.cpp") -create_single_source_cgal_program( - "test_tetrahedral_remeshing_from_mesh_file.cpp") +create_single_source_cgal_program("test_tetrahedral_remeshing_from_mesh_file.cpp") # Tests using Mesh_3 require Eigen -find_package(Eigen3 3.1.0 REQUIRED) #(3.1.0 or greater) +find_package(Eigen3 3.1.0 QUIET) #(3.1.0 or greater) include(CGAL_Eigen3_support) -if(NOT TARGET CGAL::Eigen3_support) - message( - STATUS "This project requires the Eigen library, and will not be compiled.") - return() -endif() +if(TARGET CGAL::Eigen3_support) + create_single_source_cgal_program("test_mesh_and_remesh_polyhedral_domain_with_features.cpp") + target_link_libraries(test_mesh_and_remesh_polyhedral_domain_with_features PUBLIC CGAL::Eigen3_support) -create_single_source_cgal_program( - "test_mesh_and_remesh_polyhedral_domain_with_features.cpp") -target_link_libraries(test_mesh_and_remesh_polyhedral_domain_with_features - PUBLIC CGAL::Eigen3_support) - -if(CGAL_ImageIO_USE_ZLIB) - create_single_source_cgal_program("test_mesh_and_remesh_image.cpp") - target_link_libraries(test_mesh_and_remesh_image PUBLIC CGAL::Eigen3_support) + if(CGAL_ImageIO_USE_ZLIB) + create_single_source_cgal_program("test_mesh_and_remesh_image.cpp") + target_link_libraries(test_mesh_and_remesh_image PUBLIC CGAL::Eigen3_support) + else() + message(STATUS "NOTICE: The test 'test_mesh_and_remesh_image' uses zlib, and will not be compiled.") + endif() +else() + message(STATUS "NOTICE: Some tests require Eigen 3.1 (or greater), and will not be compiled.") endif() diff --git a/Triangulation/applications/Triangulation/CMakeLists.txt b/Triangulation/applications/Triangulation/CMakeLists.txt index d0928bb79ce..8ec8183570c 100644 --- a/Triangulation/applications/Triangulation/CMakeLists.txt +++ b/Triangulation/applications/Triangulation/CMakeLists.txt @@ -7,29 +7,16 @@ project(Triangulation_apps) # CGAL and its components find_package(CGAL REQUIRED) -# Boost and its components -find_package(Boost REQUIRED) - -if(NOT Boost_FOUND) - - message( - STATUS "This project requires the Boost library, and will not be compiled.") - - return() - -endif() - -find_package(Eigen3 3.1.0) +find_package(Eigen3 3.1.0 QUIET) include(CGAL_Eigen3_support) +if(NOT TARGET CGAL::Eigen3_support) + message("NOTICE: Applications require Eigen 3.1 (or greater), and will not be compiled") + return() +endif() # include for local directory include_directories(BEFORE include) -# include for local package - -# Creating entries for all .cpp/.C files with "main" routine -# ########################################################## - create_single_source_cgal_program("points_to_RT_to_off.cpp") target_link_libraries(points_to_RT_to_off PUBLIC CGAL::Eigen3_support) create_single_source_cgal_program("points_to_DT_to_off.cpp") diff --git a/Triangulation/benchmark/Triangulation/CMakeLists.txt b/Triangulation/benchmark/Triangulation/CMakeLists.txt index 47e4945c25b..ab384682f8e 100644 --- a/Triangulation/benchmark/Triangulation/CMakeLists.txt +++ b/Triangulation/benchmark/Triangulation/CMakeLists.txt @@ -6,20 +6,15 @@ project(Triangulation_benchmark) find_package(CGAL REQUIRED COMPONENTS Core) -include(${CGAL_USE_FILE}) - -find_package(Eigen3 3.1.0) +find_package(Eigen3 3.1.0 QUIET) include(CGAL_Eigen3_support) if(TARGET CGAL::Eigen3_support) include_directories(BEFORE "include") + create_single_source_cgal_program("delaunay.cpp") target_link_libraries(delaunay PUBLIC CGAL::Eigen3_support) create_single_source_cgal_program("Td_vs_T2_and_T3.cpp") target_link_libraries(Td_vs_T2_and_T3 PUBLIC CGAL::Eigen3_support) - else() - message( - STATUS - "NOTICE: Some of the executables in this directory need Eigen 3.1 (or greater) and will not be compiled." - ) + message("NOTICE: Executables in this directory require Eigen 3.1 (or greater), and will not be compiled.") endif() diff --git a/Triangulation/examples/Triangulation/CMakeLists.txt b/Triangulation/examples/Triangulation/CMakeLists.txt index 4a8d458026a..3ad27172e58 100644 --- a/Triangulation/examples/Triangulation/CMakeLists.txt +++ b/Triangulation/examples/Triangulation/CMakeLists.txt @@ -5,16 +5,13 @@ cmake_minimum_required(VERSION 3.1...3.23) project(Triangulation_Examples) if(CMAKE_COMPILER_IS_GNUCCX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.4) - message( - STATUS - "NOTICE: this directory requires a version of gcc >= 4.4, and will not be compiled." - ) + message("NOTICE: Examples in this directory require a version of gcc >= 4.4, and will not be compiled.") return() endif() find_package(CGAL REQUIRED) -find_package(Eigen3 3.1.0) +find_package(Eigen3 3.1.0 QUIET) include(CGAL_Eigen3_support) if(TARGET CGAL::Eigen3_support) create_single_source_cgal_program("barycentric_subdivision.cpp") @@ -37,8 +34,5 @@ if(TARGET CGAL::Eigen3_support) target_link_libraries(${target} PUBLIC CGAL::Eigen3_support) endforeach() else() - message( - STATUS - "NOTICE: Some of the executables in this directory need Eigen 3.1 (or greater) and will not be compiled." - ) + message("NOTICE: Examples in this directory require Eigen 3.1 (or greater), and will not be compiled.") endif() diff --git a/Triangulation/test/Triangulation/CMakeLists.txt b/Triangulation/test/Triangulation/CMakeLists.txt index 6eedc4296fc..c726891424f 100644 --- a/Triangulation/test/Triangulation/CMakeLists.txt +++ b/Triangulation/test/Triangulation/CMakeLists.txt @@ -5,16 +5,13 @@ cmake_minimum_required(VERSION 3.1...3.23) project(Triangulation_Tests) if(CMAKE_COMPILER_IS_GNUCCX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.4) - message( - STATUS - "NOTICE: this directory requires a version of gcc >= 4.4, and will not be compiled." - ) + message("NOTICE: Examples in this directory require a version of gcc >= 4.4, and will not be compiled.") return() endif() find_package(CGAL REQUIRED) -find_package(Eigen3 3.1.0) +find_package(Eigen3 3.1.0 QUIET) include(CGAL_Eigen3_support) if(TARGET CGAL::Eigen3_support) include_directories(BEFORE "include") @@ -32,8 +29,5 @@ if(TARGET CGAL::Eigen3_support) endforeach() else() - message( - STATUS - "NOTICE: Some of the executables in this directory need Eigen 3.1 (or greater) and will not be compiled." - ) + message("NOTICE: Tests in this directory require Eigen 3.1 (or greater), and will not be compiled.") endif() diff --git a/Triangulation_2/examples/Triangulation_2/CMakeLists.txt b/Triangulation_2/examples/Triangulation_2/CMakeLists.txt index 179ea91a3e7..e4f5e7392ee 100644 --- a/Triangulation_2/examples/Triangulation_2/CMakeLists.txt +++ b/Triangulation_2/examples/Triangulation_2/CMakeLists.txt @@ -20,8 +20,5 @@ if(CGAL_Qt5_FOUND) target_link_libraries(draw_triangulation_2 PUBLIC CGAL::CGAL_Basic_viewer) target_link_libraries(star_conflict_zone PUBLIC CGAL::CGAL_Basic_viewer) else() - message( - STATUS - "NOTICE: Several examples require Qt and will not be compiled." - ) + message(STATUS "NOTICE: Several examples require Qt5 and will not be compiled.") endif() diff --git a/Triangulation_2/include/CGAL/Constrained_triangulation_2.h b/Triangulation_2/include/CGAL/Constrained_triangulation_2.h index ac11e5182e2..80d7a197e3e 100644 --- a/Triangulation_2/include/CGAL/Constrained_triangulation_2.h +++ b/Triangulation_2/include/CGAL/Constrained_triangulation_2.h @@ -38,6 +38,28 @@ #include #include +#ifdef CGAL_CDT_2_DEBUG_INTERSECTIONS +# include +# include +# include +namespace CGAL { + +struct With_point_tag {}; + +template +struct Output_rep, With_point_tag> + : public Output_rep> +{ + using Base = Output_rep>; + using Base::Base; + + std::ostream& operator()(std::ostream& out) const { + return Base::operator()(out) << "= " << this->it->point(); + } +}; +} // namespace CGAL +#endif // CGAL_CDT_2_DEBUG_INTERSECTIONS + namespace CGAL { struct No_constraint_intersection_tag{}; @@ -597,6 +619,13 @@ public: return are_there; } +#ifdef CGAL_CDT_2_DEBUG_INTERSECTIONS + auto display_vertex(Vertex_handle v) const { + With_point_tag point_tag; + using CGAL::IO::oformat; + return oformat(v, point_tag); + } +#endif // CGAL_CDT_2_DEBUG_INTERSECTIONS template OutputItEdges incident_constraints(Vertex_handle v, @@ -804,8 +833,8 @@ insert_constraint(Vertex_handle vaa, Vertex_handle vbb) #ifdef CGAL_CDT_2_DEBUG_INTERSECTIONS std::cerr << CGAL::internal::cdt_2_indent_level - << "CT_2::insert_constraint( #" << vaa->time_stamp() << "= " << vaa->point() - << " , #" << vbb->time_stamp() << "= " << vbb->point() + << "CT_2::insert_constraint( " << display_vertex(vaa) + << " , " << display_vertex(vbb) << " )\n"; internal::Indentation_level::Exit_guard exit_guard = CGAL::internal::cdt_2_indent_level.open_new_scope(); #endif // CGAL_CDT_2_DEBUG_INTERSECTIONS @@ -815,8 +844,8 @@ insert_constraint(Vertex_handle vaa, Vertex_handle vbb) CGAL_precondition( vaa != vbb); #ifdef CGAL_CDT_2_DEBUG_INTERSECTIONS std::cerr << CGAL::internal::cdt_2_indent_level - << "CT_2::insert_constraint, stack pop=( #" << vaa->time_stamp() << "= " << vaa->point() - << " , #" << vbb->time_stamp() << "= " << vbb->point() + << "CT_2::insert_constraint, stack pop=( " << display_vertex(vaa) + << " , " << display_vertex(vbb) << " ) remaining stack size: " << stack.size() << '\n'; CGAL_assertion(this->is_valid()); @@ -858,12 +887,12 @@ insert_constraint(Vertex_handle vaa, Vertex_handle vbb) if (vi != vaa && vi != vbb) { #ifdef CGAL_CDT_2_DEBUG_INTERSECTIONS std::cerr << CGAL::internal::cdt_2_indent_level - << "CT_2::insert_constraint stack push [vaa, vi] ( #" << vaa->time_stamp() << "= " << vaa->point() - << " , #" << vi->time_stamp() << "= " << vi->point() + << "CT_2::insert_constraint stack push [vaa, vi] ( " << display_vertex(vaa) + << " , " << display_vertex(vi) << " )\n"; std::cerr << CGAL::internal::cdt_2_indent_level - << "CT_2::insert_constraint stack push [vi, vbb] ( #" << vi->time_stamp() << "= " << vi->point() - << " , #" << vbb->time_stamp() << "= " << vbb->point() + << "CT_2::insert_constraint stack push [vi, vbb] ( " << display_vertex(vi) + << " , " << display_vertex(vbb) << " )\n"; #endif // CGAL_CDT_2_DEBUG_INTERSECTIONS stack.push(std::make_pair(vaa,vi)); @@ -872,8 +901,8 @@ insert_constraint(Vertex_handle vaa, Vertex_handle vbb) else{ #ifdef CGAL_CDT_2_DEBUG_INTERSECTIONS std::cerr << CGAL::internal::cdt_2_indent_level - << "CT_2::insert_constraint stack push [vaa, vbb]( #" << vaa->time_stamp() << "= " << vaa->point() - << " , #" << vbb->time_stamp() << "= " << vbb->point() + << "CT_2::insert_constraint stack push [vaa, vbb]( " << display_vertex(vaa) + << " , " << display_vertex(vbb) << " )\n"; #endif // CGAL_CDT_2_DEBUG_INTERSECTIONS stack.push(std::make_pair(vaa,vbb)); @@ -921,8 +950,8 @@ find_intersected_faces(Vertex_handle vaa, // is constrained #ifdef CGAL_CDT_2_DEBUG_INTERSECTIONS std::cerr << CGAL::internal::cdt_2_indent_level - << "CT_2::find_intersected_faces ( #" << vaa->time_stamp() << "= " << vaa->point() - << " , #" << vbb->time_stamp() << "= " << vbb->point() + << "CT_2::find_intersected_faces ( " << display_vertex(vaa) + << " , " << display_vertex(vbb) << " )\n" << CGAL::internal::cdt_2_indent_level << "> current constrained edges are:\n"; @@ -1220,7 +1249,7 @@ insert_intersection(Face_handle f, int i, } #ifdef CGAL_CDT_2_DEBUG_INTERSECTIONS std::cerr << CGAL::internal::cdt_2_indent_level - << "CT_2::insert_intersection, `vi` is ( #" << vi->time_stamp() << "= " << vi->point() + << "CT_2::insert_intersection, `vi` is ( " << display_vertex(vi) << " )\n"; #endif // CGAL_CDT_2_DEBUG_INTERSECTIONS return vi; @@ -1245,16 +1274,16 @@ intersect(Face_handle f, int i, #ifdef CGAL_CDT_2_DEBUG_INTERSECTIONS std::cerr << CGAL::internal::cdt_2_indent_level - << "CT_2::intersect segment ( #" << vaa->time_stamp() << "= " << vaa->point() - << " , #" << vbb->time_stamp() << "= " << vbb->point() - << " ) with edge ( #"<< vcc->time_stamp() << "= " << vcc->point() - << " , #" << vdd->time_stamp() << "= " << vdd->point() + << "CT_2::intersect segment ( " << display_vertex(vaa) + << " , " << display_vertex(vbb) + << " ) with edge ( " << display_vertex(vcc) + << " , " << display_vertex(vdd) << " )\n"; #endif // CGAL_CDT_2_DEBUG_INTERSECTIONS Vertex_handle vi = insert_intersection(f, i, vaa, vbb, vcc, vdd, pa, pb, pc, pd, itag); #ifdef CGAL_CDT_2_DEBUG_INTERSECTIONS std::cerr << CGAL::internal::cdt_2_indent_level - << "CT_2::intersect, `vi` is ( #" << vi->time_stamp() << "= " << vi->point() + << "CT_2::intersect, `vi` is ( " << display_vertex(vi) << " )\n"; #endif // CGAL_CDT_2_DEBUG_INTERSECTIONS diff --git a/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h b/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h index 50ca1f4bfec..63e07c51dcf 100644 --- a/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h +++ b/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h @@ -129,6 +129,10 @@ public: using Triangulation::is_infinite; using Triangulation::number_of_vertices; #endif +#ifdef CGAL_CDT_2_DEBUG_INTERSECTIONS + using Triangulation::display_vertex; +#endif // CGAL_CDT_2_DEBUG_INTERSECTIONS + typedef typename Triangulation::Edge Edge; typedef typename Triangulation::Vertex Vertex; @@ -275,8 +279,8 @@ public: { #ifdef CGAL_CDT_2_DEBUG_INTERSECTIONS std::cerr << CGAL::internal::cdt_2_indent_level - << "CT_plus_2::insert_constraint( #" << va->time_stamp() << "= " << va->point() - << " , #" << vb->time_stamp() << "= " << vb->point() + << "CT_plus_2::insert_constraint( " << display_vertex(va) + << " , " << display_vertex(vb) << " )\n"; #endif // CGAL_CDT_2_DEBUG_INTERSECTIONS // protects against inserting a zero length constraint @@ -883,13 +887,13 @@ insert_subconstraint(Vertex_handle vaa, { #ifdef CGAL_CDT_2_DEBUG_INTERSECTIONS std::cerr << CGAL::internal::cdt_2_indent_level - << "CT_plus_2::insert_subconstraint( #" << vaa->time_stamp() << "= " << vaa->point() - << " , #" << vbb->time_stamp() << "= " << vbb->point() + << "CT_plus_2::insert_subconstraint( " << display_vertex(vaa) + << " , " << display_vertex(vbb) << " )\n"; internal::Indentation_level::Exit_guard exit_guard = CGAL::internal::cdt_2_indent_level.open_new_scope(); std::cerr << CGAL::internal::cdt_2_indent_level - << "CT_plus_2::insert_constraint stack push [va, vb] ( #" << vaa->time_stamp() << "= " << vaa->point() - << " , #" << vbb->time_stamp() << "= " << vbb->point() + << "CT_plus_2::insert_constraint stack push [va, vb] ( " << display_vertex(vaa) + << " , " << display_vertex(vbb) << " )\n"; #endif // CGAL_CDT_2_DEBUG_INTERSECTIONS std::stack > stack; @@ -901,8 +905,8 @@ insert_subconstraint(Vertex_handle vaa, CGAL_precondition( vaa != vbb); #ifdef CGAL_CDT_2_DEBUG_INTERSECTIONS std::cerr << CGAL::internal::cdt_2_indent_level - << "CT_plus_2::insert_subconstraint, stack pop=( #" << vaa->time_stamp() << "= " << vaa->point() - << " , #" << vbb->time_stamp() << "= " << vbb->point() + << "CT_plus_2::insert_subconstraint, stack pop=( " << display_vertex(vaa) + << " , " << display_vertex(vbb) << " ) remaining stack size: " << stack.size() << '\n'; CGAL_assertion(this->is_valid()); @@ -914,8 +918,8 @@ insert_subconstraint(Vertex_handle vaa, if(this->includes_edge(vaa,vbb,vi,fr,i)) { #ifdef CGAL_CDT_2_DEBUG_INTERSECTIONS std::cerr << CGAL::internal::cdt_2_indent_level - << "CT_plus_2::insert_subconstraint, the segment ( #" << vaa->time_stamp() << "= " << vaa->point() - << " , #" << vbb->time_stamp() << "= " << vbb->point() + << "CT_plus_2::insert_subconstraint, the segment ( " << display_vertex(vaa) + << " , " << display_vertex(vbb) << " ) is an edge with #" << vi->time_stamp() << "= " << vi->point() << '\n'; @@ -925,8 +929,8 @@ insert_subconstraint(Vertex_handle vaa, hierarchy.split_constraint(vaa,vbb,vi); #ifdef CGAL_CDT_2_DEBUG_INTERSECTIONS std::cerr << CGAL::internal::cdt_2_indent_level - << "CT_plus_2::insert_constraint (includes_edge) stack push [vi, vbb] ( #" << vi->time_stamp() << "= " << vi->point() - << " , #" << vbb->time_stamp() << "= " << vbb->point() + << "CT_plus_2::insert_constraint (includes_edge) stack push [vi, vbb] ( " << display_vertex(vi) + << " , " << display_vertex(vbb) << " )\n"; #endif // CGAL_CDT_2_DEBUG_INTERSECTIONS stack.push(std::make_pair(vi,vbb)); @@ -949,12 +953,12 @@ insert_subconstraint(Vertex_handle vaa, hierarchy.split_constraint(vaa,vbb,vi); #ifdef CGAL_CDT_2_DEBUG_INTERSECTIONS std::cerr << CGAL::internal::cdt_2_indent_level - << "CT_plus_2::insert_constraint stack push [vaa, vi] ( #" << vaa->time_stamp() << "= " << vaa->point() - << " , #" << vi->time_stamp() << "= " << vi->point() + << "CT_plus_2::insert_constraint stack push [vaa, vi] ( " << display_vertex(vaa) + << " , " << display_vertex(vi) << " )\n"; std::cerr << CGAL::internal::cdt_2_indent_level - << "CT_plus_2::insert_constraint stack push [vi, vbb] ( #" << vi->time_stamp() << "= " << vi->point() - << " , #" << vbb->time_stamp() << "= " << vbb->point() + << "CT_plus_2::insert_constraint stack push [vi, vbb] ( " << display_vertex(vi) + << " , " << display_vertex(vbb) << " )\n"; #endif // CGAL_CDT_2_DEBUG_INTERSECTIONS stack.push(std::make_pair(vaa,vi)); @@ -963,8 +967,8 @@ insert_subconstraint(Vertex_handle vaa, else { #ifdef CGAL_CDT_2_DEBUG_INTERSECTIONS std::cerr << CGAL::internal::cdt_2_indent_level - << "CT_plus_2::insert_constraint stack push [vaa, vbb]( #" << vaa->time_stamp() << "= " << vaa->point() - << " , #" << vbb->time_stamp() << "= " << vbb->point() + << "CT_plus_2::insert_constraint stack push [vaa, vbb]( " << display_vertex(vaa) + << " , " << display_vertex(vbb) << " )\n"; #endif // CGAL_CDT_2_DEBUG_INTERSECTIONS stack.push(std::make_pair(vaa,vbb)); @@ -1180,10 +1184,10 @@ intersect(Face_handle f, int i, const Point& pd = vd->point(); #ifdef CGAL_CDT_2_DEBUG_INTERSECTIONS std::cerr << CGAL::internal::cdt_2_indent_level - << "CT_plus_2::intersect segment ( #" << va->time_stamp() << "= " << va->point() - << " , #" << vb->time_stamp() << "= " << vb->point() + << "CT_plus_2::intersect segment ( " << display_vertex(va) + << " , " << display_vertex(vb) << " ) with edge ( #"<< vc->time_stamp() << "= " << vc->point() - << " , #" << vd->time_stamp() << "= " << vd->point() + << " , " << display_vertex(vd) << " , Exact_intersections_tag)\n"; #endif // CGAL_CDT_2_DEBUG_INTERSECTIONS Point pi(ORIGIN); // initialize although we are sure that it will be @@ -1196,7 +1200,7 @@ intersect(Face_handle f, int i, Vertex_handle vi = insert(pi, Triangulation::EDGE, f, i); #ifdef CGAL_CDT_2_DEBUG_INTERSECTIONS std::cerr << CGAL::internal::cdt_2_indent_level - << "CT_plus_2::intersect, `vi` is ( #" << vi->time_stamp() << "= " << vi->point() + << "CT_plus_2::intersect, `vi` is ( " << display_vertex(vi) << " )\n"; #endif // CGAL_CDT_2_DEBUG_INTERSECTIONS return vi; @@ -1220,10 +1224,10 @@ intersect(Face_handle f, int i, const Point& pd = vdd->point(); #ifdef CGAL_CDT_2_DEBUG_INTERSECTIONS std::cerr << CGAL::internal::cdt_2_indent_level - << "CT_plus_2::intersect segment ( #" << vaa->time_stamp() << "= " << vaa->point() - << " , #" << vbb->time_stamp() << "= " << vbb->point() + << "CT_plus_2::intersect segment ( " << display_vertex(vaa) + << " , " << display_vertex(vbb) << " ) with edge ( #"<< vcc->time_stamp() << "= " << vcc->point() - << " , #" << vdd->time_stamp() << "= " << vdd->point() + << " , " << display_vertex(vdd) << " , Exact_predicates_tag)\n"; #endif // CGAL_CDT_2_DEBUG_INTERSECTIONS diff --git a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h index a6c2bf44571..7178b1dc5fa 100644 --- a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h @@ -25,7 +25,9 @@ #include #ifdef CGAL_CDT_2_DEBUG_INTERSECTIONS +# include # include +# include #endif namespace CGAL { @@ -860,12 +862,10 @@ insert_constraint(T va, T vb){ Context_list* fathers; #ifdef CGAL_CDT_2_DEBUG_INTERSECTIONS + using CGAL::IO::oformat; std::cerr << CGAL::internal::cdt_2_indent_level - << "C_hierachy.insert_constraint( #" - << va->time_stamp() - << ", #" - << vb->time_stamp() - << ")\n"; + << "C_hierachy.insert_constraint( " + << oformat(va) << ", " << oformat(vb) << ")\n"; #endif // CGAL_CDT_2_DEBUG_INTERSECTIONS typename Sc_to_c_map::iterator scit = sc_to_c_map.find(he); if(scit == sc_to_c_map.end()){ @@ -897,12 +897,10 @@ insert_constraint_old_API(T va, T vb){ Context_list* fathers; #ifdef CGAL_CDT_2_DEBUG_INTERSECTIONS + using CGAL::IO::oformat; std::cerr << CGAL::internal::cdt_2_indent_level - << "C_hierachy.insert_constraint_old_API( #" - << va->time_stamp() - << ", #" - << vb->time_stamp() - << ")\n"; + << "C_hierachy.insert_constraint_old_API( " + << oformat(va) << ", " << oformat(vb) << ")\n"; #endif // CGAL_CDT_2_DEBUG_INTERSECTIONS typename Sc_to_c_map::iterator scit = sc_to_c_map.find(he); if(scit == sc_to_c_map.end()){ @@ -932,12 +930,10 @@ append_constraint(Constraint_id cid, T va, T vb){ Context_list* fathers; #ifdef CGAL_CDT_2_DEBUG_INTERSECTIONS + using CGAL::IO::oformat; std::cerr << CGAL::internal::cdt_2_indent_level - << "C_hierachy.append_constraint( ..., #" - << va->time_stamp() - << ", #" - << vb->time_stamp() - << ")\n"; + << "C_hierachy.append_constraint( ..., " + << oformat(va) << ", " << oformat(vb) << ")\n"; #endif // CGAL_CDT_2_DEBUG_INTERSECTIONS typename Sc_to_c_map::iterator scit = sc_to_c_map.find(he); if(scit == sc_to_c_map.end()){ @@ -1051,14 +1047,11 @@ void Polyline_constraint_hierarchy_2:: add_Steiner(T va, T vb, T vc){ #ifdef CGAL_CDT_2_DEBUG_INTERSECTIONS + using CGAL::IO::oformat; std::cerr << CGAL::internal::cdt_2_indent_level - << "C_hierachy.add_Steinter( #" - << va->time_stamp() - << ", #" - << vb->time_stamp() - << ", #" - << vc->time_stamp() - << ")\n"; + << "C_hierachy.add_Steinter( " + << oformat(va) << ", " << oformat(vb) << ", " << oformat(vc) + << ")\n"; #endif // CGAL_CDT_2_DEBUG_INTERSECTIONS Context_list* hcl=nullptr; if(!get_contexts(va,vb,hcl)) { diff --git a/Triangulation_2/test/Triangulation_2/issue_4405.cpp b/Triangulation_2/test/Triangulation_2/issue_4405.cpp index c0e412e6209..ff8ebffa239 100644 --- a/Triangulation_2/test/Triangulation_2/issue_4405.cpp +++ b/Triangulation_2/test/Triangulation_2/issue_4405.cpp @@ -4,47 +4,20 @@ #include #include #include +#include typedef CGAL::Epick Kernel; typedef Kernel::FT FieldNumberType; typedef Kernel::Point_2 Point2; typedef Kernel::Point_3 Point3; -template -class My_vertex_base : public Vb { - std::size_t time_stamp_; -public: - My_vertex_base() : Vb(), time_stamp_(-1) { - } - - My_vertex_base(const My_vertex_base& other) : - Vb(other), - time_stamp_(other.time_stamp_) - {} - - typedef CGAL::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; - } - - template < class TDS > - struct Rebind_TDS { - typedef typename Vb::template Rebind_TDS::Other Vb2; - typedef My_vertex_base Other; - }; -}; - struct FaceInfo2 { unsigned long long m_id; }; typedef CGAL::Projection_traits_xy_3 TriangulationTraits; typedef CGAL::Triangulation_vertex_base_with_id_2 VertexBaseWithId; -typedef My_vertex_base Vb2; +typedef CGAL::Base_with_time_stamp Vb2; typedef CGAL::Triangulation_vertex_base_2 VertexBase; typedef CGAL::Triangulation_face_base_with_info_2 FaceBaseWithInfo; typedef CGAL::Constrained_triangulation_face_base_2 FaceBase; diff --git a/Triangulation_2/test/Triangulation_2/test_cdt_degenerate_case.cpp b/Triangulation_2/test/Triangulation_2/test_cdt_degenerate_case.cpp index b4de0e1e0f7..3c2bcf48f3f 100644 --- a/Triangulation_2/test/Triangulation_2/test_cdt_degenerate_case.cpp +++ b/Triangulation_2/test/Triangulation_2/test_cdt_degenerate_case.cpp @@ -2,41 +2,14 @@ #include #include #include +#include #include typedef CGAL::Exact_predicates_inexact_constructions_kernel EPIC; typedef EPIC::Point_2 Point_2; -template -class My_vertex_base : public Vb { - std::size_t time_stamp_; -public: - My_vertex_base() : Vb(), time_stamp_(-1) { - } - - My_vertex_base(const My_vertex_base& other) : - Vb(other), - time_stamp_(other.time_stamp_) - {} - - typedef CGAL::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; - } - - template < class TDS > - struct Rebind_TDS { - typedef typename Vb::template Rebind_TDS::Other Vb2; - typedef My_vertex_base Other; - }; -}; - #ifdef CGAL_CDT_2_DEBUG_INTERSECTIONS -typedef My_vertex_base > Vb; +typedef CGAL::Base_with_time_stamp > Vb; #else typedef CGAL::Triangulation_vertex_base_2 Vb; #endif diff --git a/Triangulation_3/benchmark/Triangulation_3/CMakeLists.txt b/Triangulation_3/benchmark/Triangulation_3/CMakeLists.txt index 6d9dd5907d5..19fd0c0efac 100644 --- a/Triangulation_3/benchmark/Triangulation_3/CMakeLists.txt +++ b/Triangulation_3/benchmark/Triangulation_3/CMakeLists.txt @@ -8,51 +8,29 @@ project(Triangulation_3) # CGAL and its components find_package(CGAL REQUIRED) -# Boost and its components -find_package(Boost REQUIRED) - -if(NOT Boost_FOUND) - - message( - STATUS "This project requires the Boost library, and will not be compiled.") - - return() - -endif() - -# include for local directory - -# include for local package - -# Creating entries for all C++ files with "main" routine -# ########################################################## - create_single_source_cgal_program("incident_edges.cpp") - create_single_source_cgal_program("simple_2.cpp") - create_single_source_cgal_program("simple.cpp") - create_single_source_cgal_program("Triangulation_benchmark_3.cpp") +create_single_source_cgal_program("segment_traverser_benchmark.cpp" ) -create_single_source_cgal_program( "segment_traverser_benchmark.cpp" ) - -find_package(benchmark) - -if(TARGET benchmark::benchmark) - find_package(TBB REQUIRED) - include(CGAL_TBB_support) - - create_single_source_cgal_program("DT3_benchmark_with_TBB.cpp") - target_link_libraries(DT3_benchmark_with_TBB PRIVATE benchmark::benchmark - CGAL::TBB_support) - - add_executable(DT3_benchmark_with_TBB_CCC_approximate_size - DT3_benchmark_with_TBB.cpp) - target_compile_definitions( - DT3_benchmark_with_TBB_CCC_approximate_size - PRIVATE CGAL_CONCURRENT_COMPACT_CONTAINER_APPROXIMATE_SIZE) - target_link_libraries( - DT3_benchmark_with_TBB_CCC_approximate_size - PRIVATE CGAL::CGAL benchmark::benchmark CGAL::TBB_support) +find_package(benchmark QUIET) +if(NOT TARGET benchmark::benchmark) + message(STATUS "NOTICE: Some benchmarks require the Google benchmark library, and will not be compiled.") + return() +endif() + +find_package(TBB REQUIRED) +include(CGAL_TBB_support) +if(TARGET CGAL::TBB_support) + create_single_source_cgal_program("DT3_benchmark_with_TBB.cpp") + target_link_libraries(DT3_benchmark_with_TBB PRIVATE benchmark::benchmark CGAL::TBB_support) + + add_executable(DT3_benchmark_with_TBB_CCC_approximate_size DT3_benchmark_with_TBB.cpp) + target_compile_definitions(DT3_benchmark_with_TBB_CCC_approximate_size + PRIVATE CGAL_CONCURRENT_COMPACT_CONTAINER_APPROXIMATE_SIZE) + target_link_libraries(DT3_benchmark_with_TBB_CCC_approximate_size + PRIVATE CGAL::CGAL benchmark::benchmark CGAL::TBB_support) +else() + message(STATUS "NOTICE: Some benchmarks require the TBB library, and will not be compiled.") endif() diff --git a/Triangulation_3/demo/Triangulation_3/CMakeLists.txt b/Triangulation_3/demo/Triangulation_3/CMakeLists.txt index 512c39d52fa..d142ca17989 100644 --- a/Triangulation_3/demo/Triangulation_3/CMakeLists.txt +++ b/Triangulation_3/demo/Triangulation_3/CMakeLists.txt @@ -81,7 +81,7 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND) include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) cgal_add_compilation_test(T3_demo) -else(Qt5_FOUND) +else(CGAL_Qt5_FOUND AND Qt5_FOUND) set(TRIANGULATION_3_MISSING_DEPS "") @@ -94,11 +94,6 @@ else(Qt5_FOUND) set(TRIANGULATION_3_MISSING_DEPS "Qt5, ${TRIANGULATION_3_MISSING_DEPS}") endif() - message( - STATUS - "NOTICE: This demo requires ${TRIANGULATION_3_MISSING_DEPS}and will not be compiled." - ) + message("NOTICE: This demo requires ${TRIANGULATION_3_MISSING_DEPS}, and will not be compiled.") -endif( - CGAL_Qt5_FOUND - AND Qt5_FOUND) +endif(CGAL_Qt5_FOUND AND Qt5_FOUND) diff --git a/Triangulation_3/examples/Triangulation_3/CMakeLists.txt b/Triangulation_3/examples/Triangulation_3/CMakeLists.txt index 94b035fc9d0..4519992969f 100644 --- a/Triangulation_3/examples/Triangulation_3/CMakeLists.txt +++ b/Triangulation_3/examples/Triangulation_3/CMakeLists.txt @@ -25,20 +25,21 @@ create_single_source_cgal_program("simplex.cpp") create_single_source_cgal_program("draw_triangulation_3.cpp") if(CGAL_Qt5_FOUND) target_link_libraries(draw_triangulation_3 PUBLIC CGAL::CGAL_Basic_viewer) +else() + message(STATUS "NOTICE: The example 'draw_triangulation_3' requires Qt5, and will not be compiled.") endif() find_package(TBB QUIET) include(CGAL_TBB_support) if(TARGET CGAL::TBB_support) - create_single_source_cgal_program( - "parallel_insertion_and_removal_in_regular_3.cpp") + message(STATUS "Found TBB") + + create_single_source_cgal_program("parallel_insertion_and_removal_in_regular_3.cpp") create_single_source_cgal_program("parallel_insertion_in_delaunay_3.cpp") create_single_source_cgal_program("sequential_parallel.cpp") - target_link_libraries(parallel_insertion_and_removal_in_regular_3 - PUBLIC CGAL::TBB_support) - target_link_libraries(parallel_insertion_in_delaunay_3 - PUBLIC CGAL::TBB_support) + target_link_libraries(parallel_insertion_and_removal_in_regular_3 PUBLIC CGAL::TBB_support) + target_link_libraries(parallel_insertion_in_delaunay_3 PUBLIC CGAL::TBB_support) target_link_libraries(sequential_parallel PUBLIC CGAL::TBB_support) if(BUILD_TESTING) @@ -49,5 +50,5 @@ if(TARGET CGAL::TBB_support) PROPERTY RUN_SERIAL 1) endif() else() - message(STATUS "NOTICE: a few examples require TBB and will not be compiled.") + message(STATUS "NOTICE: A few examples require TBB, and will not be compiled.") endif() diff --git a/Triangulation_3/include/CGAL/Triangulation_3.h b/Triangulation_3/include/CGAL/Triangulation_3.h index add6a8519f9..c5cff3b9f35 100644 --- a/Triangulation_3/include/CGAL/Triangulation_3.h +++ b/Triangulation_3/include/CGAL/Triangulation_3.h @@ -1651,7 +1651,7 @@ protected: tds().delete_vertex(inserted); } -private: +protected: typedef Facet Edge_2D; typedef Triple Vertex_triple; typedef typename Base::template Vertex_triple_Facet_map_generator< @@ -1659,8 +1659,8 @@ private: typedef typename Base::template Vertex_handle_unique_hash_map_generator< Vertex_handle>::type Vertex_handle_unique_hash_map; - Vertex_triple make_vertex_triple(const Facet& f) const; - void make_canonical_oriented_triple(Vertex_triple& t) const; + static Vertex_triple make_vertex_triple(const Facet& f); + static void make_canonical_oriented_triple(Vertex_triple& t); template < class VertexRemover > VertexRemover& make_hole_2D(Vertex_handle v, std::list& hole, @@ -1673,13 +1673,32 @@ private: template < class VertexRemover > void fill_hole_2D(std::list& hole, VertexRemover& remover); - void make_hole_3D(Vertex_handle v, - Vertex_triple_Facet_map& outer_map, - std::vector& hole); - // When the incident cells are already known - void make_hole_3D(Vertex_handle v, - const std::vector& incident_cells, - Vertex_triple_Facet_map& outer_map); + Vertex_triple_Facet_map + create_hole_outer_map(Vertex_handle v, + const std::vector& hole); + + template < class Triangulation > + static Vertex_triple_Facet_map + create_triangulation_inner_map(const Triangulation& t, + const Vertex_handle_unique_hash_map& vmap, + bool inf); + + template + OutputItCells copy_triangulation_into_hole(const Vertex_handle_unique_hash_map& vmap, + Vertex_triple_Facet_map&& outer_map, + const Vertex_triple_Facet_map& inner_map, + OutputItCells fit); + + struct Fill_auxiliary_return_type { + Vertex_handle_unique_hash_map vmap; + bool vertex_is_incident_to_infinity; + }; + + template < class Triangulation > + Fill_auxiliary_return_type + fill_auxiliary_triangulation_with_vertices_around_v(Triangulation& t, + Vertex_handle v, + std::vector& adj_vertices) const; template < class VertexRemover > VertexRemover& remove_dim_down(Vertex_handle v, VertexRemover& remover); @@ -1762,7 +1781,7 @@ private: std::map& vstates); void _make_big_hole_3D(Vertex_handle v, - std::map& outer_map, + Vertex_triple_Facet_map& outer_map, std::vector& hole, std::vector& vertices, std::map& vstates); @@ -4359,7 +4378,7 @@ Triangulation_3::insert_and_give_new_cells(const Point& p, template < class Gt, class Tds, class Lds > typename Triangulation_3::Vertex_triple Triangulation_3:: -make_vertex_triple(const Facet& f) const +make_vertex_triple(const Facet& f) { Cell_handle ch = f.first; int i = f.second; @@ -4372,7 +4391,7 @@ make_vertex_triple(const Facet& f) const template < class Gt, class Tds, class Lds > void Triangulation_3:: -make_canonical_oriented_triple(Vertex_triple& t) const +make_canonical_oriented_triple(Vertex_triple& t) { int i = (t.first < t.second) ? 0 : 1; if(i==0) @@ -4906,19 +4925,16 @@ fill_hole_2D(std::list& first_hole, VertexRemover& remover, OutputItCel } } +// When the incident cells are already known template < class Gt, class Tds, class Lds > -void +typename Triangulation_3::Vertex_triple_Facet_map Triangulation_3:: -make_hole_3D(Vertex_handle v, - Vertex_triple_Facet_map& outer_map, - std::vector& hole) +create_hole_outer_map(Vertex_handle v, const std::vector& incident_cells) { CGAL_expensive_precondition(! test_dim_down(v)); - incident_cells(v, std::back_inserter(hole)); - - for(typename std::vector::iterator cit = hole.begin(), - end = hole.end(); + Vertex_triple_Facet_map outer_map; + for(auto cit = incident_cells.begin(), end = incident_cells.end(); cit != end; ++cit) { int indv = (*cit)->index(v); @@ -4933,35 +4949,206 @@ make_hole_3D(Vertex_handle v, (*cit)->vertex(i)->set_cell(opp_cit); } } + return outer_map; } -// When the incident cells are already known template < class Gt, class Tds, class Lds > -void +template < class Triangulation > +typename Triangulation_3::Vertex_triple_Facet_map Triangulation_3:: -make_hole_3D(Vertex_handle v, - const std::vector& incident_cells, - Vertex_triple_Facet_map& outer_map) -{ - CGAL_expensive_precondition(! test_dim_down(v)); +create_triangulation_inner_map(const Triangulation& t, + const Vertex_handle_unique_hash_map& vmap, + bool all_cells) { + Vertex_triple_Facet_map inner_map; - for(typename std::vector::const_iterator cit = incident_cells.begin(), - end = incident_cells.end(); cit != end; ++cit) + if(all_cells) { - int indv = (*cit)->index(v); - Cell_handle opp_cit = (*cit)->neighbor(indv); - Facet f(opp_cit, opp_cit->index(*cit)); - Vertex_triple vt = make_vertex_triple(f); - make_canonical_oriented_triple(vt); - outer_map[vt] = f; - for(int i=0; i<4; i++) + for(All_cells_iterator it = t.all_cells_begin(), + end = t.all_cells_end(); it != end; ++it) { - if(i != indv) - (*cit)->vertex(i)->set_cell(opp_cit); + for(unsigned int index=0; index < 4; index++) + { + Facet f = std::pair(it,index); + Vertex_triple vt_aux = make_vertex_triple(f); + Vertex_triple vt(vmap[vt_aux.first], vmap[vt_aux.third], vmap[vt_aux.second]); + make_canonical_oriented_triple(vt); + inner_map[vt] = f; + } + } + } else + { + for(Finite_cells_iterator it = t.finite_cells_begin(), + end = t.finite_cells_end(); it != end; ++it) + { + for(unsigned int index=0; index < 4; index++) + { + Facet f = std::pair(it,index); + Vertex_triple vt_aux = make_vertex_triple(f); + Vertex_triple vt(vmap[vt_aux.first], vmap[vt_aux.third], vmap[vt_aux.second]); + make_canonical_oriented_triple(vt); + inner_map[vt] = f; + } } } + return inner_map; } +template < class Gt, class Tds, class Lds > +template < class Triangulation > +typename Triangulation_3::Fill_auxiliary_return_type +Triangulation_3:: +fill_auxiliary_triangulation_with_vertices_around_v(Triangulation& t, + Vertex_handle v, + std::vector& adj_vertices) const +{ + Fill_auxiliary_return_type result; + Vertex_handle_unique_hash_map& vmap = result.vmap; + unsigned int i = 0; + Cell_handle ch = Cell_handle(); +#ifdef CGAL_TRIANGULATION_3_USE_THE_4_POINTS_CONSTRUCTOR + size_t num_vertices = adj_vertices.size(); + if(num_vertices >= 5) + { + for(int j = 0 ; j < 4 ; ++j) + { + if(is_infinite(adj_vertices[j])) + { + std::swap(adj_vertices[j], adj_vertices[4]); + break; + } + } + + Orientation o = orientation(adj_vertices[0]->point(), + adj_vertices[1]->point(), + adj_vertices[2]->point(), + adj_vertices[3]->point()); + + if(o == NEGATIVE) + std::swap(adj_vertices[0], adj_vertices[1]); + + if(o != ZERO) + { + Vertex_handle vh1, vh2, vh3, vh4; + t.init_tds(adj_vertices[0]->point(), adj_vertices[1]->point(), + adj_vertices[2]->point(), adj_vertices[3]->point(), + vh1, vh2, vh3, vh4); + + ch = vh1->cell(); + vmap[vh1] = adj_vertices[0]; + vmap[vh2] = adj_vertices[1]; + vmap[vh3] = adj_vertices[2]; + vmap[vh4] = adj_vertices[3]; + i = 4; + } + } +#endif + + for(; i < adj_vertices.size(); i++) + { + if(! is_infinite(adj_vertices[i])) + { + Vertex_handle vh = t.insert(adj_vertices[i]->point(), ch); + ch = vh->cell(); + vmap[vh] = adj_vertices[i]; + } + else + { + result.vertex_is_incident_to_infinity = true; + } + } + + if(t.dimension() == 2) + { + Vertex_handle fake_inf = t.insert(v->point()); + vmap[fake_inf] = infinite_vertex(); + } + else + { + vmap[t.infinite_vertex()] = infinite_vertex(); + } + + CGAL_assertion(t.dimension() == 3); + + return result; +} + +template < class Gt, class Tds, class Lds > +template < class OutputItCells > +OutputItCells +Triangulation_3:: +copy_triangulation_into_hole(const Vertex_handle_unique_hash_map& vmap, + Vertex_triple_Facet_map&& outer_map, + const Vertex_triple_Facet_map& inner_map, + OutputItCells fit) +{ + while(! outer_map.empty()) + { + typename Vertex_triple_Facet_map::iterator oit = outer_map.begin(); + while(is_infinite(oit->first.first) || + is_infinite(oit->first.second) || + is_infinite(oit->first.third)) + { + ++oit; + // Otherwise the lookup in the inner_map fails + // because the infinite vertices are different + } + + typename Vertex_triple_Facet_map::value_type o_vt_f_pair = *oit; + outer_map.erase(oit); + Cell_handle o_ch = o_vt_f_pair.second.first; + unsigned int o_i = o_vt_f_pair.second.second; + + auto iit = inner_map.find(o_vt_f_pair.first); + CGAL_assertion(iit != inner_map.end()); + typename Vertex_triple_Facet_map::value_type i_vt_f_pair = *iit; + Cell_handle i_ch = i_vt_f_pair.second.first; + unsigned int i_i = i_vt_f_pair.second.second; + + // Create a new cell and glue it to the outer surface + Cell_handle new_ch = tds().create_cell(); + *fit++ = new_ch; + new_ch->set_vertices(vmap[i_ch->vertex(0)], vmap[i_ch->vertex(1)], + vmap[i_ch->vertex(2)], vmap[i_ch->vertex(3)]); + + o_ch->set_neighbor(o_i,new_ch); + new_ch->set_neighbor(i_i, o_ch); + + for(int j=0; j<4; j++) + new_ch->vertex(j)->set_cell(new_ch); + + // For the other faces check, if they can also be glued + for(unsigned int index = 0; index < 4; index++) + { + if(index != i_i) + { + Facet f = std::pair(new_ch, index); + Vertex_triple vt = make_vertex_triple(f); + make_canonical_oriented_triple(vt); + std::swap(vt.second, vt.third); + + typename Vertex_triple_Facet_map::iterator oit2 = outer_map.find(vt); + if(oit2 == outer_map.end()) + { + std::swap(vt.second, vt.third); + outer_map[vt] = f; + } + else + { + // glue the faces + typename Vertex_triple_Facet_map::value_type o_vt_f_pair2 = *oit2; + Cell_handle o_ch2 = o_vt_f_pair2.second.first; + int o_i2 = o_vt_f_pair2.second.second; + o_ch2->set_neighbor(o_i2, new_ch); + new_ch->set_neighbor(index, o_ch2); + outer_map.erase(oit2); + } + } + } + } + return fit; +} + + template < class Gt, class Tds, class Lds > template < class VertexRemover > VertexRemover& @@ -5030,201 +5217,7 @@ VertexRemover& Triangulation_3:: remove_3D(Vertex_handle v, VertexRemover& remover) { - std::vector hole; - hole.reserve(64); - - // Construct the set of vertex triples on the boundary - // with the facet just behind - Vertex_triple_Facet_map outer_map; - Vertex_triple_Facet_map inner_map; - - make_hole_3D(v, outer_map, hole); - CGAL_assertion(remover.hidden_points_begin() == remover.hidden_points_end()); - - // Output the hidden points. - for(typename std::vector::iterator hi = hole.begin(), - hend = hole.end(); - hi != hend; ++hi) - { - remover.add_hidden_points(*hi); - } - - bool inf = false; - - // collect all vertices on the boundary - std::vector vertices; - vertices.reserve(64); - adjacent_vertices(v, std::back_inserter(vertices)); - - // create a Delaunay triangulation of the points on the boundary - // and make a map from the vertices in remover.tmp towards the vertices - // in *this - - unsigned int i = 0; - Vertex_handle_unique_hash_map vmap; - Cell_handle ch = Cell_handle(); -#ifdef CGAL_TRIANGULATION_3_USE_THE_4_POINTS_CONSTRUCTOR - size_t num_vertices = vertices.size(); - if(num_vertices >= 5) - { - for(int j = 0 ; j < 4 ; ++j) - { - if(is_infinite(vertices[j])) - { - std::swap(vertices[j], vertices[4]); - break; - } - } - - Orientation o = orientation(vertices[0]->point(), - vertices[1]->point(), - vertices[2]->point(), - vertices[3]->point()); - - if(o == NEGATIVE) - std::swap(vertices[0], vertices[1]); - - if(o != ZERO) - { - Vertex_handle vh1, vh2, vh3, vh4; - remover.tmp.init_tds(vertices[0]->point(), vertices[1]->point(), - vertices[2]->point(), vertices[3]->point(), - vh1, vh2, vh3, vh4); - ch = vh1->cell(); - vmap[vh1] = vertices[0]; - vmap[vh2] = vertices[1]; - vmap[vh3] = vertices[2]; - vmap[vh4] = vertices[3]; - i = 4; - } - } -#endif - - for(; i < vertices.size(); i++) - { - if(! is_infinite(vertices[i])) - { - Vertex_handle vh = remover.tmp.insert(vertices[i]->point(), ch); - ch = vh->cell(); - vmap[vh] = vertices[i]; - } - else - { - inf = true; - } - } - - if(remover.tmp.dimension() == 2) - { - Vertex_handle fake_inf = remover.tmp.insert(v->point()); - vmap[fake_inf] = infinite_vertex(); - } - else - { - vmap[remover.tmp.infinite_vertex()] = infinite_vertex(); - } - - CGAL_assertion(remover.tmp.dimension() == 3); - - // Construct the set of vertex triples of remover.tmp - // We reorient the vertex triple so that it matches those from outer_map - // Also note that we use the vertices of *this, not of remover.tmp - - if(inf) - { - for(All_cells_iterator it = remover.tmp.all_cells_begin(), - end = remover.tmp.all_cells_end(); it != end; ++it) - { - for(i=0; i < 4; i++) - { - Facet f = std::pair(it,i); - Vertex_triple vt_aux = make_vertex_triple(f); - Vertex_triple vt(vmap[vt_aux.first], vmap[vt_aux.third], vmap[vt_aux.second]); - make_canonical_oriented_triple(vt); - inner_map[vt]= f; - } - } - } - else - { - for(Finite_cells_iterator it = remover.tmp.finite_cells_begin(), - end = remover.tmp.finite_cells_end(); it != end; ++it) - { - for(i=0; i < 4; i++) - { - Facet f = std::pair(it,i); - Vertex_triple vt_aux = make_vertex_triple(f); - Vertex_triple vt(vmap[vt_aux.first], vmap[vt_aux.third], vmap[vt_aux.second]); - make_canonical_oriented_triple(vt); - inner_map[vt]= f; - } - } - } - // Grow inside the hole, by extending the surface - while(! outer_map.empty()) - { - typename Vertex_triple_Facet_map::iterator oit = outer_map.begin(); - while(is_infinite(oit->first.first) || - is_infinite(oit->first.second) || - is_infinite(oit->first.third)) - { - ++oit; - // Otherwise the lookup in the inner_map fails - // because the infinite vertices are different - } - - typename Vertex_triple_Facet_map::value_type o_vt_f_pair = *oit; - outer_map.erase(oit); - Cell_handle o_ch = o_vt_f_pair.second.first; - unsigned int o_i = o_vt_f_pair.second.second; - - typename Vertex_triple_Facet_map::iterator iit = inner_map.find(o_vt_f_pair.first); - CGAL_assertion(iit != inner_map.end()); - typename Vertex_triple_Facet_map::value_type i_vt_f_pair = *iit; - Cell_handle i_ch = i_vt_f_pair.second.first; - unsigned int i_i = i_vt_f_pair.second.second; - - // Create a new cell and glue it to the outer surface - Cell_handle new_ch = tds().create_cell(); - new_ch->set_vertices(vmap[i_ch->vertex(0)], vmap[i_ch->vertex(1)], - vmap[i_ch->vertex(2)], vmap[i_ch->vertex(3)]); - - o_ch->set_neighbor(o_i,new_ch); - new_ch->set_neighbor(i_i, o_ch); - - // For the other faces check, if they can also be glued - for(i = 0; i < 4; i++) - { - if(i != i_i) - { - Facet f = std::pair(new_ch,i); - Vertex_triple vt = make_vertex_triple(f); - make_canonical_oriented_triple(vt); - std::swap(vt.second,vt.third); - - typename Vertex_triple_Facet_map::iterator oit2 = outer_map.find(vt); - if(oit2 == outer_map.end()) - { - std::swap(vt.second,vt.third); - outer_map[vt]= f; - } - else - { - // glue the faces - typename Vertex_triple_Facet_map::value_type o_vt_f_pair2 = *oit2; - Cell_handle o_ch2 = o_vt_f_pair2.second.first; - int o_i2 = o_vt_f_pair2.second.second; - o_ch2->set_neighbor(o_i2,new_ch); - new_ch->set_neighbor(i, o_ch2); - outer_map.erase(oit2); - } - } - } - } - tds().delete_vertex(v); - tds().delete_cells(hole.begin(), hole.end()); - - return remover; + return remove_3D(v, remover, Emptyset_iterator()); } template < class Gt, class Tds, class Lds > @@ -5235,192 +5228,37 @@ remove_3D(Vertex_handle v, VertexRemover& remover, const std::vector& inc_cells, std::vector& adj_vertices) { - // Construct the set of vertex triples on the boundary with the facet just behind - Vertex_triple_Facet_map outer_map; - Vertex_triple_Facet_map inner_map; + const auto& hole = inc_cells; - make_hole_3D(v, inc_cells, outer_map); + // Construct the set of vertex triples on the boundary + // with the facet just behind + Vertex_triple_Facet_map outer_map = create_hole_outer_map(v, hole); CGAL_assertion(remover.hidden_points_begin() == remover.hidden_points_end()); // Output the hidden points. - for(typename std::vector::const_iterator hi = inc_cells.begin(), - hend = inc_cells.end(); - hi != hend; ++hi) + for(auto ch: hole) { - remover.add_hidden_points(*hi); + remover.add_hidden_points(ch); } - bool inf = false; - // Create a Delaunay triangulation of the points on the boundary // and make a map from the vertices in remover.tmp towards the vertices // in *this - unsigned int i = 0; - Vertex_handle_unique_hash_map vmap; - Cell_handle ch = Cell_handle(); -#ifdef CGAL_TRIANGULATION_3_USE_THE_4_POINTS_CONSTRUCTOR - size_t num_vertices = adj_vertices.size(); - if(num_vertices >= 5) - { - for(int j = 0 ; j < 4 ; ++j) - { - if(is_infinite(adj_vertices[j])) - { - std::swap(adj_vertices[j], adj_vertices[4]); - break; - } - } - - Orientation o = orientation(adj_vertices[0]->point(), - adj_vertices[1]->point(), - adj_vertices[2]->point(), - adj_vertices[3]->point()); - - if(o == NEGATIVE) - std::swap(adj_vertices[0], adj_vertices[1]); - - if(o != ZERO) - { - Vertex_handle vh1, vh2, vh3, vh4; - remover.tmp.init_tds(adj_vertices[0]->point(), adj_vertices[1]->point(), - adj_vertices[2]->point(), adj_vertices[3]->point(), - vh1, vh2, vh3, vh4); - - ch = vh1->cell(); - vmap[vh1] = adj_vertices[0]; - vmap[vh2] = adj_vertices[1]; - vmap[vh3] = adj_vertices[2]; - vmap[vh4] = adj_vertices[3]; - i = 4; - } - } -#endif - - for(; i < adj_vertices.size(); i++) - { - if(! is_infinite(adj_vertices[i])) - { - Vertex_handle vh = remover.tmp.insert(adj_vertices[i]->point(), ch); - ch = vh->cell(); - vmap[vh] = adj_vertices[i]; - } - else - { - inf = true; - } - } - - if(remover.tmp.dimension()==2) - { - Vertex_handle fake_inf = remover.tmp.insert(v->point()); - vmap[fake_inf] = infinite_vertex(); - } - else - { - vmap[remover.tmp.infinite_vertex()] = infinite_vertex(); - } - - CGAL_assertion(remover.tmp.dimension() == 3); + const auto ret = fill_auxiliary_triangulation_with_vertices_around_v(remover.tmp, v, adj_vertices); + const auto& vmap = ret.vmap; + const bool inf = ret.vertex_is_incident_to_infinity; // Construct the set of vertex triples of remover.tmp // We reorient the vertex triple so that it matches those from outer_map // Also note that we use the vertices of *this, not of remover.tmp - if(inf) - { - for(All_cells_iterator it = remover.tmp.all_cells_begin(), - end = remover.tmp.all_cells_end(); it != end; ++it) - { - for(i=0; i < 4; i++) - { - Facet f = std::pair(it,i); - Vertex_triple vt_aux = make_vertex_triple(f); - Vertex_triple vt(vmap[vt_aux.first],vmap[vt_aux.third],vmap[vt_aux.second]); - make_canonical_oriented_triple(vt); - inner_map[vt]= f; - } - } - } - else - { - for(Finite_cells_iterator it = remover.tmp.finite_cells_begin(), - end = remover.tmp.finite_cells_end(); it != end; ++it) - { - for(i=0; i < 4; i++) - { - Facet f = std::pair(it,i); - Vertex_triple vt_aux = make_vertex_triple(f); - Vertex_triple vt(vmap[vt_aux.first],vmap[vt_aux.third],vmap[vt_aux.second]); - make_canonical_oriented_triple(vt); - inner_map[vt]= f; - } - } - } + const Vertex_triple_Facet_map inner_map = create_triangulation_inner_map(remover.tmp, vmap, inf); // Grow inside the hole, by extending the surface - while(! outer_map.empty()) - { - typename Vertex_triple_Facet_map::iterator oit = outer_map.begin(); - while(is_infinite(oit->first.first) || - is_infinite(oit->first.second) || - is_infinite(oit->first.third)) - { - ++oit; - // otherwise the lookup in the inner_map fails - // because the infinite vertices are different - } + copy_triangulation_into_hole(vmap, std::move(outer_map), inner_map, Emptyset_iterator{}); - typename Vertex_triple_Facet_map::value_type o_vt_f_pair = *oit; - outer_map.erase(oit); - Cell_handle o_ch = o_vt_f_pair.second.first; - unsigned int o_i = o_vt_f_pair.second.second; - - typename Vertex_triple_Facet_map::iterator iit = - inner_map.find(o_vt_f_pair.first); - CGAL_assertion(iit != inner_map.end()); - typename Vertex_triple_Facet_map::value_type i_vt_f_pair = *iit; - Cell_handle i_ch = i_vt_f_pair.second.first; - unsigned int i_i = i_vt_f_pair.second.second; - - // create a new cell and glue it to the outer surface - Cell_handle new_ch = tds().create_cell(); - new_ch->set_vertices(vmap[i_ch->vertex(0)], vmap[i_ch->vertex(1)], - vmap[i_ch->vertex(2)], vmap[i_ch->vertex(3)]); - - o_ch->set_neighbor(o_i,new_ch); - new_ch->set_neighbor(i_i, o_ch); - - // for the other faces check, if they can also be glued - for(i = 0; i < 4; i++) - { - if(i != i_i) - { - Facet f = std::pair(new_ch,i); - Vertex_triple vt = make_vertex_triple(f); - make_canonical_oriented_triple(vt); - std::swap(vt.second,vt.third); - - typename Vertex_triple_Facet_map::iterator oit2 = outer_map.find(vt); - if(oit2 == outer_map.end()) - { - std::swap(vt.second,vt.third); - outer_map[vt]= f; - } - else - { - // glue the faces - typename Vertex_triple_Facet_map::value_type o_vt_f_pair2 = *oit2; - Cell_handle o_ch2 = o_vt_f_pair2.second.first; - int o_i2 = o_vt_f_pair2.second.second; - o_ch2->set_neighbor(o_i2,new_ch); - new_ch->set_neighbor(i, o_ch2); - outer_map.erase(oit2); - } - } - } - } tds().delete_vertex(v); - tds().delete_cells(inc_cells.begin(), inc_cells.end()); + tds().delete_cells(hole.begin(), hole.end()); return remover; } @@ -5567,162 +5405,42 @@ remove_3D(Vertex_handle v, VertexRemover& remover, OutputItCells fit) { CGAL_precondition(dimension() == 3); + // Collect all vertices on the boundary of the hole + std::vector adj_vertices; + adj_vertices.reserve(64); + adjacent_vertices(v, std::back_inserter(adj_vertices)); + std::vector hole; hole.reserve(64); + incident_cells(v, std::back_inserter(hole)); // Construct the set of vertex triples on the boundary // with the facet just behind - Vertex_triple_Facet_map outer_map; - Vertex_triple_Facet_map inner_map; - - make_hole_3D(v, outer_map, hole); + Vertex_triple_Facet_map outer_map = create_hole_outer_map(v, hole); CGAL_assertion(remover.hidden_points_begin() == remover.hidden_points_end()); // Output the hidden points. - for(typename std::vector::iterator hi = hole.begin(), - hend = hole.end(); - hi != hend; ++hi) + for(auto ch: hole) { - remover.add_hidden_points(*hi); + remover.add_hidden_points(ch); } - bool inf = false; - unsigned int i; - - // collect all vertices on the boundary - std::vector vertices; - vertices.reserve(64); - adjacent_vertices(v, std::back_inserter(vertices)); - - // create a Delaunay triangulation of the points on the boundary + // Create a Delaunay triangulation of the points on the boundary // and make a map from the vertices in remover.tmp towards the vertices // in *this - Vertex_handle_unique_hash_map vmap; - Cell_handle ch = Cell_handle(); - for(i=0; ipoint(), ch); - ch = vh->cell(); - vmap[vh] = vertices[i]; - } - else - { - inf = true; - } - } - - if(remover.tmp.dimension()==2) - { - Vertex_handle fake_inf = remover.tmp.insert(v->point()); - vmap[fake_inf] = infinite_vertex(); - } - else - { - vmap[remover.tmp.infinite_vertex()] = infinite_vertex(); - } - - CGAL_assertion(remover.tmp.dimension() == 3); + const auto ret = fill_auxiliary_triangulation_with_vertices_around_v(remover.tmp, v, adj_vertices); + const auto& vmap = ret.vmap; + const bool inf = ret.vertex_is_incident_to_infinity; // Construct the set of vertex triples of remover.tmp // We reorient the vertex triple so that it matches those from outer_map // Also note that we use the vertices of *this, not of remover.tmp - - if(inf) - { - for(All_cells_iterator it = remover.tmp.all_cells_begin(), - end = remover.tmp.all_cells_end(); it != end; ++it) - { - for(i=0; i < 4; i++) - { - Facet f = std::pair(it,i); - Vertex_triple vt_aux = make_vertex_triple(f); - Vertex_triple vt(vmap[vt_aux.first], vmap[vt_aux.third], vmap[vt_aux.second]); - make_canonical_oriented_triple(vt); - inner_map[vt] = f; - } - } - } else - { - for(Finite_cells_iterator it = remover.tmp.finite_cells_begin(), - end = remover.tmp.finite_cells_end(); it != end; ++it) - { - for(i=0; i < 4; i++) - { - Facet f = std::pair(it,i); - Vertex_triple vt_aux = make_vertex_triple(f); - Vertex_triple vt(vmap[vt_aux.first], vmap[vt_aux.third], vmap[vt_aux.second]); - make_canonical_oriented_triple(vt); - inner_map[vt] = f; - } - } - } + const Vertex_triple_Facet_map inner_map = create_triangulation_inner_map(remover.tmp, vmap, inf); // Grow inside the hole, by extending the surface - while(! outer_map.empty()) - { - typename Vertex_triple_Facet_map::iterator oit = outer_map.begin(); - while(is_infinite(oit->first.first) || - is_infinite(oit->first.second) || - is_infinite(oit->first.third)) - { - ++oit; - // otherwise the lookup in the inner_map fails - // because the infinite vertices are different - } + copy_triangulation_into_hole(vmap, std::move(outer_map), inner_map, fit); - typename Vertex_triple_Facet_map::value_type o_vt_f_pair = *oit; - outer_map.erase(oit); - Cell_handle o_ch = o_vt_f_pair.second.first; - unsigned int o_i = o_vt_f_pair.second.second; - - typename Vertex_triple_Facet_map::iterator iit = - inner_map.find(o_vt_f_pair.first); - CGAL_assertion(iit != inner_map.end()); - typename Vertex_triple_Facet_map::value_type i_vt_f_pair = *iit; - Cell_handle i_ch = i_vt_f_pair.second.first; - unsigned int i_i = i_vt_f_pair.second.second; - - // create a new cell and glue it to the outer surface - Cell_handle new_ch = tds().create_cell(); - *fit++ = new_ch; - - new_ch->set_vertices(vmap[i_ch->vertex(0)], vmap[i_ch->vertex(1)], - vmap[i_ch->vertex(2)], vmap[i_ch->vertex(3)]); - - o_ch->set_neighbor(o_i,new_ch); - new_ch->set_neighbor(i_i, o_ch); - - // for the other faces check, if they can also be glued - for(i = 0; i < 4; i++) - { - if(i != i_i) - { - Facet f = std::pair(new_ch,i); - Vertex_triple vt = make_vertex_triple(f); - make_canonical_oriented_triple(vt); - std::swap(vt.second, vt.third); - typename Vertex_triple_Facet_map::iterator oit2 = outer_map.find(vt); - if(oit2 == outer_map.end()) - { - std::swap(vt.second, vt.third); - outer_map[vt]= f; - } - else - { - // glue the faces - typename Vertex_triple_Facet_map::value_type o_vt_f_pair2 = *oit2; - Cell_handle o_ch2 = o_vt_f_pair2.second.first; - int o_i2 = o_vt_f_pair2.second.second; - o_ch2->set_neighbor(o_i2, new_ch); - new_ch->set_neighbor(i, o_ch2); - outer_map.erase(oit2); - } - } - } - } tds().delete_vertex(v); tds().delete_cells(hole.begin(), hole.end()); @@ -5958,166 +5676,45 @@ move_if_no_collision(Vertex_handle v, const Point& p, std::vector hole; hole.reserve(64); + incident_cells(v, std::back_inserter(hole)); // Construct the set of vertex triples on the boundary // with the facet just behind - Vertex_triple_Facet_map outer_map; - Vertex_triple_Facet_map inner_map; - - make_hole_3D(v, outer_map, hole); + Vertex_triple_Facet_map outer_map = create_hole_outer_map(v, hole); CGAL_assertion(remover.hidden_points_begin() == remover.hidden_points_end()); // Output the hidden points. - for(typename std::vector::iterator hi = hole.begin(), - hend = hole.end(); hi != hend; ++hi) + for(auto ch: hole) { - remover.add_hidden_points(*hi); + remover.add_hidden_points(ch); } - bool inf = false; - unsigned int i; - // collect all vertices on the boundary - std::vector vertices; - vertices.reserve(64); - adjacent_vertices(v, std::back_inserter(vertices)); + std::vector adj_vertices; + adj_vertices.reserve(64); + adjacent_vertices(v, std::back_inserter(adj_vertices)); // create a Delaunay triangulation of the points on the boundary // and make a map from the vertices in remover.tmp towards the vertices // in *this - Vertex_handle_unique_hash_map vmap; - Cell_handle ch = Cell_handle(); - for(i=0; i < vertices.size(); i++) - { - if(! is_infinite(vertices[i])) - { - Vertex_handle vh = remover.tmp.insert(vertices[i]->point(), ch); - ch = vh->cell(); - vmap[vh] = vertices[i]; - } - else - { - inf = true; - } - } - - if(remover.tmp.dimension() == 2) - { - Vertex_handle fake_inf = remover.tmp.insert(v->point()); - vmap[fake_inf] = infinite_vertex(); - } - else - { - vmap[remover.tmp.infinite_vertex()] = infinite_vertex(); - } - - CGAL_assertion(remover.tmp.dimension() == 3); + const auto ret = fill_auxiliary_triangulation_with_vertices_around_v(remover.tmp, v, adj_vertices); + const auto& vmap = ret.vmap; + const bool inf = ret.vertex_is_incident_to_infinity; // Construct the set of vertex triples of remover.tmp // We reorient the vertex triple so that it matches those from outer_map // Also note that we use the vertices of *this, not of remover.tmp - - if(inf) - { - for(All_cells_iterator it = remover.tmp.all_cells_begin(), - end = remover.tmp.all_cells_end(); it != end; ++it) - { - for(i=0; i < 4; i++) - { - Facet f = std::pair(it,i); - Vertex_triple vt_aux = make_vertex_triple(f); - Vertex_triple vt(vmap[vt_aux.first],vmap[vt_aux.third],vmap[vt_aux.second]); - make_canonical_oriented_triple(vt); - inner_map[vt]= f; - } - } - } - else - { - for(Finite_cells_iterator it = remover.tmp.finite_cells_begin(), - end = remover.tmp.finite_cells_end(); it != end; ++it) - { - for(i=0; i < 4; i++) - { - Facet f = std::pair(it,i); - Vertex_triple vt_aux = make_vertex_triple(f); - Vertex_triple vt(vmap[vt_aux.first],vmap[vt_aux.third],vmap[vt_aux.second]); - make_canonical_oriented_triple(vt); - inner_map[vt]= f; - } - } - } + const Vertex_triple_Facet_map inner_map = create_triangulation_inner_map(remover.tmp, vmap, inf); // Grow inside the hole, by extending the surface - while(! outer_map.empty()) - { - typename Vertex_triple_Facet_map::iterator oit = outer_map.begin(); - while(is_infinite(oit->first.first) || - is_infinite(oit->first.second) || - is_infinite(oit->first.third)) - { - ++oit; - // otherwise the lookup in the inner_map fails - // because the infinite vertices are different - } - - typename Vertex_triple_Facet_map::value_type o_vt_f_pair = *oit; - outer_map.erase(oit); - Cell_handle o_ch = o_vt_f_pair.second.first; - unsigned int o_i = o_vt_f_pair.second.second; - - typename Vertex_triple_Facet_map::iterator iit = - inner_map.find(o_vt_f_pair.first); - CGAL_assertion(iit != inner_map.end()); - typename Vertex_triple_Facet_map::value_type i_vt_f_pair = *iit; - Cell_handle i_ch = i_vt_f_pair.second.first; - unsigned int i_i = i_vt_f_pair.second.second; - - // create a new cell and glue it to the outer surface - Cell_handle new_ch = tds().create_cell(); - - new_ch->set_vertices(vmap[i_ch->vertex(0)], vmap[i_ch->vertex(1)], - vmap[i_ch->vertex(2)], vmap[i_ch->vertex(3)]); - - o_ch->set_neighbor(o_i,new_ch); - new_ch->set_neighbor(i_i, o_ch); - - // for the other faces check, if they can also be glued - for(i = 0; i < 4; i++) - { - if(i != i_i) - { - Facet f = std::pair(new_ch,i); - Vertex_triple vt = make_vertex_triple(f); - make_canonical_oriented_triple(vt); - std::swap(vt.second,vt.third); - typename Vertex_triple_Facet_map::iterator oit2 = outer_map.find(vt); - if(oit2 == outer_map.end()) - { - std::swap(vt.second,vt.third); - outer_map[vt]= f; - } - else - { - // glue the faces - typename Vertex_triple_Facet_map::value_type o_vt_f_pair2 = *oit2; - Cell_handle o_ch2 = o_vt_f_pair2.second.first; - int o_i2 = o_vt_f_pair2.second.second; - o_ch2->set_neighbor(o_i2,new_ch); - new_ch->set_neighbor(i, o_ch2); - outer_map.erase(oit2); - } - } - } - } + copy_triangulation_into_hole(vmap, std::move(outer_map), inner_map, Emptyset_iterator{}); // fixing pointer std::vector cells_pt; cells_pt.reserve(64); incident_cells(inserted, std::back_inserter(cells_pt)); - std::size_t size = cells_pt.size(); - for(std::size_t i=0; iset_vertex(c->index(inserted), v); @@ -6397,180 +5994,57 @@ move_if_no_collision_and_give_new_cells(Vertex_handle v, const Point& p, std::vector cells_tmp; cells_tmp.reserve(64); incident_cells(inserted, std::back_inserter(cells_tmp)); - int size = cells_tmp.size(); - for(int i=0; i hole; hole.reserve(64); + incident_cells(v, std::back_inserter(hole)); + + for(auto ch : hole) + { + cells_set.erase(ch); + } // Construct the set of vertex triples on the boundary // with the facet just behind - Vertex_triple_Facet_map outer_map; - Vertex_triple_Facet_map inner_map; - - make_hole_3D(v, outer_map, hole); - - for(typename std::vector::const_iterator ib = hole.begin(), - iend = hole.end(); - ib != iend; ib++) - { - cells_set.erase(*ib); - } + Vertex_triple_Facet_map outer_map = create_hole_outer_map(v, hole); CGAL_assertion(remover.hidden_points_begin() == remover.hidden_points_end()); // Output the hidden points. - for(typename std::vector::iterator hi = hole.begin(), - hend = hole.end(); - hi != hend; ++hi) + for(auto ch: hole) { - remover.add_hidden_points(*hi); + remover.add_hidden_points(ch); } - bool inf = false; - unsigned int i; - // Collect all vertices on the boundary - std::vector vertices; - vertices.reserve(64); - adjacent_vertices(v, std::back_inserter(vertices)); + std::vector adj_vertices; + adj_vertices.reserve(64); + adjacent_vertices(v, std::back_inserter(adj_vertices)); // Create a Delaunay triangulation of the points on the boundary // and make a map from the vertices in remover.tmp towards the vertices // in *this - Vertex_handle_unique_hash_map vmap; - Cell_handle ch = Cell_handle(); - for(i=0; i < vertices.size(); i++) - { - if(! is_infinite(vertices[i])) - { - Vertex_handle vh = remover.tmp.insert(vertices[i]->point(), ch); - ch = vh->cell(); - vmap[vh] = vertices[i]; - }else { - inf = true; - } - } - - if(remover.tmp.dimension()==2) - { - Vertex_handle fake_inf = remover.tmp.insert(v->point()); - vmap[fake_inf] = infinite_vertex(); - } - else - { - vmap[remover.tmp.infinite_vertex()] = infinite_vertex(); - } - - CGAL_assertion(remover.tmp.dimension() == 3); + const auto ret = fill_auxiliary_triangulation_with_vertices_around_v(remover.tmp, v, adj_vertices); + const auto& vmap = ret.vmap; + const bool inf = ret.vertex_is_incident_to_infinity; // Construct the set of vertex triples of remover.tmp // We reorient the vertex triple so that it matches those from outer_map // Also note that we use the vertices of *this, not of remover.tmp - if(inf) - { - for(All_cells_iterator it = remover.tmp.all_cells_begin(), - end = remover.tmp.all_cells_end(); it != end; ++it) - { - for(i=0; i < 4; i++) - { - Facet f = std::pair(it,i); - Vertex_triple vt_aux = make_vertex_triple(f); - Vertex_triple vt(vmap[vt_aux.first], vmap[vt_aux.third], vmap[vt_aux.second]); - make_canonical_oriented_triple(vt); - inner_map[vt]= f; - } - } - } - else - { - for(Finite_cells_iterator it = remover.tmp.finite_cells_begin(), - end = remover.tmp.finite_cells_end(); it != end; ++it) - { - for(i=0; i < 4; i++) - { - Facet f = std::pair(it,i); - Vertex_triple vt_aux = make_vertex_triple(f); - Vertex_triple vt(vmap[vt_aux.first], vmap[vt_aux.third], vmap[vt_aux.second]); - make_canonical_oriented_triple(vt); - inner_map[vt]= f; - } - } - } + const Vertex_triple_Facet_map inner_map = create_triangulation_inner_map(remover.tmp, vmap, inf); // Grow inside the hole, by extending the surface - while(! outer_map.empty()) - { - typename Vertex_triple_Facet_map::iterator oit = outer_map.begin(); - while(is_infinite(oit->first.first) || - is_infinite(oit->first.second) || - is_infinite(oit->first.third)) - { - ++oit; - // otherwise the lookup in the inner_map fails - // because the infinite vertices are different - } - - typename Vertex_triple_Facet_map::value_type o_vt_f_pair = *oit; - outer_map.erase(oit); - Cell_handle o_ch = o_vt_f_pair.second.first; - unsigned int o_i = o_vt_f_pair.second.second; - - typename Vertex_triple_Facet_map::iterator iit = - inner_map.find(o_vt_f_pair.first); - CGAL_assertion(iit != inner_map.end()); - typename Vertex_triple_Facet_map::value_type i_vt_f_pair = *iit; - Cell_handle i_ch = i_vt_f_pair.second.first; - unsigned int i_i = i_vt_f_pair.second.second; - - // create a new cell and glue it to the outer surface - Cell_handle new_ch = tds().create_cell(); - *fit++ = new_ch; - - new_ch->set_vertices(vmap[i_ch->vertex(0)], vmap[i_ch->vertex(1)], - vmap[i_ch->vertex(2)], vmap[i_ch->vertex(3)]); - - o_ch->set_neighbor(o_i,new_ch); - new_ch->set_neighbor(i_i, o_ch); - - // for the other faces check, if they can also be glued - for(i = 0; i < 4; i++) - { - if(i != i_i) - { - Facet f = std::pair(new_ch, i); - Vertex_triple vt = make_vertex_triple(f); - make_canonical_oriented_triple(vt); - std::swap(vt.second,vt.third); - typename Vertex_triple_Facet_map::iterator oit2 = outer_map.find(vt); - if(oit2 == outer_map.end()) - { - std::swap(vt.second,vt.third); - outer_map[vt] = f; - } - else - { - // glue the faces - typename Vertex_triple_Facet_map::value_type o_vt_f_pair2 = *oit2; - Cell_handle o_ch2 = o_vt_f_pair2.second.first; - int o_i2 = o_vt_f_pair2.second.second; - o_ch2->set_neighbor(o_i2,new_ch); - new_ch->set_neighbor(i, o_ch2); - outer_map.erase(oit2); - } - } - } - } + copy_triangulation_into_hole(vmap, std::move(outer_map), inner_map, fit); // fixing pointer std::vector cells_pt; cells_pt.reserve(64); incident_cells(inserted, std::back_inserter(cells_pt)); - size = cells_pt.size(); - for(int i=0; iset_vertex(c->index(inserted), v); @@ -6594,7 +6068,7 @@ template < class Gt, class Tds, class Lds > void Triangulation_3:: _make_big_hole_3D(Vertex_handle v, - std::map& outer_map, + Vertex_triple_Facet_map& outer_map, std::vector& hole, std::vector& vertices, std::map& vstates) @@ -6707,13 +6181,12 @@ _remove_cluster_3D(InputIterator first, InputIterator beyond, VertexRemover& rem vstates[v] = PROCESSED; // here, we make the hole for the cluster with v inside - typedef std::map Vertex_triple_Facet_map; std::vector hole; - std::vector vertices; + std::vector adj_vertices; hole.reserve(64); - vertices.reserve(32); + adj_vertices.reserve(32); Vertex_triple_Facet_map outer_map; - _make_big_hole_3D(v, outer_map, hole, vertices, vstates); + _make_big_hole_3D(v, outer_map, hole, adj_vertices, vstates); // the connectivity is totally lost, we need to rebuild if(!outer_map.size()) @@ -6723,7 +6196,7 @@ _remove_cluster_3D(InputIterator first, InputIterator beyond, VertexRemover& rem return false; } - std::size_t vsi = vertices.size(); + std::size_t vsi = adj_vertices.size(); bool inf = false; std::size_t i; @@ -6737,7 +6210,7 @@ _remove_cluster_3D(InputIterator first, InputIterator beyond, VertexRemover& rem std::map mp_vps; for(i=0; iis_infinite(vv)) { vps.push_back(vv->point()); @@ -6770,7 +6243,7 @@ _remove_cluster_3D(InputIterator first, InputIterator beyond, VertexRemover& rem vmap[vh] = vv; } - if(remover.tmp.dimension()==2) + if(remover.tmp.dimension() == 2) { Vertex_handle fake_inf = remover.tmp.insert(v->point()); vmap[fake_inf] = this->infinite_vertex(); @@ -6784,11 +6257,11 @@ _remove_cluster_3D(InputIterator first, InputIterator beyond, VertexRemover& rem { for(i=0; i < vsi; i++) { - if(!this->is_infinite(vertices[i])) + if(!this->is_infinite(adj_vertices[i])) { - Vertex_handle vh = remover.tmp.insert(vertices[i]->point(), ch); + Vertex_handle vh = remover.tmp.insert(adj_vertices[i]->point(), ch); ch = vh->cell(); - vmap[vh] = vertices[i]; + vmap[vh] = adj_vertices[i]; } else { @@ -6796,7 +6269,7 @@ _remove_cluster_3D(InputIterator first, InputIterator beyond, VertexRemover& rem } } - if(remover.tmp.dimension()==2) + if(remover.tmp.dimension() == 2) { Vertex_handle fake_inf = remover.tmp.insert(v->point()); vmap[fake_inf] = this->infinite_vertex(); @@ -6807,105 +6280,10 @@ _remove_cluster_3D(InputIterator first, InputIterator beyond, VertexRemover& rem } } - Vertex_triple_Facet_map inner_map; - - if(inf) - { - for(All_cells_iterator it = remover.tmp.all_cells_begin(), - end = remover.tmp.all_cells_end(); it != end; ++it) - { - for(unsigned int index=0; index < 4; index++) - { - Facet f = std::pair(it,index); - Vertex_triple vt_aux = this->make_vertex_triple(f); - Vertex_triple vt(vmap[vt_aux.first], vmap[vt_aux.third], vmap[vt_aux.second]); - this->make_canonical_oriented_triple(vt); - inner_map[vt]= f; - } - } - } - else - { - for(Finite_cells_iterator it = remover.tmp.finite_cells_begin(), - end = remover.tmp.finite_cells_end(); it != end; ++it) - { - for(unsigned int index=0; index < 4; index++) - { - Facet f = std::pair(it,index); - Vertex_triple vt_aux = this->make_vertex_triple(f); - Vertex_triple vt(vmap[vt_aux.first], vmap[vt_aux.third], vmap[vt_aux.second]); - this->make_canonical_oriented_triple(vt); - inner_map[vt]= f; - } - } - } + const Vertex_triple_Facet_map inner_map = create_triangulation_inner_map(remover.tmp, vmap, inf); // Grow inside the hole, by extending the surface - while(! outer_map.empty()) - { - typename Vertex_triple_Facet_map::iterator oit = outer_map.begin(); - - while(this->is_infinite(oit->first.first) || - this->is_infinite(oit->first.second) || - this->is_infinite(oit->first.third)) - { - ++oit; - // otherwise the lookup in the inner_map fails - // because the infinite vertices are different - } - - typename Vertex_triple_Facet_map::value_type o_vt_f_pair = *oit; - outer_map.erase(oit); - Cell_handle o_ch = o_vt_f_pair.second.first; - unsigned int o_i = o_vt_f_pair.second.second; - - typename Vertex_triple_Facet_map::iterator iit = - inner_map.find(o_vt_f_pair.first); - CGAL_assertion(iit != inner_map.end()); - typename Vertex_triple_Facet_map::value_type i_vt_f_pair = *iit; - Cell_handle i_ch = i_vt_f_pair.second.first; - unsigned int i_i = i_vt_f_pair.second.second; - - // create a new cell and glue it to the outer surface - Cell_handle new_ch = tds().create_cell(); - new_ch->set_vertices(vmap[i_ch->vertex(0)], vmap[i_ch->vertex(1)], - vmap[i_ch->vertex(2)], vmap[i_ch->vertex(3)]); - - o_ch->set_neighbor(o_i,new_ch); - new_ch->set_neighbor(i_i, o_ch); - - for(int j=0; j<4; j++) - new_ch->vertex(j)->set_cell(new_ch); - - // for the other faces check, if they can also be glued - for(unsigned int index = 0; index < 4; index++) - { - if(index != i_i) - { - Facet f = std::pair(new_ch,index); - Vertex_triple vt = this->make_vertex_triple(f); - this->make_canonical_oriented_triple(vt); - std::swap(vt.second,vt.third); - typename Vertex_triple_Facet_map::iterator oit2 = outer_map.find(vt); - if(oit2 == outer_map.end()) - { - std::swap(vt.second,vt.third); - outer_map[vt]= f; - } - else - { - // glue the faces - typename Vertex_triple_Facet_map::value_type o_vt_f_pair2 = *oit2; - Cell_handle o_ch2 = o_vt_f_pair2.second.first; - int o_i2 = o_vt_f_pair2.second.second; - o_ch2->set_neighbor(o_i2,new_ch); - new_ch->set_neighbor(index, o_ch2); - outer_map.erase(oit2); - } - } - } - - } + copy_triangulation_into_hole(vmap, std::move(outer_map), inner_map, Emptyset_iterator{}); this->tds().delete_cells(hole.begin(), hole.end()); remover.tmp.clear(); diff --git a/Triangulation_3/test/Triangulation_3/CMakeLists.txt b/Triangulation_3/test/Triangulation_3/CMakeLists.txt index a820549bf20..c87f341eb25 100644 --- a/Triangulation_3/test/Triangulation_3/CMakeLists.txt +++ b/Triangulation_3/test/Triangulation_3/CMakeLists.txt @@ -19,8 +19,7 @@ create_single_source_cgal_program("test_regular_as_delaunay_3.cpp") create_single_source_cgal_program("test_regular_insert_range_with_info.cpp") create_single_source_cgal_program("test_regular_remove_3.cpp") create_single_source_cgal_program("test_regular_traits_3.cpp") -create_single_source_cgal_program( - "test_RT_cell_base_with_weighted_circumcenter_3.cpp") +create_single_source_cgal_program("test_RT_cell_base_with_weighted_circumcenter_3.cpp") create_single_source_cgal_program("test_robust_weighted_circumcenter.cpp") create_single_source_cgal_program("test_simplex_3.cpp") create_single_source_cgal_program( "test_simplex_iterator_3.cpp" ) @@ -31,10 +30,13 @@ create_single_source_cgal_program("test_triangulation_3.cpp") create_single_source_cgal_program("test_io_triangulation_3.cpp") if(TARGET CGAL::TBB_support) + message(STATUS "Found TBB") + foreach(target test_delaunay_3 test_regular_3 test_regular_insert_range_with_info) target_link_libraries(${target} PUBLIC CGAL::TBB_support) endforeach() + if(BUILD_TESTING) set_property(TEST execution___of__test_delaunay_3 @@ -42,6 +44,8 @@ if(TARGET CGAL::TBB_support) execution___of__test_regular_insert_range_with_info PROPERTY RUN_SERIAL 1) endif() +else() + message(STATUS "NOTICE: The TBB library was not found. Some tests will not be available.") endif() if(BUILD_TESTING) diff --git a/Triangulation_on_sphere_2/benchmark/Triangulation_on_sphere_2/CMakeLists.txt b/Triangulation_on_sphere_2/benchmark/Triangulation_on_sphere_2/CMakeLists.txt index b8c1d21bba3..0e8422aefa1 100644 --- a/Triangulation_on_sphere_2/benchmark/Triangulation_on_sphere_2/CMakeLists.txt +++ b/Triangulation_on_sphere_2/benchmark/Triangulation_on_sphere_2/CMakeLists.txt @@ -1,20 +1,12 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -project( Triangulation_on_sphere_2_Benchmarks ) - cmake_minimum_required(VERSION 3.1...3.23) +project( Triangulation_on_sphere_2_Benchmarks ) + find_package(CGAL REQUIRED COMPONENTS Core ) -if ( CGAL_FOUND ) - - create_single_source_cgal_program( "bench_dtos2.cpp" ) - create_single_source_cgal_program( "generate_points.cpp" ) - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() +create_single_source_cgal_program( "bench_dtos2.cpp" ) +create_single_source_cgal_program( "generate_points.cpp" ) diff --git a/Triangulation_on_sphere_2/demo/Triangulation_on_sphere_2/CMakeLists.txt b/Triangulation_on_sphere_2/demo/Triangulation_on_sphere_2/CMakeLists.txt index 4245bf18870..c9b21f4d7ee 100644 --- a/Triangulation_on_sphere_2/demo/Triangulation_on_sphere_2/CMakeLists.txt +++ b/Triangulation_on_sphere_2/demo/Triangulation_on_sphere_2/CMakeLists.txt @@ -20,20 +20,19 @@ if(POLICY CMP0071) cmake_policy(SET CMP0071 NEW) endif() - # Find CGAL and CGAL Qt5 find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) # Find Qt5 itself find_package(Qt5 QUIET COMPONENTS Script OpenGL Gui Svg) -find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) +find_package(Eigen3 3.1.0 QUIET) #(requires 3.1.0 or greater) include(CGAL_Eigen3_support) if(CGAL_Qt5_FOUND AND Qt5_FOUND AND TARGET CGAL::Eigen3_support) # Include this package's headers first - include_directories(BEFORE ./ ./include) + # ui file, created with Qt Designer qt5_wrap_ui( uis Mainwindow.ui ) @@ -48,5 +47,5 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND AND TARGET CGAL::Eigen3_support) include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) cgal_add_compilation_test( Triangulation_on_sphere_2_Demo ) else() - message(STATUS "NOTICE: This demo requires CGAL, Qt5 and OpenGL, and will not be compiled.") + message("NOTICE: This demo requires CGAL, Qt5, and Eigen, and will not be compiled.") endif() diff --git a/Triangulation_on_sphere_2/examples/Triangulation_on_sphere_2/CMakeLists.txt b/Triangulation_on_sphere_2/examples/Triangulation_on_sphere_2/CMakeLists.txt index a1c1d31478d..3d3d7367f53 100644 --- a/Triangulation_on_sphere_2/examples/Triangulation_on_sphere_2/CMakeLists.txt +++ b/Triangulation_on_sphere_2/examples/Triangulation_on_sphere_2/CMakeLists.txt @@ -4,16 +4,8 @@ project( Triangulation_on_sphere_2_Examples ) find_package(CGAL REQUIRED COMPONENTS Core) -if ( CGAL_FOUND ) - - create_single_source_cgal_program( "triang_on_sphere.cpp" ) - create_single_source_cgal_program( "triang_on_sphere_range.cpp" ) - create_single_source_cgal_program( "triang_on_sphere_exact.cpp" ) - create_single_source_cgal_program( "triang_on_sphere_proj.cpp" ) - create_single_source_cgal_program( "triang_on_sphere_geo.cpp" ) - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() +create_single_source_cgal_program( "triang_on_sphere.cpp" ) +create_single_source_cgal_program( "triang_on_sphere_range.cpp" ) +create_single_source_cgal_program( "triang_on_sphere_exact.cpp" ) +create_single_source_cgal_program( "triang_on_sphere_proj.cpp" ) +create_single_source_cgal_program( "triang_on_sphere_geo.cpp" ) diff --git a/Triangulation_on_sphere_2/test/Triangulation_on_sphere_2/CMakeLists.txt b/Triangulation_on_sphere_2/test/Triangulation_on_sphere_2/CMakeLists.txt index a9b9fba423d..6e26394bee1 100644 --- a/Triangulation_on_sphere_2/test/Triangulation_on_sphere_2/CMakeLists.txt +++ b/Triangulation_on_sphere_2/test/Triangulation_on_sphere_2/CMakeLists.txt @@ -4,25 +4,18 @@ project( Triangulation_on_sphere_2_Tests ) find_package(CGAL REQUIRED COMPONENTS Core) -find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) +create_single_source_cgal_program( "test_dtos.cpp" ) +create_single_source_cgal_program( "test_dtos2_remove.cpp" ) +create_single_source_cgal_program( "test_dtos_degenerate_cases.cpp" ) +create_single_source_cgal_program( "test_dtos_illegal_points.cpp" ) +create_single_source_cgal_program( "test_dtos_projection_traits.cpp" ) +create_single_source_cgal_program( "test_dtos_traits.cpp" ) + +find_package(Eigen3 3.1.0 QUIET) #(requires 3.1.0 or greater) include(CGAL_Eigen3_support) - -if ( CGAL_FOUND ) - - create_single_source_cgal_program( "test_dtos.cpp" ) - create_single_source_cgal_program( "test_dtos2_remove.cpp" ) - create_single_source_cgal_program( "test_dtos_degenerate_cases.cpp" ) - create_single_source_cgal_program( "test_dtos_illegal_points.cpp" ) - create_single_source_cgal_program( "test_dtos_projection_traits.cpp" ) - create_single_source_cgal_program( "test_dtos_traits.cpp" ) - - if(TARGET CGAL::Eigen3_support) - create_single_source_cgal_program( "test_dtos_dual.cpp" ) - target_link_libraries(test_dtos_dual PUBLIC CGAL::Eigen3_support) - endif() - +if(TARGET CGAL::Eigen3_support) + create_single_source_cgal_program( "test_dtos_dual.cpp" ) + target_link_libraries(test_dtos_dual PUBLIC CGAL::Eigen3_support) else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - + message(STATUS "NOTICE: The Eigen library was not found. The test 'test_dtos_dual' will not be compiled.") endif() diff --git a/Voronoi_diagram_2/examples/Voronoi_diagram_2/CMakeLists.txt b/Voronoi_diagram_2/examples/Voronoi_diagram_2/CMakeLists.txt index 7d6f692ba0d..ea1bf322bf5 100644 --- a/Voronoi_diagram_2/examples/Voronoi_diagram_2/CMakeLists.txt +++ b/Voronoi_diagram_2/examples/Voronoi_diagram_2/CMakeLists.txt @@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.1...3.23) project(Voronoi_diagram_2_Examples) -find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) +find_package(CGAL REQUIRED QUIET OPTIONAL_COMPONENTS Qt5) # create a target per cppfile file( @@ -17,4 +17,6 @@ endforeach() if(CGAL_Qt5_FOUND) target_link_libraries(draw_voronoi_diagram_2 PUBLIC CGAL::CGAL_Basic_viewer) +else() + message(STATUS "NOTICE: The Qt5 library was not found. The example 'draw_voronoi_diagram_2' will not be compiled.") endif() diff --git a/Voronoi_diagram_2/test/Voronoi_diagram_2/CMakeLists.txt b/Voronoi_diagram_2/test/Voronoi_diagram_2/CMakeLists.txt index c6a29500bef..3c52d3d7eca 100644 --- a/Voronoi_diagram_2/test/Voronoi_diagram_2/CMakeLists.txt +++ b/Voronoi_diagram_2/test/Voronoi_diagram_2/CMakeLists.txt @@ -1,7 +1,5 @@ -# Created by the script cgal_create_cmake_script -# This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.23) + project(Voronoi_diagram_2_Tests) find_package(CGAL REQUIRED) @@ -14,10 +12,11 @@ create_single_source_cgal_program("vda_pt.cpp") create_single_source_cgal_program("vda_rt.cpp") create_single_source_cgal_program("vda_sdg.cpp") -find_package(Eigen3 3.2.0) #(requires 3.2.0 or greater) +find_package(Eigen3 3.2.0 QUIET) #(requires 3.2.0 or greater) include(CGAL_Eigen3_support) - if(TARGET CGAL::Eigen3_support) create_single_source_cgal_program("vda_tos2.cpp") target_link_libraries(vda_tos2 PUBLIC CGAL::Eigen3_support) +else() + message(STATUS "NOTICE: The Eigen library was not found. The test 'vda_tos2' will not be available.") endif() diff --git a/Weights/examples/Weights/CMakeLists.txt b/Weights/examples/Weights/CMakeLists.txt index 0edac604a89..26748ec7233 100644 --- a/Weights/examples/Weights/CMakeLists.txt +++ b/Weights/examples/Weights/CMakeLists.txt @@ -1,6 +1,3 @@ -# Created by the script cgal_create_cmake_script. -# This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.23) project(Weights_Examples) @@ -14,11 +11,11 @@ create_single_source_cgal_program("projection_traits.cpp") create_single_source_cgal_program("custom_traits.cpp") create_single_source_cgal_program("convergence.cpp") -find_package(Eigen3 3.1.0 QUIET) # (3.1.0 or greater) +find_package(Eigen3 3.1.0 QUIET) # (requires 3.1.0 or greater) include(CGAL_Eigen3_support) if(TARGET CGAL::Eigen3_support) create_single_source_cgal_program("weighted_laplacian.cpp") target_link_libraries(weighted_laplacian PUBLIC CGAL::Eigen3_support) else() - message(NOTICE "Several examples require the Eigen library, and will not be compiled.") + message(STATUS "NOTICE: The example 'weighted_laplacian' requires the Eigen library, and will not be compiled.") endif() diff --git a/Weights/test/Weights/CMakeLists.txt b/Weights/test/Weights/CMakeLists.txt index 90bb93b2ae5..38fb9e881a3 100644 --- a/Weights/test/Weights/CMakeLists.txt +++ b/Weights/test/Weights/CMakeLists.txt @@ -1,6 +1,3 @@ -# Created by the script cgal_create_cmake_script. -# This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.23) project(Weights_Tests) @@ -12,16 +9,12 @@ create_single_source_cgal_program("test_shepard_weights.cpp") create_single_source_cgal_program("test_inverse_distance_weights.cpp") create_single_source_cgal_program("test_three_point_family_weights.cpp") create_single_source_cgal_program("test_projected_weights.cpp") - create_single_source_cgal_program("test_wachspress_weights.cpp") create_single_source_cgal_program("test_authalic_weights.cpp") - create_single_source_cgal_program("test_mean_value_weights.cpp") create_single_source_cgal_program("test_tangent_weights.cpp") - create_single_source_cgal_program("test_discrete_harmonic_weights.cpp") create_single_source_cgal_program("test_cotangent_weights.cpp") - create_single_source_cgal_program("test_uniform_region_weights.cpp") create_single_source_cgal_program("test_triangular_region_weights.cpp") create_single_source_cgal_program("test_barycentric_region_weights.cpp")