diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 1cf9bec6af1..1ed109f66d6 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -9,4 +9,6 @@ _Describe what your pull request changes to CGAL (this can be skipped if it solv * Affected package(s): * Issue(s) solved (if any): fix #0000, fix #0000,... * Feature/Small Feature (if any): +* Link to compiled documentation (obligatory for small feature) [link](https://mydoc/Manual/Pkg) +* License and copyright ownership: diff --git a/.gitignore b/.gitignore index c1553f03af9..44a3f3a6bd0 100644 --- a/.gitignore +++ b/.gitignore @@ -1206,5 +1206,3 @@ gmon.* /Stream_support/test/Stream_support/cgal_test_with_cmake /*.html /Snap_rounding_2/test/Snap_rounding_2/data/out -/Operations_on_polyhedra/examples/Operations_on_polyhedra/cgal_test_with_cmake -/Operations_on_polyhedra/test/Operations_on_polyhedra/cgal_test_with_cmake diff --git a/.travis.yml b/.travis.yml index d5461dd8ece..5959198a264 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,28 +29,27 @@ env: - PACKAGE='Mesher_level Minkowski_sum_2 Minkowski_sum_3 ' - PACKAGE='Modifier Modular_arithmetic Nef_2 ' - PACKAGE='Nef_3 Nef_S2 NewKernel_d ' - - PACKAGE='Number_types OpenNL Operations_on_polyhedra ' - - PACKAGE='Optimal_transportation_reconstruction_2 Optimisation_basic Partition_2 ' - - PACKAGE='Periodic_2_triangulation_2 Periodic_3_mesh_3 Periodic_3_triangulation_3 ' - - PACKAGE='Point_set_2 Point_set_3 Point_set_processing_3 ' - - PACKAGE='Point_set_shape_detection_3 Poisson_surface_reconstruction_3 Polygon ' - - PACKAGE='Polygon_mesh_processing Polyhedron Polyhedron_IO ' - - PACKAGE='Polyline_simplification_2 Polynomial Polytope_distance_d ' - - PACKAGE='Principal_component_analysis Principal_component_analysis_LGPL Profiling_tools ' - - PACKAGE='Property_map QP_solver Random_numbers ' - - PACKAGE='Ridges_3 Scale_space_reconstruction_3 Scripts ' - - PACKAGE='SearchStructures Segment_Delaunay_graph_2 Segment_Delaunay_graph_Linf_2 ' - - PACKAGE='Set_movable_separability_2 Skin_surface_3 Snap_rounding_2 ' - - PACKAGE='Solver_interface Spatial_searching Spatial_sorting ' - - PACKAGE='STL_Extension Straight_skeleton_2 Stream_lines_2 ' - - PACKAGE='Stream_support Subdivision_method_3 Surface_mesh ' - - PACKAGE='Surface_mesh_deformation Surface_mesher Surface_mesh_parameterization ' - - PACKAGE='Surface_mesh_segmentation Surface_mesh_shortest_path Surface_mesh_simplification ' - - PACKAGE='Surface_mesh_skeletonization Surface_sweep_2 TDS_2 ' - - PACKAGE='TDS_3 Testsuite Three ' - - PACKAGE='Triangulation Triangulation_2 Triangulation_3 ' - - PACKAGE='Union_find Visibility_2 Voronoi_diagram_2 ' - - PACKAGE='wininst ' + - PACKAGE='Number_types OpenNL Optimal_transportation_reconstruction_2 ' + - PACKAGE='Optimisation_basic Partition_2 Periodic_2_triangulation_2 ' + - PACKAGE='Periodic_3_mesh_3 Periodic_3_triangulation_3 Point_set_2 ' + - PACKAGE='Point_set_3 Point_set_processing_3 Point_set_shape_detection_3 ' + - PACKAGE='Poisson_surface_reconstruction_3 Polygon Polygon_mesh_processing ' + - PACKAGE='Polyhedron Polyhedron_IO Polyline_simplification_2 ' + - PACKAGE='Polynomial Polytope_distance_d Principal_component_analysis ' + - PACKAGE='Principal_component_analysis_LGPL Profiling_tools Property_map ' + - PACKAGE='QP_solver Random_numbers Ridges_3 ' + - PACKAGE='Scale_space_reconstruction_3 Scripts SearchStructures ' + - PACKAGE='Segment_Delaunay_graph_2 Segment_Delaunay_graph_Linf_2 Set_movable_separability_2 ' + - PACKAGE='Skin_surface_3 Snap_rounding_2 Solver_interface ' + - PACKAGE='Spatial_searching Spatial_sorting STL_Extension ' + - PACKAGE='Straight_skeleton_2 Stream_lines_2 Stream_support ' + - PACKAGE='Subdivision_method_3 Surface_mesh Surface_mesh_deformation ' + - PACKAGE='Surface_mesher Surface_mesh_parameterization Surface_mesh_segmentation ' + - PACKAGE='Surface_mesh_shortest_path Surface_mesh_simplification Surface_mesh_skeletonization ' + - PACKAGE='Surface_sweep_2 TDS_2 TDS_3 ' + - PACKAGE='Testsuite Three Triangulation ' + - PACKAGE='Triangulation_2 Triangulation_3 Union_find ' + - PACKAGE='Visibility_2 Voronoi_diagram_2 wininst ' compiler: clang-3.6 install: - echo "$PWD" @@ -63,7 +62,7 @@ before_script: - sudo chmod +x /usr/bin/doxygen - mkdir -p build - cd build -- cmake -DCMAKE_CXX_FLAGS="-std=c++11" -DCGAL_HEADER_ONLY=ON -DQt5_DIR="/opt/qt55/lib/cmake/Qt5" -DQt5Svg_DIR="/opt/qt55/lib/cmake/Qt5Svg" -DQt5OpenGL_DIR="/opt/qt55/lib/cmake/Qt5OpenGL" -DCMAKE_CXX_FLAGS_RELEASE=-DCGAL_NDEBUG .. +- cmake -DCMAKE_CXX_FLAGS="-std=c++11" -DCGAL_HEADER_ONLY=ON -DQt5_DIR="/opt/qt55/lib/cmake/Qt5" -DQt5Svg_DIR="/opt/qt55/lib/cmake/Qt5Svg" -DQt5OpenGL_DIR="/opt/qt55/lib/cmake/Qt5OpenGL" -DCMAKE_CXX_FLAGS_RELEASE=-DCGAL_NDEBUG -DWITH_examples=ON -DWITH_demos=ON -DWITH_tests=ON .. - make - sudo make install &>/dev/null - cd .. diff --git a/.travis/build_package.sh b/.travis/build_package.sh index f1faf434ddd..c47cd822c21 100755 --- a/.travis/build_package.sh +++ b/.travis/build_package.sh @@ -2,12 +2,12 @@ set -e [ -n "$CGAL_DEBUG_TRAVIS" ] && set -x -CXX_FLAGS="-DCGAL_NDEBUG" +CXX_FLAGS="-DCGAL_NDEBUG -ftemplate-backtrace-limit=0" function build_examples { mkdir -p build-travis cd build-travis - cmake -DCGAL_DIR="/usr/local/lib/cmake/CGAL" -DCMAKE_CXX_FLAGS_RELEASE="${CXX_FLAGS}" .. + cmake -DCGAL_DIR="/usr/local/lib/cmake/CGAL" -DCMAKE_CXX_FLAGS="${CXX_FLAGS}" .. make -j2 } @@ -45,7 +45,7 @@ function build_demo { QGLVIEWERROOT=$PWD/qglviewer export QGLVIEWERROOT fi - cmake -DCGAL_DIR="/usr/local/lib/cmake/CGAL" -DQt5_DIR="/opt/qt55/lib/cmake/Qt5" -DQt5Svg_DIR="/opt/qt55/lib/cmake/Qt5Svg" -DQt5OpenGL_DIR="/opt/qt55/lib/cmake/Qt5OpenGL" -DCGAL_DONT_OVERRIDE_CMAKE_FLAGS:BOOL=ON -DCMAKE_CXX_FLAGS_RELEASE="${CXX_FLAGS} ${EXTRA_CXX_FLAGS}" .. + cmake -DCGAL_DIR="/usr/local/lib/cmake/CGAL" -DQt5_DIR="/opt/qt55/lib/cmake/Qt5" -DQt5Svg_DIR="/opt/qt55/lib/cmake/Qt5Svg" -DQt5OpenGL_DIR="/opt/qt55/lib/cmake/Qt5OpenGL" -DCGAL_DONT_OVERRIDE_CMAKE_FLAGS:BOOL=ON -DCMAKE_CXX_FLAGS="${CXX_FLAGS} ${EXTRA_CXX_FLAGS}" .. make -j2 } old_IFS=$IFS diff --git a/.travis/packages.txt b/.travis/packages.txt index 4c872da0115..53b128c1c85 100644 --- a/.travis/packages.txt +++ b/.travis/packages.txt @@ -69,7 +69,6 @@ Nef_S2 NewKernel_d Number_types OpenNL -Operations_on_polyhedra Optimal_transportation_reconstruction_2 Optimisation_basic Partition_2 diff --git a/.travis/template.txt b/.travis/template.txt index c023fe68f3e..1632aa16cbf 100644 --- a/.travis/template.txt +++ b/.travis/template.txt @@ -19,7 +19,7 @@ before_script: - sudo chmod +x /usr/bin/doxygen - mkdir -p build - cd build -- cmake -DCMAKE_CXX_FLAGS="-std=c++11" -DCGAL_HEADER_ONLY=ON -DQt5_DIR="/opt/qt55/lib/cmake/Qt5" -DQt5Svg_DIR="/opt/qt55/lib/cmake/Qt5Svg" -DQt5OpenGL_DIR="/opt/qt55/lib/cmake/Qt5OpenGL" -DCMAKE_CXX_FLAGS_RELEASE=-DCGAL_NDEBUG .. +- cmake -DCMAKE_CXX_FLAGS="-std=c++11" -DCGAL_HEADER_ONLY=ON -DQt5_DIR="/opt/qt55/lib/cmake/Qt5" -DQt5Svg_DIR="/opt/qt55/lib/cmake/Qt5Svg" -DQt5OpenGL_DIR="/opt/qt55/lib/cmake/Qt5OpenGL" -DCMAKE_CXX_FLAGS_RELEASE=-DCGAL_NDEBUG -DWITH_examples=ON -DWITH_demos=ON -DWITH_tests=ON .. - make - sudo make install &>/dev/null - cd .. diff --git a/AABB_tree/benchmark/AABB_tree/CMakeLists.txt b/AABB_tree/benchmark/AABB_tree/CMakeLists.txt new file mode 100644 index 00000000000..077df0007ca --- /dev/null +++ b/AABB_tree/benchmark/AABB_tree/CMakeLists.txt @@ -0,0 +1,41 @@ +# Created by the script cgal_create_CMakeLists +# This is the CMake script for compiling a set of CGAL applications. + +project( AABB_traits_benchmark) + + +cmake_minimum_required(VERSION 3.1) + cmake_policy(VERSION 3.1) + + +if ( COMMAND cmake_policy ) + + cmake_policy( SET CMP0003 NEW ) + +endif() + +# CGAL and its components +find_package( CGAL QUIET) +if ( CGAL_FOUND ) + include( ${CGAL_USE_FILE} ) +else () + message(STATUS "This project requires the CGAL library, and will not be compiled.") + return() + +endif() + + +# Boost and its components +find_package( Boost REQUIRED ) +# include for local directory +if ( NOT Boost_FOUND ) + message(STATUS "This project requires the Boost library, and will not be compiled.") + return() +endif() + +# include for local package +include_directories( BEFORE ../../include ) + +add_executable (test_ test.cpp) + + diff --git a/AABB_tree/benchmark/AABB_tree/data/handle.off b/AABB_tree/benchmark/AABB_tree/data/handle.off new file mode 100644 index 00000000000..1b4c7ffbfe2 --- /dev/null +++ b/AABB_tree/benchmark/AABB_tree/data/handle.off @@ -0,0 +1,3495 @@ +OFF +1165 2326 0 + +-0.5 -0.153364 0 +-0.5 -0.145472 -0.123072 +-0.5 -0.145472 0.123072 +-0.5 -0.131604 -0.204475 +-0.5 -0.122132 -0.245084 +-0.5 -0.122132 0.245084 +-0.5 -0.06 0 +-0.5 -0.0588999 -0.01144 +-0.5 -0.0588999 0.01144 +-0.5 -0.0557159 -0.022268 +-0.5 -0.0557159 0.022268 +-0.5 -0.052588 -0.0288879 +-0.5 -0.050768 0.0319758 +-0.5 -0.0474238 -0.0367521 +-0.5 -0.0422279 0.0426238 +-0.5 -0.0398639 -0.0448439 +-0.5 -0.03388 0.0495199 +-0.5 -0.0333279 -0.0498919 +-0.5 -0.026544 0.053808 +-0.5 -0.0259439 -0.0540999 +-0.5 -0.018904 0.056944 +-0.5 -0.015804 -0.0578799 +-0.5 -0.00754798 0.059524 +-0.5 -0.002308 -0.0599558 +-0.5 0.00308399 0.0599199 +-0.5 0.008572 -0.0593841 +-0.5 0.01408 0.0583239 +-0.5 0.0195399 -0.0567281 +-0.5 0.024872 0.0546 +-0.5 0.03 -0.0519599 +-0.5 0.034848 0.0488401 +-0.5 0.039356 -0.0452879 +-0.5 0.0434681 0.0413558 +-0.5 0.0471437 -0.037116 +-0.5 0.050352 0.0326319 +-0.5 0.0513119 -0.031096 +-0.5 0.055324 0.023224 +-0.5 0.055544 -0.0226959 +-0.5 0.0587678 -0.0121 +-0.5 0.0587678 0.0121 +-0.5 0.06 0 +-0.5 0.122132 -0.245084 +-0.5 0.122132 0.245084 +-0.5 0.131604 0.204475 +-0.5 0.145472 -0.123072 +-0.5 0.145472 0.123072 +-0.5 0.153364 0 +-0.499816 -0.126076 0.245176 +-0.499816 0.126076 -0.245176 +-0.499583 -0.12108 -0.250841 +-0.499583 0.12108 0.250841 +-0.499477 0.124444 -0.25072 +-0.499458 0.122748 -0.251432 +-0.499458 0.12602 -0.249804 +-0.499417 0.127408 -0.248739 +-0.499399 -0.137264 -0.210963 +-0.499399 0.137264 0.210963 +-0.499396 -0.152344 -0.123952 +-0.499396 -0.152344 0.123952 +-0.499396 0.152344 -0.123952 +-0.499396 0.152344 0.123952 +-0.499392 -0.160308 0 +-0.499392 0.160308 0 +-0.49934 0.128816 -0.247291 +-0.499246 -0.12088 0.252811 +-0.499246 0.12088 -0.252811 +-0.499227 -0.130112 -0.245444 +-0.499227 0.130112 0.245444 +-0.498925 -0.131512 0.245571 +-0.498925 0.131512 -0.245571 +-0.498835 -0.129156 0.25086 +-0.498801 -0.120744 -0.2548 +-0.498801 0.120744 0.2548 +-0.498433 -0.129056 -0.253028 +-0.498433 0.12906 0.253028 +-0.498128 0.126868 -0.255655 +-0.4981 -0.12884 0.254631 +-0.4981 0.123844 -0.25688 +-0.498056 0.129668 -0.254044 +-0.49791 0.13212 -0.252139 +-0.497657 0.134556 -0.24954 +-0.497467 -0.144212 -0.212476 +-0.497467 0.144212 0.212476 +-0.497442 -0.159432 -0.12486 +-0.497442 -0.159432 0.12486 +-0.497442 0.159432 -0.12486 +-0.497442 0.159432 0.12486 +-0.49743 -0.167467 0 +-0.49743 0.167467 0 +-0.497171 -0.120668 0.25986 +-0.497171 0.120668 -0.25986 +-0.497087 -0.137288 -0.246275 +-0.497087 0.137288 0.246275 +-0.496623 -0.13838 0.246439 +-0.496623 0.13838 -0.246439 +-0.496592 0.135432 0.253396 +-0.496526 -0.120712 -0.261387 +-0.496526 0.120712 0.261387 +-0.496427 -0.135844 -0.253427 +-0.496402 0.128968 -0.259603 +-0.496383 0.124964 -0.261172 +-0.496321 -0.12888 -0.25996 +-0.496314 0.128888 0.259955 +-0.496252 0.132664 -0.257492 +-0.496249 -0.137512 0.25136 +-0.495969 0.135876 -0.25496 +-0.495928 -0.128764 0.260992 +-0.495545 -0.137216 0.254795 +-0.495517 0.139024 -0.251484 +-0.49447 0.135236 0.259987 +-0.494311 -0.135636 -0.259992 +-0.494177 -0.120972 0.265864 +-0.494177 0.120972 -0.265864 +-0.494074 -0.150996 -0.213951 +-0.494074 0.150996 0.213951 +-0.494015 -0.166348 -0.125748 +-0.494015 -0.166348 0.125748 +-0.494015 0.166348 -0.125748 +-0.494015 0.166348 0.125748 +-0.493984 -0.17446 0 +-0.493984 0.17446 0 +-0.493984 -0.143332 -0.247299 +-0.493984 0.143332 0.247299 +-0.493741 -0.143712 0.247376 +-0.493741 0.143712 -0.247376 +-0.493489 -0.13708 0.260624 +-0.493327 -0.142968 0.251887 +-0.49332 0.142076 0.2539 +-0.493274 -0.129116 -0.265888 +-0.493274 0.129124 0.265884 +-0.492704 -0.14304 -0.253991 +-0.492648 -0.142688 0.255028 +-0.492202 0.127068 -0.268071 +-0.492109 0.132524 -0.266076 +-0.491744 0.13752 -0.263231 +-0.491467 0.135364 0.265615 +-0.491314 -0.135752 -0.265599 +-0.491308 -0.121372 -0.269979 +-0.491308 0.121372 0.269979 +-0.491242 0.141816 0.259925 +-0.491183 0.141804 -0.259736 +-0.490806 -0.12924 0.269464 +-0.490691 -0.1425 0.260347 +-0.490644 -0.142756 -0.259917 +-0.490358 0.14588 -0.254872 +-0.489488 -0.121628 0.272111 +-0.489488 0.121628 -0.272111 +-0.489255 -0.15718 -0.2153 +-0.489255 0.15718 0.2153 +-0.489143 -0.172648 -0.126556 +-0.489143 -0.172648 0.126556 +-0.489143 0.172648 -0.126556 +-0.489143 0.172648 0.126556 +-0.489087 -0.180824 0 +-0.489087 0.180824 0 +-0.488915 -0.149724 0.248715 +-0.488915 0.149724 -0.248715 +-0.488915 -0.149724 -0.248715 +-0.488915 0.149724 0.248715 +-0.488629 -0.137304 0.268477 +-0.488526 0.14836 0.254412 +-0.488501 -0.129572 -0.272052 +-0.488495 0.129588 0.272048 +-0.488435 -0.149128 0.252623 +-0.488382 0.141792 0.265048 +-0.487819 -0.142696 -0.264951 +-0.487772 -0.148868 0.255319 +-0.487557 0.12876 -0.273191 +-0.487526 -0.121888 -0.274107 +-0.487526 0.121888 0.274107 +-0.487248 0.1352 -0.270971 +-0.487083 -0.14982 -0.254547 +-0.487018 -0.129576 0.2736 +-0.486775 0.135616 0.271463 +-0.486635 0.141052 -0.267636 +-0.486635 -0.135976 -0.271423 +-0.486566 0.148028 0.259632 +-0.486114 -0.142532 0.267536 +-0.485971 -0.148616 0.259863 +-0.485815 0.14602 -0.263451 +-0.485432 -0.122144 0.275956 +-0.485432 0.122144 -0.275956 +-0.485174 -0.149456 -0.259544 +-0.484996 -0.137436 0.272355 +-0.484691 0.150648 -0.257584 +-0.484367 -0.129884 -0.275836 +-0.484364 0.1299 0.275832 +-0.484289 -0.16158 -0.216256 +-0.484289 0.16158 0.216256 +-0.484195 -0.15378 0.249844 +-0.484195 0.15378 -0.249844 +-0.484124 -0.17712 -0.127128 +-0.484124 -0.17712 0.127128 +-0.484124 0.17712 -0.127128 +-0.484124 0.17712 0.127128 +-0.484043 -0.185331 0 +-0.484043 0.185331 0 +-0.483971 0.147848 0.264048 +-0.483959 0.141784 0.27036 +-0.483672 -0.153276 0.253192 +-0.483454 -0.14264 -0.270172 +-0.483236 0.153092 0.254764 +-0.483114 0.129912 -0.27676 +-0.483036 -0.153028 0.255483 +-0.482731 0.135744 0.275051 +-0.482703 -0.142516 0.271103 +-0.482672 -0.154832 -0.25018 +-0.482672 0.154832 0.25018 +-0.482669 -0.14922 -0.263763 +-0.482606 -0.136088 -0.274997 +-0.482572 0.136964 -0.274419 +-0.481874 -0.148416 0.265991 +-0.481871 -0.122496 -0.278576 +-0.481871 0.122496 0.278576 +-0.481728 0.14334 -0.270767 +-0.481569 -0.15426 -0.254864 +-0.48146 0.152696 0.259124 +-0.481391 -0.152724 0.259323 +-0.481267 -0.129888 0.278123 +-0.4807 0.148716 -0.266128 +-0.480176 0.141696 0.273624 +-0.480021 0.1476 0.268624 +-0.479865 -0.15384 -0.258968 +-0.479728 -0.142512 -0.273379 +-0.479457 -0.137428 0.276636 +-0.479366 0.153656 -0.259592 +-0.479195 0.152396 0.262796 +-0.478874 -0.1489 -0.26814 +-0.478855 -0.14824 0.269047 +-0.478089 -0.165388 -0.217084 +-0.478089 0.165388 0.217084 +-0.477865 -0.180972 -0.12762 +-0.477865 -0.180972 0.12762 +-0.477865 0.180972 -0.12762 +-0.477865 0.180972 0.12762 +-0.477849 -0.157516 0.251172 +-0.477849 0.157516 -0.251172 +-0.477787 -0.152364 0.264483 +-0.477746 -0.189212 0 +-0.477746 0.189212 0 +-0.477715 -0.153504 -0.262424 +-0.477497 -0.142296 0.275072 +-0.47731 -0.157096 0.253792 +-0.477307 0.13084 -0.280132 +-0.476737 -0.156856 0.255568 +-0.476693 0.157032 0.255007 +-0.476668 0.147328 0.271444 +-0.476441 0.138376 -0.277695 +-0.475818 0.151988 0.266604 +-0.475668 -0.14858 -0.270836 +-0.475534 -0.1585 -0.251612 +-0.475534 0.1585 0.251612 +-0.475466 -0.157588 -0.255047 +-0.47535 -0.156504 0.25852 +-0.475329 0.145168 -0.273784 +-0.47522 0.156592 0.258339 +-0.475167 -0.152092 0.267063 +-0.47512 -0.122816 0.282116 +-0.47512 0.122816 -0.282116 +-0.474531 -0.153048 -0.266007 +-0.474269 -0.147812 0.272484 +-0.474089 0.150864 -0.268756 +-0.474067 -0.12282 -0.282528 +-0.474067 0.12282 0.282528 +-0.474058 -0.15714 -0.2582 +-0.473896 -0.130032 -0.281823 +-0.473892 0.130056 0.28182 +-0.473428 0.156216 0.261132 +-0.473272 -0.167396 -0.21752 +-0.473272 0.167396 0.21752 +-0.47322 -0.129772 0.282127 +-0.473008 -0.182992 -0.12788 +-0.473008 -0.182992 0.12788 +-0.473008 0.182992 -0.12788 +-0.473008 0.182992 0.12788 +-0.47298 0.151612 0.268963 +-0.472871 -0.191236 0 +-0.472871 0.191236 0 +-0.472581 0.156048 -0.261637 +-0.472534 0.135456 0.280732 +-0.472531 -0.159528 0.252152 +-0.472531 0.159528 -0.252152 +-0.47245 -0.156012 0.262456 +-0.472444 -0.13576 -0.280655 +-0.47236 -0.156748 -0.260839 +-0.472036 -0.159164 0.254171 +-0.471861 -0.15264 -0.268235 +-0.471643 -0.136876 0.280491 +-0.471628 0.159036 0.255088 +-0.471543 -0.15894 0.255531 +-0.471219 -0.151568 0.269979 +-0.471207 -0.159164 -0.2551 +-0.470799 0.155716 0.26404 +-0.470774 0.13116 -0.282592 +-0.470684 0.140948 0.278827 +-0.470444 0.1586 0.257635 +-0.470419 -0.15858 0.257775 +-0.470391 -0.15568 0.264424 +-0.470381 -0.14168 -0.278507 +-0.470151 -0.141488 0.278708 +-0.470048 -0.158728 -0.257592 +-0.46988 -0.15624 -0.263591 +-0.469543 0.13898 -0.280108 +-0.469039 0.158212 0.259775 +-0.468677 -0.15834 -0.25968 +-0.468612 0.1553 0.265856 +-0.468503 -0.160488 -0.252832 +-0.468503 0.160488 0.252832 +-0.468334 0.14624 0.276013 +-0.468257 -0.122512 0.284224 +-0.468257 0.122512 -0.284224 +-0.468154 0.146004 -0.276075 +-0.468151 -0.158056 0.260755 +-0.467833 -0.146808 0.275712 +-0.467817 -0.15582 -0.265311 +-0.467696 -0.147404 -0.275239 +-0.467316 -0.155128 0.266671 +-0.467029 -0.129456 -0.283796 +-0.467023 0.12948 0.283791 +-0.467014 0.15772 0.262008 +-0.466711 0.151872 -0.270856 +-0.466708 -0.157848 -0.261863 +-0.466562 -0.157724 0.262244 +-0.465967 0.1504 0.272863 +-0.465904 0.13466 0.282624 +-0.465836 -0.13494 -0.282544 +-0.465721 -0.15054 0.272791 +-0.465403 -0.122132 -0.284716 +-0.465403 0.122132 -0.284716 +-0.465403 0.122132 0.284716 +-0.465403 -0.122132 0.284716 +-0.465344 0.157332 0.263411 +-0.465294 -0.169264 -0.217928 +-0.465294 0.169264 0.217928 +-0.465278 -0.1514 -0.271944 +-0.465079 -0.157456 -0.263239 +-0.465029 0.157204 -0.263411 +-0.464973 -0.184839 -0.128116 +-0.464973 -0.184839 0.128116 +-0.464973 0.184839 -0.128116 +-0.464973 0.184839 0.128116 +-0.464892 -0.160976 0.253408 +-0.464892 0.160976 -0.253408 +-0.464808 -0.193076 0 +-0.464808 0.193076 0 +-0.464555 0.139932 0.280627 +-0.464531 -0.16072 0.254555 +-0.464359 -0.140624 -0.2803 +-0.46434 -0.160608 -0.255063 +-0.46434 0.160608 0.25506 +-0.464222 -0.15722 0.263951 +-0.464213 -0.160552 0.255327 +-0.464157 0.129284 0.28422 +-0.463917 -0.130532 0.283995 +-0.463898 -0.130612 -0.283979 +-0.463898 0.130612 -0.283979 +-0.46363 -0.160272 -0.256507 +-0.46363 0.160276 0.2565 +-0.463515 -0.160264 0.256584 +-0.463253 0.154152 0.268931 +-0.463076 -0.154204 0.268891 +-0.462982 0.145116 0.277704 +-0.462823 -0.159972 -0.257716 +-0.462823 0.159976 0.257705 +-0.462776 -0.154684 -0.268251 +-0.462739 0.136324 0.28238 +-0.462586 -0.146256 -0.2769 +-0.462468 -0.137572 0.281899 +-0.462396 0.137892 -0.281772 +-0.462262 -0.138484 -0.28152 +-0.4622 -0.159848 0.25824 +-0.46168 -0.159608 -0.258987 +-0.46168 0.159612 0.258976 +-0.46159 -0.161129 -0.253912 +-0.46159 0.161129 0.253912 +-0.461477 0.14932 0.274403 +-0.461303 -0.1596 0.259068 +-0.461256 0.156348 0.265835 +-0.461213 -0.142952 0.279216 +-0.461188 0.143052 0.279155 +-0.4611 -0.15648 -0.26562 +-0.461066 -0.150332 -0.273449 +-0.461019 -0.15646 0.26566 +-0.46097 0.143916 -0.27862 +-0.460748 -0.159332 -0.259799 +-0.460745 0.15934 0.259783 +-0.460555 -0.145528 -0.277524 +-0.460004 -0.15926 0.260019 +-0.459814 0.153244 0.27024 +-0.459592 -0.14902 0.274696 +-0.45954 -0.153808 -0.269516 +-0.459511 0.1493 0.27444 +-0.45929 0.150032 -0.273736 +-0.458876 -0.151396 -0.272328 +-0.45862 0.155628 0.266912 +-0.458536 -0.155772 -0.266684 +-0.458468 -0.158708 -0.261236 +-0.458462 0.15872 0.261212 +-0.458312 -0.15314 0.270296 +-0.458247 -0.158808 0.260987 +-0.458069 0.153848 0.269388 +-0.45772 0.154824 -0.26802 +-0.456988 -0.1583 -0.261903 +-0.456985 0.158312 0.261879 +-0.456969 -0.156776 -0.264851 +-0.45653 0.157784 0.262887 +-0.456514 -0.15782 0.262811 +-0.456271 0.158344 -0.261659 +-0.454972 -0.160592 -0.254859 +-0.454972 0.160592 -0.254859 +-0.454972 0.160592 0.254859 +-0.454972 -0.160592 0.254859 +-0.454726 -0.170388 -0.212715 +-0.454726 0.170388 0.212715 +-0.454383 -0.184756 -0.128108 +-0.454383 -0.184756 0.128108 +-0.454383 0.184756 -0.128108 +-0.454383 0.184756 0.128108 +-0.454197 -0.192939 0 +-0.454197 0.192939 0 +-0.407823 0.12186 -0.291647 +-0.407823 0.12186 0.291647 +-0.406527 0.128916 0.28954 +-0.406246 0.130292 -0.288948 +-0.405387 0.134304 0.286847 +-0.405091 0.135588 -0.286043 +-0.403901 0.140388 0.282324 +-0.403598 0.141488 -0.281284 +-0.402707 0.144516 0.277927 +-0.402414 0.145432 -0.276744 +-0.401013 0.149216 -0.270452 +-0.401013 0.149216 0.270452 +-0.397539 0.111812 0.293972 +-0.397539 0.111812 -0.293972 +-0.388108 -0.1504 0.26408 +-0.388108 0.1504 -0.26408 +-0.383578 -0.159856 -0.221235 +-0.383578 -0.159856 0.221235 +-0.383578 0.159856 -0.221235 +-0.383578 0.159856 0.221235 +-0.378893 -0.172355 -0.147492 +-0.378893 -0.172355 0.147492 +-0.378893 0.172355 -0.147492 +-0.378893 0.172355 0.147492 +-0.37608 -0.179856 -0.0737438 +-0.37608 -0.179856 0.0737438 +-0.37608 0.179856 -0.0737438 +-0.37608 0.179856 0.0737438 +-0.375145 -0.182356 0 +-0.375145 0.182356 0 +-0.26712 -0.147256 -0.232476 +-0.26712 -0.147256 0.232476 +-0.26712 0.147256 -0.232476 +-0.26712 0.147256 0.232476 +-0.261492 -0.0965677 0.312524 +-0.261492 -0.0965677 -0.312524 +-0.261492 0.0965677 -0.312524 +-0.261492 0.0965677 0.312524 +-0.260656 -0.105052 0.311711 +-0.260656 -0.105052 -0.311711 +-0.260656 0.105052 -0.311711 +-0.260656 0.105052 0.311711 +-0.26 -0.06 0 +-0.26 -0.0588999 0.01144 +-0.26 -0.0588999 -0.01144 +-0.26 -0.0557159 0.022268 +-0.26 -0.0557159 -0.022268 +-0.26 -0.052588 0.0288879 +-0.26 -0.050768 -0.0319758 +-0.26 -0.0474238 0.0367521 +-0.26 -0.0422279 -0.0426238 +-0.26 -0.0398639 0.0448439 +-0.26 -0.03388 -0.0495199 +-0.26 -0.0333279 0.0498919 +-0.26 -0.026544 -0.053808 +-0.26 -0.0259439 0.0540999 +-0.26 -0.018904 -0.056944 +-0.26 -0.015804 0.0578799 +-0.26 -0.00754798 -0.059524 +-0.26 -0.002308 0.0599558 +-0.26 0.00308399 -0.0599199 +-0.26 0.008572 0.0593841 +-0.26 0.01408 -0.0583239 +-0.26 0.0195399 0.0567281 +-0.26 0.024872 -0.0546 +-0.26 0.03 0.0519599 +-0.26 0.034848 -0.0488401 +-0.26 0.039356 0.0452879 +-0.26 0.0434681 -0.0413558 +-0.26 0.0471437 0.037116 +-0.26 0.050352 -0.0326319 +-0.26 0.0513119 0.031096 +-0.26 0.055324 -0.023224 +-0.26 0.055544 0.0226959 +-0.26 0.0587678 0.0121 +-0.26 0.0587678 -0.0121 +-0.26 0.06 0 +-0.259756 -0.112164 0.30954 +-0.259756 0.112164 0.30954 +-0.259556 -0.113556 -0.308939 +-0.259556 0.113556 -0.308939 +-0.25892 -0.117596 0.306799 +-0.25892 0.117596 0.306799 +-0.258696 -0.118892 -0.30598 +-0.258696 0.118892 -0.30598 +-0.257772 -0.123728 0.302212 +-0.257772 0.123728 0.302212 +-0.257743 -0.159756 -0.154984 +-0.257743 -0.159756 0.154984 +-0.257743 0.159756 -0.154984 +-0.257743 0.159756 0.154984 +-0.257533 -0.124836 -0.301156 +-0.257533 0.124836 -0.301156 +-0.256812 -0.127888 0.297764 +-0.256812 0.127888 0.297764 +-0.256568 -0.128804 -0.296568 +-0.256568 0.128804 -0.296568 +-0.25538 -0.132612 0.290228 +-0.25538 -0.132612 -0.290228 +-0.25538 0.132612 -0.290228 +-0.25538 0.132612 0.290228 +-0.254052 -0.135408 0.282243 +-0.254052 0.135408 0.282243 +-0.254052 -0.135408 -0.282243 +-0.254052 0.135408 -0.282243 +-0.25212 -0.167257 -0.0774917 +-0.25212 -0.167257 0.0774917 +-0.25212 0.167257 -0.0774917 +-0.25212 0.167257 0.0774917 +-0.250244 -0.169756 0 +-0.250244 0.169756 0 +-0.15062 -0.139692 -0.243719 +-0.15062 -0.139692 0.243719 +-0.15062 0.139692 -0.243719 +-0.15062 0.139692 0.243719 +-0.136556 -0.152192 -0.162481 +-0.136556 -0.152192 0.162481 +-0.136556 0.152192 -0.162481 +-0.136556 0.152192 0.162481 +-0.12812 -0.159692 -0.08124 +-0.12812 -0.159692 0.08124 +-0.12812 0.159692 -0.08124 +-0.12812 0.159692 0.08124 +-0.125308 -0.162191 0 +-0.125308 0.162191 0 +-0.0564879 -0.0874238 0.340479 +-0.0564879 0.0874238 0.340479 +-0.0564879 -0.0874238 -0.340479 +-0.0564879 0.0874238 -0.340479 +-0.0563278 -0.0960599 0.339548 +-0.0563278 0.0960599 0.339548 +-0.0563278 -0.0960599 -0.339548 +-0.0563278 0.0960599 -0.339548 +-0.0559839 -0.103304 0.337227 +-0.0559839 0.103304 0.337227 +-0.055892 -0.10472 -0.336591 +-0.055892 0.10472 -0.336591 +-0.0555679 -0.108828 0.334339 +-0.0555679 0.108828 0.334339 +-0.055444 -0.11014 -0.333479 +-0.055444 0.11014 -0.333479 +-0.0548878 -0.115036 0.329535 +-0.0548878 0.115036 0.329535 +-0.0547321 -0.116152 -0.328435 +-0.0547321 0.116152 -0.328435 +-0.0542398 -0.119216 0.324911 +-0.0542398 0.119216 0.324911 +-0.0540679 -0.120136 -0.323671 +-0.0540679 0.120136 -0.323671 +-0.05316 -0.123904 0.317119 +-0.05316 -0.123904 -0.317119 +-0.05316 0.123904 -0.317119 +-0.05316 0.123904 0.317119 +-0.0520319 -0.126588 0.308931 +-0.0520319 0.126588 0.308931 +-0.0520319 -0.126588 -0.308931 +-0.0520319 0.126588 -0.308931 +-0.034076 -0.137172 -0.254967 +-0.034076 -0.137172 0.254967 +-0.034076 0.137172 -0.254967 +-0.034076 0.137172 0.254967 +-0.015328 -0.149672 -0.169976 +-0.015328 -0.149672 0.169976 +-0.015328 0.149672 -0.169976 +-0.015328 0.149672 0.169976 +-0.00407599 -0.157172 -0.0849878 +-0.00407599 -0.157172 0.0849878 +-0.00407599 0.157172 -0.0849878 +-0.00407599 0.157172 0.0849878 +-0.000327999 -0.159672 0 +-0.000327999 0.159672 0 +0.0825039 -0.139692 -0.266219 +0.0825039 -0.139692 0.266219 +0.0825039 0.139692 -0.266219 +0.0825039 0.139692 0.266219 +0.105944 -0.152192 -0.17748 +0.105944 -0.152192 0.17748 +0.105944 0.152192 -0.17748 +0.105944 0.152192 0.17748 +0.120004 -0.159692 -0.0887398 +0.120004 -0.159692 0.0887398 +0.120004 0.159692 -0.0887398 +0.120004 0.159692 0.0887398 +0.124692 -0.162191 0 +0.124692 0.162191 0 +0.14804 -0.11266 -0.364188 +0.14804 0.11266 -0.364188 +0.148044 -0.116848 0.361761 +0.148044 0.116848 0.361761 +0.148056 -0.111216 0.364876 +0.148056 0.111216 0.364876 +0.148064 -0.118184 -0.360839 +0.148064 0.118184 -0.360839 +0.148256 -0.123132 0.356627 +0.148256 0.123132 0.356627 +0.148288 -0.103812 0.3674 +0.148288 0.103812 0.3674 +0.148288 -0.103812 -0.3674 +0.148288 0.103812 -0.3674 +0.148328 -0.124256 -0.355455 +0.148328 0.124256 -0.355455 +0.1486 -0.127312 0.351714 +0.1486 0.127312 0.351714 +0.148708 -0.12822 -0.350402 +0.148708 0.12822 -0.350402 +0.148824 -0.0949838 0.368478 +0.148824 0.0949838 0.368478 +0.148824 -0.0949838 -0.368478 +0.148824 0.0949838 -0.368478 +0.149364 -0.131876 0.34351 +0.149364 -0.131876 -0.34351 +0.149364 0.131876 -0.34351 +0.149364 0.131876 0.34351 +0.150336 -0.134316 0.334999 +0.150336 -0.134316 -0.334999 +0.150336 0.134316 -0.334999 +0.150336 0.134316 0.334999 +0.199129 -0.147256 -0.277475 +0.199129 -0.147256 0.277475 +0.199129 0.147256 -0.277475 +0.199129 0.147256 0.277475 +0.227255 -0.159756 -0.184984 +0.227255 -0.159756 0.184984 +0.227255 0.159756 -0.184984 +0.227255 0.159756 0.184984 +0.244127 -0.167257 -0.0924917 +0.244127 -0.167257 0.0924917 +0.244127 0.167257 -0.0924917 +0.244127 0.167257 0.0924917 +0.249755 -0.169756 0 +0.249755 0.169756 0 +0.284912 0.148592 0.352041 +0.284912 -0.148592 -0.352041 +0.28532 -0.109284 -0.38709 +0.28532 -0.109284 0.38709 +0.292052 -0.139 0.375668 +0.292068 -0.140124 -0.374435 +0.29212 -0.134024 -0.38012 +0.292168 -0.132672 0.381095 +0.292195 -0.143156 0.3705 +0.29226 -0.144048 -0.369123 +0.292391 -0.128432 -0.383672 +0.292491 -0.126964 0.384404 +0.292764 -0.14758 0.361935 +0.292764 -0.14758 -0.361935 +0.29314 -0.11944 0.387108 +0.29314 -0.11944 -0.387108 +0.315795 -0.159856 -0.288736 +0.315795 -0.159856 0.288736 +0.315795 0.159856 -0.288736 +0.315795 0.159856 0.288736 +0.3481 0.15234 -0.376562 +0.348149 -0.150804 0.378949 +0.348168 0.153492 0.37455 +0.34823 -0.15396 0.373656 +0.348237 -0.149856 -0.38026 +0.348237 0.14988 0.380236 +0.348327 -0.154436 -0.37269 +0.34848 0.148088 -0.382479 +0.348495 0.155044 -0.371378 +0.348561 0.155224 0.370964 +0.348607 -0.172355 -0.192491 +0.348607 -0.172355 0.192491 +0.348607 0.172355 -0.192491 +0.348607 0.172355 0.192491 +0.348716 -0.146748 0.383983 +0.348829 -0.146168 -0.384588 +0.348944 0.145588 0.38517 +0.3491 -0.156296 0.368275 +0.349255 0.1441 -0.386575 +0.34934 -0.156624 -0.36735 +0.34976 0.157084 -0.365942 +0.349869 0.15718 0.365621 +0.350072 -0.15412 0.374079 +0.350075 -0.155828 0.370166 +0.350097 -0.140404 0.38952 +0.350168 -0.140096 -0.389735 +0.350252 -0.157492 -0.364546 +0.350393 -0.15216 0.377647 +0.350433 0.138972 0.390482 +0.350636 -0.157332 0.365577 +0.351196 0.135652 -0.392389 +0.351355 -0.148488 0.382781 +0.351436 0.157508 0.3654 +0.351455 -0.13448 0.392959 +0.351495 0.156164 0.369883 +0.351536 -0.134124 -0.393124 +0.351707 -0.157568 0.365328 +0.351785 0.132944 0.393635 +0.351966 0.154588 0.373737 +0.351981 -0.156276 0.369764 +0.352153 0.158448 0.360484 +0.352153 -0.158448 -0.360484 +0.352153 -0.158448 0.360484 +0.352153 0.158448 -0.360484 +0.352536 0.129052 -0.394997 +0.352611 -0.154744 0.373587 +0.352692 0.15274 0.37727 +0.352735 -0.143972 0.387407 +0.352767 0.1578 0.364995 +0.352857 -0.12706 -0.395508 +0.352966 -0.126268 0.395676 +0.352966 0.126268 0.395676 +0.353038 -0.157856 0.364895 +0.353119 0.125072 -0.395897 +0.353474 -0.152928 0.377104 +0.353496 -0.119196 -0.396383 +0.353496 0.119196 -0.396383 +0.353496 -0.119196 0.396383 +0.353496 0.119196 0.396383 +0.35382 0.158028 0.364571 +0.353866 0.156704 0.369194 +0.354197 0.149192 0.382407 +0.354352 -0.156812 0.36902 +0.35438 0.126832 -0.395782 +0.354383 -0.152824 -0.377513 +0.354496 0.13788 -0.391859 +0.354527 -0.137968 0.391732 +0.354536 0.133132 -0.394028 +0.354583 -0.158192 0.364203 +0.354617 0.145932 -0.386083 +0.35467 -0.148496 -0.383363 +0.354767 -0.155556 -0.372369 +0.355119 0.150636 -0.380908 +0.355134 0.155324 0.372852 +0.355159 -0.14942 0.382223 +0.355312 -0.144424 -0.387401 +0.355327 0.158352 0.363783 +0.35567 0.126356 -0.396018 +0.355686 -0.158428 0.363555 +0.355748 0.157112 0.368453 +0.355782 -0.155464 0.372624 +0.355863 -0.132804 0.394233 +0.355932 -0.157604 -0.366973 +0.356028 0.144724 0.387096 +0.356408 0.154804 -0.374254 +0.356536 0.153632 0.376248 +0.356652 -0.129044 0.395467 +0.356708 0.125744 -0.396208 +0.35672 0.158652 0.36282 +0.356888 -0.158684 0.362686 +0.356898 -0.1358 -0.393056 +0.356957 0.1323 -0.394576 +0.357103 -0.1574 0.367789 +0.35715 -0.144964 0.386918 +0.357321 -0.1538 0.375977 +0.357652 0.155864 0.371867 +0.357792 0.136804 -0.392729 +0.357829 0.12478 -0.396402 +0.357963 -0.129096 -0.39552 +0.358247 0.138636 0.391523 +0.358402 -0.125076 -0.396336 +0.358424 0.157672 0.367029 +0.358443 0.157412 -0.36792 +0.358524 0.123964 -0.396511 +0.35887 0.158948 -0.361736 +0.35887 -0.158948 0.361736 +0.358895 0.131196 -0.395015 +0.358938 0.150256 0.381239 +0.35906 -0.1578 0.366621 +0.359462 -0.156236 0.370976 +0.359511 -0.138848 0.391364 +0.359515 0.122276 -0.396657 +0.359527 0.144576 -0.387588 +0.359583 0.154276 0.375067 +0.359789 -0.119196 -0.396744 +0.359789 0.119196 0.396744 +0.359823 0.1333 0.394102 +0.359907 -0.150456 0.380915 +0.359994 0.120988 -0.396707 +0.360184 0.120252 -0.396723 +0.36044 0.135336 -0.393433 +0.360723 0.129388 0.39537 +0.360854 -0.152328 -0.378463 +0.36087 0.158156 0.365269 +0.361001 0.129432 -0.395467 +0.361032 -0.14802 -0.383993 +0.361051 0.149188 -0.382831 +0.361128 0.158844 0.362315 +0.361128 -0.158844 -0.362315 +0.361156 -0.158212 0.365023 +0.361172 -0.133456 0.393959 +0.361216 0.15658 0.369951 +0.361231 -0.155056 -0.373575 +0.361515 -0.143976 -0.387784 +0.36154 0.145844 0.385862 +0.36178 -0.154708 0.373983 +0.361879 -0.119196 0.396638 +0.361879 0.119196 -0.396638 +0.36206 -0.15674 0.369397 +0.362113 -0.1295 0.395233 +0.362287 -0.157104 -0.368431 +0.362303 0.127928 -0.395722 +0.362664 -0.146056 0.385504 +0.362705 0.151008 0.379812 +0.36272 -0.135448 -0.393056 +0.363259 0.153324 -0.376537 +0.363303 0.132964 -0.394159 +0.363387 0.158596 -0.362967 +0.363387 -0.158596 0.362967 +0.363484 0.14256 -0.388868 +0.363496 -0.128852 -0.395311 +0.363783 -0.12492 -0.396056 +0.363892 0.155104 0.37273 +0.363967 -0.119196 -0.39643 +0.363967 0.119196 0.39643 +0.364172 0.12482 -0.39604 +0.364446 0.157176 0.367546 +0.364456 0.139628 0.390298 +0.364823 -0.15724 0.367216 +0.364901 -0.155284 0.372042 +0.365079 0.13094 -0.394576 +0.365098 0.122456 -0.396149 +0.3654 -0.1515 0.378475 +0.365481 0.121116 -0.396165 +0.365721 -0.139816 0.389915 +0.365823 0.155932 -0.370356 +0.365827 0.146896 -0.384516 +0.365898 0.146632 0.384251 +0.366425 0.134032 0.392915 +0.367403 -0.1507 -0.379323 +0.367453 -0.146536 -0.384298 +0.367503 0.129908 0.394208 +0.367627 0.126752 -0.395078 +0.367752 0.139196 -0.390227 +0.367764 -0.142656 -0.387688 +0.367764 -0.134172 0.392529 +0.367764 0.155764 0.369758 +0.367783 -0.15336 -0.374893 +0.367848 0.163779 -0.331591 +0.367852 -0.163779 0.331591 +0.367982 0.151944 0.376908 +0.36821 -0.155836 0.369347 +0.368297 -0.179856 -0.096244 +0.368297 -0.179856 0.096244 +0.368297 0.179856 -0.096244 +0.368297 0.179856 0.096244 +0.368568 -0.134536 -0.39238 +0.368696 0.157376 0.364736 +0.368696 -0.157376 -0.364736 +0.368727 -0.155392 -0.370188 +0.368768 0.150828 -0.378606 +0.36888 -0.130004 0.393816 +0.368898 0.123568 -0.39524 +0.369011 -0.147144 0.3827 +0.369045 -0.128292 -0.394373 +0.369173 -0.12458 -0.395043 +0.369216 -0.152144 0.376042 +0.36935 0.140324 0.388557 +0.369422 0.121768 -0.395258 +0.369503 -0.119196 0.395321 +0.369503 0.119196 -0.395321 +0.37021 0.156848 -0.365291 +0.37021 -0.156848 0.365291 +0.370381 0.136284 -0.391024 +0.37097 0.142984 -0.386348 +0.371213 -0.119196 -0.394813 +0.371213 0.119196 0.394813 +0.371612 0.134548 0.391121 +0.371727 0.153344 -0.37264 +0.371976 0.147604 0.380859 +0.372668 0.152668 0.373151 +0.372824 0.130268 0.392398 +0.37283 -0.140776 0.386837 +0.373204 -0.152744 0.372628 +0.373385 -0.147808 0.379843 +0.373883 -0.143872 -0.38422 +0.373986 -0.147724 -0.380005 +0.373998 -0.14032 -0.387071 +0.374129 0.130192 -0.392015 +0.374129 0.139556 -0.387445 +0.374375 -0.132972 -0.390999 +0.374388 -0.150232 -0.376207 +0.374534 -0.12402 -0.393271 +0.374556 -0.127352 -0.392685 +0.374687 0.146468 -0.380937 +0.374699 0.154764 0.367073 +0.374699 -0.154764 -0.367073 +0.374855 -0.182356 0 +0.374855 0.182356 0 +0.375058 0.162841 -0.340236 +0.375058 -0.162841 0.340236 +0.37522 -0.152196 -0.372132 +0.375294 -0.134884 0.389323 +0.375939 0.125552 -0.392339 +0.376136 0.14118 0.384765 +0.376164 -0.119196 0.392834 +0.376164 0.119196 -0.392834 +0.376597 -0.130508 0.390576 +0.376662 0.122936 -0.39238 +0.377301 0.148352 0.376419 +0.3777 -0.141364 0.383619 +0.37774 -0.119196 -0.39204 +0.37774 0.119196 0.39204 +0.377905 -0.148432 0.375796 +0.378067 0.148736 -0.375301 +0.378301 0.142592 -0.382376 +0.378572 0.132328 -0.388856 +0.378787 0.135184 0.387149 +0.378852 -0.123368 -0.391193 +0.378964 -0.126252 -0.390679 +0.378968 -0.137528 -0.386074 +0.379005 -0.131124 -0.38928 +0.37902 -0.140652 -0.38375 +0.379027 0.151864 -0.368939 +0.379027 -0.151864 0.368939 +0.379279 -0.144088 -0.380301 +0.379718 -0.14636 -0.377164 +0.380167 0.130716 0.388361 +0.380435 -0.13532 0.385937 +0.380482 -0.148192 -0.373755 +0.380669 0.126796 -0.389361 +0.381127 -0.12294 -0.389819 +0.381133 -0.150068 -0.369895 +0.381133 0.150068 0.369895 +0.381276 -0.125528 -0.389351 +0.381413 -0.1299 -0.388115 +0.381463 0.123668 -0.389442 +0.381538 -0.135664 -0.385336 +0.381678 -0.138492 -0.383323 +0.381849 -0.130816 0.387121 +0.381924 0.144604 -0.376999 +0.382018 -0.141624 -0.38032 +0.382021 0.141852 0.37974 +0.382127 0.160815 -0.343588 +0.382127 -0.160815 0.343588 +0.382479 -0.143716 -0.377584 +0.382681 -0.141924 0.379036 +0.382812 -0.119196 0.388825 +0.382812 0.119196 -0.388825 +0.383139 0.148056 -0.370839 +0.383139 -0.148056 0.370839 +0.383211 -0.145432 -0.37459 +0.383276 -0.119196 -0.388473 +0.383276 0.119196 0.388473 +0.383329 0.134336 -0.384314 +0.384725 -0.12212 -0.387183 +0.384902 -0.124136 -0.386797 +0.384971 0.135688 0.381824 +0.385036 -0.14582 -0.371758 +0.385036 0.14582 0.371758 +0.385142 -0.127536 -0.385853 +0.385488 -0.13204 -0.38379 +0.385603 0.127972 -0.385083 +0.385666 -0.135744 0.381077 +0.385741 -0.134272 -0.382307 +0.386174 -0.136768 -0.380086 +0.386417 0.124364 -0.385267 +0.386435 0.158732 -0.345479 +0.386435 -0.158732 0.345479 +0.386485 0.131072 0.382915 +0.38666 -0.138464 -0.378052 +0.387192 -0.131112 0.382148 +0.387239 0.1357 -0.379397 +0.387326 -0.139892 -0.375799 +0.387762 -0.121256 -0.384388 +0.387928 -0.122668 -0.384096 +0.387943 0.141516 -0.373216 +0.387943 -0.141516 0.373216 +0.388189 -0.125048 -0.383423 +0.388619 -0.1282 -0.382021 +0.388775 -0.119196 -0.383351 +0.388775 0.119196 0.383351 +0.388775 -0.119196 0.383351 +0.388775 0.119196 -0.383351 +0.388915 -0.129772 -0.381014 +0.389376 -0.131544 -0.379516 +0.389566 0.12878 -0.380435 +0.389834 -0.132764 -0.378129 +0.390348 0.124844 -0.380746 +0.390383 -0.136576 -0.3745 +0.390383 0.136576 0.3745 +0.390408 -0.133812 -0.376587 +0.390825 -0.12026 -0.380843 +0.390922 -0.120988 -0.380675 +0.391046 0.134856 -0.374858 +0.391046 -0.134856 0.374858 +0.391102 -0.122204 -0.380317 +0.391429 -0.123812 -0.379597 +0.391647 -0.12462 -0.379086 +0.391975 -0.125536 -0.378332 +0.392062 0.154856 -0.347748 +0.392062 -0.154856 0.347748 +0.392283 -0.12618 -0.37764 +0.392644 -0.126748 -0.376858 +0.392648 -0.129316 -0.375762 +0.392651 0.129316 0.375762 +0.393056 -0.127228 0.376005 +0.393056 0.127228 -0.376005 +0.393358 -0.125168 -0.376189 +0.393358 0.125168 0.376189 +0.393732 -0.119196 -0.376419 +0.393732 -0.119196 0.376419 +0.393732 0.119196 0.376419 +0.393732 0.119196 -0.376419 +0.396109 -0.173355 -0.271955 +0.396109 0.173355 -0.271955 +0.396109 0.173355 0.271955 +0.396109 -0.173355 0.271955 +0.39666 0.150424 -0.349371 +0.39666 -0.150424 0.349371 +0.401259 0.144232 -0.350685 +0.401259 -0.144232 0.350685 +0.40467 0.137464 -0.351268 +0.40467 -0.137464 0.351268 +0.405732 -0.173204 -0.276043 +0.405732 0.173204 -0.276043 +0.405732 0.173204 0.276043 +0.405732 -0.173204 0.276043 +0.406848 -0.130532 0.351178 +0.406848 0.130536 -0.351178 +0.409938 -0.124484 0.346526 +0.409938 0.124484 -0.346526 +0.413088 -0.171228 0.2789 +0.413088 -0.171228 -0.2789 +0.413088 0.171228 -0.2789 +0.413088 0.171228 0.2789 +0.417559 0.16916 0.280512 +0.417559 -0.16916 0.280512 +0.417559 -0.16916 -0.280512 +0.417559 0.16916 -0.280512 +0.423375 -0.165279 -0.282431 +0.423375 0.165279 -0.282431 +0.423375 0.165279 0.282431 +0.423375 -0.165279 0.282431 +0.428098 -0.160823 -0.283807 +0.428098 -0.160823 0.283807 +0.428098 0.160823 -0.283807 +0.428098 0.160823 0.283807 +0.428341 -0.184248 -0.181432 +0.428341 -0.184248 0.181432 +0.428341 0.184248 -0.181432 +0.428341 0.184248 0.181432 +0.432784 -0.154584 -0.284903 +0.432784 0.154584 -0.284903 +0.432784 0.154584 0.284903 +0.432784 -0.154584 0.284903 +0.436208 -0.147756 -0.285379 +0.436208 0.147756 -0.285379 +0.436208 0.147756 0.285379 +0.436208 -0.147756 0.285379 +0.438323 -0.14076 -0.285272 +0.438323 -0.14076 0.285272 +0.438323 0.14076 -0.285272 +0.438323 0.14076 0.285272 +0.438473 -0.184236 -0.184323 +0.438473 -0.184236 0.184323 +0.438473 0.184236 -0.184323 +0.438473 0.184236 0.184323 +0.439221 -0.133976 0.284675 +0.439221 -0.133976 -0.284675 +0.439221 0.133976 -0.284675 +0.439221 0.133976 0.284675 +0.446187 -0.182328 -0.186344 +0.446187 -0.182328 0.186344 +0.446187 0.182328 -0.186344 +0.446187 0.182328 0.186344 +0.447819 -0.190811 -0.090152 +0.447819 -0.190811 0.090152 +0.447819 0.190811 -0.090152 +0.447819 0.190811 0.090152 +0.450866 -0.18028 -0.187481 +0.450866 -0.18028 0.187481 +0.450866 0.18028 -0.187481 +0.450866 0.18028 0.187481 +0.454209 -0.192961 0 +0.454209 0.192961 0 +0.456923 0.1764 0.188836 +0.456923 -0.1764 -0.188836 +0.456923 -0.1764 0.188836 +0.456923 0.1764 -0.188836 +0.458303 -0.190904 -0.0916478 +0.458303 -0.190904 0.0916478 +0.458303 0.190904 0.0916478 +0.458303 0.190904 -0.0916478 +0.461811 0.171917 0.1898 +0.461811 -0.171917 -0.1898 +0.461811 -0.171917 0.1898 +0.461811 0.171917 -0.1898 +0.464817 -0.193092 0 +0.464817 0.193092 0 +0.466275 -0.189043 -0.0926918 +0.466275 -0.189043 0.0926918 +0.466275 0.189043 -0.0926918 +0.466275 0.189043 0.0926918 +0.466602 -0.165615 -0.190564 +0.466602 -0.165615 0.190564 +0.466602 0.165615 -0.190564 +0.466602 0.165615 0.190564 +0.470039 -0.158704 -0.19088 +0.470039 -0.158704 0.19088 +0.470039 0.158704 -0.19088 +0.470039 0.158704 0.19088 +0.471101 -0.187011 -0.09328 +0.471101 -0.187011 0.09328 +0.471101 0.187011 -0.09328 +0.471101 0.187011 0.09328 +0.472079 -0.151624 -0.190779 +0.472079 -0.151624 0.190779 +0.472079 0.151624 -0.190779 +0.472079 0.151624 0.190779 +0.472827 0.14476 0.190336 +0.472827 -0.14476 -0.190336 +0.472827 -0.14476 0.190336 +0.472827 0.14476 -0.190336 +0.47288 -0.191252 0 +0.47288 0.191252 0 +0.477332 -0.183132 -0.09398 +0.477332 -0.183132 0.09398 +0.477332 0.183132 -0.09398 +0.477332 0.183132 0.09398 +0.477756 -0.189223 0 +0.477756 0.189223 0 +0.482332 -0.178631 -0.094476 +0.482332 -0.178631 0.094476 +0.482332 0.178631 -0.094476 +0.482332 0.178631 0.094476 +0.484049 -0.185344 0 +0.484049 0.185344 0 +0.487199 -0.172283 -0.0948639 +0.487199 -0.172283 0.0948639 +0.487199 0.172283 -0.0948639 +0.487199 0.172283 0.0948639 +0.489087 -0.180835 0 +0.489087 0.180835 0 +0.490644 -0.165316 -0.0950199 +0.490644 -0.165316 0.0950199 +0.490644 0.165316 -0.0950199 +0.490644 0.165316 0.0950199 +0.492629 -0.158176 -0.0949598 +0.492629 -0.158176 0.0949598 +0.492629 0.158176 -0.0949598 +0.492629 0.158176 0.0949598 +0.493271 -0.151256 -0.094724 +0.493271 -0.151256 0.094724 +0.493271 0.151256 -0.094724 +0.493271 0.151256 0.094724 +0.493987 -0.174473 0 +0.493987 0.174473 0 +0.49743 -0.167483 0 +0.49743 0.167483 0 +0.499392 -0.160324 0 +0.499392 0.160324 0 +0.5 -0.15338 0 +0.5 0.15338 0 +3 1163 1161 1153 +3 1153 1161 1149 +3 1161 1145 1149 +3 1149 1145 1109 +3 1145 1105 1109 +3 1109 1105 1053 +3 1105 1045 1053 +3 1045 959 1053 +3 959 990 1053 +3 1053 990 1057 +3 990 1005 1057 +3 1057 1005 1061 +3 1005 1009 1061 +3 1061 1009 1070 +3 1009 1011 1070 +3 1011 1014 1070 +3 1014 1032 1070 +3 1032 1071 1070 +3 1070 1071 1122 +3 1071 1124 1122 +3 1122 1124 1153 +3 1124 1155 1153 +3 1155 1164 1153 +3 1153 1164 1163 +3 1164 1156 1163 +3 1156 1154 1163 +3 1154 1150 1163 +3 1163 1150 1161 +3 1150 1159 1161 +3 1161 1159 1145 +3 1159 1139 1145 +3 1145 1139 1105 +3 1139 1096 1105 +3 1105 1096 1045 +3 1096 1041 1045 +3 1041 933 1045 +3 1045 933 959 +3 933 952 959 +3 952 974 959 +3 959 974 990 +3 974 992 990 +3 990 992 1005 +3 992 1004 1005 +3 1005 1004 1009 +3 1004 1003 1009 +3 1009 1003 1000 +3 1000 1003 986 +3 1003 988 986 +3 986 988 966 +3 988 971 966 +3 966 971 942 +3 971 946 942 +3 942 946 926 +3 926 946 927 +3 946 952 927 +3 927 952 930 +3 952 933 930 +3 930 933 902 +3 933 897 902 +3 902 897 860 +3 897 859 860 +3 1153 1149 1122 +3 1149 1117 1122 +3 1122 1117 1070 +3 1070 1117 1061 +3 1061 1117 1057 +3 1117 1109 1057 +3 1057 1109 1053 +3 1117 1149 1109 +3 1069 1062 1123 +3 1123 1062 1118 +3 1062 1110 1118 +3 1118 1110 1146 +3 1110 1140 1146 +3 1146 1140 1157 +3 1140 1143 1157 +3 1157 1143 1133 +3 1143 1127 1133 +3 1133 1127 1088 +3 1127 1081 1088 +3 1088 1081 1039 +3 1081 1034 1039 +3 1059 1112 1055 +3 1055 1112 1108 +3 1112 1148 1108 +3 1108 1148 1142 +3 1148 1160 1142 +3 1142 1160 1158 +3 1160 1147 1158 +3 1158 1147 1141 +3 1147 1111 1141 +3 1141 1111 1107 +3 1111 1058 1107 +3 1107 1058 1054 +3 1058 1023 1054 +3 1054 1023 1021 +3 1023 995 1021 +3 1021 995 977 +3 995 973 977 +3 977 973 941 +3 973 916 941 +3 941 916 895 +3 916 875 895 +3 895 875 837 +3 875 820 837 +3 837 820 783 +3 820 767 783 +3 783 767 736 +3 767 738 736 +3 736 738 701 +3 738 715 701 +3 715 618 701 +3 701 618 606 +3 618 552 606 +3 606 552 556 +3 552 460 556 +3 556 460 500 +3 460 420 500 +3 1055 1108 1048 +3 1048 1108 1095 +3 1108 1142 1095 +3 1095 1142 1136 +3 1142 1158 1136 +3 1136 1158 1144 +3 1158 1141 1144 +3 1144 1141 1135 +3 1141 1107 1135 +3 1135 1107 1098 +3 1107 1054 1098 +3 1098 1054 1047 +3 1054 1021 1047 +3 1047 1021 1019 +3 1021 977 1019 +3 1019 977 950 +3 977 941 950 +3 950 941 915 +3 941 895 915 +3 915 895 861 +3 895 837 861 +3 861 837 797 +3 837 783 797 +3 797 783 740 +3 783 736 740 +3 740 736 689 +3 736 701 689 +3 689 701 612 +3 701 606 612 +3 606 556 612 +3 612 556 560 +3 556 500 560 +3 1048 1095 1043 +3 1043 1095 1087 +3 1095 1136 1087 +3 1087 1136 1130 +3 1136 1144 1130 +3 1130 1144 1138 +3 1144 1135 1138 +3 1138 1135 1129 +3 1135 1098 1129 +3 1129 1098 1090 +3 1098 1047 1090 +3 1090 1047 1042 +3 1047 1019 1042 +3 1042 1019 1001 +3 1019 950 1001 +3 1001 950 924 +3 950 915 924 +3 924 915 879 +3 915 861 879 +3 879 861 816 +3 861 797 816 +3 816 797 743 +3 797 740 743 +3 743 740 678 +3 740 689 678 +3 678 689 620 +3 689 612 620 +3 620 612 560 +3 1043 1087 1037 +3 1037 1087 1084 +3 1087 1130 1084 +3 1084 1130 1116 +3 1130 1138 1116 +3 1116 1138 1132 +3 1138 1129 1132 +3 1132 1129 1115 +3 1129 1090 1115 +3 1115 1090 1083 +3 1090 1042 1083 +3 1083 1042 1040 +3 1042 1001 1040 +3 1040 1001 968 +3 1001 924 968 +3 968 924 872 +3 924 879 872 +3 872 879 836 +3 879 816 836 +3 836 816 755 +3 816 743 755 +3 755 743 671 +3 743 678 671 +3 671 678 620 +3 1031 1029 1069 +3 1069 1029 1062 +3 1029 1060 1062 +3 1062 1060 1110 +3 1060 1106 1110 +3 1110 1106 1140 +3 1106 1134 1140 +3 1140 1134 1143 +3 1134 1137 1143 +3 1143 1137 1127 +3 1137 1113 1127 +3 1127 1113 1081 +3 1113 1073 1081 +3 1081 1073 1034 +3 1073 1025 1034 +3 1050 1028 1018 +3 1018 1028 901 +3 1028 945 901 +3 901 945 819 +3 945 873 819 +3 819 873 829 +3 829 873 852 +3 873 884 852 +3 852 884 867 +3 884 885 867 +3 867 885 864 +3 885 883 864 +3 864 883 835 +3 883 846 835 +3 835 846 801 +3 846 810 801 +3 801 810 757 +3 810 807 757 +3 1015 1025 1065 +3 1025 1073 1065 +3 1065 1073 1101 +3 1073 1113 1101 +3 1101 1113 1131 +3 1113 1137 1131 +3 1131 1137 1128 +3 1137 1134 1128 +3 1128 1134 1097 +3 1134 1106 1097 +3 1097 1106 1056 +3 1106 1060 1056 +3 1056 1060 1024 +3 1060 1029 1024 +3 1024 1029 1007 +3 1029 1031 1007 +3 1007 1031 1012 +3 1012 1031 1072 +3 1031 1069 1072 +3 1072 1069 1121 +3 1069 1123 1121 +3 1121 1123 1156 +3 1156 1123 1154 +3 1123 1118 1154 +3 1154 1118 1150 +3 1118 1146 1150 +3 1150 1146 1159 +3 1146 1157 1159 +3 1159 1157 1139 +3 1157 1133 1139 +3 1139 1133 1096 +3 1133 1088 1096 +3 1096 1088 1041 +3 1088 1039 1041 +3 1041 1039 897 +3 1039 1034 897 +3 897 1034 859 +3 1034 1025 859 +3 859 1025 799 +3 1025 1015 799 +3 799 1015 712 +3 1015 667 712 +3 712 667 652 +3 667 637 652 +3 652 637 634 +3 637 591 634 +3 634 591 575 +3 591 577 575 +3 577 531 575 +3 575 531 523 +3 531 450 523 +3 450 436 523 +3 436 408 523 +3 523 408 518 +3 408 404 518 +3 404 515 518 +3 518 515 567 +3 515 563 567 +3 567 563 619 +3 563 611 619 +3 619 611 657 +3 611 661 657 +3 657 661 696 +3 661 706 696 +3 696 706 761 +3 706 769 761 +3 761 769 815 +3 769 821 815 +3 815 821 857 +3 821 865 857 +3 857 865 891 +3 865 894 891 +3 891 894 922 +3 894 920 922 +3 922 920 936 +3 920 935 936 +3 936 935 961 +3 935 957 961 +3 961 957 979 +3 957 976 979 +3 979 976 997 +3 976 994 997 +3 997 994 1009 +3 994 1011 1009 +3 1003 1004 988 +3 1004 992 988 +3 988 992 971 +3 992 974 971 +3 971 974 946 +3 974 952 946 +3 998 999 980 +3 999 985 980 +3 980 985 962 +3 985 965 962 +3 962 965 938 +3 965 939 938 +3 938 939 921 +3 939 923 921 +3 921 923 888 +3 923 886 888 +3 888 886 845 +3 886 841 845 +3 845 841 804 +3 841 796 804 +3 1011 994 993 +3 993 994 975 +3 994 976 975 +3 1011 993 981 +3 993 975 981 +3 1008 989 987 +3 983 1013 982 +3 1013 1010 982 +3 975 976 956 +3 976 957 956 +3 956 957 932 +3 957 935 932 +3 932 935 919 +3 935 920 919 +3 919 920 893 +3 920 894 893 +3 893 894 866 +3 894 865 866 +3 866 865 822 +3 865 821 822 +3 822 821 771 +3 821 769 771 +3 771 769 720 +3 769 706 720 +3 720 706 666 +3 706 661 666 +3 666 661 605 +3 661 611 605 +3 605 611 559 +3 611 563 559 +3 559 563 511 +3 563 515 511 +3 511 515 393 +3 515 404 393 +3 393 404 390 +3 975 956 981 +3 981 956 953 +3 956 932 953 +3 954 970 928 +3 970 918 928 +3 928 918 878 +3 918 868 878 +3 878 868 828 +3 868 805 828 +3 828 805 754 +3 805 732 754 +3 754 732 687 +3 732 676 687 +3 687 676 614 +3 676 622 614 +3 614 622 566 +3 622 572 566 +3 566 572 520 +3 572 574 520 +3 520 574 522 +3 522 574 534 +3 574 580 534 +3 580 538 534 +3 534 538 510 +3 538 528 510 +3 510 528 447 +3 528 449 447 +3 449 419 447 +3 419 417 447 +3 447 417 443 +3 417 413 443 +3 443 413 439 +3 413 410 439 +3 439 410 522 +3 410 431 522 +3 522 431 520 +3 431 514 520 +3 520 514 566 +3 514 562 566 +3 566 562 614 +3 562 608 614 +3 614 608 687 +3 608 699 687 +3 687 699 754 +3 699 770 754 +3 754 770 828 +3 770 839 828 +3 828 839 878 +3 839 882 878 +3 878 882 928 +3 882 913 928 +3 928 913 954 +3 913 948 954 +3 953 984 981 +3 981 984 1011 +3 1011 984 1014 +3 984 989 1014 +3 989 1008 1014 +3 1014 1008 1032 +3 1008 1030 1032 +3 1032 1030 1071 +3 1030 1063 1071 +3 1071 1063 1124 +3 1063 1119 1124 +3 1124 1119 1155 +3 1119 1151 1155 +3 1155 1151 1164 +3 1151 1162 1164 +3 1164 1162 1156 +3 1162 1152 1156 +3 1156 1152 1121 +3 1152 1120 1121 +3 1121 1120 1072 +3 1120 1064 1072 +3 1064 1010 1072 +3 1010 1013 1072 +3 1072 1013 1012 +3 1013 983 1012 +3 1012 983 1007 +3 983 972 1007 +3 972 996 1007 +3 1007 996 1024 +3 996 1022 1024 +3 1024 1022 1056 +3 1022 1046 1056 +3 1056 1046 1097 +3 1046 1089 1097 +3 1097 1089 1128 +3 1089 1114 1128 +3 1128 1114 1131 +3 1114 1125 1131 +3 1131 1125 1101 +3 1125 1091 1101 +3 1101 1091 1065 +3 1091 1049 1065 +3 1065 1049 1015 +3 1049 681 1015 +3 1015 681 667 +3 681 641 667 +3 667 641 637 +3 641 595 637 +3 637 595 591 +3 595 581 591 +3 591 581 577 +3 581 535 577 +3 577 535 531 +3 535 507 531 +3 531 507 450 +3 507 440 450 +3 450 440 436 +3 440 412 436 +3 436 412 408 +3 412 373 408 +3 960 943 991 +3 991 943 958 +3 943 905 958 +3 933 1041 897 +3 967 931 963 +3 963 931 917 +3 931 889 917 +3 917 889 874 +3 889 831 874 +3 874 831 817 +3 831 795 817 +3 817 795 777 +3 795 758 777 +3 777 758 748 +3 926 927 887 +3 887 927 892 +3 927 930 892 +3 930 902 892 +3 892 902 848 +3 902 860 848 +3 932 919 953 +3 919 893 953 +3 949 912 907 +3 912 876 907 +3 907 876 871 +3 876 824 871 +3 871 824 808 +3 824 785 808 +3 808 785 727 +3 785 726 727 +3 726 653 727 +3 727 653 628 +3 653 627 628 +3 627 547 628 +3 628 547 548 +3 548 547 456 +3 547 455 456 +3 456 455 433 +3 455 327 433 +3 433 327 328 +3 934 910 960 +3 960 910 943 +3 910 880 943 +3 943 880 905 +3 880 838 905 +3 937 909 904 +3 904 909 863 +3 909 869 863 +3 863 869 832 +3 869 834 832 +3 832 834 789 +3 834 790 789 +3 887 892 840 +3 892 848 840 +3 896 881 934 +3 934 881 910 +3 881 851 910 +3 910 851 880 +3 851 814 880 +3 880 814 838 +3 814 778 838 +3 904 863 843 +3 863 826 843 +3 843 826 812 +3 826 774 812 +3 812 774 768 +3 768 774 727 +3 774 782 727 +3 727 782 789 +3 789 782 832 +3 782 826 832 +3 832 826 863 +3 854 1050 682 +3 1050 1018 682 +3 682 1018 668 +3 668 1018 850 +3 1018 901 850 +3 850 901 776 +3 901 819 776 +3 776 819 800 +3 819 829 800 +3 800 829 809 +3 829 830 809 +3 809 830 806 +3 830 833 806 +3 806 833 788 +3 833 813 788 +3 788 813 764 +3 813 781 764 +3 764 781 737 +3 781 752 737 +3 737 752 704 +3 752 757 704 +3 704 757 721 +3 757 807 721 +3 721 807 728 +3 807 786 728 +3 728 786 729 +3 786 722 729 +3 729 722 626 +3 722 616 626 +3 626 616 550 +3 616 554 550 +3 550 554 498 +3 554 502 498 +3 498 502 424 +3 502 426 424 +3 424 426 379 +3 426 391 379 +3 391 361 379 +3 379 361 345 +3 361 308 345 +3 829 852 830 +3 852 867 830 +3 830 867 833 +3 867 864 833 +3 833 864 813 +3 864 835 813 +3 813 835 781 +3 835 801 781 +3 781 801 752 +3 801 757 752 +3 858 827 847 +3 827 802 847 +3 847 802 823 +3 802 766 823 +3 823 766 784 +3 766 744 784 +3 784 744 756 +3 744 709 756 +3 799 811 859 +3 859 811 860 +3 811 803 860 +3 860 803 848 +3 803 793 848 +3 848 793 840 +3 793 796 840 +3 796 841 840 +3 840 841 887 +3 841 886 887 +3 887 886 926 +3 886 923 926 +3 926 923 942 +3 923 939 942 +3 942 939 966 +3 939 965 966 +3 966 965 986 +3 965 985 986 +3 986 985 1000 +3 985 999 1000 +3 1000 999 1009 +3 999 998 1009 +3 1009 998 997 +3 997 998 979 +3 998 980 979 +3 979 980 961 +3 980 962 961 +3 961 962 936 +3 962 938 936 +3 936 938 922 +3 938 921 922 +3 922 921 891 +3 921 888 891 +3 891 888 857 +3 888 845 857 +3 857 845 815 +3 845 804 815 +3 815 804 761 +3 761 804 746 +3 804 796 746 +3 746 796 741 +3 796 793 741 +3 741 793 735 +3 793 803 735 +3 735 803 742 +3 803 811 742 +3 742 811 753 +3 811 799 753 +3 753 799 697 +3 799 712 697 +3 712 652 697 +3 697 652 664 +3 652 634 664 +3 664 634 630 +3 634 575 630 +3 630 575 570 +3 575 523 570 +3 523 518 570 +3 518 567 570 +3 570 567 623 +3 567 619 623 +3 623 619 656 +3 619 657 656 +3 656 657 686 +3 657 696 686 +3 686 696 746 +3 696 761 746 +3 798 1017 711 +3 794 798 759 +3 798 711 759 +3 789 790 727 +3 727 790 808 +3 790 834 808 +3 808 834 871 +3 834 869 871 +3 871 869 907 +3 869 909 907 +3 907 909 949 +3 909 937 949 +3 949 937 967 +3 967 937 931 +3 937 904 931 +3 931 904 889 +3 904 843 889 +3 889 843 831 +3 843 812 831 +3 831 812 795 +3 812 768 795 +3 795 768 758 +3 768 724 758 +3 758 724 748 +3 724 734 748 +3 734 762 748 +3 748 762 777 +3 762 791 777 +3 777 791 817 +3 791 844 817 +3 817 844 874 +3 844 890 874 +3 874 890 917 +3 890 955 917 +3 917 955 963 +3 955 987 963 +3 987 989 963 +3 963 989 967 +3 989 984 967 +3 967 984 949 +3 984 953 949 +3 949 953 912 +3 953 893 912 +3 912 893 876 +3 893 866 876 +3 876 866 824 +3 866 822 824 +3 824 822 785 +3 822 771 785 +3 785 771 726 +3 771 720 726 +3 726 720 653 +3 720 666 653 +3 653 666 627 +3 666 617 627 +3 627 617 547 +3 617 551 547 +3 547 551 455 +3 551 459 455 +3 455 459 327 +3 459 354 327 +3 327 354 317 +3 354 325 317 +3 317 325 283 +3 325 298 283 +3 283 298 223 +3 298 249 223 +3 223 249 227 +3 249 259 227 +3 227 259 240 +3 259 284 240 +3 240 284 264 +3 284 300 264 +3 264 300 291 +3 300 348 291 +3 291 348 306 +3 348 373 306 +3 306 373 332 +3 373 412 332 +3 332 412 414 +3 412 440 414 +3 414 440 444 +3 440 507 444 +3 444 507 525 +3 507 535 525 +3 525 535 539 +3 535 581 539 +3 539 581 585 +3 581 595 585 +3 585 595 599 +3 595 641 599 +3 599 641 645 +3 641 681 645 +3 645 681 853 +3 681 1049 853 +3 853 1049 1077 +3 1049 1091 1077 +3 1077 1091 1099 +3 1091 1125 1099 +3 1099 1125 1102 +3 1125 1114 1102 +3 1102 1114 1082 +3 1114 1089 1082 +3 1082 1089 1044 +3 1089 1046 1044 +3 1044 1046 1020 +3 1046 1022 1020 +3 1020 1022 978 +3 1022 996 978 +3 978 996 964 +3 996 972 964 +3 964 972 940 +3 972 983 940 +3 940 983 948 +3 948 983 954 +3 983 982 954 +3 954 982 970 +3 982 1010 970 +3 970 1010 1006 +3 1010 1064 1006 +3 1006 1064 1059 +3 1064 1120 1059 +3 1059 1120 1112 +3 1120 1152 1112 +3 1112 1152 1148 +3 1152 1162 1148 +3 1148 1162 1160 +3 1162 1151 1160 +3 1160 1151 1147 +3 1151 1119 1147 +3 1147 1119 1111 +3 1119 1063 1111 +3 1111 1063 1058 +3 1063 1030 1058 +3 1058 1030 1023 +3 1030 1008 1023 +3 1023 1008 995 +3 1008 987 995 +3 995 987 973 +3 987 955 973 +3 973 955 916 +3 955 890 916 +3 916 890 875 +3 890 844 875 +3 875 844 820 +3 844 791 820 +3 820 791 767 +3 791 762 767 +3 767 762 738 +3 762 734 738 +3 738 734 715 +3 734 724 715 +3 715 724 618 +3 724 628 618 +3 618 628 552 +3 628 548 552 +3 552 548 460 +3 548 456 460 +3 460 456 420 +3 456 433 420 +3 420 433 355 +3 433 328 355 +3 355 328 310 +3 328 327 310 +3 310 327 262 +3 327 317 262 +3 262 317 265 +3 317 283 265 +3 265 283 209 +3 283 223 209 +3 209 223 200 +3 223 227 200 +3 200 227 208 +3 227 240 208 +3 208 240 222 +3 240 264 222 +3 222 264 252 +3 264 291 252 +3 252 291 250 +3 291 306 250 +3 250 306 268 +3 306 332 268 +3 268 332 337 +3 332 414 337 +3 337 414 418 +3 414 444 418 +3 418 444 448 +3 444 525 448 +3 448 525 529 +3 525 539 529 +3 529 539 543 +3 539 585 543 +3 543 585 589 +3 585 599 589 +3 589 599 603 +3 599 645 603 +3 603 645 649 +3 645 853 649 +3 649 853 898 +3 853 1077 898 +3 898 1077 1085 +3 1077 1099 1085 +3 1085 1099 1092 +3 1099 1102 1092 +3 1092 1102 1074 +3 1102 1082 1074 +3 1074 1082 1038 +3 1082 1044 1038 +3 1038 1044 1002 +3 1044 1020 1002 +3 1002 1020 951 +3 1020 978 951 +3 951 978 947 +3 978 964 947 +3 947 964 929 +3 964 940 929 +3 929 940 908 +3 940 948 908 +3 908 948 906 +3 948 913 906 +3 906 913 877 +3 913 882 877 +3 877 882 842 +3 882 839 842 +3 842 839 787 +3 839 770 787 +3 787 770 708 +3 770 699 708 +3 708 699 610 +3 699 608 610 +3 610 608 558 +3 608 562 558 +3 558 562 506 +3 562 514 506 +3 506 514 428 +3 514 431 428 +3 428 431 400 +3 431 405 400 +3 400 405 394 +3 405 403 394 +3 826 782 774 +3 759 747 794 +3 794 747 772 +3 747 730 772 +3 772 730 750 +3 730 719 750 +3 750 719 731 +3 719 703 731 +3 731 703 705 +3 746 741 686 +3 741 675 686 +3 686 675 656 +3 741 735 675 +3 730 747 711 +3 747 759 711 +3 768 727 724 +3 727 628 724 +3 721 728 654 +3 728 729 654 +3 654 729 626 +3 776 713 850 +3 713 668 850 +3 713 776 760 +3 776 800 760 +3 760 800 779 +3 800 809 779 +3 779 809 780 +3 809 806 780 +3 780 806 765 +3 806 788 765 +3 765 788 745 +3 788 764 745 +3 745 764 718 +3 764 737 718 +3 718 737 695 +3 737 704 695 +3 695 704 662 +3 704 665 662 +3 662 665 615 +3 665 625 615 +3 615 625 545 +3 625 546 545 +3 545 546 454 +3 546 457 454 +3 454 457 432 +3 457 421 432 +3 432 421 352 +3 421 365 352 +3 352 365 324 +3 365 345 324 +3 324 345 294 +3 345 308 294 +3 294 308 246 +3 308 275 246 +3 275 248 246 +3 246 248 221 +3 248 226 221 +3 221 226 197 +3 226 216 197 +3 197 216 176 +3 216 201 176 +3 176 201 160 +3 201 158 160 +3 160 158 122 +3 158 148 122 +3 122 148 114 +3 148 152 114 +3 114 152 118 +3 152 154 118 +3 118 154 120 +3 154 151 120 +3 120 151 117 +3 151 124 117 +3 117 124 94 +3 124 108 94 +3 94 108 80 +3 108 105 80 +3 80 105 79 +3 105 103 79 +3 79 103 78 +3 103 99 78 +3 78 99 75 +3 99 100 75 +3 75 100 77 +3 713 760 749 +3 760 779 749 +3 749 779 763 +3 779 780 763 +3 763 780 751 +3 780 765 751 +3 751 765 725 +3 765 745 725 +3 725 745 702 +3 745 718 702 +3 702 718 685 +3 718 695 685 +3 685 695 658 +3 695 662 658 +3 658 662 609 +3 662 615 609 +3 609 615 549 +3 615 545 549 +3 545 454 549 +3 549 454 458 +3 454 330 458 +3 458 330 353 +3 330 309 353 +3 353 309 270 +3 309 257 270 +3 270 257 218 +3 257 180 218 +3 218 180 172 +3 180 145 172 +3 172 145 141 +3 145 111 141 +3 141 111 106 +3 111 89 106 +3 106 89 76 +3 89 64 76 +3 76 64 70 +3 70 64 47 +3 64 5 47 +3 47 5 2 +3 5 22 2 +3 22 20 2 +3 20 18 2 +3 18 16 2 +3 16 14 2 +3 14 12 2 +3 12 10 2 +3 2 10 0 +3 10 8 0 +3 8 6 0 +3 6 7 0 +3 7 9 0 +3 9 11 0 +3 0 11 1 +3 11 13 1 +3 13 15 1 +3 15 17 1 +3 17 19 1 +3 19 21 1 +3 21 23 1 +3 1 23 3 +3 23 25 3 +3 3 25 41 +3 25 44 41 +3 41 44 48 +3 44 59 48 +3 48 59 69 +3 59 85 69 +3 69 85 94 +3 94 85 117 +3 85 88 117 +3 117 88 120 +3 88 86 120 +3 120 86 118 +3 86 82 118 +3 118 82 114 +3 82 92 114 +3 114 92 122 +3 92 127 122 +3 122 127 160 +3 127 139 160 +3 160 139 176 +3 139 164 176 +3 176 164 197 +3 164 198 197 +3 197 198 221 +3 198 220 221 +3 221 220 246 +3 246 220 294 +3 220 279 294 +3 294 279 324 +3 279 318 324 +3 324 318 352 +3 318 329 352 +3 352 329 432 +3 329 330 432 +3 432 330 454 +3 713 749 739 +3 749 763 739 +3 739 763 733 +3 763 751 733 +3 733 751 716 +3 751 725 716 +3 716 725 698 +3 725 702 698 +3 698 702 672 +3 702 685 672 +3 672 685 655 +3 685 658 655 +3 655 658 607 +3 658 609 607 +3 607 609 553 +3 609 549 553 +3 553 549 458 +3 713 739 723 +3 739 733 723 +3 723 733 710 +3 733 716 710 +3 710 716 693 +3 716 698 693 +3 693 698 674 +3 698 672 674 +3 674 672 659 +3 672 655 659 +3 659 655 613 +3 655 607 613 +3 613 607 557 +3 607 553 557 +3 557 553 497 +3 553 458 497 +3 497 458 367 +3 458 353 367 +3 367 353 287 +3 353 270 287 +3 270 218 287 +3 287 218 224 +3 218 172 224 +3 224 172 183 +3 172 141 183 +3 183 141 159 +3 141 106 159 +3 159 106 125 +3 106 76 125 +3 125 76 107 +3 76 70 107 +3 713 723 707 +3 723 710 707 +3 707 710 694 +3 710 693 694 +3 693 674 694 +3 694 674 688 +3 674 663 688 +3 688 663 713 +3 663 633 713 +3 713 633 668 +3 633 638 668 +3 668 638 682 +3 638 642 682 +3 682 642 854 +3 642 646 854 +3 854 646 898 +3 898 646 649 +3 646 600 649 +3 649 600 603 +3 600 586 603 +3 603 586 589 +3 586 540 589 +3 589 540 543 +3 540 526 543 +3 543 526 529 +3 526 445 529 +3 529 445 448 +3 448 445 418 +3 445 415 418 +3 418 415 343 +3 415 338 343 +3 343 338 276 +3 338 272 276 +3 276 272 238 +3 272 232 238 +3 232 195 238 +3 238 195 191 +3 195 149 191 +3 191 149 147 +3 149 113 147 +3 147 113 121 +3 113 91 121 +3 91 98 121 +3 121 98 130 +3 98 110 130 +3 130 110 143 +3 110 136 143 +3 143 136 165 +3 136 175 165 +3 165 175 200 +3 200 175 209 +3 175 185 209 +3 209 185 265 +3 185 212 265 +3 265 212 262 +3 212 258 262 +3 262 258 310 +3 258 293 310 +3 310 293 355 +3 293 368 355 +3 355 368 420 +3 368 423 420 +3 420 423 500 +3 423 504 500 +3 500 504 560 +3 504 564 560 +3 560 564 620 +3 564 624 620 +3 620 624 671 +3 624 679 671 +3 671 679 755 +3 679 773 755 +3 755 773 836 +3 773 818 836 +3 836 818 872 +3 818 944 872 +3 872 944 968 +3 944 1035 968 +3 968 1035 1040 +3 1035 1075 1040 +3 1040 1075 1083 +3 1075 1103 1083 +3 1083 1103 1115 +3 1103 1126 1115 +3 1115 1126 1132 +3 1126 1104 1132 +3 1132 1104 1116 +3 1104 1076 1116 +3 1116 1076 1084 +3 1076 1036 1084 +3 1084 1036 1037 +3 1036 896 1037 +3 1037 896 1043 +3 896 934 1043 +3 1043 934 1048 +3 934 960 1048 +3 1048 960 1055 +3 960 991 1055 +3 1055 991 1059 +3 1059 991 1006 +3 1006 991 970 +3 991 958 970 +3 970 958 918 +3 958 905 918 +3 918 905 868 +3 905 838 868 +3 868 838 805 +3 838 778 805 +3 805 778 732 +3 778 717 732 +3 732 717 676 +3 717 673 676 +3 676 673 622 +3 673 632 622 +3 622 632 572 +3 632 636 572 +3 572 636 574 +3 636 594 574 +3 574 594 580 +3 594 584 580 +3 580 584 538 +3 584 542 538 +3 538 542 528 +3 542 530 528 +3 528 530 449 +3 530 446 449 +3 449 446 419 +3 446 416 419 +3 419 416 344 +3 416 339 344 +3 344 339 277 +3 339 273 277 +3 277 273 239 +3 273 233 239 +3 239 233 196 +3 196 233 193 +3 233 190 193 +3 193 190 156 +3 156 190 144 +3 190 184 144 +3 144 184 179 +3 184 219 179 +3 179 219 214 +3 219 254 214 +3 214 254 247 +3 254 302 247 +3 247 302 293 +3 293 302 368 +3 302 383 368 +3 368 383 423 +3 383 425 423 +3 423 425 504 +3 425 512 504 +3 504 512 564 +3 512 568 564 +3 564 568 624 +3 568 631 624 +3 624 631 679 +3 631 691 679 +3 679 691 773 +3 691 775 773 +3 773 775 818 +3 775 900 818 +3 818 900 944 +3 900 1026 944 +3 944 1026 1035 +3 1026 1067 1035 +3 1035 1067 1075 +3 1067 1094 1075 +3 1075 1094 1103 +3 1094 1100 1103 +3 1103 1100 1126 +3 1100 1093 1126 +3 1126 1093 1104 +3 1093 1068 1104 +3 1104 1068 1076 +3 1068 1027 1076 +3 1076 1027 1036 +3 1027 858 1036 +3 1036 858 896 +3 858 847 896 +3 896 847 881 +3 847 823 881 +3 881 823 851 +3 823 784 851 +3 851 784 814 +3 784 756 814 +3 814 756 778 +3 778 756 717 +3 756 709 717 +3 717 709 673 +3 709 680 673 +3 673 680 632 +3 680 651 632 +3 632 651 636 +3 651 640 636 +3 636 640 594 +3 640 598 594 +3 594 598 584 +3 598 588 584 +3 584 588 542 +3 588 544 542 +3 542 544 530 +3 544 527 530 +3 530 527 446 +3 527 442 446 +3 446 442 416 +3 442 438 416 +3 416 438 409 +3 438 435 409 +3 409 435 407 +3 435 430 407 +3 407 430 401 +3 430 429 401 +3 401 429 392 +3 429 427 392 +3 392 427 425 +3 425 427 512 +3 427 516 512 +3 512 516 568 +3 516 571 568 +3 568 571 631 +3 571 635 631 +3 631 635 691 +3 635 714 691 +3 691 714 775 +3 714 849 775 +3 775 849 900 +3 849 1016 900 +3 900 1016 1026 +3 1016 1051 1026 +3 1026 1051 1067 +3 1051 1079 1067 +3 1067 1079 1094 +3 1079 1086 1094 +3 1094 1086 1100 +3 1086 1080 1100 +3 1100 1080 1093 +3 1080 1052 1093 +3 1093 1052 1068 +3 1052 1017 1068 +3 1068 1017 1027 +3 1017 798 1027 +3 1027 798 858 +3 798 794 858 +3 858 794 827 +3 794 772 827 +3 827 772 802 +3 772 750 802 +3 802 750 766 +3 750 731 766 +3 766 731 744 +3 731 705 744 +3 744 705 709 +3 709 705 680 +3 705 692 680 +3 680 692 651 +3 692 711 651 +3 651 711 670 +3 711 1017 670 +3 670 1017 684 +3 1017 1052 684 +3 684 1052 856 +3 1052 1080 856 +3 856 1080 899 +3 1080 1086 899 +3 1086 1079 899 +3 899 1079 855 +3 1079 1051 855 +3 855 1051 683 +3 1051 1016 683 +3 683 1016 669 +3 1016 849 669 +3 849 714 669 +3 714 635 669 +3 669 635 639 +3 635 593 639 +3 639 593 643 +3 593 597 643 +3 643 597 647 +3 597 601 647 +3 647 601 650 +3 601 604 650 +3 650 604 648 +3 604 602 648 +3 648 602 644 +3 602 598 644 +3 598 640 644 +3 644 640 670 +3 640 651 670 +3 730 711 719 +3 711 692 719 +3 719 692 703 +3 692 705 703 +3 708 792 787 +3 787 792 842 +3 792 825 842 +3 842 825 877 +3 825 870 877 +3 877 870 906 +3 870 862 906 +3 906 862 908 +3 862 903 908 +3 908 903 929 +3 903 911 929 +3 929 911 947 +3 911 914 947 +3 947 914 951 +3 914 925 951 +3 951 925 1002 +3 925 969 1002 +3 1002 969 1038 +3 969 1033 1038 +3 1038 1033 1074 +3 1033 1066 1074 +3 1074 1066 1092 +3 1066 1078 1092 +3 1092 1078 1085 +3 1085 1078 898 +3 898 1078 854 +3 854 1078 1050 +3 1078 1066 1050 +3 1050 1066 1028 +3 1066 1033 1028 +3 1028 1033 945 +3 1033 969 945 +3 945 969 873 +3 969 925 873 +3 873 925 884 +3 925 914 884 +3 884 914 885 +3 914 911 885 +3 885 911 883 +3 911 903 883 +3 883 903 846 +3 903 862 846 +3 846 862 810 +3 862 870 810 +3 810 870 807 +3 870 825 807 +3 807 825 786 +3 825 792 786 +3 786 792 722 +3 792 708 722 +3 722 708 616 +3 708 610 616 +3 616 610 554 +3 610 558 554 +3 554 558 502 +3 558 506 502 +3 502 506 426 +3 506 428 426 +3 426 428 391 +3 428 400 391 +3 400 375 391 +3 391 375 361 +3 375 323 361 +3 361 323 308 +3 323 275 308 +3 704 721 665 +3 721 654 665 +3 665 654 625 +3 654 626 625 +3 625 626 546 +3 626 550 546 +3 546 550 461 +3 550 498 461 +3 461 498 422 +3 498 424 422 +3 424 379 422 +3 422 379 365 +3 379 345 365 +3 707 700 713 +3 700 688 713 +3 707 694 700 +3 694 688 700 +3 742 677 735 +3 735 677 675 +3 677 660 675 +3 675 660 656 +3 660 623 656 +3 670 684 644 +3 644 684 648 +3 684 856 648 +3 648 856 650 +3 856 899 650 +3 650 899 647 +3 899 855 647 +3 647 855 643 +3 855 683 643 +3 643 683 639 +3 683 669 639 +3 664 690 697 +3 697 690 753 +3 753 690 742 +3 742 690 677 +3 690 664 677 +3 677 664 660 +3 664 630 660 +3 660 630 623 +3 630 570 623 +3 674 659 663 +3 663 659 621 +3 659 613 621 +3 621 613 561 +3 613 557 561 +3 561 557 501 +3 557 497 501 +3 501 497 378 +3 497 367 378 +3 378 367 299 +3 367 287 299 +3 299 287 224 +3 633 663 629 +3 663 621 629 +3 629 621 565 +3 621 561 565 +3 565 561 505 +3 561 501 505 +3 505 501 389 +3 501 378 389 +3 389 378 313 +3 378 299 313 +3 313 299 241 +3 299 224 241 +3 224 183 241 +3 241 183 205 +3 183 159 205 +3 666 605 617 +3 605 555 617 +3 617 555 551 +3 555 499 551 +3 551 499 459 +3 499 369 459 +3 459 369 354 +3 354 369 325 +3 369 347 325 +3 325 347 298 +3 347 315 298 +3 298 315 249 +3 315 286 249 +3 249 286 259 +3 286 301 259 +3 259 301 284 +3 301 304 284 +3 284 304 300 +3 304 356 300 +3 300 356 348 +3 348 356 373 +3 356 362 373 +3 373 362 371 +3 362 321 371 +3 371 321 335 +3 321 314 335 +3 335 314 364 +3 314 334 364 +3 364 334 381 +3 334 366 381 +3 381 366 386 +3 366 347 386 +3 347 369 386 +3 386 369 503 +3 369 499 503 +3 499 555 503 +3 503 555 559 +3 555 605 559 +3 602 604 590 +3 604 587 590 +3 590 587 541 +3 587 537 541 +3 541 537 509 +3 509 537 452 +3 537 533 452 +3 452 533 524 +3 533 576 524 +3 524 576 519 +3 576 571 519 +3 519 571 516 +3 604 601 587 +3 601 583 587 +3 587 583 537 +3 537 583 533 +3 583 579 533 +3 533 579 576 +3 579 593 576 +3 593 635 576 +3 576 635 571 +3 598 602 588 +3 602 590 588 +3 588 590 544 +3 590 541 544 +3 544 541 527 +3 541 509 527 +3 527 509 442 +3 442 509 438 +3 509 452 438 +3 438 452 435 +3 452 524 435 +3 435 524 430 +3 524 519 430 +3 430 519 429 +3 519 516 429 +3 429 516 427 +3 601 597 583 +3 583 597 579 +3 597 593 579 +3 573 578 592 +3 592 578 596 +3 596 578 582 +3 582 578 532 +3 578 573 532 +3 532 573 521 +3 573 569 521 +3 521 569 517 +3 569 513 517 +3 517 513 406 +3 513 398 406 +3 406 398 382 +3 398 360 382 +3 382 360 316 +3 360 290 316 +3 316 290 256 +3 290 228 256 +3 256 228 211 +3 228 177 211 +3 211 177 142 +3 582 532 536 +3 532 451 536 +3 536 451 508 +3 508 451 437 +3 451 434 437 +3 437 434 411 +3 411 434 406 +3 406 434 517 +3 517 434 521 +3 434 451 521 +3 521 451 532 +3 559 511 503 +3 503 511 386 +3 511 393 386 +3 386 393 381 +3 496 495 494 +3 495 492 494 +3 494 492 493 +3 492 490 493 +3 493 490 491 +3 490 488 491 +3 491 488 489 +3 488 486 489 +3 489 486 487 +3 486 484 487 +3 487 484 485 +3 484 482 485 +3 485 482 483 +3 482 480 483 +3 483 480 481 +3 480 478 481 +3 481 478 479 +3 478 476 479 +3 479 476 477 +3 476 474 477 +3 477 474 475 +3 474 472 475 +3 475 472 473 +3 472 470 473 +3 473 470 471 +3 470 468 471 +3 471 468 469 +3 468 466 469 +3 469 466 467 +3 466 464 467 +3 467 464 465 +3 464 462 465 +3 465 462 463 +3 546 461 457 +3 457 461 421 +3 461 422 421 +3 421 422 365 +3 447 443 510 +3 443 453 510 +3 510 453 534 +3 534 453 522 +3 522 453 439 +3 453 443 439 +3 526 441 445 +3 441 415 445 +3 417 419 340 +3 419 344 340 +3 340 344 274 +3 344 277 274 +3 413 417 333 +3 417 340 333 +3 333 340 269 +3 340 274 269 +3 269 274 230 +3 230 274 234 +3 274 277 234 +3 234 277 239 +3 431 410 405 +3 410 403 405 +3 410 413 374 +3 413 333 374 +3 374 333 307 +3 333 269 307 +3 307 269 251 +3 269 230 251 +3 251 230 207 +3 207 230 188 +3 230 234 188 +3 188 234 194 +3 234 239 194 +3 194 239 196 +3 416 409 339 +3 409 342 339 +3 339 342 281 +3 342 278 281 +3 281 278 225 +3 278 261 225 +3 225 261 219 +3 219 261 254 +3 261 311 254 +3 254 311 302 +3 302 311 383 +3 311 392 383 +3 383 392 425 +3 409 407 342 +3 407 336 342 +3 342 336 278 +3 336 320 278 +3 278 320 261 +3 261 320 311 +3 311 320 392 +3 392 320 401 +3 320 336 401 +3 401 336 407 +3 411 406 399 +3 406 382 399 +3 399 382 350 +3 382 316 350 +3 350 316 297 +3 316 256 297 +3 297 256 237 +3 256 211 237 +3 237 211 178 +3 211 142 178 +3 178 142 131 +3 142 107 131 +3 131 107 104 +3 107 70 104 +3 104 70 68 +3 70 47 68 +3 68 47 58 +3 47 2 58 +3 58 2 61 +3 2 0 61 +3 61 0 57 +3 0 1 57 +3 57 1 55 +3 1 3 55 +3 55 3 66 +3 3 4 66 +3 66 4 49 +3 4 41 49 +3 41 65 49 +3 49 65 71 +3 71 65 90 +3 90 65 100 +3 65 77 100 +3 408 402 404 +3 402 395 404 +3 411 399 387 +3 399 350 387 +3 387 350 322 +3 350 297 322 +3 322 297 282 +3 297 237 282 +3 282 237 217 +3 237 178 217 +3 217 178 166 +3 178 131 166 +3 166 131 126 +3 131 104 126 +3 126 104 93 +3 104 68 93 +3 93 68 84 +3 68 58 84 +3 58 61 84 +3 84 61 87 +3 61 57 87 +3 87 57 83 +3 57 55 83 +3 83 55 81 +3 55 66 81 +3 404 395 390 +3 400 394 388 +3 393 390 381 +3 381 390 364 +3 364 390 380 +3 390 395 380 +3 380 395 396 +3 395 402 396 +3 396 402 373 +3 402 408 373 +3 400 388 375 +3 388 359 375 +3 375 359 323 +3 359 305 323 +3 323 305 275 +3 305 292 275 +3 275 292 248 +3 292 267 248 +3 248 267 226 +3 267 255 226 +3 226 255 216 +3 255 245 216 +3 216 245 201 +3 245 207 201 +3 201 207 158 +3 207 188 158 +3 158 188 148 +3 188 194 148 +3 148 194 152 +3 194 196 152 +3 152 196 154 +3 196 193 154 +3 154 193 151 +3 193 156 151 +3 151 156 124 +3 156 144 124 +3 124 144 108 +3 144 140 108 +3 108 140 105 +3 140 134 105 +3 105 134 103 +3 134 133 103 +3 103 133 99 +3 133 132 99 +3 99 132 100 +3 132 112 100 +3 100 112 90 +3 112 96 90 +3 90 96 71 +3 96 101 71 +3 71 101 73 +3 101 98 73 +3 73 98 66 +3 98 91 66 +3 66 91 81 +3 91 113 81 +3 81 113 115 +3 113 149 115 +3 115 149 153 +3 149 195 153 +3 153 195 192 +3 195 232 192 +3 192 232 189 +3 232 235 189 +3 189 235 242 +3 235 280 242 +3 242 280 285 +3 280 346 285 +3 285 346 351 +3 346 411 351 +3 411 387 376 +3 387 322 376 +3 376 322 312 +3 322 282 312 +3 312 282 253 +3 282 217 253 +3 253 217 203 +3 217 166 203 +3 203 166 163 +3 166 126 163 +3 163 126 123 +3 126 93 123 +3 123 93 116 +3 93 84 116 +3 84 87 116 +3 116 87 119 +3 87 83 119 +3 119 83 115 +3 83 81 115 +3 380 396 384 +3 396 373 384 +3 373 371 384 +3 371 335 384 +3 384 335 380 +3 335 364 380 +3 411 376 370 +3 376 312 370 +3 370 312 296 +3 312 253 296 +3 296 253 244 +3 253 203 244 +3 244 203 199 +3 203 163 199 +3 199 163 155 +3 163 123 155 +3 155 123 150 +3 123 116 150 +3 116 119 150 +3 150 119 153 +3 119 115 153 +3 410 374 403 +3 374 397 403 +3 403 397 394 +3 397 377 394 +3 394 377 388 +3 388 377 359 +3 377 331 359 +3 359 331 305 +3 331 319 305 +3 305 319 292 +3 319 303 292 +3 292 303 267 +3 303 295 267 +3 267 295 255 +3 295 288 255 +3 255 288 245 +3 288 251 245 +3 245 251 207 +3 411 370 358 +3 370 296 358 +3 358 296 289 +3 296 244 289 +3 289 244 242 +3 244 199 242 +3 242 199 189 +3 199 155 189 +3 189 155 192 +3 155 150 192 +3 192 150 153 +3 363 372 374 +3 372 385 374 +3 374 385 397 +3 397 385 377 +3 377 385 331 +3 385 372 331 +3 331 372 319 +3 372 363 319 +3 319 363 303 +3 303 363 357 +3 363 374 357 +3 357 374 349 +3 374 307 349 +3 349 307 288 +3 307 251 288 +3 411 358 351 +3 358 289 351 +3 351 289 285 +3 289 242 285 +3 347 366 315 +3 366 334 315 +3 315 334 286 +3 334 314 286 +3 286 314 301 +3 314 321 301 +3 301 321 304 +3 321 362 304 +3 304 362 356 +3 411 346 341 +3 346 280 341 +3 418 343 337 +3 343 271 337 +3 337 271 268 +3 271 229 268 +3 268 229 250 +3 229 206 250 +3 250 206 252 +3 206 215 252 +3 252 215 222 +3 215 182 222 +3 222 182 208 +3 182 165 208 +3 208 165 200 +3 330 329 309 +3 329 263 309 +3 309 263 257 +3 263 213 257 +3 257 213 180 +3 213 169 180 +3 180 169 145 +3 169 138 145 +3 145 138 111 +3 138 97 111 +3 111 97 89 +3 97 72 89 +3 89 72 64 +3 72 50 64 +3 64 50 5 +3 50 42 5 +3 5 42 43 +3 42 67 43 +3 43 67 56 +3 67 82 56 +3 82 86 56 +3 56 86 60 +3 86 88 60 +3 60 88 62 +3 88 85 62 +3 85 59 62 +3 59 44 62 +3 62 44 46 +3 44 37 46 +3 37 38 46 +3 38 40 46 +3 40 39 46 +3 39 36 46 +3 46 36 45 +3 36 34 45 +3 34 32 45 +3 32 30 45 +3 30 28 45 +3 28 26 45 +3 26 24 45 +3 45 24 43 +3 24 22 43 +3 43 22 5 +3 329 318 263 +3 263 318 266 +3 318 279 266 +3 279 204 266 +3 266 204 186 +3 204 173 186 +3 186 173 162 +3 173 135 162 +3 162 135 129 +3 135 109 129 +3 129 109 102 +3 109 95 102 +3 102 95 74 +3 95 67 74 +3 74 67 50 +3 67 42 50 +3 389 313 326 +3 326 313 260 +3 313 241 260 +3 260 241 205 +3 303 357 295 +3 357 349 295 +3 295 349 288 +3 339 281 273 +3 281 236 273 +3 273 236 233 +3 233 236 190 +3 190 236 184 +3 236 225 184 +3 184 225 219 +3 343 276 271 +3 276 231 271 +3 271 231 229 +3 231 187 229 +3 229 187 206 +3 187 157 206 +3 206 157 171 +3 157 130 171 +3 130 143 171 +3 171 143 182 +3 143 165 182 +3 263 266 213 +3 266 186 213 +3 213 186 169 +3 186 162 169 +3 169 162 138 +3 162 129 138 +3 138 129 97 +3 129 102 97 +3 97 102 72 +3 102 74 72 +3 72 74 50 +3 276 238 231 +3 238 191 231 +3 231 191 187 +3 191 147 187 +3 187 147 157 +3 147 121 157 +3 157 121 130 +3 236 281 225 +3 232 272 235 +3 235 272 280 +3 272 338 280 +3 280 338 341 +3 341 338 411 +3 338 415 411 +3 411 415 437 +3 415 441 437 +3 437 441 508 +3 441 526 508 +3 526 540 508 +3 508 540 536 +3 540 586 536 +3 536 586 582 +3 586 600 582 +3 582 600 596 +3 600 646 596 +3 646 642 596 +3 596 642 592 +3 642 638 592 +3 638 633 592 +3 592 633 573 +3 633 629 573 +3 573 629 569 +3 629 565 569 +3 569 565 513 +3 565 505 513 +3 513 505 398 +3 505 389 398 +3 398 389 360 +3 389 326 360 +3 360 326 290 +3 326 260 290 +3 290 260 228 +3 260 205 228 +3 228 205 177 +3 205 159 177 +3 159 125 177 +3 177 125 142 +3 125 107 142 +3 279 220 204 +3 220 198 204 +3 204 198 173 +3 198 164 173 +3 173 164 135 +3 164 139 135 +3 135 139 109 +3 139 127 109 +3 109 127 95 +3 127 92 95 +3 95 92 67 +3 92 82 67 +3 210 243 202 +3 243 181 202 +3 182 215 171 +3 215 206 171 +3 144 179 140 +3 140 179 174 +3 179 214 174 +3 174 214 210 +3 214 247 210 +3 210 247 243 +3 247 293 243 +3 293 258 243 +3 243 258 181 +3 258 212 181 +3 181 212 168 +3 212 185 168 +3 168 185 161 +3 185 175 161 +3 175 136 161 +3 161 136 128 +3 136 110 128 +3 128 110 101 +3 110 98 101 +3 140 174 134 +3 134 174 170 +3 174 210 170 +3 210 202 170 +3 170 202 167 +3 202 181 167 +3 167 181 146 +3 181 168 146 +3 146 168 137 +3 168 161 137 +3 161 128 137 +3 137 128 96 +3 128 101 96 +3 134 170 133 +3 170 167 133 +3 133 167 132 +3 167 146 132 +3 132 146 112 +3 146 137 112 +3 112 137 96 +3 94 80 69 +3 69 80 63 +3 80 79 63 +3 79 54 63 +3 63 54 48 +3 54 41 48 +3 79 78 54 +3 78 53 54 +3 54 53 41 +3 78 75 53 +3 75 51 53 +3 53 51 41 +3 75 77 51 +3 71 73 49 +3 73 66 49 +3 77 65 52 +3 65 41 52 +3 69 63 48 +3 77 52 51 +3 52 41 51 +3 62 46 60 +3 46 45 60 +3 60 45 56 +3 45 43 56 +3 39 493 36 +3 493 491 36 +3 36 491 34 +3 491 489 34 +3 34 489 32 +3 489 487 32 +3 32 487 30 +3 487 485 30 +3 30 485 28 +3 485 483 28 +3 28 483 26 +3 483 481 26 +3 26 481 24 +3 481 479 24 +3 24 479 22 +3 479 477 22 +3 22 477 20 +3 477 475 20 +3 20 475 18 +3 475 473 18 +3 18 473 16 +3 473 471 16 +3 16 471 14 +3 471 469 14 +3 14 469 12 +3 469 467 12 +3 12 467 10 +3 467 465 10 +3 10 465 8 +3 465 463 8 +3 8 463 6 +3 463 462 6 +3 6 462 7 +3 462 464 7 +3 7 464 9 +3 464 466 9 +3 9 466 11 +3 466 468 11 +3 11 468 13 +3 468 470 13 +3 13 470 15 +3 470 472 15 +3 15 472 17 +3 472 474 17 +3 17 474 19 +3 474 476 19 +3 19 476 21 +3 476 478 21 +3 21 478 23 +3 478 480 23 +3 23 480 25 +3 480 482 25 +3 25 482 27 +3 482 484 27 +3 27 484 29 +3 484 486 29 +3 29 486 31 +3 486 488 31 +3 31 488 33 +3 488 490 33 +3 33 490 35 +3 490 492 35 +3 35 492 37 +3 492 495 37 +3 37 495 38 +3 38 495 40 +3 495 496 40 +3 40 496 39 +3 496 494 39 +3 39 494 493 +3 37 44 35 +3 35 44 33 +3 33 44 31 +3 31 44 29 +3 29 44 27 +3 44 25 27 +3 41 4 3 + diff --git a/AABB_tree/benchmark/AABB_tree/test.cpp b/AABB_tree/benchmark/AABB_tree/test.cpp new file mode 100644 index 00000000000..22ebbbb08e5 --- /dev/null +++ b/AABB_tree/benchmark/AABB_tree/test.cpp @@ -0,0 +1,176 @@ +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include + +typedef CGAL::Exact_predicates_inexact_constructions_kernel K; +typedef CGAL::Surface_mesh Surface_mesh; + +typedef CGAL::AABB_face_graph_triangle_primitive Primitive; +typedef CGAL::AABB_do_intersect_transform_traits Traits; +typedef CGAL::AABB_tree Tree; + +namespace PMP = CGAL::Polygon_mesh_processing; + +void naive_test(int k, const char* fname, + int& nb_inter, int& nb_no_inter, int& nb_include) +{ + std::ifstream input(fname); + Surface_mesh tm, tm2; + input >> tm; + copy_face_graph(tm, tm2); + CGAL::Aff_transformation_3 init1(CGAL::SCALING, 6.0); + PMP::transform(init1, tm); + CGAL::Bbox_3 box = PMP::bbox(tm); + typedef CGAL::AABB_tree > Tree; + Tree tmTree(tm.faces_begin(), tm.faces_end(), tm); + Tree tmTree2(tm2.faces_begin(), tm2.faces_end(), tm2); + CGAL::Aff_transformation_3 init2(CGAL::TRANSLATION, - K::Vector_3( + (box.xmax()-box.xmin()),0,0)); + PMP::transform(init2, tm2); + + tmTree.build(); + K::Vector_3 unit_vec = (2.0/k * K::Vector_3((box.xmax()-box.xmin()), + 0, + 0)); + CGAL::Aff_transformation_3 T0(CGAL::IDENTITY); + K::FT rot[9]; + rot[0] = 1.0; + rot[1] = 0.0; + rot[2] = 0.0; + rot[3] = 0.0; + rot[4] = std::cos(CGAL_PI/4.0); + rot[5] = -std::sin(CGAL_PI/4.0); + rot[6] = 0.0; + rot[7] = std::sin(CGAL_PI/4.0); + rot[8] = std::cos(CGAL_PI/4.0); + CGAL::Aff_transformation_3 R(rot[0], rot[1], rot[2], + rot[3], rot[4], rot[5], + rot[6], rot[7], rot[8]); + + CGAL::Side_of_triangle_mesh sotm1(tm); + for(int i=1; i T1 = CGAL::Aff_transformation_3(CGAL::TRANSLATION, i*unit_vec); + CGAL::Aff_transformation_3 transfo = T0*R*T1; + PMP::transform(transfo, tm2); + tmTree2.build(); + if(tmTree2.do_intersect(tmTree)) + ++nb_inter; + else + { + if(sotm1(tm2.point(*tm2.vertices().begin())) != CGAL::ON_UNBOUNDED_SIDE) + { + ++nb_include; + } + else + { + CGAL::Side_of_triangle_mesh sotm2(tm2); + if(sotm2(tm.point(*tm.vertices().begin())) != CGAL::ON_UNBOUNDED_SIDE) + ++nb_include; + else + ++nb_no_inter; + } + } + T0 = CGAL::Aff_transformation_3(CGAL::TRANSLATION, -i*unit_vec); + } +} +void test_no_collision(int k, const char* fname, + int& nb_inter, int& nb_no_inter, int& nb_include) +{ + std::ifstream input(fname); + Surface_mesh tm, tm2; + input >> tm; + copy_face_graph(tm, tm2); + CGAL::Aff_transformation_3 init1(CGAL::SCALING, 6.0); + PMP::transform(init1, tm); + CGAL::Bbox_3 box = PMP::bbox(tm); + Tree tmTree(tm.faces_begin(), tm.faces_end(), tm); + Tree tmTree2(tm2.faces_begin(), tm2.faces_end(), tm2); + CGAL::Aff_transformation_3 init2(CGAL::TRANSLATION, - K::Vector_3( + (box.xmax()-box.xmin()),0,0)); + PMP::transform(init2, tm2); + + tmTree.build(); + tmTree2.build(); + typedef boost::property_map::type VPM; + VPM vpm2 = get(CGAL::vertex_point, tm2); + + K::Vector_3 unit_vec = (2.0/k * K::Vector_3((box.xmax()-box.xmin()), + 0, + 0)); + + CGAL::Side_of_triangle_mesh sotm1(tmTree); + for(int i=1; i R(rot[0], rot[1], rot[2], + rot[3], rot[4], rot[5], + rot[6], rot[7], rot[8]); + CGAL::Aff_transformation_3 T1 = CGAL::Aff_transformation_3(CGAL::TRANSLATION, i*unit_vec); + CGAL::Aff_transformation_3 transfo = R*T1; + tmTree2.traits().set_transformation(transfo); + CGAL::Interval_nt_advanced::Protector protector; + if(tmTree2.do_intersect(tmTree)) + ++nb_inter; + else + { + if(sotm1(transfo.transform(vpm2[*tm2.vertices().begin()])) != CGAL::ON_UNBOUNDED_SIDE) + { + ++nb_include; + } + else + { + CGAL::Side_of_triangle_mesh sotm2(tmTree2); + if(sotm2(tm.point(*tm.vertices().begin())) != CGAL::ON_UNBOUNDED_SIDE) + ++nb_include; + else + ++nb_no_inter; + } + } + } +} + +int main(int argc, const char** argv) +{ + int k = (argc>1) ? atoi(argv[1]) : 10; + const char* path = (argc>2)?argv[2]:"data/handle" + ".off"; + + std::cout<< k<<" steps in "<(end - start).count() << "μs." << std::endl; + start = std::chrono::steady_clock::now(); + test_no_collision(k, path,nb_inter, nb_no_inter, nb_include); + end = std::chrono::steady_clock::now(); + std::cout<<"With transform_traits: "<(end - start).count() << "μs." << std::endl; + return 0; +} diff --git a/AABB_tree/demo/AABB_tree/CMakeLists.txt b/AABB_tree/demo/AABB_tree/CMakeLists.txt index 67d82685b54..11a5922ccf6 100644 --- a/AABB_tree/demo/AABB_tree/CMakeLists.txt +++ b/AABB_tree/demo/AABB_tree/CMakeLists.txt @@ -17,7 +17,7 @@ if(POLICY CMP0071) endif() # Include this package's headers first -include_directories( BEFORE ./ ./include ../../include ) +include_directories( BEFORE ./ ./include ) # Find CGAL and CGAL Qt5 find_package(CGAL COMPONENTS Qt5) @@ -25,9 +25,6 @@ find_package(CGAL COMPONENTS Qt5) # Find Qt5 itself find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Gui Svg) -include( ${CGAL_USE_FILE} ) - - if(CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND) qt5_wrap_ui( UI_FILES MainWindow.ui ) diff --git a/AABB_tree/doc/AABB_tree/Concepts/AABBGeomTraits.h b/AABB_tree/doc/AABB_tree/Concepts/AABBGeomTraits.h index ec017f1efe3..c5b4eb97f1b 100644 --- a/AABB_tree/doc/AABB_tree/Concepts/AABBGeomTraits.h +++ b/AABB_tree/doc/AABB_tree/Concepts/AABBGeomTraits.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgAABB_treeConcepts +\ingroup PkgAABBTreeConcepts \cgalConcept The concept `AABBGeomTraits` defines the requirements for the first template parameter of the class `CGAL::AABB_traits`. It provides predicates and constructors to detect and compute intersections between query objects and the primitives stored in the AABB tree. In addition, it contains predicates and constructors to compute distances between a point query and the primitives stored in the AABB tree. diff --git a/AABB_tree/doc/AABB_tree/Concepts/AABBPrimitive.h b/AABB_tree/doc/AABB_tree/Concepts/AABBPrimitive.h index 93a4b42efee..64962d12741 100644 --- a/AABB_tree/doc/AABB_tree/Concepts/AABBPrimitive.h +++ b/AABB_tree/doc/AABB_tree/Concepts/AABBPrimitive.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgAABB_treeConcepts +\ingroup PkgAABBTreeConcepts \cgalConcept The concept `AABBPrimitive` describes the requirements for the primitives stored in the AABB tree data structure. The concept encapsulates a type for the input datum (a geometric object) and an identifier (id) type through which those primitives are referred to. The concept `AABBPrimitive` also refines the concepts DefaultConstructible and Assignable. diff --git a/AABB_tree/doc/AABB_tree/Concepts/AABBPrimitiveWithSharedData.h b/AABB_tree/doc/AABB_tree/Concepts/AABBPrimitiveWithSharedData.h index 406c581c415..fb740edf212 100644 --- a/AABB_tree/doc/AABB_tree/Concepts/AABBPrimitiveWithSharedData.h +++ b/AABB_tree/doc/AABB_tree/Concepts/AABBPrimitiveWithSharedData.h @@ -1,5 +1,5 @@ /*! -\ingroup PkgAABB_treeConcepts +\ingroup PkgAABBTreeConcepts \cgalConcept The concept `AABBPrimitiveWithSharedData` describes the requirements for the primitives diff --git a/AABB_tree/doc/AABB_tree/Concepts/AABBRayIntersectionGeomTraits.h b/AABB_tree/doc/AABB_tree/Concepts/AABBRayIntersectionGeomTraits.h index 9cbf77a1183..22ce34118d3 100644 --- a/AABB_tree/doc/AABB_tree/Concepts/AABBRayIntersectionGeomTraits.h +++ b/AABB_tree/doc/AABB_tree/Concepts/AABBRayIntersectionGeomTraits.h @@ -1,5 +1,5 @@ /*! -\ingroup PkgAABB_treeConcepts +\ingroup PkgAABBTreeConcepts \cgalConcept The concept `AABBRayIntersectionGeomTraits` is a refinement of the diff --git a/AABB_tree/doc/AABB_tree/Concepts/AABBRayIntersectionTraits.h b/AABB_tree/doc/AABB_tree/Concepts/AABBRayIntersectionTraits.h index 68d3d4d3a68..dfe82f27d01 100644 --- a/AABB_tree/doc/AABB_tree/Concepts/AABBRayIntersectionTraits.h +++ b/AABB_tree/doc/AABB_tree/Concepts/AABBRayIntersectionTraits.h @@ -1,5 +1,5 @@ /*! -\ingroup PkgAABB_treeConcepts +\ingroup PkgAABBTreeConcepts \cgalConcept The concept `AABBRayIntersectionTraits` is a refinement of the concept diff --git a/AABB_tree/doc/AABB_tree/Concepts/AABBTraits.h b/AABB_tree/doc/AABB_tree/Concepts/AABBTraits.h index 123bda80c47..3f9cc9a9be3 100644 --- a/AABB_tree/doc/AABB_tree/Concepts/AABBTraits.h +++ b/AABB_tree/doc/AABB_tree/Concepts/AABBTraits.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgAABB_treeConcepts +\ingroup PkgAABBTreeConcepts \cgalConcept The concept `AABBTraits` provides the geometric primitive types and methods for the class `CGAL::AABB_tree`. @@ -75,25 +75,17 @@ using Intersection_and_primitive_id = unspecified_type; /// \name Splitting /// During the construction of the AABB tree, the primitives are -/// sorted according to some comparison functions related to the \f$x\f$, -/// \f$ y\f$ or \f$ z\f$ coordinate axis: +/// splitted according to some comparison functions related to the longest axis: /// @{ /*! -A functor object to split a range of primitives into two sub-ranges along the X-axis. Provides the operator: -`void operator()(InputIterator first, InputIterator beyond);` %Iterator type `InputIterator` must be a model of RandomAccessIterator and have `Primitive` as value type. The operator is used for determining the primitives assigned to the two children nodes of a given node, assuming that the goal is to split the X-dimension of the bounding box of the node. The primitives assigned to this node are passed as argument to the operator. It should modify the iterator range in such a way that its first half and its second half correspond to the two children nodes. +A functor object to split a range of primitives into two sub-ranges along the longest axis. Provides the operator: + `void operator()(InputIterator first, InputIterator beyond);` %Iterator type `InputIterator` must be a model of RandomAccessIterator + and have `Primitive` as value type. The operator is used for determining the primitives assigned to the two children nodes of a given node, + assuming that the goal is to split the chosen axis dimension of the bounding box of the node. The primitives assigned to this node are passed as argument + to the operator. It should modify the iterator range in such a way that its first half and its second half correspond to the two children nodes. */ -typedef unspecified_type Split_primitives_along_x_axis; - -/*! -A functor object to split a range of primitives into two sub-ranges along the Y-axis. See `Split_primitives_along_x_axis` for the detailed description. -*/ -typedef unspecified_type Split_primitives_along_y_axis; - -/*! -A functor object to split a range of primitives into two sub-ranges along the Z-axis. See `Split_primitives_along_x_axis` for the detailed description. -*/ -typedef unspecified_type Split_primitives_along_z_axis; +typedef unspecified_type Split_primitives; /*! A functor object to compute the bounding box of a set of primitives. Provides the operator: @@ -132,7 +124,7 @@ A functor object to compute the intersection of a query and a primitive. Provide \cgalHeading{Note on Backward Compatibility} Before the release 4.3 of \cgal, the return type of this function used to be `boost::optional`. */ -typedef unspecified_type Intersect; +typedef unspecified_type Intersection; /// \name Distance Queries /// The following predicates are required for each @@ -170,19 +162,9 @@ typedef unspecified_type Equal_3; /// @{ /*! -Returns the primitive splitting functor for the X axis. +Returns the primitive splitting functor. */ -Split_primitives_along_x_axis split_primitives_along_x_axis_object(); - -/*! -Returns the primitive splitting functor for the Y axis. -*/ -Split_primitives_along_y_axis split_primitives_along_y_axis_object(); - -/*! -Returns the primitive splitting functor for the Z axis. -*/ -Split_primitives_along_z_axis split_primitives_along_z_axis_object(); +Split_primitives split_primitives_object(); /*! Returns the bounding box constructor. @@ -197,7 +179,7 @@ Do_intersect do_intersect_object(); /*! Returns the intersection constructor. */ -Intersect intersect_object(); +Intersection intersection_object(); /*! Returns the distance comparison functor. diff --git a/AABB_tree/doc/AABB_tree/PackageDescription.txt b/AABB_tree/doc/AABB_tree/PackageDescription.txt index e94a561f00a..7df50a91fd1 100644 --- a/AABB_tree/doc/AABB_tree/PackageDescription.txt +++ b/AABB_tree/doc/AABB_tree/PackageDescription.txt @@ -1,16 +1,16 @@ -/// \defgroup PkgAABB_tree AABB Tree Reference +/// \defgroup PkgAABBTreeRef AABB Tree Reference -/// \defgroup PkgAABB_treeConcepts Concepts -/// \ingroup PkgAABB_tree +/// \defgroup PkgAABBTreeConcepts Concepts +/// \ingroup PkgAABBTreeRef /*! -\addtogroup PkgAABB_tree -\cgalPkgDescriptionBegin{3D Fast Intersection and Distance Computation,PkgAABB_treeSummary} +\addtogroup PkgAABBTreeRef +\cgalPkgDescriptionBegin{3D Fast Intersection and Distance Computation,PkgAABBTree} \cgalPkgPicture{aabb-teaser-thumb.png} \cgalPkgSummaryBegin \cgalPkgAuthors{Pierre Alliez, Stéphane Tayeb, Camille Wormser} \cgalPkgDesc{The AABB (axis-aligned bounding box) tree component offers a static data structure and algorithms to perform efficient intersection and distance queries on sets of finite 3D geometric objects.} -\cgalPkgManuals{Chapter_3D_Fast_Intersection_and_Distance_Computation,PkgAABB_tree} +\cgalPkgManuals{Chapter_3D_Fast_Intersection_and_Distance_Computation,PkgAABBTreeRef} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{3.5} diff --git a/AABB_tree/examples/AABB_tree/CMakeLists.txt b/AABB_tree/examples/AABB_tree/CMakeLists.txt index 4119933bf05..c3317a79f65 100644 --- a/AABB_tree/examples/AABB_tree/CMakeLists.txt +++ b/AABB_tree/examples/AABB_tree/CMakeLists.txt @@ -4,18 +4,12 @@ project( AABB_tree_Examples ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/AABB_tree/include/CGAL/AABB_face_graph_triangle_primitive.h b/AABB_tree/include/CGAL/AABB_face_graph_triangle_primitive.h index 83e01c72d6c..7663d0d78c7 100644 --- a/AABB_tree/include/CGAL/AABB_face_graph_triangle_primitive.h +++ b/AABB_tree/include/CGAL/AABB_face_graph_triangle_primitive.h @@ -30,11 +30,12 @@ #include #include #include +#include namespace CGAL { /*! - * \ingroup PkgAABB_tree + * \ingroup PkgAABBTreeRef * Primitive type for a facet of a polyhedral surface. * It wraps a handle to a facet of a polyhedron to a 3D triangle. * The polyhedron from which the primitive is built should not be deleted @@ -65,24 +66,27 @@ template < class FaceGraph, class CacheDatum=Tag_false > class AABB_face_graph_triangle_primitive #ifndef DOXYGEN_RUNNING - : public AABB_primitive::face_descriptor, + : public AABB_primitive::face_descriptor, + std::pair::face_descriptor, const FaceGraph*> >::type, Triangle_from_face_descriptor_map< FaceGraph, typename Default::Get::type >::type>, + vertex_point_t>::const_type >::type>, One_point_from_face_descriptor_map< FaceGraph, typename Default::Get::type >::type>, + vertex_point_t>::const_type >::type>, OneFaceGraphPerTree, CacheDatum > #endif { - typedef typename Default::Get::type >::type VertexPointPMap_; + typedef typename Default::Get::const_type >::type VertexPointPMap_; + typedef typename boost::graph_traits::face_descriptor FD; + typedef typename boost::mpl::if_ >::type Id_; - typedef typename boost::graph_traits::face_descriptor Id_; typedef Triangle_from_face_descriptor_map Triangle_property_map; typedef One_point_from_face_descriptor_map Point_property_map; @@ -92,6 +96,16 @@ class AABB_face_graph_triangle_primitive OneFaceGraphPerTree, CacheDatum > Base; + FD make_id(FD fd, const FaceGraph&, Tag_true) + { + return fd; + } + + std::pair make_id(FD fd, const FaceGraph& fg, Tag_false) + { + return std::make_pair(fd, &fg); + } + public: #ifdef DOXYGEN_RUNNING /// \name Types @@ -105,9 +119,12 @@ public: */ typedef Kernel_traits::Kernel::Triangle_3 Datum; /*! - Id type. + Id type: + - `boost::graph_traits::%face_descriptor` if `OneFaceGraphPerTree` is `CGAL::Tag_true` + - `std::pair::%face_descriptor, FaceGraph>` if `OneFaceGraphPerTree` is `CGAL::Tag_false` */ - typedef boost::graph_traits::face_descriptor Id; + unspecified_type Id; + /// @} /*! @@ -117,6 +134,7 @@ public: #else typedef typename Base::Id Id; #endif + typedef typename boost::graph_traits::face_descriptor face_descriptor; // constructors /*! @@ -127,7 +145,7 @@ public: */ template AABB_face_graph_triangle_primitive(Iterator it, const FaceGraph& graph, VertexPointPMap_ vppm) - : Base( Id_(*it), + : Base( Id_(make_id(*it, graph, OneFaceGraphPerTree())), Triangle_property_map(const_cast(&graph),vppm), Point_property_map(const_cast(&graph),vppm) ) {} @@ -137,8 +155,8 @@ public: If `VertexPointPMap` is the default of the class, an additional constructor is available with `vppm` set to `get(vertex_point, graph)`. */ - AABB_face_graph_triangle_primitive(Id id, const FaceGraph& graph, VertexPointPMap_ vppm) - : Base( Id_(id), + AABB_face_graph_triangle_primitive(face_descriptor fd, const FaceGraph& graph, VertexPointPMap_ vppm) + : Base( Id_(make_id(fd, graph, OneFaceGraphPerTree())), Triangle_property_map(const_cast(&graph),vppm), Point_property_map(const_cast(&graph),vppm) ) {} @@ -146,13 +164,13 @@ public: #ifndef DOXYGEN_RUNNING template AABB_face_graph_triangle_primitive(Iterator it, const FaceGraph& graph) - : Base( Id_(*it), + : Base( Id_(make_id(*it, graph, OneFaceGraphPerTree())), Triangle_property_map(const_cast(&graph)), Point_property_map(const_cast(&graph)) ) {} - AABB_face_graph_triangle_primitive(Id id, const FaceGraph& graph) - : Base( Id_(id), + AABB_face_graph_triangle_primitive(face_descriptor fd, const FaceGraph& graph) + : Base( Id_(make_id(fd, graph, OneFaceGraphPerTree())), Triangle_property_map(const_cast(&graph)), Point_property_map(const_cast(&graph)) ) {} diff --git a/AABB_tree/include/CGAL/AABB_halfedge_graph_segment_primitive.h b/AABB_tree/include/CGAL/AABB_halfedge_graph_segment_primitive.h index 1a0dc4eb616..1eb27965e6c 100644 --- a/AABB_tree/include/CGAL/AABB_halfedge_graph_segment_primitive.h +++ b/AABB_tree/include/CGAL/AABB_halfedge_graph_segment_primitive.h @@ -35,6 +35,7 @@ #include #include #include +#include #include @@ -42,7 +43,7 @@ namespace CGAL { /*! - * \ingroup PkgAABB_tree + * \ingroup PkgAABBTreeRef * Primitive type for a edge of a polyhedral surface. * It wraps an `edge_descriptor` into a 3D segment. * The class model of `HalfedgeGraph` from which the primitive is built should not be deleted @@ -78,7 +79,9 @@ template < class HalfedgeGraph, class CacheDatum = Tag_false > class AABB_halfedge_graph_segment_primitive #ifndef DOXYGEN_RUNNING - : public AABB_primitive< typename boost::graph_traits::edge_descriptor, + : public AABB_primitive< typename boost::mpl::if_::edge_descriptor, + std::pair::edge_descriptor, const HalfedgeGraph*> >::type, Segment_from_edge_descriptor_map< HalfedgeGraph, typename Default::Get::type >::type VertexPointPMap_; + typedef typename boost::graph_traits::edge_descriptor ED; + typedef typename boost::mpl::if_ >::type Id_; - typedef typename boost::graph_traits::edge_descriptor Id_; typedef Segment_from_edge_descriptor_map Segment_property_map; typedef Source_point_from_edge_descriptor_map Point_property_map; @@ -105,6 +109,16 @@ class AABB_halfedge_graph_segment_primitive OneHalfedgeGraphPerTree, CacheDatum > Base; + ED make_id(ED ed, const HalfedgeGraph&, Tag_true) + { + return ed; + } + + std::pair make_id(ED ed, const HalfedgeGraph& fg, Tag_false) + { + return std::make_pair(ed, &fg); + } + public: #ifdef DOXYGEN_RUNNING @@ -119,18 +133,21 @@ public: */ typedef Kernel_traits::Kernel::Segment_3 Datum; /*! - Id type. + Id type: + - `boost::graph_traits::%edge_descriptor if `OneHalfedgeGraphPerTree` is `Tag_true` + - `std::pair::edge_descriptor, HalfedgeGraph>` if `OneHalfedgeGraphPerTree` is `Tag_false` */ - typedef boost::graph_traits::edge_descriptor Id; + unspecified_type Id; /// @} /*! - If `OneHalfedgeGraphPerTreeGraphPerTree` is CGAL::Tag_true, constructs a `Shared_data` object from a reference to the halfedge graph. + If `OneHalfedgeGraphPerTree` is CGAL::Tag_true, constructs a `Shared_data` object from a reference to the halfedge graph. */ static unspecified_type construct_shared_data( HalfedgeGraph& graph ); #else typedef typename Base::Id Id; #endif + typedef typename boost::graph_traits::edge_descriptor edge_descriptor; /*! Constructs a primitive. @@ -142,7 +159,7 @@ public: */ template AABB_halfedge_graph_segment_primitive(Iterator it, const HalfedgeGraph& graph, VertexPointPMap_ vppm) - : Base( Id_(*it), + : Base( Id_(make_id(*it, graph, OneHalfedgeGraphPerTree())), Segment_property_map(const_cast(&graph), vppm), Point_property_map(const_cast(&graph), vppm) ) {} @@ -152,8 +169,8 @@ public: If `VertexPointPMap` is the default of the class, an additional constructor is available with `vppm` set to `boost::get(vertex_point, graph)`. */ - AABB_halfedge_graph_segment_primitive(Id id, const HalfedgeGraph& graph, VertexPointPMap_ vppm) - : Base( Id_(id), + AABB_halfedge_graph_segment_primitive(edge_descriptor ed, const HalfedgeGraph& graph, VertexPointPMap_ vppm) + : Base( Id_(make_id(ed, graph, OneHalfedgeGraphPerTree())), Segment_property_map(const_cast(&graph), vppm), Point_property_map(const_cast(&graph), vppm) ) {} @@ -161,12 +178,12 @@ public: #ifndef DOXYGEN_RUNNING template AABB_halfedge_graph_segment_primitive(Iterator it, const HalfedgeGraph& graph) - : Base( Id_(*it), + : Base( Id_(make_id(*it, graph, OneHalfedgeGraphPerTree())), Segment_property_map(const_cast(&graph)), Point_property_map(const_cast(&graph)) ){} - AABB_halfedge_graph_segment_primitive(Id id, const HalfedgeGraph& graph) - : Base( Id_(id), + AABB_halfedge_graph_segment_primitive(edge_descriptor ed, const HalfedgeGraph& graph) + : Base( Id_(make_id(ed, graph, OneHalfedgeGraphPerTree())), Segment_property_map(const_cast(&graph)), Point_property_map(const_cast(&graph)) ){} #endif diff --git a/AABB_tree/include/CGAL/AABB_polyhedron_segment_primitive.h b/AABB_tree/include/CGAL/AABB_polyhedron_segment_primitive.h index 85798d83374..4db0f6eae75 100644 --- a/AABB_tree/include/CGAL/AABB_polyhedron_segment_primitive.h +++ b/AABB_tree/include/CGAL/AABB_polyhedron_segment_primitive.h @@ -40,7 +40,7 @@ namespace CGAL { -/// \addtogroup PkgAABB_tree +/// \addtogroup PkgAABBTreeRef /// @{ /// \deprecated This class is deprecated since \cgal 4.3, the class /// `AABB_halfedge_graph_segment_primitive` should be used instead. diff --git a/AABB_tree/include/CGAL/AABB_polyhedron_triangle_primitive.h b/AABB_tree/include/CGAL/AABB_polyhedron_triangle_primitive.h index 363a718c03f..92cc3e165ab 100644 --- a/AABB_tree/include/CGAL/AABB_polyhedron_triangle_primitive.h +++ b/AABB_tree/include/CGAL/AABB_polyhedron_triangle_primitive.h @@ -35,7 +35,7 @@ #include namespace CGAL { - /// \ingroup PkgAABB_tree + /// \ingroup PkgAABBTreeRef /// \deprecated This class is deprecated since \cgal 4.3, the class /// `AABB_face_graph_triangle_primitive` should be used instead. /// diff --git a/AABB_tree/include/CGAL/AABB_primitive.h b/AABB_tree/include/CGAL/AABB_primitive.h index 205dad36754..6e08c8800a2 100644 --- a/AABB_tree/include/CGAL/AABB_primitive.h +++ b/AABB_tree/include/CGAL/AABB_primitive.h @@ -57,7 +57,7 @@ public: #ifdef DOXYGEN_RUNNING /*! - * \ingroup PkgAABB_tree + * \ingroup PkgAABBTreeRef * Generic primitive type. * The two property maps which are template parameters of the class enable to get the datum and the reference point of * the primitive from the identifier. The last template parameter controls whether the primitive class holds a copy of the datum. diff --git a/AABB_tree/include/CGAL/AABB_segment_primitive.h b/AABB_tree/include/CGAL/AABB_segment_primitive.h index 00618eafd34..872fa2f5b46 100644 --- a/AABB_tree/include/CGAL/AABB_segment_primitive.h +++ b/AABB_tree/include/CGAL/AABB_segment_primitive.h @@ -56,7 +56,7 @@ namespace internal { /*! - * \ingroup PkgAABB_tree + * \ingroup PkgAABBTreeRef * Primitive type that uses as identifier an iterator with a 3D segment as `value_type`. * The iterator from which the primitive is built should not be invalided * while the AABB tree holding the primitive is in use. diff --git a/AABB_tree/include/CGAL/AABB_traits.h b/AABB_tree/include/CGAL/AABB_traits.h index 632f2256d4b..a3e20752516 100644 --- a/AABB_tree/include/CGAL/AABB_traits.h +++ b/AABB_tree/include/CGAL/AABB_traits.h @@ -173,9 +173,13 @@ struct AABB_traits_base_2{ } } //end of namespace internal::AABB_tree -/// \addtogroup PkgAABB_tree +/// \addtogroup PkgAABBTreeRef /// @{ +// forward declaration +template< typename AABBTraits> +class AABB_tree; + /// This traits class handles any type of 3D geometric /// primitives provided that the proper intersection tests and /// constructions are implemented. It handles points, rays, lines and @@ -289,14 +293,15 @@ public: * Sorts the range defined by [first,beyond[. Sort is achieved on bbox longuest * axis, using the comparison function `_less_than` (dim in {x,y,z}) */ - class Sort_primitives + class Split_primitives { typedef AABB_traits Traits; const Traits& m_traits; public: - Sort_primitives(const AABB_traits& traits) + Split_primitives(const AABB_traits& traits) : m_traits(traits) {} + typedef void result_type; template void operator()(PrimitiveIterator first, PrimitiveIterator beyond, @@ -320,7 +325,7 @@ public: } }; - Sort_primitives sort_primitives_object() const {return Sort_primitives(*this);} + Split_primitives split_primitives_object() const {return Split_primitives(*this);} /* @@ -369,6 +374,19 @@ public: { return GeomTraits().do_intersect_3_object()(q, internal::Primitive_helper::get_datum(pr,m_traits)); } + + // intersection with AABB-tree + template + bool operator()(const CGAL::AABB_tree& other_tree, const Primitive& pr) const + { + return other_tree.do_intersect( internal::Primitive_helper::get_datum(pr,m_traits) ); + } + + template + bool operator()(const CGAL::AABB_tree& other_tree, const Bounding_box& bbox) const + { + return other_tree.do_intersect(bbox); + } }; Do_intersect do_intersect_object() const {return Do_intersect(*this);} diff --git a/AABB_tree/include/CGAL/AABB_tree.h b/AABB_tree/include/CGAL/AABB_tree.h index d4275852147..ceff5ddc003 100644 --- a/AABB_tree/include/CGAL/AABB_tree.h +++ b/AABB_tree/include/CGAL/AABB_tree.h @@ -44,7 +44,7 @@ namespace CGAL { -/// \addtogroup PkgAABB_tree +/// \addtogroup PkgAABBTreeRef /// @{ /** @@ -156,7 +156,28 @@ namespace CGAL { /// `build()` explicitly to ensure that the next call to /// query functions will not trigger the reconstruction of the /// data structure. + /// A call to `AABBTraits::set_shared_data(t...)` + /// is made using the internally stored traits. + /// For compilers that do not support variadic templates, + /// overloads up to 5 template arguments are provided. + +#if !defined(CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES) && !defined(CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE) + template + void build(T&& ...); void build(); +#else + void build(); + template + void build(T1& t1); + template + void build(T1& t1, T2& t2); + template + void build(T1& t1, T2& t2, T3& t3); + template + void build(T1& t1, T2& t2, T3& t3, T4& t4); + template + void build(T1& t1, T2& t2, T3& t3, T4& t4, T5& t5); +#endif ///@} /// \name Operations @@ -646,6 +667,18 @@ public: else return this->any_reference_point_and_id(); } + + //! Returns the datum (geometric object) represented `p`. +#ifndef DOXYGEN_RUNNING + typename internal::Primitive_helper::Datum_type +#else + typename AABBTraits::Primitive::Datum_reference +#endif + datum(Primitive& p)const + { + return internal::Primitive_helper:: + get_datum(p, this->traits()); + } private: //Traits class @@ -728,7 +761,7 @@ public: ConstPrimitiveIterator beyond, T&& ... t) { - set_shared_data(std::forward(t)...); + set_shared_data(std::forward(t)...); while(first != beyond) { m_primitives.push_back(Primitive(first,std::forward(t)...)); @@ -752,6 +785,14 @@ public: build(); } + + template + template + void AABB_tree::build(T&& ... t) + { + set_shared_data(std::forward(t)...); + build(); + } #else //=============constructor====================== template @@ -1033,7 +1074,43 @@ public: build(); } - #endif + //overloads calling set_shared_data() + template + template + void AABB_tree::build(T1& t1) + { + set_shared_data(t1); + build(); + } + template + template + void AABB_tree::build(T1& t1, T2& t2) + { + set_shared_data(t1, t2); + build(); + } + template + template + void AABB_tree::build(T1& t1, T2& t2, T3& t3) + { + set_shared_data(t1, t2, t3); + build(); + } + template + template + void AABB_tree::build(T1& t1, T2& t2, T3& t3, T4& t4) + { + set_shared_data(t1, t2, t3, t4); + build(); + } + template + template + void AABB_tree::build(T1& t1, T2& t2, T3& t3, T4& t4, T5& t5) + { + set_shared_data(t1, t2, t3, t4, t5); + build(); + } +#endif template void AABB_tree::insert(const Primitive& p) @@ -1062,7 +1139,7 @@ public: // constructs the tree m_p_root_node->expand(m_primitives.begin(), m_primitives.end(), - m_primitives.size(), m_traits); + m_primitives.size(), m_traits); } diff --git a/AABB_tree/include/CGAL/AABB_triangle_primitive.h b/AABB_tree/include/CGAL/AABB_triangle_primitive.h index 4b2035e00f4..639a7dab307 100644 --- a/AABB_tree/include/CGAL/AABB_triangle_primitive.h +++ b/AABB_tree/include/CGAL/AABB_triangle_primitive.h @@ -56,7 +56,7 @@ namespace internal { /*! - * \ingroup PkgAABB_tree + * \ingroup PkgAABBTreeRef * Primitive type that uses as identifier an iterator with a 3D triangle as `value_type`. * The iterator from which the primitive is built should not be invalided * while the AABB tree holding the primitive is in use. diff --git a/AABB_tree/include/CGAL/AABB_triangulation_3_triangle_primitive.h b/AABB_tree/include/CGAL/AABB_triangulation_3_triangle_primitive.h index 96f4b305f28..6cd04d5aca8 100644 --- a/AABB_tree/include/CGAL/AABB_triangulation_3_triangle_primitive.h +++ b/AABB_tree/include/CGAL/AABB_triangulation_3_triangle_primitive.h @@ -31,7 +31,7 @@ #include namespace CGAL { - // \ingroup PkgAABB_tree + // \ingroup PkgAABBTreeRef // Primitive type that wraps a facet handle of a CGAL::Triangulation_3, // which is used as id, and allows the construction of the datum on // the fly. Since only the facet handle is stored in this primitive, diff --git a/AABB_tree/include/CGAL/internal/AABB_tree/AABB_node.h b/AABB_tree/include/CGAL/internal/AABB_tree/AABB_node.h index e3504a615ab..5d0cf5ce4d2 100644 --- a/AABB_tree/include/CGAL/internal/AABB_tree/AABB_node.h +++ b/AABB_tree/include/CGAL/internal/AABB_tree/AABB_node.h @@ -138,7 +138,7 @@ AABB_node::expand(ConstPrimitiveIterator first, m_bbox = traits.compute_bbox_object()(first, beyond); // sort primitives along longest axis aabb - traits.sort_primitives_object()(first, beyond, m_bbox); + traits.split_primitives_object()(first, beyond, m_bbox); switch(range) { diff --git a/AABB_tree/test/AABB_tree/CMakeLists.txt b/AABB_tree/test/AABB_tree/CMakeLists.txt index b5f7d28e57a..38a39723ead 100644 --- a/AABB_tree/test/AABB_tree/CMakeLists.txt +++ b/AABB_tree/test/AABB_tree/CMakeLists.txt @@ -4,17 +4,13 @@ project( AABB_tree_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - include_directories (BEFORE "../../include") + include( ${CGAL_USE_FILE} ) # Kept to test the old behaviour. # create a target per cppfile file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) diff --git a/AABB_tree/test/AABB_tree/aabb_test_datum.cpp b/AABB_tree/test/AABB_tree/aabb_test_datum.cpp new file mode 100644 index 00000000000..dac02e5349b --- /dev/null +++ b/AABB_tree/test/AABB_tree/aabb_test_datum.cpp @@ -0,0 +1,74 @@ + +#include +#include +#include + +#include + +#include +#include +#include +#include + +typedef CGAL::Epick K; +typedef K::Point_3 Point; +typedef K::Triangle_3 Triangle; +typedef CGAL::Surface_mesh Mesh; +typedef CGAL::AABB_face_graph_triangle_primitive Primitive; +typedef CGAL::AABB_traits Traits; +typedef CGAL::AABB_tree Tree; + +typedef CGAL::AABB_face_graph_triangle_primitive Primitive2; +typedef CGAL::AABB_traits Traits2; +typedef CGAL::AABB_tree Tree2; + +typedef CGAL::AABB_face_graph_triangle_primitive Primitive3; +typedef CGAL::AABB_traits Traits3; +typedef CGAL::AABB_tree Tree3; + +typedef CGAL::AABB_face_graph_triangle_primitive Primitive4; +typedef CGAL::AABB_traits Traits4; +typedef CGAL::AABB_tree Tree4; + +int main(void) +{ + Mesh m; + std::ifstream in("data/cube.off"); + if(in) + in >> m; + else{ + std::cout << "error reading bunny" << std::endl; + return 1; + } + + Tree t1(faces(m).begin(), faces(m).end(), m); + Tree2 t2(faces(m).begin(), faces(m).end(), m); + Tree3 t3(faces(m).begin(), faces(m).end(), m); + Tree4 t4(faces(m).begin(), faces(m).end(), m); + + t1.build(); + t2.build(); + t3.build(); + t4.build(); + + Primitive p1(faces(m).begin(), m); + Primitive2 p2(faces(m).begin(), m); + Primitive3 p3(faces(m).begin(), m); + Primitive4 p4(faces(m).begin(), m); + Triangle tr1 = t1.datum(p1); + Triangle tr2 = t2.datum(p2); + Triangle tr3 = t3.datum(p3); + Triangle tr4 = t4.datum(p4); + if(tr1 != tr2 + || tr1 != tr3 + || tr1 != tr4 + || tr2 != tr3 + || tr2 != tr4 + || tr3 != tr4) + return 1; + return 0; +} + diff --git a/AABB_tree/test/AABB_tree/aabb_test_multi_mesh.cpp b/AABB_tree/test/AABB_tree/aabb_test_multi_mesh.cpp new file mode 100644 index 00000000000..21d201a0062 --- /dev/null +++ b/AABB_tree/test/AABB_tree/aabb_test_multi_mesh.cpp @@ -0,0 +1,82 @@ +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +typedef CGAL::Epick K; +typedef K::FT FT; +typedef K::Point_3 Point; +typedef K::Vector_3 Vector; +typedef K::Segment_3 Segment; +typedef K::Ray_3 Ray; +typedef CGAL::Surface_mesh > Mesh; +typedef CGAL::AABB_face_graph_triangle_primitive T_Primitive; +typedef CGAL::AABB_traits T_Traits; +typedef CGAL::AABB_tree T_Tree; +typedef T_Tree::Primitive_id T_Primitive_id; + +typedef CGAL::AABB_halfedge_graph_segment_primitive E_Primitive; +typedef CGAL::AABB_traits E_Traits; +typedef CGAL::AABB_tree E_Tree; +typedef E_Tree::Primitive_id E_Primitive_id; + +int main() +{ + CGAL::Surface_mesh > m1, m2; + std::ifstream in("data/cube.off"); + if(in) + in >> m1; + else{ + std::cout << "error reading cube" << std::endl; + return 1; + } + in.close(); + in.open("data/tetrahedron.off"); + if(in) + in >> m2; + else{ + std::cout << "error reading tetrahedron" << std::endl; + return 1; + } + in.close(); + T_Tree tree(faces(m1).first, faces(m1).second, m1); + tree.insert(faces(m2).first, faces(m2).second, m2); + tree.build(); + T_Tree::Bounding_box bbox = tree.bbox(); + Point bbox_center((bbox.xmin() + bbox.xmax()) / 2, + (bbox.ymin() + bbox.ymax()) / 2, + (bbox.zmin() + bbox.zmax()) / 2); + std::vector< T_Primitive_id > intersections; + Ray ray(bbox_center+Vector(3,-0.25,0),bbox_center+Vector(-3,+0.25,0)); + tree.all_intersected_primitives(ray, + std::back_inserter(intersections)); + E_Tree e_tree(edges(m1).first, edges(m1).second, m1); + e_tree.insert(edges(m2).first, edges(m2).second, m2); + e_tree.build(); + std::vector< E_Primitive_id > e_intersections; + Ray e_ray(Point(0,0,0),Point(0,1,1)); + e_tree.all_intersected_primitives(e_ray, + std::back_inserter(e_intersections)); + + + + return 0; +} diff --git a/Advancing_front_surface_reconstruction/doc/Advancing_front_surface_reconstruction/PackageDescription.txt b/Advancing_front_surface_reconstruction/doc/Advancing_front_surface_reconstruction/PackageDescription.txt index 8e104c34c35..d944d7fbbbf 100644 --- a/Advancing_front_surface_reconstruction/doc/Advancing_front_surface_reconstruction/PackageDescription.txt +++ b/Advancing_front_surface_reconstruction/doc/Advancing_front_surface_reconstruction/PackageDescription.txt @@ -1,9 +1,9 @@ -/// \defgroup PkgAdvancingFrontSurfaceReconstruction Advancing Front Surface Reconstruction Reference +/// \defgroup PkgAdvancingFrontSurfaceReconstructionRef Advancing Front Surface Reconstruction Reference /*! -\addtogroup PkgAdvancingFrontSurfaceReconstruction +\addtogroup PkgAdvancingFrontSurfaceReconstructionRef -\cgalPkgDescriptionBegin{Advancing Front Surface Reconstruction,PkgAdvancingFrontSurfaceReconstructionSummary} +\cgalPkgDescriptionBegin{Advancing Front Surface Reconstruction,PkgAdvancingFrontSurfaceReconstruction} \cgalPkgPicture{afsr-detail.png} \cgalPkgSummaryBegin \cgalPkgAuthors{Tran Kai Frank Da, David Cohen-Steiner} @@ -12,11 +12,11 @@ unorganized point set. Starting from a seed facet, a piecewise linear surface is grown by adding Delaunay triangles one by one. The most plausible triangles are added first, in a way that avoids the appearance of topological singularities. } -\cgalPkgManuals{Chapter_Advancing_Front_Surface_Reconstruction,PkgAdvancingFrontSurfaceReconstruction} +\cgalPkgManuals{Chapter_Advancing_Front_Surface_Reconstruction,PkgAdvancingFrontSurfaceReconstructionRef} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{4.7} -\cgalPkgDependsOn{\ref PkgTriangulation3Summary} +\cgalPkgDependsOn{\ref PkgTriangulation3} \cgalPkgBib{cgal:dc-afsr} \cgalPkgLicense{\ref licensesGPL "GPL"} \cgalPkgShortInfoEnd diff --git a/Advancing_front_surface_reconstruction/examples/Advancing_front_surface_reconstruction/CMakeLists.txt b/Advancing_front_surface_reconstruction/examples/Advancing_front_surface_reconstruction/CMakeLists.txt index 166bbc9b131..650ce176202 100644 --- a/Advancing_front_surface_reconstruction/examples/Advancing_front_surface_reconstruction/CMakeLists.txt +++ b/Advancing_front_surface_reconstruction/examples/Advancing_front_surface_reconstruction/CMakeLists.txt @@ -4,22 +4,16 @@ project( Advancing_front_surface_reconstruction_Examples ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - if (MSVC AND ( CMAKE_SIZEOF_VOID_P EQUAL 4 ) ) SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4244") endif() - 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}) diff --git a/Advancing_front_surface_reconstruction/include/CGAL/Advancing_front_surface_reconstruction.h b/Advancing_front_surface_reconstruction/include/CGAL/Advancing_front_surface_reconstruction.h index 6fc6e33b4d8..f97c3bca853 100644 --- a/Advancing_front_surface_reconstruction/include/CGAL/Advancing_front_surface_reconstruction.h +++ b/Advancing_front_surface_reconstruction/include/CGAL/Advancing_front_surface_reconstruction.h @@ -175,7 +175,7 @@ namespace CGAL { /*! - \ingroup PkgAdvancingFrontSurfaceReconstruction + \ingroup PkgAdvancingFrontSurfaceReconstructionRef The class `Advancing_front_surface_reconstruction` enables advanced users to provide the unstructured point cloud in a 3D Delaunay triangulation. The reconstruction algorithm then marks vertices and faces @@ -2480,7 +2480,7 @@ namespace CGAL { } /*! - \ingroup PkgAdvancingFrontSurfaceReconstruction + \ingroup PkgAdvancingFrontSurfaceReconstructionRef For a sequence of points computes a sequence of index triples describing the faces of the reconstructed surface. @@ -2532,7 +2532,7 @@ namespace CGAL { } /*! - \ingroup PkgAdvancingFrontSurfaceReconstruction + \ingroup PkgAdvancingFrontSurfaceReconstructionRef For a sequence of points computes a sequence of index triples describing the faces of the reconstructed surface. diff --git a/Advancing_front_surface_reconstruction/include/CGAL/Advancing_front_surface_reconstruction_cell_base_3.h b/Advancing_front_surface_reconstruction/include/CGAL/Advancing_front_surface_reconstruction_cell_base_3.h index 99cfa924cdf..eac9e519d77 100644 --- a/Advancing_front_surface_reconstruction/include/CGAL/Advancing_front_surface_reconstruction_cell_base_3.h +++ b/Advancing_front_surface_reconstruction/include/CGAL/Advancing_front_surface_reconstruction_cell_base_3.h @@ -28,7 +28,7 @@ namespace CGAL { /*! - \ingroup PkgAdvancingFrontSurfaceReconstruction + \ingroup PkgAdvancingFrontSurfaceReconstructionRef The class `Advancing_front_surface_reconstruction_cell_base_3` is the default cell type for the class `Advancing_front_surface_reconstruction`. diff --git a/Advancing_front_surface_reconstruction/include/CGAL/Advancing_front_surface_reconstruction_vertex_base_3.h b/Advancing_front_surface_reconstruction/include/CGAL/Advancing_front_surface_reconstruction_vertex_base_3.h index 1d381ccc89c..050e14036fd 100644 --- a/Advancing_front_surface_reconstruction/include/CGAL/Advancing_front_surface_reconstruction_vertex_base_3.h +++ b/Advancing_front_surface_reconstruction/include/CGAL/Advancing_front_surface_reconstruction_vertex_base_3.h @@ -38,7 +38,7 @@ namespace CGAL { template class Advancing_front_surface_reconstruction; /*! - \ingroup PkgAdvancingFrontSurfaceReconstruction + \ingroup PkgAdvancingFrontSurfaceReconstructionRef The class `Advancing_front_surface_reconstruction_vertex_base_3` is the default vertex type for the class `Advancing_front_surface_reconstruction`. diff --git a/Advancing_front_surface_reconstruction/test/Advancing_front_surface_reconstruction/CMakeLists.txt b/Advancing_front_surface_reconstruction/test/Advancing_front_surface_reconstruction/CMakeLists.txt index 689787d6222..3eeeba604c0 100644 --- a/Advancing_front_surface_reconstruction/test/Advancing_front_surface_reconstruction/CMakeLists.txt +++ b/Advancing_front_surface_reconstruction/test/Advancing_front_surface_reconstruction/CMakeLists.txt @@ -4,18 +4,12 @@ project( Advancing_front_surface_reconstruction_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Algebraic_foundations/doc/Algebraic_foundations/Algebraic_foundations.txt b/Algebraic_foundations/doc/Algebraic_foundations/Algebraic_foundations.txt index 7e6c7d0039d..6e08371d24e 100644 --- a/Algebraic_foundations/doc/Algebraic_foundations/Algebraic_foundations.txt +++ b/Algebraic_foundations/doc/Algebraic_foundations/Algebraic_foundations.txt @@ -81,7 +81,7 @@ compatibility all functionality is also accessible through global functions defined within namespace `CGAL`, e.g., \link sqrt `CGAL::sqrt(x)` \endlink. This is realized via function templates using the according functor of the traits class. For an overview see -Section \ref PkgAlgebraicFoundations in the reference manual. +Section \ref PkgAlgebraicFoundationsRef in the reference manual. \subsection Algebraic_foundationsTagsinAlgebraicStructure Tags in Algebraic Structure Traits diff --git a/Algebraic_foundations/doc/Algebraic_foundations/CGAL/Algebraic_structure_traits.h b/Algebraic_foundations/doc/Algebraic_foundations/CGAL/Algebraic_structure_traits.h index 38d35c6cf27..fee8e9b1daa 100644 --- a/Algebraic_foundations/doc/Algebraic_foundations/CGAL/Algebraic_structure_traits.h +++ b/Algebraic_foundations/doc/Algebraic_foundations/CGAL/Algebraic_structure_traits.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgAlgebraicFoundations +\ingroup PkgAlgebraicFoundationsRef An instance of `Algebraic_structure_traits` is a model of `AlgebraicStructureTraits`, where T is the associated type. @@ -17,7 +17,7 @@ class Algebraic_structure_traits { namespace CGAL { /*! -\ingroup PkgAlgebraicFoundations +\ingroup PkgAlgebraicFoundationsRef Tag indicating that a type is a model of the `EuclideanRing` concept. @@ -34,7 +34,7 @@ struct Euclidean_ring_tag : public Unique_factorization_domain_tag { }; /* end Euclidean_ring_tag */ /*! -\ingroup PkgAlgebraicFoundations +\ingroup PkgAlgebraicFoundationsRef Tag indicating that a type is a model of the `Field` concept. @@ -50,7 +50,7 @@ struct Field_tag : public Integral_domain_tag { }; /* end Field_tag */ /*! -\ingroup PkgAlgebraicFoundations +\ingroup PkgAlgebraicFoundationsRef Tag indicating that a type is a model of the `FieldWithKthRoot` concept. @@ -66,7 +66,7 @@ struct Field_with_kth_root_tag : public Field_with_sqrt_tag { }; /* end Field_with_kth_root_tag */ /*! -\ingroup PkgAlgebraicFoundations +\ingroup PkgAlgebraicFoundationsRef Tag indicating that a type is a model of the `FieldWithRootOf` concept. @@ -82,7 +82,7 @@ struct Field_with_root_of_tag : public Field_with_kth_root_tag { }; /* end Field_with_root_of_tag */ /*! -\ingroup PkgAlgebraicFoundations +\ingroup PkgAlgebraicFoundationsRef Tag indicating that a type is a model of the `FieldWithSqrt` concept. @@ -98,7 +98,7 @@ struct Field_with_sqrt_tag : public Field_tag { }; /* end Field_with_sqrt_tag */ /*! -\ingroup PkgAlgebraicFoundations +\ingroup PkgAlgebraicFoundationsRef Tag indicating that a type is a model of the `IntegralDomain` concept. @@ -114,7 +114,7 @@ struct Integral_domain_tag : public Integral_domain_without_division_tag { }; /* end Integral_domain_tag */ /*! -\ingroup PkgAlgebraicFoundations +\ingroup PkgAlgebraicFoundationsRef Tag indicating that a type is a model of the `IntegralDomainWithoutDivision` concept. @@ -129,7 +129,7 @@ struct Integral_domain_without_division_tag { }; /* end Integral_domain_without_division_tag */ /*! -\ingroup PkgAlgebraicFoundations +\ingroup PkgAlgebraicFoundationsRef Tag indicating that a type is a model of the `UniqueFactorizationDomain` concept. diff --git a/Algebraic_foundations/doc/Algebraic_foundations/CGAL/Coercion_traits.h b/Algebraic_foundations/doc/Algebraic_foundations/CGAL/Coercion_traits.h index 7c1bbf3fbcb..51241f2fec2 100644 --- a/Algebraic_foundations/doc/Algebraic_foundations/CGAL/Coercion_traits.h +++ b/Algebraic_foundations/doc/Algebraic_foundations/CGAL/Coercion_traits.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgAlgebraicFoundations +\ingroup PkgAlgebraicFoundationsRef An instance of `Coercion_traits` reflects the type coercion of the types A and B, it is symmetric in the two template arguments. diff --git a/Algebraic_foundations/doc/Algebraic_foundations/CGAL/Fraction_traits.h b/Algebraic_foundations/doc/Algebraic_foundations/CGAL/Fraction_traits.h index 0e2575ec3cf..5888f705f3f 100644 --- a/Algebraic_foundations/doc/Algebraic_foundations/CGAL/Fraction_traits.h +++ b/Algebraic_foundations/doc/Algebraic_foundations/CGAL/Fraction_traits.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgAlgebraicFoundations +\ingroup PkgAlgebraicFoundationsRef An instance of `Fraction_traits` is a model of `FractionTraits`, where `T` is the associated type. diff --git a/Algebraic_foundations/doc/Algebraic_foundations/CGAL/Real_embeddable_traits.h b/Algebraic_foundations/doc/Algebraic_foundations/CGAL/Real_embeddable_traits.h index d4f7b67e6b8..fa61be8f8df 100644 --- a/Algebraic_foundations/doc/Algebraic_foundations/CGAL/Real_embeddable_traits.h +++ b/Algebraic_foundations/doc/Algebraic_foundations/CGAL/Real_embeddable_traits.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgAlgebraicFoundations +\ingroup PkgAlgebraicFoundationsRef An instance of `Real_embeddable_traits` is a model of `RealEmbeddableTraits`, where T is the associated type. diff --git a/Algebraic_foundations/doc/Algebraic_foundations/CGAL/number_utils.h b/Algebraic_foundations/doc/Algebraic_foundations/CGAL/number_utils.h index 28fe692ade1..153988e6d93 100644 --- a/Algebraic_foundations/doc/Algebraic_foundations/CGAL/number_utils.h +++ b/Algebraic_foundations/doc/Algebraic_foundations/CGAL/number_utils.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgAlgebraicFoundations +\ingroup PkgAlgebraicFoundationsRef The template function `abs()` returns the absolute value of a number. @@ -19,7 +19,7 @@ template NT abs(const NT& x); namespace CGAL { /*! -\ingroup PkgAlgebraicFoundations +\ingroup PkgAlgebraicFoundationsRef The template function `compare()` compares the first argument with respect to the second, i.e.\ it returns `CGAL::LARGER` if \f$ x\f$ is larger then \f$ y\f$. @@ -43,7 +43,7 @@ result_type compare(const NT &x, const NT &y); namespace CGAL { /*! -\ingroup PkgAlgebraicFoundations +\ingroup PkgAlgebraicFoundationsRef The function `div()` computes the integral quotient of division with remainder. @@ -74,7 +74,7 @@ div(const NT1& x, const NT2& y); namespace CGAL { /*! -\ingroup PkgAlgebraicFoundations +\ingroup PkgAlgebraicFoundationsRef computes the quotient \f$ q\f$ and remainder \f$ r\f$, such that \f$ x = q*y + r\f$ and \f$ r\f$ minimal with respect to the Euclidean Norm of the @@ -109,7 +109,7 @@ div_mod(const NT1& x, const NT2& y, result_type& q, result_type& r); namespace CGAL { /*! -\ingroup PkgAlgebraicFoundations +\ingroup PkgAlgebraicFoundationsRef The function `gcd()` computes the greatest common divisor of two values. @@ -136,7 +136,7 @@ gcd(const NT1& x, const NT2& y); namespace CGAL { /*! -\ingroup PkgAlgebraicFoundations +\ingroup PkgAlgebraicFoundationsRef The function `integral_division()` (a.k.a.\ exact division or division without remainder) maps ring elements \f$ (x,y)\f$ to ring element \f$ z\f$ such that \f$ x = yz\f$ if such a \f$ z\f$ @@ -167,7 +167,7 @@ integral_division(const NT1& x, const NT2& y); namespace CGAL { /*! -\ingroup PkgAlgebraicFoundations +\ingroup PkgAlgebraicFoundationsRef The function `inverse()` returns the inverse element with respect to multiplication. @@ -187,7 +187,7 @@ template NT inverse(const NT& x); namespace CGAL { /*! -\ingroup PkgAlgebraicFoundations +\ingroup PkgAlgebraicFoundationsRef The template function `is_negative()` determines if a value is negative or not. The function is defined if the argument type @@ -206,7 +206,7 @@ result_type is_negative(const NT& x); namespace CGAL { /*! -\ingroup PkgAlgebraicFoundations +\ingroup PkgAlgebraicFoundationsRef The function `is_one()` determines if a value is equal to 1 or not. @@ -226,7 +226,7 @@ template result_type is_one(const NT& x); namespace CGAL { /*! -\ingroup PkgAlgebraicFoundations +\ingroup PkgAlgebraicFoundationsRef The template function `is_positive()` determines if a value is positive or not. The function is defined if the argument type @@ -245,7 +245,7 @@ result_type is_positive(const NT& x); namespace CGAL { /*! -\ingroup PkgAlgebraicFoundations +\ingroup PkgAlgebraicFoundationsRef An ring element \f$ x\f$ is said to be a square iff there exists a ring element \f$ y\f$ such @@ -264,7 +264,7 @@ The `result_type` is convertible to `bool`. template result_type is_square(const NT& x); /*! -\ingroup PkgAlgebraicFoundations +\ingroup PkgAlgebraicFoundationsRef An ring element \f$ x\f$ is said to be a square iff there exists a ring element \f$ y\f$ such @@ -287,7 +287,7 @@ template result_type is_square(const NT& x, NT& y); namespace CGAL { /*! -\ingroup PkgAlgebraicFoundations +\ingroup PkgAlgebraicFoundationsRef The function `is_zero()` determines if a value is equal to 0 or not. @@ -309,7 +309,7 @@ template result_type is_zero(const NT& x); namespace CGAL { /*! -\ingroup PkgAlgebraicFoundations +\ingroup PkgAlgebraicFoundationsRef The function `kth_root()` returns the k-th root of a value. @@ -327,7 +327,7 @@ template NT kth_root(int k, const NT& x); namespace CGAL { /*! -\ingroup PkgAlgebraicFoundations +\ingroup PkgAlgebraicFoundationsRef The function `mod()` computes the remainder of division with remainder. @@ -357,7 +357,7 @@ mod(const NT1& x, const NT2& y); namespace CGAL { /*! -\ingroup PkgAlgebraicFoundations +\ingroup PkgAlgebraicFoundationsRef returns the k-th real root of the univariate polynomial, which is defined by the iterator range, where begin refers to the constant @@ -383,7 +383,7 @@ root_of(int k, InputIterator begin, InputIterator end); namespace CGAL { /*! -\ingroup PkgAlgebraicFoundations +\ingroup PkgAlgebraicFoundationsRef The template function `sign()` returns the sign of its argument. @@ -403,7 +403,7 @@ template result_type sign(const NT& x); namespace CGAL { /*! -\ingroup PkgAlgebraicFoundations +\ingroup PkgAlgebraicFoundationsRef The function `simplify()` may simplify a given object. @@ -421,7 +421,7 @@ template void simplify(const NT& x); namespace CGAL { /*! -\ingroup PkgAlgebraicFoundations +\ingroup PkgAlgebraicFoundationsRef The function `sqrt()` returns the square root of a value. @@ -439,7 +439,7 @@ template NT sqrt(const NT& x); namespace CGAL { /*! -\ingroup PkgAlgebraicFoundations +\ingroup PkgAlgebraicFoundationsRef The function `square()` returns the square of a number. @@ -457,7 +457,7 @@ template NT square(const NT& x); namespace CGAL { /*! -\ingroup PkgAlgebraicFoundations +\ingroup PkgAlgebraicFoundationsRef The template function `to_double()` returns a double approximation of a number. Note that in general, the value returned is not guaranteed to be the same @@ -482,7 +482,7 @@ template double to_double(const NT& x); namespace CGAL { /*! -\ingroup PkgAlgebraicFoundations +\ingroup PkgAlgebraicFoundationsRef The template function `to_interval()` computes for a given real embeddable number \f$ x\f$ a double interval containing \f$ x\f$. @@ -502,7 +502,7 @@ std::pair to_interval(const NT& x); namespace CGAL { /*! -\ingroup PkgAlgebraicFoundations +\ingroup PkgAlgebraicFoundationsRef The function `unit_part()` computes the unit part of a given ring element. diff --git a/Algebraic_foundations/doc/Algebraic_foundations/PackageDescription.txt b/Algebraic_foundations/doc/Algebraic_foundations/PackageDescription.txt index 9a5d49ffebf..cbf66ce5727 100644 --- a/Algebraic_foundations/doc/Algebraic_foundations/PackageDescription.txt +++ b/Algebraic_foundations/doc/Algebraic_foundations/PackageDescription.txt @@ -1,18 +1,18 @@ -/// \defgroup PkgAlgebraicFoundations Algebraic Foundations Reference +/// \defgroup PkgAlgebraicFoundationsRef Algebraic Foundations Reference /// \defgroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts Concepts -/// \ingroup PkgAlgebraicFoundations +/// \ingroup PkgAlgebraicFoundationsRef /*! -\addtogroup PkgAlgebraicFoundations +\addtogroup PkgAlgebraicFoundationsRef \todo check generated documentation -\cgalPkgDescriptionBegin{Algebraic Foundations,PkgAlgebraicFoundationsSummary} +\cgalPkgDescriptionBegin{Algebraic Foundations,PkgAlgebraicFoundations} \cgalPkgPicture{Algebraic_foundations2.png} \cgalPkgSummaryBegin \cgalPkgAuthor{Michael Hemmer} \cgalPkgDesc{This package defines what algebra means for \cgal, in terms of concepts, classes and functions. The main features are: (i) explicit concepts for interoperability of types (ii) separation between algebraic types (not necessarily embeddable into the reals), and number types (embeddable into the reals).} -\cgalPkgManuals{Chapter_Algebraic_Foundations,PkgAlgebraicFoundations} +\cgalPkgManuals{Chapter_Algebraic_Foundations,PkgAlgebraicFoundationsRef} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{3.3} diff --git a/Algebraic_foundations/examples/Algebraic_foundations/CMakeLists.txt b/Algebraic_foundations/examples/Algebraic_foundations/CMakeLists.txt index 8b00bc5a247..d30a4c846c8 100644 --- a/Algebraic_foundations/examples/Algebraic_foundations/CMakeLists.txt +++ b/Algebraic_foundations/examples/Algebraic_foundations/CMakeLists.txt @@ -4,18 +4,12 @@ project( Algebraic_foundations_Examples ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Algebraic_foundations/test/Algebraic_foundations/CMakeLists.txt b/Algebraic_foundations/test/Algebraic_foundations/CMakeLists.txt index 53a912a5a7f..1eacdbebbfa 100644 --- a/Algebraic_foundations/test/Algebraic_foundations/CMakeLists.txt +++ b/Algebraic_foundations/test/Algebraic_foundations/CMakeLists.txt @@ -4,17 +4,13 @@ project( Algebraic_foundations_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET COMPONENTS Core) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - include_directories (BEFORE "../../include") + include(${CGAL_USE_FILE}) # create a target per cppfile file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/CGAL/Algebraic_kernel_d_1.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/CGAL/Algebraic_kernel_d_1.h index 99aee7837cc..632bd0c756b 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/CGAL/Algebraic_kernel_d_1.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/CGAL/Algebraic_kernel_d_1.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgAlgebraicKerneldModels +\ingroup PkgAlgebraicKernelDModels The class represents an algebraic real root by a square free polynomial and an isolating interval that uniquely defines the root. diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/CGAL/Algebraic_kernel_d_2.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/CGAL/Algebraic_kernel_d_2.h index a499a94861d..7e8cbc60291 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/CGAL/Algebraic_kernel_d_2.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/CGAL/Algebraic_kernel_d_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgAlgebraicKerneldModels +\ingroup PkgAlgebraicKernelDModels This class gathers necessary tools for solving and handling bivariate polynomial systems of general degree \f$ d\f$. diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/CGAL/Algebraic_kernel_rs_gmpq_d_1.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/CGAL/Algebraic_kernel_rs_gmpq_d_1.h index 653c7f56cb3..3498dcb2ab8 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/CGAL/Algebraic_kernel_rs_gmpq_d_1.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/CGAL/Algebraic_kernel_rs_gmpq_d_1.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgAlgebraicKerneldModels +\ingroup PkgAlgebraicKernelDModels \anchor Algebraic_kernel_rs_gmpq_d_1 diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/CGAL/Algebraic_kernel_rs_gmpz_d_1.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/CGAL/Algebraic_kernel_rs_gmpz_d_1.h index 70fdccc2963..665aa563e40 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/CGAL/Algebraic_kernel_rs_gmpz_d_1.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/CGAL/Algebraic_kernel_rs_gmpz_d_1.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgAlgebraicKerneldModels +\ingroup PkgAlgebraicKernelDModels \anchor Algebraic_kernel_rs_gmpz_d_1 diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--ApproximateAbsolute_1.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--ApproximateAbsolute_1.h index 2896acf2af3..9c142688f05 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--ApproximateAbsolute_1.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--ApproximateAbsolute_1.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgAlgebraicKerneldConceptsUni +\ingroup PkgAlgebraicKernelDConceptsUni \cgalConcept A model of `AlgebraicKernel_d_1::ApproximateAbsolute_1` is an `AdaptableBinaryFunction` that computes an diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--ApproximateRelative_1.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--ApproximateRelative_1.h index 3a2cf52c468..977c3eb0510 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--ApproximateRelative_1.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--ApproximateRelative_1.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgAlgebraicKerneldConceptsUni +\ingroup PkgAlgebraicKernelDConceptsUni \cgalConcept A model of `AlgebraicKernel_d_1::ApproximateRelative_1` is an `AdaptableBinaryFunction` that computes an diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--BoundBetween_1.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--BoundBetween_1.h index 5af5cb25f25..532708bbc66 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--BoundBetween_1.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--BoundBetween_1.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgAlgebraicKerneldConceptsUni +\ingroup PkgAlgebraicKernelDConceptsUni \cgalConcept Computes a number of type diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--Compare_1.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--Compare_1.h index 5d7e8b3c53f..93a3245ccb8 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--Compare_1.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--Compare_1.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgAlgebraicKerneldConceptsUni +\ingroup PkgAlgebraicKernelDConceptsUni \cgalConcept Compares `AlgebraicKernel_d_1::Algebraic_real_1` values. diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--ComputePolynomial_1.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--ComputePolynomial_1.h index afc9fea9e3b..29fc14de953 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--ComputePolynomial_1.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--ComputePolynomial_1.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgAlgebraicKerneldConceptsUni +\ingroup PkgAlgebraicKernelDConceptsUni \cgalConcept Computes a square free univariate polynomial \f$ p\f$, such that the given diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--ConstructAlgebraicReal_1.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--ConstructAlgebraicReal_1.h index ec36d8c0991..82ccd3d56f1 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--ConstructAlgebraicReal_1.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--ConstructAlgebraicReal_1.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgAlgebraicKerneldConceptsUni +\ingroup PkgAlgebraicKernelDConceptsUni \cgalConcept Constructs `AlgebraicKernel_d_1::Algebraic_real_1`. diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--IsCoprime_1.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--IsCoprime_1.h index 25e71199630..e8d8ddd1d20 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--IsCoprime_1.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--IsCoprime_1.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgAlgebraicKerneldConceptsUni +\ingroup PkgAlgebraicKernelDConceptsUni \cgalConcept Determines whether a given pair of univariate polynomials \f$ p_1, p_2\f$ is coprime, diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--IsSquareFree_1.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--IsSquareFree_1.h index ca73f908aa3..b6cfbaac082 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--IsSquareFree_1.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--IsSquareFree_1.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgAlgebraicKerneldConceptsUni +\ingroup PkgAlgebraicKernelDConceptsUni \cgalConcept Computes whether the given univariate polynomial is square free. diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--IsZeroAt_1.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--IsZeroAt_1.h index d9ab0797c85..7c43c21ba54 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--IsZeroAt_1.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--IsZeroAt_1.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgAlgebraicKerneldConceptsUni +\ingroup PkgAlgebraicKernelDConceptsUni \cgalConcept Computes whether an `AlgebraicKernel_d_1::Polynomial_1` diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--Isolate_1.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--Isolate_1.h index 6ddac9ad06a..9613ee51637 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--Isolate_1.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--Isolate_1.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgAlgebraicKerneldConceptsUni +\ingroup PkgAlgebraicKernelDConceptsUni \cgalConcept Computes an open isolating interval for an `AlgebraicKernel_d_1::Algebraic_real_1` diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--MakeCoprime_1.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--MakeCoprime_1.h index fa95de42270..3ac3797a706 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--MakeCoprime_1.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--MakeCoprime_1.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgAlgebraicKerneldConceptsUni +\ingroup PkgAlgebraicKernelDConceptsUni \cgalConcept Computes for a given pair of univariate polynomials \f$ p_1\f$, \f$ p_2\f$ their diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--MakeSquareFree_1.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--MakeSquareFree_1.h index 2b60ca4d321..8b71414d61f 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--MakeSquareFree_1.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--MakeSquareFree_1.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgAlgebraicKerneldConceptsUni +\ingroup PkgAlgebraicKernelDConceptsUni \cgalConcept Returns a square free part of a univariate polynomial. diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--NumberOfSolutions_1.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--NumberOfSolutions_1.h index 8dd23b95d6d..52bf33c0067 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--NumberOfSolutions_1.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--NumberOfSolutions_1.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgAlgebraicKerneldConceptsUni +\ingroup PkgAlgebraicKernelDConceptsUni \cgalConcept Computes the number of real solutions of the given univariate polynomial. diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--SignAt_1.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--SignAt_1.h index c79e3136e8a..565ce13b992 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--SignAt_1.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--SignAt_1.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgAlgebraicKerneldConceptsUni +\ingroup PkgAlgebraicKernelDConceptsUni \cgalConcept Computes the sign of a univariate polynomial diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--Solve_1.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--Solve_1.h index 18e71de141c..b7f976f0486 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--Solve_1.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--Solve_1.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgAlgebraicKerneldConceptsUni +\ingroup PkgAlgebraicKernelDConceptsUni \cgalConcept Computes the real roots of a univariate polynomial. diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--SquareFreeFactorize_1.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--SquareFreeFactorize_1.h index d50560b29a9..91971c4f575 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--SquareFreeFactorize_1.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1--SquareFreeFactorize_1.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgAlgebraicKerneldConceptsUni +\ingroup PkgAlgebraicKernelDConceptsUni \cgalConcept Computes a square free factorization of an diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1.h index 70660d6abc1..7d7cd3b4289 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_1.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgAlgebraicKerneldConceptsUni +\ingroup PkgAlgebraicKernelDConceptsUni \cgalConcept A model of the `AlgebraicKernel_d_1` concept is meant to provide the diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ApproximateAbsoluteX_2.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ApproximateAbsoluteX_2.h index dfbd40c5c29..8fb754c7cc2 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ApproximateAbsoluteX_2.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ApproximateAbsoluteX_2.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgAlgebraicKerneldConceptsBi +\ingroup PkgAlgebraicKernelDConceptsBi \cgalConcept A model of `AlgebraicKernel_d_2::ApproximateAbsoluteX_2` is an `AdaptableBinaryFunction` that computes an diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ApproximateAbsoluteY_2.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ApproximateAbsoluteY_2.h index 9d4a8b94834..298cf2ea7a2 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ApproximateAbsoluteY_2.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ApproximateAbsoluteY_2.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgAlgebraicKerneldConceptsBi +\ingroup PkgAlgebraicKernelDConceptsBi \cgalConcept A model of `AlgebraicKernel_d_2::ApproximateAbsoluteY_2` is an `AdaptableBinaryFunction` that computes an diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ApproximateRelativeX_2.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ApproximateRelativeX_2.h index 965db4cb55c..0b07fdbdf84 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ApproximateRelativeX_2.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ApproximateRelativeX_2.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgAlgebraicKerneldConceptsBi +\ingroup PkgAlgebraicKernelDConceptsBi \cgalConcept A model of `AlgebraicKernel_d_2::ApproximateRelativeX_2` is an `AdaptableBinaryFunction` that computes an diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ApproximateRelativeY_2.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ApproximateRelativeY_2.h index fcec3b5cb92..00676a98ded 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ApproximateRelativeY_2.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ApproximateRelativeY_2.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgAlgebraicKerneldConceptsBi +\ingroup PkgAlgebraicKernelDConceptsBi \cgalConcept A model of `AlgebraicKernel_d_2::ApproximateRelativeY_2` is an `AdaptableBinaryFunction` that computes an diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--BoundBetweenX_2.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--BoundBetweenX_2.h index bf11f493b57..ccaac45c12b 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--BoundBetweenX_2.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--BoundBetweenX_2.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgAlgebraicKerneldConceptsBi +\ingroup PkgAlgebraicKernelDConceptsBi \cgalConcept Computes a number of type diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--BoundBetweenY_2.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--BoundBetweenY_2.h index 3f6709c4455..901c3162d97 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--BoundBetweenY_2.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--BoundBetweenY_2.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgAlgebraicKerneldConceptsBi +\ingroup PkgAlgebraicKernelDConceptsBi \cgalConcept Computes a number of type diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--CompareXY_2.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--CompareXY_2.h index cfdefc0a995..c8bb07c059d 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--CompareXY_2.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--CompareXY_2.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgAlgebraicKerneldConceptsBi +\ingroup PkgAlgebraicKernelDConceptsBi \cgalConcept Compares `AlgebraicKernel_d_2::Algebraic_real_2`s lexicographically. diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--CompareX_2.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--CompareX_2.h index 620bb133b08..380aded006c 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--CompareX_2.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--CompareX_2.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgAlgebraicKerneldConceptsBi +\ingroup PkgAlgebraicKernelDConceptsBi \cgalConcept Compares the first coordinates of `AlgebraicKernel_d_2::Algebraic_real_2`s. diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--CompareY_2.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--CompareY_2.h index 9d6b3483103..6c58335c8a8 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--CompareY_2.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--CompareY_2.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgAlgebraicKerneldConceptsBi +\ingroup PkgAlgebraicKernelDConceptsBi \cgalConcept Compares the second coordinated of `AlgebraicKernel_d_2::Algebraic_real_2`s. diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ComputePolynomialX_2.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ComputePolynomialX_2.h index e972739323b..c412d6fce76 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ComputePolynomialX_2.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ComputePolynomialX_2.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgAlgebraicKerneldConceptsBi +\ingroup PkgAlgebraicKernelDConceptsBi \cgalConcept Computes a univariate square free polynomial \f$ p\f$, such that the first coordinate of diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ComputePolynomialY_2.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ComputePolynomialY_2.h index 8625e4c0ae5..7a9e46a4cbb 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ComputePolynomialY_2.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ComputePolynomialY_2.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgAlgebraicKerneldConceptsBi +\ingroup PkgAlgebraicKernelDConceptsBi \cgalConcept Computes a univariate square free polynomial \f$ p\f$, such that the second coordinate of diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ComputeX_2.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ComputeX_2.h index d23478e27ee..3f3b19583ec 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ComputeX_2.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ComputeX_2.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgAlgebraicKerneldConceptsBi +\ingroup PkgAlgebraicKernelDConceptsBi \cgalConcept Computes the first coordinate of an diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ComputeY_2.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ComputeY_2.h index de9c9f0556b..5edc195f8a6 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ComputeY_2.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ComputeY_2.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgAlgebraicKerneldConceptsBi +\ingroup PkgAlgebraicKernelDConceptsBi \cgalConcept Computes the second coordinate of an diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ConstructAlgebraicReal_2.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ConstructAlgebraicReal_2.h index c43f2f0664a..4eaaeda2f26 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ConstructAlgebraicReal_2.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--ConstructAlgebraicReal_2.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgAlgebraicKerneldConceptsBi +\ingroup PkgAlgebraicKernelDConceptsBi \cgalConcept Constructs an `AlgebraicKernel_d_2::Algebraic_real_2`. diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--IsCoprime_2.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--IsCoprime_2.h index 70d7cabfeb6..70e920f5abc 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--IsCoprime_2.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--IsCoprime_2.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgAlgebraicKerneldConceptsBi +\ingroup PkgAlgebraicKernelDConceptsBi \cgalConcept Computes whether a given pair of bivariate polynomials is coprime. diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--IsSquareFree_2.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--IsSquareFree_2.h index a73d574680e..bd8fb58f588 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--IsSquareFree_2.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--IsSquareFree_2.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgAlgebraicKerneldConceptsBi +\ingroup PkgAlgebraicKernelDConceptsBi \cgalConcept Computes whether the given bivariate polynomial is square free. diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--IsZeroAt_2.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--IsZeroAt_2.h index 7add7a0ba30..bd7871600c6 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--IsZeroAt_2.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--IsZeroAt_2.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgAlgebraicKerneldConceptsBi +\ingroup PkgAlgebraicKernelDConceptsBi \cgalConcept Computes whether an `AlgebraicKernel_d_2::Polynomial_2` diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--IsolateX_2.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--IsolateX_2.h index 1c8d09dbaad..5574fa4db2d 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--IsolateX_2.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--IsolateX_2.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgAlgebraicKerneldConceptsBi +\ingroup PkgAlgebraicKernelDConceptsBi \cgalConcept Computes an isolating interval for the first coordinate of an `AlgebraicKernel_d_2::Algebraic_real_2` diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--IsolateY_2.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--IsolateY_2.h index 09d35efb5db..0d5e978d941 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--IsolateY_2.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--IsolateY_2.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgAlgebraicKerneldConceptsBi +\ingroup PkgAlgebraicKernelDConceptsBi \cgalConcept Computes an isolating interval for the second coordinate of an `AlgebraicKernel_d_2::Algebraic_real_2` diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--Isolate_2.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--Isolate_2.h index e3dcef25a28..5c8d68973d5 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--Isolate_2.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--Isolate_2.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgAlgebraicKerneldConceptsBi +\ingroup PkgAlgebraicKernelDConceptsBi \cgalConcept Computes an isolating box for a given `AlgebraicKernel_d_2::Algebraic_real_2`. diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--MakeCoprime_2.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--MakeCoprime_2.h index d5ac00efc69..155bdbf65d5 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--MakeCoprime_2.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--MakeCoprime_2.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgAlgebraicKerneldConceptsBi +\ingroup PkgAlgebraicKernelDConceptsBi \cgalConcept Computes for a given pair of bivariate polynomials \f$ p_1\f$, \f$ p_2\f$ their diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--MakeSquareFree_2.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--MakeSquareFree_2.h index f9175866e5d..acf5ec20cf7 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--MakeSquareFree_2.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--MakeSquareFree_2.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgAlgebraicKerneldConceptsBi +\ingroup PkgAlgebraicKernelDConceptsBi \cgalConcept Returns a square free part of a bivariate polynomial. diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--NumberOfSolutions_2.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--NumberOfSolutions_2.h index be42927f55e..9d89a8a885f 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--NumberOfSolutions_2.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--NumberOfSolutions_2.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgAlgebraicKerneldConceptsBi +\ingroup PkgAlgebraicKernelDConceptsBi \cgalConcept Computes the number of real solutions of the given bivariate polynomial system. diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--SignAt_2.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--SignAt_2.h index 1848718d807..c63604b2d38 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--SignAt_2.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--SignAt_2.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgAlgebraicKerneldConceptsBi +\ingroup PkgAlgebraicKernelDConceptsBi \cgalConcept Computes the sign of a bivariate polynomial diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--Solve_2.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--Solve_2.h index 50541524b2d..fefefd5b322 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--Solve_2.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--Solve_2.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgAlgebraicKerneldConceptsBi +\ingroup PkgAlgebraicKernelDConceptsBi \cgalConcept Computes the real zero-dimensional solutions of a bivariate polynomial system. diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--SquareFreeFactorize_2.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--SquareFreeFactorize_2.h index e0e754c0adb..48a73376c7c 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--SquareFreeFactorize_2.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2--SquareFreeFactorize_2.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgAlgebraicKerneldConceptsBi +\ingroup PkgAlgebraicKernelDConceptsBi \cgalConcept Computes a square free factorization of an diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2.h b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2.h index 758d153c06f..53d701efa69 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2.h +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/Concepts/AlgebraicKernel_d_2.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgAlgebraicKerneldConceptsBi +\ingroup PkgAlgebraicKernelDConceptsBi \cgalConcept A model of the `AlgebraicKernel_d_2` concept gathers necessary tools diff --git a/Algebraic_kernel_d/doc/Algebraic_kernel_d/PackageDescription.txt b/Algebraic_kernel_d/doc/Algebraic_kernel_d/PackageDescription.txt index c47391fc374..1aeab366c90 100644 --- a/Algebraic_kernel_d/doc/Algebraic_kernel_d/PackageDescription.txt +++ b/Algebraic_kernel_d/doc/Algebraic_kernel_d/PackageDescription.txt @@ -1,28 +1,28 @@ -/// \defgroup PkgAlgebraicKerneld Algebraic Kernel Reference +/// \defgroup PkgAlgebraicKernelDRef Algebraic Kernel Reference -/// \defgroup PkgAlgebraicKerneldConcepts Concepts -/// \ingroup PkgAlgebraicKerneld +/// \defgroup PkgAlgebraicKernelDConcepts Concepts +/// \ingroup PkgAlgebraicKernelDRef -/// \defgroup PkgAlgebraicKerneldConceptsUni Univariate Algebraic Kernel -/// \ingroup PkgAlgebraicKerneldConcepts +/// \defgroup PkgAlgebraicKernelDConceptsUni Univariate Algebraic Kernel +/// \ingroup PkgAlgebraicKernelDConcepts -/// \defgroup PkgAlgebraicKerneldConceptsBi Bivariate Algebraic Kernel -/// \ingroup PkgAlgebraicKerneldConcepts +/// \defgroup PkgAlgebraicKernelDConceptsBi Bivariate Algebraic Kernel +/// \ingroup PkgAlgebraicKernelDConcepts -/// \defgroup PkgAlgebraicKerneldModels Models -/// \ingroup PkgAlgebraicKerneld +/// \defgroup PkgAlgebraicKernelDModels Models +/// \ingroup PkgAlgebraicKernelDRef /*! -\addtogroup PkgAlgebraicKerneld +\addtogroup PkgAlgebraicKernelDRef \todo check generated documentation -\cgalPkgDescriptionBegin{Algebraic Kernel,PkgAlgebraicKerneldSummary} +\cgalPkgDescriptionBegin{Algebraic Kernel,PkgAlgebraicKernelD} \cgalPkgPicture{Algebraic_kernel_d.png} \cgalPkgSummaryBegin \cgalPkgAuthors{Eric Berberich, Michael Hemmer, Michael Kerber, Sylvain Lazard, Luis Peñaranda, and Monique Teillaud} \cgalPkgDesc{Real solving of polynomials is a fundamental problem with a wide application range. This package is targeted to provide black-box implementations of state-of-the-art algorithms to determine, compare and approximate real roots of univariate polynomials and bivariate polynomial systems. Such a black-box is called an *Algebraic %Kernel*. So far the package only provides models for the univariate kernel. Nevertheless, it already defines concepts for the bivariate kernel, since this settles the interface for upcoming implementations.} -\cgalPkgManuals{Chapter_Algebraic_Kernel,PkgAlgebraicKerneld} +\cgalPkgManuals{Chapter_Algebraic_Kernel,PkgAlgebraicKernelDRef} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{3.6} diff --git a/Algebraic_kernel_d/examples/Algebraic_kernel_d/CMakeLists.txt b/Algebraic_kernel_d/examples/Algebraic_kernel_d/CMakeLists.txt index 366cc0cb9c2..d6a7178ec13 100644 --- a/Algebraic_kernel_d/examples/Algebraic_kernel_d/CMakeLists.txt +++ b/Algebraic_kernel_d/examples/Algebraic_kernel_d/CMakeLists.txt @@ -6,14 +6,13 @@ cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET COMPONENTS Core) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) find_package(MPFI QUIET) endif() if( CGAL_FOUND AND MPFI_FOUND) + include( ${CGAL_USE_FILE} ) include( ${MPFI_USE_FILE} ) - include( CGAL_CreateSingleSourceCGALProgram ) include( CGAL_VersionUtils ) create_single_source_cgal_program( "Compare_1.cpp" ) diff --git a/Algebraic_kernel_d/test/Algebraic_kernel_d/CMakeLists.txt b/Algebraic_kernel_d/test/Algebraic_kernel_d/CMakeLists.txt index 5d1ddbaa0e5..a75ee88082e 100644 --- a/Algebraic_kernel_d/test/Algebraic_kernel_d/CMakeLists.txt +++ b/Algebraic_kernel_d/test/Algebraic_kernel_d/CMakeLists.txt @@ -13,9 +13,6 @@ if ( NOT CGAL_FOUND ) endif() -# include helper file -include( ${CGAL_USE_FILE} ) - find_package(RS3 QUIET) if(MPFI_FOUND) @@ -25,8 +22,6 @@ if(RS3_FOUND) include( ${RS3_USE_FILE} ) endif() -include( CGAL_CreateSingleSourceCGALProgram ) - # Boost and its components find_package( Boost ) @@ -41,14 +36,11 @@ endif() # include for local directory include_directories( BEFORE include ) -# include for local package -include_directories( BEFORE ../../include ) +include( ${CGAL_USE_FILE} ) # Creating entries for all .cpp/.C files with "main" routine # ########################################################## -include( CGAL_CreateSingleSourceCGALProgram ) - create_single_source_cgal_program( "cyclic.cpp" ) create_single_source_cgal_program( "Algebraic_curve_kernel_2.cpp" ) create_single_source_cgal_program( "algebraic_curve_kernel_2_tools.cpp" ) diff --git a/Algebraic_kernel_for_circles/test/Algebraic_kernel_for_circles/CMakeLists.txt b/Algebraic_kernel_for_circles/test/Algebraic_kernel_for_circles/CMakeLists.txt index 92dd71db11c..4261dd0c584 100644 --- a/Algebraic_kernel_for_circles/test/Algebraic_kernel_for_circles/CMakeLists.txt +++ b/Algebraic_kernel_for_circles/test/Algebraic_kernel_for_circles/CMakeLists.txt @@ -4,19 +4,13 @@ project( Algebraic_kernel_for_circles_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - include_directories (BEFORE "../../include") - - include_directories (BEFORE "include") + include_directories (BEFORE "include") # create a target per cppfile file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) diff --git a/Algebraic_kernel_for_spheres/test/Algebraic_kernel_for_spheres/CMakeLists.txt b/Algebraic_kernel_for_spheres/test/Algebraic_kernel_for_spheres/CMakeLists.txt index bdc8b022ef6..6b8567c4727 100644 --- a/Algebraic_kernel_for_spheres/test/Algebraic_kernel_for_spheres/CMakeLists.txt +++ b/Algebraic_kernel_for_spheres/test/Algebraic_kernel_for_spheres/CMakeLists.txt @@ -4,19 +4,13 @@ project( Algebraic_kernel_for_spheres_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - include_directories (BEFORE "../../include") - - include_directories (BEFORE "include") + include_directories (BEFORE "include") # create a target per cppfile file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) diff --git a/Alpha_shapes_2/doc/Alpha_shapes_2/CGAL/Alpha_shape_2.h b/Alpha_shapes_2/doc/Alpha_shapes_2/CGAL/Alpha_shape_2.h index fd3f480a7fb..cf655264ac4 100644 --- a/Alpha_shapes_2/doc/Alpha_shapes_2/CGAL/Alpha_shape_2.h +++ b/Alpha_shapes_2/doc/Alpha_shapes_2/CGAL/Alpha_shape_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgAlphaShape2 +\ingroup PkgAlphaShapes2Ref The class `Alpha_shape_2` represents the family of \f$ \alpha\f$-shapes of points in a plane for all positive diff --git a/Alpha_shapes_2/doc/Alpha_shapes_2/CGAL/Alpha_shape_face_base_2.h b/Alpha_shapes_2/doc/Alpha_shapes_2/CGAL/Alpha_shape_face_base_2.h index b6a5a330ae5..7b94e488aeb 100644 --- a/Alpha_shapes_2/doc/Alpha_shapes_2/CGAL/Alpha_shape_face_base_2.h +++ b/Alpha_shapes_2/doc/Alpha_shapes_2/CGAL/Alpha_shape_face_base_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgAlphaShape2 +\ingroup PkgAlphaShapes2Ref The class `Alpha_shape_face_base_2` is the default model for the concept `AlphaShapeFace_2`. diff --git a/Alpha_shapes_2/doc/Alpha_shapes_2/CGAL/Alpha_shape_vertex_base_2.h b/Alpha_shapes_2/doc/Alpha_shapes_2/CGAL/Alpha_shape_vertex_base_2.h index f20b2dfe563..755c8af5fb4 100644 --- a/Alpha_shapes_2/doc/Alpha_shapes_2/CGAL/Alpha_shape_vertex_base_2.h +++ b/Alpha_shapes_2/doc/Alpha_shapes_2/CGAL/Alpha_shape_vertex_base_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgAlphaShape2 +\ingroup PkgAlphaShapes2Ref The class `Alpha_shape_vertex_base_2` is the default model for the concept `AlphaShapeVertex_2`. diff --git a/Alpha_shapes_2/doc/Alpha_shapes_2/CGAL/Weighted_alpha_shape_euclidean_traits_2.h b/Alpha_shapes_2/doc/Alpha_shapes_2/CGAL/Weighted_alpha_shape_euclidean_traits_2.h index 93852d99a12..b182ba9e388 100644 --- a/Alpha_shapes_2/doc/Alpha_shapes_2/CGAL/Weighted_alpha_shape_euclidean_traits_2.h +++ b/Alpha_shapes_2/doc/Alpha_shapes_2/CGAL/Weighted_alpha_shape_euclidean_traits_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgAlphaShape2 +\ingroup PkgAlphaShapes2Ref \deprecated The class is deprecated since \cgal 4.10, as the weighted point and the function objects for weighted points are part of the concept `Kernel`. The class is kept for backward diff --git a/Alpha_shapes_2/doc/Alpha_shapes_2/Concepts/AlphaShapeFace_2.h b/Alpha_shapes_2/doc/Alpha_shapes_2/Concepts/AlphaShapeFace_2.h index 4edbc836b4f..330f343719b 100644 --- a/Alpha_shapes_2/doc/Alpha_shapes_2/Concepts/AlphaShapeFace_2.h +++ b/Alpha_shapes_2/doc/Alpha_shapes_2/Concepts/AlphaShapeFace_2.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgAlphaShape2Concepts +\ingroup PkgAlphaShapes2Concepts \cgalConcept The concept `AlphaShapeFace_2` describes the requirements for the base face of an alpha shape. diff --git a/Alpha_shapes_2/doc/Alpha_shapes_2/Concepts/AlphaShapeTraits_2.h b/Alpha_shapes_2/doc/Alpha_shapes_2/Concepts/AlphaShapeTraits_2.h index bcac27ecb44..be6e2389a11 100644 --- a/Alpha_shapes_2/doc/Alpha_shapes_2/Concepts/AlphaShapeTraits_2.h +++ b/Alpha_shapes_2/doc/Alpha_shapes_2/Concepts/AlphaShapeTraits_2.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgAlphaShape2Concepts +\ingroup PkgAlphaShapes2Concepts \cgalConcept The concept `AlphaShapeTraits_2` describes the requirements for the geometric traits diff --git a/Alpha_shapes_2/doc/Alpha_shapes_2/Concepts/AlphaShapeVertex_2.h b/Alpha_shapes_2/doc/Alpha_shapes_2/Concepts/AlphaShapeVertex_2.h index e0224242fc9..a9287eb5aff 100644 --- a/Alpha_shapes_2/doc/Alpha_shapes_2/Concepts/AlphaShapeVertex_2.h +++ b/Alpha_shapes_2/doc/Alpha_shapes_2/Concepts/AlphaShapeVertex_2.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgAlphaShape2Concepts +\ingroup PkgAlphaShapes2Concepts \cgalConcept The concept `AlphaShapeVertex_2` describes the requirements for the base vertex of an alpha shape. diff --git a/Alpha_shapes_2/doc/Alpha_shapes_2/Concepts/WeightedAlphaShapeTraits_2.h b/Alpha_shapes_2/doc/Alpha_shapes_2/Concepts/WeightedAlphaShapeTraits_2.h index b39e85a728f..09c7597b39b 100644 --- a/Alpha_shapes_2/doc/Alpha_shapes_2/Concepts/WeightedAlphaShapeTraits_2.h +++ b/Alpha_shapes_2/doc/Alpha_shapes_2/Concepts/WeightedAlphaShapeTraits_2.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgAlphaShape2Concepts +\ingroup PkgAlphaShapes2Concepts \cgalConcept The concept `WeightedAlphaShapeTraits_2` describes the requirements diff --git a/Alpha_shapes_2/doc/Alpha_shapes_2/PackageDescription.txt b/Alpha_shapes_2/doc/Alpha_shapes_2/PackageDescription.txt index 89f592fe677..1f982595424 100644 --- a/Alpha_shapes_2/doc/Alpha_shapes_2/PackageDescription.txt +++ b/Alpha_shapes_2/doc/Alpha_shapes_2/PackageDescription.txt @@ -1,20 +1,20 @@ -/// \defgroup PkgAlphaShape2 2D Alpha Shapes Reference -/// \defgroup PkgAlphaShape2Concepts Concepts -/// \ingroup PkgAlphaShape2 +/// \defgroup PkgAlphaShapes2Ref 2D Alpha Shapes Reference +/// \defgroup PkgAlphaShapes2Concepts Concepts +/// \ingroup PkgAlphaShapes2Ref /*! -\addtogroup PkgAlphaShape2 +\addtogroup PkgAlphaShapes2Ref -\cgalPkgDescriptionBegin{2D Alpha Shapes,PkgAlphaShape2Summary} +\cgalPkgDescriptionBegin{2D Alpha Shapes,PkgAlphaShapes2} \cgalPkgPicture{alpha-detail.png} \cgalPkgSummaryBegin \cgalPkgAuthors{Tran Kai Frank Da} \cgalPkgDesc{This package offers a data structure encoding the whole family of alpha-complexes related to a given 2D Delaunay or regular triangulation. In particular, the data structure allows to retrieve the alpha-complex for any alpha value, the whole spectrum of critical alpha values and a filtration on the triangulation faces (this filtration is based on the first alpha value for which each face is included on the alpha-complex).} -\cgalPkgManuals{Chapter_2D_Alpha_Shapes,PkgAlphaShape2} +\cgalPkgManuals{Chapter_2D_Alpha_Shapes,PkgAlphaShapes2Ref} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{2.1} -\cgalPkgDependsOn{\ref PkgTriangulation2Summary} +\cgalPkgDependsOn{\ref PkgTriangulation2} \cgalPkgBib{cgal:d-as2} \cgalPkgLicense{\ref licensesGPL "GPL"} \cgalPkgDemo{2D Alpha Shapes,alpha_shapes_2.zip} diff --git a/Alpha_shapes_2/examples/Alpha_shapes_2/CMakeLists.txt b/Alpha_shapes_2/examples/Alpha_shapes_2/CMakeLists.txt index 15b8a33b1d6..79131b56ac0 100644 --- a/Alpha_shapes_2/examples/Alpha_shapes_2/CMakeLists.txt +++ b/Alpha_shapes_2/examples/Alpha_shapes_2/CMakeLists.txt @@ -4,18 +4,12 @@ project( Alpha_shapes_2_Examples ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Alpha_shapes_2/test/Alpha_shapes_2/CMakeLists.txt b/Alpha_shapes_2/test/Alpha_shapes_2/CMakeLists.txt index 86838ab803e..8724fa225f4 100644 --- a/Alpha_shapes_2/test/Alpha_shapes_2/CMakeLists.txt +++ b/Alpha_shapes_2/test/Alpha_shapes_2/CMakeLists.txt @@ -4,18 +4,12 @@ project( Alpha_shapes_2_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Alpha_shapes_3/demo/Alpha_shapes_3/CMakeLists.txt b/Alpha_shapes_3/demo/Alpha_shapes_3/CMakeLists.txt index e00a76ae742..6df765a5b7a 100644 --- a/Alpha_shapes_3/demo/Alpha_shapes_3/CMakeLists.txt +++ b/Alpha_shapes_3/demo/Alpha_shapes_3/CMakeLists.txt @@ -17,7 +17,6 @@ if(POLICY CMP0071) endif() find_package(CGAL COMPONENTS Qt5) -include(${CGAL_USE_FILE}) find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg) @@ -26,7 +25,7 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND ) add_definitions(-DQT_NO_KEYWORDS) # include(${QT_USE_FILE}) - include_directories (BEFORE ../../include ./ ) + include_directories (BEFORE ./ ) # ui file, created wih Qt Designer qt5_wrap_ui( uis MainWindow.ui ) diff --git a/Alpha_shapes_3/doc/Alpha_shapes_3/CGAL/Alpha_shape_3.h b/Alpha_shapes_3/doc/Alpha_shapes_3/CGAL/Alpha_shape_3.h index 52f081ba007..e1e14111ed0 100644 --- a/Alpha_shapes_3/doc/Alpha_shapes_3/CGAL/Alpha_shape_3.h +++ b/Alpha_shapes_3/doc/Alpha_shapes_3/CGAL/Alpha_shape_3.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgAlphaShapes3 +\ingroup PkgAlphaShapes3Ref The class `Alpha_shape_3` represents the family of alpha shapes of points in the 3D space for all real diff --git a/Alpha_shapes_3/doc/Alpha_shapes_3/CGAL/Alpha_shape_cell_base_3.h b/Alpha_shapes_3/doc/Alpha_shapes_3/CGAL/Alpha_shape_cell_base_3.h index f733d1a9a8c..b57d44fe618 100644 --- a/Alpha_shapes_3/doc/Alpha_shapes_3/CGAL/Alpha_shape_cell_base_3.h +++ b/Alpha_shapes_3/doc/Alpha_shapes_3/CGAL/Alpha_shape_cell_base_3.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgAlphaShapes3 +\ingroup PkgAlphaShapes3Ref The class `Alpha_shape_cell_base_3` is the default model for the concept `AlphaShapeCell_3`. @@ -37,7 +37,7 @@ public: namespace CGAL { /*! -\ingroup PkgAlphaShapes3 +\ingroup PkgAlphaShapes3Ref The class `Alpha_status` is a small data structure to store the critical alpha values of faces of an alpha shape. diff --git a/Alpha_shapes_3/doc/Alpha_shapes_3/CGAL/Alpha_shape_vertex_base_3.h b/Alpha_shapes_3/doc/Alpha_shapes_3/CGAL/Alpha_shape_vertex_base_3.h index 48a900c3234..146a941e218 100644 --- a/Alpha_shapes_3/doc/Alpha_shapes_3/CGAL/Alpha_shape_vertex_base_3.h +++ b/Alpha_shapes_3/doc/Alpha_shapes_3/CGAL/Alpha_shape_vertex_base_3.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgAlphaShapes3 +\ingroup PkgAlphaShapes3Ref The class `Alpha_shape_vertex_base_3` is the default model for the concept `AlphaShapeVertex_3`. diff --git a/Alpha_shapes_3/doc/Alpha_shapes_3/CGAL/Fixed_alpha_shape_3.h b/Alpha_shapes_3/doc/Alpha_shapes_3/CGAL/Fixed_alpha_shape_3.h index 71b7394b4ef..d7bad466690 100644 --- a/Alpha_shapes_3/doc/Alpha_shapes_3/CGAL/Fixed_alpha_shape_3.h +++ b/Alpha_shapes_3/doc/Alpha_shapes_3/CGAL/Fixed_alpha_shape_3.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgAlphaShapes3 +\ingroup PkgAlphaShapes3Ref The class `Fixed_alpha_shape_3` represents one (fixed) alpha shape of points in the 3D space for a real diff --git a/Alpha_shapes_3/doc/Alpha_shapes_3/CGAL/Fixed_alpha_shape_cell_base_3.h b/Alpha_shapes_3/doc/Alpha_shapes_3/CGAL/Fixed_alpha_shape_cell_base_3.h index 776e787b20c..ab50625bfd5 100644 --- a/Alpha_shapes_3/doc/Alpha_shapes_3/CGAL/Fixed_alpha_shape_cell_base_3.h +++ b/Alpha_shapes_3/doc/Alpha_shapes_3/CGAL/Fixed_alpha_shape_cell_base_3.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgAlphaShapes3 +\ingroup PkgAlphaShapes3Ref The class `Fixed_alpha_shape_cell_base_3` is the default model for the concept `FixedAlphaShapeCell_3`. diff --git a/Alpha_shapes_3/doc/Alpha_shapes_3/CGAL/Fixed_alpha_shape_vertex_base_3.h b/Alpha_shapes_3/doc/Alpha_shapes_3/CGAL/Fixed_alpha_shape_vertex_base_3.h index d512a99e4a0..5c132505980 100644 --- a/Alpha_shapes_3/doc/Alpha_shapes_3/CGAL/Fixed_alpha_shape_vertex_base_3.h +++ b/Alpha_shapes_3/doc/Alpha_shapes_3/CGAL/Fixed_alpha_shape_vertex_base_3.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgAlphaShapes3 +\ingroup PkgAlphaShapes3Ref The class `Fixed_alpha_shape_vertex_base_3` is the default model for the concept `FixedAlphaShapeVertex_3`. diff --git a/Alpha_shapes_3/doc/Alpha_shapes_3/PackageDescription.txt b/Alpha_shapes_3/doc/Alpha_shapes_3/PackageDescription.txt index 279faf91035..cd6d40f3d30 100644 --- a/Alpha_shapes_3/doc/Alpha_shapes_3/PackageDescription.txt +++ b/Alpha_shapes_3/doc/Alpha_shapes_3/PackageDescription.txt @@ -1,18 +1,18 @@ -/// \defgroup PkgAlphaShapes3 3D Alpha Shapes Reference +/// \defgroup PkgAlphaShapes3Ref 3D Alpha Shapes Reference /// \defgroup PkgAlphaShapes3Concepts Concepts -/// \ingroup PkgAlphaShapes3 +/// \ingroup PkgAlphaShapes3Ref /*! -\addtogroup PkgAlphaShapes3 -\cgalPkgDescriptionBegin{3D Alpha Shapes,PkgAlphaShapes3Summary} +\addtogroup PkgAlphaShapes3Ref +\cgalPkgDescriptionBegin{3D Alpha Shapes,PkgAlphaShapes3} \cgalPkgPicture{alpha_shapes_3_small.png} \cgalPkgSummaryBegin \cgalPkgAuthors{Tran Kai Frank Da, Sébastien Loriot, and Mariette Yvinec} \cgalPkgDesc{This package offers a data structure encoding either one alpha-complex or the whole family of alpha-complexes related to a given 3D Delaunay or regular triangulation. In the latter case, the data structure allows to retrieve the alpha-complex for any alpha value, the whole spectrum of critical alpha values and a filtration on the triangulation faces (this filtration is based on the first alpha value for which each face is included on the alpha-complex). } -\cgalPkgManuals{Chapter_3D_Alpha_Shapes,PkgAlphaShapes3} +\cgalPkgManuals{Chapter_3D_Alpha_Shapes,PkgAlphaShapes3Ref} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{2.3} -\cgalPkgDependsOn{\ref PkgTriangulation3Summary} +\cgalPkgDependsOn{\ref PkgTriangulation3} \cgalPkgBib{cgal:dy-as3} \cgalPkgLicense{\ref licensesGPL "GPL"} \cgalPkgDemo{3D Alpha Shapes,alpha_shape_3.zip} diff --git a/Alpha_shapes_3/examples/Alpha_shapes_3/CMakeLists.txt b/Alpha_shapes_3/examples/Alpha_shapes_3/CMakeLists.txt index a9f5a5408fa..c9d88b3942e 100644 --- a/Alpha_shapes_3/examples/Alpha_shapes_3/CMakeLists.txt +++ b/Alpha_shapes_3/examples/Alpha_shapes_3/CMakeLists.txt @@ -4,18 +4,12 @@ project( Alpha_shapes_3_Examples ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Alpha_shapes_3/examples/Alpha_shapes_3/visible_alpha_shape_facets_to_OFF.cpp b/Alpha_shapes_3/examples/Alpha_shapes_3/visible_alpha_shape_facets_to_OFF.cpp new file mode 100644 index 00000000000..2949f50983f --- /dev/null +++ b/Alpha_shapes_3/examples/Alpha_shapes_3/visible_alpha_shape_facets_to_OFF.cpp @@ -0,0 +1,120 @@ +#include + +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +typedef CGAL::Exact_predicates_inexact_constructions_kernel Gt; + +typedef CGAL::Alpha_shape_vertex_base_3 Vb; +typedef CGAL::Alpha_shape_cell_base_3 Fb; +typedef CGAL::Triangulation_data_structure_3 Tds; +typedef CGAL::Delaunay_triangulation_3 Triangulation_3; +typedef CGAL::Alpha_shape_3 Alpha_shape_3; + +typedef Gt::Point_3 Point; +typedef Alpha_shape_3::Alpha_iterator Alpha_iterator; + +int main() +{ + std::vector points; + +//read input + std::ifstream is("data/bunny_5000"); + int n; + is >> n; + double x, y, z; + for (int i=0;i> x >> y >> z; + points.push_back( Point(x, y, z) ); + } + + std::cerr << points.size() << " points read.\n"; +// compute alpha shape + Alpha_shape_3 as(points.begin(), points.end()); + Alpha_shape_3::NT alpha_solid = as.find_alpha_solid(); + as.set_alpha(alpha_solid); + + std::cerr << "alpha_solid = " << alpha_solid << "\n"; + std::cerr << as.number_of_solid_components() << " number of solid components\n"; + +// collect alpha-shape facets accessible from the infinity + // marks the cells that are in the same component as the infinite vertex by flooding + boost::unordered_set< Alpha_shape_3::Cell_handle > marked_cells; + std::vector< Alpha_shape_3::Cell_handle > queue; + queue.push_back( as.infinite_cell() ); + + while(!queue.empty()) + { + Alpha_shape_3::Cell_handle back = queue.back(); + queue.pop_back(); + + if ( !marked_cells.insert(back).second ) continue; //already visited + + for (int i=0; i<4; ++i) + { + if (as.classify(Alpha_shape_3::Facet(back, i))==Alpha_shape_3::EXTERIOR && + marked_cells.count(back->neighbor(i))==0) + queue.push_back( back->neighbor(i) ); + } + } + + // filter regular facets to restrict them to those adjacent to a marked cell + std::vector< Alpha_shape_3::Facet > regular_facets; + as.get_alpha_shape_facets(std::back_inserter( regular_facets ), Alpha_shape_3::REGULAR ); + + std::vector filtered_regular_facets; + BOOST_FOREACH(Alpha_shape_3::Facet f, regular_facets) + { + if ( marked_cells.count(f.first)==1 ) + filtered_regular_facets.push_back(f); + else + { + f = as.mirror_facet(f); + if ( marked_cells.count(f.first)==1 ) + filtered_regular_facets.push_back(f); + } + } + +// dump into OFF format + // assign an id per vertex + boost::unordered_map< Alpha_shape_3::Vertex_handle, std::size_t> vids; + points.clear(); + + BOOST_FOREACH(Alpha_shape_3::Facet f, filtered_regular_facets) + { + for (int i=1;i<4; ++i) + { + Alpha_shape_3::Vertex_handle vh = f.first->vertex((f.second+i)%4); + if (vids.insert( std::make_pair(vh, points.size()) ).second) + points.push_back( vh->point() ); + } + } + + // writing + std::ofstream output("out.off"); + output << "OFF\n " << points.size() << " " << filtered_regular_facets.size() << " 0\n"; + std::copy(points.begin(), points.end(), std::ostream_iterator(output, "\n")); + BOOST_FOREACH(const Alpha_shape_3::Facet& f, filtered_regular_facets) + { + output << 3; + + for (int i=0;i<3; ++i) + { + Alpha_shape_3::Vertex_handle vh = f.first->vertex( as.vertex_triple_index(f.second, i) ); + output << " " << vids[vh]; + } + output << "\n"; + } + + return 0; +} diff --git a/Alpha_shapes_3/test/Alpha_shapes_3/CMakeLists.txt b/Alpha_shapes_3/test/Alpha_shapes_3/CMakeLists.txt index 528247733b7..600a2a8ae41 100644 --- a/Alpha_shapes_3/test/Alpha_shapes_3/CMakeLists.txt +++ b/Alpha_shapes_3/test/Alpha_shapes_3/CMakeLists.txt @@ -4,19 +4,13 @@ project( Alpha_shapes_3_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - include_directories (BEFORE "../../include") - - include_directories (BEFORE "include") + include_directories (BEFORE "include") # create a target per cppfile file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) diff --git a/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_2.h b/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_2.h index 27bb8401c69..6716e9095da 100644 --- a/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_2.h +++ b/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgApolloniusGraph2 +\ingroup PkgApolloniusGraph2Ref The class `Apollonius_graph_2` represents the Apollonius graph. It supports insertions and deletions of sites. diff --git a/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_filtered_traits_2.h b/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_filtered_traits_2.h index 8f972d24d33..a1b4a8003d5 100644 --- a/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_filtered_traits_2.h +++ b/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_filtered_traits_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgApolloniusGraph2 +\ingroup PkgApolloniusGraph2Ref The class `Apollonius_graph_filtered_traits_2` provides a model for the `ApolloniusGraphTraits_2` concept. diff --git a/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_hierarchy_2.h b/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_hierarchy_2.h index 863167f6e3b..6456ef59549 100644 --- a/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_hierarchy_2.h +++ b/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_hierarchy_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgApolloniusGraph2 +\ingroup PkgApolloniusGraph2Ref We provide an alternative to the class `Apollonius_graph_2` for the dynamic diff --git a/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_hierarchy_vertex_base_2.h b/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_hierarchy_vertex_base_2.h index d04be3c9250..5dd5bf06793 100644 --- a/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_hierarchy_vertex_base_2.h +++ b/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_hierarchy_vertex_base_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgApolloniusGraph2 +\ingroup PkgApolloniusGraph2Ref The class `Apollonius_graph_hierarchy_vertex_base_2` provides a model for the `ApolloniusGraphHierarchyVertexBase_2` concept, which is the diff --git a/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_traits_2.h b/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_traits_2.h index bdd1cc2b503..6f3d11a7517 100644 --- a/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_traits_2.h +++ b/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_traits_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgApolloniusGraph2 +\ingroup PkgApolloniusGraph2Ref The class `Apollonius_graph_traits_2` provides a model for the `ApolloniusGraphTraits_2` concept. diff --git a/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_vertex_base_2.h b/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_vertex_base_2.h index a1ab5ac7b74..c86d80b0b1a 100644 --- a/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_vertex_base_2.h +++ b/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_vertex_base_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgApolloniusGraph2 +\ingroup PkgApolloniusGraph2Ref The class `Apollonius_graph_vertex_base_2` provides a model for the `ApolloniusGraphVertexBase_2` concept which is the vertex base diff --git a/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_site_2.h b/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_site_2.h index fe4ddc0de0d..a77be4d6fe1 100644 --- a/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_site_2.h +++ b/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_site_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgApolloniusGraph2 +\ingroup PkgApolloniusGraph2Ref The class `Apollonius_site_2` is a model for the concept `ApolloniusSite_2`. It is parametrized by a template parameter diff --git a/Apollonius_graph_2/doc/Apollonius_graph_2/PackageDescription.txt b/Apollonius_graph_2/doc/Apollonius_graph_2/PackageDescription.txt index a8b8e8c267c..c35cbc53915 100644 --- a/Apollonius_graph_2/doc/Apollonius_graph_2/PackageDescription.txt +++ b/Apollonius_graph_2/doc/Apollonius_graph_2/PackageDescription.txt @@ -1,19 +1,19 @@ -/// \defgroup PkgApolloniusGraph2 2D Apollonius Graphs (Delaunay Graphs of Disks) Reference +/// \defgroup PkgApolloniusGraph2Ref 2D Apollonius Graphs (Delaunay Graphs of Disks) Reference /// \defgroup PkgApolloniusGraph2Concepts Concepts -/// \ingroup PkgApolloniusGraph2 +/// \ingroup PkgApolloniusGraph2Ref /*! -\addtogroup PkgApolloniusGraph2 +\addtogroup PkgApolloniusGraph2Ref \todo check generated documentation -\cgalPkgDescriptionBegin{2D Apollonius Graphs (Delaunay Graphs of Disks),PkgApolloniusGraph2Summary} +\cgalPkgDescriptionBegin{2D Apollonius Graphs (Delaunay Graphs of Disks),PkgApolloniusGraph2} \cgalPkgPicture{CircleVoronoi.png} \cgalPkgSummaryBegin \cgalPkgAuthors{Menelaos Karavelas and Mariette Yvinec} \cgalPkgDesc{Algorithms for computing the Apollonius graph in two dimensions. The Apollonius graph is the dual of the Apollonius diagram, also known as the additively weighted Voronoi diagram. The latter can be thought of as the Voronoi diagram of a set of disks under the Euclidean metric, and it is a generalization of the standard Voronoi diagram for points. The algorithms provided are dynamic.} -\cgalPkgManuals{Chapter_2D_Apollonius_Graphs,PkgApolloniusGraph2} +\cgalPkgManuals{Chapter_2D_Apollonius_Graphs,PkgApolloniusGraph2Ref} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{3.0} -\cgalPkgDependsOn{\ref PkgTDS2Summary} +\cgalPkgDependsOn{\ref PkgTDS2} \cgalPkgBib{cgal:ky-ag2} \cgalPkgLicense{\ref licensesGPL "GPL"} \cgalPkgDemo{2D Apollonius Graph,apollonius_graph_2.zip} diff --git a/Apollonius_graph_2/examples/Apollonius_graph_2/CMakeLists.txt b/Apollonius_graph_2/examples/Apollonius_graph_2/CMakeLists.txt index 286e261911a..07f5f6688ba 100644 --- a/Apollonius_graph_2/examples/Apollonius_graph_2/CMakeLists.txt +++ b/Apollonius_graph_2/examples/Apollonius_graph_2/CMakeLists.txt @@ -4,17 +4,13 @@ project( Apollonius_graph_2_Examples ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET COMPONENTS Core ) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - include_directories (BEFORE "../../include") + include(${CGAL_USE_FILE}) # create a target per cppfile file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) diff --git a/Apollonius_graph_2/test/Apollonius_graph_2/CMakeLists.txt b/Apollonius_graph_2/test/Apollonius_graph_2/CMakeLists.txt index 59f708758a2..65c0c68062b 100644 --- a/Apollonius_graph_2/test/Apollonius_graph_2/CMakeLists.txt +++ b/Apollonius_graph_2/test/Apollonius_graph_2/CMakeLists.txt @@ -4,19 +4,13 @@ project( Apollonius_graph_2_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - include_directories (BEFORE "../../include") - - include_directories (BEFORE "include") + include_directories (BEFORE "include") # create a target per cppfile file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) diff --git a/Arithmetic_kernel/test/Arithmetic_kernel/CMakeLists.txt b/Arithmetic_kernel/test/Arithmetic_kernel/CMakeLists.txt index 8542a68811b..0df7f74c0f2 100644 --- a/Arithmetic_kernel/test/Arithmetic_kernel/CMakeLists.txt +++ b/Arithmetic_kernel/test/Arithmetic_kernel/CMakeLists.txt @@ -4,31 +4,25 @@ project( Arithmetic_kernel_Tests ) -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET COMPONENTS Core) -if ( CGAL_FOUND) - include( ${CGAL_USE_FILE} ) -endif() - find_package(GMP QUIET) if ( CGAL_FOUND AND GMP_FOUND ) + include(${CGAL_USE_FILE}) include( CGAL_VersionUtils ) get_dependency_version( GMP ) IS_VERSION_LESS("${GMP_VERSION}" "4.2.0" _IS_GMP_VERSION_TO_LOW) - include_directories(../../include) include_directories(include) - include( CGAL_CreateSingleSourceCGALProgram ) - find_package( MPFI ) if( MPFI_FOUND ) 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 b73e7e414e2..31b49747cf8 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 @@ -9,15 +9,14 @@ if(NOT POLICY CMP0070 AND POLICY CMP0053) endif() find_package(CGAL COMPONENTS Core Qt5 ) -include( ${CGAL_USE_FILE} ) find_package( Qt5 QUIET COMPONENTS Gui Widgets) if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND CGAL_Core_FOUND) + include(${CGAL_USE_FILE}) + include_directories( ./ ) # Arrangement package includes - include_directories( BEFORE ../../include ) - add_definitions(-DQT_NO_KEYWORDS) qt5_wrap_ui( arrangement_2_uis diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_Bezier_curve_traits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_Bezier_curve_traits_2.h index a98df8df253..cc347e4ecc1 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_Bezier_curve_traits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_Bezier_curve_traits_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgArrangement2TraitsClasses +\ingroup PkgArrangementOnSurface2TraitsClasses The traits class `Arr_Bezier_curve_traits_2` is a model of the `ArrangementTraits_2` concept that handles planar Bézier curves. A planar Bézier curve @@ -85,7 +85,7 @@ typedef unspecified_type Algebraic; The `Curve_2` class nested within the Bézier traits class is used to represent a Bézier curve of arbitrary degree, which is defined by a sequence of rational control points. In addition to the methods listed -below, the I/O operators \link PkgArrangement2op_left_shift `operator<<` \endlink and \link PkgArrangement2op_right_shift `operator>>` \endlink for +below, the I/O operators \link PkgArrangementOnSurface2op_left_shift `operator<<` \endlink and \link PkgArrangementOnSurface2op_right_shift `operator>>` \endlink for standard output-streams are also supported. The copy constructor and assignment operator are supported as well. diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_accessor.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_accessor.h index 68be885d043..29d6417b375 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_accessor.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_accessor.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgArrangement2 +\ingroup PkgArrangementOnSurface2Ref \anchor arr_refarr_access diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_algebraic_segment_traits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_algebraic_segment_traits_2.h index 125252aebcc..0b7f00df91a 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_algebraic_segment_traits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_algebraic_segment_traits_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgArrangement2TraitsClasses +\ingroup PkgArrangementOnSurface2TraitsClasses The traits class `Arr_algebraic_segment_traits_2` is a model of the `ArrangementTraits_2` concept that handles planar algebraic curves of arbitrary degree, diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_batched_point_location.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_batched_point_location.h index 858b8f69486..2609eae0af3 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_batched_point_location.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_batched_point_location.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgArrangement2PointLocation +\ingroup PkgArrangementOnSurface2PointLocation Performs a batched point-location operation on a given arrangement. It accepts a range of query points, and locates each diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_circle_segment_traits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_circle_segment_traits_2.h index 886655a04b1..f375029fbca 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_circle_segment_traits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_circle_segment_traits_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgArrangement2TraitsClasses +\ingroup PkgArrangementOnSurface2TraitsClasses The class `Arr_circle_segment_traits_2` is a model of the `ArrangementTraits_2` concept and can be used to construct and maintain arrangements of circular arcs diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_circular_arc_traits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_circular_arc_traits_2.h index 75378bab3bf..d09dacf22b0 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_circular_arc_traits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_circular_arc_traits_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgArrangement2TraitsClasses +\ingroup PkgArrangementOnSurface2TraitsClasses This class is a traits class for \cgal arrangements, built on top of a model of concept `CircularKernel`. diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_circular_line_arc_traits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_circular_line_arc_traits_2.h index 417304ca2b0..6230d15e4c7 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_circular_line_arc_traits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_circular_line_arc_traits_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgArrangement2TraitsClasses +\ingroup PkgArrangementOnSurface2TraitsClasses This class is a traits class for \cgal arrangements, built on top of a model of concept `CircularKernel`. It provides curves that can be diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_conic_traits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_conic_traits_2.h index 92ba50dbb41..28803e7f8d5 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_conic_traits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_conic_traits_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgArrangement2TraitsClasses +\ingroup PkgArrangementOnSurface2TraitsClasses The class `Arr_conic_traits_2` is a model of the `ArrangementTraits_2` concept and can be used to construct and maintain arrangements of bounded segments of diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_consolidated_curve_data_traits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_consolidated_curve_data_traits_2.h index 4c939f85c5d..ab71d28ecc9 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_consolidated_curve_data_traits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_consolidated_curve_data_traits_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgArrangement2TraitsClasses +\ingroup PkgArrangementOnSurface2TraitsClasses The class `Arr_consolidated_curve_data_traits_2` is a model of the concept `ArrangementTraits_2`, and serves as a decorator class that enables the extension of the curve diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_curve_data_traits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_curve_data_traits_2.h index 8199dd7d2de..eb94a838578 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_curve_data_traits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_curve_data_traits_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgArrangement2TraitsClasses +\ingroup PkgArrangementOnSurface2TraitsClasses The class `Arr_curve_data_traits_2` is a model of the `ArrangementTraits_2` concept and serves as a decorator class that allows the extension of the curves diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_dcel_base.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_dcel_base.h index a95d96de7e2..da8b6d0e672 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_dcel_base.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_dcel_base.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgArrangement2DCEL +\ingroup PkgArrangementOnSurface2DCEL \anchor arr_refarr_dcel_base diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_default_dcel.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_default_dcel.h index 7de13a1b9f4..937f9961de5 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_default_dcel.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_default_dcel.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgArrangement2DCEL +\ingroup PkgArrangementOnSurface2DCEL The default Dcel class used by the `Arrangement_2` class-template is parameterized by a traits class, which is a model of the diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_default_overlay_traits.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_default_overlay_traits.h index 3f1dbdcddd2..e18a545236c 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_default_overlay_traits.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_default_overlay_traits.h @@ -2,8 +2,8 @@ namespace CGAL { /*! -\ingroup PkgArrangement2TraitsClasses -\ingroup PkgArrangement2Overlay +\ingroup PkgArrangementOnSurface2TraitsClasses +\ingroup PkgArrangementOnSurface2Overlay An instance of `Arr_default_overlay_traits` should be used for overlaying two arrangements of type `Arrangement` that store no auxiliary data with their Dcel records, where the resulting overlaid arrangement stores no auxiliary @@ -27,8 +27,8 @@ public: namespace CGAL { /*! -\ingroup PkgArrangement2TraitsClasses -\ingroup PkgArrangement2Overlay +\ingroup PkgArrangementOnSurface2TraitsClasses +\ingroup PkgArrangementOnSurface2Overlay An instance of `Arr_face_overlay_traits` should be used for overlaying two arrangements of types `Arr_A` and `Arr_B`, which are instantiated using the same diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_enums.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_enums.h index d7f2b535dc4..21fd0d44af6 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_enums.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_enums.h @@ -1,7 +1,7 @@ namespace CGAL { /*! - \ingroup PkgArrangement2Enums + \ingroup PkgArrangementOnSurface2Enums The enumeration `Arr_curve_end` is used to indicate one of the two ends of an \f$ x\f$-monotone curve. It is used by models of the `ArrangementOpenBoundaryTraits_2` concept. @@ -11,7 +11,7 @@ namespace CGAL { enum Arr_curve_end { ARR_MIN_END, ARR_MAX_END }; /*! - \ingroup PkgArrangement2Enums + \ingroup PkgArrangementOnSurface2Enums The enumeration `Arr_halfedge_direction` is defined by `CGAL::Arrangement_2::Halfedge` to specify @@ -22,32 +22,32 @@ enum Arr_curve_end { ARR_MIN_END, ARR_MAX_END }; enum Arr_halfedge_direction { ARR_LEFT_TO_RIGHT, ARR_RIGHT_TO_LEFT }; /*! - \ingroup PkgArrangement2Enums + \ingroup PkgArrangementOnSurface2Enums */ typedef Box_parameter_space_2 Arr_parameter_space; /*! - \ingroup PkgArrangement2Enums + \ingroup PkgArrangementOnSurface2Enums */ const Arr_parameter_space ARR_LEFT_BOUNDARY = LEFT_BOUNDARY; /*! - \ingroup PkgArrangement2Enums + \ingroup PkgArrangementOnSurface2Enums */ const Arr_parameter_space ARR_RIGHT_BOUNDARY = RIGHT_BOUNDARY; /*! - \ingroup PkgArrangement2Enums + \ingroup PkgArrangementOnSurface2Enums */ const Arr_parameter_space ARR_BOTTOM_BOUNDARY = BOTTOM_BOUNDARY; /*! - \ingroup PkgArrangement2Enums + \ingroup PkgArrangementOnSurface2Enums */ const Arr_parameter_space ARR_TOP_BOUNDARY = TOP_BOUNDARY; /*! - \ingroup PkgArrangement2Enums + \ingroup PkgArrangementOnSurface2Enums */ const Arr_parameter_space ARR_INTERIOR = INTERIOR; diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_extended_dcel.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_extended_dcel.h index 6fb986d3c09..8a948545117 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_extended_dcel.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_extended_dcel.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgArrangement2DCEL +\ingroup PkgArrangementOnSurface2DCEL The `Arr_extended_dcel` class-template extends the topological-features of the Dcel namely the vertex, halfedge, and face types. While it is possible to maintain @@ -51,7 +51,7 @@ class Arr_extended_dcel namespace CGAL { /*! -\ingroup PkgArrangement2DCEL +\ingroup PkgArrangementOnSurface2DCEL The `Arr_extended_face` class-template extends the face topological-features of the Dcel. It is parameterized by a face base-type `FaceBase` and a data type @@ -103,7 +103,7 @@ void set_data (const FData & data); namespace CGAL { /*! -\ingroup PkgArrangement2DCEL +\ingroup PkgArrangementOnSurface2DCEL The `Arr_extended_halfedge` class-template extends the halfedge topological-features of the Dcel. It is parameterized by a halfedge base-type `HalfedgeBase` @@ -155,7 +155,7 @@ void set_data (const HData & data); namespace CGAL { /*! -\ingroup PkgArrangement2DCEL +\ingroup PkgArrangementOnSurface2DCEL The `Arr_extended_vertex` class-template extends the vertex topological-features of the Dcel. It is parameterized by a @@ -208,7 +208,7 @@ void set_data (const VData & data); namespace CGAL { /*! -\ingroup PkgArrangement2DCEL +\ingroup PkgArrangementOnSurface2DCEL The `Arr_face_extended_dcel` class-template extends the Dcel face-records, making it possible to store extra (non-geometric) data with the arrangement faces. diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_face_index_map.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_face_index_map.h index c816ecd0a52..cf9c1573702 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_face_index_map.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_face_index_map.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgArrangement2 +\ingroup PkgArrangementOnSurface2Ref `Arr_face_index_map` maintains a mapping of face handles of an attached arrangement object to indices (of type `unsigned int`). diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_landmarks_point_location.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_landmarks_point_location.h index e97890e2da3..95c33d975ab 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_landmarks_point_location.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_landmarks_point_location.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgArrangement2PointLocation +\ingroup PkgArrangementOnSurface2PointLocation \anchor arr_reflm_pl diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_line_arc_traits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_line_arc_traits_2.h index 9bab6950c32..8dbf2b4fac5 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_line_arc_traits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_line_arc_traits_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgArrangement2TraitsClasses +\ingroup PkgArrangementOnSurface2TraitsClasses This class is a traits class for \cgal arrangements, built on top of a model of concept `CircularKernel`. It provides curves of type diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_linear_traits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_linear_traits_2.h index b996a3cd03b..4b6227ec31b 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_linear_traits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_linear_traits_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! - \ingroup PkgArrangement2TraitsClasses + \ingroup PkgArrangementOnSurface2TraitsClasses The traits class `Arr_linear_traits_2` is a model of the `ArrangementTraits_2` concept, which enables the construction and maintenance of arrangements of @@ -35,7 +35,7 @@ public: The `Curve_2` (and the `X_monotone_curve_2`) class nested within the linear-traits can represent all types of linear objects. The class supports the copy and default constructor and the assignment operator. - In addition, the \link PkgArrangement2op_left_shift `operator<<` \endlink and \link PkgArrangement2op_right_shift `operator>>` \endlink for linear objects + In addition, the \link PkgArrangementOnSurface2op_left_shift `operator<<` \endlink and \link PkgArrangementOnSurface2op_right_shift `operator>>` \endlink for linear objects are defined for standard output and input streams. */ class Curve_2 { diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_naive_point_location.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_naive_point_location.h index 490b967a9ca..4cb06ddf4a6 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_naive_point_location.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_naive_point_location.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgArrangement2PointLocation +\ingroup PkgArrangementOnSurface2PointLocation \anchor arr_refnaive_pl diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_non_caching_segment_basic_traits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_non_caching_segment_basic_traits_2.h index 2e46a442dcd..64dc43330f2 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_non_caching_segment_basic_traits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_non_caching_segment_basic_traits_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgArrangement2TraitsClasses +\ingroup PkgArrangementOnSurface2TraitsClasses The traits class `Arr_non_caching_segment_basic_traits_2` is a model of the `ArrangementTraits_2` concept that allow the construction and maintenance of arrangements of diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_non_caching_segment_traits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_non_caching_segment_traits_2.h index 8fee24bbcf7..2262120d70c 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_non_caching_segment_traits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_non_caching_segment_traits_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgArrangement2TraitsClasses +\ingroup PkgArrangementOnSurface2TraitsClasses The traits class `Arr_non_caching_segment_traits_2` is a model of the `ArrangementTraits_2` concept that allows the construction and maintenance of arrangements of diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_observer.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_observer.h index 20c9cfbecb7..cc860dbf95b 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_observer.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_observer.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgArrangement2 +\ingroup PkgArrangementOnSurface2Ref \anchor arr_refarr_obs diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_overlay_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_overlay_2.h index 540867ed058..80c4a062c1c 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_overlay_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_overlay_2.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgArrangement2Funcs +\ingroup PkgArrangementOnSurface2Funcs \brief Computes the overlay of two arrangements `arr1` and `arr2`, and sets the output arrangement `res` to represent the overlaid arrangement. @@ -35,7 +35,7 @@ void overlay (const Arrangement_2& arr1, OverlayTraits& ovl_tr); /*! -\ingroup PkgArrangement2Funcs +\ingroup PkgArrangementOnSurface2Funcs \brief Computes the overlay of two arrangements with history `arr1` and `arr2`, and sets the output arrangement with history `res` to represent the overlaid arrangement. The function also constructs a diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_point_location_result.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_point_location_result.h index 4990a399fa3..20a6787d7e5 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_point_location_result.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_point_location_result.h @@ -1,5 +1,5 @@ /*! -\ingroup PkgArrangement2PointLocation +\ingroup PkgArrangementOnSurface2PointLocation The macro `CGAL_ARR_POINT_LOCATION_VERSION` can be used to configure the point-location query API. In particular, it determines which version @@ -24,7 +24,7 @@ is included. namespace CGAL { /*! -\ingroup PkgArrangement2PointLocation +\ingroup PkgArrangementOnSurface2PointLocation A unary metafunction to determine the return type of a point-location or vertical ray-shoot query. diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_polycurve_traits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_polycurve_traits_2.h index 5fb8b3fb479..f53f8db1978 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_polycurve_traits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_polycurve_traits_2.h @@ -1,4 +1,4 @@ -/// \ingroup PkgArrangement2Macros +/// \ingroup PkgArrangementOnSurface2Macros /// @{ /*! * If the macro is set to one, then \f$x\f$-monotone curves are always @@ -8,7 +8,7 @@ /// @} namespace CGAL { - /*! \ingroup PkgArrangement2TraitsClasses + /*! \ingroup PkgArrangementOnSurface2TraitsClasses * * Note: The `SubcurveTraits_2` can comprise of Line_segments, Conic_arcs, * Circular_arc, Bezier_curves, or Linear_curves. A portion or a part @@ -280,9 +280,9 @@ namespace CGAL { * * The copy and default constructor as well as the assignment operator are * provided for polycurve subcurves. In addition, an \link - * PkgArrangement2op_left_shift `operator<<` \endlink for the subcurves is + * PkgArrangementOnSurface2op_left_shift `operator<<` \endlink for the subcurves is * defined for standard output streams, and an \link - * PkgArrangement2op_right_shift `operator>>` \endlink for the subcurves is + * PkgArrangementOnSurface2op_right_shift `operator>>` \endlink for the subcurves is * defined for standard input streams. */ template diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_polyline_traits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_polyline_traits_2.h index c4d3e697598..02116bc74e8 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_polyline_traits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_polyline_traits_2.h @@ -1,4 +1,4 @@ -/// \ingroup PkgArrangement2Macros +/// \ingroup PkgArrangementOnSurface2Macros /// @{ /*! * If the macro is set to one, then \f$x\f$-monotone curves are always @@ -8,7 +8,7 @@ /// @} namespace CGAL { - /*! \ingroup PkgArrangement2TraitsClasses + /*! \ingroup PkgArrangementOnSurface2TraitsClasses * * The traits class `Arr_polyline_traits_2` handles piecewise linear * curves, commonly referred to as polylines. Each polyline is a diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_rational_function_traits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_rational_function_traits_2.h index db330187157..5979b9b07c0 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_rational_function_traits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_rational_function_traits_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! - \ingroup PkgArrangement2TraitsClasses + \ingroup PkgArrangementOnSurface2TraitsClasses The traits class `Arr_rational_function_traits_2` is a model of the `ArrangementTraits_2` concept. It handles bounded and unbounded arcs of rational functions, diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_segment_traits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_segment_traits_2.h index ca23407fcb3..f085e4da39c 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_segment_traits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_segment_traits_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgArrangement2TraitsClasses +\ingroup PkgArrangementOnSurface2TraitsClasses The traits class `Arr_segment_traits_2` is a model of the `ArrangementTraits_2` concept, which allows the construction and maintenance of arrangements of diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_tags.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_tags.h index a70bc00be76..302a0fc6109 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_tags.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_tags.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgArrangement2Tags +\ingroup PkgArrangementOnSurface2Tags The categories `Left_side_category`, `Right_side_category`, `Bottom_side_category`, and `Top_side_category`, @@ -26,7 +26,7 @@ struct Arr_oblivious_side_tag { namespace CGAL { /*! -\ingroup PkgArrangement2Tags +\ingroup PkgArrangementOnSurface2Tags All the four types `Left_side_category`, `Right_side_category`, `Bottom_side_category`, diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_trapezoid_ric_point_location.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_trapezoid_ric_point_location.h index d80fdf954fe..1e018c044df 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_trapezoid_ric_point_location.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_trapezoid_ric_point_location.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgArrangement2PointLocation +\ingroup PkgArrangementOnSurface2PointLocation \anchor arr_reftrap_pl diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_vertex_index_map.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_vertex_index_map.h index c00dd12499a..0320001321b 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_vertex_index_map.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_vertex_index_map.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgArrangement2 +\ingroup PkgArrangementOnSurface2Ref `Arr_vertex_index_map` maintains a mapping of vertex handles of an attached arrangement object to indices (of type `unsigned int`). diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_vertical_decomposition_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_vertical_decomposition_2.h index e9fa5a62091..e0f4dbb918c 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_vertical_decomposition_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_vertical_decomposition_2.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgArrangement2Funcs +\ingroup PkgArrangementOnSurface2Funcs Produces the symbolic vertical decomposition of a given arrangement, performing a batched vertical ray-shooting query from diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_walk_along_line_point_location.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_walk_along_line_point_location.h index 4037b4030ec..7add7e4718f 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_walk_along_line_point_location.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_walk_along_line_point_location.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgArrangement2PointLocation +\ingroup PkgArrangementOnSurface2PointLocation \anchor arr_refwalk_pl diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arrangement_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arrangement_2.h index 277ddf71eca..11e3bdf9159 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arrangement_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arrangement_2.h @@ -1,7 +1,7 @@ namespace CGAL { /*! - \ingroup PkgArrangement2 + \ingroup PkgArrangementOnSurface2Ref \anchor arr_refarr @@ -36,7 +36,7 @@ namespace CGAL { Insertion Functions - \sa `PkgArrangement2Insert` + \sa `PkgArrangementOnSurface2Insert` \sa `CGAL::insert_non_intersecting_curve()` \sa `CGAL::insert_non_intersecting_curves()` \sa `CGAL::insert_point()` @@ -48,8 +48,8 @@ namespace CGAL { Input/output functions - \sa `PkgArrangement2Read` - \sa `PkgArrangement2Write` + \sa `PkgArrangementOnSurface2Read` + \sa `PkgArrangementOnSurface2Write` */ template< typename Traits, typename Dcel > @@ -91,7 +91,7 @@ public: typedef typename Dcel::Size Size; /*! - \ingroup PkgArrangement2DCEL + \ingroup PkgArrangementOnSurface2DCEL An object \f$ v\f$ of the class `Vertex` represents an arrangement vertex, that is - a \f$ 0\f$-dimensional cell, associated with a point on the plane. */ @@ -168,7 +168,7 @@ public: }; /* end Vertex */ /*! - \ingroup PkgArrangement2DCEL + \ingroup PkgArrangementOnSurface2DCEL An object \f$ e\f$ of the class `Halfedge` represents a halfedge in the arrangement. A halfedge is directed from its source vertex to its target vertex, and has an incident face lying to @@ -263,7 +263,7 @@ public: }; /* end Halfedge */ /*! - \ingroup PkgArrangement2DCEL + \ingroup PkgArrangementOnSurface2DCEL An object of the class `Face` represents an arrangement face, namely, a \f$ 2\f$-dimensional arrangement cell. An arrangement that supports @@ -994,7 +994,7 @@ edge, we first need to cast away its "constness". namespace CGAL { /*! - \ingroup PkgArrangement2Insert insert + \ingroup PkgArrangementOnSurface2Insert insert The function `%insert` inserts one or more curves or \f$ x\f$-monotone curves into a given arrangement, where no restrictions are imposed on the inserted curves. If an inserted curve is not \f$ x\f$-monotone curve, it is subdivided @@ -1065,7 +1065,7 @@ void insert (Arrangement_2& arr, /// @} /*! - \ingroup PkgArrangement2Funcs + \ingroup PkgArrangementOnSurface2Funcs Checks if a given curve or \f$ x\f$-monotone curve intersects an existing arrangement's edges or vertices. @@ -1111,7 +1111,7 @@ bool do_intersect ( /*! - \ingroup PkgArrangement2Funcs + \ingroup PkgArrangementOnSurface2Funcs Inserts a given \f$ x\f$-monotone curve into a given arrangement, where the interior of the given curve is disjoint from all @@ -1149,7 +1149,7 @@ insert_non_intersecting_curve (Arrangement_2& arr, /*! - \ingroup PkgArrangement2Funcs + \ingroup PkgArrangementOnSurface2Funcs Inserts a set of \f$ x\f$-monotone curves in a given range into a given arrangement. The insertion is performed in an aggregated @@ -1172,7 +1172,7 @@ void insert_non_intersecting_curves(Arrangement_2& arr, /*! - \ingroup PkgArrangement2Funcs + \ingroup PkgArrangementOnSurface2Funcs Inserts a given point into a given arrangement. It uses a given point-location object to locate the given @@ -1210,7 +1210,7 @@ insert_point (Arrangement_2& arr, /*! - \ingroup PkgArrangement2Funcs + \ingroup PkgArrangementOnSurface2Funcs Checks the validity of a given arrangement. @@ -1234,7 +1234,7 @@ bool is_valid (const Arrangement_2& arr); /*! - \ingroup PkgArrangement2Funcs + \ingroup PkgArrangementOnSurface2Funcs Removes an edge given by one of the twin halfedges that forms it, from a given arrangement. Once the edge is removed, if the @@ -1266,7 +1266,7 @@ remove_edge (Arrangement_2& arr, /*! - \ingroup PkgArrangement2Funcs + \ingroup PkgArrangementOnSurface2Funcs Attempts to removed a given vertex from a given arrangement. The vertex can be removed if it is either an isolated vertex, @@ -1291,7 +1291,7 @@ bool remove_vertex (Arrangement_2& arr, typename Arrangement_2::Vertex_handle v); /*! - \ingroup PkgArrangement2Funcs + \ingroup PkgArrangementOnSurface2Funcs Compute the zone of the given \f$ x\f$-monotone curve in the existing arrangement. Meaning, it output the diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arrangement_with_history_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arrangement_with_history_2.h index 7afef234acc..7c05c5c9ddc 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arrangement_with_history_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arrangement_with_history_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgArrangement2 +\ingroup PkgArrangementOnSurface2Ref \anchor arr_refarr_with_hist @@ -274,7 +274,7 @@ bool remove_target = true); }; /* end Arrangement_with_history_2 */ /*! -\ingroup PkgArrangement2Insert +\ingroup PkgArrangementOnSurface2Insert Inserts the given curve `c` into the arrangement with history `arr`, and returns a handle to the inserted curve. `c` is subdivided into @@ -297,7 +297,7 @@ insert (Arrangement_with_history_2& arr, const PointLocation& pl = walk_pl); /*! -\ingroup PkgArrangement2Insert +\ingroup PkgArrangementOnSurface2Insert Aggregately inserts the curves in the range `[first,last)` into the arrangement with history `arr` using the sweep-line framework. @@ -308,7 +308,7 @@ void insert(Arrangement_with_history_2& arr, /*! -\ingroup PkgArrangement2Funcs +\ingroup PkgArrangementOnSurface2Funcs Removes a given curve from a given arrangement. @@ -323,7 +323,7 @@ Size remove_curve (Arrangement_with_history_2& arr, /*! -\addtogroup PkgArrangement2Overlay +\addtogroup PkgArrangementOnSurface2Overlay Computes the overlay of two arrangements with history `arr1` and `arr2`, and sets the output arrangement with history `res` to @@ -340,7 +340,7 @@ void overlay (const Arrangement_with_history_2& arr1, /*! -\addtogroup PkgArrangement2Overlay +\addtogroup PkgArrangementOnSurface2Overlay Computes the (simple) overlay of two arrangements with history `arr1` and `arr2`, and sets the output arrangement with history `res` to diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/IO/Arr_iostream.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/IO/Arr_iostream.h index 672245e5d6c..413b1cd5c3f 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/IO/Arr_iostream.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/IO/Arr_iostream.h @@ -1,7 +1,7 @@ namespace CGAL { /*! - \defgroup PkgArrangement2Read CGAL::read() - \ingroup PkgArrangement2IO + \defgroup PkgArrangementOnSurface2Read CGAL::read() + \ingroup PkgArrangementOnSurface2IO Reads a given arrangement from a given input stream using a specific input format. @@ -16,11 +16,11 @@ using a specific input format. -\sa `PkgArrangement2Write` +\sa `PkgArrangementOnSurface2Write` -\sa `PkgArrangement2op_left_shift` -\sa `PkgArrangement2op_right_shift` +\sa `PkgArrangementOnSurface2op_left_shift` +\sa `PkgArrangementOnSurface2op_right_shift` */ /// @{ @@ -37,8 +37,8 @@ std::istream& read (Arrangement_2& arr, /// @} /*! - \defgroup PkgArrangement2Write CGAL::write() - \ingroup PkgArrangement2IO + \defgroup PkgArrangementOnSurface2Write CGAL::write() + \ingroup PkgArrangementOnSurface2IO Writes a given arrangement into a given output stream using a specific output format. @@ -52,9 +52,9 @@ using a specific output format. `ArrangementWithHistoryOutputFormatter` concept. -\sa `PkgArrangement2Read` -\sa `PkgArrangement2op_left_shift` -\sa `PkgArrangement2op_right_shift` +\sa `PkgArrangementOnSurface2Read` +\sa `PkgArrangementOnSurface2op_left_shift` +\sa `PkgArrangementOnSurface2op_right_shift` */ /// @{ @@ -70,7 +70,7 @@ std::ostream& write (const Arrangement_2& arr, /// @} /*! -\ingroup PkgArrangement2op_left_shift +\ingroup PkgArrangementOnSurface2op_left_shift Inserts the arrangement object `arr` into the output stream `os` using the output format defined by the `Arr_text_formatter` class. Only the basic geometric and @@ -83,7 +83,7 @@ std::ostream& operator<< (std::ostream& os, /*! -\ingroup PkgArrangement2op_right_shift +\ingroup PkgArrangementOnSurface2op_right_shift Extracts an arrangement from a given input stream using the input format defined by the `Arr_text_formatter` class - that is, only the basic geometric and topological features of the arrangement are read diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/IO/Arr_text_formatter.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/IO/Arr_text_formatter.h index d3dadb9330d..28dd3ecb888 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/IO/Arr_text_formatter.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/IO/Arr_text_formatter.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgArrangement2IO +\ingroup PkgArrangementOnSurface2IO `Arr_extended_dcel_text_formatter` defines the format of an arrangement in an input or output stream (typically a file stream), thus enabling reading and writing an `Arrangement` @@ -21,8 +21,8 @@ the `<<` operator and read from an input stream using the `>>` operator. \cgalModels `ArrangementInputFormatter` \cgalModels `ArrangementOutputFormatter` -\sa `PkgArrangement2Read` -\sa `PkgArrangement2Write` +\sa `PkgArrangementOnSurface2Read` +\sa `PkgArrangementOnSurface2Write` \sa `Arr_extended_dcel` */ @@ -38,7 +38,7 @@ public: namespace CGAL { /*! -\ingroup PkgArrangement2IO +\ingroup PkgArrangementOnSurface2IO `Arr_face_extended_text_formatter` defines the format of an arrangement in an input or output stream (typically a file stream), thus enabling reading and writing an `Arrangement` @@ -55,8 +55,8 @@ can all be written to an input stream using the `<<` operator and read from an i \cgalModels `ArrangementInputFormatter` \cgalModels `ArrangementOutputFormatter` -\sa `PkgArrangement2Read` -\sa `PkgArrangement2Write` +\sa `PkgArrangementOnSurface2Read` +\sa `PkgArrangementOnSurface2Write` \sa `Arr_face_extended_dcel` */ @@ -72,7 +72,7 @@ public: namespace CGAL { /*! -\ingroup PkgArrangement2IO +\ingroup PkgArrangementOnSurface2IO `Arr_text_formatter` defines the format of an arrangement in an input or output stream (typically a file stream), thus enabling reading and writing an `Arrangement` @@ -88,8 +88,8 @@ operator. \cgalModels `ArrangementInputFormatter` \cgalModels `ArrangementOutputFormatter` -\sa `PkgArrangement2Read` -\sa `PkgArrangement2Write` +\sa `PkgArrangementOnSurface2Read` +\sa `PkgArrangementOnSurface2Write` */ template< typename Arrangement > diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/IO/Arr_with_history_iostream.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/IO/Arr_with_history_iostream.h index 9732ee484c9..4f6deac2550 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/IO/Arr_with_history_iostream.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/IO/Arr_with_history_iostream.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgArrangement2Read +\ingroup PkgArrangementOnSurface2Read Reads the arrangement-with-history object `arr` from the given input stream `is` using a specific input format defined by @@ -15,7 +15,7 @@ std::istream& read (Arrangement_with_history_2& arr, WithHistoryFormatter& formatter); /*! -\ingroup PkgArrangement2Write +\ingroup PkgArrangementOnSurface2Write Writes the arrangement-with-history object `arr` into the given output stream `os` using a specific output format defined by `formatter`. @@ -27,7 +27,7 @@ std::ostream& write (const Arrangement_with_history_2& arr, WithHistoryFormatter& formatter); /*! -\ingroup PkgArrangement2op_left_shift +\ingroup PkgArrangementOnSurface2op_left_shift Inserts the arrangement-with-history object `arr` into the output stream `os` using the output format defined by the `Arr_with_history_text_formatter` class. Only the basic geometric @@ -39,7 +39,7 @@ std::ostream& operator<< (std::ostream& os, const Arrangement_with_history_2& arr); /*! -\ingroup PkgArrangement2op_right_shift +\ingroup PkgArrangementOnSurface2op_right_shift Extracts an arrangement-with-history from a given input stream using the default input format. */ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/IO/Arr_with_history_text_formatter.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/IO/Arr_with_history_text_formatter.h index 3af4fa40bd9..8d6bef1eb55 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/IO/Arr_with_history_text_formatter.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/IO/Arr_with_history_text_formatter.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgArrangement2IO +\ingroup PkgArrangementOnSurface2IO `Arr_with_history_text_formatter` defines the format of an arrangement in an input or output stream (typically a file stream), thus enabling reading and writing an @@ -18,8 +18,8 @@ relations between these curves and the edges they induce. \cgalModels `ArrangementWithHistoryInputFormatter` \cgalModels `ArrangementWithHistoryOutputFormatter` -\sa `PkgArrangement2Read` -\sa `PkgArrangement2Write` +\sa `PkgArrangementOnSurface2Read` +\sa `PkgArrangementOnSurface2Write` */ template< typename ArrFormatter > diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Approximate_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Approximate_2.h index 99a57c2cf9b..febcd691b52 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Approximate_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Approximate_2.h @@ -1,6 +1,6 @@ namespace ArrTraits { /*! -\ingroup PkgArrangement2ConceptsFunctionObjects +\ingroup PkgArrangementOnSurface2ConceptsFunctionObjects \cgalConcept \cgalRefines Functor diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--AreMergeable_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--AreMergeable_2.h index 64a975b195a..4cc4209c9ee 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--AreMergeable_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--AreMergeable_2.h @@ -1,6 +1,6 @@ namespace ArrTraits { /*! -\ingroup PkgArrangement2ConceptsFunctionObjects +\ingroup PkgArrangementOnSurface2ConceptsFunctionObjects \cgalConcept \cgalRefines Functor diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareXAtLimit_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareXAtLimit_2.h index b5c727aee88..f0ee218e830 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareXAtLimit_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareXAtLimit_2.h @@ -1,6 +1,6 @@ namespace ArrTraits { /*! -\ingroup PkgArrangement2ConceptsFunctionObjects +\ingroup PkgArrangementOnSurface2ConceptsFunctionObjects \cgalConcept \cgalRefines AdaptableFunctor diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareXNearLimit_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareXNearLimit_2.h index e3c56fbeadb..d31605b4134 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareXNearLimit_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareXNearLimit_2.h @@ -1,6 +1,6 @@ namespace ArrTraits { /*! -\ingroup PkgArrangement2ConceptsFunctionObjects +\ingroup PkgArrangementOnSurface2ConceptsFunctionObjects \cgalConcept \cgalRefines AdaptableTernaryFunction diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareX_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareX_2.h index 1cf927c57c5..42b5df88346 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareX_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareX_2.h @@ -1,6 +1,6 @@ namespace ArrTraits { /*! -\ingroup PkgArrangement2ConceptsFunctionObjects +\ingroup PkgArrangementOnSurface2ConceptsFunctionObjects \cgalConcept \cgalRefines AdaptableBinaryFunction diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareXy_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareXy_2.h index bd348bc85fb..cd8d99eb7b1 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareXy_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareXy_2.h @@ -1,6 +1,6 @@ namespace ArrTraits { /*! -\ingroup PkgArrangement2ConceptsFunctionObjects +\ingroup PkgArrangementOnSurface2ConceptsFunctionObjects \cgalConcept \cgalRefines AdaptableBinaryFunction diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareYAtXLeft_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareYAtXLeft_2.h index 5d06d07c143..345a6ca3321 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareYAtXLeft_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareYAtXLeft_2.h @@ -1,6 +1,6 @@ namespace ArrTraits { /*! -\ingroup PkgArrangement2ConceptsFunctionObjects +\ingroup PkgArrangementOnSurface2ConceptsFunctionObjects \cgalConcept \cgalRefines AdaptableTernaryFunction diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareYAtXRight_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareYAtXRight_2.h index fb3d4fa9596..07f072fc259 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareYAtXRight_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareYAtXRight_2.h @@ -1,6 +1,6 @@ namespace ArrTraits { /*! -\ingroup PkgArrangement2ConceptsFunctionObjects +\ingroup PkgArrangementOnSurface2ConceptsFunctionObjects \cgalConcept \cgalRefines AdaptableTernaryFunction diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareYAtX_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareYAtX_2.h index a2cb53b38ef..408e62f4a96 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareYAtX_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareYAtX_2.h @@ -1,6 +1,6 @@ namespace ArrTraits { /*! -\ingroup PkgArrangement2ConceptsFunctionObjects +\ingroup PkgArrangementOnSurface2ConceptsFunctionObjects \cgalConcept \cgalRefines AdaptableBinaryFunction diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareYNearBoundary_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareYNearBoundary_2.h index dd7f31a06c7..cea0b16d712 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareYNearBoundary_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareYNearBoundary_2.h @@ -1,6 +1,6 @@ namespace ArrTraits { /*! -\ingroup PkgArrangement2ConceptsFunctionObjects +\ingroup PkgArrangementOnSurface2ConceptsFunctionObjects \cgalConcept \cgalRefines AdaptableTernaryFunction diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--ConstructMaxVertex_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--ConstructMaxVertex_2.h index b145d3c9163..629396f9563 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--ConstructMaxVertex_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--ConstructMaxVertex_2.h @@ -1,6 +1,6 @@ namespace ArrTraits { /*! -\ingroup PkgArrangement2ConceptsFunctionObjects +\ingroup PkgArrangementOnSurface2ConceptsFunctionObjects \cgalConcept \cgalRefines AdaptableUnaryFunction diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--ConstructMinVertex_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--ConstructMinVertex_2.h index caef26fe71e..7bd2ddee785 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--ConstructMinVertex_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--ConstructMinVertex_2.h @@ -1,6 +1,6 @@ namespace ArrTraits { /*! -\ingroup PkgArrangement2ConceptsFunctionObjects +\ingroup PkgArrangementOnSurface2ConceptsFunctionObjects \cgalConcept \cgalRefines AdaptableUnaryFunction diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--ConstructXMonotoneCurve_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--ConstructXMonotoneCurve_2.h index 0c0597fd01a..0ba63096c36 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--ConstructXMonotoneCurve_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--ConstructXMonotoneCurve_2.h @@ -1,6 +1,6 @@ namespace ArrTraits { /*! -\ingroup PkgArrangement2ConceptsFunctionObjects +\ingroup PkgArrangementOnSurface2ConceptsFunctionObjects \cgalConcept \cgalRefines Functor diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Curve_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Curve_2.h index 8681b27b9a9..5677896e1d9 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Curve_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Curve_2.h @@ -1,6 +1,6 @@ namespace ArrTraits { /*! -\ingroup PkgArrangement2ConceptsGeometricObjects +\ingroup PkgArrangementOnSurface2ConceptsGeometricObjects \cgalConcept represents a general planar curve. diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Equal_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Equal_2.h index dcdcda5577e..6c3362ddc53 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Equal_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Equal_2.h @@ -1,6 +1,6 @@ namespace ArrTraits { /*! -\ingroup PkgArrangement2ConceptsFunctionObjects +\ingroup PkgArrangementOnSurface2ConceptsFunctionObjects \cgalConcept \cgalRefines AdaptableBinaryFunction diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Intersect_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Intersect_2.h index f97f43d645b..0c73d061273 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Intersect_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Intersect_2.h @@ -1,6 +1,6 @@ namespace ArrTraits { /*! -\ingroup PkgArrangement2ConceptsFunctionObjects +\ingroup PkgArrangementOnSurface2ConceptsFunctionObjects \cgalConcept \cgalRefines Functor diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--IsVertical_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--IsVertical_2.h index 84ffa9194af..31f0655630e 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--IsVertical_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--IsVertical_2.h @@ -1,6 +1,6 @@ namespace ArrTraits { /*! -\ingroup PkgArrangement2ConceptsFunctionObjects +\ingroup PkgArrangementOnSurface2ConceptsFunctionObjects \cgalConcept \cgalRefines AdaptableUnaryFunction diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--MakeXMonotone_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--MakeXMonotone_2.h index 24b8fb60472..508d65ba14e 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--MakeXMonotone_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--MakeXMonotone_2.h @@ -1,6 +1,6 @@ namespace ArrTraits { /*! -\ingroup PkgArrangement2ConceptsFunctionObjects +\ingroup PkgArrangementOnSurface2ConceptsFunctionObjects \cgalConcept \cgalRefines Functor diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Merge_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Merge_2.h index a48b8132e17..88ad38a680d 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Merge_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Merge_2.h @@ -1,6 +1,6 @@ namespace ArrTraits { /*! -\ingroup PkgArrangement2ConceptsFunctionObjects +\ingroup PkgArrangementOnSurface2ConceptsFunctionObjects \cgalConcept \cgalRefines Functor diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--ParameterSpaceInX_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--ParameterSpaceInX_2.h index 58934f055f2..6655ac19aab 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--ParameterSpaceInX_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--ParameterSpaceInX_2.h @@ -1,6 +1,6 @@ namespace ArrTraits { /*! -\ingroup PkgArrangement2ConceptsFunctionObjects +\ingroup PkgArrangementOnSurface2ConceptsFunctionObjects \cgalConcept \cgalRefines AdaptableBinaryFunction diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--ParameterSpaceInY_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--ParameterSpaceInY_2.h index 71343fe93b3..f80e3738499 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--ParameterSpaceInY_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--ParameterSpaceInY_2.h @@ -1,6 +1,6 @@ namespace ArrTraits { /*! -\ingroup PkgArrangement2ConceptsFunctionObjects +\ingroup PkgArrangementOnSurface2ConceptsFunctionObjects \cgalConcept \cgalRefines AdaptableBinaryFunction diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Point_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Point_2.h index 3e443059d80..1da395e23fa 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Point_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Point_2.h @@ -1,6 +1,6 @@ namespace ArrTraits { /*! -\ingroup PkgArrangement2ConceptsGeometricObjects +\ingroup PkgArrangementOnSurface2ConceptsGeometricObjects \cgalConcept Represents a point in the plane. diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Split_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Split_2.h index 50e6850ca7a..f6ba2f33ce7 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Split_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Split_2.h @@ -1,6 +1,6 @@ namespace ArrTraits { /*! -\ingroup PkgArrangement2ConceptsFunctionObjects +\ingroup PkgArrangementOnSurface2ConceptsFunctionObjects \cgalConcept \cgalRefines Functor diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--XMonotoneCurve_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--XMonotoneCurve_2.h index 78f421f2761..c2d1919c061 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--XMonotoneCurve_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--XMonotoneCurve_2.h @@ -1,6 +1,6 @@ namespace ArrTraits { /*! -\ingroup PkgArrangement2ConceptsGeometricObjects +\ingroup PkgArrangementOnSurface2ConceptsGeometricObjects \cgalConcept Represents a planar (weakly) \f$ x\f$-monotone curve. diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementApproximateTraits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementApproximateTraits_2.h index 589bc03c6f7..080f03082e9 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementApproximateTraits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementApproximateTraits_2.h @@ -1,5 +1,5 @@ /*! -\ingroup PkgArrangement2ConceptsTraits +\ingroup PkgArrangementOnSurface2ConceptsTraits \cgalConcept The concept `ArrangementApproximateTraits_2` refines the basic traits concept diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementBasicTraits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementBasicTraits_2.h index d65c174a8d0..fc7a2064e0c 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementBasicTraits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementBasicTraits_2.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgArrangement2ConceptsTraits +\ingroup PkgArrangementOnSurface2ConceptsTraits \cgalConcept The concept `ArrangementBasicTraits_2` defines the minimal set of geometric diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementConstructXMonotoneCurveTraits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementConstructXMonotoneCurveTraits_2.h index 7d68ce1da70..2a88611de6c 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementConstructXMonotoneCurveTraits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementConstructXMonotoneCurveTraits_2.h @@ -1,5 +1,5 @@ /*! -\ingroup PkgArrangement2ConceptsTraits +\ingroup PkgArrangementOnSurface2ConceptsTraits \cgalConcept The concept `ArrangementConstructXMonotoneCurveTraits_2` refines the basic diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcel.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcel.h index e6871287595..63c36749172 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcel.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcel.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgArrangement2ConceptsDCEL +\ingroup PkgArrangementOnSurface2ConceptsDCEL \cgalConcept A doubly-connected edge-list (Dcel for short) data-structure. It consists diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelFace.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelFace.h index 697dce33463..c8a8b03197b 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelFace.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelFace.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgArrangement2ConceptsDCEL +\ingroup PkgArrangementOnSurface2ConceptsDCEL \cgalConcept A face record in a Dcel data structure. A face may either be unbounded, diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelHalfedge.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelHalfedge.h index d5e581284bc..87d84acd8e9 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelHalfedge.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelHalfedge.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgArrangement2ConceptsDCEL +\ingroup PkgArrangementOnSurface2ConceptsDCEL \cgalConcept A halfedge record in a Dcel data structure. Two halfedges with opposite diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelHole.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelHole.h index c20aaf0e1ea..9e629686a6c 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelHole.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelHole.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgArrangement2ConceptsDCEL +\ingroup PkgArrangementOnSurface2ConceptsDCEL \cgalConcept A hole record in a Dcel data structure, which stores the face that contains diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelIsolatedVertex.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelIsolatedVertex.h index 045be05776a..8d0a84e227d 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelIsolatedVertex.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelIsolatedVertex.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgArrangement2ConceptsDCEL +\ingroup PkgArrangementOnSurface2ConceptsDCEL \cgalConcept An isolated vertex-information record in a Dcel data structure, which stores diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelVertex.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelVertex.h index 1dfbfcfe5df..a78a11eb1a2 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelVertex.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelVertex.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgArrangement2ConceptsDCEL +\ingroup PkgArrangementOnSurface2ConceptsDCEL \cgalConcept A vertex record in a Dcel data structure. A vertex is always associated diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelWithRebind.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelWithRebind.h index 392bc80c412..fa8b7abdae5 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelWithRebind.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelWithRebind.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgArrangement2ConceptsDCEL +\ingroup PkgArrangementOnSurface2ConceptsDCEL \cgalConcept The concept `ArrangementDcelWithRebind` refines the `ArrangementDcel` concept by adding diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementInputFormatter.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementInputFormatter.h index fac833d4a6c..5ca8cb4460c 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementInputFormatter.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementInputFormatter.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgArrangement2Concepts +\ingroup PkgArrangementOnSurface2Concepts \cgalConcept A model for the `ArrangementInputFormatter` concept supports a set of functions that enable diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementLandmarkTraits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementLandmarkTraits_2.h index 65141423bc5..6aa8a1457cc 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementLandmarkTraits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementLandmarkTraits_2.h @@ -1,5 +1,5 @@ /*! -\ingroup PkgArrangement2ConceptsTraits +\ingroup PkgArrangementOnSurface2ConceptsTraits \cgalConcept The concept `ArrangementLandmarkTraits_2` refines the traits concepts diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementOpenBoundaryTraits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementOpenBoundaryTraits_2.h index cfe6553ece6..a1366fb094f 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementOpenBoundaryTraits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementOpenBoundaryTraits_2.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgArrangement2ConceptsTraits +\ingroup PkgArrangementOnSurface2ConceptsTraits \cgalConcept Several predicates are required to handle \f$ x\f$-monotone curves that diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementOutputFormatter.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementOutputFormatter.h index 92649fbb1a1..03206537718 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementOutputFormatter.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementOutputFormatter.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgArrangement2Concepts +\ingroup PkgArrangementOnSurface2Concepts \cgalConcept A model for the `ArrangementOutputFormatter` concept supports a set of functions that enable diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementPointLocation_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementPointLocation_2.h index 0f65bb06b1d..1dbaba871b8 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementPointLocation_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementPointLocation_2.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgArrangement2Concepts +\ingroup PkgArrangementOnSurface2Concepts \cgalConcept A model of the `ArrangementPointLocation_2` concept can answer point-location queries on diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementTraits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementTraits_2.h index 1c13c6a227b..0a2db816543 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementTraits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementTraits_2.h @@ -1,11 +1,11 @@ /*! -\ingroup PkgArrangement2ConceptsTraits +\ingroup PkgArrangementOnSurface2ConceptsTraits \cgalConcept The concept `ArrangementTraits_2` allows the construction of arrangement of general planar curves. Models of this concept are used -by the free \link PkgArrangement2Insert `CGAL::insert()` \endlink functions of the arrangement package and +by the free \link PkgArrangementOnSurface2Insert `CGAL::insert()` \endlink functions of the arrangement package and by the `CGAL::Arrangement_with_history_2` class. A model of this concept must define the nested `Curve_2` type, which diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementVerticalRayShoot_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementVerticalRayShoot_2.h index 27d65a12c7f..b7cc4a71ab2 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementVerticalRayShoot_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementVerticalRayShoot_2.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgArrangement2Concepts +\ingroup PkgArrangementOnSurface2Concepts \cgalConcept A model of the `ArrangementVerticalRayShoot_2` concept can answer vertical ray-shooting diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementWithHistoryInputFormatter.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementWithHistoryInputFormatter.h index aae65845714..b2fdf82fe33 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementWithHistoryInputFormatter.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementWithHistoryInputFormatter.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgArrangement2Concepts +\ingroup PkgArrangementOnSurface2Concepts \cgalConcept A model for the `ArrangementWithHistoryInputFormatter` concept supports a set of functions that enable diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementWithHistoryOutputFormatter.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementWithHistoryOutputFormatter.h index ab2de7d7468..f917b232cd4 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementWithHistoryOutputFormatter.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementWithHistoryOutputFormatter.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgArrangement2Concepts +\ingroup PkgArrangementOnSurface2Concepts \cgalConcept A model for the `ArrangementWithHistoryOutputFormatter` concept supports a set of functions that enable diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementXMonotoneTraits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementXMonotoneTraits_2.h index 10997c95a5f..e8a6830b700 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementXMonotoneTraits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementXMonotoneTraits_2.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgArrangement2ConceptsTraits +\ingroup PkgArrangementOnSurface2ConceptsTraits \cgalConcept The concept `ArrangementXMonotoneTraits_2` refines the basic arrangement-traits concept. diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/OverlayTraits.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/OverlayTraits.h index ae1ebbfded0..d727df92ac0 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/OverlayTraits.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/OverlayTraits.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgArrangement2ConceptsTraits +\ingroup PkgArrangementOnSurface2ConceptsTraits \cgalConcept A model for the `OverlayTraits` should be able to operate on records (namely, diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/PackageDescription.txt b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/PackageDescription.txt index 844048f8e23..25e587778b7 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/PackageDescription.txt +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/PackageDescription.txt @@ -1,69 +1,69 @@ -/// \defgroup PkgArrangement2 2D Arrangement Reference +/// \defgroup PkgArrangementOnSurface2Ref 2D Arrangement Reference -/// \defgroup PkgArrangement2Concepts Concepts -/// \ingroup PkgArrangement2 +/// \defgroup PkgArrangementOnSurface2Concepts Concepts +/// \ingroup PkgArrangementOnSurface2Ref /// \cgalConceptNamespace /// The namespace containing concepts specific to Arrangements. namespace ArrTraits {} -/// \defgroup PkgArrangement2ConceptsDCEL DCEL Concepts -/// \ingroup PkgArrangement2Concepts +/// \defgroup PkgArrangementOnSurface2ConceptsDCEL DCEL Concepts +/// \ingroup PkgArrangementOnSurface2Concepts -/// \defgroup PkgArrangement2ConceptsGeometricObjects Geometric Object Concepts -/// \ingroup PkgArrangement2Concepts +/// \defgroup PkgArrangementOnSurface2ConceptsGeometricObjects Geometric Object Concepts +/// \ingroup PkgArrangementOnSurface2Concepts -/// \defgroup PkgArrangement2ConceptsFunctionObjects Function Object Concepts -/// \ingroup PkgArrangement2Concepts +/// \defgroup PkgArrangementOnSurface2ConceptsFunctionObjects Function Object Concepts +/// \ingroup PkgArrangementOnSurface2Concepts -/// \defgroup PkgArrangement2ConceptsTraits Traits Concepts -/// \ingroup PkgArrangement2Concepts +/// \defgroup PkgArrangementOnSurface2ConceptsTraits Traits Concepts +/// \ingroup PkgArrangementOnSurface2Concepts -/// \defgroup PkgArrangement2TraitsClasses Traits Classes -/// \ingroup PkgArrangement2 +/// \defgroup PkgArrangementOnSurface2TraitsClasses Traits Classes +/// \ingroup PkgArrangementOnSurface2Ref -/// \defgroup PkgArrangement2DCEL DCEL -/// \ingroup PkgArrangement2 +/// \defgroup PkgArrangementOnSurface2DCEL DCEL +/// \ingroup PkgArrangementOnSurface2Ref -/// \defgroup PkgArrangement2IO I/O -/// \ingroup PkgArrangement2 +/// \defgroup PkgArrangementOnSurface2IO I/O +/// \ingroup PkgArrangementOnSurface2Ref -/// \defgroup PkgArrangement2op_left_shift operator<< -/// \ingroup PkgArrangement2IO +/// \defgroup PkgArrangementOnSurface2op_left_shift operator<< +/// \ingroup PkgArrangementOnSurface2IO -/// \defgroup PkgArrangement2op_right_shift operator>> -/// \ingroup PkgArrangement2IO +/// \defgroup PkgArrangementOnSurface2op_right_shift operator>> +/// \ingroup PkgArrangementOnSurface2IO -/// \defgroup PkgArrangement2PointLocation Point Location -/// \ingroup PkgArrangement2 +/// \defgroup PkgArrangementOnSurface2PointLocation Point Location +/// \ingroup PkgArrangementOnSurface2Ref -/// \defgroup PkgArrangement2Overlay Overlay -/// \ingroup PkgArrangement2 +/// \defgroup PkgArrangementOnSurface2Overlay Overlay +/// \ingroup PkgArrangementOnSurface2Ref -/// \defgroup PkgArrangement2Funcs Free Functions -/// \ingroup PkgArrangement2 +/// \defgroup PkgArrangementOnSurface2Funcs Free Functions +/// \ingroup PkgArrangementOnSurface2Ref -/// \defgroup PkgArrangement2Insert CGAL::insert() -/// \ingroup PkgArrangement2Funcs +/// \defgroup PkgArrangementOnSurface2Insert CGAL::insert() +/// \ingroup PkgArrangementOnSurface2Funcs -/// \defgroup PkgArrangement2Tags Tags -/// \ingroup PkgArrangement2 +/// \defgroup PkgArrangementOnSurface2Tags Tags +/// \ingroup PkgArrangementOnSurface2Ref -/// \defgroup PkgArrangement2Macros Macros -/// \ingroup PkgArrangement2 +/// \defgroup PkgArrangementOnSurface2Macros Macros +/// \ingroup PkgArrangementOnSurface2Ref -/// \defgroup PkgArrangement2Enums Enumerations -/// \ingroup PkgArrangement2 +/// \defgroup PkgArrangementOnSurface2Enums Enumerations +/// \ingroup PkgArrangementOnSurface2Ref /*! -\addtogroup PkgArrangement2 +\addtogroup PkgArrangementOnSurface2Ref \todo check generated documentation -\cgalPkgDescriptionBegin{2D Arrangements,PkgArrangement2Summary} +\cgalPkgDescriptionBegin{2D Arrangements,PkgArrangementOnSurface2} \cgalPkgPicture{Arrangement_2.png} \cgalPkgSummaryBegin \cgalPkgAuthors{Ron Wein, Eric Berberich, Efi Fogel, Dan Halperin, Michael Hemmer, Oren Salzman, and Baruch Zukerman} \cgalPkgDesc{This package can be used to construct, maintain, alter, and display arrangements in the plane. Once an arrangement is constructed, the package can be used to obtain results of various queries on the arrangement, such as point location. The package also includes generic implementations of two algorithmic frameworks, that are, computing the zone of an arrangement, and line-sweeping the plane, the arrangements is embedded on. These frameworks are used in turn in the implementations of other operations on arrangements. Computing the overlay of two arrangements, for example, is based on the sweep-line framework. Arrangements and arrangement components can also be extended to store additional data. An important extension stores the construction history of the arrangement, such that it is possible to obtain the originating curve of an arrangement subcurve.} -\cgalPkgManuals{Chapter_2D_Arrangements,PkgArrangement2} +\cgalPkgManuals{Chapter_2D_Arrangements,PkgArrangementOnSurface2Ref} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{2.1} @@ -206,7 +206,7 @@ implemented as peripheral classes or as free (global) functions. - `CGAL::read()` - `CGAL::write()` - `CGAL::remove_curve()` -- \link PkgArrangement2op_left_shift `CGAL::operator<<` \endlink -- \link PkgArrangement2op_right_shift `CGAL::operator<<` \endlink +- \link PkgArrangementOnSurface2op_left_shift `CGAL::operator<<` \endlink +- \link PkgArrangementOnSurface2op_right_shift `CGAL::operator<<` \endlink */ diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/CMakeLists.txt b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/CMakeLists.txt index ff47bd7b67b..9968ed5dfae 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/CMakeLists.txt +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/CMakeLists.txt @@ -4,17 +4,13 @@ project( Arrangement_on_surface_2_Examples ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET COMPONENTS Core) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - include_directories (BEFORE "../../include") + include(${CGAL_USE_FILE}) # create a target per cppfile file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/bgl_dual_adapter.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/bgl_dual_adapter.cpp index aac2d9bf263..25edcebecc1 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/bgl_dual_adapter.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/bgl_dual_adapter.cpp @@ -6,7 +6,7 @@ #include #include #include -#include +#include #include #include diff --git a/Arrangement_on_surface_2/include/CGAL/Arrangement_2/graph_traits_dual.h b/Arrangement_on_surface_2/include/CGAL/Arrangement_2/graph_traits_dual.h new file mode 100644 index 00000000000..6be8db37bfe --- /dev/null +++ b/Arrangement_on_surface_2/include/CGAL/Arrangement_2/graph_traits_dual.h @@ -0,0 +1,539 @@ +// Copyright (c) 2005,2007,2009,2010,2011 Tel-Aviv University (Israel). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org). +// You can redistribute it and/or modify it under the terms of the GNU +// General Public License as published by the Free Software Foundation, +// either version 3 of the License, or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: GPL-3.0+ +// +// +// Author(s) : Ron Wein +// Ophir Setter +// Sebastien Loriot +// Efi Fogel + +// This file contains the follwoing three parts: +// 1. The common base class template of the specialized +// Dual class template. +// +// 2. The common base class template of the specialized +// boost::graph_traits > class template. +// +// 3. Macro definitions of free Function templates required by +// the various Boost Graph concepts. There is one macro per required function +// template. Each macro accepts the name of a template class, an instance of +// which represents an arrangement data structure, e.g., Arrangement_2. The +// definitios of the free functions templates for a given arrangement data +// strcture must be present when a dual of this data structure is defined. + +#include + +#ifndef CGAL_GRAPH_TRAITS_DUAL_H +#define CGAL_GRAPH_TRAITS_DUAL_H + +namespace CGAL { + +// Forward declaration. +template class Dual; + +/*! \class + * Generic implementation of the common base class template of the specialized + * Dual class template. + */ +template +class Dual_arrangement_on_surface { +public: + typedef Arrangement_ Arrangement; + typedef typename Arrangement::Geometry_traits_2 Geometry_traits_2; + typedef typename Arrangement::Topology_traits Topology_traits; + + typedef typename Arrangement::Size Size; + typedef typename Arrangement::Face_handle Vertex_handle; + typedef typename Arrangement::Halfedge_handle Edge_handle; + + typedef typename Arrangement::Face_iterator Vertex_iterator; + typedef typename Arrangement::Halfedge_iterator Edge_iterator; + +protected: + typedef typename Arrangement::Face_handle Face_handle; + typedef typename Arrangement::Ccb_halfedge_circulator Ccb_halfedge_circulator; + typedef typename Arrangement::Outer_ccb_iterator Outer_ccb_iterator; + typedef typename Arrangement::Inner_ccb_iterator Inner_ccb_iterator; + + /*! \class + * Iterator over the neighbors of a dual vertex (a face in the primal + * arrangement). + * These neighbors are the adjacent faces along the outer boundaries of the + * face and its inner boundaries. + */ + class Face_neighbor_iterator { + typedef Face_neighbor_iterator Self; + + public: + typedef std::forward_iterator_tag iterator_category; + typedef Edge_handle value_type; + typedef value_type reference; + typedef value_type* pointer; + typedef int difference_type; + + private: + Outer_ccb_iterator _outer_ccb_iter; + Inner_ccb_iterator _inner_ccb_iter; + Ccb_halfedge_circulator _ccb_curr; + Ccb_halfedge_circulator _ccb_first; + Face_handle _face; + bool _out; + Edge_handle _hh; + bool _end; + + public: + /*! Default constructor. */ + Face_neighbor_iterator() : _end (true) {} + + /*! Constructor. + * \param face The face (dual vertex). + * \param out_edges Do we need the outgoing or the ingoing halfedges. + * \param start Should we start traversing the edges. + * If false, we construct a past-the-end iterator. + */ + Face_neighbor_iterator(Face_handle face, bool out_edges, bool start) : + _face(face), + _out(out_edges), + _end(! start) + { + CGAL_precondition(! face->is_fictitious()); + + if (start) { + _outer_ccb_iter = _face->outer_ccbs_begin(); + _inner_ccb_iter = _face->inner_ccbs_begin(); + + if (_outer_ccb_iter != _face->outer_ccbs_end()) { + // Start from the first outer CCB, if one exists. + _ccb_curr = _ccb_first = *_outer_ccb_iter; + } + else if (_inner_ccb_iter != face->inner_ccbs_end()) { + // Otherwise, start from the first inner CCB. + _ccb_curr = _ccb_first = *_inner_ccb_iter; + } + else { + // In this case there are no CCBs to traverse: + _end = true; + return; + } + + _hh = this->_dereference(); + + // In case the incident face of the twin halfedge is fictitious, + // skip it and proceed to the next edge. + if (_hh->is_fictitious()) ++(*this); + } + else { // end iterator. + _outer_ccb_iter = _face->outer_ccbs_end(); + _inner_ccb_iter = _face->inner_ccbs_end(); + } + } + + /*! Equality operators. */ + bool operator==(const Self& it) const { return (this->_equal(it)); } + + bool operator!= (const Self& it) const { return (! this->_equal(it)); } + + /*! Dereference operators. */ + reference operator*() const { return (_hh); } + + pointer operator->() const { return (&_hh); } + + /* Increment operators. */ + Self& operator++() + { + do { + this->_increment(); + if (_end) return (*this); + _hh = this->_dereference(); + } while (_hh->is_fictitious()); + return (*this); + } + + Self operator++(int ) + { + Self tmp = *this; + do { + this->_increment(); + if (_end) return (tmp); + _hh = this->_dereference(); + } while (_hh->is_fictitious()); + return (tmp); + } + + private: + /*! Check two iterators for equality. */ + bool _equal(const Self& it) const + { + return (_out == it._out && _face == it._face && ((_end && it._end) || + (_outer_ccb_iter == it._outer_ccb_iter && + _inner_ccb_iter == it._inner_ccb_iter && + _ccb_curr == it._ccb_curr))); + } + + /*! Derefernce the current circulator. */ + Edge_handle _dereference() const + { + if (_out) return (_ccb_curr); + else return (_ccb_curr->twin()); + } + + // Increments of the iterator. + void _increment() + { + CGAL_assertion(! _end); + + // If we have not traversed the entire CCB in full, move to the next + // halfedge along the current CCB. + ++_ccb_curr; + + if (_ccb_curr != _ccb_first) return; + + // In this case we have completed the current CCB and we have to move + // to the next one. + if (_outer_ccb_iter != _face->outer_ccbs_end()) { + // Try to move to the next outer CCB. + ++_outer_ccb_iter; + if (_outer_ccb_iter != _face->outer_ccbs_end()) { + _ccb_curr = _ccb_first = *_outer_ccb_iter; + return; + } + + // In this case we start traversing the inner CCBs. + if (_inner_ccb_iter != _face->inner_ccbs_end()) { + CGAL_assertion (_inner_ccb_iter == _face->inner_ccbs_begin()); + + // Otherwise, start from the first inner CCB. + _ccb_curr = _ccb_first = *_inner_ccb_iter; + return; + } + } + else if (_inner_ccb_iter != _face->inner_ccbs_end()) { + + // In this case we have already traversed all outer CCBs (and at least + // one inner CCB), so we try to move to the next inner CCB. + ++_inner_ccb_iter; + if (_inner_ccb_iter != _face->inner_ccbs_end()) { + // Otherwise, start from the first inner CCB. + _ccb_curr = _ccb_first = *_inner_ccb_iter; + return; + } + } + + // In this case we finished traversing all outer and inner CCBs: + _end = true; + return; + } + }; + + // Data members: + mutable Arrangement* p_arr; // The primal arrangement. + +public: + typedef Face_neighbor_iterator Incident_edge_iterator; + + /*! Default constructor. */ + Dual_arrangement_on_surface() : p_arr(NULL) {} + + /*! Constructor from an arrangement. */ + Dual_arrangement_on_surface(const Arrangement& arr) : + p_arr(const_cast(&arr)) + {} + + /*! Obtain the primal arrangement (const version). */ + const Arrangement* arrangement() const { return (p_arr); } + + /*! Obtain the primal arrangement (non-const version). */ + Arrangement* arrangement() { return (p_arr); } + + /*! Obtain the number of vertices (face of the primal arrangement). */ + Size number_of_vertices() const { return (p_arr->number_of_faces()); } + + /*! Obtain the begin iterator of the vertices of the dual arrangement + * (faces of the primal arrangement). + */ + Vertex_iterator vertices_begin() const { return (p_arr->faces_begin()); } + + /*! Obtain the pass-the-end iterator of the vertices of the dual arrangement + * (faces of the primal arrangement). + */ + Vertex_iterator vertices_end() const { return (p_arr->faces_end()); } + + /*! Obtain the number of edges. */ + Size number_of_edges () const { return (p_arr->number_of_halfedges()); } + + /*! Obtain the begin iterator of the edges of the dual arrangement. */ + Edge_iterator edges_begin() const { return (p_arr->halfedges_begin()); } + + /*! Obtain the pass-the-end iterator of the edges of the dual arrangement. */ + Edge_iterator edges_end() const { return (p_arr->halfedges_end()); } + + /*! Obtain the dual vertex-degree (number of edges forming the face boundary). + */ + Size degree(Vertex_handle v) const + { + Incident_edge_iterator begin = Incident_edge_iterator(v, true, true); + Incident_edge_iterator end = Incident_edge_iterator(v, false, true); + Size deg = 0; + + while (begin != end) { + deg++; + ++begin; + } + + return (deg); + } + + /*! Traverse the outgoing edges of a given vertex. */ + Incident_edge_iterator out_edges_begin(Vertex_handle v) const + { return (Incident_edge_iterator (v, true, true)); } + + Incident_edge_iterator out_edges_end(Vertex_handle v) const + { return (Incident_edge_iterator (v, true, false)); } + + /*! Traverse the ingoing edges of a given vertex. */ + Incident_edge_iterator in_edges_begin(Vertex_handle v) const + { return (Incident_edge_iterator (v, false, true)); } + + Incident_edge_iterator in_edges_end(Vertex_handle v) const + { return (Incident_edge_iterator (v, false, false)); } +}; + +} //namespace CGAL + +#include +#include + +namespace CGAL { + +/*! \class + * The common base class template of the specialized + * boost::graph_traits > class template. + * The latter serves as a dual adapter for the specialied arrangment, where the + * valid arrangement faces correspond to graph verices, and two graph vertices + * are connected if the two corrsponding faces are adjacent. + * We consider the graph as directed. We also allow parallel edges, as two + * faces may have more than one common edges. + */ +template +class Graph_traits_dual_arr_on_surface_impl { +public: + typedef Arrangement_ Arrangement; + typedef typename Arrangement::Geometry_traits_2 Geometry_traits_2; + typedef typename Arrangement::Topology_traits Topology_traits; + typedef Dual_arrangement_on_surface Dual_arr_2; + +private: + typedef typename Dual_arr_2::Vertex_iterator Vertex_iterator; + typedef typename Dual_arr_2::Edge_iterator Edge_iterator; + typedef typename Dual_arr_2::Incident_edge_iterator Incident_edge_iterator; + + /*! \struct + * Define the arrangement traversal category, which indicates the arrangement + * models the BidirectionalGraph concept and the VertexListGraph and + * EdgeListGraph concepts. + */ + struct Dual_arr_traversal_category : + public virtual boost::bidirectional_graph_tag, // This tag refines the + // incidence_graph_tag. + public virtual boost::vertex_list_graph_tag, // Can iterate over vertices. + public virtual boost::edge_list_graph_tag // Can iterate over edges. + {}; + +public: + // Types required of the Graph concept: + typedef typename Dual_arr_2::Vertex_handle vertex_descriptor; + typedef boost::directed_tag directed_category; + typedef boost::allow_parallel_edge_tag edge_parallel_category; + + typedef Dual_arr_traversal_category traversal_category; + + // Types required by the IncidenceGraph concept: + typedef typename Dual_arr_2::Edge_handle edge_descriptor; + typedef Incident_edge_iterator out_edge_iterator; + typedef typename Dual_arr_2::Size degree_size_type; + + // Types required by the BidirectionalGraph concept: + typedef Incident_edge_iterator in_edge_iterator; + + // Types required by the VertexListGraph concept: + typedef boost::counting_iterator vertex_iterator; + typedef typename Dual_arr_2::Size vertices_size_type; + + // Types required by the EdgeListGraph concept: + typedef boost::counting_iterator edge_iterator; + typedef typename Dual_arr_2::Size edges_size_type; + + // Types not required by any of these concepts: + typedef void adjacency_iterator; +}; + +} + +// Macro definitions of free Function templates required by the various Boost +// Graph concepts. Each macro provides the required free function template with +// the specific interface and its implementation. +// We use macros (and not base functions similar to +// Graph_traits_dual_arr_on_surface_impl) for simplicity. The implementation +// is typically a one-liner. However, the interface is typically several lines +// of code. The alternative implementation (with base common functions) while +// being more safe (provided tight type checking) would consume many repeated +// lines of code. + +// Functions required by the IncidenceGraph concept: +// ------------------------------------------------- + +/*! Obtain the out-degree of a vertex in a given dual arrangement. + * \param v The vertex. + * \param darr The dual arrangement. + * \param Number of halfedges around the boundary of the primal face. + */ +#define CGAL_DUAL_ARRANGEMENT_2_OUT_DEGREE(T) \ +template \ +typename boost::graph_traits > >::degree_size_type \ +out_degree(typename boost::graph_traits > >::vertex_descriptor v,\ + const Dual >& darr) \ +{ return darr.degree(v); } + +/*! Return a range of the out-edges of a vertex given by its descriptor and the + * dual arrangement it belongs to. + * \param v The vertex. + * \param darr The dual arrangement. + * \return A pair of out-edges iterators. + */ +#define CGAL_DUAL_ARRANGEMENT_2_OUT_EDGES(T) \ +template \ +std::pair > >::out_edge_iterator, \ + typename boost::graph_traits > >::out_edge_iterator> \ +out_edges(typename boost::graph_traits > >::vertex_descriptor v,\ + const Dual >& darr) \ +{ return std::make_pair(darr.out_edges_begin(v), darr.out_edges_end(v)); } \ + +/*! Obtain the source vertex of a dual arrangement edge. + * \param e The edge. + * \param darr The dual arrangement. + * \return The incident face of e in the primal arrangement. + */ +#define CGAL_DUAL_ARRANGEMENT_2_SOURCE(T) \ +template \ +typename boost::graph_traits > >::vertex_descriptor \ +source(typename boost::graph_traits > >::edge_descriptor e, \ + const Dual >& /* darr */) \ +{ return e->face(); } + +/*! Obtain the target vertex of a dual arrangement edge. + * \param e The edge. + * \param darr The dual arrangement. + * \return The incident face of the twin of e in the primal arrangement. + */ +#define CGAL_DUAL_ARRANGEMENT_2_TARGET(T) \ +template \ +typename boost::graph_traits > >::vertex_descriptor \ +target(typename boost::graph_traits > >::edge_descriptor e, \ + const Dual >& /* darr */) \ +{ return e->twin()->face(); } + +// Functions required by the BidirectionalGraph concept: +// ----------------------------------------------------- + +/*! Obtain the in-degree of a vertex in a given dual arrangement. + * \param v The vertex. + * \param darr The dual arrangement. + * \param Number of halfedges around the boundary of the primal face. + */ +#define CGAL_DUAL_ARRANGEMENT_2_IN_DEGREE(T) \ +template \ +typename boost::graph_traits > >::degree_size_type \ +in_degree(typename boost::graph_traits > >::vertex_descriptor v,\ + const Dual >& darr) \ +{ return darr.degree(v); } + +/*! Return a range of the in-edges of a vertex given by its descriptor and the + * dual arrangement it belongs to. + * \param v The vertex. + * \param darr The dual arrangement. + * \return A pair of in-edges iterators. + */ +#define CGAL_DUAL_ARRANGEMENT_2_IN_EDGES(T) \ +template \ +std::pair > >::in_edge_iterator, \ + typename boost::graph_traits > >::in_edge_iterator> \ +in_edges(typename boost::graph_traits > >::vertex_descriptor v,\ + const Dual >& darr) \ +{ return std::make_pair(darr.in_edges_begin(v), darr.in_edges_end(v)); } + +/*! Obtain the degree of a vertex in a given dual arrangement. + * \param v The vertex. + * \param darr The dual arrangement. + * \param Number of ingoing and outgoing halfedges incident to v. + */ +#define CGAL_DUAL_ARRANGEMENT_2_DEGREE(T) \ +template \ +typename boost::graph_traits > >::degree_size_type \ +degree(typename boost::graph_traits > >::vertex_descriptor v, \ + const Dual >& darr) \ +{ return (2 * darr.degree(v)); } + +// Functions required by the VertexListGraph concept: +// -------------------------------------------------- + +/*! Obtain the number of vertices in the given dual arrangement. + * \param darr The dual arrangement. + * \return Number of faces in the primal arrangement. + */ +#define CGAL_DUAL_ARRANGEMENT_2_NUM_VERTICES(T) \ +template \ +typename boost::graph_traits > >::vertices_size_type \ +num_vertices(const Dual >& darr) \ +{ return darr.number_of_vertices(); } + +/*! Obtain the range of vertices of the given dual arrangement. + * \param darr The dual arrangement. + * \return A pair of vertex iterators. + */ +#define CGAL_DUAL_ARRANGEMENT_2_VERTICES(T) \ +template \ +std::pair > >::vertex_iterator, \ + typename boost::graph_traits > >::vertex_iterator> \ +vertices(const Dual >& darr) \ +{ return std::make_pair(darr.vertices_begin(), darr.vertices_end()); } + +// Functions required by the EdgeListGraph concept: +// ------------------------------------------------ + +/*! Obtain the number of edges in the given dual arrangement. + * \param darr The dual arrangement. + * \return Number of halfedges in the primal arrangement. + */ +#define CGAL_DUAL_ARRANGEMENT_2_NUM_EDGES(T) \ +template \ +typename boost::graph_traits > >::edges_size_type \ +num_edges(const Dual >& darr) \ +{ return darr.number_of_edges(); } + +/*! Obtain the range of edges of the given dual arrangement. + * \param darr The dual arrangement. + * \return A pair of edge iterators. + */ +#define CGAL_DUAL_ARRANGEMENT_2_EDGES(T) \ +template \ +std::pair > >::edge_iterator, \ + typename boost::graph_traits > >::edge_iterator> \ +edges(const Dual >& darr) \ +{ return std::make_pair(darr.edges_begin(), darr.edges_end()); } + +#endif diff --git a/Arrangement_on_surface_2/include/CGAL/boost/graph/graph_traits_Dual_Arrangement_2.h b/Arrangement_on_surface_2/include/CGAL/boost/graph/graph_traits_Dual_Arrangement_2.h index be5fafe3060..0a23c73122e 100644 --- a/Arrangement_on_surface_2/include/CGAL/boost/graph/graph_traits_Dual_Arrangement_2.h +++ b/Arrangement_on_surface_2/include/CGAL/boost/graph/graph_traits_Dual_Arrangement_2.h @@ -23,6 +23,6 @@ #ifndef CGAL_BOOST_GRAPH_GRAPH_TRAITS_DUAL_ARRANGEMENT_2_H #define CGAL_BOOST_GRAPH_GRAPH_TRAITS_ARRANGEMENT_2_H -#include +#include #endif //CGAL_BOOST_GRAPH_GRAPH_TRAITS_DUAL_ARRANGEMENT_2_H diff --git a/Arrangement_on_surface_2/include/CGAL/graph_traits_Dual_Arrangement_2.h b/Arrangement_on_surface_2/include/CGAL/graph_traits_Dual_Arrangement_2.h deleted file mode 100644 index dd8a4f14226..00000000000 --- a/Arrangement_on_surface_2/include/CGAL/graph_traits_Dual_Arrangement_2.h +++ /dev/null @@ -1,755 +0,0 @@ -// Copyright (c) 2005,2007,2009,2010,2011 Tel-Aviv University (Israel). -// All rights reserved. -// -// This file is part of CGAL (www.cgal.org). -// You can redistribute it and/or modify it under the terms of the GNU -// General Public License as published by the Free Software Foundation, -// either version 3 of the License, or (at your option) any later version. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -// -// $URL$ -// $Id$ -// SPDX-License-Identifier: GPL-3.0+ -// -// -// Author(s) : Ron Wein -// Ophir Setter - -#ifndef CGAL_GRAPH_TRAITS_DUAL_ARRANGEMENT_2_H -#define CGAL_GRAPH_TRAITS_DUAL_ARRANGEMENT_2_H - -#include - -#include - -/*! \file - * Definition of the specialized Dual class, - * and the specialized boost::graph_traits >class. - */ - -// include this to avoid a VC15 warning -#include - -#include -#include - -namespace CGAL { - -// Forward declaration. -template class Dual; - -/*! \class - * Specilaization of the Dual<> template for Arrangement_on_surface_2. - */ -template -class Dual > -{ -public: - - typedef GeomTraits_ Geometry_traits_2; - typedef TopTraits_ Topology_traits; - typedef CGAL::Arrangement_on_surface_2 - Arrangement_on_surface_2; - - typedef typename Arrangement_on_surface_2::Size Size; - typedef typename Arrangement_on_surface_2::Face_handle Vertex_handle; - typedef typename Arrangement_on_surface_2::Halfedge_handle Edge_handle; - - typedef typename Arrangement_on_surface_2::Face_iterator Vertex_iterator; - typedef typename Arrangement_on_surface_2::Halfedge_iterator Edge_iterator; - -protected: - - typedef typename Arrangement_on_surface_2::Face_handle Face_handle; - typedef typename Arrangement_on_surface_2::Ccb_halfedge_circulator - Ccb_halfedge_circulator; - typedef typename Arrangement_on_surface_2::Outer_ccb_iterator - Outer_ccb_iterator; - typedef typename Arrangement_on_surface_2::Inner_ccb_iterator - Inner_ccb_iterator; - - /*! \class - * Iterator over the neighbors of a dual vertex (a face in the primal - * arrangement). - * These neighbors are the adjacent faces along the outer boundaries of the - * face and its inner boundaries. - */ - class Face_neighbor_iterator - { - typedef Face_neighbor_iterator Self; - - public: - - typedef std::forward_iterator_tag iterator_category; - typedef Edge_handle value_type; - typedef value_type reference; - typedef value_type* pointer; - typedef int difference_type; - - private: - - Outer_ccb_iterator _outer_ccb_iter; - Inner_ccb_iterator _inner_ccb_iter; - Ccb_halfedge_circulator _ccb_curr; - Ccb_halfedge_circulator _ccb_first; - Face_handle _face; - bool _out; - Edge_handle _hh; - bool _end; - - public: - - /*! Default constructor. */ - Face_neighbor_iterator () : - _end (true) - {} - - /*! - * Constructor. - * \param face The face (dual vertex). - * \param out_edges Do we need the outgoing or the ingoing halfedges. - * \param start Should we start traversing the edges. - * If false, we construct a past-the-end iterator. - */ - Face_neighbor_iterator (Face_handle face, - bool out_edges, - bool start) : - _face (face), - _out (out_edges), - _end (! start) - { - CGAL_precondition (! face->is_fictitious()); - - if (start) - { - _outer_ccb_iter = _face->outer_ccbs_begin(); - _inner_ccb_iter = _face->inner_ccbs_begin(); - - if (_outer_ccb_iter != _face->outer_ccbs_end()) - { - // Start from the first outer CCB, if one exists. - _ccb_curr = _ccb_first = *_outer_ccb_iter; - } - else if (_inner_ccb_iter != face->inner_ccbs_end()) - { - // Otherwise, start from the first inner CCB. - _ccb_curr = _ccb_first = *_inner_ccb_iter; - } - else - { - // In this case there are no CCBs to traverse: - _end = true; - return; - } - - _hh = this->_dereference(); - - // In case the incident face of the twin halfedge is fictitious, - // skip it and proceed to the next edge. - if (_hh->is_fictitious()) - ++(*this); - } - else // end iterator. - { - _outer_ccb_iter = _face->outer_ccbs_end(); - _inner_ccb_iter = _face->inner_ccbs_end(); - } - } - - /*! Equality operators. */ - bool operator== (const Self& it) const - { - return (this->_equal(it)); - } - - bool operator!= (const Self& it) const - { - return (! this->_equal(it)); - } - - /*! Dereference operators. */ - reference operator* () const - { - return (_hh); - } - - pointer operator-> () const - { - return (&_hh); - } - - /* Increment operators. */ - Self& operator++ () - { - do - { - this->_increment(); - if (_end) - return (*this); - - _hh = this->_dereference(); - - } while (_hh->is_fictitious()); - - return (*this); - } - - Self operator++ (int ) - { - Self tmp = *this; - - do - { - this->_increment(); - if (_end) - return (tmp); - - _hh = this->_dereference(); - - } while (_hh->is_fictitious()); - - return (tmp); - } - - private: - - /*! Check two iterators for equality. */ - bool _equal (const Self& it) const - { - return (_out == it._out && _face == it._face && - ((_end && it._end) || - (_outer_ccb_iter == it._outer_ccb_iter && - _inner_ccb_iter == it._inner_ccb_iter && - _ccb_curr == it._ccb_curr))); - } - - /*! Derefernce the current circulator. */ - Edge_handle _dereference () const - { - if (_out) - return (_ccb_curr); - else - return (_ccb_curr->twin()); - } - - // Increments of the iterator. - void _increment () - { - CGAL_assertion (! _end); - - // If we have not traversed the entire CCB in full, move to the next - // halfedge along the current CCB. - ++_ccb_curr; - - if (_ccb_curr != _ccb_first) - return; - - // In this case we have completed the current CCB and we have to move - // to the next one. - if (_outer_ccb_iter != _face->outer_ccbs_end()) - { - // Try to move to the next outer CCB. - ++_outer_ccb_iter; - if (_outer_ccb_iter != _face->outer_ccbs_end()) - { - _ccb_curr = _ccb_first = *_outer_ccb_iter; - return; - } - - // In this case we start traversing the inner CCBs. - if (_inner_ccb_iter != _face->inner_ccbs_end()) - { - CGAL_assertion (_inner_ccb_iter == _face->inner_ccbs_begin()); - - // Otherwise, start from the first inner CCB. - _ccb_curr = _ccb_first = *_inner_ccb_iter; - return; - } - } - else if (_inner_ccb_iter != _face->inner_ccbs_end()) - { - - // In this case we have already traversed all outer CCBs (and at least - // one inner CCB), so we try to move to the next inner CCB. - ++_inner_ccb_iter; - if (_inner_ccb_iter != _face->inner_ccbs_end()) - { - // Otherwise, start from the first inner CCB. - _ccb_curr = _ccb_first = *_inner_ccb_iter; - return; - } - } - - // In this case we finished traversing all outer and inner CCBs: - _end = true; - return; - } - - }; - - // Data members: - mutable Arrangement_on_surface_2 *p_arr; // The primal arrangement. - -public: - - typedef Face_neighbor_iterator Incident_edge_iterator; - - /*! Default constructor. */ - Dual () : - p_arr (NULL) - {} - - /*! Constructor from an arrangement. */ - Dual (const Arrangement_on_surface_2& arr) : - p_arr (const_cast (&arr)) - {} - - /*! Get the primal arrangement (const version). */ - const Arrangement_on_surface_2* arrangement () const - { - return (p_arr); - } - - /*! Get the primal arrangement (non-const version). */ - Arrangement_on_surface_2* arrangement () - { - return (p_arr); - } - - /*! Get the number of vertices (face of the primal arrangement). */ - Size number_of_vertices () const - { - return (p_arr->number_of_faces()); - } - - /*! Traverse the vertices (faces of the primal arrangement). */ - Vertex_iterator vertices_begin () const - { - return (p_arr->faces_begin()); - } - - Vertex_iterator vertices_end () const - { - return (p_arr->faces_end()); - } - - /*! Get the number of edges. */ - Size number_of_edges () const - { - return (p_arr->number_of_halfedges()); - } - - /*! Traverse the edges. */ - Edge_iterator edges_begin () const - { - return (p_arr->halfedges_begin()); - } - - Edge_iterator edges_end () const - { - return (p_arr->halfedges_end()); - } - - /*! - * Get the dual vertex-degree (number of edges forming the face boundary). - */ - Size degree (Vertex_handle v) const - { - Incident_edge_iterator begin = Incident_edge_iterator (v, true, true); - Incident_edge_iterator end = Incident_edge_iterator (v, false, true); - Size deg = 0; - - while (begin != end) - { - deg++; - ++begin; - } - - return (deg); - } - - /*! Traverse the outgoing edges of a given vertex. */ - Incident_edge_iterator out_edges_begin (Vertex_handle v) const - { - return (Incident_edge_iterator (v, true, true)); - } - - Incident_edge_iterator out_edges_end (Vertex_handle v) const - { - return (Incident_edge_iterator (v, true, false)); - } - - /*! Traverse the ingoing edges of a given vertex. */ - Incident_edge_iterator in_edges_begin (Vertex_handle v) const - { - return (Incident_edge_iterator (v, false, true)); - } - - Incident_edge_iterator in_edges_end (Vertex_handle v) const - { - return (Incident_edge_iterator (v, false, false)); - } -}; - -/*! \class - * Specilaization of the Dual<> template for Arrangement_2. - */ -template -class Dual > : - public Dual::Geometry_traits_2, - typename CGAL::Arrangement_2::Topology_traits> > -{ - typedef Traits_ Traits_2; - typedef Dcel_ Dcel; - typedef Dual::Geometry_traits_2, - typename CGAL::Arrangement_2::Topology_traits> > Base; - -public: - - /*! Default constructor. */ - Dual () : - Base() - {} - - /*! Constructor from an arrangement. */ - Dual (const CGAL::Arrangement_2& arr) : - Base (arr) - {} -}; - -} //namespace CGAL - -#include -#include - -namespace boost { - -/*! \class - * Specialization of the BGL graph-traits template, which serve as a dual - * adapter for Arrangment_on_surface_2, where the valid arrangement faces - * correspond to graph verices, and two graph vertices are connected if the - * two corrsponding faces are adjacent. - * We consider the graph as directed. We also allow parallel edges, as two - * faces may have more than one common edges. - */ -template -class graph_traits > > -{ -public: - - typedef GeomTraits_ Geometry_traits_2; - typedef TopTraits_ Topology_traits; - typedef CGAL::Arrangement_on_surface_2 - Arrangement_on_surface_2; - typedef CGAL::Dual Dual_arr_2; - -private: - - typedef typename Dual_arr_2::Vertex_iterator Vertex_iterator; - typedef typename Dual_arr_2::Edge_iterator Edge_iterator; - typedef typename Dual_arr_2::Incident_edge_iterator Incident_edge_iterator; - - /*! \struct - * Define the arrangement traversal category, which indicates the arrangement - * models the BidirectionalGraph concept and the VertexListGraph and - * EdgeListGraph concepts. - */ - struct Dual_arr_traversal_category : - public virtual boost::bidirectional_graph_tag, // This tag refines the - // incidence_graph_tag. - public virtual boost::vertex_list_graph_tag, // Can iterate over vertices. - public virtual boost::edge_list_graph_tag // Can iterate over edges. - {}; - -public: - - // Types required of the Graph concept: - typedef typename Dual_arr_2::Vertex_handle vertex_descriptor; - typedef boost::directed_tag directed_category; - typedef boost::allow_parallel_edge_tag edge_parallel_category; - - typedef Dual_arr_traversal_category traversal_category; - - // Types required by the IncidenceGraph concept: - typedef typename Dual_arr_2::Edge_handle edge_descriptor; - typedef Incident_edge_iterator out_edge_iterator; - typedef typename Dual_arr_2::Size degree_size_type; - - // Types required by the BidirectionalGraph concept: - typedef Incident_edge_iterator in_edge_iterator; - - // Types required by the VertexListGraph concept: - typedef boost::counting_iterator vertex_iterator; - typedef typename Dual_arr_2::Size vertices_size_type; - - // Types required by the EdgeListGraph concept: - typedef boost::counting_iterator edge_iterator; - typedef typename Dual_arr_2::Size edges_size_type; - - // Types not required by any of these concepts: - typedef void adjacency_iterator; - -}; - -/*! \class - * Specialization of the BGL graph-traits template, which serve as a dual - * adapter for Arrangment_2. - */ -template -class graph_traits > > : - public graph_traits::Geometry_traits_2, - typename CGAL::Arrangement_2::Topology_traits> > > -{}; - -} // namespace boost - -namespace CGAL { - -// Functions required by the IncidenceGraph concept: -// ------------------------------------------------- - -/*! - * Get the out-degree of a vertex in a given dual arrangement. - * \param v The vertex. - * \param darr The dual arrangement. - * \param Number of halfedges around the boundary of the primal face. - */ -template -typename -boost::graph_traits > >::degree_size_type -out_degree(typename - boost::graph_traits > >:: - vertex_descriptor v, - const CGAL::Dual >& darr) -{ - return darr.degree (v); -} - -/*! - * Return a range of the out-edges of a vertex given by its descriptor and the - * dual arrangement it belongs to. - * \param v The vertex. - * \param darr The dual arrangement. - * \return A pair of out-edges iterators. - */ -template -std::pair > >:: - out_edge_iterator, - typename - boost::graph_traits > >:: - out_edge_iterator> -out_edges(typename - boost::graph_traits > >:: - vertex_descriptor v, - const CGAL::Dual >& darr) -{ - return std::make_pair (darr.out_edges_begin (v), darr.out_edges_end (v)); -} - -/*! - * Get the source vertex of a dual arrangement edge. - * \param e The edge. - * \param darr The dual arrangement. - * \return The incident face of e in the primal arrangement. - */ -template -typename -boost::graph_traits > >::vertex_descriptor -source(typename - boost::graph_traits > >:: - edge_descriptor e, - const CGAL::Dual >& /* darr */) -{ - return e->face(); -} - -/*! - * Get the target vertex of a dual arrangement edge. - * \param e The edge. - * \param darr The dual arrangement. - * \return The incident face of e's twin in the primal arrangement. - */ -template -typename -boost::graph_traits > >::vertex_descriptor -target(typename - boost::graph_traits > >:: - edge_descriptor e, - const CGAL::Dual >& /* darr */) -{ - return e->twin()->face(); -} - -// Functions required by the BidirectionalGraph concept: -// ----------------------------------------------------- - -/*! - * Get the in-degree of a vertex in a given dual arrangement. - * \param v The vertex. - * \param darr The dual arrangement. - * \param Number of halfedges around the boundary of the primal face. - */ -template -typename -boost::graph_traits > >::degree_size_type -in_degree(typename - boost::graph_traits > >:: - vertex_descriptor v, - const CGAL::Dual >& darr) -{ - return darr.degree (v); -} - -/*! - * Return a range of the in-edges of a vertex given by its descriptor and the - * dual arrangement it belongs to. - * \param v The vertex. - * \param darr The dual arrangement. - * \return A pair of in-edges iterators. - */ -template -std::pair > >:: - in_edge_iterator, - typename - boost::graph_traits > >:: - in_edge_iterator> -in_edges(typename - boost::graph_traits > >:: - vertex_descriptor v, - const CGAL::Dual >& darr) -{ - return std::make_pair (darr.in_edges_begin (v), darr.in_edges_end (v)); -} - -/*! - * Get the degree of a vertex in a given dual arrangement. - * \param v The vertex. - * \param darr The dual arrangement. - * \param Number of ingoing and outgoing halfedges incident to v. - */ -template -typename -boost::graph_traits > >::degree_size_type -degree(typename - boost::graph_traits > >:: - vertex_descriptor v, - const CGAL::Dual >& darr) -{ - return (2 * darr.degree (v)); -} - -// Functions required by the VertexListGraph concept: -// -------------------------------------------------- - -/*! - * Get the number of vertices in the given dual arrangement. - * \param darr The dual arrangement. - * \return Number of faces in the primal arrangement. - */ -template -typename -boost::graph_traits > >::vertices_size_type -num_vertices(const CGAL::Dual >& darr) -{ - return darr.number_of_vertices(); -} - -/*! - * Get the range of vertices of the given dual arrangement. - * \param darr The dual arrangement. - * \return A pair of vertex iterators. - */ -template -std::pair > >:: - vertex_iterator, - typename - boost::graph_traits > >:: - vertex_iterator> -vertices (const CGAL::Dual >& darr) -{ - return std::make_pair (darr.vertices_begin(), darr.vertices_end()); -} - -// Functions required by the EdgeListGraph concept: -// ------------------------------------------------ - -/*! - * Get the number of edges in the given dual arrangement. - * \param darr The dual arrangement. - * \return Number of halfedges in the primal arrangement. - */ -template -typename -boost::graph_traits > >::edges_size_type -num_edges(const CGAL::Dual >& darr) -{ - return darr.number_of_edges(); -} - -/*! - * Get the range of edges of the given dual arrangement. - * \param darr The dual arrangement. - * \return A pair of edge iterators. - */ -template -std::pair > >:: - edge_iterator, - typename - boost::graph_traits > >:: - edge_iterator> -edges (const CGAL::Dual >& darr) -{ - return std::make_pair (darr.edges_begin(), darr.edges_end()); -} - -} //namespace CGAL - -#include - -#endif diff --git a/Arrangement_on_surface_2/include/CGAL/graph_traits_dual_arrangement_2.h b/Arrangement_on_surface_2/include/CGAL/graph_traits_dual_arrangement_2.h new file mode 100644 index 00000000000..060db488191 --- /dev/null +++ b/Arrangement_on_surface_2/include/CGAL/graph_traits_dual_arrangement_2.h @@ -0,0 +1,97 @@ +// Copyright (c) 2019 Tel-Aviv University (Israel). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org). +// You can redistribute it and/or modify it under the terms of the GNU +// General Public License as published by the Free Software Foundation, +// either version 3 of the License, or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: GPL-3.0+ +// +// Author(s) : Ron Wein +// Ophir Setter +// Sebastien Loriot +// Efi Fogel + +#ifndef CGAL_GRAPH_TRAITS_DUAL_ARRANGEMENT_2_H +#define CGAL_GRAPH_TRAITS_DUAL_ARRANGEMENT_2_H + +#include + +/*! \file + * Definition of: + * 1. the specialized Dual class, + * 2. the specialized boost::graph_traits >class, + * 3. The free functions required by the various graph concepts. + */ + +// include this to avoid a VC15 warning +#include + +#include +#include +#include + +namespace CGAL { + +// The specialized Dual +class Dual > : + public Dual_arrangement_on_surface > +{ +public: + typedef Arrangement_2 Arrangement; + typedef typename Arrangement::Geometry_traits_2 Geometry_traits_2; + typedef typename Arrangement::Topology_traits Topology_traits; + +private: + typedef Dual_arrangement_on_surface Base; + +public: + /*! Default constructor. */ + Dual() : Base() {} + + /*! Constructor from an arrangement. */ + Dual(const Arrangement& arr) : Base(arr) {} +}; + +} + +namespace boost { + +// The specialized graph_traits +class graph_traits > > : + public CGAL::Graph_traits_dual_arr_on_surface_impl > +{}; + +} + +namespace CGAL { + +// Templates of free functions that handle +// graph_traits +// Ophir Setter +// Sebastien Loriot +// Efi Fogel + +#ifndef CGAL_GRAPH_TRAITS_DUAL_ARRANGEMENT_ON_SURFACE_2_H +#define CGAL_GRAPH_TRAITS_DUAL_ARRANGEMENT_ON_SURFACE_2_H + +#include + +/*! \file + * Definition of: + * 1. the specialized Dual class, + * 2. the specialized boost::graph_traits > class, + * 3. The free functions required by the various graph concepts. + */ + +// include this to avoid a VC15 warning +#include + +#include +#include +#include + +namespace CGAL { + +// The specialized Dual +class Dual > : + public Dual_arrangement_on_surface > +{ +public: + typedef Arrangement_on_surface_2 Arrangement; + typedef typename Arrangement::Geometry_traits_2 Geometry_traits_2; + typedef typename Arrangement::Topology_traits Topology_traits; + +private: + typedef Dual_arrangement_on_surface Base; + +public: + /*! Default constructor. */ + Dual() : Base() {} + + /*! Constructor from an arrangement. */ + Dual(const Arrangement& arr) : Base(arr) {} +}; + +} + +namespace boost { + +// The specialized graph_traits +class graph_traits > > : + public CGAL::Graph_traits_dual_arr_on_surface_impl + > +{}; + +} + +namespace CGAL { + +// Templates of free functions that handle +// graph_traits +// Ophir Setter +// Sebastien Loriot +// Efi Fogel + +#ifndef CGAL_GRAPH_TRAITS_DUAL_ARRANGEMENT_ON_SURFACE_WITH_HISTORY_2_H +#define CGAL_GRAPH_TRAITS_DUAL_ARRANGEMENT_ON_SURFACE_WITH_HISTORY_2_H + +#include + +/*! \file + * Definition of: + * 1. the specialized Dual class, + * 2. the specialized + * boost::graph_traits >class, + * 3. The free functions required by the various graph concepts. + */ + +// include this to avoid a VC15 warning +#include + +#include +#include +#include + +namespace CGAL { + +// The specialized Dual +class Dual > : + public Dual_arrangement_on_surface > +{ +public: + typedef Arrangement_on_surface_with_history_2 Arrangement; + typedef typename Arrangement::Geometry_traits_2 Geometry_traits_2; + typedef typename Arrangement::Topology_traits Topology_traits; + +private: + typedef Dual_arrangement_on_surface Base; + +public: + /*! Default constructor. */ + Dual() : Base() {} + + /*! Constructor from an arrangement. */ + Dual(const Arrangement& arr) : Base(arr) {} +}; + +} + +namespace boost { + +// The specialized +// graph_traits +class graph_traits > > : + public CGAL::Graph_traits_dual_arr_on_surface_impl + > +{}; + +} + +namespace CGAL { + +// Templates of free functions that handle +// graph_traits +// Ophir Setter +// Sebastien Loriot +// Efi Fogel + +#ifndef CGAL_GRAPH_TRAITS_DUAL_ARRANGEMENT_WITH_HISTORY_2_H +#define CGAL_GRAPH_TRAITS_DUAL_ARRANGEMENT_WITH_HISTORY_2_H + +#include + +/*! \file + * Definition of: + * 1. the specialized Dual class, + * 2. the specialized + * boost::graph_traits >class, + * 3. The free functions required by the various graph concepts. + */ + +// include this to avoid a VC15 warning +#include + +#include +#include +#include + +namespace CGAL { + +// The specialized Dual +class Dual > : + public Dual_arrangement_on_surface > +{ +public: + typedef Arrangement_with_history_2 Arrangement; + typedef typename Arrangement::Geometry_traits_2 Geometry_traits_2; + typedef typename Arrangement::Topology_traits Topology_traits; + +private: + typedef Dual_arrangement_on_surface Base; + +public: + /*! Default constructor. */ + Dual() : Base() {} + + /*! Constructor from an arrangement. */ + Dual(const Arrangement& arr) : Base(arr) {} +}; + +} + +namespace boost { + +// The specialized graph_traits +class graph_traits > > : + public CGAL::Graph_traits_dual_arr_on_surface_impl + > +{}; + +} + +namespace CGAL { + +// Templates of free functions that handle +// graph_traits -#---------------------------------------------------------------------# - -# note that these values shloud match to the values in test_configuration.h file - -CARTESIAN_KERNEL=0 -SIMPLE_CARTESIAN_KERNEL=1 -UNIVARIATE_ALGEBRAIC_KERNEL=2 - -SEGMENT_GEOM_TRAITS=0 -NON_CACHING_SEGMENT_GEOM_TRAITS=1 -POLYLINE_GEOM_TRAITS=2 -NON_CACHING_POLYLINE_GEOM_TRAITS=3 -POLYCURVE_CONIC_GEOM_TRAITS=14 -POLYCURVE_CIRCULAR_ARC_GEOM_TRAITS=15 -POLYCURVE_BEZIER_GEOM_TRAITS=16 -LINEAR_GEOM_TRAITS=4 -CORE_CONIC_GEOM_TRAITS=5 -LINE_ARC_GEOM_TRAITS=6 -CIRCULAR_ARC_GEOM_TRAITS=7 -CIRCULAR_LINE_ARC_GEOM_TRAITS=8 -CIRCLE_SEGMENT_GEOM_TRAITS=9 -BEZIER_GEOM_TRAITS=10 -GEODESIC_ARC_ON_SPHERE_GEOM_TRAITS=11 -RATIONAL_ARC_GEOM_TRAITS=12 -ALGEBRAIC_GEOM_TRAITS=13 -POLYCURVE_CONIC_GEOM_TRAITS=14 -POLYCURVE_CIRCULAR_ARC_GEOM_TRAITS=15 -POLYCURVE_BEZIER_GEOM_TRAITS=16 -FLAT_TORUS_GEOM_TRAITS=17 - -PLANAR_BOUNDED_TOPOL_TRAITS=0 -PLANAR_UNBOUNDED_TOPOL_TRAITS=1 -SPHERICAL_TOPOL_TRAITS=2 - -DOUBLE_NT=0 -MP_FLOAT_NT=1 -GMPZ_NT=2 -LEDA_RAT_NT=3 -QUOTIENT_MP_FLOAT_NT=4 -QUOTIENT_CGAL_GMPZ_NT=5 -CGAL_GMPQ_NT=6 -LAZY_LEDA_RAT_NT=7 -LAZY_CGAL_GMPQ_NT=8 -LAZY_QUOTIENT_MP_FLOAT_NT=9 -LEDA_REAL_NT=10 -CORE_EXPR_NT=11 -LAZY_GMPZ_NT=12 -LEDA_INT_NT=13 -CGAL_GMPZ_NT=14 -CORE_INT_NT=15 -CORE_RAT_NT=16 - -if [ -n "${CGAL_DISABLE_GMP}" ]; then - echo GMP is disable. Try to use LEDA instead. - GMPZ_NT=$LEDA_INT_NT - QUOTIENT_CGAL_GMPZ_NT=$LEDA_RAT_NT - CGAL_GMPQ_NT=$LEDA_RAT_NT - LAZY_CGAL_GMPQ_NT=$LAZY_LEDA_RAT_NT - LAZY_GMPZ_NT=$LAZY_LEDA_RAT_NT - CGAL_GMPZ_NT=$LEDA_INT_NT -fi - -COMPARE=1 -VERTEX=2 -IS_VERTICAL=3 -COMPARE_Y_AT_X=4 -COMPARE_Y_AT_X_LEFT=5 -COMPARE_Y_AT_X_RIGHT=6 -MAKE_X_MONOTONE=7 -INTERSECT=8 -SPLIT=9 -ARE_MERGEABLE=10 -MERGE=11 -ASSERTIONS=12 -CONSTRUCTOR=13 -COMPARE_X_AT_LIMIT=14 -COMPARE_X_NEAR_LIMIT=15 -COMPARE_X_ON_BOUNDARY=16 -COMPARE_X_NEAR_BOUNDARY=17 -COMPARE_Y_NEAR_BOUNDARY=18 -PARAMETER_SPACE_X=19 -PARAMETER_SPACE_Y=20 -X_ON_IDENTIFICATION=21 -Y_ON_IDENTIFICATION=22 -IS_BOUNDED=23 -IS_IN_X_RANGE=24 -COMPARE_Y_POSITION=25 -IS_BETWEEN_CW=26 -COMPARE_CW_AROUND_POINT=27 -PUSH_BACK=28 -PUSH_FRONT=29 -NUMBER_OF_POINTS=32 -COMPARE_ENDPOINTS_XY=33 -CONSTRUCT_OPPOSITE=34 -TRIM=35 - -#---------------------------------------------------------------------# -# configure -#---------------------------------------------------------------------# - -configure() -{ - echo "Configuring... " - rm -rf CMakeCache.txt CMakeFiles/ - echo "cmake --no-warn-unused-cli "$CMAKE_GENERATOR" -DRUNNING_CGAL_AUTO_TEST=TRUE \ - -DCGAL_DIR=\"$CGAL_DIR\" \ - -DCGAL_CXX_FLAGS:STRING=\"$TESTSUITE_CXXFLAGS -I../../include\" \ - -DCGAL_EXE_LINKER_FLAGS=\"$TESTSUITE_LDFLAGS\" \ - -DCMAKE_BUILD_TYPE=NOTFOUND \ - ." - if eval 'cmake --no-warn-unused-cli "$CMAKE_GENERATOR" -DRUNNING_CGAL_AUTO_TEST=TRUE \ - -DCGAL_DIR="$CGAL_DIR" \ - -DCGAL_CXX_FLAGS:STRING="$TESTSUITE_CXXFLAGS -I../../include" \ - -DCGAL_EXE_LINKER_FLAGS="$TESTSUITE_LDFLAGS" \ - -DCMAKE_BUILD_TYPE=NOTFOUND \ - .' ; then - - echo " successful configuration" >> $ERRORFILE - else - echo " ERROR: configuration" >> $ERRORFILE - fi -} - -compile_test_with_flags() -{ - local name=$1; - local type=$2; - local flags=$3; - - echo "Compiling $name $type ... " - if [ "${TEST_WITH_CMAKE}" != "FALSE" ]; then - export TESTSUITE_CXXFLAGS="$flags" - configure - if eval '${MAKE_CMD} VERBOSE=1 -fMakefile \ - $name' ; then - echo " successful compilation of $name $type" >> $ERRORFILE; - SUCCESS="y" - else - echo " ERROR: compilation of $name $type" >> $ERRORFILE; - SUCCESS="" - fi - else - if eval 'make CGAL_MAKEFILE=$CGAL_MAKEFILE \ - TESTSUITE_CXXFLAGS="$TESTSUITE_CXXFLAGS" \ - TESTSUITE_LDFLAGS="$TESTSUITE_LDFLAGS" $name'; then - echo " successful compilation of $name $type" >> $ERRORFILE; - SUCCESS="y" - else - echo " ERROR: compilation of $name $type" >> $ERRORFILE; - SUCCESS="" - fi - fi -} - -run_test() -{ - # $1 - executable name - - basedata=`basename "$5"` - OUTPUTFILE="ProgramOutput.$1" - rm -f $OUTPUTFILE - COMMAND="./$1" - if [ -f $1.cmd ] ; then - COMMAND="$COMMAND `cat $1.cmd`" - fi - if [ -f $1.cin ] ; then - COMMAND="cat $1.cin | $COMMAND" - fi - OUTPUTFILE="$OUTPUTFILE.$PLATFORM" - echo "Executing $1 ($2) ... " - ulimit -t 3600 2> /dev/null - if eval $COMMAND > $OUTPUTFILE 2>&1 ; then - echo " successful execution of $1" >> $ERRORFILE - else - echo " ERROR: execution of $1" >> $ERRORFILE - cat $OUTPUTFILE >> $FULL_ERROR_DESCRIPTION_FILE - fi -} - -run_test_with_flags() -{ - # $1 - executable name - # $2 - test substring name - - basedata=`basename "$5"` - OUTPUTFILE="ProgramOutput.$1" - rm -f $OUTPUTFILE - COMMAND="./$1" - if [ -f $1.cmd ] ; then - COMMAND="$COMMAND `cat $1.cmd`" - elif [ -f $1.$2.cmd ] ; then - COMMAND="$COMMAND `cat $1.$2.cmd`" - OUTPUTFILE=$OUTPUTFILE.`echo $2 | tr '/' '.'` - fi - if [ -f $1.cin ] ; then - COMMAND="cat $1.cin | $COMMAND" - elif [ -f $1.$2.cin ] ; then - COMMAND="cat $1.$2.cin | $COMMAND" - OUTPUTFILE=$OUTPUTFILE.`echo $2 | tr '/' '.'` - fi - OUTPUTFILE="$OUTPUTFILE.$PLATFORM" - echo "Executing $1 ($2) ... " - ulimit -t 3600 2> /dev/null - if eval $COMMAND > $OUTPUTFILE 2>&1 ; then - echo " successful execution of $1 ($2)" >> $ERRORFILE - else - echo " ERROR: execution of $1 ($2)" >> $ERRORFILE - cat $OUTPUTFILE >> $FULL_ERROR_DESCRIPTION_FILE - fi -} - -run_test_alt() -{ - basedata=`basename "$5"` - OUTPUTFILE=ProgramOutput.$1.`echo $5 | tr '/' '.'`.$6 - #echo ****generating file $OUTPUTFILE - # dirdata=`dirname "$datafile"` - rm -f $OUTPUTFILE - COMMAND="./$1" - echo "Executing $1 $5 $6 ... " - if eval $COMMAND $2 $3 $4 $5 $6 > $OUTPUTFILE 2>&1 ; then - echo " successful execution of $5 $6" >> $ERRORFILE - else - echo " ERROR: execution of $5 $6" >> $ERRORFILE - cat $OUTPUTFILE >> $FULL_ERROR_DESCRIPTION_FILE - fi -} - -run_trapped_test() -{ - #local name=$1; - #local datafile=$2; - - if [ "${OSTYPE}" != "cygwin" ]; then - ulimit -t 1200 - run_test_alt $1 $2 $3 $4 $5 $6 - else - run_test_alt $1 $2 $3 $4 $5 $6 & - WPID=$! - trap "kill -9 $WPID" INT - (sleep 1200; kill -9 $WPID) > /dev/null 2>&1 & - SPID=$! - wait $WPID > /dev/null 2>&1 - # RES=$? - kill -9 $SPID > /dev/null 2>&1 - # return $RES - fi -} - -clean_tests() -{ - if [ "${TEST_WITH_CMAKE}" != "FALSE" ]; then - # - # The clean target generated by CMake under cygwin - # always fails for some reason - # - if ! ( uname | grep -q "CYGWIN" ) ; then - make -fMakefile clean - fi - fi - eval "make clean > /dev/null 2>&1" -} - -compile_and_run() -{ - local name=$1; - - echo "Compiling $name ... " - if [ "${TEST_WITH_CMAKE}" != "FALSE" ]; then - if eval '${MAKE_CMD} VERBOSE=1 -fMakefile $1' ; then - echo " successful compilation of $1" >> $ERRORFILE - SUCCESS="y" - else - echo " ERROR: compilation of $1" >> $ERRORFILE - SUCCESS="" - fi - else - SUCCESS="y" - #TESTSUITE_CXXFLAGS="$TESTSUITE_CXXFLAGS" - TESTSUITE_CXXFLAGS="" - TESTSUITE_LDFLAGS="$TESTSUITE_LDFLAGS" - if eval 'make CGAL_MAKEFILE=$CGAL_MAKEFILE \ - TESTSUITE_CXXFLAGS="$TESTSUITE_CXXFLAGS" \ - TESTSUITE_LDFLAGS="$TESTSUITE_LDFLAGS" $name' ; then - echo " successful compilation of $name" >> $ERRORFILE - else - echo " ERROR: compilation of $name" >> $ERRORFILE - SUCCESS="" - fi - fi - - if [ "${TEST_WITH_CMAKE}" != "FALSE" ]; then - if [ -n "$DO_RUN" ] ; then - if [ -n "${SUCCESS}" ] ; then - run_test $1 - else - echo " ERROR: not executed $1" >> $ERRORFILE - fi - fi - else - if [ -n "${SUCCESS}" ] ; then - OUTPUTFILE=ProgramOutput.$name.$PLATFORM - rm -f $OUTPUTFILE - COMMAND="./$name" - if [ -f $name.cmd ] ; then - COMMAND="$COMMAND `cat $name.cmd`" - fi - if [ -f $name.cin ] ; then - COMMAND="cat $name.cin | $COMMAND" - fi - echo "Executing $name ... " - echo " " - if eval $COMMAND > $OUTPUTFILE 2>&1 ; then - echo " successful execution of $name" >> $ERRORFILE - else - echo " ERROR: execution of $name" >> $ERRORFILE - cat $OUTPUTFILE >> $FULL_ERROR_DESCRIPTION_FILE - fi - else - echo " ERROR: not executed $name" >> $ERRORFILE - fi - fi - clean_tests -} - -compile_and_run_trapped_test() -{ - local name=$1; - - if [ "${OSTYPE}" != "cygwin" ]; then - ulimit -t 1200 - compile_and_run $1 - else - compile_and_run $1 & - WPID=$! - trap "kill -9 $WPID" INT - (sleep 1200; kill -9 $WPID) > /dev/null 2>&1 & - SPID=$! - wait $WPID > /dev/null 2>&1 - # RES=$? - kill -9 $SPID > /dev/null 2>&1 - # return $RES - fi -} - -execute_commands_old_structure() -{ - -# at first the tests where designed in such way that all the test input was -# in one file, the points, the xcurves, the curves and the execution block -# this function is used to execute the old tests, one may use it when needed -# but you should remember that separating the input into smaller files creates -# much more modular and comfortable test suite - -# the old structure is default, so this function executes all commands -# except the commands that are given as arguments - - - commands_indicator[COMPARE]=1 - commands_indicator[VERTEX]=1 - commands_indicator[IS_VERTICAL]=1 - commands_indicator[COMPARE_Y_AT_X]=1 - commands_indicator[COMPARE_Y_AT_X_LEFT]=1 - commands_indicator[COMPARE_Y_AT_X_RIGHT]=1 - commands_indicator[MAKE_X_MONOTONE]=1 - commands_indicator[INTERSECT]=1 - commands_indicator[SPLIT]=1 - commands_indicator[ARE_MERGEABLE]=1 - commands_indicator[MERGE]=1 - commands_indicator[ASSERTIONS]=1 - commands_indicator[CONSTRUCTOR]=1 - i=1 - if [ $# -gt 2 ] ; then - for arg in $* ; do - if [ $i -gt 2 ] ; then - commands_indicator[$arg]=0 - fi - let "i+=1" - done - fi - if [ ${commands_indicator[$COMPARE]} -ne 0 ] ; then - run_trapped_test test_traits \ - data/compare.pt data/empty.zero \ - data/empty.zero data/compare $2 - fi - if [ ${commands_indicator[$VERTEX]} -ne 0 ] ; then - run_trapped_test test_traits \ - data/$1/vertex.pt data/$1/vertex.xcv \ - data/empty.zero data/$1/vertex $2 - fi - if [ ${commands_indicator[$IS_VERTICAL]} -ne 0 ] ; then - run_trapped_test test_traits \ - data/empty.zero data/$1/is_vertical.xcv data/empty.zero \ - data/$1/is_vertical $2 - fi - if [ ${commands_indicator[$COMPARE_Y_AT_X]} -ne 0 ] ; then - run_trapped_test test_traits \ - data/$1/compare_y_at_x.pt data/$1/compare_y_at_x.xcv \ - data/empty.zero data/$1/compare_y_at_x $2 - fi - if [ ${commands_indicator[$COMPARE_Y_AT_X_LEFT]} -ne 0 ] ; then - run_trapped_test test_traits \ - data/$1/compare_y_at_x_left.pt data/$1/compare_y_at_x_left.xcv \ - data/empty.zero data/$1/compare_y_at_x_left $2 - fi - if [ ${commands_indicator[$COMPARE_Y_AT_X_RIGHT]} -ne 0 ] ; then - run_trapped_test test_traits \ - data/$1/compare_y_at_x_right.pt data/$1/compare_y_at_x_right.xcv \ - data/empty.zero data/$1/compare_y_at_x_right $2 - fi - if [ ${commands_indicator[$MAKE_X_MONOTONE]} -ne 0 ] ; then - run_trapped_test test_traits \ - data/empty.zero data/$1/make_x_monotone.xcv \ - data/$1/make_x_monotone.cv data/$1/make_x_monotone $2 - fi - if [ ${commands_indicator[$INTERSECT]} -ne 0 ] ; then - run_trapped_test test_traits \ - data/$1/intersect.pt data/$1/intersect.xcv \ - data/empty.zero data/$1/intersect $2 - fi - if [ ${commands_indicator[$SPLIT]} -ne 0 ] ; then - run_trapped_test test_traits \ - data/$1/split.pt data/$1/split.xcv \ - data/empty.zero data/$1/split $2 - fi - if [ ${commands_indicator[$ARE_MERGEABLE]} -ne 0 ] ; then - run_trapped_test test_traits \ - data/empty.zero data/$1/are_mergeable.xcv \ - data/empty.zero data/$1/are_mergeable $2 - fi - if [ ${commands_indicator[$MERGE]} -ne 0 ] ; then - run_trapped_test test_traits \ - data/empty.zero data/$1/merge.xcv \ - data/empty.zero data/$1/merge $2 - fi - if [ ${commands_indicator[$ASSERTIONS]} -ne 0 ] ; then - run_trapped_test test_traits \ - data/$1/assertions.pt data/$1/assertions.xcv \ - data/empty.zero data/$1/assertions $2 - fi - if [ ${commands_indicator[$CONSTRUCTOR]} -ne 0 ] ; then - run_trapped_test test_traits \ - data/empty.zero data/$1/constructor.xcv \ - data/$1/constructor.cv data/$1/constructor $2 - fi -} - -execute_commands_new_structure() -{ - -# the new design for the tests includes separation of the test input into 4 -# parts: points file, xcurves file, curves file and execution block file. -# one may reuse the input files for the various tests - -# the new structure is not default, so this function executes only -# commands that are given as arguments - - commands_indicator[COMPARE]=0 - commands_indicator[VERTEX]=0 - commands_indicator[IS_VERTICAL]=0 - commands_indicator[COMPARE_X_AT_LIMIT]=0 - commands_indicator[COMPARE_X_NEAR_LIMIT]=0 - commands_indicator[COMPARE_X_ON_BOUNDARY]=0 - commands_indicator[COMPARE_X_NEAR_BOUNDARY]=0 - commands_indicator[COMPARE_Y_NEAR_BOUNDARY]=0 - commands_indicator[PARAMETER_SPACE_X]=0 - commands_indicator[PARAMETER_SPACE_Y]=0 - commands_indicator[COMPARE_Y_AT_X]=0 - commands_indicator[COMPARE_Y_AT_X_LEFT]=0 - commands_indicator[COMPARE_Y_AT_X_RIGHT]=0 - commands_indicator[MAKE_X_MONOTONE]=0 - commands_indicator[INTERSECT]=0 - commands_indicator[SPLIT]=0 - commands_indicator[ARE_MERGEABLE]=0 - commands_indicator[MERGE]=0 - commands_indicator[ASSERTIONS]=0 - commands_indicator[CONSTRUCTOR]=0 - commands_indicator[EQUAL]=0 - commands_indicator[PUSH_BACK]=0 - commands_indicator[PUSH_FRONT]=0 - commands_indicator[NUMBER_OF_POINTS]=0 - commands_indicator[COMPARE_ENDPOINTS_XY]=0 - commands_indicator[CONSTRUCT_OPPOSITE]=0 - commands_indicator[TRIM]=0 - i=1 - if [ $# -gt 2 ] ; then - for arg in $* ; do - if [ $i -gt 2 ] ; then - commands_indicator[$arg]=1 - fi - let "i+=1" - done - fi - if [ ${commands_indicator[$COMPARE]} -ne 0 ] ; then - run_trapped_test test_traits data/$1/points \ - data/$1/xcurves data/$1/curves data/$1/compare $2 - fi - if [ ${commands_indicator[$VERTEX]} -ne 0 ] ; then - run_trapped_test test_traits data/$1/points \ - data/$1/xcurves data/$1/curves data/$1/vertex $2 - fi - if [ ${commands_indicator[$IS_VERTICAL]} -ne 0 ] ; then - run_trapped_test test_traits data/$1/points \ - data/$1/xcurves data/$1/curves data/$1/is_vertical $2 - fi - if [ ${commands_indicator[$COMPARE_X_AT_LIMIT]} -ne 0 ] ; then - run_trapped_test test_traits data/$1/points \ - data/$1/xcurves data/$1/curves data/$1/compare_x_at_limit $2 - fi - if [ ${commands_indicator[$COMPARE_X_NEAR_LIMIT]} -ne 0 ] ; then - run_trapped_test test_traits data/$1/points \ - data/$1/xcurves data/$1/curves data/$1/compare_x_near_limit $2 - fi - if [ ${commands_indicator[$COMPARE_X_ON_BOUNDARY]} -ne 0 ] ; then - run_trapped_test test_traits data/$1/points \ - data/$1/xcurves data/$1/curves data/$1/compare_x_on_boundary $2 - fi - if [ ${commands_indicator[$COMPARE_X_NEAR_BOUNDARY]} -ne 0 ] ; then - run_trapped_test test_traits data/$1/points \ - data/$1/xcurves data/$1/curves data/$1/compare_x_near_boundary $2 - fi - if [ ${commands_indicator[$COMPARE_Y_NEAR_BOUNDARY]} -ne 0 ] ; then - run_trapped_test test_traits data/$1/points \ - data/$1/xcurves data/$1/curves data/$1/compare_y_near_boundary $2 - fi - if [ ${commands_indicator[$PARAMETER_SPACE_X]} -ne 0 ] ; then - run_trapped_test test_traits data/$1/points \ - data/$1/xcurves data/$1/curves data/$1/parameter_space_x $2 - fi - if [ ${commands_indicator[$PARAMETER_SPACE_Y]} -ne 0 ] ; then - run_trapped_test test_traits data/$1/points \ - data/$1/xcurves data/$1/curves data/$1/parameter_space_y $2 - fi - if [ ${commands_indicator[$COMPARE_Y_AT_X]} -ne 0 ] ; then - run_trapped_test test_traits data/$1/points \ - data/$1/xcurves data/$1/curves data/$1/compare_y_at_x $2 - fi - if [ ${commands_indicator[$COMPARE_Y_AT_X_LEFT]} -ne 0 ] ; then - run_trapped_test test_traits data/$1/points \ - data/$1/xcurves data/$1/curves data/$1/compare_y_at_x_left $2 - fi - if [ ${commands_indicator[$COMPARE_Y_AT_X_RIGHT]} -ne 0 ] ; then - run_trapped_test test_traits data/$1/points \ - data/$1/xcurves data/$1/curves data/$1/compare_y_at_x_right $2 - fi - if [ ${commands_indicator[$MAKE_X_MONOTONE]} -ne 0 ] ; then - run_trapped_test test_traits data/$1/points \ - data/$1/xcurves data/$1/curves data/$1/make_x_monotone $2 - fi - if [ ${commands_indicator[$INTERSECT]} -ne 0 ] ; then - run_trapped_test test_traits data/$1/points \ - data/$1/xcurves data/$1/curves data/$1/intersect $2 - fi - if [ ${commands_indicator[$SPLIT]} -ne 0 ] ; then - run_trapped_test test_traits data/$1/points \ - data/$1/xcurves data/$1/curves data/$1/split $2 - fi - if [ ${commands_indicator[$ARE_MERGEABLE]} -ne 0 ] ; then - run_trapped_test test_traits data/$1/points \ - data/$1/xcurves data/$1/curves data/$1/are_mergeable $2 - fi - if [ ${commands_indicator[$MERGE]} -ne 0 ] ; then - run_trapped_test test_traits data/$1/points \ - data/$1/xcurves data/$1/curves data/$1/merge $2 - fi - if [ ${commands_indicator[$ASSERTIONS]} -ne 0 ] ; then - run_trapped_test test_traits data/$1/points \ - data/$1/xcurves data/$1/curves data/$1/assertions $2 - fi - if [ ${commands_indicator[$CONSTRUCTOR]} -ne 0 ] ; then - run_trapped_test test_traits data/$1/points \ - data/$1/xcurves data/$1/curves data/$1/constructor $2 - fi - if [ ${commands_indicator[$EQUAL]} -ne 0 ] ; then - run_trapped_test test_traits data/$1/points \ - data/$1/xcurves data/$1/curves data/$1/equal $2 - fi - if [ ${commands_indicator[$PUSH_BACK]} -ne 0 ] ; then - run_trapped_test test_traits data/$1/points \ - data/$1/xcurves data/$1/curves data/$1/push_back $2 - fi - if [ ${commands_indicator[$PUSH_FRONT]} -ne 0 ] ; then - run_trapped_test test_traits data/$1/points \ - data/$1/xcurves data/$1/curves data/$1/push_front $2 - fi - if [ ${commands_indicator[$NUMBER_OF_POINTS]} -ne 0 ] ; then - run_trapped_test test_traits data/$1/points \ - data/$1/xcurves data/$1/curves data/$1/number_of_points $2 - fi - if [ ${commands_indicator[$COMPARE_ENDPOINTS_XY]} -ne 0 ] ; then - run_trapped_test test_traits data/$1/points \ - data/$1/xcurves data/$1/curves data/$1/compare_endpoints_xy $2 - fi - if [ ${commands_indicator[$CONSTRUCT_OPPOSITE]} -ne 0 ] ; then - run_trapped_test test_traits data/$1/points \ - data/$1/xcurves data/$1/curves data/$1/construct_opposite $2 - fi - if [ ${commands_indicator[$TRIM]} -ne 0 ] ; then - run_trapped_test test_traits data/$1/points \ - data/$1/xcurves data/$1/curves data/$1/trim $2 - fi -} - -execute_commands_traits_adaptor() -{ - -# the new structure is not default, so this function executes only -# commands that are given as arguments - - commands_indicator[PARAMETER_SPACE_X]=0 - commands_indicator[PARAMETER_SPACE_Y]=0 - commands_indicator[COMPARE_X_AT_LIMIT]=0 - commands_indicator[COMPARE_X_NEAR_LIMIT]=0 - commands_indicator[COMPARE_X_ON_BOUNDARY]=0 - commands_indicator[COMPARE_X_NEAR_BOUNDARY]=0 - commands_indicator[COMPARE_Y_NEAR_BOUNDARY]=0 - commands_indicator[COMPARE_Y_AT_X_LEFT]=0 - commands_indicator[ARE_MERGEABLE]=0 - commands_indicator[MERGE]=0 - commands_indicator[X_ON_IDENTIFICATION]=0 - commands_indicator[Y_ON_IDENTIFICATION]=0 - commands_indicator[IS_BOUNDED]=0 - commands_indicator[IS_IN_X_RANGE]=0 - commands_indicator[COMPARE_Y_POSITION]=0 - commands_indicator[IS_BETWEEN_CW]=0 - commands_indicator[COMPARE_CW_AROUND_POINT]=0 - - i=1 - if [ $# -gt 2 ] ; then - for arg in $* ; do - if [ $i -gt 2 ] ; then - commands_indicator[$arg]=1 - fi - let "i+=1" - done - fi - - if [ ${commands_indicator[$PARAMETER_SPACE_X]} -ne 0 ] ; then - run_trapped_test test_traits_adaptor data/test_adaptor/$1/points \ - data/test_adaptor/$1/xcurves data/test_adaptor/$1/curves \ - data/test_adaptor/$1/parameter_space_x $2 - fi - if [ ${commands_indicator[$PARAMETER_SPACE_Y]} -ne 0 ] ; then - run_trapped_test test_traits_adaptor data/test_adaptor/$1/points \ - data/test_adaptor/$1/xcurves data/test_adaptor/$1/curves \ - data/test_adaptor/$1/parameter_space_y $2 - fi - if [ ${commands_indicator[$COMPARE_X_AT_LIMIT]} -ne 0 ] ; then - run_trapped_test test_traits_adaptor data/test_adaptor/$1/points \ - data/test_adaptor/$1/xcurves data/test_adaptor/$1/curves \ - data/test_adaptor/$1/compare_x_at_limit $2 - fi - if [ ${commands_indicator[$COMPARE_X_NEAR_LIMIT]} -ne 0 ] ; then - run_trapped_test test_traits_adaptor data/test_adaptor/$1/points \ - data/test_adaptor/$1/xcurves data/test_adaptor/$1/curves \ - data/test_adaptor/$1/compare_x_near_limit $2 - fi - - if [ ${commands_indicator[$COMPARE_X_ON_BOUNDARY]} -ne 0 ] ; then - run_trapped_test test_traits_adaptor data/test_adaptor/$1/points \ - data/test_adaptor/$1/xcurves data/test_adaptor/$1/curves \ - data/test_adaptor/$1/compare_x_on_boundary $2 - fi - if [ ${commands_indicator[$COMPARE_X_NEAR_BOUNDARY]} -ne 0 ] ; then - run_trapped_test test_traits_adaptor data/test_adaptor/$1/points \ - data/test_adaptor/$1/xcurves data/test_adaptor/$1/curves \ - data/test_adaptor/$1/compare_x_near_boundary $2 - fi - - if [ ${commands_indicator[$COMPARE_Y_NEAR_BOUNDARY]} -ne 0 ] ; then - run_trapped_test test_traits_adaptor data/test_adaptor/$1/points \ - data/test_adaptor/$1/xcurves data/test_adaptor/$1/curves \ - data/test_adaptor/$1/compare_y_near_boundary $2 - fi - if [ ${commands_indicator[$COMPARE_Y_AT_X_LEFT]} -ne 0 ] ; then - run_trapped_test test_traits_adaptor data/test_adaptor/$1/points \ - data/test_adaptor/$1/xcurves data/test_adaptor/$1/curves \ - data/test_adaptor/$1/compare_y_at_x_left $2 - fi - if [ ${commands_indicator[$ARE_MERGEABLE]} -ne 0 ] ; then - run_trapped_test test_traits_adaptor data/test_adaptor/$1/points \ - data/test_adaptor/$1/xcurves data/test_adaptor/$1/curves \ - data/test_adaptor/$1/are_mergeable $2 - fi - if [ ${commands_indicator[$MERGE]} -ne 0 ] ; then - run_trapped_test test_traits_adaptor data/test_adaptor/$1/points \ - data/test_adaptor/$1/xcurves data/test_adaptor/$1/curves \ - data/test_adaptor/$1/merge $2 - fi - if [ ${commands_indicator[X_ON_IDENTIFICATION]} -ne 0 ] ; then - run_trapped_test test_traits_adaptor data/test_adaptor/$1/points \ - data/test_adaptor/$1/xcurves data/test_adaptor/$1/curves \ - data/test_adaptor/$1/x_on_idintification $2 - fi - if [ ${commands_indicator[Y_ON_IDENTIFICATION]} -ne 0 ] ; then - run_trapped_test test_traits_adaptor data/test_adaptor/$1/points \ - data/test_adaptor/$1/xcurves data/test_adaptor/$1/curves \ - data/test_adaptor/$1/x_on_idintification $2 - fi - if [ ${commands_indicator[IS_BOUNDED]} -ne 0 ] ; then - run_trapped_test test_traits_adaptor data/test_adaptor/$1/points \ - data/test_adaptor/$1/xcurves data/test_adaptor/$1/curves \ - data/test_adaptor/$1/is_bounded $2 - fi - if [ ${commands_indicator[IS_IN_X_RANGE]} -ne 0 ] ; then - run_trapped_test test_traits_adaptor data/test_adaptor/$1/points \ - data/test_adaptor/$1/xcurves data/test_adaptor/$1/curves \ - data/test_adaptor/$1/is_in_x_range $2 - fi - if [ ${commands_indicator[COMPARE_Y_POSITION]} -ne 0 ] ; then - run_trapped_test test_traits_adaptor data/test_adaptor/$1/points \ - data/test_adaptor/$1/xcurves data/test_adaptor/$1/curves \ - data/test_adaptor/$1/compare_y_position $2 - fi - if [ ${commands_indicator[IS_BETWEEN_CW]} -ne 0 ] ; then - run_trapped_test test_traits_adaptor data/test_adaptor/$1/points \ - data/test_adaptor/$1/xcurves data/test_adaptor/$1/curves \ - data/test_adaptor/$1/is_between_cw $2 - fi - if [ ${commands_indicator[COMPARE_CW_AROUND_POINT]} -ne 0 ] ; then - run_trapped_test test_traits_adaptor data/test_adaptor/$1/points \ - data/test_adaptor/$1/xcurves data/test_adaptor/$1/curves \ - data/test_adaptor/$1/compare_cw_around_point $2 - fi -} - -#---------------------------------------------------------------------# -# traits adaptor (segments traits) -#---------------------------------------------------------------------# -test_segment_traits_adaptor() -{ - local nt=$QUOTIENT_MP_FLOAT_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$SEGMENT_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; - - compile_test_with_flags test_traits_adaptor segments "$flags" - if [ -n "${SUCCESS}" ] ; then - execute_commands_traits_adaptor segments segments_traits_adaptor \ - COMPARE_Y_POSITION COMPARE_CW_AROUND_POINT COMPARE_Y_AT_X_LEFT \ - ARE_MERGEABLE MERGE IS_IN_X_RANGE IS_BETWEEN_CW - else - echo " ERROR: not executed test_traits_adaptor segment_traits" >> $ERRORFILE - fi - clean_tests -} - -#---------------------------------------------------------------------# -# traits adaptor (linear traits) -#---------------------------------------------------------------------# -test_linear_traits_adaptor() -{ - local nt=$QUOTIENT_MP_FLOAT_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$LINEAR_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; - - compile_test_with_flags test_traits_adaptor linear "$flags" - if [ -n "${SUCCESS}" ] ; then - execute_commands_traits_adaptor linear linear_traits_adaptor \ - COMPARE_Y_AT_X_LEFT ARE_MERGEABLE MERGE IS_IN_X_RANGE \ - COMPARE_Y_POSITION IS_BETWEEN_CW COMPARE_CW_AROUND_POINT - else - echo " ERROR: not executed test_traits_adaptor linear_traits" >> $ERRORFILE - fi - clean_tests -} - -#---------------------------------------------------------------------# -# traits adaptor (spherical arcs traits) -#---------------------------------------------------------------------# -test_spherical_arcs_traits_adaptor() -{ - local nt=$CGAL_GMPQ_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$GEODESIC_ARC_ON_SPHERE_GEOM_TRAITS; - local topol_traits=$SPHERICAL_TOPOL_TRAITS - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits -DTEST_TOPOL_TRAITS=$topol_traits"; - - compile_test_with_flags test_traits_adaptor geodesic_arcs_on_sphere "$flags" - if [ -n "${SUCCESS}" ] ; then - execute_commands_traits_adaptor spherical_arcs spherical_arcs_traits_adaptor \ - COMPARE_Y_AT_X_LEFT ARE_MERGEABLE MERGE IS_IN_X_RANGE \ - COMPARE_Y_POSITION IS_BETWEEN_CW COMPARE_CW_AROUND_POINT - else - echo " ERROR: not executed test_traits_adaptor spherical_arcs_traits" >> $ERRORFILE - fi - clean_tests -} - -#---------------------------------------------------------------------# -# compile and run test with traits -#---------------------------------------------------------------------# -compile_and_run_with_flags() -{ - local name=$1; - local type=$2; - local flags=$3; - - compile_test_with_flags $name $type "$flags" - if [ -n "${SUCCESS}" ] ; then - if [ -n "$DO_RUN" ] ; then - run_test_with_flags $name $type - fi - else - echo " ERROR: not executed construction of segments" >> $ERRORFILE - fi - clean_tests -} - -#---------------------------------------------------------------------# -# construction with segments -#---------------------------------------------------------------------# -test_construction_segments() -{ - local nt=$CGAL_GMPQ_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$SEGMENT_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; - compile_and_run_with_flags test_construction segments "$flags" -} - -#---------------------------------------------------------------------# -# construction with linear curves -#---------------------------------------------------------------------# -test_construction_linear_curves() -{ - local nt=$CGAL_GMPQ_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$LINEAR_GEOM_TRAITS; - local topol_traits=$PLANAR_UNBOUNDED_TOPOL_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits -DTEST_TOPOL_TRAITS=$topol_traits"; - compile_and_run_with_flags test_construction linear "$flags" -} - -#---------------------------------------------------------------------# -# construction with geodesic arcs on the sphere -#---------------------------------------------------------------------# -test_construction_spherical_arcs() -{ - local nt=$CGAL_GMPQ_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$GEODESIC_ARC_ON_SPHERE_GEOM_TRAITS; - local topol_traits=$SPHERICAL_TOPOL_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits -DTEST_TOPOL_TRAITS=$topol_traits"; - compile_and_run_with_flags test_construction geodesic_arcs_on_sphere "$flags" -} - -#---------------------------------------------------------------------# -# construction with polylines -#---------------------------------------------------------------------# -test_construction_polylines() -{ - local nt=$CGAL_GMPQ_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$POLYLINE_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; - compile_and_run_with_flags test_construction polylines "$flags" -} - -#---------------------------------------------------------------------# -# overlay with segments -#---------------------------------------------------------------------# -test_overlay_segments() -{ - local nt=$CGAL_GMPQ_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$SEGMENT_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; - compile_and_run_with_flags test_overlay segments "$flags" -} - -#---------------------------------------------------------------------# -# overlay with geodesic arcs on the sphere -#---------------------------------------------------------------------# -test_overlay_spherical_arcs() -{ - local nt=$CGAL_GMPQ_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$GEODESIC_ARC_ON_SPHERE_GEOM_TRAITS; - local topol_traits=$SPHERICAL_TOPOL_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits -DTEST_TOPOL_TRAITS=$topol_traits"; - compile_and_run_with_flags test_overlay geodesic_arcs_on_sphere "$flags" -} - -#---------------------------------------------------------------------# -# point location with segments -#---------------------------------------------------------------------# -test_point_location_segments() -{ - local nt=$CGAL_GMPQ_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$SEGMENT_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; - compile_and_run_with_flags test_point_location segments "$flags" -} - -# For backward compatibility -test_point_location_segments_version() -{ - local nt=$CGAL_GMPQ_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$SEGMENT_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits -DCGAL_ARR_POINT_LOCATION_VERSION=1"; - compile_and_run_with_flags test_point_location segments "$flags" -} - -# For backward compatibility -test_point_location_segments_conversion() -{ - local nt=$CGAL_GMPQ_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$SEGMENT_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits -DCGAL_ARR_POINT_LOCATION_CONVERSION"; - compile_and_run_with_flags test_point_location segments "$flags" -} - -#---------------------------------------------------------------------# -# point location dynamic with segments -#---------------------------------------------------------------------# -test_point_location_dynamic_segments() -{ - local nt=$CGAL_GMPQ_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$SEGMENT_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; - compile_and_run_with_flags test_point_location_dynamic segments "$flags" -} - -#---------------------------------------------------------------------# -# point location with circle segments -#---------------------------------------------------------------------# -test_point_location_circle_segments() -{ - local nt=$CGAL_GMPQ_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$CIRCLE_SEGMENT_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; - compile_and_run_with_flags test_point_location circle_segments "$flags" -} - -#---------------------------------------------------------------------# -# point location with linear objects -#---------------------------------------------------------------------# -test_point_location_linear() -{ - local nt=$CGAL_GMPQ_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$LINEAR_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; - compile_and_run_with_flags test_point_location linear "$flags" -} - -#---------------------------------------------------------------------# -# batchecd point location with segments -#---------------------------------------------------------------------# -test_batched_point_location_segments() -{ - local nt=$CGAL_GMPQ_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$SEGMENT_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; - compile_and_run_with_flags test_batched_point_location segments "$flags" -} - -#---------------------------------------------------------------------# -# batchecd point location with linear objects -#---------------------------------------------------------------------# -test_batched_point_location_linear() -{ - local nt=$CGAL_GMPQ_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$LINEAR_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; - compile_and_run_with_flags test_batched_point_location linear "$flags" -} - -#---------------------------------------------------------------------# -# batchecd point location with geodesic arcs on the sphere -#---------------------------------------------------------------------# -test_batched_point_location_spherical_arcs() -{ - local nt=$CGAL_GMPQ_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$GEODESIC_ARC_ON_SPHERE_GEOM_TRAITS; - local topol_traits=$SPHERICAL_TOPOL_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits -DTEST_TOPOL_TRAITS=$topol_traits"; - compile_and_run_with_flags test_batched_point_location geodesic_arcs_on_sphere "$flags" -} - -#---------------------------------------------------------------------# -# vertical decomposition with segments -#---------------------------------------------------------------------# -test_vertical_decomposition_segments() -{ - local nt=$CGAL_GMPQ_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$SEGMENT_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; - compile_and_run_with_flags test_vertical_decomposition segments "$flags" -} - -#---------------------------------------------------------------------# -# vertical decomposition with linear objects -#---------------------------------------------------------------------# -test_vertical_decomposition_linear() -{ - local nt=$CGAL_GMPQ_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$LINEAR_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; - compile_and_run_with_flags test_vertical_decomposition linear "$flags" -} - -#---------------------------------------------------------------------# -# vertical decomposition with geodesic arcs on the sphere -#---------------------------------------------------------------------# -test_vertical_decomposition_spherical_arcs() -{ - local nt=$CGAL_GMPQ_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$LINEAR_GEOM_TRAITS; - local topol_traits=$SPHERICAL_TOPOL_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits -DTEST_TOPOL_TRAITS=$topol_traits"; - compile_and_run_with_flags test_vertical_decomposition geodesic_arcs_on_sphere "$flags" -} - -#---------------------------------------------------------------------# -# segment traits -#---------------------------------------------------------------------# -test_segment_traits() -{ - local nt=$QUOTIENT_MP_FLOAT_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$SEGMENT_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; - - compile_test_with_flags test_traits segments "$flags" - if [ -n "${SUCCESS}" ] ; then - execute_commands_old_structure segments segment_traits \ - VERTEX IS_VERTICAL COMPARE_Y_AT_X COMPARE_Y_AT_X_LEFT CONSTRUCTOR \ - COMPARE_Y_AT_X_RIGHT ARE_MERGEABLE - - execute_commands_new_structure segments segment_traits \ - IS_VERTICAL COMPARE_Y_AT_X COMPARE_Y_AT_X_LEFT ARE_MERGEABLE - - run_trapped_test test_traits \ - data/segments/vertex.pt data/segments/xcurves \ - data/empty.zero data/segments/vertex segment_traits - else - echo " ERROR: not executed test_traits segment_traits" >> $ERRORFILE - fi - clean_tests -} - -#---------------------------------------------------------------------# -# non-caching segment traits -#---------------------------------------------------------------------# -test_non_caching_segment_traits() -{ - local nt=$CGAL_GMPQ_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$NON_CACHING_SEGMENT_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; - - compile_test_with_flags test_traits non_caching_segments "$flags" - if [ -n "${SUCCESS}" ] ; then - execute_commands_old_structure segments non_caching_segment_traits \ - VERTEX IS_VERTICAL COMPARE_Y_AT_X COMPARE_Y_AT_X_LEFT CONSTRUCTOR \ - COMPARE_Y_AT_X_RIGHT ARE_MERGEABLE ASSERTIONS - - execute_commands_new_structure segments segment_traits \ - IS_VERTICAL COMPARE_Y_AT_X COMPARE_Y_AT_X_LEFT - - run_trapped_test test_traits \ - data/segments/vertex.pt data/segments/xcurves \ - data/empty.zero data/segments/vertex non_caching_segment_traits - else - echo " ERROR: not executed test_traits non_caching_segment_traits" >> $ERRORFILE - fi - clean_tests -} - -#---------------------------------------------------------------------# -# polycurve conic traits -#---------------------------------------------------------------------# -test_polycurve_conic_traits() -{ - if [ -n "${CGAL_DISABLE_GMP}" ]; then - echo "CORE is not available, test_polycurve_conic_traits not ran" - return - fi - echo polycurve test starting - local nt=$CORE_EXPR_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$POLYCURVE_CONIC_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; - - compile_test_with_flags test_traits conic_polycurve "$flags" - if [ -n "${SUCCESS}" ] ; then - - # The input arguments for the execute_commands_new_structure, - # 1. Polycurve_conics is the directory name in "data" - # 2. polycurve_conic_traits is a string - # Execute_command_new_structure will only run the test on functors provided as the third, fourth and so on arguments. - # To see how the input data directory should be structured for each functor, check the execute_commands_new_structure function in this file. - execute_commands_new_structure polycurves_conics polycurve_conic_traits \ - COMPARE_Y_AT_X \ - INTERSECT \ - EQUAL \ - IS_VERTICAL \ - SPLIT \ - ARE_MERGEABLE \ - COMPARE_Y_AT_X_LEFT \ - COMPARE_Y_AT_X_RIGHT \ - MAKE_X_MONOTONE \ - PUSH_BACK \ - PUSH_FRONT \ - NUMBER_OF_POINTS \ - VERTEX \ - CONSTRUCT_OPPOSITE \ - MERGE \ - COMPARE_ENDPOINTS_XY \ - TRIM - - else - echo " ERROR: not executed test_traits polyline_traits" >> $ERRORFILE - fi - clean_tests -} - -#---------------------------------------------------------------------# -# polycurve arc traits -#---------------------------------------------------------------------# -test_polycurve_circular_arc_traits() -{ - local nt=$QUOTIENT_MP_FLOAT_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$POLYCURVE_CIRCULAR_ARC_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; - - compile_test_with_flags test_traits circular_arc_polycurve "$flags" - if [ -n "${SUCCESS}" ] ; then - execute_commands_new_structure Polycurves_circular_arcs polycurve_circular_arc_traits \ - COMPARE_Y_AT_X \ - EQUAL \ - IS_VERTICAL \ - SPLIT \ - ARE_MERGEABLE \ - COMPARE_Y_AT_X_LEFT \ - COMPARE_Y_AT_X_RIGHT \ - MAKE_X_MONOTONE \ - PUSH_BACK \ - PUSH_FRONT \ - NUMBER_OF_POINTS \ - VERTEX \ - CONSTRUCT_OPPOSITE \ - MERGE \ - COMPARE_ENDPOINTS_XY \ - INTERSECT - - else - echo " ERROR: not executed test_traits polyline_traits" >> $ERRORFILE - fi - clean_tests -} - -#---------------------------------------------------------------------# -# polycurve bezier traits -#---------------------------------------------------------------------# -test_polycurve_bezier_traits() -{ - if [ -n "${CGAL_DISABLE_GMP}" ]; then - echo "CORE is not available, test_polycurve_bezier_traits not ran" - return - fi - local nt=$CORE_EXPR_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$POLYCURVE_BEZIER_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; - - compile_test_with_flags test_traits bezier_polycurve "$flags" - if [ -n "${SUCCESS}" ] ; then - execute_commands_new_structure Polycurves_bezier test_polycurve_bezier_traits \ - MERGE \ - EQUAL \ - IS_VERTICAL \ - NUMBER_OF_POINTS \ - PUSH_BACK \ - PUSH_FRONT \ - VERTEX \ - ARE_MERGEABLE \ - COMPARE_ENDPOINTS_XY - # TODO (add data for these tests) - # COMPARE_Y_AT_X \ - # SPLIT \ - # COMPARE_Y_AT_X_LEFT \ - # COMPARE_Y_AT_X_RIGHT \ - # MAKE_X_MONOTONE \ - # CONSTRUCT_OPPOSITE \ - - # INTERSECT - - else - echo " ERROR: not executed test_traits polyline_traits" >> $ERRORFILE - fi - clean_tests -} - -#---------------------------------------------------------------------# -# polyline traits -#---------------------------------------------------------------------# -test_polyline_traits() -{ - local nt=$CGAL_GMPQ_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$POLYLINE_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; - - compile_test_with_flags test_traits test_polylines "$flags" - if [ -n "${SUCCESS}" ] ; then - execute_commands_old_structure polylines polyline_traits \ - CONSTRUCTOR COMPARE_Y_AT_X_LEFT \ - COMPARE_Y_AT_X_RIGHT ARE_MERGEABLE - else - echo " ERROR: not executed test_traits polyline_traits" >> $ERRORFILE - fi - clean_tests -} - -#---------------------------------------------------------------------# -# non-caching polyline traits -#---------------------------------------------------------------------# -test_non_caching_polyline_traits() -{ - local nt=$CGAL_GMPQ_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$NON_CACHING_POLYLINE_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; - - compile_test_with_flags test_traits non_caching_polylines "$flags" - if [ -n "${SUCCESS}" ] ; then - execute_commands_old_structure polylines non_caching_polyline_traits \ - CONSTRUCTOR COMPARE_Y_AT_X_LEFT \ - COMPARE_Y_AT_X_RIGHT ARE_MERGEABLE - else - echo " ERROR: not executed test_traits non_caching_polyline_traits" >> $ERRORFILE - fi - clean_tests -} - -#---------------------------------------------------------------------# -# linear traits -#---------------------------------------------------------------------# -test_linear_traits() -{ - local nt=$QUOTIENT_MP_FLOAT_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$LINEAR_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; - - compile_test_with_flags test_traits linear "$flags" - if [ -n "${SUCCESS}" ] ; then - execute_commands_old_structure linear/segments linear_traits.segments \ - VERTEX IS_VERTICAL COMPARE_Y_AT_X COMPARE_Y_AT_X_LEFT \ - COMPARE_Y_AT_X_RIGHT CONSTRUCTOR ARE_MERGEABLE - - execute_commands_new_structure linear/segments linear_traits.segments \ - IS_VERTICAL COMPARE_Y_AT_X COMPARE_Y_AT_X_LEFT - - run_trapped_test test_traits \ - data/linear/segments/vertex.pt data/linear/segments/xcurves \ - data/empty.zero data/linear/segments/vertex linear_traits.segments - - execute_commands_old_structure linear/rays linear_traits.rays \ - VERTEX IS_VERTICAL COMPARE_Y_AT_X COMPARE_Y_AT_X_LEFT \ - COMPARE_Y_AT_X_RIGHT CONSTRUCTOR ARE_MERGEABLE - - execute_commands_new_structure linear/rays linear_traits.rays \ - IS_VERTICAL COMPARE_Y_AT_X COMPARE_Y_AT_X_LEFT - - run_trapped_test test_traits \ - data/linear/rays/vertex.pt data/linear/rays/xcurves \ - data/empty.zero data/linear/rays/vertex linear_traits.rays - - execute_commands_new_structure linear/lines linear_traits.lines \ - IS_VERTICAL COMPARE_Y_AT_X COMPARE_Y_AT_X_LEFT INTERSECT \ - SPLIT MERGE \ - PARAMETER_SPACE_X PARAMETER_SPACE_Y \ - COMPARE_X_AT_LIMIT COMPARE_X_NEAR_LIMIT COMPARE_Y_NEAR_BOUNDARY - else - echo " ERROR: not executed test_traits linear_traits" >> $ERRORFILE - fi - clean_tests -} - -#---------------------------------------------------------------------# -# conic traits -#---------------------------------------------------------------------# -test_conic_traits() -{ - if [ -n "${CGAL_DISABLE_GMP}" ]; then - echo "CORE is not available, test_conic_traits not ran" - return - fi - local nt=$CORE_EXPR_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$CORE_CONIC_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; - - compile_test_with_flags test_traits conics "$flags" - if [ -n "${SUCCESS}" ] ; then - execute_commands_old_structure conics conic_traits \ - INTERSECT SPLIT MERGE COMPARE_Y_AT_X_LEFT \ - COMPARE_Y_AT_X_RIGHT ARE_MERGEABLE - - execute_commands_new_structure conics conic_traits \ - INTERSECT SPLIT MERGE - - run_trapped_test test_traits \ - data/conics/compare.pt data/empty.zero \ - data/empty.zero data/conics/compare conic_traits - else - echo " ERROR: not executed test_traits conic_traits" >> $ERRORFILE - fi - clean_tests -} - -#---------------------------------------------------------------------# -# "line arcs" (segments) only -#---------------------------------------------------------------------# -test_line_arc_traits() -{ - local nt=$QUOTIENT_MP_FLOAT_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$LINE_ARC_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; - - compile_test_with_flags test_traits line_arcs "$flags" - if [ -n "${SUCCESS}" ] ; then - execute_commands_old_structure circular_lines line_arc_traits \ - VERTEX IS_VERTICAL COMPARE_Y_AT_X COMPARE_Y_AT_X_LEFT \ - ASSERTIONS COMPARE_Y_AT_X_RIGHT MERGE ARE_MERGEABLE - - execute_commands_new_structure circular_lines line_arc_traits \ - IS_VERTICAL COMPARE_Y_AT_X - - run_trapped_test test_traits \ - data/circular_lines/compare.pt data/empty.zero \ - data/empty.zero data/circular_lines/compare line_arc_traits - - run_trapped_test test_traits \ - data/circular_lines/vertex.pt data/circular_lines/xcurves \ - data/empty.zero data/circular_lines/vertex line_arc_traits - else - echo " ERROR: not executed test_traits" >> $ERRORFILE - fi - clean_tests -} - -#---------------------------------------------------------------------# -# circular arcs only -#---------------------------------------------------------------------# -test_circular_arc_traits() -{ - local nt=$QUOTIENT_MP_FLOAT_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$CIRCULAR_ARC_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; - - compile_test_with_flags test_traits circular_arcs "$flags" - if [ -n "${SUCCESS}" ] ; then - execute_commands_old_structure circular_arcs circular_arc_traits \ - VERTEX IS_VERTICAL COMPARE_Y_AT_X COMPARE_Y_AT_X_LEFT \ - ASSERTIONS COMPARE_Y_AT_X_RIGHT MERGE ARE_MERGEABLE - - execute_commands_new_structure circular_arcs circular_arc_traits \ - VERTEX IS_VERTICAL COMPARE_Y_AT_X - else - echo " ERROR: not executed test_traits" >> $ERRORFILE - fi - clean_tests -} - -#---------------------------------------------------------------------# -# circular and line arcs -#---------------------------------------------------------------------# -test_circular_line_arc_traits() -{ - local nt=$QUOTIENT_MP_FLOAT_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$CIRCULAR_LINE_ARC_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; - - compile_test_with_flags test_traits circular_line_arcs "$flags" - if [ -n "${SUCCESS}" ] ; then - execute_commands_old_structure circular_line_arcs circular_line_arc_traits \ - VERTEX IS_VERTICAL CONSTRUCTOR COMPARE_Y_AT_X COMPARE_Y_AT_X_LEFT \ - ASSERTIONS COMPARE_Y_AT_X_RIGHT MERGE ARE_MERGEABLE - - execute_commands_new_structure circular_line_arcs circular_line_arc_traits \ - IS_VERTICAL COMPARE_Y_AT_X - - run_trapped_test test_traits \ - data/circular_line_arcs/vertex.pt data/circular_line_arcs/xcurves \ - data/empty.zero data/circular_line_arcs/vertex circular_line_arc_traits - else - echo " ERROR: not executed test_traits circular_line_arc_traits" >> $ERRORFILE - fi - clean_tests -} - -#---------------------------------------------------------------------# -# circle segment traits -#---------------------------------------------------------------------# -test_circle_segments_traits() -{ - local nt=$QUOTIENT_MP_FLOAT_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$CIRCLE_SEGMENT_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; - - compile_test_with_flags test_traits circle_segments "$flags" - if [ -n "${SUCCESS}" ] ; then - execute_commands_old_structure circle_segments circle_segments_traits \ - VERTEX IS_VERTICAL COMPARE_Y_AT_X COMPARE_Y_AT_X_LEFT \ - COMPARE_Y_AT_X_RIGHT CONSTRUCTOR ARE_MERGEABLE - - run_trapped_test test_traits \ - data/circle_segments/points data/circle_segments/xcurves.8 \ - data/empty.zero data/circle_segments/vertex circle_segments_traits - run_trapped_test test_traits \ - data/empty.zero data/circle_segments/xcurves.8 \ - data/empty.zero data/circle_segments/is_vertical circle_segments_traits - run_trapped_test test_traits \ - data/circle_segments/points data/circle_segments/xcurves.8 \ - data/empty.zero data/circle_segments/compare_y_at_x circle_segments_traits - run_trapped_test test_traits \ - data/circle_segments/points data/circle_segments/xcurves.16 \ - data/empty.zero data/circle_segments/compare_y_at_x_left circle_segments_traits - run_trapped_test test_traits \ - data/circle_segments/points data/circle_segments/xcurves.16 \ - data/empty.zero data/circle_segments/compare_y_at_x_right circle_segments_traits - run_trapped_test test_traits \ - data/empty.zero data/circle_segments/constructor.xcv \ - data/empty.zero data/circle_segments/constructor circle_segments_traits - else - echo " ERROR: not executed test_traits circle_segments_traits" >> $ERRORFILE - fi - clean_tests -} - -#---------------------------------------------------------------------# -# bezier traits -#---------------------------------------------------------------------# -test_bezier_traits() -{ - if [ -n "${CGAL_DISABLE_GMP}" ]; then - echo "CORE is not available, test_bezier_traits not ran" - return - fi - local nt=$CORE_EXPR_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$BEZIER_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; - - compile_test_with_flags test_traits Bezier "$flags" - if [ -n "${SUCCESS}" ] ; then - execute_commands_old_structure bezier bezier_traits \ - COMPARE_Y_AT_X_LEFT COMPARE_Y_AT_X_RIGHT SPLIT \ - CONSTRUCTOR ASSERTIONS ARE_MERGEABLE - else - echo " ERROR: not executed test_traits bezier_traits" >> $ERRORFILE - fi - clean_tests -} - -#---------------------------------------------------------------------# -# spherical arc traits -#---------------------------------------------------------------------# -test_spherical_arc_traits() -{ - local nt=$CGAL_GMPQ_NT; - local kernel=$CARTESIAN_KERNEL; - local geom_traits=$GEODESIC_ARC_ON_SPHERE_GEOM_TRAITS; - local topol_traits=$SPHERICAL_TOPOL_TRAITS - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits -DTEST_TOPOL_TRAITS=$topol_traits"; - - compile_test_with_flags test_traits geodesic_arcs_on_sphere "$flags" - if [ -n "${SUCCESS}" ] ; then - execute_commands_old_structure spherical_arcs spherical_arc_traits \ - COMPARE_Y_AT_X_LEFT COMPARE_Y_AT_X_RIGHT INTERSECT \ - CONSTRUCTOR \ - COMPARE MAKE_X_MONOTONE SPLIT MERGE ASSERTIONS ARE_MERGEABLE - - execute_commands_new_structure spherical_arcs spherical_arc_traits \ - INTERSECT \ - COMPARE_X_ON_BOUNDARY COMPARE_X_NEAR_BOUNDARY \ - COMPARE_Y_NEAR_BOUNDARY - - run_trapped_test test_traits \ - data/spherical_arcs/compare.pt data/spherical_arcs/compare.xcv \ - data/empty.zero data/spherical_arcs/compare spherical_arc_traits - else - echo " ERROR: not executed test_traits spherical_arc_traits" >> $ERRORFILE - fi - clean_tests -} - -#---------------------------------------------------------------------# -# rational arc traits -#---------------------------------------------------------------------# -test_rational_arc_traits() -{ - if [ -n "${CGAL_DISABLE_GMP}" ]; then - echo "CORE is not available, test_rational_arc_traits not ran" - return - fi - local nt=$CORE_INT_NT; - local kernel=$UNIVARIATE_ALGEBRAIC_KERNEL; - local geom_traits=$RATIONAL_ARC_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; - - compile_test_with_flags test_traits rational_arcs "$flags" - if [ -n "${SUCCESS}" ] ; then - run_trapped_test test_traits \ - data/compare.pt data/empty.zero \ - data/empty.zero data/compare rational_arc_traits - - execute_commands_new_structure rational_arcs rational_arc_traits \ - VERTEX IS_VERTICAL COMPARE_Y_AT_X COMPARE_Y_AT_X_LEFT SPLIT MERGE \ - COMPARE_X_AT_LIMIT COMPARE_X_NEAR_LIMIT COMPARE_Y_NEAR_BOUNDARY - else - echo " ERROR: not executed test_traits rational_arc_traits" >> $ERRORFILE - fi - clean_tests -} - -#---------------------------------------------------------------------# -# algebraic traits with GMP/MPFI -#---------------------------------------------------------------------# -test_algebraic_traits_gmp() -{ - #TODO: Adapt - - local nt=$CGAL_GMPZ_NT; - local kernel=$UNIVARIATE_ALGEBRAIC_KERNEL; - local geom_traits=$ALGEBRAIC_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; - - compile_test_with_flags test_traits algebraic "$flags" - if [ -n "${SUCCESS}" ] ; then - execute_commands_new_structure algebraic algebraic_traits_gmp \ - COMPARE COMPARE_Y_AT_X COMPARE_Y_AT_X_RIGHT COMPARE_Y_AT_X_LEFT \ - MAKE_X_MONOTONE IS_VERTICAL VERTEX SPLIT MERGE INTERSECT \ - PARAMETER_SPACE_X PARAMETER_SPACE_Y - else - echo " ERROR: not executed test_traits algebraic_traits_gmp" >> $ERRORFILE - fi - clean_tests -} - -#---------------------------------------------------------------------# -# algebraic traits with LEDA -#---------------------------------------------------------------------# -test_algebraic_traits_leda() -{ - #TODO: Adapt - - local nt=$LEDA_INT_NT; - local kernel=$UNIVARIATE_ALGEBRAIC_KERNEL; - local geom_traits=$ALGEBRAIC_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; - - compile_test_with_flags test_traits algebraic "$flags" - if [ -n "${SUCCESS}" ] ; then - execute_commands_new_structure algebraic algebraic_traits_leda \ - COMPARE COMPARE_Y_AT_X COMPARE_Y_AT_X_RIGHT COMPARE_Y_AT_X_LEFT \ - MAKE_X_MONOTONE IS_VERTICAL VERTEX SPLIT MERGE INTERSECT \ - PARAMETER_SPACE_X PARAMETER_SPACE_Y - else - echo " ERROR: not executed test_traits algebraic_traits_leda" >> $ERRORFILE - fi - clean_tests -} - - -#---------------------------------------------------------------------# -# algebraic traits with CORE -#---------------------------------------------------------------------# -test_algebraic_traits_core() -{ - #TODO: Adapt - if [ -n "${CGAL_DISABLE_GMP}" ]; then - echo "CORE is not available, test_algebraic_traits_core not ran" - return - fi - local nt=$CORE_INT_NT; - local kernel=$UNIVARIATE_ALGEBRAIC_KERNEL; - local geom_traits=$ALGEBRAIC_GEOM_TRAITS; - local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; - - compile_test_with_flags test_traits algebraic "$flags" - if [ -n "${SUCCESS}" ] ; then - execute_commands_new_structure algebraic algebraic_traits_core \ - COMPARE COMPARE_Y_AT_X COMPARE_Y_AT_X_RIGHT COMPARE_Y_AT_X_LEFT \ - MAKE_X_MONOTONE IS_VERTICAL VERTEX SPLIT MERGE INTERSECT \ - PARAMETER_SPACE_X PARAMETER_SPACE_Y - else - echo " ERROR: not executed test_traits algebraic_traits_core" >> $ERRORFILE - fi - clean_tests -} - -#---------------------------------------------------------------------# -# remove the previous error file -#---------------------------------------------------------------------# - -rm -f $ERRORFILE -rm -f $FULL_ERROR_DESCRIPTION_FILE -rm -f ProgramOutput.test_* -touch $ERRORFILE - -#---------------------------------------------------------------------# -# compile and run the tests -#---------------------------------------------------------------------# - - - -if [ $# -ne 0 ] ; then - case $1 in - -cmake) TEST_WITH_CMAKE="TRUE" ;; - *)TEST_WITH_CMAKE="FALSE" ;; - esac -else - TEST_WITH_CMAKE="FALSE" -fi - -echo "Run all tests." - -if [ "${TEST_WITH_CMAKE}" != "FALSE" ]; then - configure -fi - -if [ "${TEST_WITH_CMAKE}" != "FALSE" ]; then - compile_and_run construction_test_suite_generator -fi - -test_segment_traits -test_non_caching_segment_traits -test_polyline_traits -test_polycurve_conic_traits -test_polycurve_circular_arc_traits -test_polycurve_bezier_traits -test_non_caching_polyline_traits -test_linear_traits -test_conic_traits - -test_line_arc_traits # "line arcs" (segments) only -test_circular_arc_traits # circular arcs only -test_circular_line_arc_traits # for both - -test_circle_segments_traits -test_bezier_traits - -test_spherical_arc_traits - -test_rational_arc_traits - -test_algebraic_traits_core -test_algebraic_traits_gmp -test_algebraic_traits_leda - -compile_and_run test_data_traits - -compile_and_run test_insertion -compile_and_run test_unbounded_rational_insertion -compile_and_run test_unbounded_rational_direct_insertion -compile_and_run test_rational_function_traits_2 -compile_and_run test_iso_verts - -compile_and_run test_vert_ray_shoot_vert_segments - -test_construction_segments -test_construction_linear_curves -test_construction_spherical_arcs -test_construction_polylines - -test_overlay_segments -test_overlay_spherical_arcs - -test_point_location_segments -test_point_location_segments_version -test_point_location_segments_conversion -test_point_location_circle_segments -test_point_location_linear - -test_point_location_dynamic_segments - -test_batched_point_location_segments -test_batched_point_location_linear -test_batched_point_location_spherical_arcs - -test_vertical_decomposition_segments -test_vertical_decomposition_linear -# test_vertical_decomposition_spherical_arcs - -compile_and_run test_dual -compile_and_run test_do_intersect -compile_and_run test_zone - -compile_and_run test_observer -compile_and_run test_do_equal - -test_segment_traits_adaptor -test_linear_traits_adaptor -test_spherical_arcs_traits_adaptor - -compile_and_run test_removal -compile_and_run test_unbounded_removal -compile_and_run test_spherical_removal - -compile_and_run test_io - -compile_and_run test_sgm - -# if any error occured then append the full error description file to error file - -if [ -f $FULL_ERROR_DESCRIPTION_FILE ] ; then - echo "******************** appending all error outputs ********************" >> $ERRORFILE - cat $FULL_ERROR_DESCRIPTION_FILE >> $ERRORFILE -fi diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test_with_cmake b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test_with_cmake index 8c72a52e332..33cd53adeea 100755 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test_with_cmake +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test_with_cmake @@ -1,4 +1,1759 @@ #! /bin/bash -./cgal_test_base -cmake +# This is a script for the CGAL test suite. Such a script must obey +# the following rules: +# +# - the name of the script is cgal_test +# - for every target two one line messages are written to the file 'error.txt' +# the first one indicates if the compilation was successful +# the second one indicates if the execution was successful +# if one of the two was not successful, the line should start with 'ERROR:' +# - running the script should not require any user interaction +# - the script should clean up object files and executables +# SET PARAMETERS FOR cgal_test + +set -- -cmake +ERRORFILE=error.txt +DO_RUN=y +if [ -z "${MAKE_CMD}" ]; then + MAKE_CMD=make +fi + + +FULL_ERROR_DESCRIPTION_FILE=ProgramOutput.error.txt + +#---------------------------------------------------------------------# +# compile_and_run +#---------------------------------------------------------------------# + +# note that these values shloud match to the values in test_configuration.h file + +CARTESIAN_KERNEL=0 +SIMPLE_CARTESIAN_KERNEL=1 +UNIVARIATE_ALGEBRAIC_KERNEL=2 + +SEGMENT_GEOM_TRAITS=0 +NON_CACHING_SEGMENT_GEOM_TRAITS=1 +POLYLINE_GEOM_TRAITS=2 +NON_CACHING_POLYLINE_GEOM_TRAITS=3 +POLYCURVE_CONIC_GEOM_TRAITS=14 +POLYCURVE_CIRCULAR_ARC_GEOM_TRAITS=15 +POLYCURVE_BEZIER_GEOM_TRAITS=16 +LINEAR_GEOM_TRAITS=4 +CORE_CONIC_GEOM_TRAITS=5 +LINE_ARC_GEOM_TRAITS=6 +CIRCULAR_ARC_GEOM_TRAITS=7 +CIRCULAR_LINE_ARC_GEOM_TRAITS=8 +CIRCLE_SEGMENT_GEOM_TRAITS=9 +BEZIER_GEOM_TRAITS=10 +GEODESIC_ARC_ON_SPHERE_GEOM_TRAITS=11 +RATIONAL_ARC_GEOM_TRAITS=12 +ALGEBRAIC_GEOM_TRAITS=13 +POLYCURVE_CONIC_GEOM_TRAITS=14 +POLYCURVE_CIRCULAR_ARC_GEOM_TRAITS=15 +POLYCURVE_BEZIER_GEOM_TRAITS=16 +FLAT_TORUS_GEOM_TRAITS=17 + +PLANAR_BOUNDED_TOPOL_TRAITS=0 +PLANAR_UNBOUNDED_TOPOL_TRAITS=1 +SPHERICAL_TOPOL_TRAITS=2 + +DOUBLE_NT=0 +MP_FLOAT_NT=1 +GMPZ_NT=2 +LEDA_RAT_NT=3 +QUOTIENT_MP_FLOAT_NT=4 +QUOTIENT_CGAL_GMPZ_NT=5 +CGAL_GMPQ_NT=6 +LAZY_LEDA_RAT_NT=7 +LAZY_CGAL_GMPQ_NT=8 +LAZY_QUOTIENT_MP_FLOAT_NT=9 +LEDA_REAL_NT=10 +CORE_EXPR_NT=11 +LAZY_GMPZ_NT=12 +LEDA_INT_NT=13 +CGAL_GMPZ_NT=14 +CORE_INT_NT=15 +CORE_RAT_NT=16 + +if [ -n "${CGAL_DISABLE_GMP}" ]; then + echo GMP is disable. Try to use LEDA instead. + GMPZ_NT=$LEDA_INT_NT + QUOTIENT_CGAL_GMPZ_NT=$LEDA_RAT_NT + CGAL_GMPQ_NT=$LEDA_RAT_NT + LAZY_CGAL_GMPQ_NT=$LAZY_LEDA_RAT_NT + LAZY_GMPZ_NT=$LAZY_LEDA_RAT_NT + CGAL_GMPZ_NT=$LEDA_INT_NT +fi + +COMPARE=1 +VERTEX=2 +IS_VERTICAL=3 +COMPARE_Y_AT_X=4 +COMPARE_Y_AT_X_LEFT=5 +COMPARE_Y_AT_X_RIGHT=6 +MAKE_X_MONOTONE=7 +INTERSECT=8 +SPLIT=9 +ARE_MERGEABLE=10 +MERGE=11 +ASSERTIONS=12 +CONSTRUCTOR=13 +COMPARE_X_AT_LIMIT=14 +COMPARE_X_NEAR_LIMIT=15 +COMPARE_X_ON_BOUNDARY=16 +COMPARE_X_NEAR_BOUNDARY=17 +COMPARE_Y_NEAR_BOUNDARY=18 +PARAMETER_SPACE_X=19 +PARAMETER_SPACE_Y=20 +X_ON_IDENTIFICATION=21 +Y_ON_IDENTIFICATION=22 +IS_BOUNDED=23 +IS_IN_X_RANGE=24 +COMPARE_Y_POSITION=25 +IS_BETWEEN_CW=26 +COMPARE_CW_AROUND_POINT=27 +PUSH_BACK=28 +PUSH_FRONT=29 +NUMBER_OF_POINTS=32 +COMPARE_ENDPOINTS_XY=33 +CONSTRUCT_OPPOSITE=34 +TRIM=35 + +#---------------------------------------------------------------------# +# configure +#---------------------------------------------------------------------# + +configure() +{ + echo "Configuring... " + rm -rf CMakeCache.txt CMakeFiles/ + echo "cmake --no-warn-unused-cli ${INIT_FILE:+"-C${INIT_FILE}"} "$CMAKE_GENERATOR" -DRUNNING_CGAL_AUTO_TEST=TRUE \ + -DCGAL_DIR=\"$CGAL_DIR\" \ + -DCGAL_CXX_FLAGS:STRING=\"$TESTSUITE_CXXFLAGS -I../../include\" \ + -DCGAL_EXE_LINKER_FLAGS=\"$TESTSUITE_LDFLAGS\" \ + -DCMAKE_BUILD_TYPE=NOTFOUND \ + ." + if eval 'cmake --no-warn-unused-cli ${INIT_FILE:+"-C${INIT_FILE}"} "$CMAKE_GENERATOR" -DRUNNING_CGAL_AUTO_TEST=TRUE \ + -DCGAL_DIR="$CGAL_DIR" \ + -DCGAL_CXX_FLAGS:STRING="$TESTSUITE_CXXFLAGS -I../../include" \ + -DCGAL_EXE_LINKER_FLAGS="$TESTSUITE_LDFLAGS" \ + -DCMAKE_BUILD_TYPE=NOTFOUND \ + .' ; then + + echo " successful configuration" >> $ERRORFILE + else + echo " ERROR: configuration" >> $ERRORFILE + fi +} + +compile_test_with_flags() +{ + local name=$1; + local type=$2; + local flags=$3; + + echo "Compiling $name $type ... " + if [ "${TEST_WITH_CMAKE}" != "FALSE" ]; then + export TESTSUITE_CXXFLAGS="$flags" + configure + if eval '${MAKE_CMD} VERBOSE=1 -fMakefile \ + $name' ; then + echo " successful compilation of $name $type" >> $ERRORFILE; + SUCCESS="y" + else + echo " ERROR: compilation of $name $type" >> $ERRORFILE; + SUCCESS="" + fi + else + if eval 'make CGAL_MAKEFILE=$CGAL_MAKEFILE \ + TESTSUITE_CXXFLAGS="$TESTSUITE_CXXFLAGS" \ + TESTSUITE_LDFLAGS="$TESTSUITE_LDFLAGS" $name'; then + echo " successful compilation of $name $type" >> $ERRORFILE; + SUCCESS="y" + else + echo " ERROR: compilation of $name $type" >> $ERRORFILE; + SUCCESS="" + fi + fi +} + +run_test() +{ + # $1 - executable name + + basedata=`basename "$5"` + OUTPUTFILE="ProgramOutput.$1" + rm -f $OUTPUTFILE + COMMAND="./$1" + if [ -f $1.cmd ] ; then + COMMAND="$COMMAND `cat $1.cmd`" + fi + if [ -f $1.cin ] ; then + COMMAND="cat $1.cin | $COMMAND" + fi + OUTPUTFILE="$OUTPUTFILE.$PLATFORM" + echo "Executing $1 ($2) ... " + ulimit -t 3600 2> /dev/null + if eval $COMMAND > $OUTPUTFILE 2>&1 ; then + echo " successful execution of $1" >> $ERRORFILE + else + echo " ERROR: execution of $1" >> $ERRORFILE + cat $OUTPUTFILE >> $FULL_ERROR_DESCRIPTION_FILE + fi +} + +run_test_with_flags() +{ + # $1 - executable name + # $2 - test substring name + + basedata=`basename "$5"` + OUTPUTFILE="ProgramOutput.$1" + rm -f $OUTPUTFILE + COMMAND="./$1" + if [ -f $1.cmd ] ; then + COMMAND="$COMMAND `cat $1.cmd`" + elif [ -f $1.$2.cmd ] ; then + COMMAND="$COMMAND `cat $1.$2.cmd`" + OUTPUTFILE=$OUTPUTFILE.`echo $2 | tr '/' '.'` + fi + if [ -f $1.cin ] ; then + COMMAND="cat $1.cin | $COMMAND" + elif [ -f $1.$2.cin ] ; then + COMMAND="cat $1.$2.cin | $COMMAND" + OUTPUTFILE=$OUTPUTFILE.`echo $2 | tr '/' '.'` + fi + OUTPUTFILE="$OUTPUTFILE.$PLATFORM" + echo "Executing $1 ($2) ... " + ulimit -t 3600 2> /dev/null + if eval $COMMAND > $OUTPUTFILE 2>&1 ; then + echo " successful execution of $1 ($2)" >> $ERRORFILE + else + echo " ERROR: execution of $1 ($2)" >> $ERRORFILE + cat $OUTPUTFILE >> $FULL_ERROR_DESCRIPTION_FILE + fi +} + +run_test_alt() +{ + basedata=`basename "$5"` + OUTPUTFILE=ProgramOutput.$1.`echo $5 | tr '/' '.'`.$6 + #echo ****generating file $OUTPUTFILE + # dirdata=`dirname "$datafile"` + rm -f $OUTPUTFILE + COMMAND="./$1" + echo "Executing $1 $5 $6 ... " + if eval $COMMAND $2 $3 $4 $5 $6 > $OUTPUTFILE 2>&1 ; then + echo " successful execution of $5 $6" >> $ERRORFILE + else + echo " ERROR: execution of $5 $6" >> $ERRORFILE + cat $OUTPUTFILE >> $FULL_ERROR_DESCRIPTION_FILE + fi +} + +run_trapped_test() +{ + #local name=$1; + #local datafile=$2; + + if [ "${OSTYPE}" != "cygwin" ]; then + ulimit -t 1200 + run_test_alt $1 $2 $3 $4 $5 $6 + else + run_test_alt $1 $2 $3 $4 $5 $6 & + WPID=$! + trap "kill -9 $WPID" INT + (sleep 1200; kill -9 $WPID) > /dev/null 2>&1 & + SPID=$! + wait $WPID > /dev/null 2>&1 + # RES=$? + kill -9 $SPID > /dev/null 2>&1 + # return $RES + fi +} + +clean_tests() +{ + if [ "${TEST_WITH_CMAKE}" != "FALSE" ]; then + # + # The clean target generated by CMake under cygwin + # always fails for some reason + # + if ! ( uname | grep -q "CYGWIN" ) ; then + make -fMakefile clean + fi + fi + eval "make clean > /dev/null 2>&1" +} + +compile_and_run() +{ + local name=$1; + + echo "Compiling $name ... " + if [ "${TEST_WITH_CMAKE}" != "FALSE" ]; then + if eval '${MAKE_CMD} VERBOSE=1 -fMakefile $1' ; then + echo " successful compilation of $1" >> $ERRORFILE + SUCCESS="y" + else + echo " ERROR: compilation of $1" >> $ERRORFILE + SUCCESS="" + fi + else + SUCCESS="y" + #TESTSUITE_CXXFLAGS="$TESTSUITE_CXXFLAGS" + TESTSUITE_CXXFLAGS="" + TESTSUITE_LDFLAGS="$TESTSUITE_LDFLAGS" + if eval 'make CGAL_MAKEFILE=$CGAL_MAKEFILE \ + TESTSUITE_CXXFLAGS="$TESTSUITE_CXXFLAGS" \ + TESTSUITE_LDFLAGS="$TESTSUITE_LDFLAGS" $name' ; then + echo " successful compilation of $name" >> $ERRORFILE + else + echo " ERROR: compilation of $name" >> $ERRORFILE + SUCCESS="" + fi + fi + + if [ "${TEST_WITH_CMAKE}" != "FALSE" ]; then + if [ -n "$DO_RUN" ] ; then + if [ -n "${SUCCESS}" ] ; then + run_test $1 + else + echo " ERROR: not executed $1" >> $ERRORFILE + fi + fi + else + if [ -n "${SUCCESS}" ] ; then + OUTPUTFILE=ProgramOutput.$name.$PLATFORM + rm -f $OUTPUTFILE + COMMAND="./$name" + if [ -f $name.cmd ] ; then + COMMAND="$COMMAND `cat $name.cmd`" + fi + if [ -f $name.cin ] ; then + COMMAND="cat $name.cin | $COMMAND" + fi + echo "Executing $name ... " + echo " " + if eval $COMMAND > $OUTPUTFILE 2>&1 ; then + echo " successful execution of $name" >> $ERRORFILE + else + echo " ERROR: execution of $name" >> $ERRORFILE + cat $OUTPUTFILE >> $FULL_ERROR_DESCRIPTION_FILE + fi + else + echo " ERROR: not executed $name" >> $ERRORFILE + fi + fi + clean_tests +} + +compile_and_run_trapped_test() +{ + local name=$1; + + if [ "${OSTYPE}" != "cygwin" ]; then + ulimit -t 1200 + compile_and_run $1 + else + compile_and_run $1 & + WPID=$! + trap "kill -9 $WPID" INT + (sleep 1200; kill -9 $WPID) > /dev/null 2>&1 & + SPID=$! + wait $WPID > /dev/null 2>&1 + # RES=$? + kill -9 $SPID > /dev/null 2>&1 + # return $RES + fi +} + +execute_commands_old_structure() +{ + +# at first the tests where designed in such way that all the test input was +# in one file, the points, the xcurves, the curves and the execution block +# this function is used to execute the old tests, one may use it when needed +# but you should remember that separating the input into smaller files creates +# much more modular and comfortable test suite + +# the old structure is default, so this function executes all commands +# except the commands that are given as arguments + + + commands_indicator[COMPARE]=1 + commands_indicator[VERTEX]=1 + commands_indicator[IS_VERTICAL]=1 + commands_indicator[COMPARE_Y_AT_X]=1 + commands_indicator[COMPARE_Y_AT_X_LEFT]=1 + commands_indicator[COMPARE_Y_AT_X_RIGHT]=1 + commands_indicator[MAKE_X_MONOTONE]=1 + commands_indicator[INTERSECT]=1 + commands_indicator[SPLIT]=1 + commands_indicator[ARE_MERGEABLE]=1 + commands_indicator[MERGE]=1 + commands_indicator[ASSERTIONS]=1 + commands_indicator[CONSTRUCTOR]=1 + i=1 + if [ $# -gt 2 ] ; then + for arg in $* ; do + if [ $i -gt 2 ] ; then + commands_indicator[$arg]=0 + fi + let "i+=1" + done + fi + if [ ${commands_indicator[$COMPARE]} -ne 0 ] ; then + run_trapped_test test_traits \ + data/compare.pt data/empty.zero \ + data/empty.zero data/compare $2 + fi + if [ ${commands_indicator[$VERTEX]} -ne 0 ] ; then + run_trapped_test test_traits \ + data/$1/vertex.pt data/$1/vertex.xcv \ + data/empty.zero data/$1/vertex $2 + fi + if [ ${commands_indicator[$IS_VERTICAL]} -ne 0 ] ; then + run_trapped_test test_traits \ + data/empty.zero data/$1/is_vertical.xcv data/empty.zero \ + data/$1/is_vertical $2 + fi + if [ ${commands_indicator[$COMPARE_Y_AT_X]} -ne 0 ] ; then + run_trapped_test test_traits \ + data/$1/compare_y_at_x.pt data/$1/compare_y_at_x.xcv \ + data/empty.zero data/$1/compare_y_at_x $2 + fi + if [ ${commands_indicator[$COMPARE_Y_AT_X_LEFT]} -ne 0 ] ; then + run_trapped_test test_traits \ + data/$1/compare_y_at_x_left.pt data/$1/compare_y_at_x_left.xcv \ + data/empty.zero data/$1/compare_y_at_x_left $2 + fi + if [ ${commands_indicator[$COMPARE_Y_AT_X_RIGHT]} -ne 0 ] ; then + run_trapped_test test_traits \ + data/$1/compare_y_at_x_right.pt data/$1/compare_y_at_x_right.xcv \ + data/empty.zero data/$1/compare_y_at_x_right $2 + fi + if [ ${commands_indicator[$MAKE_X_MONOTONE]} -ne 0 ] ; then + run_trapped_test test_traits \ + data/empty.zero data/$1/make_x_monotone.xcv \ + data/$1/make_x_monotone.cv data/$1/make_x_monotone $2 + fi + if [ ${commands_indicator[$INTERSECT]} -ne 0 ] ; then + run_trapped_test test_traits \ + data/$1/intersect.pt data/$1/intersect.xcv \ + data/empty.zero data/$1/intersect $2 + fi + if [ ${commands_indicator[$SPLIT]} -ne 0 ] ; then + run_trapped_test test_traits \ + data/$1/split.pt data/$1/split.xcv \ + data/empty.zero data/$1/split $2 + fi + if [ ${commands_indicator[$ARE_MERGEABLE]} -ne 0 ] ; then + run_trapped_test test_traits \ + data/empty.zero data/$1/are_mergeable.xcv \ + data/empty.zero data/$1/are_mergeable $2 + fi + if [ ${commands_indicator[$MERGE]} -ne 0 ] ; then + run_trapped_test test_traits \ + data/empty.zero data/$1/merge.xcv \ + data/empty.zero data/$1/merge $2 + fi + if [ ${commands_indicator[$ASSERTIONS]} -ne 0 ] ; then + run_trapped_test test_traits \ + data/$1/assertions.pt data/$1/assertions.xcv \ + data/empty.zero data/$1/assertions $2 + fi + if [ ${commands_indicator[$CONSTRUCTOR]} -ne 0 ] ; then + run_trapped_test test_traits \ + data/empty.zero data/$1/constructor.xcv \ + data/$1/constructor.cv data/$1/constructor $2 + fi +} + +execute_commands_new_structure() +{ + +# the new design for the tests includes separation of the test input into 4 +# parts: points file, xcurves file, curves file and execution block file. +# one may reuse the input files for the various tests + +# the new structure is not default, so this function executes only +# commands that are given as arguments + + commands_indicator[COMPARE]=0 + commands_indicator[VERTEX]=0 + commands_indicator[IS_VERTICAL]=0 + commands_indicator[COMPARE_X_AT_LIMIT]=0 + commands_indicator[COMPARE_X_NEAR_LIMIT]=0 + commands_indicator[COMPARE_X_ON_BOUNDARY]=0 + commands_indicator[COMPARE_X_NEAR_BOUNDARY]=0 + commands_indicator[COMPARE_Y_NEAR_BOUNDARY]=0 + commands_indicator[PARAMETER_SPACE_X]=0 + commands_indicator[PARAMETER_SPACE_Y]=0 + commands_indicator[COMPARE_Y_AT_X]=0 + commands_indicator[COMPARE_Y_AT_X_LEFT]=0 + commands_indicator[COMPARE_Y_AT_X_RIGHT]=0 + commands_indicator[MAKE_X_MONOTONE]=0 + commands_indicator[INTERSECT]=0 + commands_indicator[SPLIT]=0 + commands_indicator[ARE_MERGEABLE]=0 + commands_indicator[MERGE]=0 + commands_indicator[ASSERTIONS]=0 + commands_indicator[CONSTRUCTOR]=0 + commands_indicator[EQUAL]=0 + commands_indicator[PUSH_BACK]=0 + commands_indicator[PUSH_FRONT]=0 + commands_indicator[NUMBER_OF_POINTS]=0 + commands_indicator[COMPARE_ENDPOINTS_XY]=0 + commands_indicator[CONSTRUCT_OPPOSITE]=0 + commands_indicator[TRIM]=0 + i=1 + if [ $# -gt 2 ] ; then + for arg in $* ; do + if [ $i -gt 2 ] ; then + commands_indicator[$arg]=1 + fi + let "i+=1" + done + fi + if [ ${commands_indicator[$COMPARE]} -ne 0 ] ; then + run_trapped_test test_traits data/$1/points \ + data/$1/xcurves data/$1/curves data/$1/compare $2 + fi + if [ ${commands_indicator[$VERTEX]} -ne 0 ] ; then + run_trapped_test test_traits data/$1/points \ + data/$1/xcurves data/$1/curves data/$1/vertex $2 + fi + if [ ${commands_indicator[$IS_VERTICAL]} -ne 0 ] ; then + run_trapped_test test_traits data/$1/points \ + data/$1/xcurves data/$1/curves data/$1/is_vertical $2 + fi + if [ ${commands_indicator[$COMPARE_X_AT_LIMIT]} -ne 0 ] ; then + run_trapped_test test_traits data/$1/points \ + data/$1/xcurves data/$1/curves data/$1/compare_x_at_limit $2 + fi + if [ ${commands_indicator[$COMPARE_X_NEAR_LIMIT]} -ne 0 ] ; then + run_trapped_test test_traits data/$1/points \ + data/$1/xcurves data/$1/curves data/$1/compare_x_near_limit $2 + fi + if [ ${commands_indicator[$COMPARE_X_ON_BOUNDARY]} -ne 0 ] ; then + run_trapped_test test_traits data/$1/points \ + data/$1/xcurves data/$1/curves data/$1/compare_x_on_boundary $2 + fi + if [ ${commands_indicator[$COMPARE_X_NEAR_BOUNDARY]} -ne 0 ] ; then + run_trapped_test test_traits data/$1/points \ + data/$1/xcurves data/$1/curves data/$1/compare_x_near_boundary $2 + fi + if [ ${commands_indicator[$COMPARE_Y_NEAR_BOUNDARY]} -ne 0 ] ; then + run_trapped_test test_traits data/$1/points \ + data/$1/xcurves data/$1/curves data/$1/compare_y_near_boundary $2 + fi + if [ ${commands_indicator[$PARAMETER_SPACE_X]} -ne 0 ] ; then + run_trapped_test test_traits data/$1/points \ + data/$1/xcurves data/$1/curves data/$1/parameter_space_x $2 + fi + if [ ${commands_indicator[$PARAMETER_SPACE_Y]} -ne 0 ] ; then + run_trapped_test test_traits data/$1/points \ + data/$1/xcurves data/$1/curves data/$1/parameter_space_y $2 + fi + if [ ${commands_indicator[$COMPARE_Y_AT_X]} -ne 0 ] ; then + run_trapped_test test_traits data/$1/points \ + data/$1/xcurves data/$1/curves data/$1/compare_y_at_x $2 + fi + if [ ${commands_indicator[$COMPARE_Y_AT_X_LEFT]} -ne 0 ] ; then + run_trapped_test test_traits data/$1/points \ + data/$1/xcurves data/$1/curves data/$1/compare_y_at_x_left $2 + fi + if [ ${commands_indicator[$COMPARE_Y_AT_X_RIGHT]} -ne 0 ] ; then + run_trapped_test test_traits data/$1/points \ + data/$1/xcurves data/$1/curves data/$1/compare_y_at_x_right $2 + fi + if [ ${commands_indicator[$MAKE_X_MONOTONE]} -ne 0 ] ; then + run_trapped_test test_traits data/$1/points \ + data/$1/xcurves data/$1/curves data/$1/make_x_monotone $2 + fi + if [ ${commands_indicator[$INTERSECT]} -ne 0 ] ; then + run_trapped_test test_traits data/$1/points \ + data/$1/xcurves data/$1/curves data/$1/intersect $2 + fi + if [ ${commands_indicator[$SPLIT]} -ne 0 ] ; then + run_trapped_test test_traits data/$1/points \ + data/$1/xcurves data/$1/curves data/$1/split $2 + fi + if [ ${commands_indicator[$ARE_MERGEABLE]} -ne 0 ] ; then + run_trapped_test test_traits data/$1/points \ + data/$1/xcurves data/$1/curves data/$1/are_mergeable $2 + fi + if [ ${commands_indicator[$MERGE]} -ne 0 ] ; then + run_trapped_test test_traits data/$1/points \ + data/$1/xcurves data/$1/curves data/$1/merge $2 + fi + if [ ${commands_indicator[$ASSERTIONS]} -ne 0 ] ; then + run_trapped_test test_traits data/$1/points \ + data/$1/xcurves data/$1/curves data/$1/assertions $2 + fi + if [ ${commands_indicator[$CONSTRUCTOR]} -ne 0 ] ; then + run_trapped_test test_traits data/$1/points \ + data/$1/xcurves data/$1/curves data/$1/constructor $2 + fi + if [ ${commands_indicator[$EQUAL]} -ne 0 ] ; then + run_trapped_test test_traits data/$1/points \ + data/$1/xcurves data/$1/curves data/$1/equal $2 + fi + if [ ${commands_indicator[$PUSH_BACK]} -ne 0 ] ; then + run_trapped_test test_traits data/$1/points \ + data/$1/xcurves data/$1/curves data/$1/push_back $2 + fi + if [ ${commands_indicator[$PUSH_FRONT]} -ne 0 ] ; then + run_trapped_test test_traits data/$1/points \ + data/$1/xcurves data/$1/curves data/$1/push_front $2 + fi + if [ ${commands_indicator[$NUMBER_OF_POINTS]} -ne 0 ] ; then + run_trapped_test test_traits data/$1/points \ + data/$1/xcurves data/$1/curves data/$1/number_of_points $2 + fi + if [ ${commands_indicator[$COMPARE_ENDPOINTS_XY]} -ne 0 ] ; then + run_trapped_test test_traits data/$1/points \ + data/$1/xcurves data/$1/curves data/$1/compare_endpoints_xy $2 + fi + if [ ${commands_indicator[$CONSTRUCT_OPPOSITE]} -ne 0 ] ; then + run_trapped_test test_traits data/$1/points \ + data/$1/xcurves data/$1/curves data/$1/construct_opposite $2 + fi + if [ ${commands_indicator[$TRIM]} -ne 0 ] ; then + run_trapped_test test_traits data/$1/points \ + data/$1/xcurves data/$1/curves data/$1/trim $2 + fi +} + +execute_commands_traits_adaptor() +{ + +# the new structure is not default, so this function executes only +# commands that are given as arguments + + commands_indicator[PARAMETER_SPACE_X]=0 + commands_indicator[PARAMETER_SPACE_Y]=0 + commands_indicator[COMPARE_X_AT_LIMIT]=0 + commands_indicator[COMPARE_X_NEAR_LIMIT]=0 + commands_indicator[COMPARE_X_ON_BOUNDARY]=0 + commands_indicator[COMPARE_X_NEAR_BOUNDARY]=0 + commands_indicator[COMPARE_Y_NEAR_BOUNDARY]=0 + commands_indicator[COMPARE_Y_AT_X_LEFT]=0 + commands_indicator[ARE_MERGEABLE]=0 + commands_indicator[MERGE]=0 + commands_indicator[X_ON_IDENTIFICATION]=0 + commands_indicator[Y_ON_IDENTIFICATION]=0 + commands_indicator[IS_BOUNDED]=0 + commands_indicator[IS_IN_X_RANGE]=0 + commands_indicator[COMPARE_Y_POSITION]=0 + commands_indicator[IS_BETWEEN_CW]=0 + commands_indicator[COMPARE_CW_AROUND_POINT]=0 + + i=1 + if [ $# -gt 2 ] ; then + for arg in $* ; do + if [ $i -gt 2 ] ; then + commands_indicator[$arg]=1 + fi + let "i+=1" + done + fi + + if [ ${commands_indicator[$PARAMETER_SPACE_X]} -ne 0 ] ; then + run_trapped_test test_traits_adaptor data/test_adaptor/$1/points \ + data/test_adaptor/$1/xcurves data/test_adaptor/$1/curves \ + data/test_adaptor/$1/parameter_space_x $2 + fi + if [ ${commands_indicator[$PARAMETER_SPACE_Y]} -ne 0 ] ; then + run_trapped_test test_traits_adaptor data/test_adaptor/$1/points \ + data/test_adaptor/$1/xcurves data/test_adaptor/$1/curves \ + data/test_adaptor/$1/parameter_space_y $2 + fi + if [ ${commands_indicator[$COMPARE_X_AT_LIMIT]} -ne 0 ] ; then + run_trapped_test test_traits_adaptor data/test_adaptor/$1/points \ + data/test_adaptor/$1/xcurves data/test_adaptor/$1/curves \ + data/test_adaptor/$1/compare_x_at_limit $2 + fi + if [ ${commands_indicator[$COMPARE_X_NEAR_LIMIT]} -ne 0 ] ; then + run_trapped_test test_traits_adaptor data/test_adaptor/$1/points \ + data/test_adaptor/$1/xcurves data/test_adaptor/$1/curves \ + data/test_adaptor/$1/compare_x_near_limit $2 + fi + + if [ ${commands_indicator[$COMPARE_X_ON_BOUNDARY]} -ne 0 ] ; then + run_trapped_test test_traits_adaptor data/test_adaptor/$1/points \ + data/test_adaptor/$1/xcurves data/test_adaptor/$1/curves \ + data/test_adaptor/$1/compare_x_on_boundary $2 + fi + if [ ${commands_indicator[$COMPARE_X_NEAR_BOUNDARY]} -ne 0 ] ; then + run_trapped_test test_traits_adaptor data/test_adaptor/$1/points \ + data/test_adaptor/$1/xcurves data/test_adaptor/$1/curves \ + data/test_adaptor/$1/compare_x_near_boundary $2 + fi + + if [ ${commands_indicator[$COMPARE_Y_NEAR_BOUNDARY]} -ne 0 ] ; then + run_trapped_test test_traits_adaptor data/test_adaptor/$1/points \ + data/test_adaptor/$1/xcurves data/test_adaptor/$1/curves \ + data/test_adaptor/$1/compare_y_near_boundary $2 + fi + if [ ${commands_indicator[$COMPARE_Y_AT_X_LEFT]} -ne 0 ] ; then + run_trapped_test test_traits_adaptor data/test_adaptor/$1/points \ + data/test_adaptor/$1/xcurves data/test_adaptor/$1/curves \ + data/test_adaptor/$1/compare_y_at_x_left $2 + fi + if [ ${commands_indicator[$ARE_MERGEABLE]} -ne 0 ] ; then + run_trapped_test test_traits_adaptor data/test_adaptor/$1/points \ + data/test_adaptor/$1/xcurves data/test_adaptor/$1/curves \ + data/test_adaptor/$1/are_mergeable $2 + fi + if [ ${commands_indicator[$MERGE]} -ne 0 ] ; then + run_trapped_test test_traits_adaptor data/test_adaptor/$1/points \ + data/test_adaptor/$1/xcurves data/test_adaptor/$1/curves \ + data/test_adaptor/$1/merge $2 + fi + if [ ${commands_indicator[X_ON_IDENTIFICATION]} -ne 0 ] ; then + run_trapped_test test_traits_adaptor data/test_adaptor/$1/points \ + data/test_adaptor/$1/xcurves data/test_adaptor/$1/curves \ + data/test_adaptor/$1/x_on_idintification $2 + fi + if [ ${commands_indicator[Y_ON_IDENTIFICATION]} -ne 0 ] ; then + run_trapped_test test_traits_adaptor data/test_adaptor/$1/points \ + data/test_adaptor/$1/xcurves data/test_adaptor/$1/curves \ + data/test_adaptor/$1/x_on_idintification $2 + fi + if [ ${commands_indicator[IS_BOUNDED]} -ne 0 ] ; then + run_trapped_test test_traits_adaptor data/test_adaptor/$1/points \ + data/test_adaptor/$1/xcurves data/test_adaptor/$1/curves \ + data/test_adaptor/$1/is_bounded $2 + fi + if [ ${commands_indicator[IS_IN_X_RANGE]} -ne 0 ] ; then + run_trapped_test test_traits_adaptor data/test_adaptor/$1/points \ + data/test_adaptor/$1/xcurves data/test_adaptor/$1/curves \ + data/test_adaptor/$1/is_in_x_range $2 + fi + if [ ${commands_indicator[COMPARE_Y_POSITION]} -ne 0 ] ; then + run_trapped_test test_traits_adaptor data/test_adaptor/$1/points \ + data/test_adaptor/$1/xcurves data/test_adaptor/$1/curves \ + data/test_adaptor/$1/compare_y_position $2 + fi + if [ ${commands_indicator[IS_BETWEEN_CW]} -ne 0 ] ; then + run_trapped_test test_traits_adaptor data/test_adaptor/$1/points \ + data/test_adaptor/$1/xcurves data/test_adaptor/$1/curves \ + data/test_adaptor/$1/is_between_cw $2 + fi + if [ ${commands_indicator[COMPARE_CW_AROUND_POINT]} -ne 0 ] ; then + run_trapped_test test_traits_adaptor data/test_adaptor/$1/points \ + data/test_adaptor/$1/xcurves data/test_adaptor/$1/curves \ + data/test_adaptor/$1/compare_cw_around_point $2 + fi +} + +#---------------------------------------------------------------------# +# traits adaptor (segments traits) +#---------------------------------------------------------------------# +test_segment_traits_adaptor() +{ + local nt=$QUOTIENT_MP_FLOAT_NT; + local kernel=$CARTESIAN_KERNEL; + local geom_traits=$SEGMENT_GEOM_TRAITS; + local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; + + compile_test_with_flags test_traits_adaptor segments "$flags" + if [ -n "${SUCCESS}" ] ; then + execute_commands_traits_adaptor segments segments_traits_adaptor \ + COMPARE_Y_POSITION COMPARE_CW_AROUND_POINT COMPARE_Y_AT_X_LEFT \ + ARE_MERGEABLE MERGE IS_IN_X_RANGE IS_BETWEEN_CW + else + echo " ERROR: not executed test_traits_adaptor segment_traits" >> $ERRORFILE + fi + clean_tests +} + +#---------------------------------------------------------------------# +# traits adaptor (linear traits) +#---------------------------------------------------------------------# +test_linear_traits_adaptor() +{ + local nt=$QUOTIENT_MP_FLOAT_NT; + local kernel=$CARTESIAN_KERNEL; + local geom_traits=$LINEAR_GEOM_TRAITS; + local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; + + compile_test_with_flags test_traits_adaptor linear "$flags" + if [ -n "${SUCCESS}" ] ; then + execute_commands_traits_adaptor linear linear_traits_adaptor \ + COMPARE_Y_AT_X_LEFT ARE_MERGEABLE MERGE IS_IN_X_RANGE \ + COMPARE_Y_POSITION IS_BETWEEN_CW COMPARE_CW_AROUND_POINT + else + echo " ERROR: not executed test_traits_adaptor linear_traits" >> $ERRORFILE + fi + clean_tests +} + +#---------------------------------------------------------------------# +# traits adaptor (spherical arcs traits) +#---------------------------------------------------------------------# +test_spherical_arcs_traits_adaptor() +{ + local nt=$CGAL_GMPQ_NT; + local kernel=$CARTESIAN_KERNEL; + local geom_traits=$GEODESIC_ARC_ON_SPHERE_GEOM_TRAITS; + local topol_traits=$SPHERICAL_TOPOL_TRAITS + local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits -DTEST_TOPOL_TRAITS=$topol_traits"; + + compile_test_with_flags test_traits_adaptor geodesic_arcs_on_sphere "$flags" + if [ -n "${SUCCESS}" ] ; then + execute_commands_traits_adaptor spherical_arcs spherical_arcs_traits_adaptor \ + COMPARE_Y_AT_X_LEFT ARE_MERGEABLE MERGE IS_IN_X_RANGE \ + COMPARE_Y_POSITION IS_BETWEEN_CW COMPARE_CW_AROUND_POINT + else + echo " ERROR: not executed test_traits_adaptor spherical_arcs_traits" >> $ERRORFILE + fi + clean_tests +} + +#---------------------------------------------------------------------# +# compile and run test with traits +#---------------------------------------------------------------------# +compile_and_run_with_flags() +{ + local name=$1; + local type=$2; + local flags=$3; + + compile_test_with_flags $name $type "$flags" + if [ -n "${SUCCESS}" ] ; then + if [ -n "$DO_RUN" ] ; then + run_test_with_flags $name $type + fi + else + echo " ERROR: not executed construction of segments" >> $ERRORFILE + fi + clean_tests +} + +#---------------------------------------------------------------------# +# construction with segments +#---------------------------------------------------------------------# +test_construction_segments() +{ + local nt=$CGAL_GMPQ_NT; + local kernel=$CARTESIAN_KERNEL; + local geom_traits=$SEGMENT_GEOM_TRAITS; + local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; + compile_and_run_with_flags test_construction segments "$flags" +} + +#---------------------------------------------------------------------# +# construction with linear curves +#---------------------------------------------------------------------# +test_construction_linear_curves() +{ + local nt=$CGAL_GMPQ_NT; + local kernel=$CARTESIAN_KERNEL; + local geom_traits=$LINEAR_GEOM_TRAITS; + local topol_traits=$PLANAR_UNBOUNDED_TOPOL_TRAITS; + local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits -DTEST_TOPOL_TRAITS=$topol_traits"; + compile_and_run_with_flags test_construction linear "$flags" +} + +#---------------------------------------------------------------------# +# construction with geodesic arcs on the sphere +#---------------------------------------------------------------------# +test_construction_spherical_arcs() +{ + local nt=$CGAL_GMPQ_NT; + local kernel=$CARTESIAN_KERNEL; + local geom_traits=$GEODESIC_ARC_ON_SPHERE_GEOM_TRAITS; + local topol_traits=$SPHERICAL_TOPOL_TRAITS; + local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits -DTEST_TOPOL_TRAITS=$topol_traits"; + compile_and_run_with_flags test_construction geodesic_arcs_on_sphere "$flags" +} + +#---------------------------------------------------------------------# +# construction with polylines +#---------------------------------------------------------------------# +test_construction_polylines() +{ + local nt=$CGAL_GMPQ_NT; + local kernel=$CARTESIAN_KERNEL; + local geom_traits=$POLYLINE_GEOM_TRAITS; + local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; + compile_and_run_with_flags test_construction polylines "$flags" +} + +#---------------------------------------------------------------------# +# overlay with segments +#---------------------------------------------------------------------# +test_overlay_segments() +{ + local nt=$CGAL_GMPQ_NT; + local kernel=$CARTESIAN_KERNEL; + local geom_traits=$SEGMENT_GEOM_TRAITS; + local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; + compile_and_run_with_flags test_overlay segments "$flags" +} + +#---------------------------------------------------------------------# +# overlay with geodesic arcs on the sphere +#---------------------------------------------------------------------# +test_overlay_spherical_arcs() +{ + local nt=$CGAL_GMPQ_NT; + local kernel=$CARTESIAN_KERNEL; + local geom_traits=$GEODESIC_ARC_ON_SPHERE_GEOM_TRAITS; + local topol_traits=$SPHERICAL_TOPOL_TRAITS; + local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits -DTEST_TOPOL_TRAITS=$topol_traits"; + compile_and_run_with_flags test_overlay geodesic_arcs_on_sphere "$flags" +} + +#---------------------------------------------------------------------# +# point location with segments +#---------------------------------------------------------------------# +test_point_location_segments() +{ + local nt=$CGAL_GMPQ_NT; + local kernel=$CARTESIAN_KERNEL; + local geom_traits=$SEGMENT_GEOM_TRAITS; + local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; + compile_and_run_with_flags test_point_location segments "$flags" +} + +# For backward compatibility +test_point_location_segments_version() +{ + local nt=$CGAL_GMPQ_NT; + local kernel=$CARTESIAN_KERNEL; + local geom_traits=$SEGMENT_GEOM_TRAITS; + local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits -DCGAL_ARR_POINT_LOCATION_VERSION=1"; + compile_and_run_with_flags test_point_location segments "$flags" +} + +# For backward compatibility +test_point_location_segments_conversion() +{ + local nt=$CGAL_GMPQ_NT; + local kernel=$CARTESIAN_KERNEL; + local geom_traits=$SEGMENT_GEOM_TRAITS; + local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits -DCGAL_ARR_POINT_LOCATION_CONVERSION"; + compile_and_run_with_flags test_point_location segments "$flags" +} + +#---------------------------------------------------------------------# +# point location dynamic with segments +#---------------------------------------------------------------------# +test_point_location_dynamic_segments() +{ + local nt=$CGAL_GMPQ_NT; + local kernel=$CARTESIAN_KERNEL; + local geom_traits=$SEGMENT_GEOM_TRAITS; + local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; + compile_and_run_with_flags test_point_location_dynamic segments "$flags" +} + +#---------------------------------------------------------------------# +# point location with circle segments +#---------------------------------------------------------------------# +test_point_location_circle_segments() +{ + local nt=$CGAL_GMPQ_NT; + local kernel=$CARTESIAN_KERNEL; + local geom_traits=$CIRCLE_SEGMENT_GEOM_TRAITS; + local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; + compile_and_run_with_flags test_point_location circle_segments "$flags" +} + +#---------------------------------------------------------------------# +# point location with linear objects +#---------------------------------------------------------------------# +test_point_location_linear() +{ + local nt=$CGAL_GMPQ_NT; + local kernel=$CARTESIAN_KERNEL; + local geom_traits=$LINEAR_GEOM_TRAITS; + local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; + compile_and_run_with_flags test_point_location linear "$flags" +} + +#---------------------------------------------------------------------# +# batchecd point location with segments +#---------------------------------------------------------------------# +test_batched_point_location_segments() +{ + local nt=$CGAL_GMPQ_NT; + local kernel=$CARTESIAN_KERNEL; + local geom_traits=$SEGMENT_GEOM_TRAITS; + local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; + compile_and_run_with_flags test_batched_point_location segments "$flags" +} + +#---------------------------------------------------------------------# +# batchecd point location with linear objects +#---------------------------------------------------------------------# +test_batched_point_location_linear() +{ + local nt=$CGAL_GMPQ_NT; + local kernel=$CARTESIAN_KERNEL; + local geom_traits=$LINEAR_GEOM_TRAITS; + local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; + compile_and_run_with_flags test_batched_point_location linear "$flags" +} + +#---------------------------------------------------------------------# +# batchecd point location with geodesic arcs on the sphere +#---------------------------------------------------------------------# +test_batched_point_location_spherical_arcs() +{ + local nt=$CGAL_GMPQ_NT; + local kernel=$CARTESIAN_KERNEL; + local geom_traits=$GEODESIC_ARC_ON_SPHERE_GEOM_TRAITS; + local topol_traits=$SPHERICAL_TOPOL_TRAITS; + local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits -DTEST_TOPOL_TRAITS=$topol_traits"; + compile_and_run_with_flags test_batched_point_location geodesic_arcs_on_sphere "$flags" +} + +#---------------------------------------------------------------------# +# vertical decomposition with segments +#---------------------------------------------------------------------# +test_vertical_decomposition_segments() +{ + local nt=$CGAL_GMPQ_NT; + local kernel=$CARTESIAN_KERNEL; + local geom_traits=$SEGMENT_GEOM_TRAITS; + local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; + compile_and_run_with_flags test_vertical_decomposition segments "$flags" +} + +#---------------------------------------------------------------------# +# vertical decomposition with linear objects +#---------------------------------------------------------------------# +test_vertical_decomposition_linear() +{ + local nt=$CGAL_GMPQ_NT; + local kernel=$CARTESIAN_KERNEL; + local geom_traits=$LINEAR_GEOM_TRAITS; + local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; + compile_and_run_with_flags test_vertical_decomposition linear "$flags" +} + +#---------------------------------------------------------------------# +# vertical decomposition with geodesic arcs on the sphere +#---------------------------------------------------------------------# +test_vertical_decomposition_spherical_arcs() +{ + local nt=$CGAL_GMPQ_NT; + local kernel=$CARTESIAN_KERNEL; + local geom_traits=$LINEAR_GEOM_TRAITS; + local topol_traits=$SPHERICAL_TOPOL_TRAITS; + local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits -DTEST_TOPOL_TRAITS=$topol_traits"; + compile_and_run_with_flags test_vertical_decomposition geodesic_arcs_on_sphere "$flags" +} + +#---------------------------------------------------------------------# +# segment traits +#---------------------------------------------------------------------# +test_segment_traits() +{ + local nt=$QUOTIENT_MP_FLOAT_NT; + local kernel=$CARTESIAN_KERNEL; + local geom_traits=$SEGMENT_GEOM_TRAITS; + local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; + + compile_test_with_flags test_traits segments "$flags" + if [ -n "${SUCCESS}" ] ; then + execute_commands_old_structure segments segment_traits \ + VERTEX IS_VERTICAL COMPARE_Y_AT_X COMPARE_Y_AT_X_LEFT CONSTRUCTOR \ + COMPARE_Y_AT_X_RIGHT ARE_MERGEABLE + + execute_commands_new_structure segments segment_traits \ + IS_VERTICAL COMPARE_Y_AT_X COMPARE_Y_AT_X_LEFT ARE_MERGEABLE + + run_trapped_test test_traits \ + data/segments/vertex.pt data/segments/xcurves \ + data/empty.zero data/segments/vertex segment_traits + else + echo " ERROR: not executed test_traits segment_traits" >> $ERRORFILE + fi + clean_tests +} + +#---------------------------------------------------------------------# +# non-caching segment traits +#---------------------------------------------------------------------# +test_non_caching_segment_traits() +{ + local nt=$CGAL_GMPQ_NT; + local kernel=$CARTESIAN_KERNEL; + local geom_traits=$NON_CACHING_SEGMENT_GEOM_TRAITS; + local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; + + compile_test_with_flags test_traits non_caching_segments "$flags" + if [ -n "${SUCCESS}" ] ; then + execute_commands_old_structure segments non_caching_segment_traits \ + VERTEX IS_VERTICAL COMPARE_Y_AT_X COMPARE_Y_AT_X_LEFT CONSTRUCTOR \ + COMPARE_Y_AT_X_RIGHT ARE_MERGEABLE ASSERTIONS + + execute_commands_new_structure segments segment_traits \ + IS_VERTICAL COMPARE_Y_AT_X COMPARE_Y_AT_X_LEFT + + run_trapped_test test_traits \ + data/segments/vertex.pt data/segments/xcurves \ + data/empty.zero data/segments/vertex non_caching_segment_traits + else + echo " ERROR: not executed test_traits non_caching_segment_traits" >> $ERRORFILE + fi + clean_tests +} + +#---------------------------------------------------------------------# +# polycurve conic traits +#---------------------------------------------------------------------# +test_polycurve_conic_traits() +{ + if [ -n "${CGAL_DISABLE_GMP}" ]; then + echo "CORE is not available, test_polycurve_conic_traits not ran" + return + fi + echo polycurve test starting + local nt=$CORE_EXPR_NT; + local kernel=$CARTESIAN_KERNEL; + local geom_traits=$POLYCURVE_CONIC_GEOM_TRAITS; + local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; + + compile_test_with_flags test_traits conic_polycurve "$flags" + if [ -n "${SUCCESS}" ] ; then + + # The input arguments for the execute_commands_new_structure, + # 1. Polycurve_conics is the directory name in "data" + # 2. polycurve_conic_traits is a string + # Execute_command_new_structure will only run the test on functors provided as the third, fourth and so on arguments. + # To see how the input data directory should be structured for each functor, check the execute_commands_new_structure function in this file. + execute_commands_new_structure polycurves_conics polycurve_conic_traits \ + COMPARE_Y_AT_X \ + INTERSECT \ + EQUAL \ + IS_VERTICAL \ + SPLIT \ + ARE_MERGEABLE \ + COMPARE_Y_AT_X_LEFT \ + COMPARE_Y_AT_X_RIGHT \ + MAKE_X_MONOTONE \ + PUSH_BACK \ + PUSH_FRONT \ + NUMBER_OF_POINTS \ + VERTEX \ + CONSTRUCT_OPPOSITE \ + MERGE \ + COMPARE_ENDPOINTS_XY \ + TRIM + + else + echo " ERROR: not executed test_traits polyline_traits" >> $ERRORFILE + fi + clean_tests +} + +#---------------------------------------------------------------------# +# polycurve arc traits +#---------------------------------------------------------------------# +test_polycurve_circular_arc_traits() +{ + local nt=$QUOTIENT_MP_FLOAT_NT; + local kernel=$CARTESIAN_KERNEL; + local geom_traits=$POLYCURVE_CIRCULAR_ARC_GEOM_TRAITS; + local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; + + compile_test_with_flags test_traits circular_arc_polycurve "$flags" + if [ -n "${SUCCESS}" ] ; then + execute_commands_new_structure Polycurves_circular_arcs polycurve_circular_arc_traits \ + COMPARE_Y_AT_X \ + EQUAL \ + IS_VERTICAL \ + SPLIT \ + ARE_MERGEABLE \ + COMPARE_Y_AT_X_LEFT \ + COMPARE_Y_AT_X_RIGHT \ + MAKE_X_MONOTONE \ + PUSH_BACK \ + PUSH_FRONT \ + NUMBER_OF_POINTS \ + VERTEX \ + CONSTRUCT_OPPOSITE \ + MERGE \ + COMPARE_ENDPOINTS_XY \ + INTERSECT + + else + echo " ERROR: not executed test_traits polyline_traits" >> $ERRORFILE + fi + clean_tests +} + +#---------------------------------------------------------------------# +# polycurve bezier traits +#---------------------------------------------------------------------# +test_polycurve_bezier_traits() +{ + if [ -n "${CGAL_DISABLE_GMP}" ]; then + echo "CORE is not available, test_polycurve_bezier_traits not ran" + return + fi + local nt=$CORE_EXPR_NT; + local kernel=$CARTESIAN_KERNEL; + local geom_traits=$POLYCURVE_BEZIER_GEOM_TRAITS; + local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; + + compile_test_with_flags test_traits bezier_polycurve "$flags" + if [ -n "${SUCCESS}" ] ; then + execute_commands_new_structure Polycurves_bezier test_polycurve_bezier_traits \ + MERGE \ + EQUAL \ + IS_VERTICAL \ + NUMBER_OF_POINTS \ + PUSH_BACK \ + PUSH_FRONT \ + VERTEX \ + ARE_MERGEABLE \ + COMPARE_ENDPOINTS_XY + # TODO (add data for these tests) + # COMPARE_Y_AT_X \ + # SPLIT \ + # COMPARE_Y_AT_X_LEFT \ + # COMPARE_Y_AT_X_RIGHT \ + # MAKE_X_MONOTONE \ + # CONSTRUCT_OPPOSITE \ + + # INTERSECT + + else + echo " ERROR: not executed test_traits polyline_traits" >> $ERRORFILE + fi + clean_tests +} + +#---------------------------------------------------------------------# +# polyline traits +#---------------------------------------------------------------------# +test_polyline_traits() +{ + local nt=$CGAL_GMPQ_NT; + local kernel=$CARTESIAN_KERNEL; + local geom_traits=$POLYLINE_GEOM_TRAITS; + local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; + + compile_test_with_flags test_traits test_polylines "$flags" + if [ -n "${SUCCESS}" ] ; then + execute_commands_old_structure polylines polyline_traits \ + CONSTRUCTOR COMPARE_Y_AT_X_LEFT \ + COMPARE_Y_AT_X_RIGHT ARE_MERGEABLE + else + echo " ERROR: not executed test_traits polyline_traits" >> $ERRORFILE + fi + clean_tests +} + +#---------------------------------------------------------------------# +# non-caching polyline traits +#---------------------------------------------------------------------# +test_non_caching_polyline_traits() +{ + local nt=$CGAL_GMPQ_NT; + local kernel=$CARTESIAN_KERNEL; + local geom_traits=$NON_CACHING_POLYLINE_GEOM_TRAITS; + local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; + + compile_test_with_flags test_traits non_caching_polylines "$flags" + if [ -n "${SUCCESS}" ] ; then + execute_commands_old_structure polylines non_caching_polyline_traits \ + CONSTRUCTOR COMPARE_Y_AT_X_LEFT \ + COMPARE_Y_AT_X_RIGHT ARE_MERGEABLE + else + echo " ERROR: not executed test_traits non_caching_polyline_traits" >> $ERRORFILE + fi + clean_tests +} + +#---------------------------------------------------------------------# +# linear traits +#---------------------------------------------------------------------# +test_linear_traits() +{ + local nt=$QUOTIENT_MP_FLOAT_NT; + local kernel=$CARTESIAN_KERNEL; + local geom_traits=$LINEAR_GEOM_TRAITS; + local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; + + compile_test_with_flags test_traits linear "$flags" + if [ -n "${SUCCESS}" ] ; then + execute_commands_old_structure linear/segments linear_traits.segments \ + VERTEX IS_VERTICAL COMPARE_Y_AT_X COMPARE_Y_AT_X_LEFT \ + COMPARE_Y_AT_X_RIGHT CONSTRUCTOR ARE_MERGEABLE + + execute_commands_new_structure linear/segments linear_traits.segments \ + IS_VERTICAL COMPARE_Y_AT_X COMPARE_Y_AT_X_LEFT + + run_trapped_test test_traits \ + data/linear/segments/vertex.pt data/linear/segments/xcurves \ + data/empty.zero data/linear/segments/vertex linear_traits.segments + + execute_commands_old_structure linear/rays linear_traits.rays \ + VERTEX IS_VERTICAL COMPARE_Y_AT_X COMPARE_Y_AT_X_LEFT \ + COMPARE_Y_AT_X_RIGHT CONSTRUCTOR ARE_MERGEABLE + + execute_commands_new_structure linear/rays linear_traits.rays \ + IS_VERTICAL COMPARE_Y_AT_X COMPARE_Y_AT_X_LEFT + + run_trapped_test test_traits \ + data/linear/rays/vertex.pt data/linear/rays/xcurves \ + data/empty.zero data/linear/rays/vertex linear_traits.rays + + execute_commands_new_structure linear/lines linear_traits.lines \ + IS_VERTICAL COMPARE_Y_AT_X COMPARE_Y_AT_X_LEFT INTERSECT \ + SPLIT MERGE \ + PARAMETER_SPACE_X PARAMETER_SPACE_Y \ + COMPARE_X_AT_LIMIT COMPARE_X_NEAR_LIMIT COMPARE_Y_NEAR_BOUNDARY + else + echo " ERROR: not executed test_traits linear_traits" >> $ERRORFILE + fi + clean_tests +} + +#---------------------------------------------------------------------# +# conic traits +#---------------------------------------------------------------------# +test_conic_traits() +{ + if [ -n "${CGAL_DISABLE_GMP}" ]; then + echo "CORE is not available, test_conic_traits not ran" + return + fi + local nt=$CORE_EXPR_NT; + local kernel=$CARTESIAN_KERNEL; + local geom_traits=$CORE_CONIC_GEOM_TRAITS; + local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; + + compile_test_with_flags test_traits conics "$flags" + if [ -n "${SUCCESS}" ] ; then + execute_commands_old_structure conics conic_traits \ + INTERSECT SPLIT MERGE COMPARE_Y_AT_X_LEFT \ + COMPARE_Y_AT_X_RIGHT ARE_MERGEABLE + + execute_commands_new_structure conics conic_traits \ + INTERSECT SPLIT MERGE + + run_trapped_test test_traits \ + data/conics/compare.pt data/empty.zero \ + data/empty.zero data/conics/compare conic_traits + else + echo " ERROR: not executed test_traits conic_traits" >> $ERRORFILE + fi + clean_tests +} + +#---------------------------------------------------------------------# +# "line arcs" (segments) only +#---------------------------------------------------------------------# +test_line_arc_traits() +{ + local nt=$QUOTIENT_MP_FLOAT_NT; + local kernel=$CARTESIAN_KERNEL; + local geom_traits=$LINE_ARC_GEOM_TRAITS; + local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; + + compile_test_with_flags test_traits line_arcs "$flags" + if [ -n "${SUCCESS}" ] ; then + execute_commands_old_structure circular_lines line_arc_traits \ + VERTEX IS_VERTICAL COMPARE_Y_AT_X COMPARE_Y_AT_X_LEFT \ + ASSERTIONS COMPARE_Y_AT_X_RIGHT MERGE ARE_MERGEABLE + + execute_commands_new_structure circular_lines line_arc_traits \ + IS_VERTICAL COMPARE_Y_AT_X + + run_trapped_test test_traits \ + data/circular_lines/compare.pt data/empty.zero \ + data/empty.zero data/circular_lines/compare line_arc_traits + + run_trapped_test test_traits \ + data/circular_lines/vertex.pt data/circular_lines/xcurves \ + data/empty.zero data/circular_lines/vertex line_arc_traits + else + echo " ERROR: not executed test_traits" >> $ERRORFILE + fi + clean_tests +} + +#---------------------------------------------------------------------# +# circular arcs only +#---------------------------------------------------------------------# +test_circular_arc_traits() +{ + local nt=$QUOTIENT_MP_FLOAT_NT; + local kernel=$CARTESIAN_KERNEL; + local geom_traits=$CIRCULAR_ARC_GEOM_TRAITS; + local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; + + compile_test_with_flags test_traits circular_arcs "$flags" + if [ -n "${SUCCESS}" ] ; then + execute_commands_old_structure circular_arcs circular_arc_traits \ + VERTEX IS_VERTICAL COMPARE_Y_AT_X COMPARE_Y_AT_X_LEFT \ + ASSERTIONS COMPARE_Y_AT_X_RIGHT MERGE ARE_MERGEABLE + + execute_commands_new_structure circular_arcs circular_arc_traits \ + VERTEX IS_VERTICAL COMPARE_Y_AT_X + else + echo " ERROR: not executed test_traits" >> $ERRORFILE + fi + clean_tests +} + +#---------------------------------------------------------------------# +# circular and line arcs +#---------------------------------------------------------------------# +test_circular_line_arc_traits() +{ + local nt=$QUOTIENT_MP_FLOAT_NT; + local kernel=$CARTESIAN_KERNEL; + local geom_traits=$CIRCULAR_LINE_ARC_GEOM_TRAITS; + local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; + + compile_test_with_flags test_traits circular_line_arcs "$flags" + if [ -n "${SUCCESS}" ] ; then + execute_commands_old_structure circular_line_arcs circular_line_arc_traits \ + VERTEX IS_VERTICAL CONSTRUCTOR COMPARE_Y_AT_X COMPARE_Y_AT_X_LEFT \ + ASSERTIONS COMPARE_Y_AT_X_RIGHT MERGE ARE_MERGEABLE + + execute_commands_new_structure circular_line_arcs circular_line_arc_traits \ + IS_VERTICAL COMPARE_Y_AT_X + + run_trapped_test test_traits \ + data/circular_line_arcs/vertex.pt data/circular_line_arcs/xcurves \ + data/empty.zero data/circular_line_arcs/vertex circular_line_arc_traits + else + echo " ERROR: not executed test_traits circular_line_arc_traits" >> $ERRORFILE + fi + clean_tests +} + +#---------------------------------------------------------------------# +# circle segment traits +#---------------------------------------------------------------------# +test_circle_segments_traits() +{ + local nt=$QUOTIENT_MP_FLOAT_NT; + local kernel=$CARTESIAN_KERNEL; + local geom_traits=$CIRCLE_SEGMENT_GEOM_TRAITS; + local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; + + compile_test_with_flags test_traits circle_segments "$flags" + if [ -n "${SUCCESS}" ] ; then + execute_commands_old_structure circle_segments circle_segments_traits \ + VERTEX IS_VERTICAL COMPARE_Y_AT_X COMPARE_Y_AT_X_LEFT \ + COMPARE_Y_AT_X_RIGHT CONSTRUCTOR ARE_MERGEABLE + + run_trapped_test test_traits \ + data/circle_segments/points data/circle_segments/xcurves.8 \ + data/empty.zero data/circle_segments/vertex circle_segments_traits + run_trapped_test test_traits \ + data/empty.zero data/circle_segments/xcurves.8 \ + data/empty.zero data/circle_segments/is_vertical circle_segments_traits + run_trapped_test test_traits \ + data/circle_segments/points data/circle_segments/xcurves.8 \ + data/empty.zero data/circle_segments/compare_y_at_x circle_segments_traits + run_trapped_test test_traits \ + data/circle_segments/points data/circle_segments/xcurves.16 \ + data/empty.zero data/circle_segments/compare_y_at_x_left circle_segments_traits + run_trapped_test test_traits \ + data/circle_segments/points data/circle_segments/xcurves.16 \ + data/empty.zero data/circle_segments/compare_y_at_x_right circle_segments_traits + run_trapped_test test_traits \ + data/empty.zero data/circle_segments/constructor.xcv \ + data/empty.zero data/circle_segments/constructor circle_segments_traits + else + echo " ERROR: not executed test_traits circle_segments_traits" >> $ERRORFILE + fi + clean_tests +} + +#---------------------------------------------------------------------# +# bezier traits +#---------------------------------------------------------------------# +test_bezier_traits() +{ + if [ -n "${CGAL_DISABLE_GMP}" ]; then + echo "CORE is not available, test_bezier_traits not ran" + return + fi + local nt=$CORE_EXPR_NT; + local kernel=$CARTESIAN_KERNEL; + local geom_traits=$BEZIER_GEOM_TRAITS; + local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; + + compile_test_with_flags test_traits Bezier "$flags" + if [ -n "${SUCCESS}" ] ; then + execute_commands_old_structure bezier bezier_traits \ + COMPARE_Y_AT_X_LEFT COMPARE_Y_AT_X_RIGHT SPLIT \ + CONSTRUCTOR ASSERTIONS ARE_MERGEABLE + else + echo " ERROR: not executed test_traits bezier_traits" >> $ERRORFILE + fi + clean_tests +} + +#---------------------------------------------------------------------# +# spherical arc traits +#---------------------------------------------------------------------# +test_spherical_arc_traits() +{ + local nt=$CGAL_GMPQ_NT; + local kernel=$CARTESIAN_KERNEL; + local geom_traits=$GEODESIC_ARC_ON_SPHERE_GEOM_TRAITS; + local topol_traits=$SPHERICAL_TOPOL_TRAITS + local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits -DTEST_TOPOL_TRAITS=$topol_traits"; + + compile_test_with_flags test_traits geodesic_arcs_on_sphere "$flags" + if [ -n "${SUCCESS}" ] ; then + execute_commands_old_structure spherical_arcs spherical_arc_traits \ + COMPARE_Y_AT_X_LEFT COMPARE_Y_AT_X_RIGHT INTERSECT \ + CONSTRUCTOR \ + COMPARE MAKE_X_MONOTONE SPLIT MERGE ASSERTIONS ARE_MERGEABLE + + execute_commands_new_structure spherical_arcs spherical_arc_traits \ + INTERSECT \ + COMPARE_X_ON_BOUNDARY COMPARE_X_NEAR_BOUNDARY \ + COMPARE_Y_NEAR_BOUNDARY + + run_trapped_test test_traits \ + data/spherical_arcs/compare.pt data/spherical_arcs/compare.xcv \ + data/empty.zero data/spherical_arcs/compare spherical_arc_traits + else + echo " ERROR: not executed test_traits spherical_arc_traits" >> $ERRORFILE + fi + clean_tests +} + +#---------------------------------------------------------------------# +# rational arc traits +#---------------------------------------------------------------------# +test_rational_arc_traits() +{ + if [ -n "${CGAL_DISABLE_GMP}" ]; then + echo "CORE is not available, test_rational_arc_traits not ran" + return + fi + local nt=$CORE_INT_NT; + local kernel=$UNIVARIATE_ALGEBRAIC_KERNEL; + local geom_traits=$RATIONAL_ARC_GEOM_TRAITS; + local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; + + compile_test_with_flags test_traits rational_arcs "$flags" + if [ -n "${SUCCESS}" ] ; then + run_trapped_test test_traits \ + data/compare.pt data/empty.zero \ + data/empty.zero data/compare rational_arc_traits + + execute_commands_new_structure rational_arcs rational_arc_traits \ + VERTEX IS_VERTICAL COMPARE_Y_AT_X COMPARE_Y_AT_X_LEFT SPLIT MERGE \ + COMPARE_X_AT_LIMIT COMPARE_X_NEAR_LIMIT COMPARE_Y_NEAR_BOUNDARY + else + echo " ERROR: not executed test_traits rational_arc_traits" >> $ERRORFILE + fi + clean_tests +} + +#---------------------------------------------------------------------# +# algebraic traits with GMP/MPFI +#---------------------------------------------------------------------# +test_algebraic_traits_gmp() +{ + #TODO: Adapt + + local nt=$CGAL_GMPZ_NT; + local kernel=$UNIVARIATE_ALGEBRAIC_KERNEL; + local geom_traits=$ALGEBRAIC_GEOM_TRAITS; + local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; + + compile_test_with_flags test_traits algebraic "$flags" + if [ -n "${SUCCESS}" ] ; then + execute_commands_new_structure algebraic algebraic_traits_gmp \ + COMPARE COMPARE_Y_AT_X COMPARE_Y_AT_X_RIGHT COMPARE_Y_AT_X_LEFT \ + MAKE_X_MONOTONE IS_VERTICAL VERTEX SPLIT MERGE INTERSECT \ + PARAMETER_SPACE_X PARAMETER_SPACE_Y + else + echo " ERROR: not executed test_traits algebraic_traits_gmp" >> $ERRORFILE + fi + clean_tests +} + +#---------------------------------------------------------------------# +# algebraic traits with LEDA +#---------------------------------------------------------------------# +test_algebraic_traits_leda() +{ + #TODO: Adapt + + local nt=$LEDA_INT_NT; + local kernel=$UNIVARIATE_ALGEBRAIC_KERNEL; + local geom_traits=$ALGEBRAIC_GEOM_TRAITS; + local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; + + compile_test_with_flags test_traits algebraic "$flags" + if [ -n "${SUCCESS}" ] ; then + execute_commands_new_structure algebraic algebraic_traits_leda \ + COMPARE COMPARE_Y_AT_X COMPARE_Y_AT_X_RIGHT COMPARE_Y_AT_X_LEFT \ + MAKE_X_MONOTONE IS_VERTICAL VERTEX SPLIT MERGE INTERSECT \ + PARAMETER_SPACE_X PARAMETER_SPACE_Y + else + echo " ERROR: not executed test_traits algebraic_traits_leda" >> $ERRORFILE + fi + clean_tests +} + + +#---------------------------------------------------------------------# +# algebraic traits with CORE +#---------------------------------------------------------------------# +test_algebraic_traits_core() +{ + #TODO: Adapt + if [ -n "${CGAL_DISABLE_GMP}" ]; then + echo "CORE is not available, test_algebraic_traits_core not ran" + return + fi + local nt=$CORE_INT_NT; + local kernel=$UNIVARIATE_ALGEBRAIC_KERNEL; + local geom_traits=$ALGEBRAIC_GEOM_TRAITS; + local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits"; + + compile_test_with_flags test_traits algebraic "$flags" + if [ -n "${SUCCESS}" ] ; then + execute_commands_new_structure algebraic algebraic_traits_core \ + COMPARE COMPARE_Y_AT_X COMPARE_Y_AT_X_RIGHT COMPARE_Y_AT_X_LEFT \ + MAKE_X_MONOTONE IS_VERTICAL VERTEX SPLIT MERGE INTERSECT \ + PARAMETER_SPACE_X PARAMETER_SPACE_Y + else + echo " ERROR: not executed test_traits algebraic_traits_core" >> $ERRORFILE + fi + clean_tests +} + +#---------------------------------------------------------------------# +# remove the previous error file +#---------------------------------------------------------------------# + +rm -f $ERRORFILE +rm -f $FULL_ERROR_DESCRIPTION_FILE +rm -f ProgramOutput.test_* +touch $ERRORFILE + +#---------------------------------------------------------------------# +# compile and run the tests +#---------------------------------------------------------------------# + + + +if [ $# -ne 0 ] ; then + case $1 in + -cmake) TEST_WITH_CMAKE="TRUE" ;; + *)TEST_WITH_CMAKE="FALSE" ;; + esac +else + TEST_WITH_CMAKE="FALSE" +fi + +echo "Run all tests." + +if [ "${TEST_WITH_CMAKE}" != "FALSE" ]; then + configure +fi + +if [ "${TEST_WITH_CMAKE}" != "FALSE" ]; then + compile_and_run construction_test_suite_generator +fi + +test_segment_traits +test_non_caching_segment_traits +test_polyline_traits +test_polycurve_conic_traits +test_polycurve_circular_arc_traits +test_polycurve_bezier_traits +test_non_caching_polyline_traits +test_linear_traits +test_conic_traits + +test_line_arc_traits # "line arcs" (segments) only +test_circular_arc_traits # circular arcs only +test_circular_line_arc_traits # for both + +test_circle_segments_traits +test_bezier_traits + +test_spherical_arc_traits + +test_rational_arc_traits + +test_algebraic_traits_core +test_algebraic_traits_gmp +test_algebraic_traits_leda + +compile_and_run test_data_traits + +compile_and_run test_insertion +compile_and_run test_unbounded_rational_insertion +compile_and_run test_unbounded_rational_direct_insertion +compile_and_run test_rational_function_traits_2 +compile_and_run test_iso_verts + +compile_and_run test_vert_ray_shoot_vert_segments + +test_construction_segments +test_construction_linear_curves +test_construction_spherical_arcs +test_construction_polylines + +test_overlay_segments +test_overlay_spherical_arcs + +test_point_location_segments +test_point_location_segments_version +test_point_location_segments_conversion +test_point_location_circle_segments +test_point_location_linear + +test_point_location_dynamic_segments + +test_batched_point_location_segments +test_batched_point_location_linear +test_batched_point_location_spherical_arcs + +test_vertical_decomposition_segments +test_vertical_decomposition_linear +# test_vertical_decomposition_spherical_arcs + +compile_and_run test_dual +compile_and_run test_do_intersect +compile_and_run test_zone + +compile_and_run test_observer +compile_and_run test_do_equal + +test_segment_traits_adaptor +test_linear_traits_adaptor +test_spherical_arcs_traits_adaptor + +compile_and_run test_removal +compile_and_run test_unbounded_removal +compile_and_run test_spherical_removal + +compile_and_run test_io + +compile_and_run test_sgm + +# if any error occured then append the full error description file to error file + +if [ -f $FULL_ERROR_DESCRIPTION_FILE ] ; then + echo "******************** appending all error outputs ********************" >> $ERRORFILE + cat $FULL_ERROR_DESCRIPTION_FILE >> $ERRORFILE +fi diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_dual.cpp b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_dual.cpp index e1ec912b860..1915f8a1a23 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_dual.cpp +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_dual.cpp @@ -7,7 +7,7 @@ #include -#include +#include // leda_rational, or Gmpq, or Quotient typedef CGAL::Exact_rational Number_type; diff --git a/BGL/doc/BGL/BGL.txt b/BGL/doc/BGL/BGL.txt index a372c5cdd05..6a319650062 100644 --- a/BGL/doc/BGL/BGL.txt +++ b/BGL/doc/BGL/BGL.txt @@ -15,14 +15,14 @@ faces as edges of the dual graph. The scope of \cgal is geometry and not graph algorithms. Nevertheless, this package provides the necessary classes and functions that enable using the -algorithms of the Boost Graph Library \cgalCite{cgal:sll-bgl-02} +algorithms of the Boost Graph Library \cgalCite{cgal:sll-bgl-02} (\sc{Bgl} for short) with \cgal data structures. Furthermore, this package extends the \sc{Bgl} by introducing concepts such as `HalfedgeGraph` and `FaceGraph` allowing to handle *halfedges* and *faces*. These concepts reflect the design of the halfedge data structure described -in Chapter \ref PkgHDSSummary, with opposite halfedges and circular +in Chapter \ref PkgHalfedgeDS, with opposite halfedges and circular sequences of halfedges around vertices and around faces. This chapter is organized as follows: @@ -31,10 +31,10 @@ This chapter is organized as follows: different libraries. - The four following sections give examples on how to use CGAL graph and mesh data structures such as -\link PkgSurfaceMeshSummary Surface_mesh \endlink, -\link PkgPolyhedronSummary Polyhedron \endlink, -\link PkgArrangement2Summary Arrangement_2 \endlink, and the -\link PkgTriangulation2Summary 2D triangulation \endlink classes as models of the \sc{Bgl} concepts. +\link PkgSurfaceMesh Surface_mesh \endlink, +\link PkgPolyhedron Polyhedron \endlink, +\link PkgArrangementOnSurface2 Arrangement_2 \endlink, and the +\link PkgTriangulation2 2D triangulation \endlink classes as models of the \sc{Bgl} concepts. - Starting with Section \ref BGLExtensions, we introduce new graph concepts, classes, and functions that extend the functionalities of the \sc{Bgl}. @@ -53,7 +53,7 @@ arbitrary order. \subsection BGLGraphConcepts Graph Concepts -The \sc{Bgl} introduces several graph concepts, +The \sc{Bgl} introduces several graph concepts, which have different sets of characteristics and requirements. For example, iterating through all vertices or all edges in a graph, obtaining the outgoing or in-going edges of a vertex, inserting vertices and edges into a graph, @@ -62,7 +62,7 @@ and removing vertices and edges from a graph. \subsection BGLTheGraphTraitsClass The Graph Traits Class An algorithm operating on a graph model determines types with the help of the traits class -boost::graph_traits. +boost::graph_traits. Such types are the `vertex_descriptor`, which is similar to a vertex handle in \cgal data structures, or the `edge_descriptor`, which is similar to the \link HalfedgeDSHalfedge halfedge handle \endlink in @@ -102,7 +102,7 @@ std::pair vertices(const Graph& g); \subsection BGLPropertyMaps Property Maps Another feature extensively used in the \sc{Bgl} is the *property map*, -which is offered by the Boost Property Map Library. Property maps +which is offered by the Boost Property Map Library. Property maps are a general purpose interface for mapping key objects to corresponding value objects. @@ -127,7 +127,7 @@ The data itself may be stored in the vertex or the edge, or it may be stored in an external data structure, or it may be computed on the fly. This is an implementation detail of a particular property map. -See also Chapter \ref PkgProperty_mapSummary. +See also Chapter \ref PkgPropertyMap. \subsection BGLVisitors Visitors @@ -137,14 +137,14 @@ The functions as well as the event points are algorithm-specific. Examples of such event points in graph algorithms are when a vertex is traversed the first time, or when all outgoing edges of a vertex have been traversed.
-See also Section Visitor Concepts +See also Section Visitor Concepts in the \sc{Bgl} manual. \subsection BGLNamedParameters Named Parameters The notion of named parameters was introduced in the \sc{Bgl}, and allow the user to specify only those parameters which are really needed, by name, making the parameter ordering unimportant. -See also this page +See also this page in the manual of the \sc{Bgl} for more information. Say there is a function `f()` that takes 3 parameters called name, age and gender, @@ -218,7 +218,7 @@ the concepts provided by \cgal to implement a simple algorithm. The following example program computes the minimum spanning tree on a surface mesh. More examples can be found in Chapters -\ref PkgSurfaceMeshSimplificationSummary, \ref PkgSurfaceSegmentationSummary, and \ref PkgSurfaceMeshDeformationSummary. +\ref PkgSurfaceMeshSimplification, \ref PkgSurfaceMeshSegmentation, and \ref PkgSurfaceMeshDeformation. The surface mesh class uses integer indices to address vertices and edges, and it comes with a built-in property mechanism that maps nicely on the \sc{Bgl}. @@ -237,7 +237,7 @@ the concepts provided by \cgal to implement a simple algorithm. The following example program computes the minimum spanning tree on a polyhedral surface. More examples can be found in the Chapter -\ref PkgSurfaceMeshSimplificationSummary. +\ref PkgSurfaceMeshSimplification. \cgalExample{BGL_polyhedron_3/kruskal.cpp} @@ -258,7 +258,7 @@ as a graph. An edge is defined as a pair of a face handle and the index of the edge. Particular care has to be taken with the infinite vertex and its incident edges. One can either use a -boost::filtered_graph +boost::filtered_graph in order to make the infinite edges invisible, or one can have a property map that returns an infinite length for these edges. @@ -423,11 +423,11 @@ by the functionalities of the \sc{Bgl}. \subsection BGLExtensionsGraphConcepts Graph concepts -In order to match \ref PkgHDSSummary more closely and to enable writing generic algorithms +In order to match \ref PkgHalfedgeDS more closely and to enable writing generic algorithms which operate on data structures that have faces and halfedges, we define -a set of new concepts to extend the graph concepts of the BGL: +a set of new concepts to extend the graph concepts of the BGL: -- `HalfedgeGraph` refines `Graph` +- `HalfedgeGraph` refines `Graph` with operations to accommodate halfedge data structures: given a halfedge, say `h`, the concept `HalfedgeGraph` requires the provision of the halfedge opposite to `h`, the halfedge that succeeds `h`, @@ -492,7 +492,7 @@ stored in the vertex record.) The following example program shows a simple algorithm for calculating facet normals for a polyhedron using the \sc{Bgl} API. A -boost::vector_property_map +boost::vector_property_map is used to to store the calculated normals instead of changing the Polyhedron items class. \cgalExample{BGL_polyhedron_3/normals.cpp} @@ -564,7 +564,7 @@ Note that border edges in a `Dual` have the `null_face` of the original graph as either source or target. This is unusual and might break other algorithms since edges are always assumed to have non-null vertices as a source and target. It is nevertheless possible to filter border edges -using boost::filtered_graph, +using boost::filtered_graph, as shown in the following example. \cgalExample{BGL_surface_mesh/surface_mesh_dual.cpp} @@ -636,11 +636,11 @@ Vertices of the seam mesh that are linked by a green dashed segment correspond to the same vertex in the underlying mesh. \cgalFigureEnd -Seam meshes are for example used in Chapter \ref PkgSurfaceParameterizationSummary +Seam meshes are for example used in Chapter \ref PkgSurfaceMeshParameterization to parameterize a topological sphere by first virtually cutting it into a topological disk. -\section PMPPartitioning Graph Partitioning +\section BGLPartitioning Graph Partitioning For algorithms that operate locally, partitioning is often an easy way to parallelize the algorithm at little cost. diff --git a/BGL/doc/BGL/CGAL/boost/graph/properties.h b/BGL/doc/BGL/CGAL/boost/graph/properties.h index adb5837b7b3..cbd4d4f960f 100644 --- a/BGL/doc/BGL/CGAL/boost/graph/properties.h +++ b/BGL/doc/BGL/CGAL/boost/graph/properties.h @@ -5,25 +5,25 @@ namespace boost { /// @{ /// The constant `edge_index` is a property tag which identifies the index property of an edge of a \sc{Bgl} -/// Graph. -/// \cgalModels PropertyTag +/// Graph. +/// \cgalModels PropertyTag enum edge_index_t { edge_index}; /// The constant `vertex_index` is a property tag which identifies the index property of a vertex of a \sc{Bgl} -/// Graph. -/// \cgalModels PropertyTag +/// Graph. +/// \cgalModels PropertyTag enum vertex_index_t { vertex_index }; /// The constant `halfedge_index` is a property tag which identifies the index property of a halfedge of a `HalfedgeGraph`. /// /// This is a property tag introduced by \cgal. -/// \cgalModels PropertyTag +/// \cgalModels PropertyTag enum halfedge_index_t { halfedge_index }; /// The constant `face_index` is a property tag which identifies the index property of a face of a `FaceGraph`. /// /// This is a property tag introduced by \cgal. -/// \cgalModels PropertyTag +/// \cgalModels PropertyTag enum face_index_t { face_index }; @@ -31,7 +31,7 @@ enum face_index_t { face_index }; /// a vertex of a `HalfedgeGraph`. /// /// This is a property tag introduced by \cgal. -/// \cgalModels PropertyTag +/// \cgalModels PropertyTag enum vertex_point_t { vertex_point }; diff --git a/BGL/doc/BGL/Concepts/EdgeListGraph.h b/BGL/doc/BGL/Concepts/EdgeListGraph.h index 7d7980aa172..685aed4fff5 100644 --- a/BGL/doc/BGL/Concepts/EdgeListGraph.h +++ b/BGL/doc/BGL/Concepts/EdgeListGraph.h @@ -3,13 +3,13 @@ \cgalConcept Concept from the Boost Graph Library. -See http://www.boost.org/libs/graph/doc/EdgeListGraph.html. +See https://www.boost.org/libs/graph/doc/EdgeListGraph.html. The concept `EdgeListGraph` refines the concept -Graph +Graph and adds the requirement for traversal of all edges in a graph. -\cgalRefines Graph +\cgalRefines Graph \cgalHasModel See \link PkgBGLTraits Boost Graph Traits Specializations \endlink @@ -33,21 +33,21 @@ edges(const EdgeListGraph& g); This is the case for implementations only marking edges deleted in the edge container. */ template -boost::graph_traits::ver_size_type +boost::graph_traits::edges_size_type num_edges(const EdgeListGraph& g); /*! \relates EdgeListGraph -returns the source vertex of `h`. +returns the source vertex of `e`. */ template boost::graph_traits::vertex_descriptor -source(boost::graph_traits::halfedge_descriptor h, const EdgeListGraph& g); +source(boost::graph_traits::edge_descriptor e, const EdgeListGraph& g); /*! \relates EdgeListGraph -returns the target vertex of `h`. +returns the target vertex of `e`. */ template boost::graph_traits::vertex_descriptor -target(boost::graph_traits::halfedge_descriptor h, const EdgeListGraph& g); +target(boost::graph_traits::edge_descriptor e, const EdgeListGraph& g); diff --git a/BGL/doc/BGL/Concepts/VertexListGraph.h b/BGL/doc/BGL/Concepts/VertexListGraph.h index e24f6c55404..0b030083492 100644 --- a/BGL/doc/BGL/Concepts/VertexListGraph.h +++ b/BGL/doc/BGL/Concepts/VertexListGraph.h @@ -3,13 +3,13 @@ \cgalConcept Concept from the Boost Graph Library. -See http://www.boost.org/libs/graph/doc/VertexListGraph.html. +See https://www.boost.org/libs/graph/doc/VertexListGraph.html. The concept `VertexListGraph` refines the concept - Graph + Graph and adds the requirement for traversal of all vertices in a graph. -\cgalRefines Graph +\cgalRefines Graph \cgalHasModel See \link PkgBGLTraits Boost Graph Traits Specializations \endlink @@ -33,6 +33,6 @@ vertices(const VertexListGraph& g); This is the case for implementations only marking vertices deleted in the vertex container. */ template -boost::graph_traits::ver_size_type +boost::graph_traits::vertices_size_type num_vertices(const VertexListGraph& g); diff --git a/BGL/doc/BGL/NamedParameters.txt b/BGL/doc/BGL/NamedParameters.txt index 4bde1971424..f775e26ce48 100644 --- a/BGL/doc/BGL/NamedParameters.txt +++ b/BGL/doc/BGL/NamedParameters.txt @@ -1,6 +1,6 @@ /*! \defgroup bgl_namedparameters BGL Named Parameters -\ingroup PkgBGL +\ingroup PkgBGLRef The algorithms of the \sc{Bgl} often have many parameters with default values that are appropriate for most cases. In general, when no @@ -19,7 +19,7 @@ dijkstra_shortest_paths(g, s, predecessor_map(&p[0]).distance_map(&d[0])); \endcode In the \sc{Bgl} manual, this is called -named parameters. +named parameters. The named parameters in the example use the tags `predecessor_map` and `distance_map` and they are concatenated with the dot operator.
diff --git a/BGL/doc/BGL/PackageDescription.txt b/BGL/doc/BGL/PackageDescription.txt index d40b1ec6ecf..6ba2f1ba2d6 100644 --- a/BGL/doc/BGL/PackageDescription.txt +++ b/BGL/doc/BGL/PackageDescription.txt @@ -1,7 +1,7 @@ -/// \defgroup PkgBGL CGAL and the Boost Graph Library Reference +/// \defgroup PkgBGLRef CGAL and the Boost Graph Library Reference /*! \defgroup PkgBGLConcepts Concepts - \ingroup PkgBGL + \ingroup PkgBGLRef We extend the Boost Graph Library (\sc{Bgl} for short) with a set of new concepts. In order to make this documentation self-contained we here also document @@ -15,7 +15,7 @@ digraph example { node [shape=record, fontname=Helvetica, fontsize=10]; rankdir=BT - "boost Graph" [ URL="http://www.boost.org/libs/graph/doc/Graph.html" ]; + "boost Graph" [ URL="https://www.boost.org/libs/graph/doc/Graph.html" ]; HalfedgeGraph [ URL="\ref HalfedgeGraph"]; HalfedgeListGraph [ URL="\ref HalfedgeListGraph"]; MutableHalfedgeGraph [ URL="\ref MutableHalfedgeGraph"]; @@ -45,7 +45,7 @@ digraph example { \cgalHeading{%VertexListGraph} The concept `VertexListGraph` refines the concept -`Graph` +`Graph` and adds the requirement for traversal of all vertices in a graph.
@@ -86,7 +86,7 @@ and adds the requirement for traversal of all vertices in a graph. \cgalHeading{%EdgeListGraph} The concept `EdgeListGraph` refines the concept -`Graph` +`Graph` and adds the requirement for traversal of all edges in a graph.
@@ -122,12 +122,12 @@ and adds the requirement for traversal of all edges in a graph. An upper bound of the number of edges of the graph - `source(g)` + `source(e, g)` `vertex_descriptor` The source vertex of `e` - `target(g)` + `target(e, g)` `vertex_descriptor` The target vertex of `e` @@ -137,7 +137,7 @@ and adds the requirement for traversal of all edges in a graph. \cgalHeading{%HalfedgeGraph} The concept `HalfedgeGraph` refines the concept -`Graph` +`Graph` and adds the notion of halfedges, where each edge corresponds to two opposite halfedges.
@@ -435,37 +435,37 @@ the requirement for traversal of all faces in a graph. */ -/// The property tags model of the boost concept PropertyTag. -/// These tags are used to retrieve default property maps using the traits class boost::property_map. +/// The property tags model of the boost concept PropertyTag. +/// These tags are used to retrieve default property maps using the traits class boost::property_map. /// \defgroup PkgBGLProperties Properties -/// \ingroup PkgBGL +/// \ingroup PkgBGLRef /// \defgroup PkgBGLPropertiesDynamic Dynamic Properties -/// \ingroup PkgBGL +/// \ingroup PkgBGLRef /// \defgroup PkgBGLHelper Helper Classes -/// \ingroup PkgBGL +/// \ingroup PkgBGLRef /// \defgroup PkgBGLHelperFct Helper Functions -/// \ingroup PkgBGL +/// \ingroup PkgBGLRef /// \defgroup PkgBGLIterators Iterators and Circulators -/// \ingroup PkgBGL +/// \ingroup PkgBGLRef /// \defgroup PkgBGLSelectionFct Selection Functions -/// \ingroup PkgBGL +/// \ingroup PkgBGLRef /// \defgroup PkgBGLAdaptors Graph Adaptors -/// \ingroup PkgBGL +/// \ingroup PkgBGLRef /// \defgroup PkgBGLEulerOperations Euler Operations -/// \ingroup PkgBGL +/// \ingroup PkgBGLRef /// \defgroup PkgBGLPartition Partitioning Operations -/// \ingroup PkgBGL +/// \ingroup PkgBGLRef /// \defgroup PkgBGLIOFct I/O Functions -/// \ingroup PkgBGL +/// \ingroup PkgBGLRef /*! \addtogroup PkgBGLPropertiesDynamic @@ -541,13 +541,13 @@ Methods to read and write graphs. /*! -\addtogroup PkgBGL -\cgalPkgDescriptionBegin{CGAL and the Boost Graph Library,PkgBGLSummary} +\addtogroup PkgBGLRef +\cgalPkgDescriptionBegin{CGAL and the Boost Graph Library,PkgBGL} \cgalPkgPicture{emst-detail.png} \cgalPkgSummaryBegin \cgalPkgAuthors{Andreas Fabri, Fernando Cacciola, Philipp Moeller, and Ron Wein} \cgalPkgDesc{This package provides a framework for interfacing \cgal data structures with the algorithms of the Boost Graph Library, or \sc{BGL} for short. It allows to run graph algorithms directly on \cgal data structures which are model of the \sc{BGL} graph concepts, for example the shortest path algorithm on a Delaunay triangulation in order to compute the Euclidean minimum spanning tree. Furthermore, it introduces several new graph concepts describing halfedge data structures.} -\cgalPkgManuals{Chapter_CGAL_and_the_Boost_Graph_Library,PkgBGL} +\cgalPkgManuals{Chapter_CGAL_and_the_Boost_Graph_Library,PkgBGLRef} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{3.3} diff --git a/BGL/doc/BGL/graph_traits.txt b/BGL/doc/BGL/graph_traits.txt index ce760aebcde..bbc9deabdd9 100644 --- a/BGL/doc/BGL/graph_traits.txt +++ b/BGL/doc/BGL/graph_traits.txt @@ -1,7 +1,7 @@ /*! \defgroup PkgBGLTraits Specializations of boost::graph_traits -\ingroup PkgBGL +\ingroup PkgBGLRef The \sc{Bgl} defines the class template `boost::graph_traits` diff --git a/BGL/examples/BGL_LCC/CMakeLists.txt b/BGL/examples/BGL_LCC/CMakeLists.txt index b503f39b9a0..1139bccedb8 100644 --- a/BGL/examples/BGL_LCC/CMakeLists.txt +++ b/BGL/examples/BGL_LCC/CMakeLists.txt @@ -4,7 +4,7 @@ project( BGL_LCC_Examples ) -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.1) # CGAL and its components find_package( CGAL QUIET COMPONENTS ) @@ -16,10 +16,6 @@ if ( NOT CGAL_FOUND ) endif() -# include helper file -include( ${CGAL_USE_FILE} ) - - # Boost and its components find_package( Boost REQUIRED ) @@ -32,14 +28,10 @@ if ( NOT Boost_FOUND ) endif() # include for local directory -include_directories( BEFORE ../../include ) - # Creating entries for all C++ files with "main" routine # ########################################################## -include( CGAL_CreateSingleSourceCGALProgram ) - # create a target per cppfile file(GLOB_RECURSE cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cpp) foreach(cppfile ${cppfiles}) diff --git a/BGL/examples/BGL_LCC/distance_lcc.cpp b/BGL/examples/BGL_LCC/distance_lcc.cpp index 452ffe9eb0c..2dec36620db 100644 --- a/BGL/examples/BGL_LCC/distance_lcc.cpp +++ b/BGL/examples/BGL_LCC/distance_lcc.cpp @@ -15,11 +15,11 @@ typedef CGAL::Linear_cell_complex_for_bgl_combinatorial_map_helper typedef boost::graph_traits::vertex_descriptor vertex_descriptor; typedef boost::graph_traits::vertex_iterator vertex_iterator; -int main(int, char** argv) +int main(int argc, char** argv) { LCC lcc; - CGAL::read_off(argv[1], lcc); - + CGAL::read_off((argc>1)?argv[1]:"cube.off", lcc); + // This is the vector where the distance gets written to std::vector distance(lcc.vertex_attributes().size()); diff --git a/BGL/examples/BGL_LCC/incident_vertices_lcc.cpp b/BGL/examples/BGL_LCC/incident_vertices_lcc.cpp index 5466b303bd0..2dcc9bb3699 100644 --- a/BGL/examples/BGL_LCC/incident_vertices_lcc.cpp +++ b/BGL/examples/BGL_LCC/incident_vertices_lcc.cpp @@ -46,10 +46,10 @@ OutputIterator adjacent_vertices_V2(const LCC& g, } -int main(int, char** argv) +int main(int argc, char** argv) { LCC lcc; - CGAL::read_off(argv[1], lcc); + CGAL::read_off((argc>1)?argv[1]:"cube.off", lcc); GraphTraits::vertex_iterator vi = vertices(lcc).first; std::list V; diff --git a/BGL/examples/BGL_LCC/normals_lcc.cpp b/BGL/examples/BGL_LCC/normals_lcc.cpp index 0563adb891e..3f2f4b29687 100644 --- a/BGL/examples/BGL_LCC/normals_lcc.cpp +++ b/BGL/examples/BGL_LCC/normals_lcc.cpp @@ -63,13 +63,13 @@ void calculate_face_normals(const HalfedgeGraph& g, } } -int main(int, char** argv) +int main(int argc, char** argv) { typedef boost::property_map::const_type Face_index_map; LCC lcc; - CGAL::read_off(argv[1], lcc); + CGAL::read_off((argc>1)?argv[1]:"cube.off", lcc); // Ad hoc property_map to store normals. Face_index_map is used to // map face_descriptors to a contiguous range of indices. See diff --git a/BGL/examples/BGL_LCC/range_lcc.cpp b/BGL/examples/BGL_LCC/range_lcc.cpp index 91e9a739877..f52254be8b6 100644 --- a/BGL/examples/BGL_LCC/range_lcc.cpp +++ b/BGL/examples/BGL_LCC/range_lcc.cpp @@ -55,10 +55,10 @@ void fct(const LCC& lcc) std::for_each(vb,ve, Fct()); } -int main(int, char** argv) +int main(int argc, char** argv) { LCC lcc; - CGAL::read_off(argv[1], lcc); + CGAL::read_off((argc>1)?argv[1]:"cube.off", lcc); fct(lcc); return 0; diff --git a/BGL/examples/BGL_LCC/transform_iterator_lcc.cpp b/BGL/examples/BGL_LCC/transform_iterator_lcc.cpp index 40f1f884fee..c865ce209b5 100644 --- a/BGL/examples/BGL_LCC/transform_iterator_lcc.cpp +++ b/BGL/examples/BGL_LCC/transform_iterator_lcc.cpp @@ -38,10 +38,10 @@ struct Source { } }; -int main(int, char** argv) +int main(int argc, char** argv) { LCC lcc; - CGAL::read_off(argv[1], lcc); + CGAL::read_off((argc>1)?argv[1]:"cube.off", lcc); GraphTraits::vertex_descriptor vd = *(vertices(lcc).first); typedef boost::transform_iterator,halfedge_around_target_iterator> adjacent_vertex_iterator; diff --git a/BGL/examples/BGL_OpenMesh/CMakeLists.txt b/BGL/examples/BGL_OpenMesh/CMakeLists.txt index 97f02a51da8..118d52a20df 100644 --- a/BGL/examples/BGL_OpenMesh/CMakeLists.txt +++ b/BGL/examples/BGL_OpenMesh/CMakeLists.txt @@ -4,7 +4,7 @@ project( BGL_OpenMesh_Examples ) -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.1) # CGAL and its components find_package( CGAL QUIET COMPONENTS ) @@ -16,10 +16,6 @@ if ( NOT CGAL_FOUND ) endif() -# include helper file -include( ${CGAL_USE_FILE} ) - - # Boost and its components find_package( Boost REQUIRED ) @@ -45,14 +41,10 @@ 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 ) - if(OpenMesh_FOUND) create_single_source_cgal_program( "TriMesh.cpp" ) target_link_libraries( TriMesh PRIVATE ${OPENMESH_LIBRARIES} ) diff --git a/BGL/examples/BGL_arrangement_2/CMakeLists.txt b/BGL/examples/BGL_arrangement_2/CMakeLists.txt index cd6170d2509..55c9036e43a 100644 --- a/BGL/examples/BGL_arrangement_2/CMakeLists.txt +++ b/BGL/examples/BGL_arrangement_2/CMakeLists.txt @@ -1,17 +1,11 @@ project( BGL_arrangement_2_Examples ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/BGL/examples/BGL_arrangement_2/arrangement_dual.cpp b/BGL/examples/BGL_arrangement_2/arrangement_dual.cpp index 7166c92d054..3ca5598ea27 100644 --- a/BGL/examples/BGL_arrangement_2/arrangement_dual.cpp +++ b/BGL/examples/BGL_arrangement_2/arrangement_dual.cpp @@ -6,7 +6,7 @@ #include #include #include -#include +#include #include #include diff --git a/BGL/examples/BGL_polyhedron_3/CMakeLists.txt b/BGL/examples/BGL_polyhedron_3/CMakeLists.txt index 098f6e17f07..9b1542ef967 100644 --- a/BGL/examples/BGL_polyhedron_3/CMakeLists.txt +++ b/BGL/examples/BGL_polyhedron_3/CMakeLists.txt @@ -4,7 +4,7 @@ project( BGL_polyhedron_3_Examples ) -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.1) # CGAL and its components find_package( CGAL QUIET COMPONENTS ) @@ -16,10 +16,6 @@ if ( NOT CGAL_FOUND ) endif() -# include helper file -include( ${CGAL_USE_FILE} ) - - # Boost and its components find_package( Boost REQUIRED ) @@ -51,14 +47,10 @@ 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( "distance.cpp" ) create_single_source_cgal_program( "incident_vertices.cpp" ) diff --git a/BGL/examples/BGL_polyhedron_3/distance.cpp b/BGL/examples/BGL_polyhedron_3/distance.cpp index 51da1ac49d7..3cfc8e1aa0c 100644 --- a/BGL/examples/BGL_polyhedron_3/distance.cpp +++ b/BGL/examples/BGL_polyhedron_3/distance.cpp @@ -15,10 +15,10 @@ typedef boost::graph_traits::vertex_iterator vertex_iterator; -int main(int, char** argv) { +int main(int argc, char** argv) { Polyhedron P; - std::ifstream in(argv[1]); + std::ifstream in((argc>1)?argv[1]:"cube.off"); in >> P ; // associate indices to the vertices using the "id()" field of the vertex. diff --git a/BGL/examples/BGL_polyhedron_3/incident_vertices.cpp b/BGL/examples/BGL_polyhedron_3/incident_vertices.cpp index 6f7b8d24e00..4e79d97ca4f 100644 --- a/BGL/examples/BGL_polyhedron_3/incident_vertices.cpp +++ b/BGL/examples/BGL_polyhedron_3/incident_vertices.cpp @@ -44,9 +44,9 @@ adjacent_vertices_V2(const Polyhedron& g, } -int main(int, char** argv) +int main(int argc, char** argv) { - std::ifstream in(argv[1]); + std::ifstream in((argc>1)?argv[1]:"cube.off"); Polyhedron P; in >> P; GraphTraits::vertex_iterator vi = vertices(P).first; diff --git a/BGL/examples/BGL_polyhedron_3/normals.cpp b/BGL/examples/BGL_polyhedron_3/normals.cpp index eed947b01fd..efa95a34f72 100644 --- a/BGL/examples/BGL_polyhedron_3/normals.cpp +++ b/BGL/examples/BGL_polyhedron_3/normals.cpp @@ -63,14 +63,14 @@ void calculate_face_normals(const HalfedgeGraph& g, } } -int main(int, char** argv) +int main(int argc, char** argv) { typedef boost::property_map< Polyhedron, CGAL::face_index_t >::const_type Face_index_map; - std::ifstream in(argv[1]); + std::ifstream in((argc>1)?argv[1]:"cube.off"); Polyhedron P; in >> P ; diff --git a/BGL/examples/BGL_polyhedron_3/range.cpp b/BGL/examples/BGL_polyhedron_3/range.cpp index 35bac222042..4e4c11aa2a1 100644 --- a/BGL/examples/BGL_polyhedron_3/range.cpp +++ b/BGL/examples/BGL_polyhedron_3/range.cpp @@ -55,10 +55,10 @@ void fct(const Polyhedron& p) std::for_each(vb,ve, Fct()); } -int main(int, char** argv) +int main(int argc, char** argv) { Polyhedron P; - std::ifstream in(argv[1]); + std::ifstream in((argc>1)?argv[1]:"cube.off"); in >> P ; fct(P); diff --git a/BGL/examples/BGL_polyhedron_3/transform_iterator.cpp b/BGL/examples/BGL_polyhedron_3/transform_iterator.cpp index c03df6f0b7f..776805c7a09 100644 --- a/BGL/examples/BGL_polyhedron_3/transform_iterator.cpp +++ b/BGL/examples/BGL_polyhedron_3/transform_iterator.cpp @@ -37,9 +37,9 @@ struct Source { } }; -int main(int, char** argv) +int main(int argc, char** argv) { - std::ifstream in(argv[1]); + std::ifstream in((argc>1)?argv[1]:"cube.off"); Polyhedron P; in >> P; GraphTraits::vertex_descriptor vd = *(vertices(P).first); diff --git a/BGL/examples/BGL_surface_mesh/CMakeLists.txt b/BGL/examples/BGL_surface_mesh/CMakeLists.txt index 50736f8df6d..c885f703675 100644 --- a/BGL/examples/BGL_surface_mesh/CMakeLists.txt +++ b/BGL/examples/BGL_surface_mesh/CMakeLists.txt @@ -1,6 +1,6 @@ project( BGL_surface_mesh_Examples ) -cmake_minimum_required( VERSION 2.8.10 ) +cmake_minimum_required(VERSION 3.1) find_package( CGAL QUIET ) @@ -9,12 +9,7 @@ if ( NOT CGAL_FOUND ) return() endif() -include( ${CGAL_USE_FILE} ) - # include for local package -include_directories( BEFORE "../../include" ) - -include( CGAL_CreateSingleSourceCGALProgram ) create_single_source_cgal_program( "prim.cpp" ) create_single_source_cgal_program( "gwdwg.cpp" ) diff --git a/BGL/examples/BGL_surface_mesh/prim.cpp b/BGL/examples/BGL_surface_mesh/prim.cpp index 9a3e2d200ef..08ad8806170 100644 --- a/BGL/examples/BGL_surface_mesh/prim.cpp +++ b/BGL/examples/BGL_surface_mesh/prim.cpp @@ -13,11 +13,11 @@ typedef CGAL::Surface_mesh Mesh; typedef boost::graph_traits::vertex_descriptor vertex_descriptor; -int main(int, char* argv[]) +int main(int argc, char* argv[]) { Mesh P; //std::cin >> P; - std::ifstream in(argv[1]); + std::ifstream in((argc>1)?argv[1]:"data/prim.off"); in >> P; Mesh::Property_map predecessor; predecessor = P.add_property_map("v:predecessor").first; diff --git a/BGL/examples/BGL_triangulation_2/CMakeLists.txt b/BGL/examples/BGL_triangulation_2/CMakeLists.txt index c8d6a0b3145..b3e337d3040 100644 --- a/BGL/examples/BGL_triangulation_2/CMakeLists.txt +++ b/BGL/examples/BGL_triangulation_2/CMakeLists.txt @@ -1,24 +1,17 @@ project( BGL_triangulation_2_Examples ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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 library, and will not be compiled.") diff --git a/BGL/include/CGAL/boost/graph/Euler_operations.h b/BGL/include/CGAL/boost/graph/Euler_operations.h index 109de182736..874141e8776 100644 --- a/BGL/include/CGAL/boost/graph/Euler_operations.h +++ b/BGL/include/CGAL/boost/graph/Euler_operations.h @@ -1421,10 +1421,15 @@ bool //CGAL_ECMS_TRACE(3," p-q belongs to a tetrahedron. NON-COLLAPSABLE edge." ) ; return false ; } + if ( next(v0_v1, g) == opposite(prev(v1_v0, g), g) && + prev(v0_v1, g) == opposite(next(v1_v0, g), g) ) + { + //CGAL_ECMS_TRACE(3," degenerate volume." ) ; + return false ; + } } } - return true ; } diff --git a/BGL/include/CGAL/boost/graph/Face_filtered_graph.h b/BGL/include/CGAL/boost/graph/Face_filtered_graph.h index ffaedbf181e..472583030bd 100644 --- a/BGL/include/CGAL/boost/graph/Face_filtered_graph.h +++ b/BGL/include/CGAL/boost/graph/Face_filtered_graph.h @@ -50,7 +50,7 @@ namespace CGAL * * The class `Face_filtered_graph` is an adaptor that creates a filtered view of a graph * by restricting it to a subset of faces. Contrary to - * boost::filtered_graph, + * boost::filtered_graph, * this class only requires a way to access the selected faces and will automatically select the * edges/halfedges and vertices present in the adapted graph. A vertex is selected if it is incident to at least one * selected face. A edge is selected if it is incident to at least a selected face. A halfedge is selected if its edge diff --git a/BGL/include/CGAL/boost/graph/Seam_mesh.h b/BGL/include/CGAL/boost/graph/Seam_mesh.h index 8df36e3ff4c..429e38c98ee 100644 --- a/BGL/include/CGAL/boost/graph/Seam_mesh.h +++ b/BGL/include/CGAL/boost/graph/Seam_mesh.h @@ -1017,7 +1017,7 @@ public: /// of a vertex of the underlying mesh is given by its position /// in the container `tm_vds`. /// - /// \tparam VdContainer must be a model of SequenceContainer (that is, provide + /// \tparam VdContainer must be a model of `SequenceContainer` (that is, provide /// the functions: `operator[]` and `at()`). /// /// \returns one of the halfedges of the seam mesh that is on a seam. @@ -1062,7 +1062,7 @@ public: /// /// \returns one of the halfedges of the seam mesh that is on a seam. /// - /// \tparam VdContainer must be a model of SequenceContainer (that is, provide + /// \tparam VdContainer must be a model of `SequenceContainer` (that is, provide /// the functions: `operator[]` and `at()`). /// /// \pre filename should be the name of a CGAL selection file: edges are diff --git a/BGL/include/CGAL/boost/graph/helpers.h b/BGL/include/CGAL/boost/graph/helpers.h index e1023d591df..c62b5c9ebba 100644 --- a/BGL/include/CGAL/boost/graph/helpers.h +++ b/BGL/include/CGAL/boost/graph/helpers.h @@ -794,6 +794,16 @@ make_quad(typename boost::graph_traits::vertex_descriptor v0, return opposite(h3,g); } +//default Functor for make_grid +template +struct Default_grid_maker + : public CGAL::Creator_uniform_3 +{ + Point operator()(const Size_type& i, const Size_type& j)const + { + return CGAL::Creator_uniform_3::operator ()(i,j,0); + } +}; } // namespace internal /** @@ -973,33 +983,6 @@ make_tetrahedron(const P& p0, const P& p1, const P& p2, const P& p3, Graph& g) return opposite(h2,g); } -/// \cond SKIP_IN_DOC -template -bool is_degenerate_triangle_face( - typename boost::graph_traits::halfedge_descriptor hd, - TriangleMesh& tmesh, - const VertexPointMap& vpmap, - const Traits& traits) -{ - CGAL_assertion(!is_border(hd, tmesh)); - - const typename Traits::Point_3& p1 = get(vpmap, target( hd, tmesh) ); - const typename Traits::Point_3& p2 = get(vpmap, target(next(hd, tmesh), tmesh) ); - const typename Traits::Point_3& p3 = get(vpmap, source( hd, tmesh) ); - return traits.collinear_3_object()(p1, p2, p3); -} - -template -bool is_degenerate_triangle_face( - typename boost::graph_traits::face_descriptor fd, - TriangleMesh& tmesh, - const VertexPointMap& vpmap, - const Traits& traits) -{ - return is_degenerate_triangle_face(halfedge(fd,tmesh), tmesh, vpmap, traits); -} -/// \endcond - /** * \ingroup PkgBGLHelperFct * \brief Creates a triangulated regular prism, outward oriented, @@ -1276,6 +1259,7 @@ make_icosahedron( * * \brief Creates a row major ordered grid with `i` cells along the width and `j` cells * along the height and adds it to the graph `g`. + * An internal property map for `CGAL::vertex_point_t` must be available in `Graph`. * * \param i the number of cells along the width. * \param j the number of cells along the height. @@ -1284,19 +1268,14 @@ make_icosahedron( * \param triangulated decides if a cell is composed of one quad or two triangles. * If `triangulated` is `true`, the diagonal of each cell is oriented from (0,0) to (1,1) * in the cell coordinates. - * - * \tparam CoordinateFunctor that takes two `boost::graph_traits::%vertices_size_type` + *\tparam CoordinateFunctor a function object providing `Point_3 operator()(size_type I, size_type J)` with `Point_3` being + * the value_type of the internal property_map for `CGAL::vertex_point_t`. * and outputs a `boost::property_traits::%type>::%value_type`. + * It will be called with arguments (`w`, `h`), with `w` in [0..`i`] and `h` in [0..`j`]. *

%Default: a point with positive integer coordinates (`w`, `h`, 0), with `w` in [0..`i`] and `h` in [0..`j`] * \returns the non-border non-diagonal halfedge that has the target vertex associated with the first point of the grid (default is (0,0,0) ). */ -#ifndef DOXYGEN_RUNNING template -#else -template::vertices_size_type, - typename boost::property_traits::type>::value_type> > -#endif typename boost::graph_traits::halfedge_descriptor make_grid(typename boost::graph_traits::vertices_size_type i, typename boost::graph_traits::vertices_size_type j, @@ -1308,7 +1287,6 @@ make_grid(typename boost::graph_traits::vertices_size_type i, typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; typename boost::graph_traits::vertices_size_type w(i+1), h(j+1); Point_property_map vpmap = get(CGAL::vertex_point, g); - // create the initial icosahedron //create the vertices std::vector v_vertices; v_vertices.resize(static_cast(w*h)); @@ -1319,7 +1297,7 @@ make_grid(typename boost::graph_traits::vertices_size_type i, { for(typename boost::graph_traits::vertices_size_type b=0; b::vertices_size_type i, return halfedge(v_vertices[1], v_vertices[0], g).first; } -//default Functor + template typename boost::graph_traits::halfedge_descriptor make_grid(typename boost::graph_traits::vertices_size_type w, @@ -1367,7 +1345,7 @@ make_grid(typename boost::graph_traits::vertices_size_type w, { typedef typename boost::graph_traits::vertices_size_type Size_type; typedef typename boost::property_traits::type>::value_type Point; - return make_grid(w, h, g, CGAL::Creator_uniform_3(), triangulated); + return make_grid(w, h, g, internal::Default_grid_maker(), triangulated); } namespace internal { diff --git a/BGL/include/CGAL/boost/graph/iterator.h b/BGL/include/CGAL/boost/graph/iterator.h index fbbc6e81c9d..83b3c001d71 100644 --- a/BGL/include/CGAL/boost/graph/iterator.h +++ b/BGL/include/CGAL/boost/graph/iterator.h @@ -1281,7 +1281,7 @@ template Iterator_range > adjacent_vertices(typename boost::graph_traits::halfedge_descriptor h, const Graph& g) { - typedef Vertex_around_face_iterator I; + typedef Vertex_around_target_iterator I; return make_range(I(h,g), I(h,g,1)); } @@ -1290,7 +1290,7 @@ template Iterator_range > adjacent_vertices(typename boost::graph_traits::vertex_descriptor v, const Graph& g) { - typedef Vertex_around_face_iterator I; + typedef Vertex_around_target_iterator I; return make_range(I(halfedge(v,g),g), I(halfedge(v,g),g,1)); } diff --git a/BGL/include/CGAL/boost/graph/parameters_interface.h b/BGL/include/CGAL/boost/graph/parameters_interface.h index 0c0727c6e59..8b074e82e12 100644 --- a/BGL/include/CGAL/boost/graph/parameters_interface.h +++ b/BGL/include/CGAL/boost/graph/parameters_interface.h @@ -78,6 +78,9 @@ CGAL_add_named_parameter(projection_functor_t, projection_functor, projection_fu CGAL_add_named_parameter(throw_on_self_intersection_t, throw_on_self_intersection, throw_on_self_intersection) CGAL_add_named_parameter(clip_volume_t, clip_volume, clip_volume) CGAL_add_named_parameter(use_compact_clipper_t, use_compact_clipper, use_compact_clipper) +CGAL_add_named_parameter(output_iterator_t, output_iterator, output_iterator) +CGAL_add_named_parameter(erase_all_duplicates_t, erase_all_duplicates, erase_all_duplicates) +CGAL_add_named_parameter(require_same_orientation_t, require_same_orientation, require_same_orientation) // List of named parameters that we use in the package 'Surface Mesh Simplification' CGAL_add_named_parameter(get_cost_policy_t, get_cost_policy, get_cost) @@ -91,6 +94,7 @@ CGAL_add_named_parameter(tolerance_map_t, tolerance_map, tolerance_map) //internal CGAL_add_named_parameter(weight_calculator_t, weight_calculator, weight_calculator) +CGAL_add_named_parameter(use_bool_op_to_clip_surface_t, use_bool_op_to_clip_surface, use_bool_op_to_clip_surface) // List of named parameters used in the Point Set Processing package CGAL_add_named_parameter(point_t, point_map, point_map) diff --git a/BGL/include/CGAL/boost/graph/partition.h b/BGL/include/CGAL/boost/graph/partition.h index 129e2421e13..a6bf761fccb 100644 --- a/BGL/include/CGAL/boost/graph/partition.h +++ b/BGL/include/CGAL/boost/graph/partition.h @@ -22,7 +22,7 @@ #define CGAL_BGL_PARTITION_H /** -* \ingroup PkgBGL +* \ingroup PkgBGLRef * \file CGAL/boost/graph/partition.h * Convenience header file including the headers for all the partitioning-related * free functions of this package. diff --git a/BGL/include/CGAL/boost/graph/properties.h b/BGL/include/CGAL/boost/graph/properties.h index c720256b591..9a86de3f6b8 100644 --- a/BGL/include/CGAL/boost/graph/properties.h +++ b/BGL/include/CGAL/boost/graph/properties.h @@ -26,6 +26,8 @@ #include #include #include +#include +#include #include #include @@ -267,7 +269,9 @@ struct Edge_index_accessor reference operator[](Handle h) const { return h.id(); } }; -template +template::type >::value> struct Point_accessor : boost::put_get_helper< Reference, Point_accessor > { @@ -279,6 +283,26 @@ struct Point_accessor reference operator[](Handle h) const { return h->point(); } }; +// partial specialization for const map to make them constructible from non-const map +template +struct Point_accessor + : boost::put_get_helper< ConstReference, Point_accessor > +{ + typedef boost::lvalue_property_map_tag category; + typedef ConstReference reference; + typedef ValueType value_type; + typedef Handle key_type; + + typedef typename boost::mpl::if_< boost::is_reference, + ValueType&, + ValueType >::type Reference; + + Point_accessor() {} + Point_accessor(Point_accessor) {} + + reference operator[](Handle h) const { return h->point(); } +}; + } // namespace internal // Needed by PMP::detec_features and Mesh_3 diff --git a/BGL/include/CGAL/boost/graph/property_maps.h b/BGL/include/CGAL/boost/graph/property_maps.h index 28f11307193..fb6c8b486da 100644 --- a/BGL/include/CGAL/boost/graph/property_maps.h +++ b/BGL/include/CGAL/boost/graph/property_maps.h @@ -73,6 +73,19 @@ struct Triangle_from_face_descriptor_map{ get(pmap.m_vpm, target(next(halfedge(f,tm),tm),tm)), get(pmap.m_vpm, source(halfedge(f,tm),tm)) ); } + + inline friend + reference + get(const Triangle_from_face_descriptor_map& pmap, + const std::pair& f) + { + typename boost::remove_const::type & tm = *(pmap.m_tm); + CGAL_precondition(halfedge(f.first,tm) == next(next(next(halfedge(f.first,tm),tm),tm),tm)); + + return value_type( get(pmap.m_vpm, target(halfedge(f.first,tm),tm)), + get(pmap.m_vpm, target(next(halfedge(f.first,tm),tm),tm)), + get(pmap.m_vpm, source(halfedge(f.first,tm),tm)) ); + } }; template < class PolygonMesh, @@ -114,6 +127,15 @@ struct Segment_from_edge_descriptor_map{ return value_type(get(pmap.m_vpm, source(h, *pmap.m_pm) ), get(pmap.m_vpm, target(h, *pmap.m_pm) ) ); } + + inline friend + reference + get(const Segment_from_edge_descriptor_map& pmap, + const std::pair& h) + { + return value_type(get(pmap.m_vpm, source(h.first, *pmap.m_pm) ), + get(pmap.m_vpm, target(h.first, *pmap.m_pm) ) ); + } }; //property map to access a point from a face_descriptor @@ -151,6 +173,14 @@ struct One_point_from_face_descriptor_map{ { return get(m.m_vpm, target(halfedge(f, *m.m_pm), *m.m_pm)); } + + inline friend + reference + get(const One_point_from_face_descriptor_map& m, + const std::pair& f) + { + return get(m.m_vpm, target(halfedge(f.first, *m.m_pm), *m.m_pm)); + } }; //property map to access a point from an edge @@ -187,6 +217,14 @@ struct Source_point_from_edge_descriptor_map{ { return get(pmap.m_vpm, source(h, *pmap.m_pm) ); } + + inline friend + reference + get(const Source_point_from_edge_descriptor_map& pmap, + const std::pair& h) + { + return get(pmap.m_vpm, source(h.first, *pmap.m_pm) ); + } }; } //namespace CGAL diff --git a/BGL/include/CGAL/boost/graph/selection.h b/BGL/include/CGAL/boost/graph/selection.h index 224d5f6b7e6..d44c297a696 100644 --- a/BGL/include/CGAL/boost/graph/selection.h +++ b/BGL/include/CGAL/boost/graph/selection.h @@ -570,14 +570,16 @@ void expand_face_selection_for_removal(const FaceRange& faces_to_be_deleted, vertex_descriptor vd = *vertices_queue.begin(); vertices_queue.erase( vertices_queue.begin() ); - // set hd to the last selected face of a connected component - // of selected faces around a vertex + // make sure hd is not a border halfedge halfedge_descriptor hd = halfedge(vd, tm); while(is_border(hd,tm) || ( !get(is_selected, face(hd, tm))) ) { hd = opposite( next(hd, tm), tm); CGAL_assertion( hd != halfedge(vd, tm) ); } + + // set hd to the last selected face of a connected component + // of selected faces around a vertex halfedge_descriptor start = hd; halfedge_descriptor next_around_vertex = opposite( next(hd, tm), tm); while(is_border(next_around_vertex,tm) || get(is_selected, face(next_around_vertex, tm) ) ) @@ -596,6 +598,9 @@ void expand_face_selection_for_removal(const FaceRange& faces_to_be_deleted, { faces_traversed.push_back(next_around_vertex); next_around_vertex = opposite( next(next_around_vertex, tm), tm); + if (is_border(next_around_vertex,tm)) + next_around_vertex = opposite( next(next_around_vertex, tm), tm); + CGAL_assertion(!is_border(next_around_vertex,tm)); } while( !get(is_selected, face(next_around_vertex, tm) ) ); @@ -640,7 +645,7 @@ bool is_selection_a_topological_disk(const FaceRange& face_selection, sel_edges.insert(edge(h,pm)); } } - return (sel_vertices.size() - sel_edges.size() + face_selection.size() == 1); + return (sel_vertices.size() - sel_edges.size() + face_selection.size() == 1); } } //end of namespace CGAL diff --git a/BGL/include/CGAL/boost/graph/split_graph_into_polylines.h b/BGL/include/CGAL/boost/graph/split_graph_into_polylines.h index 09fe353349b..2fc9ed6b461 100644 --- a/BGL/include/CGAL/boost/graph/split_graph_into_polylines.h +++ b/BGL/include/CGAL/boost/graph/split_graph_into_polylines.h @@ -203,7 +203,7 @@ void duplicate_terminal_vertices(Graph& graph, /*! -\ingroup PkgBGL +\ingroup PkgBGLRef splits into polylines the graph `g` at vertices of degree greater than 2 and at vertices for which `is_terminal(v,graph)==true`. The polylines are reported using a visitor. diff --git a/BGL/test/BGL/CMakeLists.txt b/BGL/test/BGL/CMakeLists.txt index 74efdb21fc3..8b6ef06e78d 100644 --- a/BGL/test/BGL/CMakeLists.txt +++ b/BGL/test/BGL/CMakeLists.txt @@ -4,7 +4,7 @@ project( BGL_Tests ) -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.1) @@ -18,10 +18,6 @@ if ( NOT CGAL_FOUND ) endif() -# include helper file -include( ${CGAL_USE_FILE} ) - - # Boost and its components find_package( Boost ) @@ -42,13 +38,10 @@ endif() # include for local package -include_directories( BEFORE ../../include ) # Creating entries for all .cpp/.C files with "main" routine # ########################################################## -include( CGAL_CreateSingleSourceCGALProgram ) - if(OpenMesh_FOUND) create_single_source_cgal_program( "graph_concept_OpenMesh.cpp" ) target_link_libraries( graph_concept_OpenMesh PRIVATE ${OPENMESH_LIBRARIES} ) diff --git a/BGL/test/BGL/test_Manifold_face_removal.cpp b/BGL/test/BGL/test_Manifold_face_removal.cpp index f84b63175d5..851399d67cc 100644 --- a/BGL/test/BGL/test_Manifold_face_removal.cpp +++ b/BGL/test/BGL/test_Manifold_face_removal.cpp @@ -23,8 +23,8 @@ int main() // define my selection of faces to remove boost::unordered_map is_selected_map; - const int selection_indices[] = {501, 652, 646, 322, 328, 212, 347, 345, 352, 353, 696, 697, 698, 706, 714, 2892}; - std::set index_set(&selection_indices[0], &selection_indices[0]+16); + const int selection_indices[30] = {652,18,328,698,322,212,808,353,706,869,646,352,788,696,714,796,937,2892,374,697,227,501,786,794,345,16,21,581,347,723}; + std::set index_set(&selection_indices[0], &selection_indices[0]+30); std::vector faces_to_remove; int index = 0; @@ -40,6 +40,8 @@ int main() ++index; } + std::size_t nb_input_faces = sm.number_of_faces(); + expand_face_selection_for_removal(faces_to_remove, sm, boost::make_assoc_property_map(is_selected_map)); @@ -54,8 +56,10 @@ int main() } } - assert(index == 25); + CGAL_USE(nb_input_faces); + assert( sm.number_of_faces()+30 < nb_input_faces); assert(is_valid_polygon_mesh(sm)); + return 0; } diff --git a/BGL/test/BGL/test_cgal_bgl_named_params.cpp b/BGL/test/BGL/test_cgal_bgl_named_params.cpp index 019ad98dedf..71cf1369565 100644 --- a/BGL/test/BGL/test_cgal_bgl_named_params.cpp +++ b/BGL/test/BGL/test_cgal_bgl_named_params.cpp @@ -85,6 +85,9 @@ void test(const NamedParameters& np) assert(get_param(np, CGAL::internal_np::throw_on_self_intersection).v == 43); assert(get_param(np, CGAL::internal_np::clip_volume).v == 44); assert(get_param(np, CGAL::internal_np::use_compact_clipper).v == 45); + assert(get_param(np, CGAL::internal_np::erase_all_duplicates).v == 48); + assert(get_param(np, CGAL::internal_np::require_same_orientation).v == 49); + assert(get_param(np, CGAL::internal_np::use_bool_op_to_clip_surface).v == 50); // Named parameters that we use in the package 'Surface Mesh Simplification' assert(get_param(np, CGAL::internal_np::get_cost_policy).v == 34); @@ -101,6 +104,7 @@ void test(const NamedParameters& np) assert(get_param(np, CGAL::internal_np::verbosity_level).v == 41); assert(get_param(np, CGAL::internal_np::projection_functor).v == 42); assert(get_param(np, CGAL::internal_np::apply_per_connected_component).v == 46); + assert(get_param(np, CGAL::internal_np::output_iterator).v == 47); // Test types @@ -161,6 +165,9 @@ void test(const NamedParameters& np) check_same_type<43>(get_param(np, CGAL::internal_np::throw_on_self_intersection)); check_same_type<44>(get_param(np, CGAL::internal_np::clip_volume)); check_same_type<45>(get_param(np, CGAL::internal_np::use_compact_clipper)); + check_same_type<48>(get_param(np, CGAL::internal_np::erase_all_duplicates)); + check_same_type<49>(get_param(np, CGAL::internal_np::require_same_orientation)); + check_same_type<50>(get_param(np, CGAL::internal_np::use_bool_op_to_clip_surface)); // Named parameters that we use in the package 'Surface Mesh Simplification' check_same_type<34>(get_param(np, CGAL::internal_np::get_cost_policy)); @@ -177,6 +184,7 @@ void test(const NamedParameters& np) check_same_type<41>(get_param(np, CGAL::internal_np::verbosity_level)); check_same_type<42>(get_param(np, CGAL::internal_np::projection_functor)); check_same_type<46>(get_param(np, CGAL::internal_np::apply_per_connected_component)); + check_same_type<47>(get_param(np, CGAL::internal_np::output_iterator)); } int main() @@ -237,7 +245,11 @@ int main() .throw_on_self_intersection(A<43>(43)) .clip_volume(A<44>(44)) .use_compact_clipper(A<45>(45)) + .use_bool_op_to_clip_surface(A<50>(50)) .apply_per_connected_component(A<46>(46)) + .output_iterator(A<47>(47)) + .erase_all_duplicates(A<48>(48)) + .require_same_orientation(A<49>(49)) ); return EXIT_SUCCESS; diff --git a/BGL/test/BGL/test_circulator.cpp b/BGL/test/BGL/test_circulator.cpp index 8cd8ac1e6ec..1237d2e4801 100644 --- a/BGL/test/BGL/test_circulator.cpp +++ b/BGL/test/BGL/test_circulator.cpp @@ -30,7 +30,7 @@ typedef CGAL::Halfedge_around_target_iterator halfedge_around_target typedef CGAL::Halfedge_around_face_iterator halfedge_around_face_iterator; typedef CGAL::Face_around_face_iterator face_around_face_iterator; typedef CGAL::Vertex_around_target_iterator vertex_around_target_iterator; -int main(int, char* argv[]) +int main(int argc, char* argv[]) { BOOST_CONCEPT_ASSERT((CGAL::Concepts::BidirectionalCirculator)) CGAL_UNUSED; @@ -49,7 +49,7 @@ int main(int, char* argv[]) BOOST_CONCEPT_ASSERT((boost::BidirectionalIterator)) CGAL_UNUSED; BOOST_CONCEPT_ASSERT((boost::BidirectionalIterator)) CGAL_UNUSED; - std::ifstream in(argv[1]); + std::ifstream in((argc>1)?argv[1]:"data/cube.off"); Polyhedron P; in >> P; diff --git a/Barycentric_coordinates_2/doc/Barycentric_coordinates_2/Barycentric_coordinates_2.txt b/Barycentric_coordinates_2/doc/Barycentric_coordinates_2/Barycentric_coordinates_2.txt index da226aedf29..5c9edab1683 100644 --- a/Barycentric_coordinates_2/doc/Barycentric_coordinates_2/Barycentric_coordinates_2.txt +++ b/Barycentric_coordinates_2/doc/Barycentric_coordinates_2/Barycentric_coordinates_2.txt @@ -10,7 +10,7 @@ namespace CGAL { \section gbc_introduction Introduction -The package 2D Generalized Barycentric Coordinates offers an efficient and robust implementation of two-dimensional closed-form generalized barycentric coordinates defined for simple two-dimensional polygons. If coordinates with respect to multivariate scattered points instead of a polygon are required, please refer to natural neighbour coordinates from the package \ref PkgInterpolation2Summary "2D and Surface Function Interpolation". +The package 2D Generalized Barycentric Coordinates offers an efficient and robust implementation of two-dimensional closed-form generalized barycentric coordinates defined for simple two-dimensional polygons. If coordinates with respect to multivariate scattered points instead of a polygon are required, please refer to natural neighbour coordinates from the package \ref PkgInterpolation2 "2D and Surface Function Interpolation". In particular, the package includes an implementation of \ref wp_example "Wachspress", \ref mv_example "mean value", and \ref dh_example "discrete harmonic" coordinates and provides some extra functions to compute barycentric coordinates with respect to segments (\ref seg_example "segment coordinates") and triangles (\ref tri_example "triangle coordinates"). The section \ref gbc_theory gives a short introduction to the topic of barycentric coordinates. @@ -26,7 +26,7 @@ Segment and triangle coordinates can be computed by using either a global functi Any point in the plane may be taken as a query point. However, we do not recommend to use Wachspress and discrete harmonic coordinates with query points outside the closure of a polygon because at some of those points these coordinates are not well-defined, as explained in the Section \ref gbc_degeneracies. -Once instantiated for some polygon, the coordinates can be computed multiple times for different query points with respect to all the vertices of the provided polygon. Use the \ref PkgBarycentric_coordinates_2 "Reference Manual" for the detailed interface. +Once instantiated for some polygon, the coordinates can be computed multiple times for different query points with respect to all the vertices of the provided polygon. Use the \ref PkgBarycentricCoordinates2Ref "Reference Manual" for the detailed interface. The output of the computation is a set of coordinate values at the current query point with respect to all the vertices of the polygon. This output can be stored in an arbitrary container providing an appropriate output iterator. In addition, all the classes return a pointer to the last stored element and a status of the computation (Boolean true or false). @@ -85,7 +85,7 @@ This is an advanced example that shows how to use generalized barycentric coordi A 2D polygon with 50 vertices representing a piece of terrain with convex and concave parts. The height is not shown. \cgalFigureEnd -In this example we project a three-dimensional polygon orthogonally onto the two-dimensional plane using the class `CGAL::Projection_traits_xy_3`, triangulate its interior using the class `CGAL::Delaunay_mesher_2`, and compute mean value coordinates for all the obtained points with respect to all the polygon's vertices. Finally, we interpolate the height data from the polygon's boundary to its interior using the computed coordinates and the global interpolation function from the package \ref PkgInterpolation2Summary "2D and Surface Function Interpolation". +In this example we project a three-dimensional polygon orthogonally onto the two-dimensional plane using the class `CGAL::Projection_traits_xy_3`, triangulate its interior using the class `CGAL::Delaunay_mesher_2`, and compute mean value coordinates for all the obtained points with respect to all the polygon's vertices. Finally, we interpolate the height data from the polygon's boundary to its interior using the computed coordinates and the global interpolation function from the package \ref PkgInterpolation2 "2D and Surface Function Interpolation". \cgalExample{Barycentric_coordinates_2/Terrain_height_modeling.cpp} @@ -223,7 +223,7 @@ From the figure above it is easy to see that the \f$O(n^2)\f$ algorithm is as fa The generic design of the package was developed in 2013 by Dmitry Anisimov and David Bommes with many useful comments by Kai Hormann and Pierre Alliez. The package consists of 6 classes, 2 enumerations, and one namespace. Appropriate iterators are used to provide an efficient access to data and to pass them to one of the generic algorithms for computing coordinates. Once instantiated for a polygon (triangle, segment), the coordinates can be computed multiple times for different query points with respect to all the vertices of the provided polygon (triangle, segment). All the classes are fully templated and have a simple and similar design. In particular, we follow the same naming convention for all functions. Yet, the number of functions can differ from one class to another. -The implemented algorithms for computing coordinates do not depend on a particular kernel, and all the coordinates can be computed exactly, if an exact kernel is used, apart from mean value coordinates. The latter coordinates involve a square root operation, which results in a slightly worse precision with exact data types due to temporal conversion into a floating point type. The computed coordinates can be stored in an arbitrary container if an appropriate output iterator is provided. +The implemented algorithms for computing coordinates do not depend on a particular kernel, and all the coordinates can be computed exactly, if an exact kernel is used, apart from mean value coordinates. The latter coordinates involve a square root operation, which results in a slightly worse precision with exact data types due to temporal conversion into a floating point type. The computed coordinates can be stored in an arbitrary container if an appropriate output iterator is provided. It is worth noting that the class `CGAL::Barycentric_coordinates::Segment_coordinates_2` is used to compute generalized barycentric coordinates along the polygon's boundary. Hence, one can use the trick for segment coordinates from Section \ref gbc_degeneracies if one is convinced that a point must lie exactly on the polygon's boundary but due to some numerical instabilities it does not. @@ -256,7 +256,7 @@ Analogously to the previous cases, we want to plot the Wachspress coordinates an The Wachspress coordinate function with respect to the indicated vertex with values from zero to one as the colour bar indicates. \cgalFigureEnd -Another type of generalized barycentric coordinates goes back to Pinkall and Polthier in 1993 \cite cgal:pp-cdmsc-93 and Eck et al. in 1995 \cite cgal:bc:eddhls-maam-95 in the context of \ref PkgSurfaceParameterizationSummary "triangle mesh parameterization". They are called discrete harmonic coordinates. \ref gbc_deg_discrete_harmonic_coordinates "These coordinates" are well-defined, similarly to Wachspress coordinates, for arbitrary strictly convex polygons and inherit all the properties of triangle coordinates apart from the positivity inside a polygon because they can take on negative values \ref gbc_deg_discrete_harmonic_coordinates "for some polygons". Another interesting property of these coordinate functions is that they coincide with Wachspress coordinates for any polygon whose vertices lie on a common circle. +Another type of generalized barycentric coordinates goes back to Pinkall and Polthier in 1993 \cite cgal:pp-cdmsc-93 and Eck et al. in 1995 \cite cgal:bc:eddhls-maam-95 in the context of \ref PkgSurfaceMeshParameterization "triangle mesh parameterization". They are called discrete harmonic coordinates. \ref gbc_deg_discrete_harmonic_coordinates "These coordinates" are well-defined, similarly to Wachspress coordinates, for arbitrary strictly convex polygons and inherit all the properties of triangle coordinates apart from the positivity inside a polygon because they can take on negative values \ref gbc_deg_discrete_harmonic_coordinates "for some polygons". Another interesting property of these coordinate functions is that they coincide with Wachspress coordinates for any polygon whose vertices lie on a common circle. To plot discrete harmonic coordinates we take \ref wp_plot "the same polygon" as for Wachspress coordinates and plot the coordinate function with respect to the same vertex. Again, we get a smooth function, which is linear along all edges and grows from zero to one. Isolines in the plot show the difference between discrete harmonic and Wachspress coordinates for the chosen polygon and vertex. @@ -265,7 +265,7 @@ To plot discrete harmonic coordinates we take \ref wp_plot "the same polygon" as The discrete harmonic coordinate function with respect to the indicated vertex with values from zero to one as the colour bar indicates. \cgalFigureEnd -The last type of generalized barycentric coordinates that we discuss are mean value coordinates \cite cgal:f-mvc-03 proposed by M. Floater in 2003. Based on the mean value theorem, \ref gbc_deg_mean_value_coordinates "these coordinates", unlike Wachspress and discrete harmonic coordinates, are well-defined for arbitrary simple polygons, inherit all the properties of triangle coordinates for any convex polygon, and lack only the positivity property for general concave polygons. Hormann and Floater prove in \cite cgal:bc:hf-mvcapp-06 that these coordinates are positive inside the kernel of a star-shaped polygon. They are also positive in the closure of any quadrilateral. Like discrete harmonic weights, mean value weights are often used in the context of \ref PkgSurfaceParameterizationSummary "triangle mesh parameterization." +The last type of generalized barycentric coordinates that we discuss are mean value coordinates \cite cgal:f-mvc-03 proposed by M. Floater in 2003. Based on the mean value theorem, \ref gbc_deg_mean_value_coordinates "these coordinates", unlike Wachspress and discrete harmonic coordinates, are well-defined for arbitrary simple polygons, inherit all the properties of triangle coordinates for any convex polygon, and lack only the positivity property for general concave polygons. Hormann and Floater prove in \cite cgal:bc:hf-mvcapp-06 that these coordinates are positive inside the kernel of a star-shaped polygon. They are also positive in the closure of any quadrilateral. Like discrete harmonic weights, mean value weights are often used in the context of \ref PkgSurfaceMeshParameterization "triangle mesh parameterization." In order to show the particular behaviour of mean value coordinates with an application to concave polygons, we take \ref fig__mv__example "a star-shaped polygon" with ten vertices \f$[v_0, \dots, v_9]\f$, sample its interior and boundary, and plot the coordinate function with respect to the fourth vertex \f$v_3\f$. As the colour bar indicates, the obtained function grows from a slightly negative value to one at the chosen vertex. It is also smooth inside the polygon and linear along all edges. diff --git a/Barycentric_coordinates_2/doc/Barycentric_coordinates_2/Concepts/BarycentricCoordinates_2.h b/Barycentric_coordinates_2/doc/Barycentric_coordinates_2/Concepts/BarycentricCoordinates_2.h index 961c9de9c45..3d90dd14ef9 100644 --- a/Barycentric_coordinates_2/doc/Barycentric_coordinates_2/Concepts/BarycentricCoordinates_2.h +++ b/Barycentric_coordinates_2/doc/Barycentric_coordinates_2/Concepts/BarycentricCoordinates_2.h @@ -1,5 +1,5 @@ /*! -\ingroup PkgBarycentric_coordinates_2Concepts +\ingroup PkgBarycentricCoordinates2Concepts \cgalConcept Requirements of the template parameter `Coordinate_2` for the class `CGAL::Barycentric_coordinates::Generalized_barycentric_coordinates_2`. diff --git a/Barycentric_coordinates_2/doc/Barycentric_coordinates_2/Concepts/BarycentricTraits_2.h b/Barycentric_coordinates_2/doc/Barycentric_coordinates_2/Concepts/BarycentricTraits_2.h index b79617eea76..ae63a83a518 100644 --- a/Barycentric_coordinates_2/doc/Barycentric_coordinates_2/Concepts/BarycentricTraits_2.h +++ b/Barycentric_coordinates_2/doc/Barycentric_coordinates_2/Concepts/BarycentricTraits_2.h @@ -1,5 +1,5 @@ /*! -\ingroup PkgBarycentric_coordinates_2Concepts +\ingroup PkgBarycentricCoordinates2Concepts \cgalConcept Requirements of the template parameter `Traits` for all the classes with two-dimensional barycentric coordinates from the namespace `CGAL::Barycentric_coordinates`. diff --git a/Barycentric_coordinates_2/doc/Barycentric_coordinates_2/PackageDescription.txt b/Barycentric_coordinates_2/doc/Barycentric_coordinates_2/PackageDescription.txt index 29cae2cd33c..73e02ea085b 100644 --- a/Barycentric_coordinates_2/doc/Barycentric_coordinates_2/PackageDescription.txt +++ b/Barycentric_coordinates_2/doc/Barycentric_coordinates_2/PackageDescription.txt @@ -1,17 +1,17 @@ -/// \defgroup PkgBarycentric_coordinates_2 2D Generalized Barycentric Coordinates Reference +/// \defgroup PkgBarycentricCoordinates2Ref 2D Generalized Barycentric Coordinates Reference -/// \defgroup PkgBarycentric_coordinates_2Concepts Concepts -/// \ingroup PkgBarycentric_coordinates_2 +/// \defgroup PkgBarycentricCoordinates2Concepts Concepts +/// \ingroup PkgBarycentricCoordinates2Ref /*! -\addtogroup PkgBarycentric_coordinates_2 -\cgalPkgDescriptionBegin{2D Generalized Barycentric Coordinates, PkgBarycentric_coordinates_2Summary} +\addtogroup PkgBarycentricCoordinates2Ref +\cgalPkgDescriptionBegin{2D Generalized Barycentric Coordinates, PkgBarycentricCoordinates2} \cgalPkgPicture{barcoord_thumb.png} \cgalPkgSummaryBegin \cgalPkgAuthors{Dmitry Anisimov, David Bommes, Kai Hormann, and Pierre Alliez} -\cgalPkgDesc{The package 2D Generalized Barycentric Coordinates offers an efficient and robust implementation of two-dimensional closed-form generalized barycentric coordinates defined for simple two-dimensional polygons. If coordinates with respect to multivariate scattered points instead of a polygon are required, please refer to natural neighbor coordinates from the Package \ref PkgInterpolation2Summary.} -\cgalPkgManuals{Chapter_2D_Generalized_Barycentric_Coordinates, PkgBarycentric_coordinates_2} +\cgalPkgDesc{The package 2D Generalized Barycentric Coordinates offers an efficient and robust implementation of two-dimensional closed-form generalized barycentric coordinates defined for simple two-dimensional polygons. If coordinates with respect to multivariate scattered points instead of a polygon are required, please refer to natural neighbor coordinates from the Package \ref PkgInterpolation2.} +\cgalPkgManuals{Chapter_2D_Generalized_Barycentric_Coordinates, PkgBarycentricCoordinates2Ref} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{4.6} diff --git a/Barycentric_coordinates_2/examples/Barycentric_coordinates_2/CMakeLists.txt b/Barycentric_coordinates_2/examples/Barycentric_coordinates_2/CMakeLists.txt index 2622051db08..afb44332279 100644 --- a/Barycentric_coordinates_2/examples/Barycentric_coordinates_2/CMakeLists.txt +++ b/Barycentric_coordinates_2/examples/Barycentric_coordinates_2/CMakeLists.txt @@ -4,18 +4,12 @@ project( Barycentric_coordinates_2_Examples ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Discrete_harmonic_2.h b/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Discrete_harmonic_2.h index 5ab84f16885..c906a697198 100644 --- a/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Discrete_harmonic_2.h +++ b/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Discrete_harmonic_2.h @@ -49,7 +49,7 @@ namespace Barycentric_coordinates { // [1] Reference: "M. S. Floater, K. Hormann, and G. Kos. A general construction of barycentric coordinates over convex polygons. Advances in Computational Mathematics, 24(1-4):311-331, 2006.". /*! - * \ingroup PkgBarycentric_coordinates_2 + * \ingroup PkgBarycentricCoordinates2Ref * The class `Discrete_harmonic_2` implements 2D discrete harmonic coordinates ( \cite cgal:bc:fhk-gcbcocp-06, \cite cgal:pp-cdmsc-93, \cite cgal:bc:eddhls-maam-95 ). * This class is parameterized by a traits class `Traits`, and it is used as a coordinate class to complete the class `Generalized_barycentric_coordinates_2`. * For a polygon with three vertices (triangle) it is better to use the class `Triangle_coordinates_2`. diff --git a/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Generalized_barycentric_coordinates_2.h b/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Generalized_barycentric_coordinates_2.h index 4bce42d7680..5a214236086 100644 --- a/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Generalized_barycentric_coordinates_2.h +++ b/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Generalized_barycentric_coordinates_2.h @@ -48,7 +48,7 @@ namespace Barycentric_coordinates { // Examples: see the User Manual here - https://doc.cgal.org/latest/Manual/index.html. /*! - * \ingroup PkgBarycentric_coordinates_2 + * \ingroup PkgBarycentricCoordinates2Ref * The class `Generalized_barycentric_coordinates_2` implements generalized barycentric coordinates along the polygon's boundary and provides a common interface for all coordinate classes. * This class is parameterized by a coordinate class `Coordinate_2`, and a traits class `Traits`. diff --git a/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Mean_value_2.h b/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Mean_value_2.h index e44a126dc56..af15ec92ac8 100644 --- a/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Mean_value_2.h +++ b/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Mean_value_2.h @@ -101,7 +101,7 @@ public: // [2] Reference: "M. S. Floater, Wachspress and mean value coordinates, to appear in the Proceedings of the 14th International Conference on Approximation Theory, G. Fasshauer and L. L. Schumaker (eds.)." /*! - * \ingroup PkgBarycentric_coordinates_2 + * \ingroup PkgBarycentricCoordinates2Ref * The class `Mean_value_2` implements 2D mean value coordinates ( \cite cgal:bc:hf-mvcapp-06, \cite cgal:bc:fhk-gcbcocp-06, \cite cgal:f-mvc-03 ). * This class is parameterized by a traits class `Traits`, and it is used as a coordinate class to complete the class `Generalized_barycentric_coordinates_2`. * For a polygon with three vertices (triangle) it is better to use the class `Triangle_coordinates_2`. diff --git a/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Segment_coordinates_2.h b/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Segment_coordinates_2.h index 34fe8b3ba3b..cbd74d8fb21 100644 --- a/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Segment_coordinates_2.h +++ b/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Segment_coordinates_2.h @@ -48,7 +48,7 @@ namespace Barycentric_coordinates { // Examples: see the User Manual - https://doc.cgal.org/latest/Manual/index.html. /*! - * \ingroup PkgBarycentric_coordinates_2 + * \ingroup PkgBarycentricCoordinates2Ref * The class `Segment_coordinates_2` implements barycentric coordinates with respect to an arbitrary non-degenerate segment along an arbitrary line in the plane. * This class is parameterized by a traits class `Traits`. diff --git a/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Triangle_coordinates_2.h b/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Triangle_coordinates_2.h index 8ef6af47752..8d8222db4aa 100644 --- a/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Triangle_coordinates_2.h +++ b/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Triangle_coordinates_2.h @@ -49,7 +49,7 @@ namespace Barycentric_coordinates { // [1] Reference: Weisstein, Eric W. "Barycentric Coordinates." From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/BarycentricCoordinates.html. /*! - * \ingroup PkgBarycentric_coordinates_2 + * \ingroup PkgBarycentricCoordinates2Ref * The class `Triangle_coordinates_2` implements barycentric coordinates ( [1], * [2] ) with respect to an arbitrary non-degenerate triangle in the plane. * This class is parameterized by a traits class `Traits`. diff --git a/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Wachspress_2.h b/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Wachspress_2.h index 09209606660..0e9d42fa317 100644 --- a/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Wachspress_2.h +++ b/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Wachspress_2.h @@ -49,7 +49,7 @@ namespace Barycentric_coordinates { // [1] Reference: "M. S. Floater, K. Hormann, and G. Kos. A general construction of barycentric coordinates over convex polygons. Advances in Computational Mathematics, 24(1-4):311-331, 2006.". /*! - * \ingroup PkgBarycentric_coordinates_2 + * \ingroup PkgBarycentricCoordinates2Ref * The class `Wachspress_2` implements 2D Wachspress coordinates ( \cite cgal:bc:fhk-gcbcocp-06, \cite cgal:bc:mlbd-gbcip-02, \cite cgal:bc:w-rfeb-75 ). * This class is parameterized by a traits class `Traits`, and it is used as a coordinate class to complete the class `Generalized_barycentric_coordinates_2`. * For a polygon with three vertices it is better to use the class `Triangle_coordinates_2`. diff --git a/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/barycentric_enum_2.h b/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/barycentric_enum_2.h index 3f8fe3541ca..9f79c0227bd 100644 --- a/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/barycentric_enum_2.h +++ b/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/barycentric_enum_2.h @@ -32,7 +32,7 @@ namespace CGAL { /*! - * \ingroup PkgBarycentric_coordinates_2 + * \ingroup PkgBarycentricCoordinates2Ref * The namespace Barycentric_coordinates contains implementations of all generalized barycentric coordinates: 2D, 3D, related enumerations, and so on. */ diff --git a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/CMakeLists.txt b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/CMakeLists.txt index 276306dbbba..1d55dbc2fd2 100644 --- a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/CMakeLists.txt +++ b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/CMakeLists.txt @@ -4,18 +4,12 @@ project( Barycentric_coordinates_2_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/CMakeLists.txt b/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/CMakeLists.txt index 87cc1896278..2a05bfa5c19 100644 --- a/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/CMakeLists.txt +++ b/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/CMakeLists.txt @@ -11,13 +11,10 @@ endif() find_package(CGAL COMPONENTS Qt5 Core ) -include(${CGAL_USE_FILE}) - set( QT_USE_QTMAIN TRUE ) find_package(Qt5 QUIET COMPONENTS Widgets Script Svg) -include_directories (BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/../../include ) include_directories (BEFORE ${CMAKE_CURRENT_BINARY_DIR}) include_directories (BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/include ) diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/Boolean_set_operations_2.txt b/Boolean_set_operations_2/doc/Boolean_set_operations_2/Boolean_set_operations_2.txt index fefab6d04e6..f62ef5d35b8 100644 --- a/Boolean_set_operations_2/doc/Boolean_set_operations_2/Boolean_set_operations_2.txt +++ b/Boolean_set_operations_2/doc/Boolean_set_operations_2/Boolean_set_operations_2.txt @@ -23,7 +23,7 @@ intersection predicates, and point containment predicates. Ordinary Boolean set-operations, which distinguish between the interior and the boundary of a polygon, are not implemented within this -package. The Chapter \ref PkgNef2Summary supports these operations for (linear) +package. The Chapter \ref PkgNef2 supports these operations for (linear) polygons. In the rest of this chapter we use, unless otherwise stated, the diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Boolean_set_operations_2.h b/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Boolean_set_operations_2.h index 4c918fffd2b..f22267db575 100644 --- a/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Boolean_set_operations_2.h +++ b/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Boolean_set_operations_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! \addtogroup boolean_complement Complement Functions -\ingroup PkgBooleanSetOperations2 +\ingroup PkgBooleanSetOperations2Ref \anchor ref_bso_complement The `complement` function is overloaded. Depending on the @@ -58,7 +58,7 @@ namespace CGAL { /*! \addtogroup boolean_difference Difference Functions -\ingroup PkgBooleanSetOperations2 +\ingroup PkgBooleanSetOperations2Ref \anchor ref_bso_difference Each one of these functions computes the difference between two given @@ -181,7 +181,7 @@ namespace CGAL { /*! \addtogroup boolean_do_intersect Intersection Testing Functions -\ingroup PkgBooleanSetOperations2 +\ingroup PkgBooleanSetOperations2Ref \anchor ref_bso_do_intersect Each one of these functions computes if the interior of two given @@ -305,7 +305,7 @@ namespace CGAL { /*! \addtogroup boolean_intersection Intersection Functions -\ingroup PkgBooleanSetOperations2 +\ingroup PkgBooleanSetOperations2Ref \anchor ref_bso_intersection Each one of these functions computes the intersection of two given @@ -467,7 +467,7 @@ namespace CGAL { /*! \addtogroup boolean_join Union Functions -\ingroup PkgBooleanSetOperations2 +\ingroup PkgBooleanSetOperations2Ref \anchor ref_bso_union Each one of these functions computes the union of two given polygons @@ -621,7 +621,7 @@ OutputIterator oi); namespace CGAL { /*! \addtogroup boolean_oriented_side Oriented Side Functions -\ingroup PkgBooleanSetOperations2 +\ingroup PkgBooleanSetOperations2Ref \anchor ref_bso_oriented_side Each one of these functions returns `ON_POSITIVE_SIDE` if the two @@ -706,7 +706,7 @@ namespace CGAL { /*! \addtogroup boolean_symmetric_difference Symmetric Difference Functions -\ingroup PkgBooleanSetOperations2 +\ingroup PkgBooleanSetOperations2Ref \anchor ref_bso_symmetric_difference Each one of these functions computes the symmetric difference between diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Boolean_set_operations_2/Gps_default_dcel.h b/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Boolean_set_operations_2/Gps_default_dcel.h index f15067d1cfb..a70de3fc84d 100644 --- a/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Boolean_set_operations_2/Gps_default_dcel.h +++ b/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Boolean_set_operations_2/Gps_default_dcel.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgBooleanSetOperations2 +\ingroup PkgBooleanSetOperations2Ref An instance of this template serves as a basis type for any face record of the Dcel class used by instances of the @@ -22,7 +22,7 @@ further. class Gps_face_base : public Arr_face_base {}; /*! -\ingroup PkgBooleanSetOperations2 +\ingroup PkgBooleanSetOperations2Ref An instance of this teplate serves as a basis type for any halfedge record of the Dcel class used by instances of the @@ -44,7 +44,7 @@ class Gps_halfedge_base : public Arr_halfedge_base {}; /*! -\ingroup PkgBooleanSetOperations2 +\ingroup PkgBooleanSetOperations2Ref The default Dcel class template used by the `General_polygon_set_2` and `General_polygon_with_holes_2` class templates. diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/General_polygon_2.h b/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/General_polygon_2.h index 0eef1b3b4bf..9f1b175d383 100644 --- a/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/General_polygon_2.h +++ b/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/General_polygon_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgBooleanSetOperations2 +\ingroup PkgBooleanSetOperations2Ref The class `General_polygon_2` models the concept `GeneralPolygon_2`. It represents a simple general-polygon. It is parameterized with the type diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/General_polygon_set_2.h b/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/General_polygon_set_2.h index fbaf40f38b8..c11787975f8 100644 --- a/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/General_polygon_set_2.h +++ b/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/General_polygon_set_2.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgBooleanSetOperations2 +\ingroup PkgBooleanSetOperations2Ref An object of the `General_polygon_set_2` class-template represents a point set in the plane bounded by \f$ x\f$ monotone curves. Points in the set diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Gps_circle_segment_traits_2.h b/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Gps_circle_segment_traits_2.h index de13d563186..663c1d11a4c 100644 --- a/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Gps_circle_segment_traits_2.h +++ b/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Gps_circle_segment_traits_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgBooleanSetOperations2 +\ingroup PkgBooleanSetOperations2Ref The traits class `Gps_circle_segment_traits_2` models the `GeneralPolygonSetTraits_2` concept. It enables Boolean set-operations on general polygons bounded by diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Gps_segment_traits_2.h b/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Gps_segment_traits_2.h index adc2521cbfa..536b7dddd40 100644 --- a/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Gps_segment_traits_2.h +++ b/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Gps_segment_traits_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgBooleanSetOperations2 +\ingroup PkgBooleanSetOperations2Ref \cgalModels `GeneralPolygonSetTraits_2` diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Gps_traits_2.h b/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Gps_traits_2.h index cb5172cbf06..d5155423f8e 100644 --- a/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Gps_traits_2.h +++ b/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Gps_traits_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgBooleanSetOperations2 +\ingroup PkgBooleanSetOperations2Ref The traits class `Gps_traits_2` models the concept `GeneralPolygonSetTraits_2`. It inherits from the instantiated diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Polygon_set_2.h b/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Polygon_set_2.h index 1e9b5211e9a..3ed0e9cc728 100644 --- a/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Polygon_set_2.h +++ b/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Polygon_set_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgBooleanSetOperations2 +\ingroup PkgBooleanSetOperations2Ref The class `Polygon_set_2` represents sets of linear polygons with holes. The first two template parameters (`Kernel` and `Container`) diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/connect_holes.h b/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/connect_holes.h index 939c8566e9f..928c0d1fc96 100644 --- a/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/connect_holes.h +++ b/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/connect_holes.h @@ -2,7 +2,7 @@ namespace CGAL { /*! \addtogroup boolean_connect_holes Functions on Polygon with Holes -\ingroup PkgBooleanSetOperations2 +\ingroup PkgBooleanSetOperations2Ref \anchor ref_bso_connect_holes diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/PackageDescription.txt b/Boolean_set_operations_2/doc/Boolean_set_operations_2/PackageDescription.txt index c9570ed6982..11947d410d4 100644 --- a/Boolean_set_operations_2/doc/Boolean_set_operations_2/PackageDescription.txt +++ b/Boolean_set_operations_2/doc/Boolean_set_operations_2/PackageDescription.txt @@ -1,24 +1,24 @@ -/// \defgroup PkgBooleanSetOperations2 2D Regularized Boolean Set-Operations Reference +/// \defgroup PkgBooleanSetOperations2Ref 2D Regularized Boolean Set-Operations Reference /// \defgroup PkgBooleanSetOperations2Concepts Concepts -/// \ingroup PkgBooleanSetOperations2 +/// \ingroup PkgBooleanSetOperations2Ref /// \cgalConceptNamespace /// The namespace containing concepts specific to 2D Boolean Set Operations. namespace ArrDirectionalTraits {} /*! -\addtogroup PkgBooleanSetOperations2 +\addtogroup PkgBooleanSetOperations2Ref \todo check generated documentation -\cgalPkgDescriptionBegin{2D Regularized Boolean Set-Operations,PkgBooleanSetOperations2Summary} +\cgalPkgDescriptionBegin{2D Regularized Boolean Set-Operations,PkgBooleanSetOperations2} \cgalPkgPicture{Boolean_set_operations_2.png} \cgalPkgSummaryBegin \cgalPkgAuthors{Efi Fogel, Ophir Setter, Ron Wein, Guy Zucker, Baruch Zukerman, and Dan Halperin} \cgalPkgDesc{This package consists of the implementation of Boolean set-operations on point sets bounded by weakly x-monotone curves in 2-dimensional Euclidean space. In particular, it contains the implementation of regularized Boolean set-operations, intersection predicates, and point containment predicates.} -\cgalPkgManuals{Chapter_2D_Regularized_Boolean_Set-Operations,PkgBooleanSetOperations2} +\cgalPkgManuals{Chapter_2D_Regularized_Boolean_Set-Operations,PkgBooleanSetOperations2Ref} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{3.2} -\cgalPkgDependsOn{\ref PkgArrangement2Summary} +\cgalPkgDependsOn{\ref PkgArrangementOnSurface2} \cgalPkgBib{cgal:fwzh-rbso2} \cgalPkgLicense{\ref licensesGPL "GPL"} \cgalPkgDemo{Boolean operations,boolean_operations_2.zip} 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 d91325c426a..98df7ce7446 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 @@ -4,17 +4,13 @@ project( Boolean_set_operations_2_Examples ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) -find_package(CGAL QUIET COMPONENTS Core ) +find_package(CGAL QUIET COMPONENTS Core) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - include_directories (BEFORE "../../include") + include(${CGAL_USE_FILE}) # create a target per cppfile file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) diff --git a/Boolean_set_operations_2/test/Boolean_set_operations_2/CMakeLists.txt b/Boolean_set_operations_2/test/Boolean_set_operations_2/CMakeLists.txt index 7b4c1b160ef..f1069ba938b 100644 --- a/Boolean_set_operations_2/test/Boolean_set_operations_2/CMakeLists.txt +++ b/Boolean_set_operations_2/test/Boolean_set_operations_2/CMakeLists.txt @@ -4,18 +4,12 @@ project( Boolean_set_operations_2_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Bounding_volumes/doc/Bounding_volumes/CGAL/Approximate_min_ellipsoid_d.h b/Bounding_volumes/doc/Bounding_volumes/CGAL/Approximate_min_ellipsoid_d.h index 8fbe5d25734..c53940face3 100644 --- a/Bounding_volumes/doc/Bounding_volumes/CGAL/Approximate_min_ellipsoid_d.h +++ b/Bounding_volumes/doc/Bounding_volumes/CGAL/Approximate_min_ellipsoid_d.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgBoundingVolumes +\ingroup PkgBoundingVolumesRef An object of class `Approximate_min_ellipsoid_d` is an approximation to the ellipsoid of smallest volume enclosing a finite multiset of points diff --git a/Bounding_volumes/doc/Bounding_volumes/CGAL/Approximate_min_ellipsoid_d_traits_2.h b/Bounding_volumes/doc/Bounding_volumes/CGAL/Approximate_min_ellipsoid_d_traits_2.h index edd58cacab9..8692b24c19a 100644 --- a/Bounding_volumes/doc/Bounding_volumes/CGAL/Approximate_min_ellipsoid_d_traits_2.h +++ b/Bounding_volumes/doc/Bounding_volumes/CGAL/Approximate_min_ellipsoid_d_traits_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgBoundingVolumes +\ingroup PkgBoundingVolumesRef The class `Approximate_min_ellipsoid_d_traits_2` is a traits class for `CGAL::Approximate_min_ellipsoid_d` using the diff --git a/Bounding_volumes/doc/Bounding_volumes/CGAL/Approximate_min_ellipsoid_d_traits_3.h b/Bounding_volumes/doc/Bounding_volumes/CGAL/Approximate_min_ellipsoid_d_traits_3.h index dd398e46456..b7f79cd4167 100644 --- a/Bounding_volumes/doc/Bounding_volumes/CGAL/Approximate_min_ellipsoid_d_traits_3.h +++ b/Bounding_volumes/doc/Bounding_volumes/CGAL/Approximate_min_ellipsoid_d_traits_3.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgBoundingVolumes +\ingroup PkgBoundingVolumesRef The class `Approximate_min_ellipsoid_d_traits_3` is a traits class for `CGAL::Approximate_min_ellipsoid_d` using the diff --git a/Bounding_volumes/doc/Bounding_volumes/CGAL/Approximate_min_ellipsoid_d_traits_d.h b/Bounding_volumes/doc/Bounding_volumes/CGAL/Approximate_min_ellipsoid_d_traits_d.h index b7bdcbe586e..75d4b45137d 100644 --- a/Bounding_volumes/doc/Bounding_volumes/CGAL/Approximate_min_ellipsoid_d_traits_d.h +++ b/Bounding_volumes/doc/Bounding_volumes/CGAL/Approximate_min_ellipsoid_d_traits_d.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgBoundingVolumes +\ingroup PkgBoundingVolumesRef The class `Approximate_min_ellipsoid_d_traits_d` is a traits class for `CGAL::Approximate_min_ellipsoid_d` using the diff --git a/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_annulus_d.h b/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_annulus_d.h index c7af75cd66f..fdcc62b8986 100644 --- a/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_annulus_d.h +++ b/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_annulus_d.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgBoundingVolumes +\ingroup PkgBoundingVolumesRef An object of the class `Min_annulus_d` is the unique annulus (region between two concentric spheres with radii \f$ r\f$ and \f$ R\f$, \f$ r \leq R\f$) enclosing a diff --git a/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_circle_2.h b/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_circle_2.h index f4e8d622eb0..62309eefebe 100644 --- a/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_circle_2.h +++ b/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_circle_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgBoundingVolumes +\ingroup PkgBoundingVolumesRef An object of the class `Min_circle_2` is the unique circle of smallest area enclosing a finite (multi)set of points in two-dimensional Euclidean diff --git a/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_circle_2_traits_2.h b/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_circle_2_traits_2.h index acba791f7dc..3fe2037bdc2 100644 --- a/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_circle_2_traits_2.h +++ b/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_circle_2_traits_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgBoundingVolumes +\ingroup PkgBoundingVolumesRef The class `Min_circle_2_traits_2` is a traits class for `Min_circle_2` using the two-dimensional \cgal kernel. diff --git a/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_ellipse_2.h b/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_ellipse_2.h index fc36ae9e095..a9edbb88bcd 100644 --- a/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_ellipse_2.h +++ b/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_ellipse_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgBoundingVolumes +\ingroup PkgBoundingVolumesRef An object of the class `Min_ellipse_2` is the unique ellipse of smallest area enclosing a finite (multi)set of points in two-dimensional euclidean diff --git a/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_ellipse_2_traits_2.h b/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_ellipse_2_traits_2.h index e6a1ec22a1e..3a1f2fd3e77 100644 --- a/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_ellipse_2_traits_2.h +++ b/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_ellipse_2_traits_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgBoundingVolumes +\ingroup PkgBoundingVolumesRef The class `Min_ellipse_2_traits_2` is a traits class for `CGAL::Min_ellipse_2` using the two-di-men-sional \cgal kernel. diff --git a/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_quadrilateral_traits_2.h b/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_quadrilateral_traits_2.h index 6562281723e..212e5188ba2 100644 --- a/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_quadrilateral_traits_2.h +++ b/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_quadrilateral_traits_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgBoundingVolumes +\ingroup PkgBoundingVolumesRef The class `Min_quadrilateral_default_traits_2` is a traits class for the functions `min_rectangle_2`, `min_parallelogram_2` and diff --git a/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_sphere_annulus_d_traits_2.h b/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_sphere_annulus_d_traits_2.h index d0806b47f50..9d0e4de3c88 100644 --- a/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_sphere_annulus_d_traits_2.h +++ b/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_sphere_annulus_d_traits_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgBoundingVolumes +\ingroup PkgBoundingVolumesRef The class `Min_sphere_annulus_d_traits_2` is a traits class for the \f$ d\f$-dimensional optimisation algorithms using the two-dimensional \cgal kernel. diff --git a/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_sphere_annulus_d_traits_3.h b/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_sphere_annulus_d_traits_3.h index e4627f99380..6d07f070b9e 100644 --- a/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_sphere_annulus_d_traits_3.h +++ b/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_sphere_annulus_d_traits_3.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgBoundingVolumes +\ingroup PkgBoundingVolumesRef The class `Min_sphere_annulus_d_traits_3` is a traits class for the \f$ d\f$-dimensional optimisation algorithms using the three-dimensional \cgal kernel. diff --git a/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_sphere_annulus_d_traits_d.h b/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_sphere_annulus_d_traits_d.h index 5fec804b71d..0e65c594f65 100644 --- a/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_sphere_annulus_d_traits_d.h +++ b/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_sphere_annulus_d_traits_d.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgBoundingVolumes +\ingroup PkgBoundingVolumesRef The class `Min_sphere_annulus_d_traits_d` is a traits class for the \f$ d\f$-dimensional optimisation algorithms using the \f$ d\f$-dimensional \cgal kernel. diff --git a/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_sphere_d.h b/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_sphere_d.h index 7c93a00b5e1..a682dd41650 100644 --- a/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_sphere_d.h +++ b/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_sphere_d.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgBoundingVolumes +\ingroup PkgBoundingVolumesRef An object of the class `Min_sphere_d` is the unique sphere of smallest volume enclosing a finite (multi)set of points in \f$ d\f$-dimensional diff --git a/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_sphere_of_points_d_traits_2.h b/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_sphere_of_points_d_traits_2.h index 778ee39f84d..5b5f00fc91f 100644 --- a/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_sphere_of_points_d_traits_2.h +++ b/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_sphere_of_points_d_traits_2.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgBoundingVolumes +\ingroup PkgBoundingVolumesRef The class `Min_sphere_of_points_d_traits_2` is a diff --git a/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_sphere_of_points_d_traits_3.h b/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_sphere_of_points_d_traits_3.h index 94fc8752a01..0a789e04e45 100644 --- a/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_sphere_of_points_d_traits_3.h +++ b/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_sphere_of_points_d_traits_3.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgBoundingVolumes +\ingroup PkgBoundingVolumesRef The class `Min_sphere_of_points_d_traits_3` is a diff --git a/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_sphere_of_points_d_traits_d.h b/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_sphere_of_points_d_traits_d.h index 20af328cf96..2fa016f2303 100644 --- a/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_sphere_of_points_d_traits_d.h +++ b/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_sphere_of_points_d_traits_d.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgBoundingVolumes +\ingroup PkgBoundingVolumesRef The class `Min_sphere_of_points_d_traits_d` is diff --git a/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_sphere_of_spheres_d.h b/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_sphere_of_spheres_d.h index 24de9ca7fd8..f7cb4a140ca 100644 --- a/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_sphere_of_spheres_d.h +++ b/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_sphere_of_spheres_d.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgBoundingVolumes +\ingroup PkgBoundingVolumesRef An object of the class `Min_sphere_of_spheres_d` is a data structure that represents the unique sphere of smallest volume enclosing a finite set of spheres diff --git a/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_sphere_of_spheres_d_traits_2.h b/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_sphere_of_spheres_d_traits_2.h index 6154e5dae39..a0e085ede92 100644 --- a/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_sphere_of_spheres_d_traits_2.h +++ b/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_sphere_of_spheres_d_traits_2.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgBoundingVolumes +\ingroup PkgBoundingVolumesRef The class `Min_sphere_of_spheres_d_traits_2` is a diff --git a/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_sphere_of_spheres_d_traits_3.h b/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_sphere_of_spheres_d_traits_3.h index b59539673e6..e366016a9e0 100644 --- a/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_sphere_of_spheres_d_traits_3.h +++ b/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_sphere_of_spheres_d_traits_3.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgBoundingVolumes +\ingroup PkgBoundingVolumesRef The class `Min_sphere_of_spheres_d_traits_3` is a diff --git a/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_sphere_of_spheres_d_traits_d.h b/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_sphere_of_spheres_d_traits_d.h index 81774e86735..6821e1e210c 100644 --- a/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_sphere_of_spheres_d_traits_d.h +++ b/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_sphere_of_spheres_d_traits_d.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgBoundingVolumes +\ingroup PkgBoundingVolumesRef The class `Min_sphere_of_spheres_d_traits_d` is diff --git a/Bounding_volumes/doc/Bounding_volumes/CGAL/min_quadrilateral_2.h b/Bounding_volumes/doc/Bounding_volumes/CGAL/min_quadrilateral_2.h index 84ce8286486..c9c0f1469ae 100644 --- a/Bounding_volumes/doc/Bounding_volumes/CGAL/min_quadrilateral_2.h +++ b/Bounding_volumes/doc/Bounding_volumes/CGAL/min_quadrilateral_2.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgBoundingVolumes +\ingroup PkgBoundingVolumesRef The function computes a minimum area enclosing parallelogram \f$ A(P)\f$ of a given convex point set \f$ P\f$. Note that @@ -72,7 +72,7 @@ Traits& t = Default_traits); namespace CGAL { /*! -\ingroup PkgBoundingVolumes +\ingroup PkgBoundingVolumesRef The function computes a minimum area enclosing rectangle \f$ R(P)\f$ of a given convex point set \f$ P\f$. Note that \f$ R(P)\f$ is not @@ -141,7 +141,7 @@ Traits& t = Default_traits); namespace CGAL { /*! -\ingroup PkgBoundingVolumes +\ingroup PkgBoundingVolumesRef The function computes a minimum width enclosing strip \f$ S(P)\f$ of a given convex point set \f$ P\f$. A strip is the closed region diff --git a/Bounding_volumes/doc/Bounding_volumes/CGAL/rectangular_p_center_2.h b/Bounding_volumes/doc/Bounding_volumes/CGAL/rectangular_p_center_2.h index debd0c3c8ea..77381b0cb91 100644 --- a/Bounding_volumes/doc/Bounding_volumes/CGAL/rectangular_p_center_2.h +++ b/Bounding_volumes/doc/Bounding_volumes/CGAL/rectangular_p_center_2.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgBoundingVolumes +\ingroup PkgBoundingVolumesRef The class `Rectangular_p_center_default_traits_2` defines types and operations needed to compute rectilinear \f$ p\f$-centers of a planar point set @@ -194,7 +194,7 @@ construct_iso_rectangle_2_above_right_point_2_object() const; }; /*! -\ingroup PkgBoundingVolumes +\ingroup PkgBoundingVolumesRef Computes rectilinear \f$ p\f$-centers of a planar point set, i.e.\ a set of \f$ p\f$ points such diff --git a/Bounding_volumes/doc/Bounding_volumes/PackageDescription.txt b/Bounding_volumes/doc/Bounding_volumes/PackageDescription.txt index 30b90996b35..761addad579 100644 --- a/Bounding_volumes/doc/Bounding_volumes/PackageDescription.txt +++ b/Bounding_volumes/doc/Bounding_volumes/PackageDescription.txt @@ -1,15 +1,15 @@ -/// \defgroup PkgBoundingVolumes Bounding Volumes Reference +/// \defgroup PkgBoundingVolumesRef Bounding Volumes Reference /// \defgroup PkgBoundingVolumesConcepts Concepts -/// \ingroup PkgBoundingVolumes +/// \ingroup PkgBoundingVolumesRef /*! -\addtogroup PkgBoundingVolumes +\addtogroup PkgBoundingVolumesRef \todo check generated documentation -\cgalPkgDescriptionBegin{Bounding Volumes,PkgBoundingVolumesSummary} +\cgalPkgDescriptionBegin{Bounding Volumes,PkgBoundingVolumes} \cgalPkgPicture{minCircle.png} \cgalPkgSummaryBegin \cgalPkgAuthors{Kaspar Fischer, Bernd Gärtner, Thomas Herrmann, Michael Hoffmann, and Sven Schönherr} \cgalPkgDesc{This package provides algorithms for computing optimal bounding volumes of point sets. In d-dimensional space, the smallest enclosing sphere, ellipsoid (approximate), and annulus can be computed. In 3-dimensional space, the smallest enclosing strip is available as well, and in 2-dimensional space, there are algorithms for a number of additional volumes (rectangles, parallelograms, \f$ k=2,3,4\f$ axis-aligned rectangles). The smallest enclosing sphere algorithm can also be applied to a set of d-dimensional spheres.} -\cgalPkgManuals{Chapter_Bounding_Volumes,PkgBoundingVolumes} +\cgalPkgManuals{Chapter_Bounding_Volumes,PkgBoundingVolumesRef} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{1.1} diff --git a/Bounding_volumes/examples/Approximate_min_ellipsoid_d/CMakeLists.txt b/Bounding_volumes/examples/Approximate_min_ellipsoid_d/CMakeLists.txt index 00764d546fc..16a7ff583b6 100644 --- a/Bounding_volumes/examples/Approximate_min_ellipsoid_d/CMakeLists.txt +++ b/Bounding_volumes/examples/Approximate_min_ellipsoid_d/CMakeLists.txt @@ -1,17 +1,11 @@ project( Approximate_min_ellipsoid_d_Examples ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - include_directories (BEFORE "../../include") - # Use Eigen find_package(Eigen3 3.1.0 QUIET) #(3.1.0 or greater) if (EIGEN3_FOUND) diff --git a/Bounding_volumes/examples/Min_annulus_d/CMakeLists.txt b/Bounding_volumes/examples/Min_annulus_d/CMakeLists.txt index 488a5b88090..b406ed77552 100644 --- a/Bounding_volumes/examples/Min_annulus_d/CMakeLists.txt +++ b/Bounding_volumes/examples/Min_annulus_d/CMakeLists.txt @@ -1,24 +1,17 @@ project( Min_annulus_d_Examples ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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 library, and will not be compiled.") diff --git a/Bounding_volumes/examples/Min_circle_2/CMakeLists.txt b/Bounding_volumes/examples/Min_circle_2/CMakeLists.txt index 1806818a17b..d1db7e242fe 100644 --- a/Bounding_volumes/examples/Min_circle_2/CMakeLists.txt +++ b/Bounding_volumes/examples/Min_circle_2/CMakeLists.txt @@ -1,17 +1,11 @@ project( Min_circle_2_Examples ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Bounding_volumes/examples/Min_ellipse_2/CMakeLists.txt b/Bounding_volumes/examples/Min_ellipse_2/CMakeLists.txt index a9e1c25d83e..d0e44baa048 100644 --- a/Bounding_volumes/examples/Min_ellipse_2/CMakeLists.txt +++ b/Bounding_volumes/examples/Min_ellipse_2/CMakeLists.txt @@ -1,17 +1,11 @@ project( Min_ellipse_2_Examples ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Bounding_volumes/examples/Min_quadrilateral_2/CMakeLists.txt b/Bounding_volumes/examples/Min_quadrilateral_2/CMakeLists.txt index 00f6398d517..b59e56f2286 100644 --- a/Bounding_volumes/examples/Min_quadrilateral_2/CMakeLists.txt +++ b/Bounding_volumes/examples/Min_quadrilateral_2/CMakeLists.txt @@ -1,17 +1,11 @@ project( Min_quadrilateral_2_Examples ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Bounding_volumes/examples/Min_sphere_d/CMakeLists.txt b/Bounding_volumes/examples/Min_sphere_d/CMakeLists.txt index f81e2da2fab..685ac2e938b 100644 --- a/Bounding_volumes/examples/Min_sphere_d/CMakeLists.txt +++ b/Bounding_volumes/examples/Min_sphere_d/CMakeLists.txt @@ -1,17 +1,11 @@ project( Min_sphere_d_Examples ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Bounding_volumes/examples/Min_sphere_of_spheres_d/CMakeLists.txt b/Bounding_volumes/examples/Min_sphere_of_spheres_d/CMakeLists.txt index d53ce971f12..39ba7fb4af5 100644 --- a/Bounding_volumes/examples/Min_sphere_of_spheres_d/CMakeLists.txt +++ b/Bounding_volumes/examples/Min_sphere_of_spheres_d/CMakeLists.txt @@ -1,17 +1,11 @@ project( Min_sphere_of_spheres_d_Examples ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Bounding_volumes/examples/Rectangular_p_center_2/CMakeLists.txt b/Bounding_volumes/examples/Rectangular_p_center_2/CMakeLists.txt index 3bae164b2d1..76fb954b161 100644 --- a/Bounding_volumes/examples/Rectangular_p_center_2/CMakeLists.txt +++ b/Bounding_volumes/examples/Rectangular_p_center_2/CMakeLists.txt @@ -1,24 +1,17 @@ project( Rectangular_p_center_2_Examples ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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 library, and will not be compiled.") diff --git a/Bounding_volumes/test/Bounding_volumes/CMakeLists.txt b/Bounding_volumes/test/Bounding_volumes/CMakeLists.txt index 30daac07fc0..f6a82d575ee 100644 --- a/Bounding_volumes/test/Bounding_volumes/CMakeLists.txt +++ b/Bounding_volumes/test/Bounding_volumes/CMakeLists.txt @@ -4,17 +4,13 @@ project( Bounding_volumes_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET COMPONENTS Core ) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - include_directories (BEFORE "../../include") + include(${CGAL_USE_FILE}) # Use Eigen find_package(Eigen3 3.1.0 QUIET) #(3.1.0 or greater) diff --git a/Box_intersection_d/doc/Box_intersection_d/PackageDescription.txt b/Box_intersection_d/doc/Box_intersection_d/PackageDescription.txt index 272c41c14d5..1478c8a0cf1 100644 --- a/Box_intersection_d/doc/Box_intersection_d/PackageDescription.txt +++ b/Box_intersection_d/doc/Box_intersection_d/PackageDescription.txt @@ -1,33 +1,33 @@ -/// \defgroup PkgBoxIntersectionD Intersecting Sequences of dD Iso-oriented Boxes Reference +/// \defgroup PkgBoxIntersectionDRef Intersecting Sequences of dD Iso-oriented Boxes Reference /// \defgroup PkgBoxIntersectionDConcepts Concepts -/// \ingroup PkgBoxIntersectionD +/// \ingroup PkgBoxIntersectionDRef /// \defgroup PkgBoxIntersectionDClasses Classes -/// \ingroup PkgBoxIntersectionD +/// \ingroup PkgBoxIntersectionDRef /// \defgroup PkgBoxIntersectionD_box_intersection_d CGAL::box_intersection_d() -/// \ingroup PkgBoxIntersectionD +/// \ingroup PkgBoxIntersectionDRef /// \defgroup PkgBoxIntersectionD_box_intersection_all_pairs_d CGAL::box_intersection_all_pairs_d() -/// \ingroup PkgBoxIntersectionD +/// \ingroup PkgBoxIntersectionDRef /// \defgroup PkgBoxIntersectionD_box_self_intersection_d CGAL::box_self_intersection_d() -/// \ingroup PkgBoxIntersectionD +/// \ingroup PkgBoxIntersectionDRef /// \defgroup PkgBoxIntersectionD_box_self_intersection_all_pairs_d CGAL::box_self_intersection_all_pairs_d() -/// \ingroup PkgBoxIntersectionD +/// \ingroup PkgBoxIntersectionDRef /*! -\addtogroup PkgBoxIntersectionD +\addtogroup PkgBoxIntersectionDRef \todo de-math and change D to d for the dimension -\cgalPkgDescriptionBegin{Intersecting Sequences of dD Iso-oriented Boxes,PkgBoxIntersectionDSummary} +\cgalPkgDescriptionBegin{Intersecting Sequences of dD Iso-oriented Boxes,PkgBoxIntersectionD} \cgalPkgPicture{box_inters-small.png} \cgalPkgSummaryBegin \cgalPkgAuthors{Lutz Kettner, Andreas Meyer, and Afra Zomorodian} \cgalPkgDesc{An efficient algorithm for finding all intersecting pairs for large numbers of iso-oriented boxes, in order to apply a user defined callback on them. Typically these boxes will be bounding boxes of more complicated geometries. The algorithm is useful for (self-) intersection tests of surfaces etc. } -\cgalPkgManuals{Chapter_Intersecting_Sequences_of_dD_Iso-oriented_Boxes,PkgBoxIntersectionD} +\cgalPkgManuals{Chapter_Intersecting_Sequences_of_dD_Iso-oriented_Boxes,PkgBoxIntersectionDRef} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{3.1} diff --git a/Box_intersection_d/examples/Box_intersection_d/CMakeLists.txt b/Box_intersection_d/examples/Box_intersection_d/CMakeLists.txt index c2f2b3c8d61..1d5ab39100c 100644 --- a/Box_intersection_d/examples/Box_intersection_d/CMakeLists.txt +++ b/Box_intersection_d/examples/Box_intersection_d/CMakeLists.txt @@ -4,18 +4,12 @@ project( Box_intersection_d_Examples ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Box_intersection_d/test/Box_intersection_d/CMakeLists.txt b/Box_intersection_d/test/Box_intersection_d/CMakeLists.txt index 43f85186e90..bcdb064e633 100644 --- a/Box_intersection_d/test/Box_intersection_d/CMakeLists.txt +++ b/Box_intersection_d/test/Box_intersection_d/CMakeLists.txt @@ -4,18 +4,12 @@ project( Box_intersection_d_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/CGAL_Core/examples/Core/CMakeLists.txt b/CGAL_Core/examples/Core/CMakeLists.txt index d51b2ae90b7..ad932d6731a 100644 --- a/CGAL_Core/examples/Core/CMakeLists.txt +++ b/CGAL_Core/examples/Core/CMakeLists.txt @@ -1,16 +1,13 @@ project( Core_Examples ) -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.1) # CGAL and its components find_package( CGAL QUIET COMPONENTS Core ) -# include helper file -include( ${CGAL_USE_FILE} ) - if ( NOT CGAL_Core_FOUND ) message(STATUS "This project requires the CGAL_Core library, and will not be compiled.") @@ -32,12 +29,9 @@ endif() # include for local directory # include for local package -include_directories( BEFORE ../../include ) - +include(${CGAL_USE_FILE}) # Creating entries for all .cpp/.C files with "main" routine # ########################################################## -include( CGAL_CreateSingleSourceCGALProgram ) - create_single_source_cgal_program( "delaunay.cpp" ) diff --git a/CGAL_ImageIO/archive/demo/CGALimageIO/CMakeLists.txt b/CGAL_ImageIO/archive/demo/CGALimageIO/CMakeLists.txt index 0d395812e09..a5f3c89d94b 100644 --- a/CGAL_ImageIO/archive/demo/CGALimageIO/CMakeLists.txt +++ b/CGAL_ImageIO/archive/demo/CGALimageIO/CMakeLists.txt @@ -25,7 +25,6 @@ endforeach() find_package(CGAL REQUIRED ImageIO) -include( ${CGAL_USE_FILE} ) find_package(VTK QUIET NO_MODULE) if(VTK_FOUND) diff --git a/CGAL_ImageIO/examples/CGALimageIO/CMakeLists.txt b/CGAL_ImageIO/examples/CGALimageIO/CMakeLists.txt index 038eb63d17b..abf713eb1c8 100644 --- a/CGAL_ImageIO/examples/CGALimageIO/CMakeLists.txt +++ b/CGAL_ImageIO/examples/CGALimageIO/CMakeLists.txt @@ -3,15 +3,13 @@ project( CGALimageIO_Examples ) -cmake_minimum_required(VERSION 2.8.11) - +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET COMPONENTS ImageIO ) -include( ${CGAL_USE_FILE} ) -include( CGAL_CreateSingleSourceCGALProgram ) - if(CGAL_ImageIO_FOUND) + include(${CGAL_USE_FILE}) + create_single_source_cgal_program( "convert_raw_image_to_inr.cpp" ) create_single_source_cgal_program( "test_imageio.cpp" ) else() diff --git a/CGAL_ImageIO/include/CGAL/ImageIO_impl.h b/CGAL_ImageIO/include/CGAL/ImageIO_impl.h index 9d57d1470e4..da049f853db 100644 --- a/CGAL_ImageIO/include/CGAL/ImageIO_impl.h +++ b/CGAL_ImageIO/include/CGAL/ImageIO_impl.h @@ -63,6 +63,12 @@ #include #endif + +#ifdef CGAL_USE_ZLIB +#define ZLIB_MAJOR_VERSION ZLIB_VERNUM>>8 +#define ZLIB_MINOR_VERSION (ZLIB_VERNUM-(ZLIB_MAJOR_VERSION <<8)) +#define CGAL_USE_GZFWRITE ZLIB_MAJOR_VERSION > 0x12 || ((ZLIB_MAJOR_VERSION == 0x12) && (ZLIB_MINOR_VERSION >= 0x90)) +#endif struct Remove_supported_file_format { ~Remove_supported_file_format() { @@ -194,6 +200,14 @@ size_t ImageIO_write(const _image *im, const void *buf, size_t len) { fprintf(stderr, "zlib error: %s\n", gzerror(im->fd, &errnum)); } return ( len - to_be_written ); +#if CGAL_USE_GZFWRITE + case OM_FILE : + while ( (to_be_written > 0) && ((l = gzfwrite( b, sizeof(char), ImageIO_limit_len(to_be_written), im->fd )) > 0) ) { + to_be_written -= l; + b += l; + } + return ( len - to_be_written ); +#endif // CGAL_USE_GZFWRITE #else case OM_FILE : while ( (to_be_written > 0) && ((l = fwrite( b, 1, ImageIO_limit_len(to_be_written), im->fd )) > 0) ) { @@ -243,6 +257,9 @@ size_t ImageIO_read(const _image *im, void *buf, size_t len) return ( len - to_be_read ); #ifdef CGAL_USE_ZLIB case OM_GZ : +#if CGAL_USE_GZFWRITE + case OM_FILE : +#endif// CGAL_USE_GZFWRITE while ( (to_be_read > 0) && ((l = gzread(im->fd, (void *) b, ImageIO_limit_len(to_be_read))) > 0) ) { to_be_read -= l; b += l; @@ -291,8 +308,12 @@ char *ImageIO_gets( const _image *im, char *str, int size ) break; #ifdef CGAL_USE_ZLIB case OM_GZ : +#if CGAL_USE_GZFWRITE + case OM_FILE : +#endif // CGAL_USE_GZFWRITE ret = (char *) gzgets(im->fd, str, size); break; + #else case OM_FILE : ret = fgets(str, size, im->fd); @@ -312,10 +333,14 @@ long ImageIO_seek( const _image *im, long offset, int whence ) { return -1; #ifdef CGAL_USE_ZLIB case OM_GZ: +#if CGAL_USE_GZFWRITE + case OM_FILE: +#endif //CGAL_USE_GZFWRITE return gzseek(im->fd, offset, whence ); -#endif +#else case OM_FILE: return fseek( (FILE*)im->fd, offset, whence ); +#endif } } @@ -330,12 +355,16 @@ int ImageIO_error( const _image *im ) return 0; #ifdef CGAL_USE_ZLIB case OM_GZ : +#if CGAL_USE_GZFWRITE + case OM_FILE : +#endif //CGAL_USE_GZFWRITE static int errnum; (void)gzerror(im->fd, &errnum); return( (errnum != Z_OK) || gzeof(im->fd) ); -#endif +#else case OM_FILE : return( ferror( (FILE*)im->fd ) || feof( (FILE*)im->fd ) ); +#endif } //return 0; } @@ -359,15 +388,19 @@ int ImageIO_close( _image* im ) #ifdef CGAL_USE_ZLIB case OM_GZ : case OM_STD : +#if CGAL_USE_GZFWRITE + case OM_FILE : +#endif//CGAL_USE_GZFWRITE ret = gzclose( im->fd ); break; #else case OM_STD : break; -#endif case OM_FILE : ret = fclose( (FILE*)im->fd ); +#endif } + im->fd = NULL; im->openMode = OM_CLOSE; @@ -474,12 +507,19 @@ void _openWriteImage(_image* im, const char *name) #endif im->openMode = OM_GZ; } +#if CGAL_USE_GZFWRITE else -#endif + { + im->fd = (_ImageIO_file) gzopen(name, "wb"); + im->openMode = OM_FILE; + } +#endif// CGAL_USE_GZFWRITE +#else { im->fd = (_ImageIO_file) fopen(name, "wb"); im->openMode = OM_FILE; } +#endif } } diff --git a/CGAL_ImageIO/test/CGAL_ImageIO/CMakeLists.txt b/CGAL_ImageIO/test/CGAL_ImageIO/CMakeLists.txt index c70bb5c24cb..7b39be42ee8 100644 --- a/CGAL_ImageIO/test/CGAL_ImageIO/CMakeLists.txt +++ b/CGAL_ImageIO/test/CGAL_ImageIO/CMakeLists.txt @@ -4,18 +4,12 @@ project( CGAL_ImageIO_Tests ) -cmake_minimum_required(VERSION 2.8.11) - - -include_directories(../../include) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET COMPONENTS ImageIO ) if ( CGAL_FOUND ) - - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) + include(${CGAL_USE_FILE}) if (WITH_CGAL_ImageIO) create_single_source_cgal_program( "test_trilinear_interpolation.cpp" ) diff --git a/CGAL_ipelets/demo/CGAL_ipelets/CMakeLists.txt b/CGAL_ipelets/demo/CGAL_ipelets/CMakeLists.txt index 83f66e52253..b6419a7476c 100644 --- a/CGAL_ipelets/demo/CGAL_ipelets/CMakeLists.txt +++ b/CGAL_ipelets/demo/CGAL_ipelets/CMakeLists.txt @@ -23,7 +23,8 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}") find_package(CGAL QUIET COMPONENTS Core) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) + + include(${CGAL_USE_FILE}) find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) if (EIGEN3_FOUND) diff --git a/CGAL_ipelets/demo/CGAL_ipelets/cgal_test_with_cmake b/CGAL_ipelets/demo/CGAL_ipelets/cgal_test_with_cmake index 1893347ec5b..7113a52ffb8 100755 --- a/CGAL_ipelets/demo/CGAL_ipelets/cgal_test_with_cmake +++ b/CGAL_ipelets/demo/CGAL_ipelets/cgal_test_with_cmake @@ -26,7 +26,7 @@ configure() { echo "Configuring... " - if eval 'cmake --no-warn-unused-cli "$CMAKE_GENERATOR" -DRUNNING_CGAL_AUTO_TEST=TRUE \ + if eval 'cmake --no-warn-unused-cli ${INIT_FILE:+"-C$INIT_FILE"} "$CMAKE_GENERATOR" -DRUNNING_CGAL_AUTO_TEST=TRUE \ -DCGAL_DIR="$CGAL_DIR" \ .' ; then diff --git a/CGAL_ipelets/doc/CGAL_ipelets/CGAL/CGAL_Ipelet_base.h b/CGAL_ipelets/doc/CGAL_ipelets/CGAL/CGAL_Ipelet_base.h index 32c46524737..5152f1a50a2 100644 --- a/CGAL_ipelets/doc/CGAL_ipelets/CGAL/CGAL_Ipelet_base.h +++ b/CGAL_ipelets/doc/CGAL_ipelets/CGAL/CGAL_Ipelet_base.h @@ -1,5 +1,5 @@ /*! -\ingroup PkgCGALIpelets +\ingroup PkgCGALIpeletsRef The registration of a new ipelet can be done using the macro command `CGAL_IPELET`. Taking as a parameter the name of the class defining the new ipelet, that macro must be placed in the source file after the class definition. @@ -9,7 +9,7 @@ file after the class definition. namespace CGAL { /*! -\ingroup PkgCGALIpelets +\ingroup PkgCGALIpeletsRef `Ipelet_base` is an abstract base class for defining an ipelet. The only function that needs to be defined in a derived class is diff --git a/CGAL_ipelets/doc/CGAL_ipelets/PackageDescription.txt b/CGAL_ipelets/doc/CGAL_ipelets/PackageDescription.txt index d51312d18c2..61200e65b1f 100644 --- a/CGAL_ipelets/doc/CGAL_ipelets/PackageDescription.txt +++ b/CGAL_ipelets/doc/CGAL_ipelets/PackageDescription.txt @@ -1,12 +1,12 @@ -/// \defgroup PkgCGALIpelets CGAL Ipelets Reference +/// \defgroup PkgCGALIpeletsRef CGAL Ipelets Reference /*! -\addtogroup PkgCGALIpelets -\cgalPkgDescriptionBegin{CGAL Ipelets,PkgCGALIpeletsSummary} +\addtogroup PkgCGALIpeletsRef +\cgalPkgDescriptionBegin{CGAL Ipelets,PkgCGALIpelets} \cgalPkgPicture{ipeico.jpg} \cgalPkgSummaryBegin \cgalPkgAuthors{Olivier Devillers, Sébastien Loriot, and Sylvain Pion} \cgalPkgDesc{This package provides a generic framework to easily write ipelets (plug-in's) using \cgal for the the Ipe extensible drawing editor.} -\cgalPkgManuals{Chapter_CGAL_Ipelets,PkgCGALIpelets} +\cgalPkgManuals{Chapter_CGAL_Ipelets,PkgCGALIpeletsRef} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{3.5} diff --git a/CGAL_ipelets/examples/CGAL_ipelets/CMakeLists.txt b/CGAL_ipelets/examples/CGAL_ipelets/CMakeLists.txt index 56e033ef616..25e4407eaf9 100644 --- a/CGAL_ipelets/examples/CGAL_ipelets/CMakeLists.txt +++ b/CGAL_ipelets/examples/CGAL_ipelets/CMakeLists.txt @@ -4,18 +4,12 @@ project( CGAL_ipelets_Examples ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Aff_transformation_2.h b/Cartesian_kernel/include/CGAL/Cartesian/Aff_transformation_2.h index e3c836b438c..ca07a5066df 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Aff_transformation_2.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Aff_transformation_2.h @@ -178,6 +178,21 @@ public: std::ostream & print(std::ostream &os) const; + + bool operator==(const Aff_transformationC2 &t)const + { + for(int i=0; i<3; ++i) + for(int j = 0; j< 3; ++j) + if(cartesian(i,j)!=t.cartesian(i,j)) + return false; + return true; + } + + bool operator!=(const Aff_transformationC2 &t)const + { + return !(*this == t); + } + }; template < class R > diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Aff_transformation_3.h b/Cartesian_kernel/include/CGAL/Cartesian/Aff_transformation_3.h index 706b0747f05..e42f9ea5ca9 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Aff_transformation_3.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Aff_transformation_3.h @@ -177,7 +177,21 @@ public: Aff_transformation_3 operator*(const Aff_transformationC3 &t) const { return (*this->Ptr()) * (*t.Ptr()); } - + + bool operator==(const Aff_transformationC3 &t)const + { + for(int i=0; i<3; ++i) + for(int j = 0; j< 4; ++j) + if(cartesian(i,j)!=t.cartesian(i,j)) + return false; + return true; + } + + bool operator!=(const Aff_transformationC3 &t)const + { + return !(*this == t); + } + protected: Aff_transformation_3 transpose() const { return this->Ptr()->transpose(); } }; diff --git a/Cartesian_kernel/include/CGAL/Cartesian_converter.h b/Cartesian_kernel/include/CGAL/Cartesian_converter.h index fb25953c85f..33f941b3305 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian_converter.h +++ b/Cartesian_kernel/include/CGAL/Cartesian_converter.h @@ -393,6 +393,24 @@ public: return std::make_pair(operator()(pp.first), operator()(pp.second)); } + typename K2::Aff_transformation_3 + operator()(const typename K1::Aff_transformation_3 &a) const + { + typedef typename K2::Aff_transformation_3 Aff_transformation_3; + typename K2::FT t[12]; + for(int i=0; i< 3; ++i) + { + for(int j=0; j<4; ++j) + { + t[i*4+j] = a.m(i,j); + } + } + return Aff_transformation_3( + t[0],t[1],t[2],t[3], + t[4],t[5],t[6],t[7], + t[8],t[9],t[10],t[11], + a.m(3,3)); + } private: Converter c; K2 k; diff --git a/Cartesian_kernel/include/CGAL/constructions/kernel_ftC2.h b/Cartesian_kernel/include/CGAL/constructions/kernel_ftC2.h index ff81eb5582b..48dba7821ae 100644 --- a/Cartesian_kernel/include/CGAL/constructions/kernel_ftC2.h +++ b/Cartesian_kernel/include/CGAL/constructions/kernel_ftC2.h @@ -313,34 +313,24 @@ line_project_pointC2(const FT &la, const FT &lb, const FT &lc, const FT &px, const FT &py, FT &x, FT &y) { -#if 1 // FIXME - // Original old version - if (CGAL_NTS is_zero(la)) // horizontal line + if (certainly(is_zero(la))) // horizontal line { x = px; y = -lc/lb; } - else if (CGAL_NTS is_zero(lb)) // vertical line + else if (certainly(is_zero(lb))) // vertical line { x = -lc/la; y = py; } else { - FT ab = la/lb, ba = lb/la, ca = lc/la; - y = ( -px + ab*py - ca ) / ( ba + ab ); - x = -ba * y - ca; + FT a2 = CGAL_NTS square(la); + FT b2 = CGAL_NTS square(lb); + FT d = a2 + b2; + x = (b2*px - la*lb*py - la*lc) / d; + y = (-la*lb*px + a2*py - lb*lc) / d; } -#else - // New version, with more multiplications, but less divisions and tests. - // Let's compare the results of the 2, benchmark them, as well as check - // the precision with the intervals. - FT a2 = CGAL_NTS square(la); - FT b2 = CGAL_NTS square(lb); - FT d = a2 + b2; - x = (la * (lb * py - lc) - px * b2) / d; - y = (lb * (lc - la * px) + py * a2) / d; -#endif } template < class FT > diff --git a/Circular_kernel_2/doc/Circular_kernel_2/Circular_kernel_2.txt b/Circular_kernel_2/doc/Circular_kernel_2/Circular_kernel_2.txt index 288a9337069..bc2674a7f71 100644 --- a/Circular_kernel_2/doc/Circular_kernel_2/Circular_kernel_2.txt +++ b/Circular_kernel_2/doc/Circular_kernel_2/Circular_kernel_2.txt @@ -73,7 +73,7 @@ The following example shows how to use a functor of the kernel. The first pieces of prototype code were comparisons of algebraic numbers of degree 2, written by Olivier Devillers -\cgalCite{cgal:dfmt-amafe-00},cgal:dfmt-amafe-02. +\cgalCite{cgal:dfmt-amafe-00},\cgalCite{cgal:dfmt-amafe-02}. Some work was then done in the direction of a "kernel" for \cgal.\cgalFootnote{Monique Teillaud, First Prototype of a \cgal Geometric Kernel with Circular Arcs, Technical Report ECG-TR-182203-01, 2002 diff --git a/Circular_kernel_2/doc/Circular_kernel_2/PackageDescription.txt b/Circular_kernel_2/doc/Circular_kernel_2/PackageDescription.txt index 5343842eb4a..e51308477a9 100644 --- a/Circular_kernel_2/doc/Circular_kernel_2/PackageDescription.txt +++ b/Circular_kernel_2/doc/Circular_kernel_2/PackageDescription.txt @@ -1,34 +1,34 @@ -/// \defgroup PkgCircularKernel2 2D Circular Geometry Kernel Reference +/// \defgroup PkgCircularKernel2Ref 2D Circular Geometry Kernel Reference /// \defgroup PkgCircularKernel2GeometricConcepts Geometric Concepts -/// \ingroup PkgCircularKernel2 +/// \ingroup PkgCircularKernel2Ref /// \defgroup PkgCircularKernel2GeometricClasses Geometric Kernel and Classes -/// \ingroup PkgCircularKernel2 +/// \ingroup PkgCircularKernel2Ref /// \defgroup PkgCircularKernel2GeometricFunctions Geometric Global Functions -/// \ingroup PkgCircularKernel2 +/// \ingroup PkgCircularKernel2Ref /// \defgroup PkgCircularKernel2AlgebraicConcepts Algebraic Concepts -/// \ingroup PkgCircularKernel2 +/// \ingroup PkgCircularKernel2Ref /// \defgroup PkgCircularKernel2AlgebraicClasses Algebraic Kernel and Classes -/// \ingroup PkgCircularKernel2 +/// \ingroup PkgCircularKernel2Ref /*! -\addtogroup PkgCircularKernel2 +\addtogroup PkgCircularKernel2Ref \todo check generated documentation -\cgalPkgDescriptionBegin{2D Circular Geometry Kernel,PkgCircularKernel2Summary} +\cgalPkgDescriptionBegin{2D Circular Geometry Kernel,PkgCircularKernel2} \cgalPkgPicture{Boolean_operation_detail.png} \cgalPkgSummaryBegin \cgalPkgAuthors{Pedro Machado Manhães de Castro, Sylvain Pion, and Monique Teillaud} \cgalPkgDesc{This package is an extension of the linear \cgal kernel. It offers functionalities on circles, circular arcs and line segments in the plane. } -\cgalPkgManuals{Chapter_2D_Circular_Geometry_Kernel,PkgCircularKernel2} +\cgalPkgManuals{Chapter_2D_Circular_Geometry_Kernel,PkgCircularKernel2Ref} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{3.2} diff --git a/Circular_kernel_2/examples/Circular_kernel_2/CMakeLists.txt b/Circular_kernel_2/examples/Circular_kernel_2/CMakeLists.txt index 02f290163fb..8072b3720da 100644 --- a/Circular_kernel_2/examples/Circular_kernel_2/CMakeLists.txt +++ b/Circular_kernel_2/examples/Circular_kernel_2/CMakeLists.txt @@ -4,18 +4,12 @@ project( Circular_kernel_2_Examples ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Circular_kernel_2/test/Circular_kernel_2/CMakeLists.txt b/Circular_kernel_2/test/Circular_kernel_2/CMakeLists.txt index dc4bb0315ef..8561adcfbcd 100644 --- a/Circular_kernel_2/test/Circular_kernel_2/CMakeLists.txt +++ b/Circular_kernel_2/test/Circular_kernel_2/CMakeLists.txt @@ -4,18 +4,13 @@ project( Circular_kernel_2_Tests ) -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11) +CMAKE_MINIMUM_REQUIRED(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - include_directories (BEFORE include) -include_directories (BEFORE ../../include) include_directories (BEFORE ../../../Kernel_23/test/Kernel_23/include) include_directories (BEFORE ../Kernel_23/include) include_directories (BEFORE ../Cartesian_kernel/include) diff --git a/Circular_kernel_3/demo/Circular_kernel_3/CMakeLists.txt b/Circular_kernel_3/demo/Circular_kernel_3/CMakeLists.txt index 690ba9517c3..7b855adddbf 100644 --- a/Circular_kernel_3/demo/Circular_kernel_3/CMakeLists.txt +++ b/Circular_kernel_3/demo/Circular_kernel_3/CMakeLists.txt @@ -7,15 +7,11 @@ if(NOT POLICY CMP0070 AND POLICY CMP0053) endif() find_package(CGAL COMPONENTS Qt5) -include(${CGAL_USE_FILE}) find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL) if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND) - - include_directories (BEFORE ../../include ./ ) - add_executable (Circular_kernel_3 Circular_kernel_3.cpp Viewer.cpp ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) add_to_cached_list( CGAL_EXECUTABLE_TARGETS Circular_kernel_3 ) diff --git a/Circular_kernel_3/doc/Circular_kernel_3/CGAL/Algebraic_kernel_for_spheres_2_3.h b/Circular_kernel_3/doc/Circular_kernel_3/CGAL/Algebraic_kernel_for_spheres_2_3.h index 6867ba05ee6..55a6093a78e 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/CGAL/Algebraic_kernel_for_spheres_2_3.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/CGAL/Algebraic_kernel_for_spheres_2_3.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgSphericalKernel3AlgebraicClasses +\ingroup PkgCircularKernel3AlgebraicClasses \cgalModels `AlgebraicKernelForSpheres` diff --git a/Circular_kernel_3/doc/Circular_kernel_3/CGAL/Circle_type.h b/Circular_kernel_3/doc/Circular_kernel_3/CGAL/Circle_type.h index ac96f07d415..430446ebc00 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/CGAL/Circle_type.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/CGAL/Circle_type.h @@ -1,6 +1,6 @@ namespace CGAL { /*! - \ingroup PkgSphericalKernel3GeometricClasses + \ingroup PkgCircularKernel3GeometricClasses The enum `Circle_type` is used to classify an object of type `Circle_3`, so as to specify its type (normal,polar,bipolar or threaded), as defined in Section \ref sectionSKobjects. diff --git a/Circular_kernel_3/doc/Circular_kernel_3/CGAL/Circular_arc_3.h b/Circular_kernel_3/doc/Circular_kernel_3/CGAL/Circular_arc_3.h index eea28fb3796..ae81c8a30b1 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/CGAL/Circular_arc_3.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/CGAL/Circular_arc_3.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgSphericalKernel3GeometricClasses +\ingroup PkgCircularKernel3GeometricClasses \cgalModels `SphericalKernel::CircularArc_3` diff --git a/Circular_kernel_3/doc/Circular_kernel_3/CGAL/Circular_arc_point_3.h b/Circular_kernel_3/doc/Circular_kernel_3/CGAL/Circular_arc_point_3.h index dedfefdbf5a..aa1faa8a9cf 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/CGAL/Circular_arc_point_3.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/CGAL/Circular_arc_point_3.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgSphericalKernel3GeometricClasses +\ingroup PkgCircularKernel3GeometricClasses \cgalModels `SphericalKernel::CircularArcPoint_3` diff --git a/Circular_kernel_3/doc/Circular_kernel_3/CGAL/Exact_spherical_kernel_3.h b/Circular_kernel_3/doc/Circular_kernel_3/CGAL/Exact_spherical_kernel_3.h index e39620dc8bb..00159f6b404 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/CGAL/Exact_spherical_kernel_3.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/CGAL/Exact_spherical_kernel_3.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgSphericalKernel3GeometricClasses +\ingroup PkgCircularKernel3GeometricClasses A typedef to a spherical kernel that provides both exact geometric predicates and exact geometric constructions. diff --git a/Circular_kernel_3/doc/Circular_kernel_3/CGAL/Line_arc_3.h b/Circular_kernel_3/doc/Circular_kernel_3/CGAL/Line_arc_3.h index 52916046472..3173d76855a 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/CGAL/Line_arc_3.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/CGAL/Line_arc_3.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgSphericalKernel3GeometricClasses +\ingroup PkgCircularKernel3GeometricClasses \cgalModels `SphericalKernel::LineArc_3` diff --git a/Circular_kernel_3/doc/Circular_kernel_3/CGAL/Polynomials_1_3.h b/Circular_kernel_3/doc/Circular_kernel_3/CGAL/Polynomials_1_3.h index f476455d9eb..025200ba4c1 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/CGAL/Polynomials_1_3.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/CGAL/Polynomials_1_3.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgSphericalKernel3AlgebraicClasses +\ingroup PkgCircularKernel3AlgebraicClasses \cgalModels `AlgebraicKernelForSpheres::Polynomial_1_3` diff --git a/Circular_kernel_3/doc/Circular_kernel_3/CGAL/Polynomials_2_3.h b/Circular_kernel_3/doc/Circular_kernel_3/CGAL/Polynomials_2_3.h index 6410811b92d..5adf730a43a 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/CGAL/Polynomials_2_3.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/CGAL/Polynomials_2_3.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgSphericalKernel3AlgebraicClasses +\ingroup PkgCircularKernel3AlgebraicClasses \cgalModels `AlgebraicKernelForSpheres::PolynomialForSpheres_2_3` diff --git a/Circular_kernel_3/doc/Circular_kernel_3/CGAL/Polynomials_for_line_3.h b/Circular_kernel_3/doc/Circular_kernel_3/CGAL/Polynomials_for_line_3.h index 8987c2aa93c..3a8ad778710 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/CGAL/Polynomials_for_line_3.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/CGAL/Polynomials_for_line_3.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgSphericalKernel3AlgebraicClasses +\ingroup PkgCircularKernel3AlgebraicClasses \cgalModels `AlgebraicKernelForSpheres::PolynomialsForLines_3` diff --git a/Circular_kernel_3/doc/Circular_kernel_3/CGAL/Root_for_spheres_2_3.h b/Circular_kernel_3/doc/Circular_kernel_3/CGAL/Root_for_spheres_2_3.h index 3afdd451378..b73f031e5d1 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/CGAL/Root_for_spheres_2_3.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/CGAL/Root_for_spheres_2_3.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgSphericalKernel3AlgebraicClasses +\ingroup PkgCircularKernel3AlgebraicClasses \cgalModels `AlgebraicKernelForSpheres::RootForSpheres_2_3` diff --git a/Circular_kernel_3/doc/Circular_kernel_3/CGAL/Spherical_kernel_3.h b/Circular_kernel_3/doc/Circular_kernel_3/CGAL/Spherical_kernel_3.h index 21d92e1a274..3016c5a4035 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/CGAL/Spherical_kernel_3.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/CGAL/Spherical_kernel_3.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgSphericalKernel3GeometricClasses +\ingroup PkgCircularKernel3GeometricClasses \cgalModels `SphericalKernel` diff --git a/Circular_kernel_3/doc/Circular_kernel_3/CGAL/global_functions_spherical_kernel_3.h b/Circular_kernel_3/doc/Circular_kernel_3/CGAL/global_functions_spherical_kernel_3.h index f1f52278e26..b00e2b99e20 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/CGAL/global_functions_spherical_kernel_3.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/CGAL/global_functions_spherical_kernel_3.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgSphericalKernel3GeometricFunctions +\ingroup PkgCircularKernel3GeometricFunctions Classify a circle according to `sphere`, as defined in Section \ref sectionSKobjects. \pre `c` lies on `sphere`. @@ -18,7 +18,7 @@ classify(const CGAL::Circle_3 & c, const CGAL::Sphere_3 & p, const CGAL::Circular_arc_point_3 & q,const CGAL::Sphere_3& sphere); /*! -\ingroup PkgSphericalKernel3GeometricFunctions +\ingroup PkgCircularKernel3GeometricFunctions Compares the \f$ \theta\f$-coordinates of `p` and of the meridian defined by `m` (see Section \ref sectionSKobjects) @@ -61,7 +61,7 @@ Comparison_result compare_theta(const CGAL::Circular_arc_point_3 &p, const CGAL::Vector_3 &m, const CGAL::Sphere_3& sphere ); /*! -\ingroup PkgSphericalKernel3GeometricFunctions +\ingroup PkgCircularKernel3GeometricFunctions Compares the \f$ \theta\f$-coordinates of the meridian defined by `m` and of `p` (see Section \ref sectionSKobjects) in the cylindrical coordinate system relative to `sphere`. @@ -85,7 +85,7 @@ compare_theta(const CGAL::Vector_3 &m,const CGAL::Circular_arc_ namespace CGAL { /*! -\ingroup PkgSphericalKernel3GeometricFunctions +\ingroup PkgCircularKernel3GeometricFunctions Compares `p` and `q` according to the lexicographic ordering on \f$ \theta\f$ and \f$ z\f$-coordinates in the cylindrical coordinate system relative to `sphere`. @@ -111,7 +111,7 @@ const CGAL::Circular_arc_point_3 & q, const CGAL::Sphere_3 & a,const CGAL::Sp namespace CGAL { /*! -\ingroup PkgSphericalKernel3GeometricFunctions +\ingroup PkgCircularKernel3GeometricFunctions Returns the point on the circle that is extremal in \f$ \theta\f$ using the cylindrical coordinate system relative to `sphere`, and that has the smallest (resp.\ largest) @@ -147,7 +147,7 @@ theta_extremal_point(const CGAL::Circle_3 & c, const CGAL::Sphe namespace CGAL { /*! -\ingroup PkgSphericalKernel3GeometricFunctions +\ingroup PkgCircularKernel3GeometricFunctions Copies in the output iterator the \f$ \theta\f$-extremal points of the circle relatively to `sphere`. `res` iterates on elements of type @@ -167,7 +167,7 @@ OutputIterator res); namespace CGAL { /*! -\ingroup PkgSphericalKernel3GeometricFunctions +\ingroup PkgCircularKernel3GeometricFunctions Returns the point on the sphere that is extremal in the \f$ x\f$-direction, and that is the smallest (resp.\ largest) of the two @@ -179,7 +179,7 @@ CGAL::Circular_arc_point_3 x_extremal_point(const CGAL::Sphere_3 & c, bool b); /*! -\ingroup PkgSphericalKernel3GeometricFunctions +\ingroup PkgCircularKernel3GeometricFunctions Same for a circle. \pre The circle is not contained in a plane orthogonal to the \f$ x\f$-axis. @@ -193,7 +193,7 @@ x_extremal_point(const CGAL::Circle_3 & c, bool b); namespace CGAL { /*! -\ingroup PkgSphericalKernel3GeometricFunctions +\ingroup PkgCircularKernel3GeometricFunctions Copies in the output iterator the \f$ x\f$-extremal points of the sphere. `res` iterates on elements of type @@ -205,7 +205,7 @@ x_extremal_points(const CGAL::Sphere_3 & c, OutputIterator res); /*! -\ingroup PkgSphericalKernel3GeometricFunctions +\ingroup PkgCircularKernel3GeometricFunctions Copies in the output iterator the \f$ x\f$-extremal points of the circle. `res` iterates on elements of type @@ -223,7 +223,7 @@ OutputIterator res); namespace CGAL { /*! -\ingroup PkgSphericalKernel3GeometricFunctions +\ingroup PkgCircularKernel3GeometricFunctions Returns the point on the sphere that is extremal in the \f$ y\f$-direction, and that is the smallest (resp.\ largest) of the two @@ -235,7 +235,7 @@ CGAL::Circular_arc_point_3 y_extremal_point(const CGAL::Sphere_3 & c, bool b); /*! -\ingroup PkgSphericalKernel3GeometricFunctions +\ingroup PkgCircularKernel3GeometricFunctions Same for a circle. \pre The circle is not contained in a plane orthogonal to the \f$ y\f$-axis. @@ -249,7 +249,7 @@ y_extremal_point(const CGAL::Circle_3 & c, bool b); namespace CGAL { /*! -\ingroup PkgSphericalKernel3GeometricFunctions +\ingroup PkgCircularKernel3GeometricFunctions Copies in the output iterator the \f$ y\f$-extremal points of the sphere. `res` iterates on elements of type @@ -261,7 +261,7 @@ y_extremal_points(const CGAL::Sphere_3 & c, OutputIterator res); /*! -\ingroup PkgSphericalKernel3GeometricFunctions +\ingroup PkgCircularKernel3GeometricFunctions Copies in the output iterator the \f$ y\f$-extremal points of the circle. `res` iterates on elements of type @@ -279,7 +279,7 @@ OutputIterator res); namespace CGAL { /*! -\ingroup PkgSphericalKernel3GeometricFunctions +\ingroup PkgCircularKernel3GeometricFunctions Returns the point on the sphere that is extremal in the \f$ z\f$-direction, and that is the smallest (resp.\ largest) of the two @@ -291,7 +291,7 @@ CGAL::Circular_arc_point_3 z_extremal_point(const CGAL::Sphere_3 & c, bool b); /*! -\ingroup PkgSphericalKernel3GeometricFunctions +\ingroup PkgCircularKernel3GeometricFunctions Same for a circle. \pre The circle is not contained in a plane orthogonal to the \f$ z\f$-axis. @@ -305,7 +305,7 @@ z_extremal_point(const CGAL::Circle_3 & c, bool b); namespace CGAL { /*! -\ingroup PkgSphericalKernel3GeometricFunctions +\ingroup PkgCircularKernel3GeometricFunctions Copies in the output iterator the \f$ z\f$-extremal points of the sphere. `res` iterates on elements of type @@ -317,7 +317,7 @@ z_extremal_points(const CGAL::Sphere_3 & c, OutputIterator res); /*! -\ingroup PkgSphericalKernel3GeometricFunctions +\ingroup PkgCircularKernel3GeometricFunctions Copies in the output iterator the \f$ z\f$-extremal points of the circle. `res` iterates on elements of type diff --git a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--CompareX.h b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--CompareX.h index 7ef5402dc3e..cf9c804d733 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--CompareX.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--CompareX.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgSphericalKernel3AlgebraicConcepts +\ingroup PkgCircularKernel3AlgebraicConcepts \cgalConcept \sa `AlgebraicKernelForSpheres::CompareY` diff --git a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--CompareXY.h b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--CompareXY.h index 60cfffab7ed..98b452d668c 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--CompareXY.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--CompareXY.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgSphericalKernel3AlgebraicConcepts +\ingroup PkgCircularKernel3AlgebraicConcepts \cgalConcept \sa `AlgebraicKernelForSpheres::CompareX` diff --git a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--CompareXYZ.h b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--CompareXYZ.h index 92dd9bc52d7..171641cc56e 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--CompareXYZ.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--CompareXYZ.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgSphericalKernel3AlgebraicConcepts +\ingroup PkgCircularKernel3AlgebraicConcepts \cgalConcept \sa `AlgebraicKernelForSpheres::CompareX` diff --git a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--CompareY.h b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--CompareY.h index 2d8cb30cf48..ff2b9d9ad74 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--CompareY.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--CompareY.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgSphericalKernel3AlgebraicConcepts +\ingroup PkgCircularKernel3AlgebraicConcepts \cgalConcept \sa `AlgebraicKernelForSpheres::CompareX` diff --git a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--CompareZ.h b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--CompareZ.h index 2a2743f67c4..e30f42b9865 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--CompareZ.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--CompareZ.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgSphericalKernel3AlgebraicConcepts +\ingroup PkgCircularKernel3AlgebraicConcepts \cgalConcept \sa `AlgebraicKernelForSpheres::CompareX` diff --git a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--ConstructPolynomialForSpheres_2_3.h b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--ConstructPolynomialForSpheres_2_3.h index 73517c1da08..074003ddad0 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--ConstructPolynomialForSpheres_2_3.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--ConstructPolynomialForSpheres_2_3.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgSphericalKernel3AlgebraicConcepts +\ingroup PkgCircularKernel3AlgebraicConcepts \cgalConcept \sa `SphericalKernel::ConstructSphere_3` diff --git a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--ConstructPolynomial_1_3.h b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--ConstructPolynomial_1_3.h index 1860c7088d5..66a7c953651 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--ConstructPolynomial_1_3.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--ConstructPolynomial_1_3.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgSphericalKernel3AlgebraicConcepts +\ingroup PkgCircularKernel3AlgebraicConcepts \cgalConcept \sa `SphericalKernel::ConstructPlane_3` diff --git a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--ConstructPolynomialsForLines_3.h b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--ConstructPolynomialsForLines_3.h index 766c1fa5833..9743e9eeb6b 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--ConstructPolynomialsForLines_3.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--ConstructPolynomialsForLines_3.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgSphericalKernel3AlgebraicConcepts +\ingroup PkgCircularKernel3AlgebraicConcepts \cgalConcept \sa `SphericalKernel::ConstructLine_3` diff --git a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--PolynomialForSpheres_2_3.h b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--PolynomialForSpheres_2_3.h index 9a41be9e609..6021e6ef0fa 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--PolynomialForSpheres_2_3.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--PolynomialForSpheres_2_3.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgSphericalKernel3AlgebraicConcepts +\ingroup PkgCircularKernel3AlgebraicConcepts \cgalConcept Concept to represent diff --git a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--Polynomial_1_3.h b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--Polynomial_1_3.h index 3d1de1a9e94..9401c645852 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--Polynomial_1_3.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--Polynomial_1_3.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgSphericalKernel3AlgebraicConcepts +\ingroup PkgCircularKernel3AlgebraicConcepts \cgalConcept Concept to represent trivariate polynomials of degree 1 whose diff --git a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--PolynomialsForCircles_3.h b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--PolynomialsForCircles_3.h index 1126a869bf9..a06bca51ecc 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--PolynomialsForCircles_3.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--PolynomialsForCircles_3.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgSphericalKernel3AlgebraicConcepts +\ingroup PkgCircularKernel3AlgebraicConcepts \cgalConcept Concept to represent a system of polynomials on `FieldNumberType` diff --git a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--PolynomialsForLines_3.h b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--PolynomialsForLines_3.h index 11da317d7c8..7f2a474f25e 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--PolynomialsForLines_3.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--PolynomialsForLines_3.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgSphericalKernel3AlgebraicConcepts +\ingroup PkgCircularKernel3AlgebraicConcepts \cgalConcept Concept to represent a system of polynomials on `FieldNumberType` diff --git a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--RootForSpheres_2_3.h b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--RootForSpheres_2_3.h index da3556e3fe8..0e76a7fd05d 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--RootForSpheres_2_3.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--RootForSpheres_2_3.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgSphericalKernel3AlgebraicConcepts +\ingroup PkgCircularKernel3AlgebraicConcepts \cgalConcept Concept to represent the roots of a system of three equations of degree 2 diff --git a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--SignAt.h b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--SignAt.h index e447c16569e..91a6d0ff7ab 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--SignAt.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--SignAt.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgSphericalKernel3AlgebraicConcepts +\ingroup PkgCircularKernel3AlgebraicConcepts \cgalConcept */ diff --git a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--Solve.h b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--Solve.h index 6c2cab02d7b..b4d8cc88a62 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--Solve.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--Solve.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgSphericalKernel3AlgebraicConcepts +\ingroup PkgCircularKernel3AlgebraicConcepts \cgalConcept */ diff --git a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--XCriticalPoints.h b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--XCriticalPoints.h index c1ec1bf7e91..449634f1758 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--XCriticalPoints.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--XCriticalPoints.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgSphericalKernel3AlgebraicConcepts +\ingroup PkgCircularKernel3AlgebraicConcepts \cgalConcept \sa `AlgebraicKernelForSpheres::YCriticalPoints` diff --git a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--YCriticalPoints.h b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--YCriticalPoints.h index 8201c661c4d..225b8d6032c 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--YCriticalPoints.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--YCriticalPoints.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgSphericalKernel3AlgebraicConcepts +\ingroup PkgCircularKernel3AlgebraicConcepts \cgalConcept \sa `AlgebraicKernelForSpheres::XCriticalPoints` diff --git a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--ZCriticalPoints.h b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--ZCriticalPoints.h index 68e5e99971f..45ba56ce839 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--ZCriticalPoints.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres--ZCriticalPoints.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgSphericalKernel3AlgebraicConcepts +\ingroup PkgCircularKernel3AlgebraicConcepts \cgalConcept \sa `AlgebraicKernelForSpheres::XCriticalPoints` diff --git a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres.h b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres.h index 9d891eed1db..b07d5a7a7c3 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/AlgebraicKernelForSpheres.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgSphericalKernel3AlgebraicConcepts +\ingroup PkgCircularKernel3AlgebraicConcepts \cgalConcept The `AlgebraicKernelForSpheres` concept is meant to provide the diff --git a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--BoundedSide_3.h b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--BoundedSide_3.h index 5a427f81ad4..1229ea46042 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--BoundedSide_3.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--BoundedSide_3.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgSphericalKernel3GeometricConcepts +\ingroup PkgCircularKernel3GeometricConcepts \cgalConcept \brief diff --git a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--CircularArcPoint_3.h b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--CircularArcPoint_3.h index c1727d5ce3b..6cab8d00438 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--CircularArcPoint_3.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--CircularArcPoint_3.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgSphericalKernel3GeometricConcepts +\ingroup PkgCircularKernel3GeometricConcepts \cgalConcept Concept for points on spheres, circles, circular arcs or line arcs. diff --git a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--CircularArc_3.h b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--CircularArc_3.h index 365d734af94..913e3383742 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--CircularArc_3.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--CircularArc_3.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgSphericalKernel3GeometricConcepts +\ingroup PkgCircularKernel3GeometricConcepts \cgalConcept Concept for arcs of circles. diff --git a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--CompareThetaZ_3.h b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--CompareThetaZ_3.h index 177382b53d2..27f341e6296 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--CompareThetaZ_3.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--CompareThetaZ_3.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgSphericalKernel3GeometricConcepts +\ingroup PkgCircularKernel3GeometricConcepts \cgalConcept diff --git a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--CompareTheta_3.h b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--CompareTheta_3.h index c89f57589bf..07044092c83 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--CompareTheta_3.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--CompareTheta_3.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgSphericalKernel3GeometricConcepts +\ingroup PkgCircularKernel3GeometricConcepts \cgalConcept diff --git a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--CompareXYZ_3.h b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--CompareXYZ_3.h index f591957d31e..95421dbdf9e 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--CompareXYZ_3.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--CompareXYZ_3.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgSphericalKernel3GeometricConcepts +\ingroup PkgCircularKernel3GeometricConcepts \cgalConcept \cgalRefines `Kernel::CompareXYZ_3` diff --git a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--CompareXY_3.h b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--CompareXY_3.h index 857a9f1e6ff..99d384efd69 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--CompareXY_3.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--CompareXY_3.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgSphericalKernel3GeometricConcepts +\ingroup PkgCircularKernel3GeometricConcepts \cgalConcept \brief diff --git a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--CompareX_3.h b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--CompareX_3.h index 596965a20aa..9f71286a30b 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--CompareX_3.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--CompareX_3.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgSphericalKernel3GeometricConcepts +\ingroup PkgCircularKernel3GeometricConcepts \cgalConcept \brief diff --git a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--CompareY_3.h b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--CompareY_3.h index df7e7ee7c1e..09dfffb0b17 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--CompareY_3.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--CompareY_3.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgSphericalKernel3GeometricConcepts +\ingroup PkgCircularKernel3GeometricConcepts \cgalConcept \brief diff --git a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--CompareZAtTheta_3.h b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--CompareZAtTheta_3.h index d7eabaf9662..bbdf4dda764 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--CompareZAtTheta_3.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--CompareZAtTheta_3.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgSphericalKernel3GeometricConcepts +\ingroup PkgCircularKernel3GeometricConcepts \cgalConcept \sa `SphericalKernel::CompareZToRight_3` diff --git a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--CompareZToRight_3.h b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--CompareZToRight_3.h index afa30a84101..788af2c00a5 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--CompareZToRight_3.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--CompareZToRight_3.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgSphericalKernel3GeometricConcepts +\ingroup PkgCircularKernel3GeometricConcepts \cgalConcept diff --git a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--CompareZ_3.h b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--CompareZ_3.h index 231e08d4e58..3e6726d5bf3 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--CompareZ_3.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--CompareZ_3.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgSphericalKernel3GeometricConcepts +\ingroup PkgCircularKernel3GeometricConcepts \cgalConcept \cgalRefines `Kernel::CompareZ_3` diff --git a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ComputeApproximateAngle_3.h b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ComputeApproximateAngle_3.h index 9d1616784fe..b5ffc5fae0d 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ComputeApproximateAngle_3.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ComputeApproximateAngle_3.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgSphericalKernel3GeometricConcepts +\ingroup PkgCircularKernel3GeometricConcepts \cgalConcept */ diff --git a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ComputeApproximateSquaredLength_3.h b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ComputeApproximateSquaredLength_3.h index 10790dfe157..6c7cdd07d11 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ComputeApproximateSquaredLength_3.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ComputeApproximateSquaredLength_3.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgSphericalKernel3GeometricConcepts +\ingroup PkgCircularKernel3GeometricConcepts \cgalConcept \cgalRefines `Kernel::ComputeApproximateSquaredLength_3` diff --git a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ComputeCircularX_3.h b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ComputeCircularX_3.h index 1066b75b12f..2d52c075a4b 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ComputeCircularX_3.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ComputeCircularX_3.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgSphericalKernel3GeometricConcepts +\ingroup PkgCircularKernel3GeometricConcepts \cgalConcept */ diff --git a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ComputeCircularY_3.h b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ComputeCircularY_3.h index cd7832e5945..ffde6e295ba 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ComputeCircularY_3.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ComputeCircularY_3.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgSphericalKernel3GeometricConcepts +\ingroup PkgCircularKernel3GeometricConcepts \cgalConcept */ class SphericalKernel::ComputeCircularY_3 { diff --git a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ComputeCircularZ_3.h b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ComputeCircularZ_3.h index 980b4fa459a..1c17649edb6 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ComputeCircularZ_3.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ComputeCircularZ_3.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgSphericalKernel3GeometricConcepts +\ingroup PkgCircularKernel3GeometricConcepts \cgalConcept */ diff --git a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ConstructBbox_3.h b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ConstructBbox_3.h index 4b8973145b1..a2e9ee38d3d 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ConstructBbox_3.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ConstructBbox_3.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgSphericalKernel3GeometricConcepts +\ingroup PkgCircularKernel3GeometricConcepts \cgalConcept \cgalRefines Kernel::ConstructBbox_3 diff --git a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ConstructCircle_3.h b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ConstructCircle_3.h index 971ee15a6c7..4b3359d8fbe 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ConstructCircle_3.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ConstructCircle_3.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgSphericalKernel3GeometricConcepts +\ingroup PkgCircularKernel3GeometricConcepts \cgalConcept \sa `SphericalKernel::GetEquation` diff --git a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ConstructCircularArcPoint_3.h b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ConstructCircularArcPoint_3.h index 199e8642715..760bc6d7e0b 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ConstructCircularArcPoint_3.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ConstructCircularArcPoint_3.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgSphericalKernel3GeometricConcepts +\ingroup PkgCircularKernel3GeometricConcepts \cgalConcept */ diff --git a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ConstructCircularArc_3.h b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ConstructCircularArc_3.h index a98395e59ff..44b8c1fa74f 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ConstructCircularArc_3.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ConstructCircularArc_3.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgSphericalKernel3GeometricConcepts +\ingroup PkgCircularKernel3GeometricConcepts \cgalConcept The circular arc constructed from a circle, a source, and a target, is diff --git a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ConstructCircularMaxVertex_3.h b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ConstructCircularMaxVertex_3.h index 19a9ed9cdfb..0c4676e8718 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ConstructCircularMaxVertex_3.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ConstructCircularMaxVertex_3.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgSphericalKernel3GeometricConcepts +\ingroup PkgCircularKernel3GeometricConcepts \cgalConcept */ diff --git a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ConstructCircularMinVertex_3.h b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ConstructCircularMinVertex_3.h index ff0685de062..bd57fb767fb 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ConstructCircularMinVertex_3.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ConstructCircularMinVertex_3.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgSphericalKernel3GeometricConcepts +\ingroup PkgCircularKernel3GeometricConcepts \cgalConcept */ diff --git a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ConstructCircularSourceVertex_3.h b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ConstructCircularSourceVertex_3.h index 8bad0d7b5a4..e0d9ef7c0f9 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ConstructCircularSourceVertex_3.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ConstructCircularSourceVertex_3.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgSphericalKernel3GeometricConcepts +\ingroup PkgCircularKernel3GeometricConcepts \cgalConcept */ diff --git a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ConstructCircularTargetVertex_3.h b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ConstructCircularTargetVertex_3.h index f200f4ef213..c702d99b7dd 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ConstructCircularTargetVertex_3.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ConstructCircularTargetVertex_3.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgSphericalKernel3GeometricConcepts +\ingroup PkgCircularKernel3GeometricConcepts \cgalConcept */ diff --git a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ConstructLineArc_3.h b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ConstructLineArc_3.h index 2f9e57de6ba..6f6d37714ef 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ConstructLineArc_3.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ConstructLineArc_3.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgSphericalKernel3GeometricConcepts +\ingroup PkgCircularKernel3GeometricConcepts \cgalConcept */ diff --git a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ConstructLine_3.h b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ConstructLine_3.h index 76773ae40b1..27f72c8a0c0 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ConstructLine_3.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ConstructLine_3.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgSphericalKernel3GeometricConcepts +\ingroup PkgCircularKernel3GeometricConcepts \cgalConcept \brief diff --git a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ConstructPlane_3.h b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ConstructPlane_3.h index 1b955bf1428..de3af6123cf 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ConstructPlane_3.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ConstructPlane_3.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgSphericalKernel3GeometricConcepts +\ingroup PkgCircularKernel3GeometricConcepts \cgalConcept \brief diff --git a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ConstructSphere_3.h b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ConstructSphere_3.h index ff91610bac5..f6847e012c4 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ConstructSphere_3.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--ConstructSphere_3.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgSphericalKernel3GeometricConcepts +\ingroup PkgCircularKernel3GeometricConcepts \cgalConcept \brief diff --git a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--DoIntersect_3.h b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--DoIntersect_3.h index 8ec36e83a99..d90877d8b9a 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--DoIntersect_3.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--DoIntersect_3.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgSphericalKernel3GeometricConcepts +\ingroup PkgCircularKernel3GeometricConcepts \cgalConcept \brief Testing whether two curves or surfaces intersect. diff --git a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--DoOverlap_3.h b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--DoOverlap_3.h index a09666706b3..d74b68decb7 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--DoOverlap_3.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--DoOverlap_3.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgSphericalKernel3GeometricConcepts +\ingroup PkgCircularKernel3GeometricConcepts \cgalConcept */ diff --git a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--Equal_3.h b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--Equal_3.h index d2ee772abde..6daed207135 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--Equal_3.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--Equal_3.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgSphericalKernel3GeometricConcepts +\ingroup PkgCircularKernel3GeometricConcepts \cgalConcept Testing equality between objects. diff --git a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--GetEquation.h b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--GetEquation.h index 4d28619e57e..9cdf8c27ddb 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--GetEquation.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--GetEquation.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgSphericalKernel3GeometricConcepts +\ingroup PkgCircularKernel3GeometricConcepts \cgalConcept diff --git a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--HasOnBoundedSide_3.h b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--HasOnBoundedSide_3.h index 89edee1e7ba..0f35abc8fa4 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--HasOnBoundedSide_3.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--HasOnBoundedSide_3.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgSphericalKernel3GeometricConcepts +\ingroup PkgCircularKernel3GeometricConcepts \cgalConcept \brief diff --git a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--HasOnUnboundedSide_3.h b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--HasOnUnboundedSide_3.h index 01b8fb9b7a1..2bc7a836d1a 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--HasOnUnboundedSide_3.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--HasOnUnboundedSide_3.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgSphericalKernel3GeometricConcepts +\ingroup PkgCircularKernel3GeometricConcepts \cgalConcept \brief diff --git a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--HasOn_3.h b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--HasOn_3.h index bf306400dc9..dd48967e7e2 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--HasOn_3.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--HasOn_3.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgSphericalKernel3GeometricConcepts +\ingroup PkgCircularKernel3GeometricConcepts \cgalConcept \cgalRefines `Kernel::HasOn_3` diff --git a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--Intersect_3.h b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--Intersect_3.h index e46e60c80dc..ccd903ef013 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--Intersect_3.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--Intersect_3.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgSphericalKernel3GeometricConcepts +\ingroup PkgCircularKernel3GeometricConcepts \cgalConcept \cgalRefines `Kernel::Intersect_3` diff --git a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--IsThetaMonotone_3.h b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--IsThetaMonotone_3.h index de3a4f5d298..3727037a315 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--IsThetaMonotone_3.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--IsThetaMonotone_3.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgSphericalKernel3GeometricConcepts +\ingroup PkgCircularKernel3GeometricConcepts \cgalConcept diff --git a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--LineArc_3.h b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--LineArc_3.h index 31dd3bae744..238d4b30d76 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--LineArc_3.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--LineArc_3.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgSphericalKernel3GeometricConcepts +\ingroup PkgCircularKernel3GeometricConcepts \cgalConcept Concept for line segments supported by a line that is a model of diff --git a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--MakeThetaMonotone_3.h b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--MakeThetaMonotone_3.h index fe16e37902f..36cb2e929b9 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--MakeThetaMonotone_3.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--MakeThetaMonotone_3.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgSphericalKernel3GeometricConcepts +\ingroup PkgCircularKernel3GeometricConcepts \cgalConcept diff --git a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--Split_3.h b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--Split_3.h index 64d37b00258..4fb8b3d0238 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--Split_3.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel--Split_3.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgSphericalKernel3GeometricConcepts +\ingroup PkgCircularKernel3GeometricConcepts \cgalConcept */ diff --git a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel.h b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel.h index 531abd4088d..6e76b59bc3a 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel.h +++ b/Circular_kernel_3/doc/Circular_kernel_3/Concepts/SphericalKernel.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgSphericalKernel3GeometricConcepts +\ingroup PkgCircularKernel3GeometricConcepts \cgalConcept \cgalRefines `Kernel` diff --git a/Circular_kernel_3/doc/Circular_kernel_3/PackageDescription.txt b/Circular_kernel_3/doc/Circular_kernel_3/PackageDescription.txt index 5b04d8f987e..26b34fec208 100644 --- a/Circular_kernel_3/doc/Circular_kernel_3/PackageDescription.txt +++ b/Circular_kernel_3/doc/Circular_kernel_3/PackageDescription.txt @@ -1,31 +1,31 @@ -/// \defgroup PkgSphericalKernel3 3D Spherical Geometry Kernel Reference +/// \defgroup PkgCircularKernel3Ref 3D Spherical Geometry Kernel Reference -/// \defgroup PkgSphericalKernel3GeometricConcepts Geometric Concepts -/// \ingroup PkgSphericalKernel3 +/// \defgroup PkgCircularKernel3GeometricConcepts Geometric Concepts +/// \ingroup PkgCircularKernel3Ref -/// \defgroup PkgSphericalKernel3GeometricClasses Geometric Kernel and Classes -/// \ingroup PkgSphericalKernel3 +/// \defgroup PkgCircularKernel3GeometricClasses Geometric Kernel and Classes +/// \ingroup PkgCircularKernel3Ref -/// \defgroup PkgSphericalKernel3GeometricFunctions Geometric Global Functions -/// \ingroup PkgSphericalKernel3 +/// \defgroup PkgCircularKernel3GeometricFunctions Geometric Global Functions +/// \ingroup PkgCircularKernel3Ref -/// \defgroup PkgSphericalKernel3AlgebraicConcepts Algebraic Concepts -/// \ingroup PkgSphericalKernel3 +/// \defgroup PkgCircularKernel3AlgebraicConcepts Algebraic Concepts +/// \ingroup PkgCircularKernel3Ref -/// \defgroup PkgSphericalKernel3AlgebraicClasses Algebraic Kernel and Classes -/// \ingroup PkgSphericalKernel3 +/// \defgroup PkgCircularKernel3AlgebraicClasses Algebraic Kernel and Classes +/// \ingroup PkgCircularKernel3Ref /*! -\addtogroup PkgSphericalKernel3 -\cgalPkgDescriptionBegin{3D Spherical Geometry Kernel,PkgSphericalKernel3Summary} +\addtogroup PkgCircularKernel3Ref +\cgalPkgDescriptionBegin{3D Spherical Geometry Kernel,PkgCircularKernel3} \cgalPkgPicture{segment_sphere_intersection_detail.png} \cgalPkgSummaryBegin \cgalPkgAuthors{Pedro Machado Manhães de Castro, Frédéric Cazals, Sébastien Loriot, and Monique Teillaud} \cgalPkgDesc{This package is an extension of the linear \cgal %Kernel. It offers functionalities on spheres, circles, circular arcs and line segments, in the 3D space or restricted on a reference sphere.} -\cgalPkgManuals{Chapter_3D_Spherical_Geometry_Kernel,PkgSphericalKernel3} +\cgalPkgManuals{Chapter_3D_Spherical_Geometry_Kernel,PkgCircularKernel3Ref} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{3.4} diff --git a/Circular_kernel_3/examples/Circular_kernel_3/CMakeLists.txt b/Circular_kernel_3/examples/Circular_kernel_3/CMakeLists.txt index becd480281e..fceddecd46a 100644 --- a/Circular_kernel_3/examples/Circular_kernel_3/CMakeLists.txt +++ b/Circular_kernel_3/examples/Circular_kernel_3/CMakeLists.txt @@ -4,18 +4,12 @@ project( Circular_kernel_3_Examples ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Circular_kernel_3/test/Circular_kernel_3/CMakeLists.txt b/Circular_kernel_3/test/Circular_kernel_3/CMakeLists.txt index 02e799605db..3b4c24caaa8 100644 --- a/Circular_kernel_3/test/Circular_kernel_3/CMakeLists.txt +++ b/Circular_kernel_3/test/Circular_kernel_3/CMakeLists.txt @@ -4,18 +4,15 @@ project( Circular_kernel_3_Tests ) -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11) +CMAKE_MINIMUM_REQUIRED(VERSION 3.1) find_package(CGAL QUIET COMPONENTS Core ) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) +include(${CGAL_USE_FILE}) include_directories (BEFORE include) -include_directories (BEFORE ../../include) include_directories (BEFORE ../../../Kernel_23/test/Kernel_23/include) include_directories (BEFORE ../Kernel_23/include) include_directories (BEFORE ../Cartesian_kernel/include) diff --git a/Circulator/doc/Circulator/CGAL/circulator.h b/Circulator/doc/Circulator/CGAL/circulator.h index d081d150af8..7a8cb8551ba 100644 --- a/Circulator/doc/Circulator/CGAL/circulator.h +++ b/Circulator/doc/Circulator/CGAL/circulator.h @@ -295,7 +295,7 @@ template C::size_type circulator_size(C c); namespace CGAL { /*! -\ingroup PkgHandlesAndCirculators +\ingroup PkgHandlesAndCirculatorsRef The circulator traits class distinguishes between circulators and iterators. It defines a local type `category` that is identical to the diff --git a/Circulator/doc/Circulator/PackageDescription.txt b/Circulator/doc/Circulator/PackageDescription.txt index f9141bf7c52..2b781abd240 100644 --- a/Circulator/doc/Circulator/PackageDescription.txt +++ b/Circulator/doc/Circulator/PackageDescription.txt @@ -1,33 +1,33 @@ -/// \defgroup PkgHandlesAndCirculators Handles and Circulators Reference +/// \defgroup PkgHandlesAndCirculatorsRef Handles and Circulators Reference /// \defgroup PkgHandlesAndCirculatorsConcepts Concepts -/// \ingroup PkgHandlesAndCirculators +/// \ingroup PkgHandlesAndCirculatorsRef /// \defgroup PkgHandlesAndCirculatorsAdapter Adapters for Iterators and Containers -/// \ingroup PkgHandlesAndCirculators +/// \ingroup PkgHandlesAndCirculatorsRef /// \defgroup PkgHandlesAndCirculatorsFunctions Functions -/// \ingroup PkgHandlesAndCirculators +/// \ingroup PkgHandlesAndCirculatorsRef /// \defgroup PkgHandlesAndCirculatorsTags Compile Time Tags -/// \ingroup PkgHandlesAndCirculators +/// \ingroup PkgHandlesAndCirculatorsRef /// \defgroup PkgHandlesAndCirculatorsAssert Assertions -/// \ingroup PkgHandlesAndCirculators +/// \ingroup PkgHandlesAndCirculatorsRef /// \defgroup PkgHandlesAndCirculatorsBaseClasses Base Classes -/// \ingroup PkgHandlesAndCirculators +/// \ingroup PkgHandlesAndCirculatorsRef /*! -\addtogroup PkgHandlesAndCirculators -\cgalPkgDescriptionBegin{Handles and Circulators,PkgHandlesAndCirculatorsSummary} +\addtogroup PkgHandlesAndCirculatorsRef +\cgalPkgDescriptionBegin{Handles and Circulators,PkgHandlesAndCirculators} \cgalPkgPicture{circulator.png} \cgalPkgSummaryBegin \cgalPkgAuthors{Olivier Devillers, Lutz Kettner, Sylvain Pion, Michael Seel, and Mariette Yvinec} \cgalPkgDesc{This package descibes handles and circulators. They are related to iterators. Handles allow to dereference but neither to increment nor to decrement. Circulators have no notion of past-the-end, and they are used in \cgal whenever we have cyclic stuctures. } -\cgalPkgManuals{Chapter_Handles_Ranges_and_Circulators,PkgHandlesAndCirculators} +\cgalPkgManuals{Chapter_Handles_Ranges_and_Circulators,PkgHandlesAndCirculatorsRef} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{1.0} diff --git a/Circulator/examples/Circulator/CMakeLists.txt b/Circulator/examples/Circulator/CMakeLists.txt index 1f38ed5bfd4..25ebaaa3029 100644 --- a/Circulator/examples/Circulator/CMakeLists.txt +++ b/Circulator/examples/Circulator/CMakeLists.txt @@ -4,18 +4,12 @@ project( Circulator_Examples ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Circulator/test/Circulator/CMakeLists.txt b/Circulator/test/Circulator/CMakeLists.txt index 64c2826e792..330c0553644 100644 --- a/Circulator/test/Circulator/CMakeLists.txt +++ b/Circulator/test/Circulator/CMakeLists.txt @@ -4,18 +4,12 @@ project( Circulator_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Classification/doc/Classification/PackageDescription.txt b/Classification/doc/Classification/PackageDescription.txt index 28404554d77..b1a3dafe536 100644 --- a/Classification/doc/Classification/PackageDescription.txt +++ b/Classification/doc/Classification/PackageDescription.txt @@ -1,68 +1,68 @@ /*! -\defgroup PkgClassification Classification Reference +\defgroup PkgClassificationRef Classification Reference \defgroup PkgClassificationConcepts Concepts -\ingroup PkgClassification +\ingroup PkgClassificationRef \defgroup PkgClassificationMain Main Functions -\ingroup PkgClassification +\ingroup PkgClassificationRef Functions that perform classification based on a set of labels and a classifier, with or without regularization. \defgroup PkgClassificationClassifiers Classifiers -\ingroup PkgClassification +\ingroup PkgClassificationRef Classifiers are functors that, given a label set and an input item, associate this input item with an energy for each label. This energy measures the likelihood of the item to belong to this label. \defgroup PkgClassificationDataStructures Common Data Structures -\ingroup PkgClassification +\ingroup PkgClassificationRef Useful data structures that are used to compute features (computation of eigenvalues, for example). \defgroup PkgClassificationLabel Label -\ingroup PkgClassification +\ingroup PkgClassificationRef A label represents how an item should be classified, for example: _vegetation_, _building_, _road_, etc. \defgroup PkgClassificationFeature Feature -\ingroup PkgClassification +\ingroup PkgClassificationRef Features are defined as scalar fields that associates each input item with a specific value. \defgroup PkgClassificationFeatures Predefined Features -\ingroup PkgClassification +\ingroup PkgClassificationRef \cgal provides some predefined features that are relevant for classification of point sets. \defgroup PkgClassificationPointSet Point Set Classification -\ingroup PkgClassification +\ingroup PkgClassificationRef Data structures specialized to classify point sets. \defgroup PkgClassificationMesh Mesh Classification -\ingroup PkgClassification +\ingroup PkgClassificationRef Data structures specialized to classify surface meshes. \defgroup PkgClassificationCluster Cluster Classification -\ingroup PkgClassification +\ingroup PkgClassificationRef Data structures specialized to classify clusters. -\addtogroup PkgClassification +\addtogroup PkgClassificationRef -\cgalPkgDescriptionBegin{Classification, PkgClassificationSummary} +\cgalPkgDescriptionBegin{Classification, PkgClassification} \cgalPkgPicture{data_classif.png} \cgalPkgSummaryBegin \cgalPkgAuthors{Simon Giraudot, Florent Lafarge} \cgalPkgDesc{This component implements an algorithm that classifies a data set into a user-defined set of labels (such as ground, vegetation, buildings, etc.). A flexible API is provided so that users can classify any type of data, compute their own local features on the input data set, and define their own labels.} -\cgalPkgManuals{Chapter_Classification, PkgClassification} +\cgalPkgManuals{Chapter_Classification, PkgClassificationRef} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{4.12} -\cgalPkgDependsOn{\ref PkgSolverSummary, \ref PkgSpatialSearchingDSummary, [Boost Serialization](http://www.boost.org/libs/serialization) and +\cgalPkgDependsOn{\ref PkgSolverInterface, \ref PkgSpatialSearchingD, [Boost Serialization](http://www.boost.org/libs/serialization) and [Boost IO Streams](http://www.boost.org/libs/iostreams)} \cgalPkgBib{cgal:lm-clscm-12} \cgalPkgLicense{\ref licensesGPL "GPL"} diff --git a/Classification/examples/Classification/CMakeLists.txt b/Classification/examples/Classification/CMakeLists.txt index 5789622899a..392d1708e5c 100644 --- a/Classification/examples/Classification/CMakeLists.txt +++ b/Classification/examples/Classification/CMakeLists.txt @@ -4,7 +4,7 @@ project( Classification_Examples ) -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.1) # CGAL and its components find_package( CGAL QUIET COMPONENTS ) @@ -14,10 +14,6 @@ if ( NOT CGAL_FOUND ) return() endif() -# include helper file -include( ${CGAL_USE_FILE} ) - - # Boost and its components find_package( Boost REQUIRED ) @@ -53,14 +49,10 @@ endif() include_directories( BEFORE include ) # include for local package -include_directories( BEFORE ../../include ) - # Creating entries for all C++ files with "main" routine # ########################################################## -include( CGAL_CreateSingleSourceCGALProgram ) - # Classification examples set(targets example_classification @@ -78,15 +70,6 @@ set(classification_linked_libraries) set(classification_compile_definitions) -# Use Eigen or BLAS and LAPACK (optional) -find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) -if (EIGEN3_FOUND) - include( ${EIGEN3_USE_FILE} ) -else() - message(STATUS "NOTICE: This project requires the Eigen library, and will not be compiled.") - return() -endif() - if (Boost_SERIALIZATION_FOUND AND Boost_IOSTREAMS_FOUND) set(classification_linked_libraries ${classification_linked_libraries} ${Boost_SERIALIZATION_LIBRARY} diff --git a/Classification/examples/Classification/data/b9_clusters_config.gz b/Classification/examples/Classification/data/b9_clusters_config.gz index 7185b55279d..8d1303c1ad0 100644 Binary files a/Classification/examples/Classification/data/b9_clusters_config.gz and b/Classification/examples/Classification/data/b9_clusters_config.gz differ diff --git a/Classification/examples/Classification/data/b9_mesh_config.gz b/Classification/examples/Classification/data/b9_mesh_config.gz index 5f96308d7ce..07af3e3496b 100644 Binary files a/Classification/examples/Classification/data/b9_mesh_config.gz and b/Classification/examples/Classification/data/b9_mesh_config.gz differ diff --git a/Classification/include/CGAL/Classification/Planimetric_grid.h b/Classification/include/CGAL/Classification/Planimetric_grid.h index 8339864ba53..33e0d141928 100644 --- a/Classification/include/CGAL/Classification/Planimetric_grid.h +++ b/Classification/include/CGAL/Classification/Planimetric_grid.h @@ -28,6 +28,8 @@ #include +#include + #include #include diff --git a/Classification/include/CGAL/Classification/internal/auxiliary/random-forest/node.hpp b/Classification/include/CGAL/Classification/internal/auxiliary/random-forest/node.hpp index 00e86323f84..9e02ed11400 100644 --- a/Classification/include/CGAL/Classification/internal/auxiliary/random-forest/node.hpp +++ b/Classification/include/CGAL/Classification/internal/auxiliary/random-forest/node.hpp @@ -28,6 +28,8 @@ // * changed inclusion protection tag // * moved to namespace CGAL::internal:: // * fix computation of node_dist[label] so that results are always <= 1.0 +// * change serialization functions to avoid a bug with boost and some +// compilers (that leads to dereferencing a null pointer) #ifndef CGAL_INTERNAL_LIBLEARNING_RANDOMFORESTS_NODE_H #define CGAL_INTERNAL_LIBLEARNING_RANDOMFORESTS_NODE_H @@ -249,8 +251,11 @@ public: ar & BOOST_SERIALIZATION_NVP(params); ar & BOOST_SERIALIZATION_NVP(splitter); ar & BOOST_SERIALIZATION_NVP(node_dist); - ar & BOOST_SERIALIZATION_NVP(left); - ar & BOOST_SERIALIZATION_NVP(right); + if (!is_leaf) + { + ar & BOOST_SERIALIZATION_NVP(left); + ar & BOOST_SERIALIZATION_NVP(right); + } } }; diff --git a/Classification/test/Classification/CMakeLists.txt b/Classification/test/Classification/CMakeLists.txt index 845522e5213..fd5d89785b2 100644 --- a/Classification/test/Classification/CMakeLists.txt +++ b/Classification/test/Classification/CMakeLists.txt @@ -4,7 +4,7 @@ project( Classification_Tests ) -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.1) # CGAL and its components find_package( CGAL QUIET COMPONENTS ) @@ -16,10 +16,6 @@ if ( NOT CGAL_FOUND ) endif() -# include helper file -include( ${CGAL_USE_FILE} ) - - # Boost and its components find_package( Boost REQUIRED ) @@ -49,14 +45,10 @@ find_package( TBB ) include_directories( BEFORE include ) # include for local package -include_directories( BEFORE ../../include ) - # Creating entries for all C++ files with "main" routine # ########################################################## -include( CGAL_CreateSingleSourceCGALProgram ) - #add_definitions("-DCGAL_DO_NOT_USE_BOYKOV_KOLMOGOROV_MAXFLOW_SOFTWARE") # Classification requires some C++11 features @@ -104,3 +96,11 @@ if(TARGET deprecated_test_classification_point_set) CGAL_target_use_TBB( deprecated_test_classification_point_set ) endif() endif() + +create_single_source_cgal_program( "test_classification_io.cpp" CXX_FEATURES ${needed_cxx_features} ) +if(TARGET test_classification_io) + target_link_libraries(test_classification_io PUBLIC ${classification_linked_libraries}) + if (TBB_FOUND) + CGAL_target_use_TBB( test_classification_io ) + endif() +endif() diff --git a/Classification/test/Classification/test_classification_io.cpp b/Classification/test/Classification/test_classification_io.cpp new file mode 100644 index 00000000000..cc05ccfb110 --- /dev/null +++ b/Classification/test/Classification/test_classification_io.cpp @@ -0,0 +1,99 @@ +#if defined (_MSC_VER) && !defined (_WIN64) +#pragma warning(disable:4244) // boost::number_distance::distance() + // converts 64 to 32 bits integers +#endif + +#include +#include +#include +#include + +#include +#include +#include +#include + +typedef CGAL::Simple_cartesian Kernel; +typedef Kernel::Point_3 Point; +typedef Kernel::Vector_3 Vector; +typedef CGAL::Point_set_3 Point_set; +typedef Point_set::Point_map Point_map; + +typedef Kernel::Iso_cuboid_3 Iso_cuboid_3; + +namespace Classification = CGAL::Classification; + +typedef Classification::Label_handle Label_handle; +typedef Classification::Feature_handle Feature_handle; +typedef Classification::Label_set Label_set; +typedef Classification::Feature_set Feature_set; + +typedef Classification::ETHZ_random_forest_classifier Classifier; + +typedef Classification::Planimetric_grid Planimetric_grid; +typedef Classification::Point_set_neighborhood Neighborhood; +typedef Classification::Local_eigen_analysis Local_eigen_analysis; + +typedef Classification::Feature::Distance_to_plane Distance_to_plane; +typedef Classification::Feature::Elevation Elevation; + +int main (int, char**) +{ + Point_set points; + + for (std::size_t i = 0; i < 1000; ++ i) + points.insert (Point (CGAL::get_default_random().get_double(), + CGAL::get_default_random().get_double(), + CGAL::get_default_random().get_double())); + + Iso_cuboid_3 bbox = CGAL::bounding_box (points.points().begin(), points.points().end()); + + float grid_resolution = 0.34f; + float radius_dtm = 15.0f; + + Planimetric_grid grid (points, points.point_map(), bbox, grid_resolution); + Neighborhood neighborhood (points, points.point_map()); + Local_eigen_analysis eigen + = Local_eigen_analysis::create_from_point_set + (points, points.point_map(), neighborhood.k_neighbor_query(6)); + + Feature_set features; + Feature_handle distance_to_plane = features.add (points, points.point_map(), eigen); + Feature_handle elevation = features.add (points, points.point_map(), grid, + radius_dtm); + + Label_set labels; + + std::vector training_set (points.size(), -1); + for (std::size_t i = 0; i < 3; ++ i) + { + std::ostringstream oss; + oss << "label_" << i; + Label_handle lh = labels.add(oss.str().c_str()); + + for (std::size_t j = 0; j < 100; ++ j) + training_set[std::size_t(CGAL::get_default_random().get_int(0, int(training_set.size())))] = int(i); + } + + Classifier classifier (labels, features); + classifier.train (training_set); + + std::ofstream outf ("output_config.gz", std::ios::binary); + outf.precision(18); + classifier.save_configuration(outf); + outf.close(); + + Classifier classifier2 (labels, features); + std::ifstream inf ("output_config.gz", std::ios::binary); + classifier2.load_configuration(inf); + + std::vector label_indices; + std::vector label_indices_2; + + Classification::classify (points, labels, classifier, label_indices); + Classification::classify (points, labels, classifier2, label_indices_2); + + assert (label_indices == label_indices_2); + + return EXIT_SUCCESS; +} diff --git a/Combinatorial_map/doc/Combinatorial_map/Concepts/CellAttribute.h b/Combinatorial_map/doc/Combinatorial_map/Concepts/CellAttribute.h index bfa60ef353c..60f652996dd 100644 --- a/Combinatorial_map/doc/Combinatorial_map/Concepts/CellAttribute.h +++ b/Combinatorial_map/doc/Combinatorial_map/Concepts/CellAttribute.h @@ -39,12 +39,12 @@ Equals to \link CGAL::Tag_true `Tag_true`\endlink to enable the storage of a `Da typedef unspecified_type Supports_cell_dart; /*! -Functor called before merging two attributes. Must be a model of the [Binary Function](http://www.sgi.com/tech/stl/BinaryFunction.html) concept having two references to a model of `CellAttribute` as type of both arguments and `void` as return type. +Functor called before merging two attributes. It must be a binary functor taking as argument two references to a model of `CellAttribute`. */ typedef unspecified_type On_merge; /*! -Functor called after an attribute was split in two. Must be a model of the [Binary Function](http://www.sgi.com/tech/stl/BinaryFunction.html) concept having two references to a model of `CellAttribute` as type of both arguments and `void` as return type. +Functor called after an attribute was split in two. It must be a binary functor taking as argument two references to a model of `CellAttribute`. */ typedef unspecified_type On_split; diff --git a/Combinatorial_map/doc/Combinatorial_map/PackageDescription.txt b/Combinatorial_map/doc/Combinatorial_map/PackageDescription.txt index 9dbdd2feb72..f1c758d89df 100644 --- a/Combinatorial_map/doc/Combinatorial_map/PackageDescription.txt +++ b/Combinatorial_map/doc/Combinatorial_map/PackageDescription.txt @@ -1,10 +1,10 @@ -/// \defgroup PkgCombinatorialMaps Combinatorial Maps Reference +/// \defgroup PkgCombinatorialMapsRef Combinatorial Maps Reference /// \defgroup PkgCombinatorialMapsConcepts Concepts -/// \ingroup PkgCombinatorialMaps +/// \ingroup PkgCombinatorialMapsRef /// \defgroup PkgCombinatorialMapsClasses Classes -/// \ingroup PkgCombinatorialMaps +/// \ingroup PkgCombinatorialMapsRef /*! Basic constructions. \code @@ -12,7 +12,7 @@ \endcode */ /// \defgroup PkgCombinatorialMapsConstructions Constructions -/// \ingroup PkgCombinatorialMaps +/// \ingroup PkgCombinatorialMapsRef /*! High-level operations. \code @@ -20,17 +20,17 @@ \endcode */ /// \defgroup PkgCombinatorialMapsOperations Operations -/// \ingroup PkgCombinatorialMaps +/// \ingroup PkgCombinatorialMapsRef /*! -\addtogroup PkgCombinatorialMaps -\cgalPkgDescriptionBegin{Combinatorial Maps,PkgCombinatorialMapsSummary} +\addtogroup PkgCombinatorialMapsRef +\cgalPkgDescriptionBegin{Combinatorial Maps,PkgCombinatorialMaps} \cgalPkgPicture{cmap_logo.png} \cgalPkgSummaryBegin \cgalPkgAuthor{Guillaume Damiand} \cgalPkgDesc{This package implements Combinatorial Maps in d dimensions. A combinatorial map is a data structure enabling to represent an orientable subdivided object by describing all the cells of the subdivision (for example in 3D vertices, edges, faces, volumes) and all the incidence and adjacency relationships between these cells. Information can be associated to cells thanks to attributes. In 2D, a combinatorial map is equivalent to a halfedge data structure. The package provides basic creation, modification operations, and several iterators enabling to run through some specific part of the object.} -\cgalPkgManuals{Chapter_Combinatorial_Maps,PkgCombinatorialMaps} +\cgalPkgManuals{Chapter_Combinatorial_Maps,PkgCombinatorialMapsRef} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{3.9} diff --git a/Combinatorial_map/examples/Combinatorial_map/CMakeLists.txt b/Combinatorial_map/examples/Combinatorial_map/CMakeLists.txt index da65cb68661..78868a0c372 100644 --- a/Combinatorial_map/examples/Combinatorial_map/CMakeLists.txt +++ b/Combinatorial_map/examples/Combinatorial_map/CMakeLists.txt @@ -4,18 +4,12 @@ project( Combinatorial_map_Examples ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Combinatorial_map/include/CGAL/Combinatorial_map.h b/Combinatorial_map/include/CGAL/Combinatorial_map.h index 4c2bb810685..341789472da 100644 --- a/Combinatorial_map/include/CGAL/Combinatorial_map.h +++ b/Combinatorial_map/include/CGAL/Combinatorial_map.h @@ -49,6 +49,7 @@ #include #include #include +#include #include #if defined( __INTEL_COMPILER ) @@ -216,7 +217,8 @@ namespace CGAL { typename PointConverter> void copy(const CMap2& amap, const Converters& converters, const DartInfoConverter& dartinfoconverter, - const PointConverter& pointconverter) + const PointConverter& pointconverter, + boost::unordered_map* dart_mapping=NULL) { this->clear(); @@ -237,27 +239,28 @@ namespace CGAL { init_dart(null_dart_handle, amap.get_marks(amap.null_dart_handle)); // Create an mapping between darts of the two maps (originals->copies). - // TODO: replace the std::map by a boost::unordered_map // (here we cannot use CGAL::Unique_hash_map because it does not provide // iterators... - std::map dartmap; - + boost::unordered_map local_dartmap; + if (dart_mapping==NULL) + { dart_mapping=&local_dartmap; } + for (typename CMap2::Dart_const_range::const_iterator it=amap.darts().begin(), itend=amap.darts().end(); it!=itend; ++it) { - dartmap[it]=mdarts.emplace(); - init_dart(dartmap[it], amap.get_marks(it)); + (*dart_mapping)[it]=mdarts.emplace(); + init_dart((*dart_mapping)[it], amap.get_marks(it)); internal::Copy_dart_info_functor::run - (amap, static_cast(*this), it, dartmap[it], + (amap, static_cast(*this), it, (*dart_mapping)[it], dartinfoconverter); } unsigned int min_dim=(dimension - ::iterator dartmap_iter, dartmap_iter_end=dartmap.end(); - for (dartmap_iter=dartmap.begin(); dartmap_iter!=dartmap_iter_end; + typename boost::unordered_map + ::iterator dartmap_iter, dartmap_iter_end=dart_mapping->end(); + for (dartmap_iter=dart_mapping->begin(); dartmap_iter!=dartmap_iter_end; ++dartmap_iter) { for (unsigned int i=0; i<=min_dim; i++) @@ -266,13 +269,13 @@ namespace CGAL { (dartmap_iter->first)<(amap.beta(dartmap_iter->first,i))) { basic_link_beta(dartmap_iter->second, - dartmap[amap.beta(dartmap_iter->first,i)], i); + (*dart_mapping)[amap.beta(dartmap_iter->first,i)], i); } } } /** Copy attributes */ - for (dartmap_iter=dartmap.begin(); dartmap_iter!=dartmap_iter_end; + for (dartmap_iter=dart_mapping->begin(); dartmap_iter!=dartmap_iter_end; ++dartmap_iter) { Helper::template Foreach_enabled_attributes @@ -287,28 +290,32 @@ namespace CGAL { } template - void copy(const CMap2& amap) + void copy(const CMap2& amap, + boost::unordered_map* dart_mapping=NULL) + { CGAL::cpp11::tuple<> converters; Default_converter_dart_info dartinfoconverter; Default_converter_cmap_0attributes_with_point pointconverter; - copy(amap, converters, dartinfoconverter, pointconverter); + copy(amap, converters, dartinfoconverter, pointconverter, dart_mapping); } template - void copy(const CMap2& amap, const Converters& converters) + void copy(const CMap2& amap, const Converters& converters, + boost::unordered_map* dart_mapping=NULL) { Default_converter_cmap_0attributes_with_point pointconverter; Default_converter_dart_info dartinfoconverter; - copy(amap, converters, dartinfoconverter, pointconverter); + copy(amap, converters, dartinfoconverter, pointconverter, dart_mapping); } template void copy(const CMap2& amap, const Converters& converters, - const DartInfoConverter& dartinfoconverter) + const DartInfoConverter& dartinfoconverter, + boost::unordered_map* dart_mapping=NULL) { Default_converter_cmap_0attributes_with_point pointconverter; - copy(amap, converters, dartinfoconverter, pointconverter); + copy(amap, converters, dartinfoconverter, pointconverter, dart_mapping); } // Copy constructor from a map having exactly the same type. diff --git a/Combinatorial_map/include/CGAL/Combinatorial_map_basic_operations.h b/Combinatorial_map/include/CGAL/Combinatorial_map_basic_operations.h index 3eb9f586569..8dfcf60debd 100644 --- a/Combinatorial_map/include/CGAL/Combinatorial_map_basic_operations.h +++ b/Combinatorial_map/include/CGAL/Combinatorial_map_basic_operations.h @@ -265,8 +265,8 @@ namespace CGAL * @return the degree of the cell. */ template < class Map, unsigned int i > - typename Map::size_type degree( const Map & amap, - typename Map::Dart_const_handle adart ) + typename Map::size_type degree(const Map & amap, + typename Map::Dart_const_handle adart) { CGAL_assertion(adart != NULL); @@ -280,20 +280,20 @@ namespace CGAL Dart_of_cell_basic_range::const_iterator it(amap, adart, mark); for ( ;it.cont(); ++it ) { - if (!amap.is_marked(*it, treated)) + if (!amap.is_marked(it, treated)) { ++nbIncident; - CGAL::mark_cell(amap, *it, treated); + CGAL::mark_cell(amap, it, treated); } - amap.mark(*it,mark); + amap.mark(it,mark); } amap.negate_mark(mark); for (it.rewind(); it.cont(); ++it) { - if (amap.is_marked(*it, treated)) - CGAL::unmark_cell(amap, *it, treated); - amap.mark(*it,mark); + if (amap.is_marked(it, treated)) + { CGAL::unmark_cell(amap, it, treated); } + amap.mark(it,mark); } amap.negate_mark(mark); @@ -329,20 +329,20 @@ namespace CGAL Dart_of_cell_basic_range::const_iterator it(amap, adart, mark); for ( ; it.cont(); ++it) { - if (!amap.is_marked(*it, treated)) + if (!amap.is_marked(it, treated)) { ++nbIncident; - CGAL::mark_cell(amap, *it, treated); + CGAL::mark_cell(amap, it, treated); } - amap.mark(*it,mark); + amap.mark(it,mark); } amap.negate_mark(mark); for (it.rewind(); it.cont(); ++it) { - if (amap.is_marked(*it, treated)) - CGAL::unmark_cell(amap, *it, treated); - amap.mark(*it,mark); + if (amap.is_marked(it, treated)) + { CGAL::unmark_cell(amap, it, treated); } + amap.mark(it,mark); } amap.negate_mark(mark); diff --git a/Combinatorial_map/include/CGAL/Combinatorial_map_operations.h b/Combinatorial_map/include/CGAL/Combinatorial_map_operations.h index bf44a965fa8..becece3f9e2 100644 --- a/Combinatorial_map/include/CGAL/Combinatorial_map_operations.h +++ b/Combinatorial_map/include/CGAL/Combinatorial_map_operations.h @@ -149,64 +149,57 @@ namespace CGAL to_erase.begin(); for ( ; it!=to_erase.end(); ++it ) { - d1=amap.template beta(*it); - while ( d1!=amap.null_dart_handle && amap.is_marked(d1, mark) ) + if (i!=1 || amap.template beta<1>(*it)!=*it) // for 1-removal of a dart loop, nothing to do { - d1=amap.template beta(d1); - if ( d1==amap. template beta(*it) ) d1=amap.null_dart_handle; - } + d1=amap.template beta(*it); + while (d1!=amap.null_dart_handle && amap.is_marked(d1, mark)) + { + d1=amap.template beta(d1); + if (d1==amap. template beta(*it)) + { d1=amap.null_dart_handle; } + } - if ( !amap.is_marked(d1, mark_modified_darts) ) - { d2=amap.template beta(*it); while ( d2!=amap.null_dart_handle && amap.is_marked(d2, mark) ) { d2=amap.template beta(d2); if ( d2==amap.template beta(*it) ) - d2=amap.null_dart_handle; + { d2=amap.null_dart_handle; } } - if ( !amap.is_marked(d2, mark_modified_darts) ) + if ( d1!=amap.null_dart_handle ) { - if ( d1!=amap.null_dart_handle ) + if ( d2!=amap.null_dart_handle && d1!=d2 ) { - if ( d2!=amap.null_dart_handle && d1!=d2 ) + amap.template basic_link_beta(d1, d2); + amap.mark(d1, mark_modified_darts); + amap.mark(d2, mark_modified_darts); + first_modified_darts.push_back(d1); + modified_darts.push_back(d2); + } + else + { + if (d1==d2) { - //d1->basic_link_beta(d2, i); - amap.template basic_link_beta(d1, d2); + amap.template basic_link_beta(d1, d1); amap.mark(d1, mark_modified_darts); - amap.mark(d2, mark_modified_darts); first_modified_darts.push_back(d1); - modified_darts.push_back(d2); - // TODO push only one out of two dart ? - - /*if ( i==1 ) - { - d2->basic_link_beta(d1, 0); - modified_darts.push_back(d2); - }*/ - // modified_darts2.push_back(d1); } - else + else if ( !amap.template is_free(d1) ) { - if ( !amap.template is_free(d1) ) - { - amap.template unlink_beta(d1); - CGAL_assertion( !amap.is_marked(d1, mark_modified_darts) ); - amap.mark(d1, mark_modified_darts); - first_modified_darts.push_back(d1); - } + amap.template unlink_beta(d1); + amap.mark(d1, mark_modified_darts); + first_modified_darts.push_back(d1); } } - else if ( d2!=amap.null_dart_handle ) + } + else if ( d2!=amap.null_dart_handle ) + { + if ( !amap.template is_free(d2) ) { - if ( !amap.template is_free(d2) ) - { - amap.template unlink_beta(d2); - CGAL_assertion( !amap.is_marked(d2, mark_modified_darts) ); - amap.mark(d2, mark_modified_darts); - modified_darts.push_back(d2); - } + amap.template unlink_beta(d2); + amap.mark(d2, mark_modified_darts); + modified_darts.push_back(d2); } } } @@ -217,7 +210,6 @@ namespace CGAL if ( !amap.template is_free(d1) ) { amap.template unlink_beta(d1); - CGAL_assertion( !amap.is_marked(d1, mark_modified_darts) ); amap.mark(d1, mark_modified_darts); modified_darts.push_back(d1); } diff --git a/Combinatorial_map/test/Combinatorial_map/CMakeLists.txt b/Combinatorial_map/test/Combinatorial_map/CMakeLists.txt index b887bd817d0..f8dd901b528 100644 --- a/Combinatorial_map/test/Combinatorial_map/CMakeLists.txt +++ b/Combinatorial_map/test/Combinatorial_map/CMakeLists.txt @@ -4,18 +4,12 @@ project( Combinatorial_map_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Combinatorial_map/test/Combinatorial_map/Combinatorial_map_3_test.h b/Combinatorial_map/test/Combinatorial_map/Combinatorial_map_3_test.h index dc8c273ce3c..e70fc28d142 100644 --- a/Combinatorial_map/test/Combinatorial_map/Combinatorial_map_3_test.h +++ b/Combinatorial_map/test/Combinatorial_map/Combinatorial_map_3_test.h @@ -1137,6 +1137,48 @@ bool test3D() return false; } + if (CGAL::degree(map2, d1)!=4) + { + std::cout<<"Error: 0-degree is wrong: "<(map2, d1)<<" instead of 4."<(map2, d1)!=3) + { + std::cout<<"Error: 1-degree is wrong: "<(map2, d1)<<" instead of 3."<(map2, d1)!=2) + { + std::cout<<"Error: 2-degree is wrong: "<(map2, d1)<<" instead of 2."<(map2, d1)!=2) + { + std::cout<<"Error: 1-codegree is wrong: "<(map2, d1)<<" instead of 2."<(map2, d1)!=4) + { + std::cout<<"Error: 2-codegree is wrong: "<(map2, d1)<<" instead of 4."<(map2, d1)!=6) + { + std::cout<<"Error: 3-codegree is wrong: "<(map2, d1)<<" instead of 6."<boost::adjacency_list +boost::adjacency_list from the Boost Graph Library (BGL). The advantage of using `boost::adjacency_list` is that it provides convenience to the further processing of the constructed graphs, since BGL includes most common graph algorithms. @@ -151,7 +151,7 @@ Note that there are seven template parameters for `boost::adjacency_list` in BGL of which we require `VertexProperties` to be `Traits::Point_2`, and other parameters can be chosen freely. Also note that, here we pass `Point_2` directly as -bundled properties +bundled properties to `boost::adjacency_list`, because this makes our implementation more straightforward than using a property map. If you want more properties other than `Point_2` for vertices, you can still construct external properties by using property maps. diff --git a/Cone_spanners_2/doc/Cone_spanners_2/PackageDescription.txt b/Cone_spanners_2/doc/Cone_spanners_2/PackageDescription.txt index f0258b35140..5833bf7e4ae 100644 --- a/Cone_spanners_2/doc/Cone_spanners_2/PackageDescription.txt +++ b/Cone_spanners_2/doc/Cone_spanners_2/PackageDescription.txt @@ -1,11 +1,11 @@ // PRETTY PACKAGE NAME should equal the project title in Doxyfile.in -/// \defgroup PkgConeBasedSpanners Cone-Based Spanners Reference +/// \defgroup PkgConeSpanners2Ref Cone-Based Spanners Reference /*! -\addtogroup PkgConeBasedSpanners +\addtogroup PkgConeSpanners2Ref -\cgalPkgDescriptionBegin{Cone-Based Spanners,PkgConeBasedSpannersSummary} +\cgalPkgDescriptionBegin{Cone-Based Spanners,PkgConeSpanners2} \cgalPkgPicture{Logo-ConeSpanners.png} \cgalPkgSummaryBegin @@ -20,7 +20,7 @@ value defined in \cgal, which is still accurate enough for most applications. Moreover, for visualization purpose, this package provides a global function to generate the data and script files used by Gnuplot to plot the constructed graphs. This package also provides options for the Half Yao graph and the Half Theta graph.} -\cgalPkgManuals{Chapter_ConeBasedSpanners,PkgConeBasedSpanners} +\cgalPkgManuals{Chapter_ConeBasedSpanners,PkgConeSpanners2Ref} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin diff --git a/Cone_spanners_2/examples/Cone_spanners_2/CMakeLists.txt b/Cone_spanners_2/examples/Cone_spanners_2/CMakeLists.txt index bae9b74e175..c4e959b43f1 100644 --- a/Cone_spanners_2/examples/Cone_spanners_2/CMakeLists.txt +++ b/Cone_spanners_2/examples/Cone_spanners_2/CMakeLists.txt @@ -4,17 +4,12 @@ project( Cone_spanners_2_Examples ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET COMPONENTS Core) if ( CGAL_FOUND AND CGAL_Core_FOUND) - - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - include_directories (BEFORE "../../include") + include(${CGAL_USE_FILE}) if (MSVC) # Turn off a boost related warning that appears with VC2015 diff --git a/Cone_spanners_2/include/CGAL/Compute_cone_boundaries_2.h b/Cone_spanners_2/include/CGAL/Compute_cone_boundaries_2.h index 19b61beaf66..8ef3ada4897 100644 --- a/Cone_spanners_2/include/CGAL/Compute_cone_boundaries_2.h +++ b/Cone_spanners_2/include/CGAL/Compute_cone_boundaries_2.h @@ -44,7 +44,7 @@ namespace CGAL { -/*! \ingroup PkgConeBasedSpanners +/*! \ingroup PkgConeSpanners2Ref * * \brief The functor for computing the directions of cone boundaries with a given * cone number and a given initial direction. diff --git a/Cone_spanners_2/include/CGAL/Cone_spanners_enum_2.h b/Cone_spanners_2/include/CGAL/Cone_spanners_enum_2.h index 7f7832bfd43..ca9957a2112 100644 --- a/Cone_spanners_2/include/CGAL/Cone_spanners_enum_2.h +++ b/Cone_spanners_2/include/CGAL/Cone_spanners_enum_2.h @@ -31,7 +31,7 @@ namespace CGAL { - /*! \ingroup PkgConeBasedSpanners + /*! \ingroup PkgConeSpanners2Ref \brief An enum of the choice of cones in cone spanners. */ diff --git a/Cone_spanners_2/include/CGAL/Construct_theta_graph_2.h b/Cone_spanners_2/include/CGAL/Construct_theta_graph_2.h index 156d5b3e151..8bca1174f6a 100644 --- a/Cone_spanners_2/include/CGAL/Construct_theta_graph_2.h +++ b/Cone_spanners_2/include/CGAL/Construct_theta_graph_2.h @@ -45,7 +45,7 @@ namespace CGAL { -/*! \ingroup PkgConeBasedSpanners +/*! \ingroup PkgConeSpanners2Ref \brief A template functor for constructing Theta graphs with a given set of 2D points and a given initial direction for the cone boundaries. diff --git a/Cone_spanners_2/include/CGAL/Construct_yao_graph_2.h b/Cone_spanners_2/include/CGAL/Construct_yao_graph_2.h index 621ce9011a6..8efbc4d921a 100644 --- a/Cone_spanners_2/include/CGAL/Construct_yao_graph_2.h +++ b/Cone_spanners_2/include/CGAL/Construct_yao_graph_2.h @@ -42,7 +42,7 @@ namespace CGAL { -/*! \ingroup PkgConeBasedSpanners +/*! \ingroup PkgConeSpanners2Ref \brief A template functor for constructing Yao graphs with a given set of 2D points and a given initial direction for the cone boundaries. diff --git a/Cone_spanners_2/include/CGAL/gnuplot_output_2.h b/Cone_spanners_2/include/CGAL/gnuplot_output_2.h index 95ec96f016b..d4fecddc892 100644 --- a/Cone_spanners_2/include/CGAL/gnuplot_output_2.h +++ b/Cone_spanners_2/include/CGAL/gnuplot_output_2.h @@ -46,7 +46,7 @@ namespace CGAL { /* ------ Declarations go first, then implementations follow. ------ */ /*! -* \ingroup PkgConeBasedSpanners +* \ingroup PkgConeSpanners2Ref * \brief Output a set of files used by Gnuplot to plot `g`. * * The files that are generated for Gnuplot are: diff --git a/Cone_spanners_2/test/Cone_spanners_2/CMakeLists.txt b/Cone_spanners_2/test/Cone_spanners_2/CMakeLists.txt index 0c40fa1edba..a859efd04e6 100644 --- a/Cone_spanners_2/test/Cone_spanners_2/CMakeLists.txt +++ b/Cone_spanners_2/test/Cone_spanners_2/CMakeLists.txt @@ -4,19 +4,13 @@ project( Cone_spanners_2_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET COMPONENTS Core) if ( CGAL_FOUND AND CGAL_Core_FOUND) - - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - include_directories (BEFORE "../../include") - - include_directories (BEFORE "include") + include(${CGAL_USE_FILE}) + include_directories (BEFORE "include") # create a target per cppfile file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) diff --git a/Convex_decomposition_3/doc/Convex_decomposition_3/PackageDescription.txt b/Convex_decomposition_3/doc/Convex_decomposition_3/PackageDescription.txt index e572fe2a1be..19c85a1d7f5 100644 --- a/Convex_decomposition_3/doc/Convex_decomposition_3/PackageDescription.txt +++ b/Convex_decomposition_3/doc/Convex_decomposition_3/PackageDescription.txt @@ -1,13 +1,13 @@ -/// \defgroup PkgConvexDecomposition3 Convex Decomposition of Polyhedra Reference +/// \defgroup PkgConvexDecomposition3Ref Convex Decomposition of Polyhedra Reference /*! -\addtogroup PkgConvexDecomposition3 -\cgalPkgDescriptionBegin{Convex Decomposition of Polyhedra,PkgConvexDecomposition3Summary} +\addtogroup PkgConvexDecomposition3Ref +\cgalPkgDescriptionBegin{Convex Decomposition of Polyhedra,PkgConvexDecomposition3} \cgalPkgPicture{Convex_decomposition_3/fig/Convex_decomposition_3-teaser.png} \cgalPkgSummaryBegin \cgalPkgAuthor{Peter Hachenberger} \cgalPkgDesc{This packages provides a function for decomposing a bounded polyhedron into convex sub-polyhedra. The decomposition yields \f$ O(r^2)\f$ convex pieces, where \f$ r\f$ is the number of edges, whose adjacent facets form an angle of more than 180 degrees with respect to the polyhedron's interior. This bound is worst-case optimal. } -\cgalPkgManuals{Chapter_Convex_Decomposition_of_Polyhedra,PkgConvexDecomposition3} +\cgalPkgManuals{Chapter_Convex_Decomposition_of_Polyhedra,PkgConvexDecomposition3Ref} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{3.5} diff --git a/Convex_decomposition_3/examples/Convex_decomposition_3/CMakeLists.txt b/Convex_decomposition_3/examples/Convex_decomposition_3/CMakeLists.txt index dad77e423ff..459d14c78b5 100644 --- a/Convex_decomposition_3/examples/Convex_decomposition_3/CMakeLists.txt +++ b/Convex_decomposition_3/examples/Convex_decomposition_3/CMakeLists.txt @@ -4,18 +4,12 @@ project( Convex_decomposition_3_Examples ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Convex_decomposition_3/include/CGAL/convex_decomposition_3.h b/Convex_decomposition_3/include/CGAL/convex_decomposition_3.h index f232603ff8f..45ae44ca0f7 100644 --- a/Convex_decomposition_3/include/CGAL/convex_decomposition_3.h +++ b/Convex_decomposition_3/include/CGAL/convex_decomposition_3.h @@ -44,7 +44,7 @@ namespace CGAL { /*! -\ingroup PkgConvexDecomposition3 +\ingroup PkgConvexDecomposition3Ref The function `convex_decomposition_3()` inserts additional facets into the given `Nef_polyhedron_3` `N`, such that each bounded diff --git a/Convex_decomposition_3/test/Convex_decomposition_3/CMakeLists.txt b/Convex_decomposition_3/test/Convex_decomposition_3/CMakeLists.txt index c29be980c2c..8de39c59399 100644 --- a/Convex_decomposition_3/test/Convex_decomposition_3/CMakeLists.txt +++ b/Convex_decomposition_3/test/Convex_decomposition_3/CMakeLists.txt @@ -4,18 +4,12 @@ project( Convex_decomposition_3_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Convex_hull_2/doc/Convex_hull_2/CGAL/ch_akl_toussaint.h b/Convex_hull_2/doc/Convex_hull_2/CGAL/ch_akl_toussaint.h index 50631e75cb1..0f1a616be0e 100644 --- a/Convex_hull_2/doc/Convex_hull_2/CGAL/ch_akl_toussaint.h +++ b/Convex_hull_2/doc/Convex_hull_2/CGAL/ch_akl_toussaint.h @@ -26,6 +26,7 @@ functions that return instances of these types:

  • `Traits::Less_xy_2`,
  • `Traits::Less_yx_2`,
  • `Traits::Left_turn_2`, +
  • `Traits::Orientation_2`,
  • `Traits::Equal_2`. diff --git a/Convex_hull_2/doc/Convex_hull_2/CGAL/convex_hull_2.h b/Convex_hull_2/doc/Convex_hull_2/CGAL/convex_hull_2.h index 1793bd3d593..7c8edc910bb 100644 --- a/Convex_hull_2/doc/Convex_hull_2/CGAL/convex_hull_2.h +++ b/Convex_hull_2/doc/Convex_hull_2/CGAL/convex_hull_2.h @@ -31,7 +31,8 @@ functions that return instances of these types:
  • `Traits::Equal_2`,
  • `Traits::Less_xy_2`,
  • `Traits::Less_yx_2`, -
  • `Traits::Left_turn_2`. +
  • `Traits::Left_turn_2`, +
  • `Traits::Orientation_2`. diff --git a/Convex_hull_2/doc/Convex_hull_2/PackageDescription.txt b/Convex_hull_2/doc/Convex_hull_2/PackageDescription.txt index e27762884c3..8ccbfaa6dfa 100644 --- a/Convex_hull_2/doc/Convex_hull_2/PackageDescription.txt +++ b/Convex_hull_2/doc/Convex_hull_2/PackageDescription.txt @@ -1,32 +1,32 @@ -/// \defgroup PkgConvexHull2 2D Convex Hulls and Extreme Points Reference +/// \defgroup PkgConvexHull2Ref 2D Convex Hulls and Extreme Points Reference /// \defgroup PkgConvexHull2Concepts Concepts -/// \ingroup PkgConvexHull2 +/// \ingroup PkgConvexHull2Ref /// \defgroup PkgConvexHull2Traits Traits Classes -/// \ingroup PkgConvexHull2 +/// \ingroup PkgConvexHull2Ref /// \defgroup PkgConvexHull2Functions Convex Hull Functions -/// \ingroup PkgConvexHull2 +/// \ingroup PkgConvexHull2Ref /// \defgroup PkgConvexHull2Convexity Convexity Checking -/// \ingroup PkgConvexHull2 +/// \ingroup PkgConvexHull2Ref /// \defgroup PkgConvexHull2Subsequence Hull Subsequence Functions -/// \ingroup PkgConvexHull2 +/// \ingroup PkgConvexHull2Ref /// \defgroup PkgConvexHull2Extreme Extreme Point Functions -/// \ingroup PkgConvexHull2 +/// \ingroup PkgConvexHull2Ref /*! -\addtogroup PkgConvexHull2 +\addtogroup PkgConvexHull2Ref -\cgalPkgDescriptionBegin{2D Convex Hulls and Extreme Points,PkgConvexHull2Summary} +\cgalPkgDescriptionBegin{2D Convex Hulls and Extreme Points,PkgConvexHull2} \cgalPkgPicture{Convex_hull_2/fig/convex_hull.png} \cgalPkgSummaryBegin \cgalPkgAuthors{Susan Hert and Stefan Schirra} \cgalPkgDesc{This package provides functions for computing convex hulls in two dimensions as well as functions for checking if sets of points are strongly convex are not. There are also a number of functions described for computing particular extreme points and subsequences of hull points, such as the lower and upper hull of a set of points.} -\cgalPkgManuals{Chapter_2D_Convex_Hulls_and_Extreme_Points,PkgConvexHull2} +\cgalPkgManuals{Chapter_2D_Convex_Hulls_and_Extreme_Points,PkgConvexHull2Ref} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{1.0} diff --git a/Convex_hull_2/examples/Convex_hull_2/CMakeLists.txt b/Convex_hull_2/examples/Convex_hull_2/CMakeLists.txt index c448c10a81f..fb81c4d6131 100644 --- a/Convex_hull_2/examples/Convex_hull_2/CMakeLists.txt +++ b/Convex_hull_2/examples/Convex_hull_2/CMakeLists.txt @@ -4,19 +4,13 @@ project( Convex_hull_2_Examples ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - include_directories (BEFORE "../../include") - - include_directories (BEFORE "include") + include_directories (BEFORE "include") # create a target per cppfile file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) diff --git a/Convex_hull_2/test/Convex_hull_2/CMakeLists.txt b/Convex_hull_2/test/Convex_hull_2/CMakeLists.txt index f2f0a949a66..a39a58f5f99 100644 --- a/Convex_hull_2/test/Convex_hull_2/CMakeLists.txt +++ b/Convex_hull_2/test/Convex_hull_2/CMakeLists.txt @@ -4,19 +4,13 @@ project( Convex_hull_2_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - include_directories (BEFORE "../../include") - - include_directories (BEFORE "include") + include_directories (BEFORE "include") # create a target per cppfile file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) diff --git a/Convex_hull_3/demo/Convex_hull_3/CMakeLists.txt b/Convex_hull_3/demo/Convex_hull_3/CMakeLists.txt index 0a59e6cc867..59c80f4ec0e 100644 --- a/Convex_hull_3/demo/Convex_hull_3/CMakeLists.txt +++ b/Convex_hull_3/demo/Convex_hull_3/CMakeLists.txt @@ -16,10 +16,6 @@ find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - create_single_source_cgal_program( "quickhull_3_demo.cpp" ) else() diff --git a/Convex_hull_3/doc/Convex_hull_3/Concepts/ConvexHullTraits_3.h b/Convex_hull_3/doc/Convex_hull_3/Concepts/ConvexHullTraits_3.h index f5992e58347..97837cbae05 100644 --- a/Convex_hull_3/doc/Convex_hull_3/Concepts/ConvexHullTraits_3.h +++ b/Convex_hull_3/doc/Convex_hull_3/Concepts/ConvexHullTraits_3.h @@ -87,11 +87,9 @@ typedef unspecified_type Has_on_positive_side_3; /*! Predicate object type that provides -a constructor taking a single `Point_3` object and -`bool operator()(Point_3 q, Point_3 r)`, which returns true iff the +`bool operator()(Point_3 p, Point_3 q, Point_3 r)`, which returns true iff the distance from `q` to `p` is smaller than the distance from -`r` to `p`, where `p` is the point passed to the object -at construction. +`r` to `p`. */ typedef unspecified_type Less_distance_to_point_3; @@ -105,7 +103,7 @@ typedef unspecified_type Less_signed_distance_to_plane_3; /*! A traits class providing the requirements of the template parameter `Traits` of -the 2D convex hull function `CGAL::ch_bykat()` such that `Traits::Point_2` +the 2D convex hull function `CGAL::ch_akl_toussaint()` such that `Traits::Point_2` is `Point_3`, and the 2D points considered in the algorithm are the projections of the 3D points in the `xy`-plane. If this type is not available, the function `CGAL::convex_hull_3()` will diff --git a/Convex_hull_3/doc/Convex_hull_3/PackageDescription.txt b/Convex_hull_3/doc/Convex_hull_3/PackageDescription.txt index 9f0636fa1e3..1c808b0fdc0 100644 --- a/Convex_hull_3/doc/Convex_hull_3/PackageDescription.txt +++ b/Convex_hull_3/doc/Convex_hull_3/PackageDescription.txt @@ -1,13 +1,13 @@ -/// \defgroup PkgConvexHull3 3D Convex Hulls Reference +/// \defgroup PkgConvexHull3Ref 3D Convex Hulls Reference /// \defgroup PkgConvexHull3Concepts Concepts -/// \ingroup PkgConvexHull3 +/// \ingroup PkgConvexHull3Ref /// \defgroup PkgConvexHull3Traits Traits Classes -/// \ingroup PkgConvexHull3 +/// \ingroup PkgConvexHull3Ref /*! \defgroup PkgConvexHull3Functions Convex Hull Functions - \ingroup PkgConvexHull3 + \ingroup PkgConvexHull3Ref The function `convex_hull_3()` computes the convex hull of a given set of three-dimensional points. @@ -17,22 +17,22 @@ degenerate hull may also be possible. */ /// \defgroup PkgConvexityChecking Convexity Checking -/// \ingroup PkgConvexHull3 +/// \ingroup PkgConvexHull3Ref /*! -\addtogroup PkgConvexHull3 +\addtogroup PkgConvexHull3Ref \todo fix or keep the `Default_traits` -\cgalPkgDescriptionBegin{3D Convex Hulls,PkgConvexHull3Summary} +\cgalPkgDescriptionBegin{3D Convex Hulls,PkgConvexHull3} \cgalPkgPicture{Convex_hull_3/fig/bunny.png} \cgalPkgSummaryBegin \cgalPkgAuthors{Susan Hert and Stefan Schirra} \cgalPkgDesc{This package provides functions for computing convex hulls in three dimensions as well as functions for checking if sets of points are strongly convex or not. One can compute the convex hull of a set of points in three dimensions in two ways: using a static algorithm or using a triangulation to get a fully dynamic computation.} -\cgalPkgManuals{Chapter_3D_Convex_Hulls,PkgConvexHull3} +\cgalPkgManuals{Chapter_3D_Convex_Hulls,PkgConvexHull3Ref} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{1.1} -\cgalPkgDependsOn{The dynamic algorithms depend on \ref PkgTriangulation3Summary "3D Triangulations".} +\cgalPkgDependsOn{The dynamic algorithms depend on \ref PkgTriangulation3 "3D Triangulations".} \cgalPkgBib{cgal:hs-ch3} \cgalPkgLicense{\ref licensesGPL "GPL"} \cgalPkgDemo{Polyhedron demo,polyhedron_3.zip} diff --git a/Convex_hull_3/examples/Convex_hull_3/CMakeLists.txt b/Convex_hull_3/examples/Convex_hull_3/CMakeLists.txt index 571407cb649..a2a70fa2592 100644 --- a/Convex_hull_3/examples/Convex_hull_3/CMakeLists.txt +++ b/Convex_hull_3/examples/Convex_hull_3/CMakeLists.txt @@ -4,7 +4,7 @@ project( Convex_hull_3_Examples ) -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.1) # CGAL and its components find_package( CGAL QUIET COMPONENTS ) @@ -16,10 +16,6 @@ if ( NOT CGAL_FOUND ) endif() -# include helper file -include( ${CGAL_USE_FILE} ) - - # Boost and its components find_package( Boost REQUIRED ) @@ -42,14 +38,10 @@ 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( "dynamic_hull_3.cpp" ) create_single_source_cgal_program( "dynamic_hull_LCC_3.cpp" ) diff --git a/Convex_hull_3/include/CGAL/Convex_hull_traits_3.h b/Convex_hull_3/include/CGAL/Convex_hull_traits_3.h index 0a008157691..699155f983d 100644 --- a/Convex_hull_3/include/CGAL/Convex_hull_traits_3.h +++ b/Convex_hull_3/include/CGAL/Convex_hull_traits_3.h @@ -147,15 +147,8 @@ public: const Point_3& hp = h.p(); const Point_3& hq = h.q(); const Point_3& hr = h.r(); - //typename OldK::Less_signed_distance_to_plane_3 - // less_signed_distance_to_plane_3; - // return less_signed_distance_to_plane_3(hp, hq, hr, p, q); - return has_smaller_signed_dist_to_planeC3(hp.x(), hp.y(), hp.z(), - hq.x(), hq.y(), hq.z(), - hr.x(), hr.y(), hr.z(), - p.x(), p.y(), p.z(), - q.x(), q.y(), q.z()); - + typename K::Less_signed_distance_to_plane_3 less_signed_distance_to_plane_3; + return less_signed_distance_to_plane_3(hp, hq, hr, p, q); } }; @@ -164,35 +157,10 @@ struct GT3_for_CH3 { typedef typename GT::Point_3 Point_2; }; -template -struct Convex_hull_traits_base_3 { - typedef Point_triple_has_on_positive_side_3 Has_on_positive_side_3; - - typedef Point_triple_less_signed_distance_to_plane_3 - Less_signed_distance_to_plane_3; -}; - -template -struct Convex_hull_traits_base_3{ - typedef Filtered_predicate< - Point_triple_has_on_positive_side_3< typename R_::Exact_kernel_rt >, - Point_triple_has_on_positive_side_3< typename R_::Approximate_kernel >, - Point_triple_converter, - Point_triple_converter - > Has_on_positive_side_3; - - typedef Filtered_predicate< - Point_triple_less_signed_distance_to_plane_3< typename R_::Exact_kernel_rt >, - Point_triple_less_signed_distance_to_plane_3< typename R_::Approximate_kernel >, - Point_triple_converter, - Point_triple_converter - > Less_signed_distance_to_plane_3; -}; template -class Convex_hull_traits_3 : - public Convex_hull_traits_base_3 +class Convex_hull_traits_3 { public: typedef R_ R; @@ -228,11 +196,12 @@ class Convex_hull_traits_3 : typedef typename R::Coplanar_3 Coplanar_3; typedef typename R::Less_distance_to_point_3 Less_distance_to_point_3; - typedef typename Convex_hull_traits_base_3 - ::Has_on_positive_side_3 Has_on_positive_side_3; + typedef Point_triple_has_on_positive_side_3 Has_on_positive_side_3; - typedef typename Convex_hull_traits_base_3 - ::Less_signed_distance_to_plane_3 Less_signed_distance_to_plane_3; + typedef Point_triple_less_signed_distance_to_plane_3 + Less_signed_distance_to_plane_3; + + // required for degenerate case of all points coplanar typedef CGAL::Projection_traits_xy_3 Traits_xy_3; diff --git a/Convex_hull_3/include/CGAL/Extreme_points_traits_adapter_3.h b/Convex_hull_3/include/CGAL/Extreme_points_traits_adapter_3.h index 599f3f948c6..8991774adc3 100644 --- a/Convex_hull_3/include/CGAL/Extreme_points_traits_adapter_3.h +++ b/Convex_hull_3/include/CGAL/Extreme_points_traits_adapter_3.h @@ -138,7 +138,7 @@ public: public: Construct_plane_3(const PointPropertyMap& map, const typename Base_traits::Construct_plane_3& base): Base_traits::Construct_plane_3(base),vpm_(map), base(base){} - typename Base_traits::Plane_3 operator()(const Point_3& p, const Point_3& q, const Point_3& r)const + typename Base_traits::Plane_3 operator()(const Vertex& p, const Vertex& q, const Vertex& r)const { return base(get(vpm_,p),get(vpm_,q),get(vpm_,r)); } @@ -159,7 +159,7 @@ public: typedef bool result_type; result_type - operator()( const Plane_3& pl, const Point_3& p) const + operator()( const Plane_3& pl, const Vertex& p) const { return base(pl, get(vpm_, p)); } diff --git a/Convex_hull_3/include/CGAL/convex_hull_3.h b/Convex_hull_3/include/CGAL/convex_hull_3.h index 333334b3f42..531bfd3d943 100644 --- a/Convex_hull_3/include/CGAL/convex_hull_3.h +++ b/Convex_hull_3/include/CGAL/convex_hull_3.h @@ -182,13 +182,13 @@ struct Is_cartesian_kernel< Convex_hull_traits_3 { // Rational here is that Tag_true can only be passed by us since it is not documented // so we can assume that Kernel is a CGAL Kernel - typedef boost::is_same type; + typedef typename boost::is_same::type type; }; // Predicate internally used as a wrapper around has_on_positive_side // We provide a partial specialization restricted to the case of CGAL Cartesian Kernels with inexact constructions below //template ::type > -template > +template ::type > class Is_on_positive_side_of_plane_3{ typedef typename Traits::Point_3 Point_3; typename Traits::Plane_3 plane; diff --git a/Convex_hull_3/test/Convex_hull_3/CMakeLists.txt b/Convex_hull_3/test/Convex_hull_3/CMakeLists.txt index cc07c627de0..beb28619ce8 100644 --- a/Convex_hull_3/test/Convex_hull_3/CMakeLists.txt +++ b/Convex_hull_3/test/Convex_hull_3/CMakeLists.txt @@ -4,16 +4,12 @@ project( Convex_hull_3_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - find_package( OpenMesh QUIET ) if ( OpenMesh_FOUND ) @@ -22,9 +18,7 @@ if ( CGAL_FOUND ) message(STATUS "Examples that use OpenMesh will not be compiled.") endif() - include_directories (BEFORE "../../include") - - include_directories (BEFORE "include") + include_directories (BEFORE "include") # create a target per cppfile file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) diff --git a/Convex_hull_d/doc/Convex_hull_d/CGAL/Convex_hull_d.h b/Convex_hull_d/doc/Convex_hull_d/CGAL/Convex_hull_d.h index ec21aaa1d83..c14515a6e9a 100644 --- a/Convex_hull_d/doc/Convex_hull_d/CGAL/Convex_hull_d.h +++ b/Convex_hull_d/doc/Convex_hull_d/CGAL/Convex_hull_d.h @@ -1,9 +1,9 @@ namespace CGAL { /*! -\ingroup PkgConvexHullD +\ingroup PkgConvexHullDRef -\deprecated This package is deprecated since the version 4.6 of \cgal. The package \ref PkgTriangulationsSummary should be used instead. +\deprecated This package is deprecated since the version 4.6 of \cgal. The package \ref PkgTriangulations should be used instead. An instance `C` of type `Convex_hull_d` is the convex hull of a multi-set `S` of points in \f$ d\f$-dimensional space. We call diff --git a/Convex_hull_d/doc/Convex_hull_d/CGAL/Convex_hull_d_to_polyhedron_3.h b/Convex_hull_d/doc/Convex_hull_d/CGAL/Convex_hull_d_to_polyhedron_3.h index 13d0c98dfd9..9f7775b2157 100644 --- a/Convex_hull_d/doc/Convex_hull_d/CGAL/Convex_hull_d_to_polyhedron_3.h +++ b/Convex_hull_d/doc/Convex_hull_d/CGAL/Convex_hull_d_to_polyhedron_3.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\deprecated This package is deprecated since the version 4.6 of \cgal. The package \ref PkgTriangulationsSummary should be used instead. +\deprecated This package is deprecated since the version 4.6 of \cgal. The package \ref PkgTriangulations should be used instead. converts the convex hull `C` to polyhedral surface stored in `P`. @@ -13,7 +13,7 @@ template void convex_hull_d_to_polyhedron_3( const Convex_hull_d& C, Polyhedron_3& P) ; /*! -\deprecated This package is deprecated since the version 4.6 of \cgal. The package \ref PkgTriangulationsSummary should be used instead +\deprecated This package is deprecated since the version 4.6 of \cgal. The package \ref PkgTriangulations should be used instead constructs the representation of the surface of `C` as a bidirected LEDA graph `G`. diff --git a/Convex_hull_d/doc/Convex_hull_d/CGAL/Convex_hull_d_traits_3.h b/Convex_hull_d/doc/Convex_hull_d/CGAL/Convex_hull_d_traits_3.h index 3719f9fc270..694105e5729 100644 --- a/Convex_hull_d/doc/Convex_hull_d/CGAL/Convex_hull_d_traits_3.h +++ b/Convex_hull_d/doc/Convex_hull_d/CGAL/Convex_hull_d_traits_3.h @@ -1,9 +1,9 @@ namespace CGAL { /*! -\ingroup PkgConvexHullD +\ingroup PkgConvexHullDRef -\deprecated This package is deprecated since the version 4.6 of \cgal. The package \ref PkgTriangulationsSummary should be used instead. +\deprecated This package is deprecated since the version 4.6 of \cgal. The package \ref PkgTriangulations should be used instead. diff --git a/Convex_hull_d/doc/Convex_hull_d/CGAL/Delaunay_d.h b/Convex_hull_d/doc/Convex_hull_d/CGAL/Delaunay_d.h index eb83d360fb8..21e2d14953d 100644 --- a/Convex_hull_d/doc/Convex_hull_d/CGAL/Delaunay_d.h +++ b/Convex_hull_d/doc/Convex_hull_d/CGAL/Delaunay_d.h @@ -1,9 +1,9 @@ namespace CGAL { /*! -\ingroup PkgConvexHullD +\ingroup PkgConvexHullDRef -\deprecated This package is deprecated since the version 4.6 of \cgal. The package \ref PkgTriangulationsSummary should be used instead. +\deprecated This package is deprecated since the version 4.6 of \cgal. The package \ref PkgTriangulations should be used instead. An instance `DT` of type `Delaunay_d< R, Lifted_R >` is the nearest and furthest site Delaunay triangulation of a set `S` of diff --git a/Convex_hull_d/doc/Convex_hull_d/Concepts/ConvexHullTraits_d.h b/Convex_hull_d/doc/Convex_hull_d/Concepts/ConvexHullTraits_d.h index a5b30b4e9cb..3be7fa3ddbb 100644 --- a/Convex_hull_d/doc/Convex_hull_d/Concepts/ConvexHullTraits_d.h +++ b/Convex_hull_d/doc/Convex_hull_d/Concepts/ConvexHullTraits_d.h @@ -2,7 +2,7 @@ \ingroup PkgConvexHullDConcepts \cgalConcept -\deprecated This package is deprecated since the version 4.6 of \cgal. The package \ref PkgTriangulationsSummary should be used instead. +\deprecated This package is deprecated since the version 4.6 of \cgal. The package \ref PkgTriangulations should be used instead. Requirements of the traits class to be used with the class `CGAL::Convex_hull_d`. diff --git a/Convex_hull_d/doc/Convex_hull_d/Concepts/DelaunayLiftedTraits_d.h b/Convex_hull_d/doc/Convex_hull_d/Concepts/DelaunayLiftedTraits_d.h index d6211139b40..047dcdd09b1 100644 --- a/Convex_hull_d/doc/Convex_hull_d/Concepts/DelaunayLiftedTraits_d.h +++ b/Convex_hull_d/doc/Convex_hull_d/Concepts/DelaunayLiftedTraits_d.h @@ -2,7 +2,7 @@ \ingroup PkgConvexHullDConcepts \cgalConcept -\deprecated This package is deprecated since the version 4.6 of \cgal. The package \ref PkgTriangulationsSummary should be used instead. +\deprecated This package is deprecated since the version 4.6 of \cgal. The package \ref PkgTriangulations should be used instead. Requirements of the second traits class to be used with the class `CGAL::Delaunay_d`. diff --git a/Convex_hull_d/doc/Convex_hull_d/Concepts/DelaunayTraits_d.h b/Convex_hull_d/doc/Convex_hull_d/Concepts/DelaunayTraits_d.h index 868aa546169..3857c62ba55 100644 --- a/Convex_hull_d/doc/Convex_hull_d/Concepts/DelaunayTraits_d.h +++ b/Convex_hull_d/doc/Convex_hull_d/Concepts/DelaunayTraits_d.h @@ -2,7 +2,7 @@ \ingroup PkgConvexHullDConcepts \cgalConcept -\deprecated This package is deprecated since the version 4.6 of \cgal. The package \ref PkgTriangulationsSummary should be used instead. +\deprecated This package is deprecated since the version 4.6 of \cgal. The package \ref PkgTriangulations should be used instead. Requirements of the first traits class to be used with the class `CGAL::Delaunay_d`. diff --git a/Convex_hull_d/doc/Convex_hull_d/Convex_hull_d.txt b/Convex_hull_d/doc/Convex_hull_d/Convex_hull_d.txt index 1f31fff9b19..07f98db9fc6 100644 --- a/Convex_hull_d/doc/Convex_hull_d/Convex_hull_d.txt +++ b/Convex_hull_d/doc/Convex_hull_d/Convex_hull_d.txt @@ -7,7 +7,7 @@ namespace CGAL { \anchor chapconvexhulld \authors Susan Hert and Michael Seel -\deprecated This package is deprecated since the version 4.6 of \cgal. The package \ref PkgTriangulationsSummary should be used instead. +\deprecated This package is deprecated since the version 4.6 of \cgal. The package \ref PkgTriangulations should be used instead. \section Convex_hull_dIntroduction Introduction diff --git a/Convex_hull_d/doc/Convex_hull_d/PackageDescription.txt b/Convex_hull_d/doc/Convex_hull_d/PackageDescription.txt index b0a8e105d97..86ce0ec9281 100644 --- a/Convex_hull_d/doc/Convex_hull_d/PackageDescription.txt +++ b/Convex_hull_d/doc/Convex_hull_d/PackageDescription.txt @@ -1,15 +1,15 @@ -/// \defgroup PkgConvexHullD dD Convex Hulls and Delaunay Triangulations Reference +/// \defgroup PkgConvexHullDRef dD Convex Hulls and Delaunay Triangulations Reference /// \defgroup PkgConvexHullDConcepts Concepts -/// \ingroup PkgConvexHullD +/// \ingroup PkgConvexHullDRef /*! -\addtogroup PkgConvexHullD +\addtogroup PkgConvexHullDRef \todo check generated documentation -\cgalPkgDescriptionBegin{dD Convex Hulls and Delaunay Triangulations,PkgConvexHullDSummary} +\cgalPkgDescriptionBegin{dD Convex Hulls and Delaunay Triangulations,PkgConvexHullD} \cgalPkgPicture{convex_hull_d-teaser.png} \cgalPkgSummaryBegin \cgalPkgAuthors{Susan Hert and Michael Seel} \cgalPkgDesc{This package provides functions for computing convex hulls and Delaunay triangulations in \f$ d\f$-dimensional Euclidean space.} -\cgalPkgManuals{Chapter_dD_Convex_Hulls_and_Delaunay_Triangulations,PkgConvexHullD} +\cgalPkgManuals{Chapter_dD_Convex_Hulls_and_Delaunay_Triangulations,PkgConvexHullDRef} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{2.3} @@ -18,7 +18,7 @@ \cgalPkgShortInfoEnd \cgalPkgDescriptionEnd -\deprecated This package is deprecated since the version 4.6 of \cgal. The package \ref PkgTriangulationsSummary should be used instead. +\deprecated This package is deprecated since the version 4.6 of \cgal. The package \ref PkgTriangulations should be used instead. A subset \f$ S \subseteq \mathbb{R}^d\f$ is convex if for any two points \f$ p\f$ and \f$ q\f$ in the set the line segment with endpoints \f$ p\f$ and \f$ q\f$ is contained diff --git a/Convex_hull_d/test/Convex_hull_d/CMakeLists.txt b/Convex_hull_d/test/Convex_hull_d/CMakeLists.txt index 25cc178896b..fc19860c41c 100644 --- a/Convex_hull_d/test/Convex_hull_d/CMakeLists.txt +++ b/Convex_hull_d/test/Convex_hull_d/CMakeLists.txt @@ -4,19 +4,13 @@ project( Convex_hull_d_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - include_directories (BEFORE "../../include") - - include_directories (BEFORE "include") + include_directories (BEFORE "include") # create a target per cppfile file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) diff --git a/Distance_2/test/Distance_2/CMakeLists.txt b/Distance_2/test/Distance_2/CMakeLists.txt index 5aec01f2bb0..0b93c5f718c 100644 --- a/Distance_2/test/Distance_2/CMakeLists.txt +++ b/Distance_2/test/Distance_2/CMakeLists.txt @@ -4,18 +4,12 @@ project( Distance_2_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Distance_3/test/Distance_3/CMakeLists.txt b/Distance_3/test/Distance_3/CMakeLists.txt index 83ca2e35032..b72be7f7218 100644 --- a/Distance_3/test/Distance_3/CMakeLists.txt +++ b/Distance_3/test/Distance_3/CMakeLists.txt @@ -4,18 +4,12 @@ project( Distance_3_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Documentation/doc/CMakeLists.txt b/Documentation/doc/CMakeLists.txt index 0ecafab9f7c..3e630a9ae3e 100644 --- a/Documentation/doc/CMakeLists.txt +++ b/Documentation/doc/CMakeLists.txt @@ -1,7 +1,7 @@ project(Documentation NONE) # Minimal version of CMake: -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.1) # Check whether this cmake script is the top level one if ( ${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/Documentation/doc/Documentation/Developer_manual/Chapter_iterators_and_circulators.txt b/Documentation/doc/Documentation/Developer_manual/Chapter_iterators_and_circulators.txt index 900eda9aa58..d1407672ac5 100644 --- a/Documentation/doc/Documentation/Developer_manual/Chapter_iterators_and_circulators.txt +++ b/Documentation/doc/Documentation/Developer_manual/Chapter_iterators_and_circulators.txt @@ -19,15 +19,15 @@ Iterators are widely used in \cgal too. \cgal extends the idea of the iterator, which works for linear data structures, to circular data structures by defining the concept of a circulator. -\ref PkgHandlesAndCirculatorsSummary "Circulators" are quite similar to iterators, with the +\ref PkgHandlesAndCirculators "Circulators" are quite similar to iterators, with the major difference being the absence of a past-the-end position in a sequence. Note that circulators are NOT part of the \stl, but of \cgal. -In \cgal, we also define the concept of \ref PkgHandlesAndCirculatorsSummary "handle", +In \cgal, we also define the concept of \ref PkgHandlesAndCirculators "handle", which behaves roughly like a pointer to an object without an increment or decrement operation. More details about handles and their requirements can be found in -the \ref PkgHandlesAndCirculatorsSummary "chapter Circulators and Handles" +the \ref PkgHandlesAndCirculators "chapter Circulators and Handles" of the Support Library part of \cgal manual. Section \ref sechandle_vs_it_vs_circ below discusses when handles should be used in your code. @@ -35,7 +35,7 @@ should be used in your code. The concepts of iterators is relatively well described in textbooks such as Stroustrup's book (The C++ Programming Language \cgalCite{cgal:s-cpl-97}) and Austern's book (Generic Programming and the \stl \cgalCite{cgal:a-gps-98}) -and in chapter \ref PkgHandlesAndCirculatorsSummary "Handles and Circulators" +and in chapter \ref PkgHandlesAndCirculators "Handles and Circulators" of the Support Library part of the \cgal manual. which also presents the concepts of handles and circulators. Thus we will not give a full description of these concept here @@ -325,7 +325,7 @@ over either a linear or circular sequence: - `CGAL_For_all( ic1, ic2)` - `CGAL_For_all_backwards( ic1, ic2)`. -See the chapter \ref PkgHandlesAndCirculatorsSummary "Handles and Circulators" +See the chapter \ref PkgHandlesAndCirculators "Handles and Circulators" in the Support Library part of \cgal manual for more information and examples. diff --git a/Documentation/doc/Documentation/Doxyfile.in b/Documentation/doc/Documentation/Doxyfile.in index 952c61acf1c..c4efea1bc5e 100644 --- a/Documentation/doc/Documentation/Doxyfile.in +++ b/Documentation/doc/Documentation/Doxyfile.in @@ -18,7 +18,8 @@ HTML_EXTRA_FILES += ${CGAL_DOC_RESOURCE_DIR}/hacks.js \ ${CGAL_DOC_RESOURCE_DIR}/menu_version.js \ ${CGAL_DOC_RESOURCE_DIR}/cgal_stylesheet.css \ ${CMAKE_BINARY_DIR}/how_to_cite_cgal.bib \ - ${CMAKE_BINARY_DIR}/how_to_cite.html + ${CMAKE_BINARY_DIR}/how_to_cite.html \ + ${CGAL_PACKAGE_DOC_DIR}/fig/g-196x196-doc.png ALLEXTERNALS = true EXTERNAL_GROUPS = false diff --git a/Documentation/doc/Documentation/General.txt b/Documentation/doc/Documentation/General.txt index 0941991e41c..a161413f038 100644 --- a/Documentation/doc/Documentation/General.txt +++ b/Documentation/doc/Documentation/General.txt @@ -1,186 +1,239 @@ -///This concept refers to the one described at http://www.sgi.com/tech/stl/Assignable.html. -/// -///Using the latest concepts of the \cpp standard, a type that is a model of this concept -///is both CopyAssignable -///and CopyConstructible. +///This concept refines both +/// CopyAssignable +///and CopyConstructible. class Assignable {}; /// \cgalConcept /// Concept from the \cpp standard. -/// See http://en.cppreference.com/w/cpp/concept/DefaultConstructible +/// See https://en.cppreference.com/w/cpp/named_req/DefaultConstructible class DefaultConstructible {}; /// \cgalConcept /// Concept from the \cpp standard. -/// See http://en.cppreference.com/w/cpp/concept/CopyConstructible +/// See https://en.cppreference.com/w/cpp/named_req/CopyConstructible class CopyConstructible {}; /// \cgalConcept /// Concept from the \cpp standard. -/// See http://en.cppreference.com/w/cpp/concept/Callable +/// See https://en.cppreference.com/w/cpp/named_req/Callable class Callable {}; /// \cgalConcept /// Concept from the \cpp standard. -/// See http://en.cppreference.com/w/cpp/concept/EqualityComparable +/// See https://en.cppreference.com/w/cpp/named_req/EqualityComparable class EqualityComparable {}; /// \cgalConcept /// Concept from the \cpp standard. -/// See http://en.cppreference.com/w/cpp/concept/LessThanComparable +/// See https://en.cppreference.com/w/cpp/named_req/LessThanComparable class LessThanComparable {}; /// \cgalConcept -/// The concept AdaptableFunctor defines an adaptable functor, that is, a functor that can be +/// The concept `AdaptableFunctor` defines an adaptable functor, that is, a functor that can be /// used with function object adaptors such as binders and composers. /// class AdaptableFunctor {}; + /// \cgalConcept -///This concept refers to the one described at http://www.sgi.com/tech/stl/AdaptableUnaryFunction.html. -class AdaptableUnaryFunction {}; +/// Adaptable functor with one argument +/// \cgalRefines AdaptableFunctor +class AdaptableUnaryFunction +{ +public: + /// result_type + typedef unspecified_type result_type; + /// argument_type + typedef unspecified_type argument_type; + /// operator type + result_type operator()(argument_type); +}; + /// \cgalConcept -///This concept refers to the one described at http://www.sgi.com/tech/stl/AdaptableBinaryFunction.html. -class AdaptableBinaryFunction {}; +/// Adaptable functor with two arguments +/// \cgalRefines AdaptableFunctor +class AdaptableBinaryFunction +{ +public: + /// result_type + typedef unspecified_type result_type; + /// first argument_type + typedef unspecified_type first_argument_type; + /// second argument_type + typedef unspecified_type second_argument_type; + /// operator type + result_type operator()(first_argument_type, second_argument_type); +}; /// \cgalConcept /// Concept from the \cpp standard. -/// See http://en.cppreference.com/w/cpp/concept/Iterator +/// See https://en.cppreference.com/w/cpp/named_req/Iterator class Iterator {}; /// \cgalConcept /// Concept from the \cpp standard. -/// See http://en.cppreference.com/w/cpp/concept/OutputIterator +/// See https://en.cppreference.com/w/cpp/named_req/OutputIterator class OutputIterator {}; /// \cgalConcept /// Concept from the \cpp standard. -/// See http://en.cppreference.com/w/cpp/concept/InputIterator +/// See https://en.cppreference.com/w/cpp/named_req/InputIterator class InputIterator {}; /// \cgalConcept /// Concept from the \cpp standard. -/// See http://en.cppreference.com/w/cpp/concept/ForwardIterator +/// See https://en.cppreference.com/w/cpp/named_req/ForwardIterator class ForwardIterator {}; /// \cgalConcept /// Concept from the \cpp standard. -/// See http://en.cppreference.com/w/cpp/concept/RandomAccessIterator +/// See https://en.cppreference.com/w/cpp/named_req/RandomAccessIterator class RandomAccessIterator {}; /// \cgalConcept /// Concept from the \cpp standard. -/// See http://en.cppreference.com/w/cpp/concept/BidirectionalIterator +/// See https://en.cppreference.com/w/cpp/named_req/BidirectionalIterator class BidirectionalIterator {}; /// \cgalConcept -/// This concept refers to the one described at http://www.sgi.com/tech/stl/RandomAccessContainer.html. -/// -/// It is a container that is a model of -/// ReversibleContainer and whose iterator type is a model of -/// RandomAccessIterator. -class RandomAccessContainer {}; +/// Concept from the \cpp standard. +/// See https://en.cppreference.com/w/cpp/named_req/Swappable +class Swappable {}; + /// \cgalConcept -/// This concepts refers to the one described at http://www.sgi.com/tech/stl/BackInsertionSequence.html. -/// -/// It is a container that is a model of -/// SequenceContainer -/// that has the ability to append elements at the end of the sequence and to access the last element, both in amortized constant time. -class BackInsertionSequence {}; +/// Concept from the \cpp standard. +/// See https://en.cppreference.com/w/cpp/named_req/Container +class Container {}; + +/// \cgalConcept +/// Concept from the \cpp standard. +/// See https://en.cppreference.com/w/cpp/named_req/ReversibleContainer +class ReversibleContainer {}; + +/// \cgalConcept +/// Concept from the \cpp standard. +/// See https://en.cppreference.com/w/cpp/named_req/AssociativeContainer +class AssociativeContainer {}; + +/// \cgalConcept +/// Concept from the \cpp standard. +/// See https://en.cppreference.com/w/cpp/named_req/SequenceContainer +class SequenceContainer {}; + +/// \cgalConcept +/// This container concept refines +/// ReversibleContainer and its iterator type is a model of +/// RandomAccessIterator. +class RandomAccessContainer {}; + +/// \cgalConcept +/// This container concepts refines +/// SequenceContainer and +/// has the ability to append elements at the end of the sequence and to access the last element, both in amortized constant time. +class BackInsertionSequence +{ +public: + /// returns the last inserted element. + const value_type& back() const; + /// removes the last inserted element if not empty. + void pop_back() + /// inserts an element + void push_back(const value_type&) +}; /*! -See http://www.boost.org/libs/property_map/doc/LvaluePropertyMap.html +See https://www.boost.org/libs/property_map/doc/LvaluePropertyMap.html \cgalConcept */ class LvaluePropertyMap {}; /*! -See http://www.boost.org/libs/property_map/doc/ReadWritePropertyMap.html +See https://www.boost.org/libs/property_map/doc/ReadWritePropertyMap.html \cgalConcept */ class ReadWritePropertyMap {}; /*! -See http://www.boost.org/libs/property_map/doc/WritablePropertyMap.html +See https://www.boost.org/libs/property_map/doc/WritablePropertyMap.html \cgalConcept */ class WritablePropertyMap {}; /*! -See http://www.boost.org/libs/property_map/doc/ReadablePropertyMap.html +See https://www.boost.org/libs/property_map/doc/ReadablePropertyMap.html \cgalConcept */ class ReadablePropertyMap {}; /*! -See http://www.boost.org/libs/range/doc/html/range/concepts/single_pass_range.html +See https://www.boost.org/libs/range/doc/html/range/concepts/single_pass_range.html \cgalConcept */ class SinglePassRange {}; /*! -See http://www.boost.org/libs/range/doc/html/range/concepts/random_access_range.html +See https://www.boost.org/libs/range/doc/html/range/concepts/random_access_range.html \cgalConcept */ class RandomAccessRange {}; /*! -See http://www.boost.org/libs/range/doc/html/range/concepts/forward_range.html +See https://www.boost.org/libs/range/doc/html/range/concepts/forward_range.html \cgalConcept */ class ForwardRange {}; /*! Concept from the Boost Graph Library. -See http://www.boost.org/libs/graph/doc/IncidenceGraph.html +See https://www.boost.org/libs/graph/doc/IncidenceGraph.html \cgalConcept */ class IncidenceGraph {}; /*! Concept from the Boost Graph Library. -See http://www.boost.org/libs/graph/doc/BidirectionalGraph.html +See https://www.boost.org/libs/graph/doc/BidirectionalGraph.html \cgalConcept */ class BidirectionalGraph {}; /*! Concept from the Boost Graph Library. -See http://www.boost.org/libs/graph/doc/VertexAndEdgeListGraph.html +See https://www.boost.org/libs/graph/doc/VertexAndEdgeListGraph.html \cgalConcept */ class VertexAndEdgeListGraph {}; /*! Concept from the Boost Graph Library. -See http://www.boost.org/libs/graph/doc/AdjacencyGraph.html +See https://www.boost.org/libs/graph/doc/AdjacencyGraph.html \cgalConcept */ class AdjacencyGraph {}; /*! Concept from the Boost Graph Library. -See http://www.boost.org/libs/graph/doc/AdjacencyMatrix.html +See https://www.boost.org/libs/graph/doc/AdjacencyMatrix.html \cgalConcept */ class AdjacencyMatrix {}; /*! Concept from the Boost Graph Library. -See http://www.boost.org/libs/graph/doc/MutableGraph.html +See https://www.boost.org/libs/graph/doc/MutableGraph.html \cgalConcept */ class MutableGraph {}; /*! Concept from the Boost Graph Library. -See http://www.boost.org/libs/graph/doc/PropertyGraph.html +See https://www.boost.org/libs/graph/doc/PropertyGraph.html \cgalConcept */ class PropertyGraph {}; /*! Concept from the Boost Graph Library. -See http://www.boost.org/libs/graph/doc/MutablePropertyGraph.html +See https://www.boost.org/libs/graph/doc/MutablePropertyGraph.html \cgalConcept */ class MutablePropertyGraph {}; diff --git a/Documentation/doc/Documentation/Installation.txt b/Documentation/doc/Documentation/Installation.txt index 9516d1779c8..b5ba993f4f5 100644 --- a/Documentation/doc/Documentation/Installation.txt +++ b/Documentation/doc/Documentation/Installation.txt @@ -159,7 +159,7 @@ In order to build the \cgal libraries, you need a \cpp compiler. | :------- | :--------------- | |\sc{Gnu} `g++` 4.1 or later\cgalFootnote{`http://gcc.gnu.org/`} | Linux / MacOS X | | | \sc{MS} Windows | -|\sc{MS} Visual `C++` 12.0, 14.0, 15.0 (\sc{Visual Studio} 2013, 2015, and 2017)\cgalFootnote{`http://msdn.microsoft.com/en-us/vstudio/`} | \sc{MS} Windows | +|\sc{MS} Visual `C++` 12.0, 14.0, 15.7 (\sc{Visual Studio} 2013, 2015, and 2017)\cgalFootnote{`http://msdn.microsoft.com/en-us/vstudio/`} | \sc{MS} Windows | | `Clang` \cgalFootnote{`http://clang.llvm.org/`} compiler version 6.0.0 | Linux | | Apple `Clang` compiler version 7.0.2 | MacOS X | @@ -356,7 +356,7 @@ header-only. \subsubsection subsection_headeronly_pbonwindows Possible Problem on Windows -There is one possible problem when using \cgal in header-only mode on a Windows operating system when compiling a program using several modules (executable programs or dynamic-link libraries DLL). If two different modules use the same static variable, this variable is defined independently in each of these modules. If one module modifies the value of this variable, it will not be modified in the other module, which could induce an unexpected behavior. In \cgal, this concerns only a few specific variables: the default random, the failure behavior, IO mode. One example is the following: if you change the default random in one DLL, then if you use the default random in another DLL, you will not obtain the modified default random but the original one. +There is one possible problem when using \cgal in header-only mode on a Windows operating system when compiling a program using several modules (executable programs or dynamic-link libraries DLL). If two different modules use the same static variable, this variable is defined independently in each of these modules. If one module modifies the value of this variable, it will not be modified in the other module, which could induce an unexpected behavior. In \cgal, this concerns only a few specific variables: the default random, the failure behavior, IO mode. One example is the following: if you change the default random in one DLL, then if you use the default random in another DLL, you will not obtain the modified default random but the original one. \section secessential3rdpartysoftware Essential Third Party Libraries @@ -439,7 +439,7 @@ of \sc{Gmp} and \sc{Mpfr}, which can be downloaded with the installer \sc{zlib} is a data compression library, and is essential for the component libCGAL_ImageIO. -In \cgal this library is used in the examples of the \ref PkgSurfaceMesher3 package. +In \cgal this library is used in the examples of the \ref PkgSurfaceMesher3Ref package. If it is not already on your system, for instance, on Windows, you can download it from `http://www.zlib.net/`. @@ -511,7 +511,7 @@ represented using \sc{Mpfr} reliable floating-point numbers. It is based on the libraries \sc{Gmp} and \sc{Mpfr}. In the setting of \cgal, this library is optional: it is used by some models of the -\ref PkgAlgebraicKerneld "Algebraic Kernel". +\ref PkgAlgebraicKernelDRef "Algebraic Kernel". \sc{Mpfi} can be downloaded from `http://mpfi.gforge.inria.fr/`. Version 1.4 or higher is recommended. @@ -520,7 +520,7 @@ optional: it is used by some models of the \sc{Rs} (Real Solutions) is devoted to the study of the real roots of polynomial systems with a finite number of complex roots (including univariate polynomials). In \cgal, \sc{Rs} is used by one model of the -\ref PkgAlgebraicKerneld "Algebraic Kernel". +\ref PkgAlgebraicKernelDRef "Algebraic Kernel". \sc{Rs} is freely distributable for non-commercial use. You can download it from `http://vegas.loria.fr/rs/`. Actually, the \sc{Rs} package also includes \sc{Rs3}, the @@ -543,11 +543,11 @@ to speed up operations of the Polynomial package, such as GCDs. It is recommende \sc{Eigen} is a `C++` template library for linear algebra. \sc{Eigen} supports all matrix sizes, various matrix decomposition methods and sparse linear solvers. -In \cgal, \sc{Eigen} provides sparse linear solvers in the \ref PkgPoissonSurfaceReconstruction -and the \ref PkgSurfaceParameterization packages. +In \cgal, \sc{Eigen} provides sparse linear solvers in the \ref PkgPoissonSurfaceReconstruction3Ref +and the \ref PkgSurfaceMeshParameterizationRef packages. -In addition, \sc{Eigen} also provides singular value decomposition for the \ref PkgJet_fitting_3 -and the \ref PkgRidges_3 packages. +In addition, \sc{Eigen} also provides singular value decomposition for the \ref PkgJetFitting3Ref +and the \ref PkgRidges3Ref packages. The \sc{Eigen} web site is `http://eigen.tuxfamily.org`. @@ -557,7 +557,7 @@ The \sc{Esbtl} (Easy Structural Biology Template Library) is a library that allo the handling of \sc{Pdb} data. In \cgal the \sc{Esbtl} is used in an example of the -\ref PkgSkinSurface3 package. +\ref PkgSkinSurface3Ref package. It can be downloaded from `http://esbtl.sourceforge.net/`. @@ -576,7 +576,7 @@ The \sc{Tbb} web site is `http: the LAS format (or the compressed LAZ format). In \cgal, \sc{LASlib} is used to provide input and output functions in -the \ref PkgPointSetProcessing package. +the \ref PkgPointSetProcessing3Ref package. The \sc{LASlib} web site is `https://rapidlasso.com/lastools/`. \sc{LASlib} @@ -589,10 +589,22 @@ CMake based install procedure. \sc{OpenCV} (Open Computer Vision) is a library designed for computer vision, computer graphics and machine learning. -In \cgal, \sc{OpenCV} is used by the \ref PkgClassification package. +In \cgal, \sc{OpenCV} is used by the \ref PkgClassificationRef package. The \sc{OpenCV} web site is `http://opencv.org/`. +\subsection thirdpartyMETIS METIS + +\sc{METIS} is a library developed by the Karypis Lab +and designed to partition graphs and produce fill-reducing matrix orderings. + +\cgal offers wrappers around some of the methods of the \sc{METIS} library +to allow the partitioning of graphs that are models of the concepts of the +Boost Graph Library, +and, by extension, of surface meshes (see Section \ref BGLPartitioning of the package \ref PkgBGL). + +More information is available on the METIS library +at `http://glaros.dtc.umn.edu/gkhome/metis/metis/overview`. \section secbuilding Building CGAL diff --git a/Documentation/doc/Documentation/Preliminaries.txt b/Documentation/doc/Documentation/Preliminaries.txt index 8239fdb7b8e..6d03fb0d21d 100644 --- a/Documentation/doc/Documentation/Preliminaries.txt +++ b/Documentation/doc/Documentation/Preliminaries.txt @@ -171,7 +171,7 @@ been implemented yet. \section Preliminaries_functor Functor Return Types \cgal functors support the -result_of +result_of protocol. If a functor `F` has the same return type across all overloads of `operator()`, the nested type `F::result_type` is defined to be that type. Otherwise the diff --git a/Documentation/doc/Documentation/Tutorials/Tutorial_hello_world.txt b/Documentation/doc/Documentation/Tutorials/Tutorial_hello_world.txt index 99b6ca99c44..e90944007da 100644 --- a/Documentation/doc/Documentation/Tutorials/Tutorial_hello_world.txt +++ b/Documentation/doc/Documentation/Tutorials/Tutorial_hello_world.txt @@ -318,7 +318,7 @@ This function only compiles if the `operator<(..)` is defined for the type used and we say that the type must be a model of `LessThanComparable`. An example for a concept with required free functions is the `HalfedgeListGraph` in the -\cgal package \ref PkgBGLSummary. In order to be a model of `HalfedgeListGraph` a class `G` +\cgal package \ref PkgBGL. In order to be a model of `HalfedgeListGraph` a class `G` there must be a global function `halfedges(const G&)`, etc. An example for a concept with a required traits class is `InputIterator`. diff --git a/Documentation/doc/Documentation/fig/g-196x196-doc.png b/Documentation/doc/Documentation/fig/g-196x196-doc.png new file mode 100644 index 00000000000..4f76b36d170 Binary files /dev/null and b/Documentation/doc/Documentation/fig/g-196x196-doc.png differ diff --git a/Documentation/doc/resources/1.8.13/header.html b/Documentation/doc/resources/1.8.13/header.html index 43813868edd..5edbcbc3ec0 100644 --- a/Documentation/doc/resources/1.8.13/header.html +++ b/Documentation/doc/resources/1.8.13/header.html @@ -2,6 +2,7 @@ + diff --git a/Documentation/doc/resources/1.8.13/header_package.html b/Documentation/doc/resources/1.8.13/header_package.html index b8e775ceecd..a70e9ff6742 100644 --- a/Documentation/doc/resources/1.8.13/header_package.html +++ b/Documentation/doc/resources/1.8.13/header_package.html @@ -2,6 +2,7 @@ + diff --git a/Documentation/doc/resources/1.8.13/menu_version.js b/Documentation/doc/resources/1.8.13/menu_version.js index 6bd5b1f4f57..c575b27aff5 100644 --- a/Documentation/doc/resources/1.8.13/menu_version.js +++ b/Documentation/doc/resources/1.8.13/menu_version.js @@ -3,11 +3,13 @@ var url_re = /(cgal\.geometryfactory\.com\/CGAL\/doc\/|doc\.cgal\.org\/)(master|latest|(\d\.\d+|\d\.\d+\.\d+))\//; var url_local = /.*\/doc_output\//; + var current_version_local = '4.13-beta1' var all_versions = [ 'master', 'latest', - '4.12', - '4.11.1', + '4.13', + '4.12.1', + '4.11.3', '4.10.2', '4.9.1', '4.8.2', @@ -20,7 +22,6 @@ function build_select(current_version) { var buf = [''); return buf.join(''); } @@ -76,7 +81,7 @@ else { match = url_local.exec(window.location.href); if (match) { - var version = '4.11'; + var version = current_version_local; var select = build_select(version); spanNode.innerHTML=select; $('.version_menu select').bind('change', on_switch); diff --git a/Documentation/doc/resources/1.8.14/header.html b/Documentation/doc/resources/1.8.14/header.html index 43813868edd..5edbcbc3ec0 100644 --- a/Documentation/doc/resources/1.8.14/header.html +++ b/Documentation/doc/resources/1.8.14/header.html @@ -2,6 +2,7 @@ + diff --git a/Documentation/doc/resources/1.8.14/header_package.html b/Documentation/doc/resources/1.8.14/header_package.html index b8e775ceecd..a70e9ff6742 100644 --- a/Documentation/doc/resources/1.8.14/header_package.html +++ b/Documentation/doc/resources/1.8.14/header_package.html @@ -2,6 +2,7 @@ + diff --git a/Documentation/doc/resources/1.8.14/menu_version.js b/Documentation/doc/resources/1.8.14/menu_version.js index 6bd5b1f4f57..c575b27aff5 100644 --- a/Documentation/doc/resources/1.8.14/menu_version.js +++ b/Documentation/doc/resources/1.8.14/menu_version.js @@ -3,11 +3,13 @@ var url_re = /(cgal\.geometryfactory\.com\/CGAL\/doc\/|doc\.cgal\.org\/)(master|latest|(\d\.\d+|\d\.\d+\.\d+))\//; var url_local = /.*\/doc_output\//; + var current_version_local = '4.13-beta1' var all_versions = [ 'master', 'latest', - '4.12', - '4.11.1', + '4.13', + '4.12.1', + '4.11.3', '4.10.2', '4.9.1', '4.8.2', @@ -20,7 +22,6 @@ function build_select(current_version) { var buf = [''); return buf.join(''); } @@ -76,7 +81,7 @@ else { match = url_local.exec(window.location.href); if (match) { - var version = '4.11'; + var version = current_version_local; var select = build_select(version); spanNode.innerHTML=select; $('.version_menu select').bind('change', on_switch); diff --git a/Documentation/doc/resources/1.8.4/header.html b/Documentation/doc/resources/1.8.4/header.html index 07461540edd..b125e40186c 100644 --- a/Documentation/doc/resources/1.8.4/header.html +++ b/Documentation/doc/resources/1.8.4/header.html @@ -1,6 +1,7 @@ + $projectname: $title diff --git a/Documentation/doc/resources/1.8.4/header_package.html b/Documentation/doc/resources/1.8.4/header_package.html index 1a655bea646..65b3e1d9eac 100644 --- a/Documentation/doc/resources/1.8.4/header_package.html +++ b/Documentation/doc/resources/1.8.4/header_package.html @@ -1,6 +1,7 @@ + $projectname: $title diff --git a/Documentation/doc/resources/1.8.4/menu_version.js b/Documentation/doc/resources/1.8.4/menu_version.js index 6bd5b1f4f57..c575b27aff5 100644 --- a/Documentation/doc/resources/1.8.4/menu_version.js +++ b/Documentation/doc/resources/1.8.4/menu_version.js @@ -3,11 +3,13 @@ var url_re = /(cgal\.geometryfactory\.com\/CGAL\/doc\/|doc\.cgal\.org\/)(master|latest|(\d\.\d+|\d\.\d+\.\d+))\//; var url_local = /.*\/doc_output\//; + var current_version_local = '4.13-beta1' var all_versions = [ 'master', 'latest', - '4.12', - '4.11.1', + '4.13', + '4.12.1', + '4.11.3', '4.10.2', '4.9.1', '4.8.2', @@ -20,7 +22,6 @@ function build_select(current_version) { var buf = [''); return buf.join(''); } @@ -76,7 +81,7 @@ else { match = url_local.exec(window.location.href); if (match) { - var version = '4.11'; + var version = current_version_local; var select = build_select(version); spanNode.innerHTML=select; $('.version_menu select').bind('change', on_switch); diff --git a/Envelope_2/doc/Envelope_2/CGAL/Envelope_diagram_1.h b/Envelope_2/doc/Envelope_2/CGAL/Envelope_diagram_1.h index 5458eeee9f3..8bc3b12b7e4 100644 --- a/Envelope_2/doc/Envelope_2/CGAL/Envelope_diagram_1.h +++ b/Envelope_2/doc/Envelope_2/CGAL/Envelope_diagram_1.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgEnvelope2 +\ingroup PkgEnvelope2Ref This class is the default envelope-diagram class used by envelope functions to represent the minimization or the maximization diagram of a set of curves. diff --git a/Envelope_2/doc/Envelope_2/CGAL/envelope_2.h b/Envelope_2/doc/Envelope_2/CGAL/envelope_2.h index b6c9172ef2e..d45a0463b5f 100644 --- a/Envelope_2/doc/Envelope_2/CGAL/envelope_2.h +++ b/Envelope_2/doc/Envelope_2/CGAL/envelope_2.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgEnvelope2 +\ingroup PkgEnvelope2Ref Computes the lower envelope of a set of curves in \f$ \mathbb{R}^2\f$, as given by the range `[begin, end)`. The lower envelope is @@ -19,7 +19,7 @@ EnvelopeDiagram& diag); namespace CGAL { /*! -\ingroup PkgEnvelope2 +\ingroup PkgEnvelope2Ref Computes the lower envelope of a set of \f$ x\f$-monotone curves in \f$ \mathbb{R}^2\f$, as given by the range `[begin, end)`. The lower @@ -38,7 +38,7 @@ EnvelopeDiagram& diag); namespace CGAL { /*! -\ingroup PkgEnvelope2 +\ingroup PkgEnvelope2Ref Computes the upper envelope of a set of curves in \f$ \mathbb{R}^2\f$, as given by the range `[begin, end)`. The upper envelope is @@ -56,7 +56,7 @@ EnvelopeDiagram& diag); namespace CGAL { /*! -\ingroup PkgEnvelope2 +\ingroup PkgEnvelope2Ref Computes the upper envelope of a set of \f$ x\f$-monotone curves in \f$ \mathbb{R}^2\f$, as given by the range `[begin, end)`. The upper diff --git a/Envelope_2/doc/Envelope_2/PackageDescription.txt b/Envelope_2/doc/Envelope_2/PackageDescription.txt index 23f43104d00..c5f8b125e8b 100644 --- a/Envelope_2/doc/Envelope_2/PackageDescription.txt +++ b/Envelope_2/doc/Envelope_2/PackageDescription.txt @@ -1,19 +1,19 @@ -/// \defgroup PkgEnvelope2 2D Envelopes Reference +/// \defgroup PkgEnvelope2Ref 2D Envelopes Reference /// \defgroup PkgEnvelope2Concepts Concepts -/// \ingroup PkgEnvelope2 +/// \ingroup PkgEnvelope2Ref /*! -\addtogroup PkgEnvelope2 +\addtogroup PkgEnvelope2Ref \todo check generated documentation -\cgalPkgDescriptionBegin{2D Envelopes,PkgEnvelope2Summary} +\cgalPkgDescriptionBegin{2D Envelopes,PkgEnvelope2} \cgalPkgPicture{Envelope_2/fig/Envelope_2.png} \cgalPkgSummaryBegin \cgalPkgAuthor{Ron Wein} \cgalPkgDesc{This package consits of functions that computes the lower (or upper) envelope of a set of arbitrary curves in 2D. The output is represented as an envelope diagram, namely a subdivision of the \f$ x\f$-axis into intervals, such that the identity of the curves that induce the envelope on each interval is unique.} -\cgalPkgManuals{Chapter_Envelopes_of_Curves_in_2D,PkgEnvelope2} +\cgalPkgManuals{Chapter_Envelopes_of_Curves_in_2D,PkgEnvelope2Ref} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{3.3} -\cgalPkgDependsOn{\ref PkgArrangement2Summary} +\cgalPkgDependsOn{\ref PkgArrangementOnSurface2} \cgalPkgBib{cgal:w-e2} \cgalPkgLicense{\ref licensesGPL "GPL"} \cgalPkgShortInfoEnd diff --git a/Envelope_2/examples/Envelope_2/CMakeLists.txt b/Envelope_2/examples/Envelope_2/CMakeLists.txt index 549166bf226..936b6d1dabb 100644 --- a/Envelope_2/examples/Envelope_2/CMakeLists.txt +++ b/Envelope_2/examples/Envelope_2/CMakeLists.txt @@ -4,18 +4,12 @@ project( Envelope_2_Examples ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Envelope_2/test/Envelope_2/CMakeLists.txt b/Envelope_2/test/Envelope_2/CMakeLists.txt index 459ea1595b7..01cd46d3976 100644 --- a/Envelope_2/test/Envelope_2/CMakeLists.txt +++ b/Envelope_2/test/Envelope_2/CMakeLists.txt @@ -4,18 +4,12 @@ project( Envelope_2_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Envelope_3/doc/Envelope_3/CGAL/Env_plane_traits_3.h b/Envelope_3/doc/Envelope_3/CGAL/Env_plane_traits_3.h index 47c5254d1db..c1a839a38be 100644 --- a/Envelope_3/doc/Envelope_3/CGAL/Env_plane_traits_3.h +++ b/Envelope_3/doc/Envelope_3/CGAL/Env_plane_traits_3.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgEnvelope3 +\ingroup PkgEnvelope3Ref The traits class `Env_plane_traits_3` models the `EnvelopeTraits_3` concept, and is used for the construction of lower and upper envelopes of planes diff --git a/Envelope_3/doc/Envelope_3/CGAL/Env_sphere_traits_3.h b/Envelope_3/doc/Envelope_3/CGAL/Env_sphere_traits_3.h index faffe652e84..157ad738d8f 100644 --- a/Envelope_3/doc/Envelope_3/CGAL/Env_sphere_traits_3.h +++ b/Envelope_3/doc/Envelope_3/CGAL/Env_sphere_traits_3.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgEnvelope3 +\ingroup PkgEnvelope3Ref The traits class `Env_sphere_traits_3` models the `EnvelopeTraits_3` concept, and is used for the construction of lower and upper envelopes diff --git a/Envelope_3/doc/Envelope_3/CGAL/Env_surface_data_traits_3.h b/Envelope_3/doc/Envelope_3/CGAL/Env_surface_data_traits_3.h index 30dbf206ca1..9c8fbdec403 100644 --- a/Envelope_3/doc/Envelope_3/CGAL/Env_surface_data_traits_3.h +++ b/Envelope_3/doc/Envelope_3/CGAL/Env_surface_data_traits_3.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgEnvelope3 +\ingroup PkgEnvelope3Ref The class `Env_surface_data_traits_3` is a model of the `EnvelopeTraits_3` concept and serves as a decorator class that allows the extension of the surfaces diff --git a/Envelope_3/doc/Envelope_3/CGAL/Env_triangle_traits_3.h b/Envelope_3/doc/Envelope_3/CGAL/Env_triangle_traits_3.h index 0043b162c32..87ade2cb2ff 100644 --- a/Envelope_3/doc/Envelope_3/CGAL/Env_triangle_traits_3.h +++ b/Envelope_3/doc/Envelope_3/CGAL/Env_triangle_traits_3.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgEnvelope3 +\ingroup PkgEnvelope3Ref The traits class `Env_triangle_traits_3` models the `EnvelopeTraits_3` concept, and is used for the construction of lower and upper envelopes diff --git a/Envelope_3/doc/Envelope_3/CGAL/envelope_3.h b/Envelope_3/doc/Envelope_3/CGAL/envelope_3.h index d5c6b319111..d281cdb698d 100644 --- a/Envelope_3/doc/Envelope_3/CGAL/envelope_3.h +++ b/Envelope_3/doc/Envelope_3/CGAL/envelope_3.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgEnvelope3 +\ingroup PkgEnvelope3Ref The class-template `Envelope_diagram_2` represents the minimization diagram that corresponds to the lower envelope of a set of curves, or the @@ -165,7 +165,7 @@ Envelope_diagram_2 (EnvTraits *traits); namespace CGAL { /*! -\ingroup PkgEnvelope3 +\ingroup PkgEnvelope3Ref Computes the lower envelope of a set of surfaces in \f$ \mathbb{R}^3\f$, as given by the range `[begin, end)`. The lower envelope is @@ -182,7 +182,7 @@ Envelope_diagram_2& diag); namespace CGAL { /*! -\ingroup PkgEnvelope3 +\ingroup PkgEnvelope3Ref Computes the lower envelope of a set of \f$ xy\f$-monotone surfaces in \f$ \mathbb{R}^3\f$, as given by the range `[begin, end)`. The lower @@ -199,7 +199,7 @@ Envelope_diagram_2& diag); namespace CGAL { /*! -\ingroup PkgEnvelope3 +\ingroup PkgEnvelope3Ref Computes the upper envelope of a set of surfaces in \f$ \mathbb{R}^3\f$, as given by the range `[begin, end)`. The upper envelope is @@ -216,7 +216,7 @@ Envelope_diagram_2& diag); namespace CGAL { /*! -\ingroup PkgEnvelope3 +\ingroup PkgEnvelope3Ref Computes the upper envelope of a set of \f$ xy\f$-monotone surfaces in \f$ \mathbb{R}^3\f$, as given by the range `[begin, end)`. The lower diff --git a/Envelope_3/doc/Envelope_3/PackageDescription.txt b/Envelope_3/doc/Envelope_3/PackageDescription.txt index afbadf2eaf2..b20188b1d1d 100644 --- a/Envelope_3/doc/Envelope_3/PackageDescription.txt +++ b/Envelope_3/doc/Envelope_3/PackageDescription.txt @@ -1,19 +1,19 @@ -/// \defgroup PkgEnvelope3 3D Envelopes Reference +/// \defgroup PkgEnvelope3Ref 3D Envelopes Reference /// \defgroup PkgEnvelope3Concepts Concepts -/// \ingroup PkgEnvelope3 +/// \ingroup PkgEnvelope3Ref /*! -\addtogroup PkgEnvelope3 +\addtogroup PkgEnvelope3Ref \todo check generated documentation -\cgalPkgDescriptionBegin{3D Envelopes,PkgEnvelope3Summary} +\cgalPkgDescriptionBegin{3D Envelopes,PkgEnvelope3} \cgalPkgPicture{Envelope_3/fig/Envelope_3.png} \cgalPkgSummaryBegin \cgalPkgAuthors{Dan Halperin, Michal Meyerovitch, Ron Wein, and Baruch Zukerman} \cgalPkgDesc{This package consits of functions that compute the lower (or upper) envelope of a set of arbitrary surfaces in 3D. The output is represented as an 2D envelope diagram, namely a planar subdivision such that the identity of the surfaces that induce the envelope over each diagram cell is unique.} -\cgalPkgManuals{Chapter_Envelopes_of_Surfaces_in_3D,PkgEnvelope3} +\cgalPkgManuals{Chapter_Envelopes_of_Surfaces_in_3D,PkgEnvelope3Ref} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{3.3} -\cgalPkgDependsOn{\ref PkgArrangement2Summary} +\cgalPkgDependsOn{\ref PkgArrangementOnSurface2} \cgalPkgBib{cgal:mwz-e3} \cgalPkgLicense{\ref licensesGPL "GPL"} \cgalPkgDemo{3D Envelopes,envelope_3.zip,L1 Voronoi Diagram,l1_voronoi_diagram_2.zip} diff --git a/Envelope_3/examples/Envelope_3/CMakeLists.txt b/Envelope_3/examples/Envelope_3/CMakeLists.txt index bc2fd788c22..4f3dd717ad7 100644 --- a/Envelope_3/examples/Envelope_3/CMakeLists.txt +++ b/Envelope_3/examples/Envelope_3/CMakeLists.txt @@ -4,17 +4,13 @@ project( Envelope_3_Examples ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET COMPONENTS Core ) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - include_directories (BEFORE "../../include") + include(${CGAL_USE_FILE}) # create a target per cppfile file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) diff --git a/Envelope_3/include/CGAL/Envelope_3/Envelope_divide_and_conquer_3.h b/Envelope_3/include/CGAL/Envelope_3/Envelope_divide_and_conquer_3.h index a06d8a56c57..0bc094544f1 100644 --- a/Envelope_3/include/CGAL/Envelope_3/Envelope_divide_and_conquer_3.h +++ b/Envelope_3/include/CGAL/Envelope_3/Envelope_divide_and_conquer_3.h @@ -46,7 +46,7 @@ #ifdef CGAL_ENVELOPE_USE_BFS_FACE_ORDER #include -#include +#include #include #endif @@ -92,7 +92,8 @@ namespace CGAL { // the envelope between 2 surfaces over a feature // of the arrangement // 4. Overlay_2 - overlay of 2 MinimizationDiagram_2 -template , @@ -138,9 +139,9 @@ protected: Ccb_halfedge_circulator; typedef typename Minimization_diagram_2::Halfedge_around_vertex_circulator Halfedge_around_vertex_circulator; - typedef typename Minimization_diagram_2::Outer_ccb_iterator + typedef typename Minimization_diagram_2::Outer_ccb_iterator Outer_ccb_iterator; - typedef typename Minimization_diagram_2::Inner_ccb_iterator + typedef typename Minimization_diagram_2::Inner_ccb_iterator Inner_ccb_iterator; typedef Arr_observer Md_observer; @@ -155,7 +156,7 @@ protected: public: // c'tor Envelope_divide_and_conquer_3(Envelope_type type = ENVELOPE_LOWER) - { + { // Allocate the traits. m_geom_traits = new Traits; m_own_traits = true; @@ -178,7 +179,7 @@ public: m_is_lower = ((type == ENVELOPE_LOWER) ? true : false); } - + // virtual destructor. virtual ~Envelope_divide_and_conquer_3() { @@ -199,11 +200,11 @@ public: Envelope_3::Arbitrary_dividor dividor; construct_lu_envelope(begin, end, result, dividor); } - + // compute the envelope of surfaces in 3D using the given set dividor template - void construct_lu_envelope(SurfaceIterator begin, SurfaceIterator end, + void construct_lu_envelope(SurfaceIterator begin, SurfaceIterator end, Minimization_diagram_2& result, SetDividor& dividor) { @@ -211,7 +212,7 @@ public: { return; // result is empty } - + // make the general surfaces xy-monotone std::list xy_monotones; for (; begin != end; ++begin) @@ -220,10 +221,10 @@ public: std::back_inserter(xy_monotones)); // recursively construct the envelope of the xy-monotone parts - construct_lu_envelope_xy_monotones(xy_monotones.begin(), + construct_lu_envelope_xy_monotones(xy_monotones.begin(), xy_monotones.end(), result, dividor); - CGAL_assertion(is_envelope_valid(result)); + CGAL_assertion(is_envelope_valid(result)); } // compute the envelope of xy-monotone surfaces in 3D, @@ -266,7 +267,7 @@ public: protected: - // compute the envelope of xy-monotone surfaces in 3D + // compute the envelope of xy-monotone surfaces in 3D template void construct_lu_envelope_xy_monotones(SurfaceIterator begin, SurfaceIterator end, @@ -284,25 +285,25 @@ protected: { // only one surface is in the collection. insert it the result Xy_monotone_surface_3& surf = *first; - + deal_with_one_surface(surf, result); - return; + return; } - + // divide the surfaces into 2 groups (insert surface to each group // alternately) // Efi: this copy is redundant. It is sufficient to determine the range std::list group1, group2; dividor(first, end, std::back_inserter(group1), std::back_inserter(group2)); - + // recursively calculate the LU_envelope of the 2 groups Minimization_diagram_2 result1(m_geom_traits), result2(m_geom_traits); construct_lu_envelope_xy_monotones(group1.begin(), group1.end(), result1, dividor); construct_lu_envelope_xy_monotones(group2.begin(), group2.end(), result2, dividor); - + // merge the results: merge_envelopes(result1, result2, result); @@ -323,7 +324,7 @@ protected: m_geom_traits-> construct_projected_boundary_2_object()(surf, std::back_inserter(boundary)); - + if (boundary.empty()) { //one infinite surface @@ -344,13 +345,13 @@ protected: Oriented_side side = boundary_cv.second; Halfedge_handle he = insert_non_intersecting_curve(result, boundary_cv.first); - + if (side == ON_ORIENTED_BOUNDARY) { // vertical xy-surface he->face()->set_no_data(); he->twin()->face()->set_no_data(); - + continue; } @@ -374,41 +375,41 @@ protected: he->twin()->face()->set_no_data(); } - // init auxiliary data for f and its boundarys. + // init auxiliary data for f and its boundarys. for(Outer_ccb_iterator ocit = f->outer_ccbs_begin(); ocit != f->outer_ccbs_end(); ocit++){ Ccb_halfedge_circulator face_hec = *ocit; Ccb_halfedge_circulator face_hec_begin = face_hec; - do + do { face_hec->set_is_equal_data_in_face(true); face_hec->set_has_equal_data_in_face(true); face_hec->set_has_equal_data_in_target_and_face(true); - + face_hec->twin()->set_is_equal_data_in_face(false); face_hec->twin()->set_has_equal_data_in_face(false); face_hec->twin()->set_has_equal_data_in_target_and_face(false); - + ++face_hec; - } + } while(face_hec != face_hec_begin); } for(Outer_ccb_iterator icit = f->inner_ccbs_begin(); icit != f->inner_ccbs_end(); icit++){ Ccb_halfedge_circulator face_hec = *icit; Ccb_halfedge_circulator face_hec_begin = face_hec; - do + do { face_hec->set_is_equal_data_in_face(true); face_hec->set_has_equal_data_in_face(true); face_hec->set_has_equal_data_in_target_and_face(true); - + face_hec->twin()->set_is_equal_data_in_face(false); face_hec->twin()->set_has_equal_data_in_face(false); face_hec->twin()->set_has_equal_data_in_target_and_face(false); - + ++face_hec; - } + } while(face_hec != face_hec_begin); } } @@ -449,7 +450,7 @@ protected: } } } - + public: void merge_envelopes(Minimization_diagram_2& result1, @@ -457,20 +458,20 @@ public: Minimization_diagram_2& result) { // overlay the 2 arrangements - + Overlay_2 overlay; overlay(result1, result2, result); - + CGAL_expensive_assertion_msg(is_valid(result), "after overlay result is not valid"); - + // make sure the aux flags are correctly set by the overlay //CGAL_assertion(verify_aux_flags(result)); // for each face, edge and vertex in the result, should calculate // which surfaces are on the envelope // a face can be cut, or faces can be merged. - + // now the minimization diagram might change - we need to keep data in the // edges, when they're split Keep_edge_data_observer edge_observer(result, this); @@ -523,13 +524,13 @@ public: for (li = edges_to_resolve.begin(); li != edges_to_resolve.end(); ++li) { resolver->resolve(*li, result); - + } edges_to_resolve.clear(); - + // decompose the result, to have faces without holes /* decompose(result); - CGAL_expensive_assertion_msg(result.is_valid(), + CGAL_expensive_assertion_msg(result.is_valid(), "after decomposition result is not valid");*/ // compute the surface on the envelope for each face, @@ -559,7 +560,7 @@ public: visitor(bfs_visitor)); index_map.detach(); #else - // traverse the faces in arbitrary order + // traverse the faces in arbitrary order Face_iterator fi = result.faces_begin(); for (; fi != result.faces_end(); ++fi) { @@ -600,7 +601,7 @@ public: // resolver->resolve(hi, result); // } // #endif - + // detach the edge_observer from result, since no need for it anymore edge_observer.detach(); @@ -627,7 +628,7 @@ public: continue; } resolver->resolve(vh); - + } CGAL_expensive_assertion_msg(result.is_valid(), @@ -636,21 +637,21 @@ public: // make sure that aux_source and decision are set at all features // after all resolvings CGAL_assertion(check_resolve_was_ok(result)); - + // make sure the aux flags are correctly after all resolvings //CGAL_assertion(verify_aux_flags(result)); // finally, remove unneccessary edges, between faces with the same surface // (and which are not degenerate) - + remove_unneccessary_edges(result); - CGAL_expensive_assertion_msg(result.is_valid(), + CGAL_expensive_assertion_msg(result.is_valid(), "after remove edges result is not valid"); // also remove unneccessary vertices (that were created in the process of // vertical decomposition but the vertical edge was removed) remove_unneccessary_vertices(result); - CGAL_expensive_assertion_msg(result.is_valid(), + CGAL_expensive_assertion_msg(result.is_valid(), "after remove vertices result is not valid"); // update is_equal_data and has_equal_data of halfedge->face and @@ -661,7 +662,7 @@ public: // update the envelope surfaces according to the decision and the aux // surfaces in aux source update_envelope_surfaces_by_decision(result); - + // make sure that all the flags are correctly set on the envelope result //CGAL_assertion(verify_flags(result)); CGAL_expensive_assertion_msg(is_valid(result), @@ -670,7 +671,7 @@ public: protected: - + void deal_with_faces_to_split(std::list& faces_to_split, Minimization_diagram_2& result) { @@ -741,7 +742,7 @@ protected: if (can_remove_edge(hh)) edges.push_back(hh); } - + for (typename std::list::iterator ci = edges.begin(); ci != edges.end(); ++ci) { @@ -847,7 +848,7 @@ protected: end = v->end_data(); } } - + // check if we can remove the edge from the envelope // this can be done if the envelope surfaces on the edge are the same as // the envelope surfaces on both sides of the edge @@ -855,7 +856,7 @@ protected: bool can_remove_edge(Halfedge_handle hh) { Face_handle f1 = hh->face(), f2 = hh->twin()->face(); - + // we check if the decision done on the edge is equal to the decision // done on the faces. if not, then the envelope surfaces must differ CGAL_assertion(hh->is_decision_set() && f1->is_decision_set() && @@ -875,10 +876,10 @@ protected: if (decision == DAC_DECISION_FIRST) return equal_first; - + if (decision == DAC_DECISION_SECOND) return equal_second; - + return (equal_first && equal_second); } @@ -895,7 +896,7 @@ protected: When I tried to use the following code I got a Segmentation Fault when trying to compute power diagram: - + if ((v->parameter_space_in_x() != ARR_INTERIOR) || (v->parameter_space_in_y() != ARR_INTERIOR)) return false; @@ -908,7 +909,7 @@ protected: /*if (v->get_is_fake() && !v->is_decision_set()) return true; - + if (h->get_is_fake() && !h->is_decision_set()) { @@ -931,13 +932,13 @@ protected: if (decision == DAC_DECISION_FIRST) return equal_first; - + if (decision == DAC_DECISION_SECOND) return equal_second; - + return (equal_first && equal_second); } - + // check if we can remove an isolated vertex from the envelope // this can be done if the envelope surfaces on the vertex are the same as // the envelope surfaces on its incident face @@ -958,10 +959,10 @@ protected: if (decision == DAC_DECISION_FIRST) return equal_first; - + if (decision == DAC_DECISION_SECOND) return equal_second; - + return (equal_first && equal_second); } @@ -977,13 +978,13 @@ protected: Halfedge_handle he1 = hec1, he2 = hec2; CGAL_assertion(he1 != he2); CGAL_assertion(he1->is_decision_set() && he2->is_decision_set()); - + /* if (vh->get_is_fake()) { * CGAL_assertion(he1->get_decision() == he2->get_decision()); * return true; * } */ - + CGAL_assertion(vh->is_decision_set()); // if the decision done on the vertex and its incident halfedges are // different, the envelope differs too. @@ -1001,14 +1002,14 @@ protected: if (decision == DAC_DECISION_FIRST) return equal_first; - + if (decision == DAC_DECISION_SECOND) return equal_second; return (equal_first && equal_second); } - - // Remove unneccessary vertices, which have degree 2, and the 2 curves + + // Remove unneccessary vertices, which have degree 2, and the 2 curves // can be merged // (and which are not degenerate) void remove_unneccessary_vertices(Minimization_diagram_2& result) @@ -1016,14 +1017,14 @@ protected: // we have 2 types of unneccessary vertices: those with degree 2 (that // satisfy all the conditions below), and isolated vertices that have the // same envelope information as the face they're contained in. - + // all the vertices that don't have their data set, are those vertices // on vertical edges, created in the decomposition process, // and are not neccessary - // also those vertices with degree 2, that can merge their 2 edges and + // also those vertices with degree 2, that can merge their 2 edges and // with same data as both these edges, can be removed - + // collect all vertices candidate to remove in this list, // and remove the correct ones at the end // (thus, not destroying the iterator) @@ -1041,28 +1042,28 @@ protected: } typename Traits::Merge_2 curves_merge = m_geom_traits->merge_2_object(); - typename Traits::Are_mergeable_2 curves_can_merge = + typename Traits::Are_mergeable_2 curves_can_merge = m_geom_traits->are_mergeable_2_object(); // check the candidates and remove if necessary typename std::list::iterator ci; - for (ci = candidates_to_remove.begin(); + for (ci = candidates_to_remove.begin(); ci != candidates_to_remove.end(); ++ci) { Vertex_handle vh = *ci; CGAL_assertion(vh->degree() == 2); - - // we can remove this vertex only if the data on its halfedges is the + + // we can remove this vertex only if the data on its halfedges is the // same if (!combinatorically_can_remove_vertex(vh)) continue; - + // merge the edges, if geometrically possible (if data on vertex is not // set, then it must be geometrically possible) Halfedge_around_vertex_circulator hec1 = vh->incident_halfedges(); Halfedge_around_vertex_circulator hec2 = hec1++; Halfedge_handle he1 = hec1, he2 = hec2; - + const X_monotone_curve_2& a = he1->curve(), b = he2->curve(); CGAL_assertion(vh->is_decision_set() || curves_can_merge(a,b)); @@ -1072,7 +1073,7 @@ protected: X_monotone_curve_2 c; curves_merge(a,b,c); - // the decisions on he1 and he2 were the same, so the decision on + // the decisions on he1 and he2 were the same, so the decision on // the edge that will be left after the merge will be ok // but we need to take care of the bool flags of the target relation // of the edge that will be left @@ -1115,7 +1116,7 @@ protected: result.merge_edge(he1, he2 ,c); CGAL_assertion(new_edge->is_decision_set()); - CGAL_expensive_assertion_msg(result.is_valid(), + CGAL_expensive_assertion_msg(result.is_valid(), "after remove vertex result is not valid"); } @@ -1157,7 +1158,7 @@ protected: fh->set_data(begin, end); else fh->add_data(begin, end); - } + } } // foreach feature of result, update the envelope surfaces, according @@ -1168,12 +1169,12 @@ protected: Vertex_iterator vi = result.vertices_begin(); for (; vi != result.vertices_end(); ++vi) update_envelope_surfaces_by_decision(vi); - + // edges Halfedge_iterator hi = result.halfedges_begin(); for (; hi != result.halfedges_end(); ++hi) update_envelope_surfaces_by_decision(hi); - + // faces Face_iterator fi = result.faces_begin(); for (; fi != result.faces_end(); ++fi) @@ -1218,7 +1219,7 @@ protected: has_equal &= has_equal_first; else if (decision == DAC_DECISION_SECOND) has_equal &= has_equal_second; - else + else has_equal &= (has_equal_first & has_equal_second); } @@ -1264,7 +1265,7 @@ protected: else if (decision == DAC_DECISION_SECOND) has_equal &= has_equal_second; - else + else has_equal &= (has_equal_first & has_equal_second); } h->set_is_equal_data_in_target(is_equal); @@ -1297,7 +1298,7 @@ protected: else if (decision == DAC_DECISION_SECOND) has_equal &= has_equal_second; - else + else has_equal &= (has_equal_first & has_equal_second); } h->set_has_equal_data_in_target_and_face(has_equal); @@ -1340,7 +1341,7 @@ protected: has_equal &= has_equal_first; else if (decision == DAC_DECISION_SECOND) has_equal &= has_equal_second; - else + else has_equal &= (has_equal_first & has_equal_second); } v->set_is_equal_data_in_face(is_equal); @@ -1348,7 +1349,7 @@ protected: } void update_flags(Minimization_diagram_2& result) - { + { // edges Halfedge_iterator hi = result.halfedges_begin(); for (; hi != result.halfedges_end(); ++hi) @@ -1371,7 +1372,7 @@ protected: { return fh->get_aux_is_set(id); } - + template bool aux_has_no_data(FeatureHandle fh, unsigned int id) { @@ -1379,7 +1380,7 @@ protected: Halfedge_handle h; Vertex_handle v; Face_handle f; - + // aux source of a face must be a face! // aux source of a halfedge can be face or halfedge // aux source of a vertex can be face, halfedge or vertex @@ -1497,9 +1498,9 @@ protected: } } } - - // confirm that aux source and decision are set over all minimization + + // confirm that aux source and decision are set over all minimization // diagram features bool check_resolve_was_ok(Minimization_diagram_2& result) { @@ -1559,12 +1560,12 @@ protected: for (; vi != result.vertices_end(); ++vi) { Vertex_handle vh = vi; - + all_ok &= (vh->get_is_set()); CGAL_assertion_msg(all_ok, "data not set over vertex"); all_ok &= (!vh->has_no_data()); - CGAL_assertion_msg(all_ok, "data empty over vertex"); + CGAL_assertion_msg(all_ok, "data empty over vertex"); /* all_ok &= (!vh->get_is_fake());*/ CGAL_assertion_msg(all_ok, "fake vertex in envelope"); } @@ -1572,7 +1573,7 @@ protected: for (; hi != result.halfedges_end(); ++hi) { Halfedge_handle hh = hi; - + all_ok &= (hh->get_is_set()); if (!all_ok) std::cerr << "edge: " << hh->curve() << std::endl; @@ -1594,14 +1595,14 @@ protected: } return all_ok; } - + // observer for the minimization diagram // keeps the relevant data in the new faces class Keep_face_data_observer : public Md_observer { public: typedef typename Minimization_diagram_2::Face_handle Face_handle; - + Keep_face_data_observer(Minimization_diagram_2& arr) : Md_observer(arr) {} @@ -1619,7 +1620,7 @@ protected: new_f->set_decision(org_f->get_decision()); } }; - + // observer for the minimization diagram // keeps the relevant data in the new edges & vertices @@ -1628,12 +1629,12 @@ protected: public: typedef typename Minimization_diagram_2::Halfedge_handle Halfedge_handle; typedef typename Minimization_diagram_2::Vertex_handle Vertex_handle; - typedef typename Minimization_diagram_2::X_monotone_curve_2 + typedef typename Minimization_diagram_2::X_monotone_curve_2 X_monotone_curve_2; - typedef typename Envelope_divide_and_conquer_3::Self Self; Keep_edge_data_observer(Minimization_diagram_2& arr, Self* b) : @@ -1651,7 +1652,7 @@ protected: virtual void after_split_edge(Halfedge_handle he1, Halfedge_handle he2) { - // update data of the new vertex, which is the common vertex of he1 and + // update data of the new vertex, which is the common vertex of he1 and // he2, and of the new edge according to the data in the original edge CGAL_assertion(he2->source() == he1->target()); @@ -1669,19 +1670,19 @@ protected: // find the halfedge with the additional information, to be copied into // the second halfedge Halfedge_handle org_he = he1, new_he = he2; - + if (org_he->is_decision_set()) { new_he->set_decision(org_he->get_decision()); new_he->twin()->set_decision(org_he->get_decision()); new_vertex->set_decision(org_he->get_decision()); - } + } if (org_he->get_aux_is_set(0)) { new_vertex->set_aux_source(0, org_he->get_aux_source(0)); new_he->set_aux_source(0, org_he->get_aux_source(0)); new_he->twin()->set_aux_source(0, org_he->twin()->get_aux_source(0)); - } + } if (org_he->get_aux_is_set(1)) { new_vertex->set_aux_source(1, org_he->get_aux_source(1)); @@ -1812,11 +1813,11 @@ protected: } }; #endif - + protected: Envelope_resolver* resolver; const Traits* m_geom_traits; - bool m_own_traits; + bool m_own_traits; bool m_is_lower; }; diff --git a/Envelope_3/test/Envelope_3/CMakeLists.txt b/Envelope_3/test/Envelope_3/CMakeLists.txt index 8628a42b6b7..da3fdcc438a 100644 --- a/Envelope_3/test/Envelope_3/CMakeLists.txt +++ b/Envelope_3/test/Envelope_3/CMakeLists.txt @@ -4,17 +4,13 @@ project( Envelope_3_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET COMPONENTS Core ) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - include_directories (BEFORE "../../include") + include(${CGAL_USE_FILE}) # create a target per cppfile file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) diff --git a/Filtered_kernel/benchmark/Filtered_kernel/CMakeLists.txt b/Filtered_kernel/benchmark/Filtered_kernel/CMakeLists.txt index 739c48d90d3..5f557e993c4 100644 --- a/Filtered_kernel/benchmark/Filtered_kernel/CMakeLists.txt +++ b/Filtered_kernel/benchmark/Filtered_kernel/CMakeLists.txt @@ -4,7 +4,7 @@ project( Filtered_kernel_test ) -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.1) add_executable(bench_simple_comparisons bench_simple_comparisons.cpp) @@ -13,11 +13,7 @@ find_package(CGAL QUIET COMPONENTS Core ) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - include_directories (BEFORE ../../include) + 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/Filtered_kernel/examples/Filtered_kernel/CMakeLists.txt b/Filtered_kernel/examples/Filtered_kernel/CMakeLists.txt index 1ebab191641..ebcff9060b2 100644 --- a/Filtered_kernel/examples/Filtered_kernel/CMakeLists.txt +++ b/Filtered_kernel/examples/Filtered_kernel/CMakeLists.txt @@ -4,18 +4,12 @@ project( Filtered_kernel_Examples ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Filtered_kernel/test/Filtered_kernel/CMakeLists.txt b/Filtered_kernel/test/Filtered_kernel/CMakeLists.txt index ea9a0aa6184..6b3d72637c4 100644 --- a/Filtered_kernel/test/Filtered_kernel/CMakeLists.txt +++ b/Filtered_kernel/test/Filtered_kernel/CMakeLists.txt @@ -4,18 +4,12 @@ project( Filtered_kernel_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Generalized_map/doc/Generalized_map/PackageDescription.txt b/Generalized_map/doc/Generalized_map/PackageDescription.txt index acbdf16ff7e..642f145a29a 100644 --- a/Generalized_map/doc/Generalized_map/PackageDescription.txt +++ b/Generalized_map/doc/Generalized_map/PackageDescription.txt @@ -1,19 +1,19 @@ -/// \defgroup PkgGeneralizedMaps Generalized Maps Reference +/// \defgroup PkgGeneralizedMapsRef Generalized Maps Reference /// \defgroup PkgGeneralizedMapsConcepts Concepts -/// \ingroup PkgGeneralizedMaps +/// \ingroup PkgGeneralizedMapsRef /// \defgroup PkgGeneralizedMapsClasses Classes -/// \ingroup PkgGeneralizedMaps +/// \ingroup PkgGeneralizedMapsRef /*! -\addtogroup PkgGeneralizedMaps -\cgalPkgDescriptionBegin{Generalized Maps,PkgGeneralizedMapsSummary} +\addtogroup PkgGeneralizedMapsRef +\cgalPkgDescriptionBegin{Generalized Maps,PkgGeneralizedMaps} \cgalPkgPicture{gmap_logo.png} \cgalPkgSummaryBegin \cgalPkgAuthor{Guillaume Damiand} \cgalPkgDesc{This package implements Generalized Maps in d dimensions. A generalized map is a data structure enabling to represent an orientable or non orientable subdivided object by describing all the cells of the subdivision (for example in 3D vertices, edges, faces, volumes) and all the incidence and adjacency relationships between these cells. Information can be associated to cells thanks to attributes. The package provides basic creation, modification operations, and several iterators enabling to run through some specific part of the object.} -\cgalPkgManuals{Chapter_Generalized_Maps,PkgGeneralizedMaps} +\cgalPkgManuals{Chapter_Generalized_Maps,PkgGeneralizedMapsRef} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{4.9} diff --git a/Generalized_map/examples/Generalized_map/CMakeLists.txt b/Generalized_map/examples/Generalized_map/CMakeLists.txt index 21ac424632a..2fde81ed252 100644 --- a/Generalized_map/examples/Generalized_map/CMakeLists.txt +++ b/Generalized_map/examples/Generalized_map/CMakeLists.txt @@ -4,18 +4,12 @@ project( Generalized_map_Examples ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Generalized_map/include/CGAL/Generalized_map.h b/Generalized_map/include/CGAL/Generalized_map.h index f19a4dcd950..3e234ce8678 100644 --- a/Generalized_map/include/CGAL/Generalized_map.h +++ b/Generalized_map/include/CGAL/Generalized_map.h @@ -40,6 +40,7 @@ #include #include #include +#include #include #if defined( __INTEL_COMPILER ) @@ -193,7 +194,8 @@ namespace CGAL { typename PointConverter> void copy(const GMap2& amap, const Converters& converters, const DartInfoConverter& dartinfoconverter, - const PointConverter& pointconverter) + const PointConverter& pointconverter, + boost::unordered_map* dart_mapping=NULL) { this->clear(); @@ -212,27 +214,29 @@ namespace CGAL { } // Create an mapping between darts of the two maps (originals->copies). - // TODO: replace the std::map by a boost::unordered_map // (here we cannot use CGAL::Unique_hash_map because it does not provide // iterators... - std::map dartmap; + boost::unordered_map local_dartmap; + if (dart_mapping==NULL) + { dart_mapping=&local_dartmap; } + for (typename GMap2::Dart_const_range::const_iterator it=amap.darts().begin(), itend=amap.darts().end(); it!=itend; ++it) { - dartmap[it]=mdarts.emplace(); - init_dart(dartmap[it], amap.get_marks(it)); + (*dart_mapping)[it]=mdarts.emplace(); + init_dart((*dart_mapping)[it], amap.get_marks(it)); internal::Copy_dart_info_functor:: - run(amap, static_cast(*this), it, dartmap[it], + run(amap, static_cast(*this), it, (*dart_mapping)[it], dartinfoconverter); } unsigned int min_dim=(dimension - ::iterator dartmap_iter, dartmap_iter_end=dartmap.end(); - for (dartmap_iter=dartmap.begin(); dartmap_iter!=dartmap_iter_end; + typename boost::unordered_map + ::iterator dartmap_iter, dartmap_iter_end=dart_mapping->end(); + for (dartmap_iter=dart_mapping->begin(); dartmap_iter!=dartmap_iter_end; ++dartmap_iter) { for (unsigned int i=0; i<=min_dim; i++) @@ -241,13 +245,13 @@ namespace CGAL { (dartmap_iter->first)<(amap.alpha(dartmap_iter->first,i))) { basic_link_alpha(dartmap_iter->second, - dartmap[amap.alpha(dartmap_iter->first,i)], i); + (*dart_mapping)[amap.alpha(dartmap_iter->first,i)], i); } } } /** Copy attributes */ - for (dartmap_iter=dartmap.begin(); dartmap_iter!=dartmap_iter_end; + for (dartmap_iter=dart_mapping->begin(); dartmap_iter!=dartmap_iter_end; ++dartmap_iter) { Helper::template Foreach_enabled_attributes @@ -262,28 +266,31 @@ namespace CGAL { } template - void copy(const GMap2& amap) + void copy(const GMap2& amap, + boost::unordered_map* dart_mapping=NULL) { CGAL::cpp11::tuple<> converters; Default_converter_dart_info dartinfoconverter; Default_converter_cmap_0attributes_with_point pointconverter; - copy(amap, converters, dartinfoconverter, pointconverter); + copy(amap, converters, dartinfoconverter, pointconverter, dart_mapping); } template - void copy(const GMap2& amap, const Converters& converters) + void copy(const GMap2& amap, const Converters& converters, + boost::unordered_map* dart_mapping=NULL) { Default_converter_cmap_0attributes_with_point pointconverter; Default_converter_dart_info dartinfoconverter; - copy(amap, converters, dartinfoconverter, pointconverter); + copy(amap, converters, dartinfoconverter, pointconverter, dart_mapping); } template void copy(const GMap2& amap, const Converters& converters, - const DartInfoConverter& dartinfoconverter) + const DartInfoConverter& dartinfoconverter, + boost::unordered_map* dart_mapping=NULL) { Default_converter_cmap_0attributes_with_point pointconverter; - copy(amap, converters, dartinfoconverter, pointconverter); + copy(amap, converters, dartinfoconverter, pointconverter, dart_mapping); } // Copy constructor from a map having exactly the same type. diff --git a/Generalized_map/include/CGAL/Generalized_map_operations.h b/Generalized_map/include/CGAL/Generalized_map_operations.h index 964c26c88a9..bc83ff55096 100644 --- a/Generalized_map/include/CGAL/Generalized_map_operations.h +++ b/Generalized_map/include/CGAL/Generalized_map_operations.h @@ -23,6 +23,7 @@ #include #include +#include #include diff --git a/Generalized_map/test/Generalized_map/CMakeLists.txt b/Generalized_map/test/Generalized_map/CMakeLists.txt index a81560b4117..2fc8c4ac4a4 100644 --- a/Generalized_map/test/Generalized_map/CMakeLists.txt +++ b/Generalized_map/test/Generalized_map/CMakeLists.txt @@ -4,7 +4,7 @@ project( Generalized_map_Tests ) -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.1) # CGAL and its components find_package( CGAL QUIET COMPONENTS ) @@ -16,10 +16,6 @@ if ( NOT CGAL_FOUND ) endif() -# include helper file -include( ${CGAL_USE_FILE} ) - - # Boost and its components find_package( Boost REQUIRED ) @@ -34,14 +30,10 @@ 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( "Generalized_map_test.cpp" ) diff --git a/Generalized_map/test/Generalized_map/GMap_test_insertions.h b/Generalized_map/test/Generalized_map/GMap_test_insertions.h index 0734b7e1d7f..f05c62cd58b 100644 --- a/Generalized_map/test/Generalized_map/GMap_test_insertions.h +++ b/Generalized_map/test/Generalized_map/GMap_test_insertions.h @@ -21,6 +21,8 @@ #ifndef GMAP_TEST_INSERTIONS_H #define GMAP_TEST_INSERTIONS_H +#include + template bool check_number_of_cells_3(GMAP& gmap, unsigned int nbv, unsigned int nbe, unsigned int nbf, unsigned int nbvol, @@ -297,6 +299,49 @@ bool test_face_insertion(GMAP& gmap) assert(false); return false; } + + if (CGAL::degree(gmap2, d1)!=4) + { + std::cout<<"Error: 0-degree is wrong: "<(gmap2, d1)<<" instead of 4."<(gmap2, d1)!=3) + { + std::cout<<"Error: 1-degree is wrong: "<(gmap2, d1)<<" instead of 3."<(gmap2, d1)!=2) + { + std::cout<<"Error: 2-degree is wrong: "<(gmap2, d1)<<" instead of 2."<(gmap2, d1)!=2) + { + std::cout<<"Error: 1-codegree is wrong: "<(gmap2, d1)<<" instead of 2."<(gmap2, d1)!=4) + { + std::cout<<"Error: 2-codegree is wrong: "<(gmap2, d1)<<" instead of 4."<(gmap2, d1)!=6) + { + std::cout<<"Error: 3-codegree is wrong: "<(gmap2, d1)<<" instead of 6."<& p); /// \addtogroup GeomviewOutput Output Operators for CGAL Kernel Classes -/// \ingroup PkgGeomview +/// \ingroup PkgGeomviewRef /// The following classes of the \cgal kernel have output /// operators. 2D objects are embedded in the `xy`-plane. /// @{ @@ -380,7 +380,7 @@ operator<<(Geomview_stream& gs, const Bbox_3& b); /// @} /// \addtogroup GeomviewInput Input Operators for CGAL Kernel Classes -/// \ingroup PkgGeomview +/// \ingroup PkgGeomviewRef /// An input operator is provided for points. The user has to select /// a point on the pick plane with the right mouse button. The pick plane /// can be moved anywhere with the left mouse button, before a point is entered. @@ -398,7 +398,7 @@ operator>>(Geomview_stream& gs, Point_3& p); /// @} /// \addtogroup GeomviewOutputClasses Output Operators for CGAL Basic Library Classes -/// \ingroup PkgGeomview +/// \ingroup PkgGeomviewRef /// Output operators are provided for polyhedral surfaces, as well as for 3D /// and 2D triangulations. The latter allow to visualize terrrains if the /// point type isa 3D point. diff --git a/Geomview/doc/Geomview/PackageDescription.txt b/Geomview/doc/Geomview/PackageDescription.txt index 7e598818921..15e58d59d6f 100644 --- a/Geomview/doc/Geomview/PackageDescription.txt +++ b/Geomview/doc/Geomview/PackageDescription.txt @@ -1,13 +1,13 @@ -/// \defgroup PkgGeomview Geomview Reference +/// \defgroup PkgGeomviewRef Geomview Reference /*! -\addtogroup PkgGeomview +\addtogroup PkgGeomviewRef \todo check generated documentation -\cgalPkgDescriptionBegin{Geomview,PkgGeomviewSummary} +\cgalPkgDescriptionBegin{Geomview,PkgGeomview} \cgalPkgPicture{geomview.png} \cgalPkgSummaryBegin \cgalPkgAuthors{Andreas Fabri and Sylvain Pion} \cgalPkgDesc{This package implements an interface to Geomview, an interactive 3D viewing program, originally developed at the Geometry Center in Minneapolis.} -\cgalPkgManuals{Chapter_Geomview,PkgGeomview} +\cgalPkgManuals{Chapter_Geomview,PkgGeomviewRef} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{2.0} diff --git a/Geomview/test/Geomview/CMakeLists.txt b/Geomview/test/Geomview/CMakeLists.txt index a8e0247d3ed..82a744ca346 100644 --- a/Geomview/test/Geomview/CMakeLists.txt +++ b/Geomview/test/Geomview/CMakeLists.txt @@ -4,18 +4,12 @@ project( Geomview_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/GraphicsView/demo/Alpha_shapes_2/CMakeLists.txt b/GraphicsView/demo/Alpha_shapes_2/CMakeLists.txt index 79481e9d477..af389e5aa20 100644 --- a/GraphicsView/demo/Alpha_shapes_2/CMakeLists.txt +++ b/GraphicsView/demo/Alpha_shapes_2/CMakeLists.txt @@ -11,14 +11,12 @@ endif() find_package(CGAL COMPONENTS Qt5) -include(${CGAL_USE_FILE}) - find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg) -include_directories (BEFORE ../../include) include_directories (BEFORE ./include) if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND ) add_definitions(-DQT_NO_KEYWORDS) +set(CMAKE_INCLUDE_CURRENT_DIR ON) #-------------------------------- # The "Delaunay" demo: Alpha_shapes_2 diff --git a/GraphicsView/demo/Apollonius_graph_2/CMakeLists.txt b/GraphicsView/demo/Apollonius_graph_2/CMakeLists.txt index 5277df796c8..1a858439904 100644 --- a/GraphicsView/demo/Apollonius_graph_2/CMakeLists.txt +++ b/GraphicsView/demo/Apollonius_graph_2/CMakeLists.txt @@ -11,14 +11,11 @@ endif() find_package(CGAL COMPONENTS Qt5) -include(${CGAL_USE_FILE}) - find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg) -include_directories (BEFORE ../../include) - if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND ) add_definitions(-DQT_NO_KEYWORDS) +set(CMAKE_INCLUDE_CURRENT_DIR ON) #-------------------------------- # UI files (Qt Designer files) diff --git a/GraphicsView/demo/Bounding_volumes/CMakeLists.txt b/GraphicsView/demo/Bounding_volumes/CMakeLists.txt index 73dbe769131..2ac22c9815b 100644 --- a/GraphicsView/demo/Bounding_volumes/CMakeLists.txt +++ b/GraphicsView/demo/Bounding_volumes/CMakeLists.txt @@ -11,16 +11,14 @@ endif() find_package(CGAL COMPONENTS Qt5) -include(${CGAL_USE_FILE}) - find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg) -include_directories (BEFORE ../../include) include_directories (BEFORE ./include) include_directories (BEFORE ../../../Matrix_search/include) if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND ) +set(CMAKE_INCLUDE_CURRENT_DIR ON) add_definitions(-DQT_NO_KEYWORDS) #---------------------------------------------- diff --git a/GraphicsView/demo/Circular_kernel_2/CMakeLists.txt b/GraphicsView/demo/Circular_kernel_2/CMakeLists.txt index b832117e578..60a6c359d4c 100644 --- a/GraphicsView/demo/Circular_kernel_2/CMakeLists.txt +++ b/GraphicsView/demo/Circular_kernel_2/CMakeLists.txt @@ -11,17 +11,12 @@ endif() find_package(CGAL COMPONENTS Qt5) -include(${CGAL_USE_FILE}) - - find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg) -include_directories (BEFORE ../../include) - if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND ) add_definitions(-DQT_NO_KEYWORDS) - + set(CMAKE_INCLUDE_CURRENT_DIR ON) #-------------------------------- # The demo: Circular_kernel_2 diff --git a/Circular_kernel_2/demo/Circular_kernel_2/data/circle_grid.cgal b/GraphicsView/demo/Circular_kernel_2/data/circle_grid.cgal similarity index 100% rename from Circular_kernel_2/demo/Circular_kernel_2/data/circle_grid.cgal rename to GraphicsView/demo/Circular_kernel_2/data/circle_grid.cgal diff --git a/Circular_kernel_2/demo/Circular_kernel_2/data/circles_21.cgal b/GraphicsView/demo/Circular_kernel_2/data/circles_21.cgal similarity index 100% rename from Circular_kernel_2/demo/Circular_kernel_2/data/circles_21.cgal rename to GraphicsView/demo/Circular_kernel_2/data/circles_21.cgal diff --git a/GraphicsView/demo/Generator/CMakeLists.txt b/GraphicsView/demo/Generator/CMakeLists.txt index 186f37e94dd..53b33e71048 100644 --- a/GraphicsView/demo/Generator/CMakeLists.txt +++ b/GraphicsView/demo/Generator/CMakeLists.txt @@ -10,13 +10,13 @@ endif() find_package(CGAL COMPONENTS Qt5) -include(${CGAL_USE_FILE}) - find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg) if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND ) add_definitions(-DQT_NO_KEYWORDS) + set(CMAKE_INCLUDE_CURRENT_DIR ON) + #-------------------------------- # Demo: Generator_2 #-------------------------------- diff --git a/GraphicsView/demo/GraphicsView/CMakeLists.txt b/GraphicsView/demo/GraphicsView/CMakeLists.txt index 3da163ace44..5f92ac528dc 100644 --- a/GraphicsView/demo/GraphicsView/CMakeLists.txt +++ b/GraphicsView/demo/GraphicsView/CMakeLists.txt @@ -10,13 +10,12 @@ endif() find_package(CGAL COMPONENTS Qt5) -include(${CGAL_USE_FILE}) - find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg) if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND ) add_definitions(-DQT_NO_KEYWORDS) + set(CMAKE_INCLUDE_CURRENT_DIR ON) add_executable ( min min.cpp ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) diff --git a/GraphicsView/demo/L1_Voronoi_diagram_2/CMakeLists.txt b/GraphicsView/demo/L1_Voronoi_diagram_2/CMakeLists.txt index 4e42f7ed98f..9903f9ca190 100644 --- a/GraphicsView/demo/L1_Voronoi_diagram_2/CMakeLists.txt +++ b/GraphicsView/demo/L1_Voronoi_diagram_2/CMakeLists.txt @@ -11,16 +11,14 @@ endif() find_package(CGAL COMPONENTS Qt5) -include(${CGAL_USE_FILE}) - find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg) -include_directories (BEFORE ../../include) include_directories (BEFORE ./include) if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND ) add_definitions(-DQT_NO_KEYWORDS) +set(CMAKE_INCLUDE_CURRENT_DIR ON) #-------------------------------- # The "L1 Voronoi diagram" demo: L1_voronoi_diagram_2 diff --git a/GraphicsView/demo/Largest_empty_rect_2/CMakeLists.txt b/GraphicsView/demo/Largest_empty_rect_2/CMakeLists.txt index f3ea3822cee..1faba1f18d0 100644 --- a/GraphicsView/demo/Largest_empty_rect_2/CMakeLists.txt +++ b/GraphicsView/demo/Largest_empty_rect_2/CMakeLists.txt @@ -11,16 +11,13 @@ endif() find_package(CGAL COMPONENTS Qt5) -include(${CGAL_USE_FILE}) - find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg) -include_directories (BEFORE ../../include) - if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND ) add_definitions(-DQT_NO_KEYWORDS) - + set(CMAKE_INCLUDE_CURRENT_DIR ON) + #-------------------------------- # Demo: Largest_empty_rectangle_2 #-------------------------------- diff --git a/GraphicsView/demo/Periodic_2_triangulation_2/CMakeLists.txt b/GraphicsView/demo/Periodic_2_triangulation_2/CMakeLists.txt index 065264be817..6e2d6348e65 100644 --- a/GraphicsView/demo/Periodic_2_triangulation_2/CMakeLists.txt +++ b/GraphicsView/demo/Periodic_2_triangulation_2/CMakeLists.txt @@ -8,18 +8,14 @@ endif() find_package(CGAL COMPONENTS Qt5) -include(${CGAL_USE_FILE}) - - find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg) -include_directories (BEFORE ../../../include) include_directories (BEFORE ./include) if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND ) add_definitions(-DQT_NO_KEYWORDS) - +set(CMAKE_INCLUDE_CURRENT_DIR ON) #-------------------------------- # The "2D Periodic triangulation" demo: Periodic_2_triangulation_2 diff --git a/GraphicsView/demo/Polygon/CMakeLists.txt b/GraphicsView/demo/Polygon/CMakeLists.txt index f84197f4cc1..0e4e0a01d38 100644 --- a/GraphicsView/demo/Polygon/CMakeLists.txt +++ b/GraphicsView/demo/Polygon/CMakeLists.txt @@ -11,8 +11,6 @@ endif() find_package(CGAL COMPONENTS Qt5 Core) -include(${CGAL_USE_FILE}) - find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) if (EIGEN3_FOUND) include( ${EIGEN3_USE_FILE} ) @@ -23,10 +21,8 @@ endif() find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg) -include_directories (BEFORE ../../include) - if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND ) - + include(${CGAL_USE_FILE}) add_definitions(-DQT_NO_KEYWORDS) if( CGAL_Core_FOUND) diff --git a/GraphicsView/demo/Segment_Delaunay_graph_2/CMakeLists.txt b/GraphicsView/demo/Segment_Delaunay_graph_2/CMakeLists.txt index d686684058e..a2fd30a9230 100644 --- a/GraphicsView/demo/Segment_Delaunay_graph_2/CMakeLists.txt +++ b/GraphicsView/demo/Segment_Delaunay_graph_2/CMakeLists.txt @@ -11,8 +11,6 @@ endif() find_package(CGAL COMPONENTS Qt5 Core) -include(${CGAL_USE_FILE}) - set( QT_USE_QTXML TRUE ) set( QT_USE_QTMAIN TRUE ) set( QT_USE_QTSCRIPT TRUE ) @@ -20,12 +18,12 @@ set( QT_USE_QTOPENGL TRUE ) find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg) -include_directories (BEFORE ../../include) include_directories (BEFORE ./include) if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND ) +include(${CGAL_USE_FILE}) add_definitions(-DQT_NO_KEYWORDS) #-------------------------------- diff --git a/GraphicsView/demo/Segment_Delaunay_graph_Linf_2/CMakeLists.txt b/GraphicsView/demo/Segment_Delaunay_graph_Linf_2/CMakeLists.txt index 235361f99be..03685cdbfef 100644 --- a/GraphicsView/demo/Segment_Delaunay_graph_Linf_2/CMakeLists.txt +++ b/GraphicsView/demo/Segment_Delaunay_graph_Linf_2/CMakeLists.txt @@ -11,8 +11,6 @@ endif() find_package(CGAL COMPONENTS Qt5 Core) -include(${CGAL_USE_FILE}) - set( QT_USE_QTXML TRUE ) set( QT_USE_QTMAIN TRUE ) set( QT_USE_QTSCRIPT TRUE ) @@ -20,12 +18,12 @@ set( QT_USE_QTOPENGL TRUE ) find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg) -include_directories (BEFORE ../../include) include_directories (BEFORE ./include) if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND ) +include(${CGAL_USE_FILE}) add_definitions(-DQT_NO_KEYWORDS) #-------------------------------- diff --git a/GraphicsView/demo/Snap_rounding_2/CMakeLists.txt b/GraphicsView/demo/Snap_rounding_2/CMakeLists.txt index 0644db2a4ef..d19002e1bd4 100644 --- a/GraphicsView/demo/Snap_rounding_2/CMakeLists.txt +++ b/GraphicsView/demo/Snap_rounding_2/CMakeLists.txt @@ -11,16 +11,14 @@ endif() find_package(CGAL COMPONENTS Qt5) -include(${CGAL_USE_FILE}) - find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg) -include_directories (BEFORE ../../include) include_directories (BEFORE ../../../Snap_rounding_2/include) if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND ) add_definitions(-DQT_NO_KEYWORDS) +set(CMAKE_INCLUDE_CURRENT_DIR ON) #-------------------------------- # UI files (Qt Designer files) diff --git a/GraphicsView/demo/Spatial_searching_2/CMakeLists.txt b/GraphicsView/demo/Spatial_searching_2/CMakeLists.txt index 92c07195c75..b3aaa8bd452 100644 --- a/GraphicsView/demo/Spatial_searching_2/CMakeLists.txt +++ b/GraphicsView/demo/Spatial_searching_2/CMakeLists.txt @@ -11,16 +11,14 @@ endif() find_package(CGAL COMPONENTS Qt5) -include(${CGAL_USE_FILE}) - find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg) -include_directories (BEFORE ../../include) include_directories (BEFORE ../../../Spatial_searching/include) if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND ) add_definitions(-DQT_NO_KEYWORDS) + set(CMAKE_INCLUDE_CURRENT_DIR ON) #-------------------------------- # Demo: Spatial_searching_2 diff --git a/GraphicsView/demo/Stream_lines_2/CMakeLists.txt b/GraphicsView/demo/Stream_lines_2/CMakeLists.txt index e980d9e818e..999e107fbbf 100644 --- a/GraphicsView/demo/Stream_lines_2/CMakeLists.txt +++ b/GraphicsView/demo/Stream_lines_2/CMakeLists.txt @@ -11,17 +11,13 @@ endif() find_package(CGAL COMPONENTS Qt5) -include(${CGAL_USE_FILE}) - find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg) -include_directories (BEFORE ../../include) - if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND ) add_definitions(-DQT_NO_KEYWORDS) - +set(CMAKE_INCLUDE_CURRENT_DIR ON) #-------------------------------- # UI files (Qt Designer files) diff --git a/GraphicsView/demo/Triangulation_2/CMakeLists.txt b/GraphicsView/demo/Triangulation_2/CMakeLists.txt index ae34a10d4ed..ef641207689 100644 --- a/GraphicsView/demo/Triangulation_2/CMakeLists.txt +++ b/GraphicsView/demo/Triangulation_2/CMakeLists.txt @@ -25,6 +25,7 @@ if ( NOT CGAL_FOUND OR NOT CGAL_Qt5_FOUND OR NOT Qt5_FOUND ) endif() add_definitions(-DQT_NO_KEYWORDS) +set(CMAKE_INCLUDE_CURRENT_DIR ON) #-------------------------------- # The "constrained Delaunay" demo: Constrained_Delaunay_triangulation_2 diff --git a/Triangulation_2/demo/Triangulation_2/data/butterfly b/GraphicsView/demo/Triangulation_2/data/butterfly similarity index 100% rename from Triangulation_2/demo/Triangulation_2/data/butterfly rename to GraphicsView/demo/Triangulation_2/data/butterfly diff --git a/Triangulation_2/demo/Triangulation_2/data/fish b/GraphicsView/demo/Triangulation_2/data/fish similarity index 100% rename from Triangulation_2/demo/Triangulation_2/data/fish rename to GraphicsView/demo/Triangulation_2/data/fish diff --git a/Triangulation_2/demo/Triangulation_2/data/norway.edg b/GraphicsView/demo/Triangulation_2/data/norway.edg similarity index 100% rename from Triangulation_2/demo/Triangulation_2/data/norway.edg rename to GraphicsView/demo/Triangulation_2/data/norway.edg diff --git a/Triangulation_2/demo/Triangulation_2/data/poisson b/GraphicsView/demo/Triangulation_2/data/poisson similarity index 100% rename from Triangulation_2/demo/Triangulation_2/data/poisson rename to GraphicsView/demo/Triangulation_2/data/poisson diff --git a/Triangulation_2/demo/Triangulation_2/data/tr b/GraphicsView/demo/Triangulation_2/data/tr similarity index 100% rename from Triangulation_2/demo/Triangulation_2/data/tr rename to GraphicsView/demo/Triangulation_2/data/tr diff --git a/Triangulation_2/demo/Triangulation_2/data/triangulation.cgal b/GraphicsView/demo/Triangulation_2/data/triangulation.cgal similarity index 100% rename from Triangulation_2/demo/Triangulation_2/data/triangulation.cgal rename to GraphicsView/demo/Triangulation_2/data/triangulation.cgal diff --git a/GraphicsView/doc/GraphicsView/PackageDescription.txt b/GraphicsView/doc/GraphicsView/PackageDescription.txt index 01513917180..0e6d19ed6a8 100644 --- a/GraphicsView/doc/GraphicsView/PackageDescription.txt +++ b/GraphicsView/doc/GraphicsView/PackageDescription.txt @@ -1,20 +1,20 @@ -/// \defgroup PkgGraphicsView CGAL and the Qt Graphics View Framework Reference +/// \defgroup PkgGraphicsViewRef CGAL and the Qt Graphics View Framework Reference /// \defgroup PkgGraphicsViewGraphicsItemClasses Graphics Item Classes -/// \ingroup PkgGraphicsView +/// \ingroup PkgGraphicsViewRef /// \defgroup PkgGraphicsViewInputClasses Input Classes -/// \ingroup PkgGraphicsView +/// \ingroup PkgGraphicsViewRef /// \defgroup PkgGraphicsViewMiscClasses Miscellaneous Classes -/// \ingroup PkgGraphicsView +/// \ingroup PkgGraphicsViewRef /*! -\addtogroup PkgGraphicsView +\addtogroup PkgGraphicsViewRef -\cgalPkgDescriptionBegin{CGAL and the Qt Graphics View Framework,PkgGraphicsViewSummary} +\cgalPkgDescriptionBegin{CGAL and the Qt Graphics View Framework,PkgGraphicsView} \cgalPkgPicture{detail.png} \cgalPkgSummaryBegin \cgalPkgAuthors{Andreas Fabri and Laurent Rineau} \cgalPkgDesc{This package provides classes for displaying \cgal objects and data structures in the Qt 5 Graphics View Framework.} -\cgalPkgManuals{Chapter_CGAL_and_the_Qt_Graphics_View_Framework,PkgGraphicsView} +\cgalPkgManuals{Chapter_CGAL_and_the_Qt_Graphics_View_Framework,PkgGraphicsViewRef} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{3.4} diff --git a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h index 18f76232f41..de17e0d32f5 100644 --- a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h +++ b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h @@ -144,11 +144,11 @@ inline CGAL::Color get_random_color(CGAL::Random& random) //------------------------------------------------------------------------------ class Basic_viewer_qt : public CGAL::QGLViewer { +public: typedef CGAL::Exact_predicates_inexact_constructions_kernel Local_kernel; typedef Local_kernel::Point_3 Local_point; typedef Local_kernel::Vector_3 Local_vector; -public: // Constructor/Destructor Basic_viewer_qt(QWidget* parent, const char* title="", diff --git a/GraphicsView/include/CGAL/Qt/DemosMainWindow.h b/GraphicsView/include/CGAL/Qt/DemosMainWindow.h index 9d59119fe37..a90798dc119 100644 --- a/GraphicsView/include/CGAL/Qt/DemosMainWindow.h +++ b/GraphicsView/include/CGAL/Qt/DemosMainWindow.h @@ -35,6 +35,7 @@ #include #include #include +#include // forward declaration class QLabel; @@ -125,6 +126,7 @@ protected: QAction* recentFilesSeparator; unsigned int maxNumRecentFiles; QVector recentFileActs; + QSettings settings; }; // end class DemosMainWindow } // namespace Qt @@ -137,3 +139,4 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(CGAL::Qt::DemosMainWindow::Options) #endif // CGAL_HEADER_ONLY #endif // CGAL_QT_DEMOS_MAIN_WINDOW_H + diff --git a/GraphicsView/include/CGAL/Qt/DemosMainWindow_impl.h b/GraphicsView/include/CGAL/Qt/DemosMainWindow_impl.h index b4d696f763b..96403ac859b 100644 --- a/GraphicsView/include/CGAL/Qt/DemosMainWindow_impl.h +++ b/GraphicsView/include/CGAL/Qt/DemosMainWindow_impl.h @@ -379,13 +379,11 @@ CGAL_INLINE_FUNCTION void DemosMainWindow::addToRecentFiles(QString fileName) { - QSettings settings; QStringList files = settings.value("recentFileList").toStringList(); files.removeAll(fileName); files.prepend(fileName); while (files.size() > (int)maxNumberOfRecentFiles()) files.removeLast(); - settings.setValue("recentFileList", files); updateRecentFileActions(); @@ -423,7 +421,6 @@ CGAL_INLINE_FUNCTION void DemosMainWindow::updateRecentFileActions() { - QSettings settings; QStringList files = settings.value("recentFileList").toStringList(); int numRecentFiles = qMin(files.size(), (int)this->maxNumberOfRecentFiles()); @@ -444,7 +441,7 @@ DemosMainWindow::updateRecentFileActions() CGAL_INLINE_FUNCTION void DemosMainWindow::writeState(QString groupname) { - QSettings settings; + settings.beginGroup(groupname); settings.setValue("size", size()); @@ -456,7 +453,7 @@ void DemosMainWindow::writeState(QString groupname) CGAL_INLINE_FUNCTION void DemosMainWindow::readState(QString groupname, Options /*what_to_save*/) { - QSettings settings; + settings.beginGroup(groupname); resize(settings.value("size", this->size()).toSize()); diff --git a/GraphicsView/include/CGAL/Qt/qglviewer_impl.h b/GraphicsView/include/CGAL/Qt/qglviewer_impl.h index 972896a063a..960bd473d2d 100644 --- a/GraphicsView/include/CGAL/Qt/qglviewer_impl.h +++ b/GraphicsView/include/CGAL/Qt/qglviewer_impl.h @@ -3199,9 +3199,11 @@ void CGAL::QGLViewer::drawVisualHints() { glScissor (GLint((camera()->projectedCoordinatesOf(camera()->pivotPoint()).x-size/2)*devicePixelRatio()), GLint((height() - camera()->projectedCoordinatesOf(camera()->pivotPoint()).y-size/2)*devicePixelRatio()), size, size); rendering_program.setUniformValue("color", QColor(::Qt::black)); + glDisable(GL_DEPTH_TEST); glDrawArrays(GL_LINES, 0, static_cast(4)); rendering_program.setUniformValue("color", QColor(::Qt::white)); glDrawArrays(GL_LINES, 0, static_cast(4)); + glEnable(GL_DEPTH_TEST); // The viewport and the scissor are restored. glScissor(scissor[0],scissor[1],scissor[2],scissor[3]); glViewport(viewport[0],viewport[1],viewport[2],viewport[3]); diff --git a/GraphicsView/include/CGAL/Qt/quaternion.h b/GraphicsView/include/CGAL/Qt/quaternion.h index 24577c2ec20..7a6db9af3a1 100644 --- a/GraphicsView/include/CGAL/Qt/quaternion.h +++ b/GraphicsView/include/CGAL/Qt/quaternion.h @@ -323,7 +323,7 @@ public: Quaternion rot(...); cout << "Rotation=" << rot << endl; \endcode */ - std::ostream &operator<<(std::ostream &o, const CGAL::qglviewer::Vec &); + std::ostream &operator<<(std::ostream &o, const CGAL::qglviewer::Quaternion &); //@} #endif @@ -333,8 +333,8 @@ private: qreal q[4]; }; +std::ostream &operator<<(std::ostream &o, const Quaternion &); + }} // namespace CGAL::qglviewer -std::ostream &operator<<(std::ostream &o, const CGAL::qglviewer::Quaternion &); - #endif // QGLVIEWER_QUATERNION_H diff --git a/GraphicsView/include/CGAL/Qt/quaternion_impl.h b/GraphicsView/include/CGAL/Qt/quaternion_impl.h index 5dd599da5d6..e92eed00c3f 100644 --- a/GraphicsView/include/CGAL/Qt/quaternion_impl.h +++ b/GraphicsView/include/CGAL/Qt/quaternion_impl.h @@ -529,11 +529,6 @@ Quaternion Quaternion::squadTangent(const Quaternion &before, return e; } -CGAL_INLINE_FUNCTION -std::ostream &operator<<(std::ostream &o, const Quaternion &Q) { - return o << Q[0] << '\t' << Q[1] << '\t' << Q[2] << '\t' << Q[3]; -} - /*! Returns a random unit Quaternion. You can create a randomly directed unit vector using: @@ -556,4 +551,10 @@ Quaternion Quaternion::randomQuaternion() { qreal t2 = 2.0 * CGAL_PI * (rand() / (qreal)RAND_MAX); return Quaternion(sin(t1) * r1, cos(t1) * r1, sin(t2) * r2, cos(t2) * r2); } -}} + +CGAL_INLINE_FUNCTION +std::ostream &operator<<(std::ostream &o, const Quaternion &Q) { + return o << Q[0] << '\t' << Q[1] << '\t' << Q[2] << '\t' << Q[3]; +} + +}} // namespace CGAL::qglviewer diff --git a/GraphicsView/include/CGAL/Qt/vec.h b/GraphicsView/include/CGAL/Qt/vec.h index 0a6e2e2e95b..fcc9829dba3 100644 --- a/GraphicsView/include/CGAL/Qt/vec.h +++ b/GraphicsView/include/CGAL/Qt/vec.h @@ -361,8 +361,8 @@ cout << "Position=" << pos << endl; #endif }; +std::ostream &operator<<(std::ostream &o, const Vec &); + }} // namespace CGAL::qglviewer -std::ostream &operator<<(std::ostream &o, const CGAL::qglviewer::Vec &); - #endif // QGLVIEWER_VEC_H diff --git a/GraphicsView/include/CGAL/Qt/vec_impl.h b/GraphicsView/include/CGAL/Qt/vec_impl.h index 340c6cbf62c..865ef09d85d 100644 --- a/GraphicsView/include/CGAL/Qt/vec_impl.h +++ b/GraphicsView/include/CGAL/Qt/vec_impl.h @@ -177,5 +177,6 @@ void Vec::initFromDOMElement(const QDomElement &element) { CGAL_INLINE_FUNCTION std::ostream &operator<<(std::ostream &o, const Vec &v) { return o << v.x << '\t' << v.y << '\t' << v.z; -} -}} +} + +}} // namespace CGAL::qglviewer diff --git a/HalfedgeDS/doc/HalfedgeDS/CGAL/HalfedgeDS_const_decorator.h b/HalfedgeDS/doc/HalfedgeDS/CGAL/HalfedgeDS_const_decorator.h index 872112801dc..3f4ba1cab28 100644 --- a/HalfedgeDS/doc/HalfedgeDS/CGAL/HalfedgeDS_const_decorator.h +++ b/HalfedgeDS/doc/HalfedgeDS/CGAL/HalfedgeDS_const_decorator.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgHDS_Decorators +\ingroup PkgHalfedgeDS_Decorators The class `CGAL::HalfedgeDS_items_decorator` provides additional functions diff --git a/HalfedgeDS/doc/HalfedgeDS/CGAL/HalfedgeDS_decorator.h b/HalfedgeDS/doc/HalfedgeDS/CGAL/HalfedgeDS_decorator.h index 746362713ac..03fead17851 100644 --- a/HalfedgeDS/doc/HalfedgeDS/CGAL/HalfedgeDS_decorator.h +++ b/HalfedgeDS/doc/HalfedgeDS/CGAL/HalfedgeDS_decorator.h @@ -1,6 +1,6 @@ namespace CGAL { /*! -\ingroup PkgHDS_Decorators +\ingroup PkgHalfedgeDS_Decorators The class `CGAL::HalfedgeDS_items_decorator` provides additional functions diff --git a/HalfedgeDS/doc/HalfedgeDS/CGAL/HalfedgeDS_default.h b/HalfedgeDS/doc/HalfedgeDS/CGAL/HalfedgeDS_default.h index bbd41329b33..6ab2a83d527 100644 --- a/HalfedgeDS/doc/HalfedgeDS/CGAL/HalfedgeDS_default.h +++ b/HalfedgeDS/doc/HalfedgeDS/CGAL/HalfedgeDS_default.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgHDS_HDS +\ingroup PkgHalfedgeDS_HDS The class `HalfedgeDS_default` is a model for the `HalfedgeDS` concept. The second template parameter `HalfedgeDSItems` has a default argument diff --git a/HalfedgeDS/doc/HalfedgeDS/CGAL/HalfedgeDS_face_base.h b/HalfedgeDS/doc/HalfedgeDS/CGAL/HalfedgeDS_face_base.h index 4f6e98e924a..37ca8daed46 100644 --- a/HalfedgeDS/doc/HalfedgeDS/CGAL/HalfedgeDS_face_base.h +++ b/HalfedgeDS/doc/HalfedgeDS/CGAL/HalfedgeDS_face_base.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgHDS_VHF +\ingroup PkgHalfedgeDS_VHF The class `HalfedgeDS_face_base` is a model of the `HalfedgeDSFace` concept. `Refs` is an instantiation of a `HalfedgeDS`. The diff --git a/HalfedgeDS/doc/HalfedgeDS/CGAL/HalfedgeDS_face_min_base.h b/HalfedgeDS/doc/HalfedgeDS/CGAL/HalfedgeDS_face_min_base.h index 56ced2fd44e..ad6692b85b8 100644 --- a/HalfedgeDS/doc/HalfedgeDS/CGAL/HalfedgeDS_face_min_base.h +++ b/HalfedgeDS/doc/HalfedgeDS/CGAL/HalfedgeDS_face_min_base.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgHDS_VHF +\ingroup PkgHalfedgeDS_VHF The class `HalfedgeDS_face_min_base` is a model of the `HalfedgeDSFace` concept. `Refs` is an instantiation of a `HalfedgeDS`. It is diff --git a/HalfedgeDS/doc/HalfedgeDS/CGAL/HalfedgeDS_halfedge_base.h b/HalfedgeDS/doc/HalfedgeDS/CGAL/HalfedgeDS_halfedge_base.h index 45c9e165444..4fee656edb6 100644 --- a/HalfedgeDS/doc/HalfedgeDS/CGAL/HalfedgeDS_halfedge_base.h +++ b/HalfedgeDS/doc/HalfedgeDS/CGAL/HalfedgeDS_halfedge_base.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgHDS_VHF +\ingroup PkgHalfedgeDS_VHF The class `HalfedgeDS_halfedge_base` is a model of the `HalfedgeDSHalfedge` concept. `Refs` is an instantiation of a `HalfedgeDS`. diff --git a/HalfedgeDS/doc/HalfedgeDS/CGAL/HalfedgeDS_halfedge_min_base.h b/HalfedgeDS/doc/HalfedgeDS/CGAL/HalfedgeDS_halfedge_min_base.h index 661409637db..b12a7dc7869 100644 --- a/HalfedgeDS/doc/HalfedgeDS/CGAL/HalfedgeDS_halfedge_min_base.h +++ b/HalfedgeDS/doc/HalfedgeDS/CGAL/HalfedgeDS_halfedge_min_base.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgHDS_VHF +\ingroup PkgHalfedgeDS_VHF The class `HalfedgeDS_halfedge_min_base` is a model of the `HalfedgeDSHalfedge` concept. `Refs` is an instantiation of a `HalfedgeDS`. diff --git a/HalfedgeDS/doc/HalfedgeDS/CGAL/HalfedgeDS_items_2.h b/HalfedgeDS/doc/HalfedgeDS/CGAL/HalfedgeDS_items_2.h index 74762abd8ee..d65e338e313 100644 --- a/HalfedgeDS/doc/HalfedgeDS/CGAL/HalfedgeDS_items_2.h +++ b/HalfedgeDS/doc/HalfedgeDS/CGAL/HalfedgeDS_items_2.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgHDS_Items +\ingroup PkgHalfedgeDS_Items The class `HalfedgeDS_items_2` is a model of the `HalfedgeDSItems` concept. It uses the default types for vertices, halfedges, and faces that diff --git a/HalfedgeDS/doc/HalfedgeDS/CGAL/HalfedgeDS_items_decorator.h b/HalfedgeDS/doc/HalfedgeDS/CGAL/HalfedgeDS_items_decorator.h index 7ad28c20c2a..a7c1c8452f2 100644 --- a/HalfedgeDS/doc/HalfedgeDS/CGAL/HalfedgeDS_items_decorator.h +++ b/HalfedgeDS/doc/HalfedgeDS/CGAL/HalfedgeDS_items_decorator.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgHDS_Decorators +\ingroup PkgHalfedgeDS_Decorators The class `CGAL::HalfedgeDS_items_decorator` provides additional functions diff --git a/HalfedgeDS/doc/HalfedgeDS/CGAL/HalfedgeDS_list.h b/HalfedgeDS/doc/HalfedgeDS/CGAL/HalfedgeDS_list.h index 7199bce9c1a..81d5ee9884b 100644 --- a/HalfedgeDS/doc/HalfedgeDS/CGAL/HalfedgeDS_list.h +++ b/HalfedgeDS/doc/HalfedgeDS/CGAL/HalfedgeDS_list.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgHDS_HDS +\ingroup PkgHalfedgeDS_HDS The class `HalfedgeDS_list` is a model for the `HalfedgeDS` concept. `HalfedgeDS_list` is a list-based representation with bidirectional diff --git a/HalfedgeDS/doc/HalfedgeDS/CGAL/HalfedgeDS_min_items.h b/HalfedgeDS/doc/HalfedgeDS/CGAL/HalfedgeDS_min_items.h index 7036bb036b4..e77630c9bb3 100644 --- a/HalfedgeDS/doc/HalfedgeDS/CGAL/HalfedgeDS_min_items.h +++ b/HalfedgeDS/doc/HalfedgeDS/CGAL/HalfedgeDS_min_items.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgHDS_Items +\ingroup PkgHalfedgeDS_Items The class `HalfedgeDS_min_items` is a model of the `HalfedgeDSItems` concept. It defines types for vertices, halfedges, and faces that diff --git a/HalfedgeDS/doc/HalfedgeDS/CGAL/HalfedgeDS_vector.h b/HalfedgeDS/doc/HalfedgeDS/CGAL/HalfedgeDS_vector.h index 4eb89512958..88c32a00b1d 100644 --- a/HalfedgeDS/doc/HalfedgeDS/CGAL/HalfedgeDS_vector.h +++ b/HalfedgeDS/doc/HalfedgeDS/CGAL/HalfedgeDS_vector.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgHDS_HDS +\ingroup PkgHalfedgeDS_HDS The class `HalfedgeDS_vector` is a model for the `HalfedgeDS` concept. `HalfedgeDS_vector` is a vector-based representation with random diff --git a/HalfedgeDS/doc/HalfedgeDS/CGAL/HalfedgeDS_vertex_base.h b/HalfedgeDS/doc/HalfedgeDS/CGAL/HalfedgeDS_vertex_base.h index e76ea3dd61e..bbc6345e128 100644 --- a/HalfedgeDS/doc/HalfedgeDS/CGAL/HalfedgeDS_vertex_base.h +++ b/HalfedgeDS/doc/HalfedgeDS/CGAL/HalfedgeDS_vertex_base.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgHDS_VHF +\ingroup PkgHalfedgeDS_VHF The class `HalfedgeDS_vertex_base` is a model of the `HalfedgeDSVertex` concept. `Refs` is an instantiation of a `HalfedgeDS`. The diff --git a/HalfedgeDS/doc/HalfedgeDS/CGAL/HalfedgeDS_vertex_min_base.h b/HalfedgeDS/doc/HalfedgeDS/CGAL/HalfedgeDS_vertex_min_base.h index 28756ef9d02..550b4c0aaa6 100644 --- a/HalfedgeDS/doc/HalfedgeDS/CGAL/HalfedgeDS_vertex_min_base.h +++ b/HalfedgeDS/doc/HalfedgeDS/CGAL/HalfedgeDS_vertex_min_base.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgHDS_VHF +\ingroup PkgHalfedgeDS_VHF The class `HalfedgeDS_vertex_min_base` is a model of the `HalfedgeDSVertex` concept. `Refs` is an instantiation of a `HalfedgeDS`. It is diff --git a/HalfedgeDS/doc/HalfedgeDS/Concepts/HalfedgeDS.h b/HalfedgeDS/doc/HalfedgeDS/Concepts/HalfedgeDS.h index 5e3c5d9c27d..b8bbf25099c 100644 --- a/HalfedgeDS/doc/HalfedgeDS/Concepts/HalfedgeDS.h +++ b/HalfedgeDS/doc/HalfedgeDS/Concepts/HalfedgeDS.h @@ -1,5 +1,5 @@ /*! -\ingroup PkgHDSConcepts +\ingroup PkgHalfedgeDSConcepts \cgalConcept The concept of a halfedge data structure (abbreviated as `HalfedgeDS`, or diff --git a/HalfedgeDS/doc/HalfedgeDS/Concepts/HalfedgeDSFace.h b/HalfedgeDS/doc/HalfedgeDS/Concepts/HalfedgeDSFace.h index e025a3a8f87..e98a08bc57e 100644 --- a/HalfedgeDS/doc/HalfedgeDS/Concepts/HalfedgeDSFace.h +++ b/HalfedgeDS/doc/HalfedgeDS/Concepts/HalfedgeDSFace.h @@ -1,5 +1,5 @@ /*! -\ingroup PkgHDSConcepts +\ingroup PkgHalfedgeDSConcepts \cgalConcept The concept `HalfedgeDSFace` defines the requirements for the local `Face` diff --git a/HalfedgeDS/doc/HalfedgeDS/Concepts/HalfedgeDSHalfedge.h b/HalfedgeDS/doc/HalfedgeDS/Concepts/HalfedgeDSHalfedge.h index 108ba5d5b46..ac634b0bad6 100644 --- a/HalfedgeDS/doc/HalfedgeDS/Concepts/HalfedgeDSHalfedge.h +++ b/HalfedgeDS/doc/HalfedgeDS/Concepts/HalfedgeDSHalfedge.h @@ -1,5 +1,5 @@ /*! -\ingroup PkgHDSConcepts +\ingroup PkgHalfedgeDSConcepts \cgalConcept The concept `HalfedgeDSHalfedge` defines the requirements for the local `Halfedge` diff --git a/HalfedgeDS/doc/HalfedgeDS/Concepts/HalfedgeDSItems.h b/HalfedgeDS/doc/HalfedgeDS/Concepts/HalfedgeDSItems.h index 47b33ced659..085875ee624 100644 --- a/HalfedgeDS/doc/HalfedgeDS/Concepts/HalfedgeDSItems.h +++ b/HalfedgeDS/doc/HalfedgeDS/Concepts/HalfedgeDSItems.h @@ -1,5 +1,5 @@ /*! -\ingroup PkgHDSConcepts +\ingroup PkgHalfedgeDSConcepts \cgalConcept The concept `HalfedgeDSItems` wraps the three item types - vertex, diff --git a/HalfedgeDS/doc/HalfedgeDS/Concepts/HalfedgeDSVertex.h b/HalfedgeDS/doc/HalfedgeDS/Concepts/HalfedgeDSVertex.h index 008297822a5..a8e41712676 100644 --- a/HalfedgeDS/doc/HalfedgeDS/Concepts/HalfedgeDSVertex.h +++ b/HalfedgeDS/doc/HalfedgeDS/Concepts/HalfedgeDSVertex.h @@ -1,5 +1,5 @@ /*! -\ingroup PkgHDSConcepts +\ingroup PkgHalfedgeDSConcepts \cgalConcept The concept `HalfedgeDSVertex` defines the requirements for the local `Vertex` diff --git a/HalfedgeDS/doc/HalfedgeDS/PackageDescription.txt b/HalfedgeDS/doc/HalfedgeDS/PackageDescription.txt index bca353bfb67..5202070123e 100644 --- a/HalfedgeDS/doc/HalfedgeDS/PackageDescription.txt +++ b/HalfedgeDS/doc/HalfedgeDS/PackageDescription.txt @@ -1,31 +1,31 @@ -/// \defgroup PkgHDS Halfedge Data Structures Reference -/// \defgroup PkgHDSConcepts Concepts -/// \ingroup PkgHDS +/// \defgroup PkgHalfedgeDSRef Halfedge Data Structures Reference +/// \defgroup PkgHalfedgeDSConcepts Concepts +/// \ingroup PkgHalfedgeDSRef -/// \defgroup PkgHDS_HDS Halfedge Data Structures -/// \ingroup PkgHDS +/// \defgroup PkgHalfedgeDS_HDS Halfedge Data Structures +/// \ingroup PkgHalfedgeDSRef -/// \defgroup PkgHDS_Items Item Classes -/// \ingroup PkgHDS +/// \defgroup PkgHalfedgeDS_Items Item Classes +/// \ingroup PkgHalfedgeDSRef -/// \defgroup PkgHDS_VHF Vertices, Halfedges, Faces -/// \ingroup PkgHDS +/// \defgroup PkgHalfedgeDS_VHF Vertices, Halfedges, Faces +/// \ingroup PkgHalfedgeDSRef -/// \defgroup PkgHDS_Decorators Decorators -/// \ingroup PkgHDS +/// \defgroup PkgHalfedgeDS_Decorators Decorators +/// \ingroup PkgHalfedgeDSRef /// Classes that provide additional functions /// to examine and to modify a halfedge data structure. /*! -\addtogroup PkgHDS +\addtogroup PkgHalfedgeDSRef \todo check generated documentation -\cgalPkgDescriptionBegin{Halfedge Data Structures,PkgHDSSummary} +\cgalPkgDescriptionBegin{Halfedge Data Structures,PkgHalfedgeDS} \cgalPkgPicture{HalfedgeDS/fig/HalfedgeDS-teaser-small.png} \cgalPkgSummaryBegin \cgalPkgAuthor{Lutz Kettner} \cgalPkgDesc{A halfedge data structure is an edge-centered data structure capable of maintaining incidence information of vertices, edges and faces, for example for planar maps, polyhedra, or other orientable, two-dimensional surfaces embedded in arbitrary dimension. Each edge is decomposed into two halfedges with opposite orientations. One incident face and one incident vertex are stored in each halfedge. For each face and each vertex, one incident halfedge is stored. Reduced variants of the halfedge data structure can omit some of these information, for example the halfedge pointers in faces or the storage of faces at all.} -\cgalPkgManuals{Chapter_Halfedge_Data_Structures,PkgHDS} +\cgalPkgManuals{Chapter_Halfedge_Data_Structures,PkgHalfedgeDSRef} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{1.0} diff --git a/HalfedgeDS/examples/HalfedgeDS/CMakeLists.txt b/HalfedgeDS/examples/HalfedgeDS/CMakeLists.txt index 8c257523353..447e7b6ba16 100644 --- a/HalfedgeDS/examples/HalfedgeDS/CMakeLists.txt +++ b/HalfedgeDS/examples/HalfedgeDS/CMakeLists.txt @@ -4,18 +4,12 @@ project( HalfedgeDS_Examples ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/HalfedgeDS/include/CGAL/boost/graph/graph_traits_HalfedgeDS_default.h b/HalfedgeDS/include/CGAL/boost/graph/graph_traits_HalfedgeDS_default.h index 6b3898880b1..aaddbbe254a 100644 --- a/HalfedgeDS/include/CGAL/boost/graph/graph_traits_HalfedgeDS_default.h +++ b/HalfedgeDS/include/CGAL/boost/graph/graph_traits_HalfedgeDS_default.h @@ -25,6 +25,7 @@ #include #include #include +#include namespace CGAL { @@ -446,21 +447,6 @@ num_faces(const HalfedgeDS_default& p) { return p.size_of_faces(); } -namespace internal { - -template -struct HDS_Point_accessor - : boost::put_get_helper< Reference, HDS_Point_accessor > -{ - typedef boost::lvalue_property_map_tag category; - typedef Reference reference; - typedef ValueType value_type; - typedef Handle key_type; - - reference operator[](Handle h) const { return h->point(); } -}; - -} // namespace internal template struct HDS_property_map; @@ -471,13 +457,13 @@ struct HDS_property_map template struct bind_ { - typedef internal::HDS_Point_accessor< + typedef internal::Point_accessor< typename boost::graph_traits< HalfedgeDS_default >::vertex_descriptor, typename T::Point_3, typename T::Point_3&> type; - typedef internal::HDS_Point_accessor< + typedef internal::Point_accessor< typename boost::graph_traits< HalfedgeDS_default >::vertex_descriptor, diff --git a/HalfedgeDS/test/HalfedgeDS/CMakeLists.txt b/HalfedgeDS/test/HalfedgeDS/CMakeLists.txt index 12d17a2e56c..f5f9cd20dc2 100644 --- a/HalfedgeDS/test/HalfedgeDS/CMakeLists.txt +++ b/HalfedgeDS/test/HalfedgeDS/CMakeLists.txt @@ -4,18 +4,12 @@ project( HalfedgeDS_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Hash_map/benchmark/Hash_map/CMakeLists.txt b/Hash_map/benchmark/Hash_map/CMakeLists.txt index 0943567d71a..69c35aa6cf8 100644 --- a/Hash_map/benchmark/Hash_map/CMakeLists.txt +++ b/Hash_map/benchmark/Hash_map/CMakeLists.txt @@ -4,7 +4,7 @@ project( Hash_map ) -cmake_minimum_required(VERSION 2.6.2) +cmake_minimum_required(VERSION 3.1) if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" VERSION_GREATER 2.6) if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}" VERSION_GREATER 2.8.3) cmake_policy(VERSION 2.8.4) @@ -24,10 +24,6 @@ if ( NOT CGAL_FOUND ) endif() -# include helper file -include( ${CGAL_USE_FILE} ) - - # Boost and its components find_package( Boost REQUIRED ) @@ -42,14 +38,10 @@ endif() # include for local directory # include for local package -include_directories( BEFORE ../../include ) - # Creating entries for all .cpp/.C files with "main" routine # ########################################################## -include( CGAL_CreateSingleSourceCGALProgram ) - create_single_source_cgal_program( "hm.cpp" ) create_single_source_cgal_program( "foreach.cpp" ) create_single_source_cgal_program( "triangulation.cpp" ) diff --git a/Hash_map/test/Hash_map/CMakeLists.txt b/Hash_map/test/Hash_map/CMakeLists.txt index 13977a93c71..dc3c46af912 100644 --- a/Hash_map/test/Hash_map/CMakeLists.txt +++ b/Hash_map/test/Hash_map/CMakeLists.txt @@ -4,19 +4,13 @@ project( Hash_map_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - include_directories (BEFORE "../../include") - - include_directories (BEFORE "include") + include_directories (BEFORE "include") # create a target per cppfile file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) diff --git a/Homogeneous_kernel/include/CGAL/Homogeneous/Aff_transformationH2.h b/Homogeneous_kernel/include/CGAL/Homogeneous/Aff_transformationH2.h index c14000e1b02..b3f054d611a 100644 --- a/Homogeneous_kernel/include/CGAL/Homogeneous/Aff_transformationH2.h +++ b/Homogeneous_kernel/include/CGAL/Homogeneous/Aff_transformationH2.h @@ -605,6 +605,21 @@ public: Aff_transformationH2 operator*(const Aff_transformationH2& right_argument ) const; + + + bool operator==(const Aff_transformationH2 &t)const + { + for(int i=0; i<3; ++i) + for(int j = 0; j< 3; ++j) + if(homogeneous(i,j)!=t.homogeneous(i,j)) + return false; + return true; + } + + bool operator!=(const Aff_transformationH2 &t)const + { + return !(*this == t); + } }; diff --git a/Homogeneous_kernel/include/CGAL/Homogeneous/Aff_transformationH3.h b/Homogeneous_kernel/include/CGAL/Homogeneous/Aff_transformationH3.h index 11f699ded22..5dccc6ec83b 100644 --- a/Homogeneous_kernel/include/CGAL/Homogeneous/Aff_transformationH3.h +++ b/Homogeneous_kernel/include/CGAL/Homogeneous/Aff_transformationH3.h @@ -364,6 +364,20 @@ public: RT hm(int i, int j) const { return this->Ptr()->homogeneous(i,j); } + + bool operator==(const Aff_transformationH3 &t)const + { + for(int i=0; i<3; ++i) + for(int j = 0; j< 4; ++j) + if(homogeneous(i,j)!=t.homogeneous(i,j)) + return false; + return true; + } + + bool operator!=(const Aff_transformationH3 &t)const + { + return !(*this == t); + } }; template < class R > diff --git a/Inscribed_areas/doc/Inscribed_areas/CGAL/Extremal_polygon_traits_2.h b/Inscribed_areas/doc/Inscribed_areas/CGAL/Extremal_polygon_traits_2.h index 4cbe9351891..106392639d5 100644 --- a/Inscribed_areas/doc/Inscribed_areas/CGAL/Extremal_polygon_traits_2.h +++ b/Inscribed_areas/doc/Inscribed_areas/CGAL/Extremal_polygon_traits_2.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgInscribedAreas +\ingroup PkgInscribedAreasRef \cgalAdvancedClass \cgalAdvancedBegin @@ -105,7 +105,7 @@ Orientation_2 orientation_2_object(); }; /* end Extremal_polygon_area_traits_2 */ /*! -\ingroup PkgInscribedAreas +\ingroup PkgInscribedAreasRef \cgalAdvancedClass \cgalAdvancedBegin 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 716236ecf76..f464fb1fdee 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 @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgInscribedAreas +\ingroup PkgInscribedAreasRef Given a set of points in the plane, the class `Largest_empty_iso_rectangle_2` is a data structure that maintains an iso-rectangle with the largest area among diff --git a/Inscribed_areas/doc/Inscribed_areas/CGAL/extremal_polygon_2.h b/Inscribed_areas/doc/Inscribed_areas/CGAL/extremal_polygon_2.h index ebc2093435c..08c4b2a7031 100644 --- a/Inscribed_areas/doc/Inscribed_areas/CGAL/extremal_polygon_2.h +++ b/Inscribed_areas/doc/Inscribed_areas/CGAL/extremal_polygon_2.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgInscribedAreas +\ingroup PkgInscribedAreasRef computes a maximal (as specified by `t`) inscribed `k`-gon of the convex polygon described by [`points_begin`, @@ -49,7 +49,7 @@ const Traits& t); /*! -\ingroup PkgInscribedAreas +\ingroup PkgInscribedAreasRef \brief computes a maximum area inscribed `k`-gon of the convex polygon @@ -116,7 +116,7 @@ OutputIterator o); namespace CGAL { /*! -\ingroup PkgInscribedAreas +\ingroup PkgInscribedAreasRef \brief computes a maximum perimeter inscribed `k`-gon of the convex polygon described by `[points_begin, points_end)`, writes its diff --git a/Inscribed_areas/doc/Inscribed_areas/PackageDescription.txt b/Inscribed_areas/doc/Inscribed_areas/PackageDescription.txt index 929cb77847e..9270c38d3bb 100644 --- a/Inscribed_areas/doc/Inscribed_areas/PackageDescription.txt +++ b/Inscribed_areas/doc/Inscribed_areas/PackageDescription.txt @@ -1,17 +1,17 @@ -/// \defgroup PkgInscribedAreas Inscribed Areas Reference +/// \defgroup PkgInscribedAreasRef Inscribed Areas Reference /// \defgroup PkgInscribedAreasConcepts Concepts -/// \ingroup PkgInscribedAreas +/// \ingroup PkgInscribedAreasRef /*! -\addtogroup PkgInscribedAreas +\addtogroup PkgInscribedAreasRef \todo check generated documentation -\cgalPkgDescriptionBegin{Inscribed Areas,PkgInscribedAreasSummary} +\cgalPkgDescriptionBegin{Inscribed Areas,PkgInscribedAreas} \cgalPkgPicture{ler-detail.png} \cgalPkgSummaryBegin \cgalPkgAuthors{Michael Hoffmann and Eli Packer} \cgalPkgDesc{This package provides algorithms for computing inscribed areas. The algorithms for computing inscribed areas are: the largest inscribed k-gon (area or perimeter) of a convex point set and the largest inscribed iso-rectangle.} -\cgalPkgManuals{Chapter_Inscribed_Areas,PkgInscribedAreas} +\cgalPkgManuals{Chapter_Inscribed_Areas,PkgInscribedAreasRef} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{1.1} diff --git a/Inscribed_areas/examples/Inscribed_areas/CMakeLists.txt b/Inscribed_areas/examples/Inscribed_areas/CMakeLists.txt index e41f02d97e4..3d5706c5c0d 100644 --- a/Inscribed_areas/examples/Inscribed_areas/CMakeLists.txt +++ b/Inscribed_areas/examples/Inscribed_areas/CMakeLists.txt @@ -4,18 +4,12 @@ project( Inscribed_areas_Examples ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Inscribed_areas/test/Inscribed_areas/CMakeLists.txt b/Inscribed_areas/test/Inscribed_areas/CMakeLists.txt index 8e1dc364365..bbf3e5e4984 100644 --- a/Inscribed_areas/test/Inscribed_areas/CMakeLists.txt +++ b/Inscribed_areas/test/Inscribed_areas/CMakeLists.txt @@ -4,18 +4,12 @@ project( Inscribed_areas_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Installation/CHANGES.md b/Installation/CHANGES.md index 36ec3ab0f90..b83adc89c21 100644 --- a/Installation/CHANGES.md +++ b/Installation/CHANGES.md @@ -1,84 +1,208 @@ Release History =============== +Release 4.14 +------------ + +Release date: March 2019 + +### Polygon Mesh Processing package +- Added the following new functions to detect and repair issues in polygon soups: + - `CGAL::Polygon_mesh_processing::remove_isolated_points_in_polygon_soup()`, which detects and removes + points that are not used in any polygon of the soup. + - `CGAL::Polygon_mesh_processing::merge_duplicate_points_in_polygon_soup()`, + which detects and merges points that share the same geometric position. + - `CGAL::Polygon_mesh_processing::merge_duplicate_polygons_in_polygon_soup()`, + which detects and merges polygons that are identical. + - `CGAL::Polygon_mesh_processing::repair_polygon_soup()`, + which applies a number of repairing steps (a subset of which are the functions above) + to clean and repair a polygon soup. +- Added the following new functions to detect and repair degeneracies in polygon meshes: + - `CGAL::Polygon_mesh_processing::degenerate_edges()` + - `CGAL::Polygon_mesh_processing::degenerate_faces()` + - `CGAL::Polygon_mesh_processing::is_non_manifold_vertex()` + - `CGAL::Polygon_mesh_processing::is_degenerate_triangle_face()` + - `CGAL::Polygon_mesh_processing::is_degenerate_edge()` + - `CGAL::Polygon_mesh_processing::is_needle_triangle_face()` + - `CGAL::Polygon_mesh_processing::is_cap_triangle_face()` + - `CGAL::Polygon_mesh_processing::duplicate_non_manifold_vertices()` + - `CGAL::Polygon_mesh_processing::extract_boundary_cycles()` + - `CGAL::Polygon_mesh_processing::merge_duplicated_vertices_in_boundary_cycle()` + - `CGAL::Polygon_mesh_processing::merge_duplicated_vertices_in_boundary_cycles()` +- Added the class `CGAL::Rigid_triangle_mesh_collision_detection` to detect intersections between meshes + and volumes undergoing affine transformations. + +### 3D Fast Intersection and Distance Computation + +- The primitives `AABB_face_graph_triangle_primitive` and + `AABB_halfedge_graph_segment_primitive` now use as `Id` a pair of descriptor and + graph pointer in the case they are configured to deal with a possible different + graph per primitive (configuration set using a template tag). + Release 4.13 ------------ -Release date: September 2018 +Release date: October 2018 ### 3D Periodic Mesh Generation (new package) -- This package generates 3-dimensional periodic meshes. It computes isotropic simplicial meshes - for domains described through implicit functional boundaries over the flat torus (which can also seen - in the Euclidean space as a periodic cube). The output is a periodic 3D mesh of the domain - volume and conformal surface meshes for all the boundary and subdividing surfaces. - The package is closely related to the 3D Mesh Generation package, with similar concepts, classes, and API. +- This package generates 3-dimensional periodic meshes. It computes + isotropic simplicial meshes for domains described through implicit + functional boundaries over the flat torus (which can also seen in + the Euclidean space as a periodic cube). The output is a periodic + 3D mesh of the domain volume and conformal surface meshes for all + the boundary and subdividing surfaces. The package is closely + related to the 3D Mesh Generation package, with similar concepts, + classes, and API. ### Installation -- The library `CGAL_Qt5` now contains a fork of the version 2.7.0 of `libQGLViewer`. - The corresponding code is in the package GraphicsView. - The dependency for the external library `libQGLViewer` is therefore dropped for all demos. +- The library `CGAL_Qt5` now contains a fork of the version 2.7.0 of + `libQGLViewer`. The corresponding code is in the package + `GraphicsView`. The dependency for the external library + `libQGLViewer` is therefore dropped for all demos. ### General - A new function `CGAL::draw()` is added in the packages Polyhedral - Surface, Surface Mesh, Linear Cell Complex, 2D Triangulations, and 3D - Triangulations, enabling to draw the corresponding data structures. + Surface, Surface Mesh, Linear Cell Complex, 2D Triangulations, and + 3D Triangulations, enabling to draw the corresponding data + structures. ### 2D and 3D Linear Geometry Kernel - An `operator()` that takes a `Ray_3` has been added to the concept `ConstructProjectedPoint_3`. -### CGAL and Boost Property Maps +### Convex hull 3 + +- Added the function `extreme_points_3()` computing the points on + the convex hull without underlying connectivity. + +- Added a traits adapter called `Extreme_points_traits_adapter_3` + that enables the use of the function `extreme_points_3()` on a + range of keys, each key being associated to 3D point using a + property map. This can be used to get the vertices of a mesh that + are on it convex hull, or the indices of points in a range that + are on it convex hull. + +- Fix a bug in the computation of the 3D convex hull that was + leaving extra points within subset of coplanar points that do not + belong to the minimal convex hull. -- Added a read-write property map to convert on-the-fly geometric - objects from Cartesian kernels. ### 2D and 3D Triangulations -- Added a new type of intersection to handle the insertion of intersecting constraints - in a `Constrained_triangulation_2`. +- Added a new type of intersection to handle the insertion of + intersecting constraints in a `Constrained_triangulation_2`. -- **Breaking change:** The long-deprecated class `Triangulation_cell_base_with_circumcenter_3` - and its associated concept have been removed. Users should use the classes - `Delaunay_cell_base_with_circumcenter_3` or `Regular_cell_base_with_circumcenter_3`, - depending on which type of triangulation they are using. -- **Breaking change:** The deprecated functions `mirror_index` and `mirror_vertex` - of the class `Triangulation_face_base_2` have been removed. Users should use the - equivalent functions from the class `Triangulation_2`. +- **Breaking change:** The long-deprecated class + `Triangulation_cell_base_with_circumcenter_3` and its associated + concept have been removed. Users should use the classes + `Delaunay_cell_base_with_circumcenter_3` or + `Regular_cell_base_with_circumcenter_3`, depending on which type + of triangulation they are using. -### Interpolation +- **Breaking change:** The deprecated functions `mirror_index` and + `mirror_vertex` of the class `Triangulation_face_base_2` have been + removed. Users should use the equivalent functions from the class + `Triangulation_2`. -- The output of the natural and regular neighbor functions (resp. the gradient - fitting functions) is no longer restricted to a Point/Coordinate pair - (resp. Point/Vector pair). Instead, users can provide their own functor - to format the output as they desire. -- The interpolation functions can now operate on any combination of Type/Coordinate, - provided that the values and gradients functors can also be evaluated using 'Type'. +### 3D Mesh Generation - The combination of these two changes allow, for example, to operate with Vertex/Coordinate - pairs, which enables a more efficient access to values and gradients by storing - information directly in the vertex. +- **Breaking change:** The template parameters of the class template + `Labeled_mesh_domain_3` have been simplified. The three + constructors of that class template have been replaced by a new + unique constructor using Boost named parameters. Three new static + template member functions that act as named constructors have been + added: + - `create_gray_image_mesh_domain()`, to create a domain from a 3D + gray image, + - `create_labeled_image_mesh_domain()`, to create a domain from a 3D + labeled image, and + - `create_implicit_mesh_domain()`, to create a domain from an + implicit function. -- The concepts `InterpolationTraits` and `GradientFittingTraits` have been updated - to reflect the real needs of the code (some types and operators were used - in the code but did not appear in the concepts). +- The class templates `Implicit_mesh_domain_3`, + `Gray_image_mesh_domain_3`, and `Labeled_image_mesh_domain_3` are + now deprecated. -### Convex hull 3 +- **Breaking change:** The headers + `` and + ``, that were deprecated + since CGAL 4.5, have been removed. -- Added the function `extreme_points_3()` computing the - points on the convex hull without underlying connectivity. -- Added a traits adapter called `Extreme_points_traits_adapter_3` - that enables the use of the function `extreme_points_3()` on a range of keys, - each key being associated to 3D point using a property map. - This can be used to get the vertices of a mesh that are on it - convex hull, or the indices of points in a range that are - on it convex hull. -- Fix a bug in the computation of the 3D convex hull that was leaving extra points - within subset of coplanar points that do not belong to the minimal convex hull. +- **Breaking change:** the concepts `MeshCellCriteria_3` and + `MeshFacetCriteria_3` now require the triangulation to be passed + in their `operator()`. Models of these concepts that are provided + by CGAL have been modified accordingly. +- **Breaking change:** It is no longer possible to use the + deprecated, pre-CGAL 3.8 specifications in `MeshCellCriteria_3` + and `MeshFacetCriteria_3` (that is, using `Facet_badness` and + `Cell_badness` instead of `Is_facet_bad` and `Is_cell_bad`). + +- The concept `MeshFacetCriteria_3` no longer requires the function + `operator()(Cell_handle c, int i)`. + +- The concept `MeshEdgeCriteria_3` no longer requires the function + `operator()(const Edge& e)`. + +- The concept `MeshComplexWithFeatures_3InTriangulation_3` no longer + requires the functions `number_of_edges(Curve_index index)` and + `number_of_corners(Corner_index index)`. + +- Introduced the concept `MeshTriangulationTraits_3`, which covers + the needs of the traits class used in `Mesh_3` (and + `Periodic_3_mesh_3`). The traits class used as template parameter + of `Mesh_triangulation_3` and `Periodic_3_mesh_triangulation_3` + must be a model of this concept. + +- Added the function + `Mesh_domain_with_polyline_features_3::add_corner()`, which allows + users to add a single corner (that is not incident to any + polyline) to the mesh complex. + +- **Breaking change**: `CGAL::lloyd_optimize_mesh_3` now depends on + the _Eigen_ library. + +### Polygon Mesh Processing + +- Added a named parameter in stitching functions that allows to + choose whether the operation should be performed per connected + component or globally. + +- Added a function, `CGAL::Polygon_mesh_processing::transform()`, to + apply a transformation to a mesh. + +- Added a named parameter `visitor` in corefinement-related + functions that makes it possible to pass a visitor to the function + in order to track the creation of new faces. + +- Added a named parameter `throw_on_self_intersection` in all + corefinement-related functions, which enables to check for + self-intersecting faces involved in the intersection before trying + to corefine the input meshes. This new parameter replaces the + `bool` parameter in `corefine()`. + +- Added the function `corefine_and_compute_boolean_operations()`, + which can be used to compute the result of several Boolean + operations between two volumes at the same time. + +- Added the function `clip()`, which can be used to clip a + triangulated surface mesh by a plane or a clipping volume. + +- Constrained vertices are now guaranteed to be kept in the mesh + after calling `isotropic_remeshing()` (and not only the points + associated to constrained vertices, as it was before). + +- Added a function, `CGAL::Polygon_mesh_processing::extrude_mesh()`, + to perform an extrusion of an open polygon mesh. + +### Estimation of Local Differential Properties of Point-Sampled Surfaces Reference + +- **Breaking change**: `CGAL::Monge_via_jet_fitting` now depends on + the _Eigen_ library. ### Point Set Processing @@ -92,7 +216,7 @@ Release date: September 2018 `CGAL::wlop_simplify_and_regularize_point_set()`. -### Classification +### Classification - Added data structures to handle classification of Surface Meshes and of Clusters. @@ -105,102 +229,49 @@ Release date: September 2018 simple HSV color channel features. - **Breaking change**: the API of - `CGAL::Classification::Point_set_feature_generator` has been simplified. + `CGAL::Classification::Point_set_feature_generator` has been + simplified. -### Polygon Mesh Processing - -- Added a named parameter in stitching functions that allows to choose whether the operation should - be performed per connected component or globally. - -- Added a function, `CGAL::Polygon_mesh_processing::transform()`, to apply a transformation to a mesh. - -- Added a named parameter `visitor` in corefinement-related functions - that makes it possible to pass a visitor to the function in order to track - the creation of new faces. -- Added a named parameter `throw_on_self_intersection` in all corefinement-related functions, - which enables to check for self-intersecting faces involved in the intersection - before trying to corefine the input meshes. This new parameter replaces the `bool` parameter - in `corefine()`. -- Added the function `corefine_and_compute_boolean_operations()`, which can be used to - compute the result of several Boolean operations between two volumes at the same time. -- Added the function `clip()`, which can be used to clip a triangulated surface mesh - by a plane or a clipping volume. - -- Constrained vertices are now guaranteed to be kept in the mesh after calling `isotropic_remeshing()` - (and not only the points associated to constrained vertices, as it was before). - -- Added a function, `CGAL::Polygon_mesh_processing::extrude_mesh()`, to perform an extrusion of an open polygon mesh. - -### 3D Mesh Generation - -- **Breaking change:** The template parameters of the class template - `Labeled_mesh_domain_3` have been simplified. The three constructors of - that class template have been replaced by a new unique constructor - using Boost named parameters. Three new static template member - functions that act as named constructors have been added: - - `create_gray_image_mesh_domain()`, to create a domain from a 3D - gray image, - - `create_labeled_image_mesh_domain()`, to create a domain from a 3D - labeled image, and - - `create_implicit_mesh_domain()`, to create a domain from an - implicit function. - -- The class templates `Implicit_mesh_domain_3`, - `Gray_image_mesh_domain_3`, and `Labeled_image_mesh_domain_3` are now - deprecated. - -- **Breaking change:** The headers - `` and - ``, that were deprecated since - CGAL 4.5, have been removed. - -- **Breaking change:** the concepts `MeshCellCriteria_3` and `MeshFacetCriteria_3` - now require the triangulation to be passed in their `operator()`. - Models of these concepts that are provided by CGAL have been modified accordingly. - -- **Breaking change:** It is no longer possible to use the deprecated, pre-CGAL 3.8 specifications - in `MeshCellCriteria_3` and `MeshFacetCriteria_3` (that is, using `Facet_badness` - and `Cell_badness` instead of `Is_facet_bad` and `Is_cell_bad`). - -- The concept `MeshFacetCriteria_3` no longer requires the function `operator()(Cell_handle c, int i)`. -- The concept `MeshEdgeCriteria_3` no longer requires the function `operator()(const Edge& e)`. -- The concept `MeshComplexWithFeatures_3InTriangulation_3` no longer requires the functions - `number_of_edges(Curve_index index)` and `number_of_corners(Corner_index index)`. - -- Introduced the concept `MeshTriangulationTraits_3`, which covers the needs of the traits - class used in `Mesh_3` (and `Periodic_3_mesh_3`). The traits class used as template parameter - of `Mesh_triangulation_3` and `Periodic_3_mesh_triangulation_3` must be a model of this concept. - -- Added the function `Mesh_domain_with_polyline_features_3::add_corner()`, which allows users - to add a single corner (that is not incident to any polyline) to the mesh complex. - - -- **Breaking change**: `CGAL::lloyd_optimize_mesh_3` now depends on - the _Eigen_ library. - -### Estimation of Local Differential Properties of Point-Sampled Surfaces Reference - -- **Breaking change**: `CGAL::Monge_via_jet_fitting` now depends on - the _Eigen_ library. - ### Bounding Volumes - **Breaking change**: `CGAL::Approximate_min_ellipsoid_d` now depends on the _Eigen_ library. +### Interpolation + +- The output of the natural and regular neighbor functions + (resp. the gradient fitting functions) is no longer restricted to + a Point/Coordinate pair (resp. Point/Vector pair). Instead, users + can provide their own functor to format the output as they desire. + +- The interpolation functions can now operate on any combination of + Type/Coordinate, provided that the values and gradients functors + can also be evaluated using 'Type'. + + The combination of these two changes allow, for example, to + operate with Vertex/Coordinate pairs, which enables a more + efficient access to values and gradients by storing information + directly in the vertex. + +- The concepts `InterpolationTraits` and `GradientFittingTraits` + have been updated to reflect the real needs of the code (some + types and operators were used in the code but did not appear in + the concepts). + ### CGAL and the Boost Graph Library (BGL) -- Added a helper function, `CGAL::is_valid_polygon_mesh`, that checks the - validity of a polygon mesh using BGL functions. +- Added a helper function, `CGAL::is_valid_polygon_mesh`, that + checks the validity of a polygon mesh using BGL functions. -- Improved the function `CGAL::Euler::collapse_edge` such that the target - vertex of the collapsed edge is now always kept after the collapse. +- Improved the function `CGAL::Euler::collapse_edge` such that the + target vertex of the collapsed edge is now always kept after the + collapse. -- The function `copy_face_graph()` now uses named parameters, some allowing it - to use property maps instead of output iterators. +- The function `copy_face_graph()` now uses named parameters, some + allowing it to use property maps instead of output iterators. -- Addition of the following named parameters : +- Addition of the following named parameters : - vertex_to_vertex_output_iterator - halfedge_to_halfedge_output_iterator - face_to_face_output_iterator @@ -211,8 +282,30 @@ Release date: September 2018 ### CGAL and Solvers - **Breaking change**: `CGAL::Diagonalize_traits` is now deprecated - and should not be used. The class `CGAL::Eigen_diagonalize_traits` (along - with the _Eigen_ library) should be used instead. + and should not be used. The class `CGAL::Eigen_diagonalize_traits` + (along with the _Eigen_ library) should be used instead. + +### CGAL and Boost Property Maps + +- Added a read-write property map to convert on-the-fly geometric + objects from Cartesian kernels. + +### 2D Arrangements + +- Refracted and fixed the `graph_traits` for the dual of an arrangement of the + following types: + `Arrangement_on_surface_2`, + `Arrangement_2`, + `Arrangement_on_surface_with_history_2`, and + `Arrangement_with_history_2`. + +- **Breaking change**: The old `` + header file has been replaced by the four header files below; each defines + the `graph_traits` for dual of the corresponding arrangement type. + ``, + ``, + ``, and + `=3.1) Required by the packages: - o Estimation of Local Differential Properties of Point-Sampled Surfaces - o Approximation of Ridges and Umbilics on Triangulated Surface Meshes - o Planar Parameterization of Triangulated Surface Meshes - o Surface Reconstruction from Point Sets + * Estimation of Local Differential Properties of Point-Sampled Surfaces + * Approximation of Ridges and Umbilics on Triangulated Surface Meshes + * Planar Parameterization of Triangulated Surface Meshes + * Surface Reconstruction from Point Sets http://eigen.tuxfamily.org - BLAS, LAPACK, ATLAS Required by the packages (if EIGEN is not available): - o Estimation of Local Differential Properties of Point-Sampled Surfaces - o Approximation of Ridges and Umbilics on Triangulated Surface Meshes - o Planar Parameterization of Triangulated Surface Meshes + * Estimation of Local Differential Properties of Point-Sampled Surfaces + * Approximation of Ridges and Umbilics on Triangulated Surface Meshes + * Planar Parameterization of Triangulated Surface Meshes http://www.netlib.org/blas/, http://www.netlib.org/lapack/ or precompiled version that can be downloaded with CGAL-x.y-Setup.exe - MPFI Required by the package: - o Algebraic Kernel + * Algebraic Kernel https://gforge.inria.fr/projects/mpfi/ (or shipped with RS http://vegas.loria.fr/rs/) - RS (root isolation) Required by the package: - o Algebraic Kernel + * Algebraic Kernel http://vegas.loria.fr/rs/ - NTL (Number Type Theory) Optional for the packages: - o Polynomial - o Algebraic Kernel + * Polynomial + * Algebraic Kernel http://www.shoup.net/ntl/ * Miscellaneous - zlib Optional for the package: - o Surface Mesh Generator can read compressed images directly + * Surface Mesh Generator can read compressed images directly http://www.zlib.net/ - ESBTL Optional to read PDB files: - o Import data from a PDB file as CGAL points or weighted points. + * Import data from a PDB file as CGAL points or weighted points. An example is given in package Skin_surface (see example skin_surface_pdb_reader.cpp) http://esbtl.sourceforge.net/ diff --git a/Installation/cmake/modules/CGALConfig_binary.cmake.in b/Installation/cmake/modules/CGALConfig_binary.cmake.in index de25926bf51..6b443bcf52d 100644 --- a/Installation/cmake/modules/CGALConfig_binary.cmake.in +++ b/Installation/cmake/modules/CGALConfig_binary.cmake.in @@ -179,6 +179,7 @@ set(CGAL_DISABLE_GMP "@CGAL_DISABLE_GMP@") include(${CGAL_MODULES_DIR}/CGAL_CreateSingleSourceCGALProgram.cmake) include(${CGAL_MODULES_DIR}/CGAL_Macros.cmake) +include(${CGAL_MODULES_DIR}/CGAL_Common.cmake) # Temporary? Change the CMAKE module path cgal_setup_module_path() diff --git a/Installation/cmake/modules/CGALConfig_install.cmake.in b/Installation/cmake/modules/CGALConfig_install.cmake.in index 59fc4927bdb..e978b14d93d 100644 --- a/Installation/cmake/modules/CGALConfig_install.cmake.in +++ b/Installation/cmake/modules/CGALConfig_install.cmake.in @@ -154,6 +154,7 @@ set(CGAL_DISABLE_GMP "@CGAL_DISABLE_GMP@") include(${CGAL_MODULES_DIR}/CGAL_CreateSingleSourceCGALProgram.cmake) include(${CGAL_MODULES_DIR}/CGAL_Macros.cmake) +include(${CGAL_MODULES_DIR}/CGAL_Common.cmake) # Temporary? Change the CMAKE module path cgal_setup_module_path() diff --git a/Installation/cmake/modules/CGAL_TweakFindBoost.cmake b/Installation/cmake/modules/CGAL_TweakFindBoost.cmake index 457f84f342d..408f7906e74 100644 --- a/Installation/cmake/modules/CGAL_TweakFindBoost.cmake +++ b/Installation/cmake/modules/CGAL_TweakFindBoost.cmake @@ -26,7 +26,7 @@ if( NOT CGAL_TweakFindBoost ) if(POLICY CMP0077) - cmake_policy(SET CMP0077 OLD) + cmake_policy(SET CMP0077 NEW) endif() if(DEFINED CGAL_Boost_USE_STATIC_LIBS) # If the option is loaded from CGALConfig.h, use its value as default diff --git a/Installation/cmake/modules/FindGLEW.cmake b/Installation/cmake/modules/FindGLEW.cmake deleted file mode 100644 index 43d2de75abb..00000000000 --- a/Installation/cmake/modules/FindGLEW.cmake +++ /dev/null @@ -1,108 +0,0 @@ -# Copyright (c) 2009 Boudewijn Rempt -# -# Redistribution and use is allowed according to the terms of the BSD license. -# For details see the accompanying COPYING-CMAKE-SCRIPTS file. -# -# - try to find glew library and include files -# GLEW_INCLUDE_DIR, where to find GL/glew.h, etc. -# GLEW_LIBRARIES, the libraries to link against -# GLEW_FOUND, If false, do not try to use GLEW. -# Also defined, but not for general use are: -# GLEW_GLEW_LIBRARY = the full path to the glew library. - -IF (WIN32) - - IF(CYGWIN) - - FIND_PATH( GLEW_INCLUDE_DIR GL/glew.h) - - FIND_LIBRARY( GLEW_GLEW_LIBRARY glew32 - ${OPENGL_LIBRARY_DIR} - /usr/lib/w32api - /usr/X11R6/lib - ) - - - ELSE(CYGWIN) - - FIND_PATH( GLEW_INCLUDE_DIR GL/glew.h - $ENV{GLEW_ROOT_PATH}/include - ) - - FIND_LIBRARY( GLEW_GLEW_LIBRARY - NAMES glew glew32 - PATHS - $ENV{GLEW_ROOT_PATH}/lib - ${OPENGL_LIBRARY_DIR} - ) - - ENDIF(CYGWIN) - -ELSE (WIN32) - - IF (APPLE) -# These values for Apple could probably do with improvement. - FIND_PATH( GLEW_INCLUDE_DIR glew.h - /System/Library/Frameworks/GLEW.framework/Versions/A/Headers - ${OPENGL_LIBRARY_DIR} - ) - SET(GLEW_GLEW_LIBRARY "-framework GLEW" CACHE STRING "GLEW library for OSX") - SET(GLEW_cocoa_LIBRARY "-framework Cocoa" CACHE STRING "Cocoa framework for OSX") - ELSE (APPLE) - - FIND_PATH( GLEW_INCLUDE_DIR GL/glew.h - /usr/include - /usr/include/GL - /usr/openwin/share/include - /usr/openwin/include - /usr/X11R6/include - /usr/include/X11 - /opt/graphics/OpenGL/include - /opt/graphics/OpenGL/contrib/libglew - ) - - FIND_LIBRARY( GLEW_GLEW_LIBRARY GLEW - /usr/openwin/lib - /usr/X11R6/lib - /usr/lib - /usr/lib/x86_64-linux-gnu - ) - - ENDIF (APPLE) - -ENDIF (WIN32) - -SET( GLEW_FOUND "NO" ) -IF(GLEW_INCLUDE_DIR) - IF(GLEW_GLEW_LIBRARY) - # Is -lXi and -lXmu required on all platforms that have it? - # If not, we need some way to figure out what platform we are on. - SET( GLEW_LIBRARIES - ${GLEW_GLEW_LIBRARY} - ${GLEW_cocoa_LIBRARY} - ) - SET( GLEW_FOUND "YES" ) - -#The following deprecated settings are for backwards compatibility with CMake1.4 - SET (GLEW_LIBRARY ${GLEW_LIBRARIES}) - SET (GLEW_INCLUDE_PATH ${GLEW_INCLUDE_DIR}) - - ENDIF(GLEW_GLEW_LIBRARY) -ENDIF(GLEW_INCLUDE_DIR) - -IF(GLEW_FOUND) - IF(NOT GLEW_FIND_QUIETLY) - MESSAGE(STATUS "Found Glew: ${GLEW_LIBRARIES}") - ENDIF(NOT GLEW_FIND_QUIETLY) -ELSE(GLEW_FOUND) - IF(GLEW_FIND_REQUIRED) - MESSAGE(FATAL_ERROR "Could not find Glew") - ENDIF(GLEW_FIND_REQUIRED) -ENDIF(GLEW_FOUND) - -MARK_AS_ADVANCED( - GLEW_INCLUDE_DIR - GLEW_GLEW_LIBRARY - GLEW_Xmu_LIBRARY - GLEW_Xi_LIBRARY -) diff --git a/Installation/demo/CMakeLists.txt b/Installation/demo/CMakeLists.txt index 52e6c454de8..bc7742627a1 100644 --- a/Installation/demo/CMakeLists.txt +++ b/Installation/demo/CMakeLists.txt @@ -1,6 +1,6 @@ project(CGAL_DEMOS) -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.1) if (CGAL_BRANCH_BUILD) diff --git a/Installation/examples/CMakeLists.txt b/Installation/examples/CMakeLists.txt index dff3deb7300..643083964e5 100644 --- a/Installation/examples/CMakeLists.txt +++ b/Installation/examples/CMakeLists.txt @@ -1,6 +1,6 @@ project(CGAL_EXAMPLES) -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.1) if (CGAL_BRANCH_BUILD) diff --git a/Installation/include/CGAL/license/GraphicsView.h b/Installation/include/CGAL/license/GraphicsView.h index 270df8f74ad..beeac0d78bc 100644 --- a/Installation/include/CGAL/license/GraphicsView.h +++ b/Installation/include/CGAL/license/GraphicsView.h @@ -14,7 +14,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: GPL-3.0+ +// SPDX-License-Identifier: LGPL-3.0+ // // Author(s) : Andreas Fabri // diff --git a/Installation/include/CGAL/license/Polygon_mesh_processing/collision_detection.h b/Installation/include/CGAL/license/Polygon_mesh_processing/collision_detection.h new file mode 100644 index 00000000000..db5f1b29126 --- /dev/null +++ b/Installation/include/CGAL/license/Polygon_mesh_processing/collision_detection.h @@ -0,0 +1,67 @@ +// Copyright (c) 2016 GeometryFactory SARL (France). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org); you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// Author(s) : Andreas Fabri +// +// Warning: this file is generated, see include/CGAL/licence/README.md + + +#ifndef CGAL_LICENSE_POLYGON_MESH_PROCESSING_COLLISION_DETECTION_H +#define CGAL_LICENSE_POLYGON_MESH_PROCESSING_COLLISION_DETECTION_H + +#include +#include + + + + +#ifdef CGAL_POLYGON_MESH_PROCESSING_COLLISION_DETECTION_COMMERCIAL_LICENSE + +# if CGAL_POLYGON_MESH_PROCESSING_COLLISION_DETECTION_COMMERCIAL_LICENSE < CGAL_RELEASE_DATE + +# if defined(CGAL_LICENSE_WARNING) + + CGAL_pragma_warning("Your commercial license for CGAL does not cover " + "this release of the Polygon Mesh Processing - Collision Detection package.") +# endif + +# ifdef CGAL_LICENSE_ERROR +# error "Your commercial license for CGAL does not cover this release \ +of the Polygon Mesh Processing - Collision Detection package. \ +You get this error, as you defined CGAL_LICENSE_ERROR." +# endif // CGAL_LICENSE_ERROR + +# endif // CGAL_POLYGON_MESH_PROCESSING_COLLISION_DETECTION_COMMERCIAL_LICENSE < CGAL_RELEASE_DATE + +#else // no CGAL_POLYGON_MESH_PROCESSING_COLLISION_DETECTION_COMMERCIAL_LICENSE + +# if defined(CGAL_LICENSE_WARNING) + CGAL_pragma_warning("\nThe macro CGAL_POLYGON_MESH_PROCESSING_COLLISION_DETECTION_COMMERCIAL_LICENSE is not defined." + "\nYou use the CGAL Polygon Mesh Processing - Collision Detection package under " + "the terms of the GPLv3+.") +# endif // CGAL_LICENSE_WARNING + +# ifdef CGAL_LICENSE_ERROR +# error "The macro CGAL_POLYGON_MESH_PROCESSING_COLLISION_DETECTION_COMMERCIAL_LICENSE is not defined.\ + You use the CGAL Polygon Mesh Processing - Collision Detection package under the terms of \ +the GPLv3+. You get this error, as you defined CGAL_LICENSE_ERROR." +# endif // CGAL_LICENSE_ERROR + +#endif // no CGAL_POLYGON_MESH_PROCESSING_COLLISION_DETECTION_COMMERCIAL_LICENSE + +#endif // CGAL_LICENSE_CHECK_POLYGON_MESH_PROCESSING_COLLISION_DETECTION_H diff --git a/Installation/include/CGAL/license/README.md b/Installation/include/CGAL/license/README.md index 5b8e4095532..d39cd5f9bfe 100644 --- a/Installation/include/CGAL/license/README.md +++ b/Installation/include/CGAL/license/README.md @@ -1,3 +1,3 @@ -To generate the `PACKAGE.h` files, from the file `package_list.txt`: +To generate the `PACKAGE.h` files, from the file `gpl_package_list.txt`: cmake -P generate_files.cmake diff --git a/Installation/include/CGAL/license/gpl_package_list.txt b/Installation/include/CGAL/license/gpl_package_list.txt index cb330d930ac..a97a73dc0aa 100644 --- a/Installation/include/CGAL/license/gpl_package_list.txt +++ b/Installation/include/CGAL/license/gpl_package_list.txt @@ -54,6 +54,7 @@ Polygon_mesh_processing/predicate Polygon Mesh Processing - Predicate Polygon_mesh_processing/repair Polygon Mesh Processing - Repair Polygon_mesh_processing/miscellaneous Polygon Mesh Processing - Miscellaneous Polygon_mesh_processing/detect_features Polygon Mesh Processing - Feature Detection +Polygon_mesh_processing/collision_detection Polygon Mesh Processing - Collision Detection Polyhedron 3D Polyhedral Surface Polyline_simplification_2 2D Polyline Simplification Polytope_distance_d Optimal Distances diff --git a/Installation/include/CGAL/version.h b/Installation/include/CGAL/version.h index fe15f62737a..1f3acb0cd2f 100644 --- a/Installation/include/CGAL/version.h +++ b/Installation/include/CGAL/version.h @@ -25,11 +25,11 @@ #ifndef CGAL_VERSION_H #define CGAL_VERSION_H -#define CGAL_VERSION 4.13-dev -#define CGAL_VERSION_NR 1041300000 +#define CGAL_VERSION 4.14-dev +#define CGAL_VERSION_NR 1041400000 #define CGAL_SVN_REVISION 99999 #define CGAL_GIT_HASH abcdef -#define CGAL_RELEASE_DATE 20180425 +#define CGAL_RELEASE_DATE 20181001 #include diff --git a/Installation/lib/cmake/CGAL/CGALConfig.cmake b/Installation/lib/cmake/CGAL/CGALConfig.cmake index 282062bd88e..486f1ff6746 100644 --- a/Installation/lib/cmake/CGAL/CGALConfig.cmake +++ b/Installation/lib/cmake/CGAL/CGALConfig.cmake @@ -7,34 +7,6 @@ set( CGAL_REQUESTED_COMPONENTS ${CGAL_FIND_COMPONENTS} ) set(CGAL_LIBRARIES CGAL) -if(CGAL_BUILDING_LIBS) - foreach(comp ${CGAL_FIND_COMPONENTS}) - if(CGAL_${comp}_FOUND) - list(APPEND CGAL_LIBRARIES CGAL_${comp}) - endif() - endforeach() - return() -endif() - -foreach(comp ${CGAL_FIND_COMPONENTS}) - if(NOT comp MATCHES "Core|ImageIO|Qt5") - message(FATAL_ERROR "The requested CGAL component ${comp} does not exist!") - endif() - list(APPEND CGAL_LIBRARIES CGAL_${comp}) -endforeach() - -set(CGALConfig_all_targets_are_defined TRUE) -foreach(cgal_lib ${CGAL_LIBRARIES}) - if(NOT WITH_${cgal_lib}) - set(CGALConfig_all_targets_are_defined FALSE) - endif() -endforeach() -if(CGALConfig_all_targets_are_defined) - return() -endif() - -message(STATUS "Using header-only CGAL") - get_filename_component(CGAL_CONFIG_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) set(CGAL_HEADER_ONLY TRUE) @@ -90,6 +62,38 @@ else() endif() endif() +include(${CGAL_MODULES_DIR}/CGAL_CreateSingleSourceCGALProgram.cmake) +include(${CGAL_MODULES_DIR}/CGAL_Macros.cmake) +include(${CGAL_MODULES_DIR}/CGAL_Common.cmake) + +if(CGAL_BUILDING_LIBS) + foreach(comp ${CGAL_FIND_COMPONENTS}) + if(CGAL_${comp}_FOUND) + list(APPEND CGAL_LIBRARIES CGAL_${comp}) + endif() + endforeach() + return() +endif() + +foreach(comp ${CGAL_FIND_COMPONENTS}) + if(NOT comp MATCHES "Core|ImageIO|Qt5") + message(FATAL_ERROR "The requested CGAL component ${comp} does not exist!") + endif() + list(APPEND CGAL_LIBRARIES CGAL_${comp}) +endforeach() + +set(CGALConfig_all_targets_are_defined TRUE) +foreach(cgal_lib ${CGAL_LIBRARIES}) + if(NOT TARGET CGAL::${cgal_lib}) + set(CGALConfig_all_targets_are_defined FALSE) + endif() +endforeach() +if(CGALConfig_all_targets_are_defined) + return() +endif() + +message(STATUS "Using header-only CGAL") + if(NOT CGAL_FOUND) return() endif() @@ -132,9 +136,6 @@ endforeach() # # -include(${CGAL_MODULES_DIR}/CGAL_CreateSingleSourceCGALProgram.cmake) -include(${CGAL_MODULES_DIR}/CGAL_Macros.cmake) - # Temporary? Change the CMAKE module path cgal_setup_module_path() diff --git a/Installation/test/CMakeLists.txt b/Installation/test/CMakeLists.txt index c2ae63e9335..b3d48f783e6 100644 --- a/Installation/test/CMakeLists.txt +++ b/Installation/test/CMakeLists.txt @@ -1,6 +1,6 @@ project(CGAL_TESTS) -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.1) if (CGAL_BRANCH_BUILD) diff --git a/Installation/test/Installation/CMakeLists.txt b/Installation/test/Installation/CMakeLists.txt index ce85c54f412..6dd0c4b41c3 100644 --- a/Installation/test/Installation/CMakeLists.txt +++ b/Installation/test/Installation/CMakeLists.txt @@ -4,7 +4,7 @@ project( Installation_Tests ) -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.1) macro(create_link_to_program COMPONENT ) diff --git a/Interpolation/demo/Interpolation/CMakeLists.txt b/Interpolation/demo/Interpolation/CMakeLists.txt index cfa738e0dc5..17bf86f2500 100644 --- a/Interpolation/demo/Interpolation/CMakeLists.txt +++ b/Interpolation/demo/Interpolation/CMakeLists.txt @@ -16,12 +16,6 @@ find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - include_directories (BEFORE "../../include") - create_single_source_cgal_program( "interpolation_2_demo.cpp" ) create_single_source_cgal_program( "surface_voronoi.cpp" ) diff --git a/Interpolation/doc/Interpolation/CGAL/interpolation_functions.h b/Interpolation/doc/Interpolation/CGAL/interpolation_functions.h index bee04da3b82..a50d9cbff1a 100644 --- a/Interpolation/doc/Interpolation/CGAL/interpolation_functions.h +++ b/Interpolation/doc/Interpolation/CGAL/interpolation_functions.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgInterpolation2 +\ingroup PkgInterpolation2Ref The struct `Data_access` implements a functor that allows to retrieve data from an associative container. The functor keeps a reference to @@ -72,8 +72,8 @@ types of a triangulation, to a (non-normalized) barycentric coordinate. \tparam ValueFunctor must be a functor where `ValueFunctor::argument_type` must be equivalent to `std::iterator_traits::%value_type::first_type` and `ValueFunctor::result_type` is a pair of the function value type and a Boolean. -The function value type must provide a multiplication and addition operation with the type -`Traits::FT` as well as a constructor with argument `0`. +The function value type `VT` must provide an addition operator, and a multiplication operator with the type +`Traits::FT`. A model of the functor `ValueFunctor` is provided by the struct `CGAL::Data_access` instantiated with an associative container (e.g. `std::map`) and having: @@ -99,6 +99,7 @@ the interpolated function value as the weighted sum of the values corresponding to each entry of the entity/coordinate pairs in the range `[first, beyond)`. \pre `norm` \f$ \neq0\f$. +\pre `first != beyond`. \pre `value_function(p.first).second == true` for all pairs `p` in the range `[first, beyond)`. \sa `CGAL::quadratic_interpolation()` @@ -163,6 +164,7 @@ the function returns a pair where the Boolean is set to `false`. \param traits is an instance of the traits class. \pre `norm` \f$ \neq0\f$. +\pre `first != beyond`. \pre `value_function(p.first).second == true` for pairs `p` in the range `[first, beyond)` \sa `CGAL::linear_interpolation()` @@ -229,6 +231,7 @@ the function returns a pair where the Boolean is set to `false`. \param traits is an instance of the traits class. \pre `norm` \f$ \neq0\f$. +\pre `first != beyond`. \pre `value_function(q).second == true` for all points `q` of the point/coordinate pairs in the range `[first, beyond)` \sa `CGAL::Interpolation_traits_2` diff --git a/Interpolation/doc/Interpolation/Interpolation.txt b/Interpolation/doc/Interpolation/Interpolation.txt index e9e6bde16ec..cc5fb39cacc 100644 --- a/Interpolation/doc/Interpolation/Interpolation.txt +++ b/Interpolation/doc/Interpolation/Interpolation.txt @@ -95,7 +95,7 @@ diagrams, also known as power diagrams, are obtained by considering wei defined between two weighted points \f$ (p, \omega_p) \f$ and \f$ (q, \omega_q) \f$ by \f$ \Pi( (p, \omega_p), (q, \omega_q) ) = pq^2 - \omega_p - \omega_q \f$. See \link Subsection_2D_Triangulations_Regular_Description this section \endlink -of the package \ref PkgTriangulation2Summary for an in-depth description of power diagrams. +of the package \ref PkgTriangulation2 for an in-depth description of power diagrams. \cgalFigureBegin{figrn_coords, rn_coords.svg} Illustration of regular neighbor coordinates. The point set is the same @@ -416,6 +416,12 @@ compatible with the function. \cgalExample{Interpolation/linear_interpolation_2.cpp} +The next example shows the interpolation of non-scalar values, namely `Vector_3`. +It may be any type `T` which provides a multiplication operator with a scalar, and +the addition operator for `T`. + +\cgalExample{Interpolation/linear_interpolation_of_vector_3.cpp} + \subsection InterpolationExampleSibson Example for Sibson's C^1 Interpolation Scheme with Gradient Estimation \cgalExample{Interpolation/sibson_interpolation_2.cpp} diff --git a/Interpolation/doc/Interpolation/PackageDescription.txt b/Interpolation/doc/Interpolation/PackageDescription.txt index 1b13ef5d3b3..6482d84ac87 100644 --- a/Interpolation/doc/Interpolation/PackageDescription.txt +++ b/Interpolation/doc/Interpolation/PackageDescription.txt @@ -1,27 +1,27 @@ -/// \defgroup PkgInterpolation2 2D and Surface Function Interpolation Reference +/// \defgroup PkgInterpolation2Ref 2D and Surface Function Interpolation Reference /// \defgroup PkgInterpolation2Concepts Concepts -/// \ingroup PkgInterpolation2 +/// \ingroup PkgInterpolation2Ref /// \defgroup PkgInterpolation2Interpolation Interpolation Functions -/// \ingroup PkgInterpolation2 +/// \ingroup PkgInterpolation2Ref /// \defgroup PkgInterpolation2NatNeighbor Natural Neighbor Coordinate Computation -/// \ingroup PkgInterpolation2 +/// \ingroup PkgInterpolation2Ref /// \defgroup PkgInterpolation2SurfaceNeighbor Surface Neighbor and Surface Neighbor Coordinate Computation -/// \ingroup PkgInterpolation2 +/// \ingroup PkgInterpolation2Ref /*! -\addtogroup PkgInterpolation2 -\cgalPkgDescriptionBegin{2D and Surface Function Interpolation,PkgInterpolation2Summary} +\addtogroup PkgInterpolation2Ref +\cgalPkgDescriptionBegin{2D and Surface Function Interpolation,PkgInterpolation2} \cgalPkgPicture{interpolation.png} \cgalPkgSummaryBegin \cgalPkgAuthor{Julia Flötotto} \cgalPkgDesc{This package implements different methods for scattered data interpolation: Given measures of a function on a set of discrete data points, the task is to interpolate this function on an arbitrary query point. The package further offers functions for natural neighbor interpolation.} -\cgalPkgManuals{Chapter_2D_and_Surface_Function_Interpolation,PkgInterpolation2} +\cgalPkgManuals{Chapter_2D_and_Surface_Function_Interpolation,PkgInterpolation2Ref} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{3.1} diff --git a/Interpolation/doc/Interpolation/examples.txt b/Interpolation/doc/Interpolation/examples.txt index 377ab8a017d..5fa82c096cd 100644 --- a/Interpolation/doc/Interpolation/examples.txt +++ b/Interpolation/doc/Interpolation/examples.txt @@ -5,6 +5,7 @@ \example Interpolation/rn_coordinates_2.cpp \example Interpolation/surface_neighbor_coordinates_3.cpp \example Interpolation/linear_interpolation_2.cpp +\example Interpolation/linear_interpolation_of_vector_3.cpp \example Interpolation/sibson_interpolation_2.cpp \example Interpolation/sibson_interpolation_vertex_with_info_2.cpp */ diff --git a/Interpolation/examples/Interpolation/CMakeLists.txt b/Interpolation/examples/Interpolation/CMakeLists.txt index c21c16ed93c..d12b05c9cf7 100644 --- a/Interpolation/examples/Interpolation/CMakeLists.txt +++ b/Interpolation/examples/Interpolation/CMakeLists.txt @@ -4,18 +4,12 @@ project( Interpolation_Examples ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Interpolation/examples/Interpolation/linear_interpolation_of_vector_3.cpp b/Interpolation/examples/Interpolation/linear_interpolation_of_vector_3.cpp new file mode 100644 index 00000000000..2dbfa4b3bc8 --- /dev/null +++ b/Interpolation/examples/Interpolation/linear_interpolation_of_vector_3.cpp @@ -0,0 +1,43 @@ +#include +#include + +#include +#include +#include + +typedef CGAL::Exact_predicates_inexact_constructions_kernel K; +typedef CGAL::Delaunay_triangulation_2 Delaunay_triangulation; +typedef CGAL::Interpolation_traits_2 Traits; +typedef K::Vector_3 Vector_3; +typedef K::Point_2 Point_2; + +int main() +{ + Delaunay_triangulation T; + + typedef std::map Coord_map; + typedef CGAL::Data_access Value_access; + + Coord_map value_function; + + for (int y=0 ; y<255 ; y++){ + for (int x=0 ; x<255 ; x++){ + K::Point_2 p(x,y); + T.insert(p); + value_function.insert(std::make_pair(p, Vector_3(x,y,1))); + } + } + + //coordinate computation + K::Point_2 p(1.3, 0.34); + std::vector > coords; + + double norm = CGAL::natural_neighbor_coordinates_2(T, p, std::back_inserter(coords)).second; + Vector_3 res = CGAL::linear_interpolation(coords.begin(), coords.end(), norm, + Value_access(value_function)); + + std::cout << "Tested interpolation on " << p << " interpolation: " + << res << std::endl; + + return EXIT_SUCCESS; +} diff --git a/Interpolation/include/CGAL/interpolation_functions.h b/Interpolation/include/CGAL/interpolation_functions.h index cac67d5aa40..f7c8769e10a 100644 --- a/Interpolation/include/CGAL/interpolation_functions.h +++ b/Interpolation/include/CGAL/interpolation_functions.h @@ -28,7 +28,6 @@ #include #include - #include #include #include @@ -59,7 +58,7 @@ struct Data_access }; //the interpolation functions: -template < class ForwardIterator, class ValueFunctor > + template < class ForwardIterator, class ValueFunctor> typename boost::result_of< ValueFunctor(typename std::iterator_traits::value_type::first_type)> ::type::first_type @@ -67,19 +66,21 @@ linear_interpolation(ForwardIterator first, ForwardIterator beyond, const typename std::iterator_traits::value_type::second_type& norm, ValueFunctor value_function) { + CGAL_precondition(first != beyond); CGAL_precondition(norm > 0); typedef typename std::iterator_traits::value_type::first_type arg_type; typedef typename boost::result_of::type result_type; typedef typename result_type::first_type Value_type; - Value_type result(0); - result_type val; + result_type val = value_function(first->first); + CGAL_assertion(val.second); + Value_type result = (first->second / norm) * val.first; + ++first; for(; first!=beyond; ++first) { val = value_function(first->first); - CGAL_assertion(val.second); - result += (first->second / norm) * val.first; + result = result + (first->second / norm) * val.first; } return result; } @@ -97,6 +98,7 @@ quadratic_interpolation(ForwardIterator first, ForwardIterator beyond, GradFunctor gradient_function, const Traits& traits) { + CGAL_precondition(first != beyond); CGAL_precondition(norm > 0); typedef typename std::iterator_traits::value_type::first_type arg_type; @@ -145,6 +147,7 @@ sibson_c1_interpolation(ForwardIterator first, ForwardIterator beyond, GradFunctor gradient_function, const Traits& traits) { + CGAL_precondition(first != beyond); CGAL_precondition(norm >0); typedef typename std::iterator_traits::value_type::first_type arg_type; @@ -227,6 +230,7 @@ sibson_c1_interpolation_square(ForwardIterator first, ForwardIterator beyond, GradFunctor gradient_function, const Traits& traits) { + CGAL_precondition(first != beyond); CGAL_precondition(norm > 0); typedef typename std::iterator_traits::value_type::first_type arg_type; @@ -300,6 +304,7 @@ farin_c1_interpolation(RandomAccessIterator first, GradFunctor gradient_function, const Traits& traits) { + CGAL_precondition(first != beyond); CGAL_precondition(norm >0); typedef typename std::iterator_traits::value_type::first_type arg_type; diff --git a/Interpolation/test/Interpolation/CMakeLists.txt b/Interpolation/test/Interpolation/CMakeLists.txt index dc4b2e8977d..d0cf0974741 100644 --- a/Interpolation/test/Interpolation/CMakeLists.txt +++ b/Interpolation/test/Interpolation/CMakeLists.txt @@ -4,19 +4,13 @@ project( Interpolation_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - include_directories (BEFORE "../../include") - - include_directories (BEFORE "include") + include_directories (BEFORE "include") # create a target per cppfile file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) diff --git a/Intersections_2/test/Intersections_2/CMakeLists.txt b/Intersections_2/test/Intersections_2/CMakeLists.txt index 8b29c2509a0..8776da99898 100644 --- a/Intersections_2/test/Intersections_2/CMakeLists.txt +++ b/Intersections_2/test/Intersections_2/CMakeLists.txt @@ -4,18 +4,12 @@ project( Intersections_2_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Intersections_3/test/Intersections_3/CMakeLists.txt b/Intersections_3/test/Intersections_3/CMakeLists.txt index a13cf22451a..97393c87e2d 100644 --- a/Intersections_3/test/Intersections_3/CMakeLists.txt +++ b/Intersections_3/test/Intersections_3/CMakeLists.txt @@ -4,18 +4,12 @@ project( Intersections_3_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Interval_skip_list/doc/Interval_skip_list/CGAL/Interval_skip_list.h b/Interval_skip_list/doc/Interval_skip_list/CGAL/Interval_skip_list.h index 0aa28b3c0d4..ad15203e6ce 100644 --- a/Interval_skip_list/doc/Interval_skip_list/CGAL/Interval_skip_list.h +++ b/Interval_skip_list/doc/Interval_skip_list/CGAL/Interval_skip_list.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgIntervalSkipList +\ingroup PkgIntervalSkipListRef The class `Interval_skip_list` is a dynamic data structure that allows to find all members of a set of intervals that overlap a point. diff --git a/Interval_skip_list/doc/Interval_skip_list/CGAL/Interval_skip_list_interval.h b/Interval_skip_list/doc/Interval_skip_list/CGAL/Interval_skip_list_interval.h index 6db50ce910f..d5a2ce3250f 100644 --- a/Interval_skip_list/doc/Interval_skip_list/CGAL/Interval_skip_list_interval.h +++ b/Interval_skip_list/doc/Interval_skip_list/CGAL/Interval_skip_list_interval.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgIntervalSkipList +\ingroup PkgIntervalSkipListRef The class `Interval_skip_list_interval` represents intervals with lower and upper bound of type `Value`. These intervals diff --git a/Interval_skip_list/doc/Interval_skip_list/CGAL/Level_interval.h b/Interval_skip_list/doc/Interval_skip_list/CGAL/Level_interval.h index 0175c59494e..eaa1db22fc9 100644 --- a/Interval_skip_list/doc/Interval_skip_list/CGAL/Level_interval.h +++ b/Interval_skip_list/doc/Interval_skip_list/CGAL/Level_interval.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgIntervalSkipList +\ingroup PkgIntervalSkipListRef The class `Level_interval` represents intervals for the minimum and maximum value of the `z`-coordinate of a face of a triangulation. diff --git a/Interval_skip_list/doc/Interval_skip_list/PackageDescription.txt b/Interval_skip_list/doc/Interval_skip_list/PackageDescription.txt index 30af0633afc..aff3f5fe49f 100644 --- a/Interval_skip_list/doc/Interval_skip_list/PackageDescription.txt +++ b/Interval_skip_list/doc/Interval_skip_list/PackageDescription.txt @@ -1,15 +1,15 @@ -/// \defgroup PkgIntervalSkipList Interval Skip List Reference +/// \defgroup PkgIntervalSkipListRef Interval Skip List Reference /// \defgroup PkgIntervalSkipListConcepts Concepts -/// \ingroup PkgIntervalSkipList +/// \ingroup PkgIntervalSkipListRef /*! -\addtogroup PkgIntervalSkipList +\addtogroup PkgIntervalSkipListRef -\cgalPkgDescriptionBegin{Interval Skip List,PkgIntervalSkipListSummary} +\cgalPkgDescriptionBegin{Interval Skip List,PkgIntervalSkipList} \cgalPkgPicture{Interval_skip_list/fig/query.png} \cgalPkgSummaryBegin \cgalPkgAuthor{Andreas Fabri} \cgalPkgDesc{An interval skip list is a data structure for finding all intervals that contain a point, and for stabbing queries, that is for answering the question whether a given point is contained in an interval or not. For a triangulated terrain, this allows to quickly identify the triangles which intersect an iso line. } -\cgalPkgManuals{Chapter_Interval_Skip_List,PkgIntervalSkipList} +\cgalPkgManuals{Chapter_Interval_Skip_List,PkgIntervalSkipListRef} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{3.0} diff --git a/Interval_skip_list/examples/Interval_skip_list/CMakeLists.txt b/Interval_skip_list/examples/Interval_skip_list/CMakeLists.txt index 43cde661706..2d26929b883 100644 --- a/Interval_skip_list/examples/Interval_skip_list/CMakeLists.txt +++ b/Interval_skip_list/examples/Interval_skip_list/CMakeLists.txt @@ -4,18 +4,12 @@ project( Interval_skip_list_Examples ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Interval_skip_list/test/Interval_skip_list/CMakeLists.txt b/Interval_skip_list/test/Interval_skip_list/CMakeLists.txt index 06dcd09fa1c..9245b8e32a4 100644 --- a/Interval_skip_list/test/Interval_skip_list/CMakeLists.txt +++ b/Interval_skip_list/test/Interval_skip_list/CMakeLists.txt @@ -4,18 +4,12 @@ project( Interval_skip_list_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Interval_support/test/Interval_support/CMakeLists.txt b/Interval_support/test/Interval_support/CMakeLists.txt index d795bab0889..220902b3b7d 100644 --- a/Interval_support/test/Interval_support/CMakeLists.txt +++ b/Interval_support/test/Interval_support/CMakeLists.txt @@ -4,17 +4,13 @@ project( Interval_support_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET COMPONENTS Core ) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - include_directories (BEFORE "../../include") + include(${CGAL_USE_FILE}) # create a target per cppfile file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) diff --git a/Inventor/test/Inventor/CMakeLists.txt b/Inventor/test/Inventor/CMakeLists.txt index 5598698424e..cf2ec4f6944 100644 --- a/Inventor/test/Inventor/CMakeLists.txt +++ b/Inventor/test/Inventor/CMakeLists.txt @@ -4,18 +4,12 @@ project( Inventor_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Jet_fitting_3/doc/Jet_fitting_3/CGAL/Monge_via_jet_fitting.h b/Jet_fitting_3/doc/Jet_fitting_3/CGAL/Monge_via_jet_fitting.h index 7f31a429a16..2bfe86e437a 100644 --- a/Jet_fitting_3/doc/Jet_fitting_3/CGAL/Monge_via_jet_fitting.h +++ b/Jet_fitting_3/doc/Jet_fitting_3/CGAL/Monge_via_jet_fitting.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgJet_fitting_3 +\ingroup PkgJetFitting3Ref The class `Monge_via_jet_fitting` is designed to perform the estimation of the local differential quantities at a given point. The point range is @@ -39,7 +39,7 @@ public: /// @{ /*! -\ingroup PkgJet_fitting_3 +\ingroup PkgJetFitting3Ref The class `Monge_form` stores the Monge representation, i.e., the Monge coordinate system and the coefficients of the Monge form in this diff --git a/Jet_fitting_3/doc/Jet_fitting_3/Concepts/DataKernel.h b/Jet_fitting_3/doc/Jet_fitting_3/Concepts/DataKernel.h index 52107e77128..23f4f36fce0 100644 --- a/Jet_fitting_3/doc/Jet_fitting_3/Concepts/DataKernel.h +++ b/Jet_fitting_3/doc/Jet_fitting_3/Concepts/DataKernel.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgJet_fitting_3Concepts +\ingroup PkgJetFitting3Concepts \cgalConcept The concept `DataKernel` describes the set of requirements to be diff --git a/Jet_fitting_3/doc/Jet_fitting_3/Concepts/LocalKernel.h b/Jet_fitting_3/doc/Jet_fitting_3/Concepts/LocalKernel.h index 93e8c849938..bd830a31714 100644 --- a/Jet_fitting_3/doc/Jet_fitting_3/Concepts/LocalKernel.h +++ b/Jet_fitting_3/doc/Jet_fitting_3/Concepts/LocalKernel.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgJet_fitting_3Concepts +\ingroup PkgJetFitting3Concepts \cgalConcept The concept `LocalKernel` describes the set of requirements to be diff --git a/Jet_fitting_3/doc/Jet_fitting_3/PackageDescription.txt b/Jet_fitting_3/doc/Jet_fitting_3/PackageDescription.txt index ff80e0f65c4..adb780b42f7 100644 --- a/Jet_fitting_3/doc/Jet_fitting_3/PackageDescription.txt +++ b/Jet_fitting_3/doc/Jet_fitting_3/PackageDescription.txt @@ -1,19 +1,19 @@ -/// \defgroup PkgJet_fitting_3 Estimation of Local Differential Properties of Point-Sampled Surfaces Reference -/// \defgroup PkgJet_fitting_3Concepts Concepts -/// \ingroup PkgJet_fitting_3 +/// \defgroup PkgJetFitting3Ref Estimation of Local Differential Properties of Point-Sampled Surfaces Reference +/// \defgroup PkgJetFitting3Concepts Concepts +/// \ingroup PkgJetFitting3Ref /*! -\addtogroup PkgJet_fitting_3 +\addtogroup PkgJetFitting3Ref \todo check generated documentation -\cgalPkgDescriptionBegin{Estimation of Local Differential Properties of Point-Sampled Surfaces,PkgJet_fitting_3Summary} +\cgalPkgDescriptionBegin{Estimation of Local Differential Properties of Point-Sampled Surfaces,PkgJetFitting3} \cgalPkgPicture{DavidDetail.png} \cgalPkgSummaryBegin \cgalPkgAuthors{Marc Pouget and Frédéric Cazals} \cgalPkgDesc{For a surface discretized as a point cloud or a mesh, it is desirable to estimate pointwise differential quantities. More precisely, first order properties correspond to the normal or the tangent plane; second order properties provide the principal curvatures and directions, third order properties provide the directional derivatives of the principal curvatures along the curvature lines, etc. This package allows the estimation of local differential quantities of a surface from a point sample.} -\cgalPkgManuals{Chapter_Estimation_of_Local_Differential_Properties_of_Point-Sampled_Surfaces,PkgJet_fitting_3} +\cgalPkgManuals{Chapter_Estimation_of_Local_Differential_Properties_of_Point-Sampled_Surfaces,PkgJetFitting3Ref} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{3.3} -\cgalPkgDependsOn{\ref PkgSolverSummary and \ref thirdpartyEigen} +\cgalPkgDependsOn{\ref PkgSolverInterface and \ref thirdpartyEigen} \cgalPkgBib{cgal:pc-eldp} \cgalPkgLicense{\ref licensesGPL "GPL"} \cgalPkgDemo{Polyhedron demo,polyhedron_3.zip} diff --git a/Jet_fitting_3/examples/Jet_fitting_3/CMakeLists.txt b/Jet_fitting_3/examples/Jet_fitting_3/CMakeLists.txt index 4d2ef94eab9..99d25985c62 100644 --- a/Jet_fitting_3/examples/Jet_fitting_3/CMakeLists.txt +++ b/Jet_fitting_3/examples/Jet_fitting_3/CMakeLists.txt @@ -4,17 +4,13 @@ project( Jet_fitting_3_Examples ) -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - # use either Eigen or BLAS/LAPACK find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) if (NOT EIGEN3_FOUND) diff --git a/Jet_fitting_3/test/Jet_fitting_3/CMakeLists.txt b/Jet_fitting_3/test/Jet_fitting_3/CMakeLists.txt index 5bb3152d9cd..e1f65cb1884 100644 --- a/Jet_fitting_3/test/Jet_fitting_3/CMakeLists.txt +++ b/Jet_fitting_3/test/Jet_fitting_3/CMakeLists.txt @@ -4,17 +4,13 @@ project( Jet_fitting_3_Tests ) -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - # use either Eigen or BLAS/LAPACK find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) if (NOT EIGEN3_FOUND) @@ -29,8 +25,6 @@ if ( CGAL_FOUND ) if(EIGEN3_FOUND OR LAPACK_FOUND) - include_directories (BEFORE ../../include) - create_single_source_cgal_program( "blind_1pt.cpp" ) else(EIGEN3_FOUND OR LAPACK_FOUND) diff --git a/Kernel_23/doc/Kernel_23/CGAL/Aff_transformation_2.h b/Kernel_23/doc/Kernel_23/CGAL/Aff_transformation_2.h index 7e888aa8b1a..274d63e33ff 100644 --- a/Kernel_23/doc/Kernel_23/CGAL/Aff_transformation_2.h +++ b/Kernel_23/doc/Kernel_23/CGAL/Aff_transformation_2.h @@ -247,6 +247,11 @@ gives the inverse transformation. */ Aff_transformation_2 inverse() const; +/*! +compares two affine transformations. +*/ +bool operator==(const Aff_transformation_2 &s) const; + /*! returns `true`, if the transformation is not reflecting, i.e.\ the determinant of the involved linear transformation is diff --git a/Kernel_23/doc/Kernel_23/CGAL/Aff_transformation_3.h b/Kernel_23/doc/Kernel_23/CGAL/Aff_transformation_3.h index 10199d96314..b95e1530c98 100644 --- a/Kernel_23/doc/Kernel_23/CGAL/Aff_transformation_3.h +++ b/Kernel_23/doc/Kernel_23/CGAL/Aff_transformation_3.h @@ -115,7 +115,7 @@ const Kernel::RT &hw = RT(1)); \name Operations The main thing to do with transformations is to apply them on -geometric objects. Each class `Class_2` representing a +geometric objects. Each class `Class_3` representing a geometric object has a member function: \code @@ -179,6 +179,12 @@ gives the inverse transformation. */ Aff_transformation_3 inverse() const; +/*! +compares two affine transformations. +*/ +bool operator==(const Aff_transformation_3 &s) const; + + /*! returns `true`, if the transformation is not reflecting, i.e.\ the determinant of the involved linear transformation is diff --git a/Kernel_23/doc/Kernel_23/CGAL/Kernel_traits.h b/Kernel_23/doc/Kernel_23/CGAL/Kernel_traits.h index 3f650d01399..7cf0de10c85 100644 --- a/Kernel_23/doc/Kernel_23/CGAL/Kernel_traits.h +++ b/Kernel_23/doc/Kernel_23/CGAL/Kernel_traits.h @@ -7,7 +7,7 @@ namespace CGAL { The class `Kernel_traits` provides access to the kernel model to which the argument type `T` belongs. (Provided `T` belongs to some kernel model.) The default implementation assumes there is a -local type `T::Kernel` referring to the kernel model of `T`. +local type `T::R` referring to the kernel model of `T`. If this type does not exist, a specialization of `Kernel_traits` can be used to provide the desired information. diff --git a/Kernel_23/doc/Kernel_23/CGAL/Origin.h b/Kernel_23/doc/Kernel_23/CGAL/Origin.h index ad1fccbaaa7..2b590a04bed 100644 --- a/Kernel_23/doc/Kernel_23/CGAL/Origin.h +++ b/Kernel_23/doc/Kernel_23/CGAL/Origin.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgKernel23 +\ingroup PkgKernel23Ref \cgal defines a symbolic constant `NULL_VECTOR` to construct zero length vectors. @@ -21,7 +21,7 @@ public: namespace CGAL { /*! -\ingroup PkgKernel23 +\ingroup PkgKernel23Ref \cgal defines a symbolic constant `ORIGIN` which denotes the point at the origin. diff --git a/Kernel_23/doc/Kernel_23/Concepts/FunctionObjectConcepts.h b/Kernel_23/doc/Kernel_23/Concepts/FunctionObjectConcepts.h index 89ef9d08cab..5f6f6b9e38e 100644 --- a/Kernel_23/doc/Kernel_23/Concepts/FunctionObjectConcepts.h +++ b/Kernel_23/doc/Kernel_23/Concepts/FunctionObjectConcepts.h @@ -3846,7 +3846,7 @@ public: direction as the sum of the normalized normal vectors of the two planes, and passes through the intersection of `h1` and `h2`. If `h1` and `h2` are parallel, then the bisector is defined as the - plane which has the same oriented normal vector as `l1`, and which is at + plane which has the same oriented normal vector as `h1`, and which is at the same distance from `h1` and `h2`. This function requires that `Kernel::RT` supports the `sqrt()` operation. diff --git a/Kernel_23/doc/Kernel_23/Concepts/GeomObjects.h b/Kernel_23/doc/Kernel_23/Concepts/GeomObjects.h index 6feb89c5318..01fff5476ca 100644 --- a/Kernel_23/doc/Kernel_23/Concepts/GeomObjects.h +++ b/Kernel_23/doc/Kernel_23/Concepts/GeomObjects.h @@ -722,6 +722,8 @@ public: \cgalHasModel `CGAL::Vector_2` \sa `Kernel::ComputeDeterminant_2` + \sa `Kernel::ComputeScalarProduct_2` + \sa `Kernel::ComputeSquaredLength_2` \sa `Kernel::ComputeX_2` \sa `Kernel::ComputeY_2` \sa `Kernel::ComputeHx_2` @@ -754,7 +756,10 @@ A type representing vectors in three dimensions. \cgalHasModel `CGAL::Vector_3` -\sa `Kernel::ComputeDeterminant_3` +\sa `Kernel::CompareDihedralAngle_3` +\sa `Kernel::ComputeDeterminant_3` +\sa `Kernel::ComputeScalarProduct_3` +\sa `Kernel::ComputeSquaredLength_3` \sa `Kernel::ComputeX_3` \sa `Kernel::ComputeY_3` \sa `Kernel::ComputeZ_3` diff --git a/Kernel_23/doc/Kernel_23/PackageDescription.txt b/Kernel_23/doc/Kernel_23/PackageDescription.txt index aa5e95fc237..4dfd75a4e2d 100644 --- a/Kernel_23/doc/Kernel_23/PackageDescription.txt +++ b/Kernel_23/doc/Kernel_23/PackageDescription.txt @@ -1,7 +1,7 @@ -/// \defgroup PkgKernel23 2D and 3D Linear Geometry Kernel Reference +/// \defgroup PkgKernel23Ref 2D and 3D Linear Geometry Kernel Reference /// \defgroup PkgKernel23Concepts Concepts -/// \ingroup PkgKernel23 +/// \ingroup PkgKernel23Ref /// \defgroup PkgKernel23ConceptsGeomObject Kernel Geometric Object Concepts /// \ingroup PkgKernel23Concepts @@ -10,37 +10,37 @@ /// \ingroup PkgKernel23Concepts /// \defgroup kernel_predef Predefined Kernels -/// \ingroup PkgKernel23 +/// \ingroup PkgKernel23Ref /// \defgroup kernel_classes2 2D Kernel Objects -/// \ingroup PkgKernel23 +/// \ingroup PkgKernel23Ref /// \defgroup kernel_classes3 3D Kernel Objects -/// \ingroup PkgKernel23 +/// \ingroup PkgKernel23Ref /// \defgroup kernel_classes Kernel Classes -/// \ingroup PkgKernel23 +/// \ingroup PkgKernel23Ref /// \defgroup kernel_global_function Global Kernel Functions -/// \ingroup PkgKernel23 +/// \ingroup PkgKernel23Ref /// \defgroup kernel_enums Enumerations and Related Functions -/// \ingroup PkgKernel23 +/// \ingroup PkgKernel23Ref /// \defgroup kernel_conversion Cartesian/Homogenous Conversion -/// \ingroup PkgKernel23 +/// \ingroup PkgKernel23Ref /// \defgroup kernel_dimension Dimension Handling Tools -/// \ingroup PkgKernel23 +/// \ingroup PkgKernel23Ref /*! -\addtogroup PkgKernel23 -\cgalPkgDescriptionBegin{2D and 3D Linear Geometry Kernel,PkgKernel23Summary} +\addtogroup PkgKernel23Ref +\cgalPkgDescriptionBegin{2D and 3D Linear Geometry Kernel,PkgKernel23} \cgalPkgPicture{pointSegmentTriangle.png} \cgalPkgSummaryBegin \cgalPkgAuthors{Hervé Brönnimann, Andreas Fabri, Geert-Jan Giezeman, Susan Hert, Michael Hoffmann, Lutz Kettner, Sylvain Pion, and Stefan Schirra} \cgalPkgDesc{This package contains kernels each containing objects of constant size, such as point, vector, direction, line, ray, segment, circle as well as predicates and constructions for these objects. The kernels mainly differ in the way they handle robustness issues.} -\cgalPkgManuals{Chapter_2D_and_3D_Geometry_Kernel,PkgKernel23} +\cgalPkgManuals{Chapter_2D_and_3D_Geometry_Kernel,PkgKernel23Ref} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{0.9} diff --git a/Kernel_23/examples/Kernel_23/CMakeLists.txt b/Kernel_23/examples/Kernel_23/CMakeLists.txt index 5ce6c416571..efa36a2a3e9 100644 --- a/Kernel_23/examples/Kernel_23/CMakeLists.txt +++ b/Kernel_23/examples/Kernel_23/CMakeLists.txt @@ -4,18 +4,12 @@ project( Kernel_23_Examples ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Kernel_23/test/Kernel_23/CMakeLists.txt b/Kernel_23/test/Kernel_23/CMakeLists.txt index f2b3e31b248..47e33a4d04f 100644 --- a/Kernel_23/test/Kernel_23/CMakeLists.txt +++ b/Kernel_23/test/Kernel_23/CMakeLists.txt @@ -4,19 +4,14 @@ project( Kernel_23_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET COMPONENTS Core) if ( CGAL_FOUND AND CGAL_Core_FOUND) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - include_directories (BEFORE "../../include") - - include_directories (BEFORE "include") + include(${CGAL_USE_FILE}) + include_directories (BEFORE "include") # create a target per cppfile file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) diff --git a/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_aff_transformation_2.h b/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_aff_transformation_2.h index 23aff3a4c96..a4791a873aa 100644 --- a/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_aff_transformation_2.h +++ b/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_aff_transformation_2.h @@ -577,6 +577,13 @@ _test_cls_aff_transformation_2(const R& ) assert( ident.homogeneous(1,2) == ident.hm(1,2) ); assert( gscale.homogeneous(1,1) == gscale.hm(1,1) ); + //equality + CGAL::Aff_transformation_2 a2(0,1,0,1), + a3(0,1,0,1), a4(0,0,1,1); + assert(a2 == a3); + assert(a3 != a4); + + std::cout << "done" << std::endl; return true; } diff --git a/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_aff_transformation_3.h b/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_aff_transformation_3.h index a186c20d14a..35b0df744ca 100644 --- a/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_aff_transformation_3.h +++ b/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_aff_transformation_3.h @@ -543,6 +543,12 @@ _test_cls_aff_transformation_3(const R& ) assert(unit_sphere.orthogonal_transform(ident) == unit_sphere); assert(unit_sphere.orthogonal_transform(translate).center() == pnt); + //equality + CGAL::Aff_transformation_3 a2(0,1,0,1,0,1,1,0,1,0,0,1), + a3(0,1,0,1,0,1,1,0,1,0,0,1), a4(0,0,1,1,0,0,1,1,0,0,1,1); + assert(a2 == a3); + assert(a3 != a4); + std::cout << "done" << std::endl; return true; } diff --git a/Kernel_23/test/Kernel_23/issue_3301.cpp b/Kernel_23/test/Kernel_23/issue_3301.cpp new file mode 100644 index 00000000000..fedc8357787 --- /dev/null +++ b/Kernel_23/test/Kernel_23/issue_3301.cpp @@ -0,0 +1,17 @@ +#include +#include + +typedef CGAL::Simple_cartesian K; +typedef K::Point_2 Point_2; +typedef K::Line_2 Line_2; + +int main() +{ + Line_2 line(-4.2885603045067812e-18, 1, 250.73609999999996); + + Point_2 point(35.306000000000004, 250.69800000000001); + std::cout.precision(17); + std::cout << line.projection(point) << std::endl; + + return 0; +} diff --git a/Kernel_d/doc/Kernel_d/PackageDescription.txt b/Kernel_d/doc/Kernel_d/PackageDescription.txt index 296f53b8bf4..a2a4f31cbf3 100644 --- a/Kernel_d/doc/Kernel_d/PackageDescription.txt +++ b/Kernel_d/doc/Kernel_d/PackageDescription.txt @@ -1,33 +1,33 @@ -/// \defgroup PkgKernelD dD Geometry Kernel Reference +/// \defgroup PkgKernelDRef dD Geometry Kernel Reference /// \defgroup PkgKernelDLinAlgConcepts Linear Algebra Concepts -/// \ingroup PkgKernelD +/// \ingroup PkgKernelDRef /// \defgroup PkgKernelDLinAlgClasses Linear Algebra Classes -/// \ingroup PkgKernelD +/// \ingroup PkgKernelDRef /// \defgroup PkgKernelDKernels Kernels -/// \ingroup PkgKernelD +/// \ingroup PkgKernelDRef /// \defgroup PkgKernelDKernelObjs Kernel Objects -/// \ingroup PkgKernelD +/// \ingroup PkgKernelDRef /// \defgroup PkgKernelDFunctions Global Kernel Functions -/// \ingroup PkgKernelD +/// \ingroup PkgKernelDRef /// \defgroup PkgKernelDKernelConcept Kernel Concept -/// \ingroup PkgKernelD +/// \ingroup PkgKernelDRef /*! -\addtogroup PkgKernelD +\addtogroup PkgKernelDRef \todo check generated documentation -\cgalPkgDescriptionBegin{dD Geometry Kernel,PkgKernelDSummary} +\cgalPkgDescriptionBegin{dD Geometry Kernel,PkgKernelD} \cgalPkgPicture{hypercube.png} \cgalPkgSummaryBegin \cgalPkgAuthor{Michael Seel} \cgalPkgDesc{The dD %Kernel contains objects of constant size, such as point, vector, direction, line, ray, segment, circle in d dimensional Euclidean space, as well as predicates and constructions for these objects.} -\cgalPkgManuals{Chapter_dD_Geometry_Kernel,PkgKernelD} +\cgalPkgManuals{Chapter_dD_Geometry_Kernel,PkgKernelDRef} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{1.1} diff --git a/Kernel_d/test/Kernel_d/CMakeLists.txt b/Kernel_d/test/Kernel_d/CMakeLists.txt index c6da1842844..d762e532a7a 100644 --- a/Kernel_d/test/Kernel_d/CMakeLists.txt +++ b/Kernel_d/test/Kernel_d/CMakeLists.txt @@ -4,19 +4,13 @@ project( Kernel_d_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - include_directories (BEFORE "../../include") - - include_directories (BEFORE "include") + include_directories (BEFORE "include") # create a target per cppfile file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) diff --git a/Linear_cell_complex/benchmark/Linear_cell_complex_2/CMakeLists.txt b/Linear_cell_complex/benchmark/Linear_cell_complex_2/CMakeLists.txt index 6eae9b0b136..f80ad42a2ee 100644 --- a/Linear_cell_complex/benchmark/Linear_cell_complex_2/CMakeLists.txt +++ b/Linear_cell_complex/benchmark/Linear_cell_complex_2/CMakeLists.txt @@ -1,15 +1,13 @@ project(LCC_performance_2) -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.1) set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/) add_subdirectory(surface_mesh) find_package(CGAL REQUIRED) -include(${CGAL_USE_FILE}) -include_directories(BEFORE "../../include") include_directories(BEFORE "./surface_mesh") include_directories(BEFORE "./cgogn" "./cgogn/include") LINK_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/cgogn/lib/Release) 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 9faf17e58ac..e3eff7e6d85 100644 --- a/Linear_cell_complex/benchmark/Linear_cell_complex_3/CMakeLists.txt +++ b/Linear_cell_complex/benchmark/Linear_cell_complex_3/CMakeLists.txt @@ -7,7 +7,6 @@ if(NOT POLICY CMP0070 AND POLICY CMP0053) endif() find_package(CGAL REQUIRED) -include(${CGAL_USE_FILE}) find_package(Boost 1.43.0) if(Boost_FOUND) @@ -19,7 +18,6 @@ endif() add_subdirectory(openvolumemesh) include_directories(BEFORE openvolumemesh/src) -include_directories(BEFORE "../../include") include_directories(BEFORE "./cgogn" "./cgogn/include") include_directories(BEFORE "/usr/include/libxml2/") include_directories(BEFORE "/usr/include/eigen3/") diff --git a/Linear_cell_complex/demo/Linear_cell_complex/CMakeLists.txt b/Linear_cell_complex/demo/Linear_cell_complex/CMakeLists.txt index d774c81cc65..108432031ff 100644 --- a/Linear_cell_complex/demo/Linear_cell_complex/CMakeLists.txt +++ b/Linear_cell_complex/demo/Linear_cell_complex/CMakeLists.txt @@ -36,7 +36,6 @@ add_definitions(-DCGAL_PROFILE_LCC_DEMO) ################## find_package(CGAL COMPONENTS Qt5) -include(${CGAL_USE_FILE}) find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg) @@ -49,8 +48,6 @@ else() add_definitions(-DQT_NO_KEYWORDS) -include_directories(BEFORE . ../../include/) - # ui file, created wih Qt Designer qt5_wrap_ui(uis MainWindow.ui CreateMesh.ui CreateMenger.ui CreateSierpinskiCarpet.ui CreateSierpinskiTriangle.ui) diff --git a/Linear_cell_complex/doc/Linear_cell_complex/PackageDescription.txt b/Linear_cell_complex/doc/Linear_cell_complex/PackageDescription.txt index 8eb6f42e7dc..4aa6d9777bf 100644 --- a/Linear_cell_complex/doc/Linear_cell_complex/PackageDescription.txt +++ b/Linear_cell_complex/doc/Linear_cell_complex/PackageDescription.txt @@ -1,15 +1,15 @@ -/// \defgroup PkgLinearCellComplex Linear Cell Complex Reference +/// \defgroup PkgLinearCellComplexRef Linear Cell Complex Reference /// \defgroup PkgLinearCellComplexConcepts Concepts -/// \ingroup PkgLinearCellComplex +/// \ingroup PkgLinearCellComplexRef /// \defgroup PkgLinearCellComplexClasses Classes -/// \ingroup PkgLinearCellComplex +/// \ingroup PkgLinearCellComplexRef /*! Basic constructions. */ /// \defgroup PkgLinearCellComplexConstructions Constructions for Linear Cell Complex -/// \ingroup PkgLinearCellComplex +/// \ingroup PkgLinearCellComplexRef /*! High-level operations. \code @@ -17,7 +17,7 @@ \endcode */ /// \defgroup PkgLinearCellComplexOperations Operations for Linear Cell Complex -/// \ingroup PkgLinearCellComplex +/// \ingroup PkgLinearCellComplexRef /*! Draw. \code @@ -25,22 +25,22 @@ \endcode */ /// \defgroup PkgDrawLinearCellComplex Draw a Linear Cell Complex -/// \ingroup PkgLinearCellComplex +/// \ingroup PkgLinearCellComplexRef /*! -\addtogroup PkgLinearCellComplex -\cgalPkgDescriptionBegin{Linear Cell Complex,PkgLinearCellComplexSummary} +\addtogroup PkgLinearCellComplexRef +\cgalPkgDescriptionBegin{Linear Cell Complex,PkgLinearCellComplex} \cgalPkgPicture{lcc_logo.png} \cgalPkgSummaryBegin \cgalPkgAuthor{Guillaume Damiand} \cgalPkgDesc{This package implements linear cell complexes, objects in d-dimension with linear geometry. The combinatorial part of objects is described either by a combinatorial or a generalized map, representing all the cells of the object plus the incidence and adjacency relations between cells. Geometry is added to the combinatorial data-structure simply by associating a point to each vertex of the map. Taking a 2D combinatorial map, and using 3D points, gives a linear cell complex equivalent to a Polyhedron_3.} -\cgalPkgManuals{Chapter_Linear_Cell_Complex,PkgLinearCellComplex} +\cgalPkgManuals{Chapter_Linear_Cell_Complex,PkgLinearCellComplexRef} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{4.0} -\cgalPkgDependsOn{\ref PkgCombinatorialMapsSummary} -\cgalPkgDependsOn{\ref PkgGeneralizedMapsSummary} +\cgalPkgDependsOn{\ref PkgCombinatorialMaps} +\cgalPkgDependsOn{\ref PkgGeneralizedMaps} \cgalPkgBib{cgal:d-lcc-12} \cgalPkgLicense{\ref licensesLGPL "LGPL"} \cgalPkgDemo{3D Linear Cell Complex,linear_cell_complex_3.zip} diff --git a/Linear_cell_complex/examples/Linear_cell_complex/CMakeLists.txt b/Linear_cell_complex/examples/Linear_cell_complex/CMakeLists.txt index 9c0372c277d..653f6e2bc8b 100644 --- a/Linear_cell_complex/examples/Linear_cell_complex/CMakeLists.txt +++ b/Linear_cell_complex/examples/Linear_cell_complex/CMakeLists.txt @@ -23,10 +23,6 @@ endif() # add_definition(-DCGAL_DISABLE_ROUNDING_MATH_CHECK) if (CGAL_FOUND) - include( ${CGAL_USE_FILE} ) - - include(CGAL_CreateSingleSourceCGALProgram) - include_directories(BEFORE ../../include) create_single_source_cgal_program("gmap_linear_cell_complex_3.cpp") create_single_source_cgal_program("linear_cell_complex_3.cpp") diff --git a/Linear_cell_complex/include/CGAL/Linear_cell_complex_base.h b/Linear_cell_complex/include/CGAL/Linear_cell_complex_base.h index 6d207cad7dc..2610e2ea21c 100644 --- a/Linear_cell_complex/include/CGAL/Linear_cell_complex_base.h +++ b/Linear_cell_complex/include/CGAL/Linear_cell_complex_base.h @@ -761,7 +761,7 @@ namespace CGAL { * @return a dart handle to the new vertex containing p. */ Dart_handle insert_point_in_cell_1(Dart_handle dh, const Point& p, - bool update_attributes) + bool update_attributes=true) { return this->insert_cell_0_in_cell_1(dh, create_vertex_attribute(p), @@ -775,7 +775,7 @@ namespace CGAL { * @return a dart handle to the new vertex containing p. */ Dart_handle insert_point_in_cell_2(Dart_handle dh, const Point& p, - bool update_attributes) + bool update_attributes=true) { Vertex_attribute_handle v = create_vertex_attribute(p); @@ -799,7 +799,7 @@ namespace CGAL { */ template Dart_handle insert_point_in_cell(Dart_handle dh, const Point& p, - bool update_attributes = true) + bool update_attributes=true) { CGAL_static_assertion(1<=i && i<=2); if (i==1) return insert_point_in_cell_1(dh, p, update_attributes); @@ -814,7 +814,7 @@ namespace CGAL { */ Dart_handle insert_dangling_cell_1_in_cell_2(Dart_handle dh, const Point& p, - bool update_attributes = true) + bool update_attributes=true) { return this->insert_dangling_cell_1_in_cell_2 (dh, create_vertex_attribute(p), update_attributes); @@ -827,7 +827,7 @@ namespace CGAL { * @return a dart handle to the new vertex containing p. */ template - Dart_handle insert_barycenter_in_cell(Dart_handle dh, bool update_attributes = true) + Dart_handle insert_barycenter_in_cell(Dart_handle dh, bool update_attributes=true) { return insert_point_in_cell(dh, barycenter(dh), update_attributes); } /** Compute the dual of a Linear_cell_complex. diff --git a/Linear_cell_complex/include/CGAL/Linear_cell_complex_constructors.h b/Linear_cell_complex/include/CGAL/Linear_cell_complex_constructors.h index 855f0902df8..84ff459693c 100644 --- a/Linear_cell_complex/include/CGAL/Linear_cell_complex_constructors.h +++ b/Linear_cell_complex/include/CGAL/Linear_cell_complex_constructors.h @@ -173,11 +173,11 @@ namespace CGAL { } template < class LCC > - void load_off(LCC& alcc, std::istream& in) + bool load_off(LCC& alcc, std::istream& in) { File_header_OFF m_file_header; File_scanner_OFF scanner( in, m_file_header.verbose()); - if (!in) return; + if (!in) return false; m_file_header = scanner; // Remember file header after return. Linear_cell_complex_incremental_builder_3 B(alcc); @@ -252,26 +252,30 @@ namespace CGAL { } }*/ B.end_surface(); + + return true; } template < class LCC > - void load_off(LCC& alcc, const char* filename) + bool load_off(LCC& alcc, const char* filename) { std::ifstream input(filename); - if (input.is_open()) - load_off(alcc, input); + if (!input.is_open()) + { return false; } + + return load_off(alcc, input); } /** Export the alcc in off file format. If dimension>2, export all faces but only once. * @pre all faces are closed (i.e. form by closed cycles of edges) */ template < class LCC > - void write_off(LCC& alcc, std::ostream& out) + bool write_off(LCC& alcc, std::ostream& out) { if (!alcc.are_all_faces_closed()) { std::cerr<<"Impossible to write in off a map having open faces."< - void write_off(LCC& alcc, const char* filename) + bool write_off(LCC& alcc, const char* filename) { std::ofstream output(filename); - if (output.is_open()) - write_off(alcc, output); + if (!output.is_open()) + { return false; } + + return write_off(alcc, output); } } // namespace CGAL diff --git a/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h b/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h index e792b745282..70249fd05f6 100644 --- a/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h +++ b/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h @@ -45,29 +45,30 @@ struct DefaultColorFunctorLCC } }; -template -struct Geom_utils; +template +struct LCC_geom_utils; -template -struct Geom_utils +template +struct LCC_geom_utils { - static typename LCC::Vector get_vertex_normal(const LCC& lcc, - typename LCC::Dart_const_handle dh) + static typename Kernel::Vector_3 + get_vertex_normal(const LCC& lcc, typename LCC::Dart_const_handle dh) { - typename LCC::Vector n = CGAL::compute_normal_of_cell_0(lcc,dh); + typename Kernel::Vector_3 n = internal::Geom_utils:: + get_local_vector(CGAL::compute_normal_of_cell_0(lcc,dh)); n = n/(CGAL::sqrt(n*n)); return n; } }; -template -struct Geom_utils +template +struct LCC_geom_utils { - static typename LCC::Vector get_vertex_normal(const LCC&, - typename LCC::Dart_const_handle) + static typename Kernel::Vector_3 + get_vertex_normal(const LCC&, typename LCC::Dart_const_handle) { - typename LCC::Vector res=CGAL::NULL_VECTOR; - return res; + typename Kernel::Vector_3 n=CGAL::NULL_VECTOR; + return n; } }; @@ -121,8 +122,8 @@ protected: cur=dh; do { - add_point_in_face(lcc.point(cur), - Geom_utils::get_vertex_normal(lcc, cur)); + add_point_in_face(lcc.point(cur), LCC_geom_utils:: + get_vertex_normal(lcc, cur)); cur=lcc.next(cur); } while(cur!=dh); diff --git a/Linear_cell_complex/test/Linear_cell_complex/CMakeLists.txt b/Linear_cell_complex/test/Linear_cell_complex/CMakeLists.txt index 21a5a13be57..9ae14e0d428 100644 --- a/Linear_cell_complex/test/Linear_cell_complex/CMakeLists.txt +++ b/Linear_cell_complex/test/Linear_cell_complex/CMakeLists.txt @@ -4,18 +4,12 @@ project( Linear_cell_complex_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - include_directories (BEFORE "../../include") - file(GLOB hfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.h) diff --git a/Maintenance/infrastructure/cgal.geometryfactory.com/crontab b/Maintenance/infrastructure/cgal.geometryfactory.com/crontab index fae731ce3e0..477146a3739 100644 --- a/Maintenance/infrastructure/cgal.geometryfactory.com/crontab +++ b/Maintenance/infrastructure/cgal.geometryfactory.com/crontab @@ -26,12 +26,14 @@ LC_CTYPE=en_US.UTF-8 0 21 * * Sun cd $HOME/CGAL/create_internal_release && /usr/bin/time $HOME/bin/create_release $HOME/CGAL/branches/master.git --public --do-it || echo ERROR # "integration" 0 21 * * Mon,Tue,Wed,Thu,Fri cd $HOME/CGAL/create_internal_release && /usr/bin/time $HOME/bin/create_release $HOME/CGAL/branches/integration.git $HOME/CGAL/branches/empty-dir --public --do-it || echo ERROR +# from branch 4.13 +0 21 * * Sat cd $HOME/CGAL/create_internal_release-4.13-branch && /usr/bin/time $HOME/bin/create_release $HOME/CGAL/branches/CGAL-4.13-branch.git --public --do-it || echo ERROR # from branch 4.12 #0 21 * * Sat cd $HOME/CGAL/create_internal_release-4.12-branch && /usr/bin/time $HOME/bin/create_release $HOME/CGAL/branches/CGAL-4.12-branch.git --public --do-it || echo ERROR # from branch 4.11 -0 21 * * Sat cd $HOME/CGAL/create_internal_release-4.11-branch && /usr/bin/time $HOME/bin/create_release $HOME/CGAL/branches/CGAL-4.11-branch.git --public --do-it || echo ERROR +#0 21 * * Sat cd $HOME/CGAL/create_internal_release-4.11-branch && /usr/bin/time $HOME/bin/create_release $HOME/CGAL/branches/CGAL-4.11-branch.git --public --do-it || echo ERROR # from branch 4.10 -#0 21 * * Mon,Tue cd $HOME/CGAL/create_internal_release-4.10-branch && /usr/bin/time $HOME/bin/create_release $HOME/CGAL/branches/CGAL-4.10-branch.git --public --do-it || echo ERROR +#0 21 * * Mon,Tue cd $HOME/CGAL/create_internal_release-4.10-branch && /usr/bin/time $HOME/bin/create_release $HOME/CGAL/branches/CGAL-4.10-branch.git --public --do-it || echo ERROR # from branch 4.9 #0 21 * * Sat cd $HOME/CGAL/create_internal_release-4.9-branch && /usr/bin/time $HOME/bin/create_release $HOME/CGAL/branches/CGAL-4.9-branch.git --public --do-it # from branch 4.8 diff --git a/Maintenance/infrastructure/gauguin.geometryfactory.com/autocgalrc b/Maintenance/infrastructure/gauguin.geometryfactory.com/autocgalrc index 6a5c4927bc7..023f2d9dfa3 100755 --- a/Maintenance/infrastructure/gauguin.geometryfactory.com/autocgalrc +++ b/Maintenance/infrastructure/gauguin.geometryfactory.com/autocgalrc @@ -1,11 +1,12 @@ #!/bin/sh +CGAL_ROOT="/cygdrive/c/cgal/test" + # Remove test results older than 5 days. # The pattern "../test/" after "$CGAL_ROOT" tries to protect against a # catastrophic `rm -rf` is "$CGAL_ROOT" happens to be empty. -find "$CGAL_ROOT/../test" -maxdepth 1 -type d -name 'CGAL*' ! -ctime -5 -exec rm -rf '{}' \; +find "$CGAL_ROOT/../test" -maxdepth 1 -name 'CGAL*' ! -ctime -5 -exec rm -rf '{}' \; -CGAL_ROOT="/cygdrive/c/cgal/test" BUILD_HOSTS="localhost" REFERENCE_PLATFORMS_DIR="c:/cgal/reference_platforms" CGAL_TESTER="afabri" diff --git a/Maintenance/infrastructure/gauguin.geometryfactory.com/reference_platforms/setup_VC14.1-64 b/Maintenance/infrastructure/gauguin.geometryfactory.com/reference_platforms/setup_VC14.1-64 index a897ffad392..a378baa272a 100644 --- a/Maintenance/infrastructure/gauguin.geometryfactory.com/reference_platforms/setup_VC14.1-64 +++ b/Maintenance/infrastructure/gauguin.geometryfactory.com/reference_platforms/setup_VC14.1-64 @@ -1,7 +1,12 @@ +declare -x CGAL_DIR="C:\\CGAL\\CGAL-4.9" declare -x ALLUSERSPROFILE="C:\\ProgramData" declare -x APPDATA="C:\\Users\\afabri\\AppData\\Roaming" +declare -x ARCH="64" declare -x CGAL_DIR="C:\\CGAL\\CGAL-4.9" declare -x CLIENTNAME="SOSNO" +declare -x CMAKE_GENERATOR="-GNMake Makefiles" +declare -x CMAKE_PREFIX_PATH="C:/3rdPartyLibs/zlib-1.2.11/build_msvc2013;" +declare -x COLLECT_DEMOS_BINARIES="y" declare -x COMMONPROGRAMFILES="C:\\Program Files\\Common Files" declare -x COMPUTERNAME="GAUGUIN" declare -x COMSPEC="C:\\WINDOWS\\system32\\cmd.exe" @@ -9,6 +14,8 @@ declare -x CommandPromptType="Native" declare -x CommonProgramW6432="C:\\Program Files\\Common Files" declare -x DNX_HOME="%USERPROFILE%\\.dnx" declare -x DevEnvDir="C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Professional\\Common7\\IDE\\" +declare -x DriverData="C:\\Windows\\System32\\Drivers\\DriverData" +declare -x EIGEN3_DIR="C:/3rdPartyLibs/eigen-master-4-19-2018" declare -x EXECIGNORE="*.dll" declare -x ExtensionSdkDir="C:\\Program Files (x86)\\Microsoft SDKs\\Windows Kits\\10\\ExtensionSDKs" declare -x Framework40Version="v4.0" @@ -16,21 +23,32 @@ declare -x FrameworkDIR64="C:\\WINDOWS\\Microsoft.NET\\Framework64" declare -x FrameworkDir="C:\\WINDOWS\\Microsoft.NET\\Framework64\\" declare -x FrameworkVersion="v4.0.30319" declare -x FrameworkVersion64="v4.0.30319" +declare -x GMP_INC_DIR="C:\\3rdPartyLibs\\VC-64\\gmp-5.0.1_and_mpfr-3.0.0\\include" +declare -x GMP_LIB_DIR="C:\\3rdPartyLibs\\VC-64\\gmp-5.0.1_and_mpfr-3.0.0\\lib" declare -x GTK_BASEPATH="C:\\Program Files (x86)\\GtkSharp\\2.12\\" declare -x HOME="/home/afabri" declare -x HOMEDRIVE="C:" declare -x HOMEPATH="\\Users\\afabri" -declare -x INCLUDE="C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Professional\\VC\\Tools\\MSVC\\14.14.26428\\include;C:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.6.1\\include\\um;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17134.0\\ucrt;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17134.0\\shared;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17134.0\\um;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17134.0\\winrt;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17134.0\\cppwinrt" -declare -x LIB="C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Professional\\VC\\Tools\\MSVC\\14.14.26428\\lib\\x64;C:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.6.1\\lib\\um\\x64;C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.17134.0\\ucrt\\x64;C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.17134.0\\um\\x64;" -declare -x LIBPATH="C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Professional\\VC\\Tools\\MSVC\\14.14.26428\\lib\\x64;C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Professional\\VC\\Tools\\MSVC\\14.14.26428\\lib\\x86\\store\\references;C:\\Program Files (x86)\\Windows Kits\\10\\UnionMetadata\\10.0.17134.0;C:\\Program Files (x86)\\Windows Kits\\10\\References\\10.0.17134.0;C:\\WINDOWS\\Microsoft.NET\\Framework64\\v4.0.30319;" +declare -x INCLUDE="C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Professional\\VC\\Tools\\MSVC\\14.15.26726\\include;C:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.6.1\\include\\um;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17134.0\\ucrt;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17134.0\\shared;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17134.0\\um;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17134.0\\winrt;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17134.0\\cppwinrt" +declare -x INIT_FILE="C:\\CGAL\\reference_platforms\\x64_Cygwin-Windows10_MSVC2017-Release-64bits\\init.cmake" +declare -x LASLIB_INC_DIR="C:/3rdPartyLibs/LAStools-master/LASlib/inc" +declare -x LASLIB_LIB_DIR="C:/3rdPartyLibs/LAStools-master/build_vs2017-64/Release" +declare -x LIB="C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Professional\\VC\\Tools\\MSVC\\14.15.26726\\lib\\x64;C:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.6.1\\lib\\um\\x64;C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.17134.0\\ucrt\\x64;C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.17134.0\\um\\x64;" +declare -x LIBPATH="C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Professional\\VC\\Tools\\MSVC\\14.15.26726\\lib\\x64;C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Professional\\VC\\Tools\\MSVC\\14.15.26726\\lib\\x86\\store\\references;C:\\Program Files (x86)\\Windows Kits\\10\\UnionMetadata\\10.0.17134.0;C:\\Program Files (x86)\\Windows Kits\\10\\References\\10.0.17134.0;C:\\WINDOWS\\Microsoft.NET\\Framework64\\v4.0.30319;" declare -x LOCALAPPDATA="C:\\Users\\afabri\\AppData\\Local" declare -x LOGONSERVER="\\\\GAUGUIN" +declare -x MAKE_CMD="nmake" +declare -x MPFR_INC_DIR="C:\\3rdPartyLibs\\VC-64\\gmp-5.0.1_and_mpfr-3.0.0\\include" +declare -x MPFR_LIB_DIR="C:\\3rdPartyLibs\\VC-64\\gmp-5.0.1_and_mpfr-3.0.0\\lib" declare -x NETFXSDKDir="C:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.6.1\\" declare -x NUMBER_OF_PROCESSORS="8" +declare -x OLDPWD="/cygdrive/c/Program Files (x86)/Microsoft Visual Studio/2017/Professional" declare -x OS="Windows_NT" declare -x OneDrive="C:\\Users\\afabri\\OneDrive" -declare -x PATH="/cygdrive/c/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.14.26428/bin/HostX64/x64:/cygdrive/c/Program Files (x86)/Microsoft Visual Studio/2017/Professional/Common7/IDE/VC/VCPackages:/cygdrive/c/Program Files (x86)/Microsoft Visual Studio/2017/Professional/Common7/IDE/CommonExtensions/Microsoft/TestWindow:/cygdrive/c/Program Files (x86)/Microsoft Visual Studio/2017/Professional/Common7/IDE/CommonExtensions/Microsoft/TeamFoundation/Team Explorer:/cygdrive/c/Program Files (x86)/Microsoft Visual Studio/2017/Professional/MSBuild/15.0/bin/Roslyn:/cygdrive/c/Program Files (x86)/Microsoft Visual Studio/2017/Professional/Team Tools/Performance Tools/x64:/cygdrive/c/Program Files (x86)/Microsoft Visual Studio/2017/Professional/Team Tools/Performance Tools:/cygdrive/c/Program Files (x86)/Microsoft Visual Studio/Shared/Common/VSPerfCollectionTools/x64:/cygdrive/c/Program Files (x86)/Microsoft Visual Studio/Shared/Common/VSPerfCollectionTools:/cygdrive/c/Program Files (x86)/Microsoft SDKs/Windows/v10.0A/bin/NETFX 4.6.1 Tools/x64:/cygdrive/c/Program Files (x86)/Windows Kits/10/bin/10.0.17134.0/x64:/cygdrive/c/Program Files (x86)/Windows Kits/10/bin/x64:/cygdrive/c/Program Files (x86)/Microsoft Visual Studio/2017/Professional/MSBuild/15.0/bin:/cygdrive/c/WINDOWS/Microsoft.NET/Framework64/v4.0.30319:/cygdrive/c/Program Files (x86)/Microsoft Visual Studio/2017/Professional/Common7/IDE:/cygdrive/c/Program Files (x86)/Microsoft Visual Studio/2017/Professional/Common7/Tools:/cygdrive/c/Program Files (x86)/Intel/iCLS Client:/cygdrive/c/Program Files/Intel/iCLS Client:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/System32/Wbem:/cygdrive/c/WINDOWS/System32/WindowsPowerShell/v1.0:/cygdrive/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/DAL:/cygdrive/c/Program Files/Intel/Intel(R) Management Engine Components/DAL:/cygdrive/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/IPT:/cygdrive/c/Program Files/Intel/Intel(R) Management Engine Components/IPT:/cygdrive/c/Program Files (x86)/ATI Technologies/ATI.ACE/Core-Static:/cygdrive/c/Program Files/Git/cmd:/cygdrive/c/Program Files (x86)/GtkSharp/2.12/bin:/cygdrive/c/Program Files/Microsoft SQL Server/110/Tools/Binn:/cygdrive/c/Program Files (x86)/Microsoft SDKs/TypeScript/1.0:/cygdrive/c/Program Files/Microsoft SQL Server/120/Tools/Binn:/cygdrive/c/Program Files/TortoiseGit/bin:/cygdrive/c/Program Files/Microsoft SQL Server/130/Tools/Binn:/cygdrive/c/Users/afabri/.dnx/bin:/cygdrive/c/Users/afabri/AppData/Local/Microsoft/WindowsApps:%USERPROFILE%/AppData/Local/Microsoft/WindowsApps" +declare -x OpenCV_DIR="C:/3rdPartyLibs/opencv/build_vs2017-64" +declare -x PATH="/cygdrive/c/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.15.26726/bin/HostX64/x64:/cygdrive/c/Program Files (x86)/Microsoft Visual Studio/2017/Professional/Common7/IDE/VC/VCPackages:/cygdrive/c/Program Files (x86)/Microsoft Visual Studio/2017/Professional/Common7/IDE/CommonExtensions/Microsoft/TestWindow:/cygdrive/c/Program Files (x86)/Microsoft Visual Studio/2017/Professional/Common7/IDE/CommonExtensions/Microsoft/TeamFoundation/Team Explorer:/cygdrive/c/Program Files (x86)/Microsoft Visual Studio/2017/Professional/MSBuild/15.0/bin/Roslyn:/cygdrive/c/Program Files (x86)/Microsoft Visual Studio/2017/Professional/Team Tools/Performance Tools/x64:/cygdrive/c/Program Files (x86)/Microsoft Visual Studio/2017/Professional/Team Tools/Performance Tools:/cygdrive/c/Program Files (x86)/Microsoft Visual Studio/Shared/Common/VSPerfCollectionTools/x64:/cygdrive/c/Program Files (x86)/Microsoft Visual Studio/Shared/Common/VSPerfCollectionTools:/cygdrive/c/Program Files (x86)/Microsoft SDKs/Windows/v10.0A/bin/NETFX 4.6.1 Tools/x64:/cygdrive/c/Program Files (x86)/Windows Kits/10/bin/10.0.17134.0/x64:/cygdrive/c/Program Files (x86)/Windows Kits/10/bin/x64:/cygdrive/c/Program Files (x86)/Microsoft Visual Studio/2017/Professional/MSBuild/15.0/bin:/cygdrive/c/WINDOWS/Microsoft.NET/Framework64/v4.0.30319:/cygdrive/c/Program Files (x86)/Microsoft Visual Studio/2017/Professional/Common7/IDE:/cygdrive/c/Program Files (x86)/Microsoft Visual Studio/2017/Professional/Common7/Tools:/cygdrive/c/Program Files (x86)/Intel/iCLS Client:/cygdrive/c/Program Files/Intel/iCLS Client:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/System32/Wbem:/cygdrive/c/WINDOWS/System32/WindowsPowerShell/v1.0:/cygdrive/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/DAL:/cygdrive/c/Program Files/Intel/Intel(R) Management Engine Components/DAL:/cygdrive/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/IPT:/cygdrive/c/Program Files/Intel/Intel(R) Management Engine Components/IPT:/cygdrive/c/Program Files (x86)/ATI Technologies/ATI.ACE/Core-Static:/cygdrive/c/Program Files/Git/cmd:/cygdrive/c/Program Files (x86)/GtkSharp/2.12/bin:/cygdrive/c/Program Files/Microsoft SQL Server/110/Tools/Binn:/cygdrive/c/Program Files (x86)/Microsoft SDKs/TypeScript/1.0:/cygdrive/c/Program Files/Microsoft SQL Server/120/Tools/Binn:/cygdrive/c/Program Files/TortoiseGit/bin:/cygdrive/c/Program Files/Microsoft SQL Server/130/Tools/Binn:/cygdrive/c/Users/afabri/.dnx/bin:/cygdrive/c/Users/afabri/AppData/Local/Microsoft/WindowsApps:%USERPROFILE%/AppData/Local/Microsoft/WindowsApps" declare -x PATHEXT=".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC" +declare -x PLATFORM_REFERENCE="/cygdrive/c/CGAL/reference_platforms" declare -x PROCESSOR_ARCHITECTURE="AMD64" declare -x PROCESSOR_IDENTIFIER="Intel64 Family 6 Model 63 Stepping 2, GenuineIntel" declare -x PROCESSOR_LEVEL="6" @@ -42,10 +60,16 @@ declare -x PUBLIC="C:\\Users\\Public" declare -x Platform="x64" declare -x ProgramData="C:\\ProgramData" declare -x ProgramW6432="C:\\Program Files" +declare -x QGLVIEWERROOT="C:\\3rdPartyLibs/VC-64/libQGLViewer-2.6.2" +declare -x QTDIR="C:/3rdPartyLibs/Qt/5.9.1/msvc2017_64" +declare -x QT_VERSION="5.9.1" +declare -x Qt5_DIR="C:\\3rdPartyLibs\\Qt\\5.9.1\\msvc2017_64\\lib\\cmake\\Qt5" declare -x SESSIONNAME="RDP-Tcp#1" declare -x SHLVL="1" declare -x SYSTEMDRIVE="C:" declare -x SYSTEMROOT="C:\\WINDOWS" +declare -x TBBROOT="C:/3rdPartyLibs/tbb2018_20170919oss" +declare -x TBB_ARCH_PLATFORM="/vc14.1" declare -x TEMP="/cygdrive/c/Users/afabri/AppData/Local/Temp" declare -x TERM="cygwin" declare -x TMP="/cygdrive/c/Users/afabri/AppData/Local/Temp" @@ -57,9 +81,11 @@ declare -x USERPROFILE="C:\\Users\\afabri" declare -x UniversalCRTSdkDir="C:\\Program Files (x86)\\Windows Kits\\10\\" declare -x VCIDEInstallDir="C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Professional\\Common7\\IDE\\VC\\" declare -x VCINSTALLDIR="C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Professional\\VC\\" -declare -x VCToolsInstallDir="C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Professional\\VC\\Tools\\MSVC\\14.14.26428\\" +declare -x VCToolsInstallDir="C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Professional\\VC\\Tools\\MSVC\\14.15.26726\\" declare -x VCToolsRedistDir="C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Professional\\VC\\Redist\\MSVC\\14.14.26405\\" -declare -x VCToolsVersion="14.14.26428" +declare -x VCToolsVersion="14.15.26726" +declare -x VC_VERSION="14.1" +declare -x VC_VERSION_YEAR="2017" declare -x VS110COMNTOOLS="C:\\Program Files (x86)\\Microsoft Visual Studio 11.0\\Common7\\Tools\\" declare -x VS120COMNTOOLS="C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\Common7\\Tools\\" declare -x VS140COMNTOOLS="C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\Tools\\" @@ -67,8 +93,9 @@ declare -x VS150COMNTOOLS="C:\\Program Files (x86)\\Microsoft Visual Studio\\201 declare -x VSCMD_ARG_HOST_ARCH="x64" declare -x VSCMD_ARG_TGT_ARCH="x64" declare -x VSCMD_ARG_app_plat="Desktop" -declare -x VSCMD_VER="15.7.3" +declare -x VSCMD_VER="15.8.6" declare -x VSINSTALLDIR="C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Professional\\" +declare -x VTK_DIR="C:/3rdPartyLibs/VTK-8.0.1/build_vs2017-64" declare -x VisualStudioVersion="15.0" declare -x WINDIR="C:\\WINDOWS" declare -x WindowsLibPath="C:\\Program Files (x86)\\Windows Kits\\10\\UnionMetadata\\10.0.17134.0;C:\\Program Files (x86)\\Windows Kits\\10\\References\\10.0.17134.0" @@ -79,6 +106,7 @@ declare -x WindowsSDK_ExecutablePath_x86="C:\\Program Files (x86)\\Microsoft SDK declare -x WindowsSdkBinPath="C:\\Program Files (x86)\\Windows Kits\\10\\bin\\" declare -x WindowsSdkDir="C:\\Program Files (x86)\\Windows Kits\\10\\" declare -x WindowsSdkVerBinPath="C:\\Program Files (x86)\\Windows Kits\\10\\bin\\10.0.17134.0\\" +declare -x ZLIB_ROOT="C:/3rdPartyLibs/zlib-1.2.11/build_msvc2013" declare -x __DOTNET_ADD_64BIT="1" declare -x __DOTNET_PREFERRED_BITNESS="64" declare -x __VSCMD_PREINIT_PATH="C:\\Program Files (x86)\\Intel\\iCLS Client\\;C:\\Program Files\\Intel\\iCLS Client\\;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\DAL;C:\\Program Files\\Intel\\Intel(R) Management Engine Components\\DAL;C:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\IPT;C:\\Program Files\\Intel\\Intel(R) Management Engine Components\\IPT;c:\\Program Files (x86)\\ATI Technologies\\ATI.ACE\\Core-Static;C:\\Program Files\\Git\\cmd;C:\\Program Files (x86)\\GtkSharp\\2.12\\bin;C:\\Program Files\\Microsoft SQL Server\\110\\Tools\\Binn\\;C:\\Program Files (x86)\\Microsoft SDKs\\TypeScript\\1.0\\;C:\\Program Files\\Microsoft SQL Server\\120\\Tools\\Binn\\;C:\\Program Files\\TortoiseGit\\bin;C:\\Program Files\\Microsoft SQL Server\\130\\Tools\\Binn\\;C:\\Users\\afabri\\.dnx\\bin;C:\\Users\\afabri\\AppData\\Local\\Microsoft\\WindowsApps;;%USERPROFILE%\\AppData\\Local\\Microsoft\\WindowsApps" diff --git a/Maintenance/infrastructure/gauguin.geometryfactory.com/reference_platforms/setup_common b/Maintenance/infrastructure/gauguin.geometryfactory.com/reference_platforms/setup_common index 410ca7de64b..8116915571c 100644 --- a/Maintenance/infrastructure/gauguin.geometryfactory.com/reference_platforms/setup_common +++ b/Maintenance/infrastructure/gauguin.geometryfactory.com/reference_platforms/setup_common @@ -86,4 +86,5 @@ if [ -d/cygdrive/c/3rdPartyLibs/opencv/build_vs${VC_VERSION_YEAR}-${ARCH} ]; the export OpenCV_DIR="C:/3rdPartyLibs/opencv/build_vs${VC_VERSION_YEAR}-${ARCH}" export PATH="`cygpath ${OpenCV_DIR}/bin/Release`":$PATH export PATH="`cygpath ${OpenCV_DIR}/bin/Debug`":$PATH + export PATH="`cygpath ${OpenCV_DIR}/3rdparty/ffmpeg/`":$PATH fi diff --git a/Maintenance/infrastructure/gauguin.geometryfactory.com/reference_platforms/x64_Cygwin-Windows10_MSVC2017-Debug-64bits/setup b/Maintenance/infrastructure/gauguin.geometryfactory.com/reference_platforms/x64_Cygwin-Windows10_MSVC2017-Debug-64bits/setup index b096592dcda..9b4c6c4e4ec 100644 --- a/Maintenance/infrastructure/gauguin.geometryfactory.com/reference_platforms/x64_Cygwin-Windows10_MSVC2017-Debug-64bits/setup +++ b/Maintenance/infrastructure/gauguin.geometryfactory.com/reference_platforms/x64_Cygwin-Windows10_MSVC2017-Debug-64bits/setup @@ -7,5 +7,5 @@ export PLATFORM_REFERENCE="/cygdrive/c/CGAL/reference_platforms" export BOOST_VERSION=1_67_0 export TBB_ARCH="intel64" export EIGEN3_DIR="C:/3rdPartyLibs/eigen-master" -export OPENMESH_DIR="C:\3rdPartyLibs\openmesh-master-19-2018" +export OPENMESH_DIR="C:\3rdPartyLibs\OpenMesh_7_1" source "${PLATFORM_REFERENCE}/setup_common" diff --git a/Maintenance/infrastructure/gauguin.geometryfactory.com/reference_platforms/x64_Cygwin-Windows10_MSVC2017-Release-64bits/CMakeCache.txt b/Maintenance/infrastructure/gauguin.geometryfactory.com/reference_platforms/x64_Cygwin-Windows10_MSVC2017-Release-64bits/SKIPCMakeCache.txt similarity index 100% rename from Maintenance/infrastructure/gauguin.geometryfactory.com/reference_platforms/x64_Cygwin-Windows10_MSVC2017-Release-64bits/CMakeCache.txt rename to Maintenance/infrastructure/gauguin.geometryfactory.com/reference_platforms/x64_Cygwin-Windows10_MSVC2017-Release-64bits/SKIPCMakeCache.txt diff --git a/Maintenance/infrastructure/gauguin.geometryfactory.com/reference_platforms/x64_Cygwin-Windows10_MSVC2017-Release-64bits/init.cmake b/Maintenance/infrastructure/gauguin.geometryfactory.com/reference_platforms/x64_Cygwin-Windows10_MSVC2017-Release-64bits/init.cmake new file mode 100644 index 00000000000..840d4c7eb32 --- /dev/null +++ b/Maintenance/infrastructure/gauguin.geometryfactory.com/reference_platforms/x64_Cygwin-Windows10_MSVC2017-Release-64bits/init.cmake @@ -0,0 +1,25 @@ +SET(CMAKE_BUILD_TYPE "Release" CACHE STRING "") + +SET(CMAKE_CXX_FLAGS "/W3 /GR /EHsc /fp:strict /fp:except- /wd4503 /bigobj /MD" CACHE STRING "") + +SET(CMAKE_CXX_FLAGS_DEBUG "" CACHE STRING "") + +SET(CMAKE_CXX_FLAGS_RELEASE "/O2 /Ob2 /DCGAL_NDEBUG" CACHE STRING "") + +SET(WITH_CGAL_Core ON CACHE BOOL "") + +SET(WITH_CGAL_ImageIO ON CACHE BOOL "") + +SET(WITH_CGAL_Qt5 ON CACHE BOOL "") + +SET(WITH_GMP ON CACHE BOOL "") + +SET(WITH_GMPXX OFF CACHE BOOL "") + +SET(WITH_MPFR ON CACHE BOOL "") + +SET(WITH_NTL OFF CACHE BOOL "") + +SET(WITH_demos ON CACHE BOOL "") + +SET(CGAL_HEADER_ONLY ON CACHE BOOL "") diff --git a/Maintenance/infrastructure/gauguin.geometryfactory.com/reference_platforms/x64_Cygwin-Windows10_MSVC2017-Release-64bits/setup b/Maintenance/infrastructure/gauguin.geometryfactory.com/reference_platforms/x64_Cygwin-Windows10_MSVC2017-Release-64bits/setup index 61432ae5e64..2a8e2065c88 100644 --- a/Maintenance/infrastructure/gauguin.geometryfactory.com/reference_platforms/x64_Cygwin-Windows10_MSVC2017-Release-64bits/setup +++ b/Maintenance/infrastructure/gauguin.geometryfactory.com/reference_platforms/x64_Cygwin-Windows10_MSVC2017-Release-64bits/setup @@ -5,8 +5,9 @@ export ARCH="64" export QT_VERSION="5.9.1" export PLATFORM_REFERENCE="/cygdrive/c/CGAL/reference_platforms" export BOOST_VERSION="1_65_1" -export TBB_ARCH="intel64" +export TBB_ARCH_PLATFORM="intel64/vc14" export EIGEN3_DIR="C:/3rdPartyLibs/eigen-master" +export INIT_FILE="C:\\CGAL\\reference_platforms\\x64_Cygwin-Windows10_MSVC2017-Release-64bits\\init.cmake" source "${PLATFORM_REFERENCE}/setup_common" COLLECT_DEMOS_BINARIES=y diff --git a/Maintenance/public_release/announcement/mailing-beta.eml b/Maintenance/public_release/announcement/mailing-beta.eml index 1aa6957b379..8958146452d 100644 --- a/Maintenance/public_release/announcement/mailing-beta.eml +++ b/Maintenance/public_release/announcement/mailing-beta.eml @@ -1,73 +1,39 @@ -Subject: CGAL 4.12 Beta 2 Released, Computational Geometry Algorithms Library +Subject: CGAL 4.13 Beta 2 Released, Computational Geometry Algorithms Library Content-Type: text/plain; charset="utf-8" Body: -The CGAL Open Source Project is pleased to announce the release 4.12 Beta 2 +The CGAL Open Source Project is pleased to announce the release 4.13 Beta 2 of CGAL, the Computational Geometry Algorithms Library. -CGAL version 4.12 Beta 2 is a public testing release. It should provide +CGAL version 4.13 Beta 2 is a public testing release. It should provide a solid ground to report bugs that need to be tackled before the -release of the final version of CGAL 4.12 in April. - - -*WARNING*: This release features an important change of the CMake scripts -used to configure the CGAL libraries and examples. Developers using -makefiles or the Ninja build-system should set the `CMAKE_BUILD_TYPE` to -`Release` manually, to avoid using CGAL libraries without any compile-time -optimization. Please read the first paragraph of the release notes -carefully. - - -Note that, since the release CGAL-4.12 Beta 1, the header-only mode of CGAL -has been modified, and documented. - +release of the final version of CGAL 4.13 in September. Besides fixes and general enhancement to existing packages, the following -has changed since CGAL 4.11: +has changed since CGAL 4.12: -Using CGAL Header-only +### 3D Periodic Mesh Generation (new package) -- It is now possible to use CGAL without configuring it with CMake, as a - header-only library. Note that, even if CGAL is header-only, its - dependencies (such as GMP and MPFR) are not all header-only. +- This package generates 3-dimensional periodic meshes. It computes + isotropic simplicial meshes for domains described through implicit + functional boundaries over the flat torus (which can also seen in + the Euclidean space as a periodic cube). The output is a periodic + 3D mesh of the domain volume and conformal surface meshes for all + the boundary and subdividing surfaces. The package is closely + related to the 3D Mesh Generation package, with similar concepts, + classes, and API. -2D Movable Separability of Sets (new package) +### Classification -- A new package called "2D Movable Separability of Sets" has been - introduced. It handles a class of problems that deal with moving - sets of objects in the plane; the challenge is to avoid collisions - between the objects while considering different kinds of motions and - various definitions of separation. - - At this point this package consists of the implementations of - various predicates and constructions related to castings of - polygonal objects. In particular, it can be used to determine - whether a feasible mold for a polygonal object does exist. If a mold - exists, the package can also be used to compute all possible - orientations of the feasible molds and the corresponding motions - needed to remove the casted object from the mold. +- This package can now handle classification of surface meshes and + clusters, and can compute features in parallel. -Classification (new package) -- This package offers an algorithm that classifies a data set into a - user-defined set of labels (such as ground, vegetation, buildings, - etc.). A flexible API is provided so that users can classify any - type of data, compute their own local features on the input data - set, and define their own labels. - - -Kinetic Data Structures (removed package) - -- This package has been removed from CGAL-4.12. Users of the package - will have to keep using the source code available in CGAL-4.11 or - earlier. - - -See https://www.cgal.org/2018/04/09/cgal412-beta2/ for a complete list of +See https://www.cgal.org/2018/09/11/cgal413-beta2/ for a complete list of changes. @@ -92,8 +58,7 @@ structures and algorithms, like streamlines), - optimization algorithms (smallest enclosing sphere of points or spheres, smallest enclosing ellipsoid of points, principal - component analysis), -- kinetic data structures + component analysis). diff --git a/Maintenance/public_release/announcement/mailing.eml b/Maintenance/public_release/announcement/mailing.eml index 7e7b13d4235..0f2f7e78af3 100644 --- a/Maintenance/public_release/announcement/mailing.eml +++ b/Maintenance/public_release/announcement/mailing.eml @@ -1,75 +1,35 @@ -Subject: CGAL 4.12 Released, Computational Geometry Algorithms Library +Subject: CGAL 4.13 Released, Computational Geometry Algorithms Library Content-Type: text/plain; charset="utf-8" Body: -The CGAL Open Source Project is pleased to announce the release 4.12 +The CGAL Open Source Project is pleased to announce the release 4.13 of CGAL, the Computational Geometry Algorithms Library. -*WARNING*: This release features an important change of the CMake scripts -used to configure the CGAL libraries and examples. Developers using -makefiles or the Ninja build-system should set the `CMAKE_BUILD_TYPE` to -`Release` manually, to avoid using CGAL libraries without any compile-time -optimization. Please read the first paragraph of the release notes -carefully. - - Besides fixes and general enhancement to existing packages, the following -has changed since CGAL 4.11: +has changed since CGAL 4.12: -Using CGAL Header-only +### 3D Periodic Mesh Generation (new package) -- It is now possible to use CGAL without configuring it with CMake, as a - header-only library. Note that, even if CGAL is header-only, its - dependencies (such as GMP and MPFR) are not all header-only. +- This package generates 3-dimensional periodic meshes. It computes + isotropic simplicial meshes for domains described through implicit + functional boundaries over the flat torus (which can also seen in + the Euclidean space as a periodic cube). The output is a periodic + 3D mesh of the domain volume and conformal surface meshes for all + the boundary and subdividing surfaces. The package is closely + related to the 3D Mesh Generation package, with similar concepts, + classes, and API. -Compiler Support +### Classification -- The Microsoft Visual C++ 2017 version 15.3 has introduced support for - C++17, with the compilation flag `/std:c++17`. CGAL 4.12 has an initial - support for that flag: the code will compile, but a lot of deprecation - warnings will remain. Note that Boost version 1.67 is the first version - of Boost supporting `/std:c++17`. - -- The compilation flag `/permissive-` of Visual C++ is now supported. +- This package can now handle classification of surface meshes and + clusters, and can compute features in parallel. -2D Movable Separability of Sets (new package) -- A new package called "2D Movable Separability of Sets" has been - introduced. It handles a class of problems that deal with moving - sets of objects in the plane; the challenge is to avoid collisions - between the objects while considering different kinds of motions and - various definitions of separation. - - At this point this package consists of the implementations of - various predicates and constructions related to castings of - polygonal objects. In particular, it can be used to determine - whether a feasible mold for a polygonal object does exist. If a mold - exists, the package can also be used to compute all possible - orientations of the feasible molds and the corresponding motions - needed to remove the casted object from the mold. - - -Classification (new package) - -- This package offers an algorithm that classifies a data set into a - user-defined set of labels (such as ground, vegetation, buildings, - etc.). A flexible API is provided so that users can classify any - type of data, compute their own local features on the input data - set, and define their own labels. - - -Kinetic Data Structures (removed package) - -- This package has been removed from CGAL-4.12. Users of the package - will have to keep using the source code available in CGAL-4.11 or - earlier. - - -See https://www.cgal.org/2018/04/25/cgal412/ for a complete list of +See https://www.cgal.org/2018/10/01/cgal413 / for a complete list of changes. @@ -94,8 +54,7 @@ structures and algorithms, like streamlines), - optimization algorithms (smallest enclosing sphere of points or spheres, smallest enclosing ellipsoid of points, principal - component analysis), -- kinetic data structures + component analysis). diff --git a/Maintenance/public_release/scripts/precompiled_demos_zips b/Maintenance/public_release/scripts/precompiled_demos_zips index 62124245248..d1412e649d7 100755 --- a/Maintenance/public_release/scripts/precompiled_demos_zips +++ b/Maintenance/public_release/scripts/precompiled_demos_zips @@ -15,10 +15,8 @@ pushd AABB_tree_Demo; zip ../AABB_demo.zip * ; pushd Alpha_shapes_3_Demo; zip ../alpha_shape_3.zip * ; popd pushd Bounding_volumes_Demo; zip ../bounding_volumes_2.zip * ; popd pushd Circular_kernel_2_Demo; zip ../circular_kernel.zip * ; popd -pushd Mesh_3_Demo; zip -r ../mesh_3.zip * ; popd pushd Periodic_3_triangulation_3_Demo; zip ../periodic_3_triangulation_3.zip *; popd pushd Periodic_Lloyd_3_Demo; zip ../periodic_3_lloyd.zip *; popd -pushd Polygon_Demo; zip ../polygon.zip * ; popd pushd Polyhedron_Demo; zip -r ../polyhedron_3.zip * ; popd pushd Segment_Delaunay_graph_2_Demo; zip ../segment_voronoi_diagram_2.zip *; popd pushd Surface_mesher_Demo; zip ../surface_mesher.zip *; popd @@ -28,9 +26,6 @@ pushd Triangulation_2_Demo; zip ../delaunay_triangulation_2.zip Delaunay_triangulation_2.exe popd -# CGAL<3.8 but was forgot -pushd Principal_component_analysis_Demo; zip ../pca.zip *; popd - # CGAL-3.8 pushd Largest_empty_rect_2_Demo; zip ../largest_empty_rect_2.zip *; popd pushd Apollonius_graph_2_Demo; zip ../apollonius_graph_2.zip *; popd diff --git a/Maintenance/release_building/MINOR_NUMBER b/Maintenance/release_building/MINOR_NUMBER index b1bd38b62a0..8351c19397f 100644 --- a/Maintenance/release_building/MINOR_NUMBER +++ b/Maintenance/release_building/MINOR_NUMBER @@ -1 +1 @@ -13 +14 diff --git a/Maintenance/release_building/public_release_name b/Maintenance/release_building/public_release_name index 7f8ff322df2..cc75900d7a5 100644 --- a/Maintenance/release_building/public_release_name +++ b/Maintenance/release_building/public_release_name @@ -1 +1 @@ -CGAL-4.13-dev +CGAL-4.14-dev diff --git a/Matrix_search/doc/Matrix_search/CGAL/Dynamic_matrix.h b/Matrix_search/doc/Matrix_search/CGAL/Dynamic_matrix.h index 4761f703302..96b960f8b4a 100644 --- a/Matrix_search/doc/Matrix_search/CGAL/Dynamic_matrix.h +++ b/Matrix_search/doc/Matrix_search/CGAL/Dynamic_matrix.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgMatrixSearch +\ingroup PkgMatrixSearchRef The class `Dynamic_matrix` is an adaptor for an arbitrary matrix class `M` to provide the dynamic operations needed for monotone diff --git a/Matrix_search/doc/Matrix_search/CGAL/Sorted_matrix_search_traits_adaptor.h b/Matrix_search/doc/Matrix_search/CGAL/Sorted_matrix_search_traits_adaptor.h index e4f01c40586..cff3fcffd6a 100644 --- a/Matrix_search/doc/Matrix_search/CGAL/Sorted_matrix_search_traits_adaptor.h +++ b/Matrix_search/doc/Matrix_search/CGAL/Sorted_matrix_search_traits_adaptor.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgMatrixSearch +\ingroup PkgMatrixSearchRef The class `Sorted_matrix_search_traits_adaptor` can be used as an adaptor to create sorted matrix search traits classes for diff --git a/Matrix_search/doc/Matrix_search/CGAL/monotone_matrix_search.h b/Matrix_search/doc/Matrix_search/CGAL/monotone_matrix_search.h index a62799d1a10..91b60ccd958 100644 --- a/Matrix_search/doc/Matrix_search/CGAL/monotone_matrix_search.h +++ b/Matrix_search/doc/Matrix_search/CGAL/monotone_matrix_search.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgMatrixSearch +\ingroup PkgMatrixSearchRef \brief computes the maximum (as specified by `compare_strictly`) entry for each row of `m` and writes the corresponding column diff --git a/Matrix_search/doc/Matrix_search/CGAL/sorted_matrix_search.h b/Matrix_search/doc/Matrix_search/CGAL/sorted_matrix_search.h index f54578520b4..d27ad901387 100644 --- a/Matrix_search/doc/Matrix_search/CGAL/sorted_matrix_search.h +++ b/Matrix_search/doc/Matrix_search/CGAL/sorted_matrix_search.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgMatrixSearch +\ingroup PkgMatrixSearchRef \brief returns the element `x` in one of the sorted matrices from the range `[f, l)`, for which `t.is_feasible(x)` diff --git a/Matrix_search/doc/Matrix_search/PackageDescription.txt b/Matrix_search/doc/Matrix_search/PackageDescription.txt index 97b2f8fbd5c..6e91a1dba4e 100644 --- a/Matrix_search/doc/Matrix_search/PackageDescription.txt +++ b/Matrix_search/doc/Matrix_search/PackageDescription.txt @@ -1,17 +1,17 @@ -/// \defgroup PkgMatrixSearch Monotone and Sorted Matrix Search Reference +/// \defgroup PkgMatrixSearchRef Monotone and Sorted Matrix Search Reference /// \defgroup PkgMatrixSearchConcepts Concepts -/// \ingroup PkgMatrixSearch +/// \ingroup PkgMatrixSearchRef /*! -\addtogroup PkgMatrixSearch +\addtogroup PkgMatrixSearchRef \todo check generated documentation -\cgalPkgDescriptionBegin{Monotone and Sorted Matrix Search,PkgMatrixSearchSummary} +\cgalPkgDescriptionBegin{Monotone and Sorted Matrix Search,PkgMatrixSearch} \cgalPkgPicture{matrix.png} \cgalPkgSummaryBegin \cgalPkgAuthor{Michael Hoffmann} \cgalPkgDesc{This package provides a matrix search framework, which is the underlying technique for the computation of all furthest neighbors for the vertices of a convex polygon, maximal k-gons inscribed into a planar point set, and computing rectangular p-centers.} -\cgalPkgManuals{Chapter_Monotone_and_Sorted_Matrix_Search,PkgMatrixSearch} +\cgalPkgManuals{Chapter_Monotone_and_Sorted_Matrix_Search,PkgMatrixSearchRef} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{1.1} diff --git a/Matrix_search/examples/Matrix_search/CMakeLists.txt b/Matrix_search/examples/Matrix_search/CMakeLists.txt index 9b31e4bc4da..d72870c96af 100644 --- a/Matrix_search/examples/Matrix_search/CMakeLists.txt +++ b/Matrix_search/examples/Matrix_search/CMakeLists.txt @@ -4,18 +4,12 @@ project( Matrix_search_Examples ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Matrix_search/test/Matrix_search/CMakeLists.txt b/Matrix_search/test/Matrix_search/CMakeLists.txt index 6f84d2e2d5a..fd3de9c33ab 100644 --- a/Matrix_search/test/Matrix_search/CMakeLists.txt +++ b/Matrix_search/test/Matrix_search/CMakeLists.txt @@ -4,18 +4,12 @@ project( Matrix_search_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Mesh_2/demo/Mesh_2/CMakeLists.txt b/Mesh_2/demo/Mesh_2/CMakeLists.txt index 71a049e416f..ea268eec3f0 100644 --- a/Mesh_2/demo/Mesh_2/CMakeLists.txt +++ b/Mesh_2/demo/Mesh_2/CMakeLists.txt @@ -10,13 +10,12 @@ if(NOT POLICY CMP0070 AND POLICY CMP0053) endif() find_package(CGAL QUIET) -include( ${CGAL_USE_FILE} ) -include_directories(BEFORE ../../include) include_directories(BEFORE ../../../Triangulation_2/include) if ( CGAL_FOUND ) + include(${CGAL_USE_FILE}) # conform target add_executable (conform conform.cpp) diff --git a/Mesh_2/doc/Mesh_2/CGAL/Delaunay_mesh_criteria_2.h b/Mesh_2/doc/Mesh_2/CGAL/Delaunay_mesh_criteria_2.h index e80acb71a5b..3979f8baf04 100644 --- a/Mesh_2/doc/Mesh_2/CGAL/Delaunay_mesh_criteria_2.h +++ b/Mesh_2/doc/Mesh_2/CGAL/Delaunay_mesh_criteria_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgMesh2 +\ingroup PkgMesh2Ref diff --git a/Mesh_2/doc/Mesh_2/CGAL/Delaunay_mesh_face_base_2.h b/Mesh_2/doc/Mesh_2/CGAL/Delaunay_mesh_face_base_2.h index 3fe813eecfe..909c91012c5 100644 --- a/Mesh_2/doc/Mesh_2/CGAL/Delaunay_mesh_face_base_2.h +++ b/Mesh_2/doc/Mesh_2/CGAL/Delaunay_mesh_face_base_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgMesh2 +\ingroup PkgMesh2Ref diff --git a/Mesh_2/doc/Mesh_2/CGAL/Delaunay_mesh_size_criteria_2.h b/Mesh_2/doc/Mesh_2/CGAL/Delaunay_mesh_size_criteria_2.h index f8624d97adc..1c29f732f89 100644 --- a/Mesh_2/doc/Mesh_2/CGAL/Delaunay_mesh_size_criteria_2.h +++ b/Mesh_2/doc/Mesh_2/CGAL/Delaunay_mesh_size_criteria_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgMesh2 +\ingroup PkgMesh2Ref diff --git a/Mesh_2/doc/Mesh_2/CGAL/Delaunay_mesh_vertex_base_2.h b/Mesh_2/doc/Mesh_2/CGAL/Delaunay_mesh_vertex_base_2.h index 02894cb4e84..0eb0c2f8028 100644 --- a/Mesh_2/doc/Mesh_2/CGAL/Delaunay_mesh_vertex_base_2.h +++ b/Mesh_2/doc/Mesh_2/CGAL/Delaunay_mesh_vertex_base_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgMesh2 +\ingroup PkgMesh2Ref The class `Delaunay_mesh_vertex_base_2` is a model for the concept `DelaunayMeshVertexBase_2`. diff --git a/Mesh_2/doc/Mesh_2/CGAL/Delaunay_mesher_2.h b/Mesh_2/doc/Mesh_2/CGAL/Delaunay_mesher_2.h index 449cb10d6e7..dd71a465d4d 100644 --- a/Mesh_2/doc/Mesh_2/CGAL/Delaunay_mesher_2.h +++ b/Mesh_2/doc/Mesh_2/CGAL/Delaunay_mesher_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgMesh2 +\ingroup PkgMesh2Ref This class implements a 2D mesh generator. diff --git a/Mesh_2/doc/Mesh_2/CGAL/Mesh_2/Face_badness.h b/Mesh_2/doc/Mesh_2/CGAL/Mesh_2/Face_badness.h index fc3e577f324..57ac738075b 100644 --- a/Mesh_2/doc/Mesh_2/CGAL/Mesh_2/Face_badness.h +++ b/Mesh_2/doc/Mesh_2/CGAL/Mesh_2/Face_badness.h @@ -1,7 +1,7 @@ namespace CGAL { namespace Mesh_2 { /*! -\ingroup PkgMesh2 +\ingroup PkgMesh2Ref */ enum Face_badness { NOT_BAD, BAD, IMPERATIVELY_BAD}; diff --git a/Mesh_2/doc/Mesh_2/CGAL/Triangulation_conformer_2.h b/Mesh_2/doc/Mesh_2/CGAL/Triangulation_conformer_2.h index b0ff428a78e..2a8fcae9eef 100644 --- a/Mesh_2/doc/Mesh_2/CGAL/Triangulation_conformer_2.h +++ b/Mesh_2/doc/Mesh_2/CGAL/Triangulation_conformer_2.h @@ -40,7 +40,7 @@ template void make_conforming_Gabriel_2 (CDT &t); namespace CGAL { /*! -\ingroup PkgMesh2 +\ingroup PkgMesh2Ref The class `Triangulation_conformer_2` is an auxiliary class of diff --git a/Mesh_2/doc/Mesh_2/PackageDescription.txt b/Mesh_2/doc/Mesh_2/PackageDescription.txt index 79733d285b8..96c93298c8b 100644 --- a/Mesh_2/doc/Mesh_2/PackageDescription.txt +++ b/Mesh_2/doc/Mesh_2/PackageDescription.txt @@ -1,19 +1,19 @@ -/// \defgroup PkgMesh2 2D Conforming Triangulations and Meshes Reference +/// \defgroup PkgMesh2Ref 2D Conforming Triangulations and Meshes Reference /// \defgroup PkgMesh2Concepts Concepts -/// \ingroup PkgMesh2 +/// \ingroup PkgMesh2Ref /// \defgroup PkgMesh2Functions Mesh Generation Functions -/// \ingroup PkgMesh2 +/// \ingroup PkgMesh2Ref /// The main function to generate a mesh is `refine_Delaunay_mesh_2()`. /// The function `lloyd_optimize_mesh_2()` allows to optimize an existing mesh. /// \defgroup PkgMesh2Enum Enumerations -/// \ingroup PkgMesh2 +/// \ingroup PkgMesh2Ref /*! -\addtogroup PkgMesh2 -\cgalPkgDescriptionBegin{2D Conforming Triangulations and Meshes,PkgMesh2Summary} +\addtogroup PkgMesh2Ref +\cgalPkgDescriptionBegin{2D Conforming Triangulations and Meshes,PkgMesh2} \cgalPkgPicture{Mesh_2/fig/delaunaymesh-small.png} \cgalPkgSummaryBegin \cgalPkgAuthor{Laurent Rineau} @@ -23,11 +23,11 @@ Conforming Gabriel triangulations are obtained by further refining constrained The package provides also a 2D mesh generator that refines triangles and constrained edges until user defined size and shape criteria on triangles are satisfied. The generated meshes can be optimized using the Lloyd algorithm, also provided in this package. The package can handle intersecting input constraints and set no restriction on the angle formed by two constraints sharing an endpoint.} -\cgalPkgManuals{Chapter_2D_Conforming_Triangulations_and_Meshes,PkgMesh2} +\cgalPkgManuals{Chapter_2D_Conforming_Triangulations_and_Meshes,PkgMesh2Ref} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{3.1} -\cgalPkgDependsOn{\ref PkgTriangulation2Summary} +\cgalPkgDependsOn{\ref PkgTriangulation2} \cgalPkgBib{cgal:r-ctm2} \cgalPkgLicense{\ref licensesGPL "GPL"} \cgalPkgDemo{2D Mesh Generator,constrained_delaunay_triangulation_2.zip} diff --git a/Mesh_2/examples/Mesh_2/CMakeLists.txt b/Mesh_2/examples/Mesh_2/CMakeLists.txt index 43eaf6b585d..69148ac52ee 100644 --- a/Mesh_2/examples/Mesh_2/CMakeLists.txt +++ b/Mesh_2/examples/Mesh_2/CMakeLists.txt @@ -1,6 +1,6 @@ project( Mesh_2_Examples ) -cmake_minimum_required(VERSION 2.8.12) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) diff --git a/Mesh_2/include/CGAL/Mesh_2/README b/Mesh_2/include/CGAL/Mesh_2/README deleted file mode 100644 index 30d815f220c..00000000000 --- a/Mesh_2/include/CGAL/Mesh_2/README +++ /dev/null @@ -1,6 +0,0 @@ -No header in this sub-directory, but Face_badness.h, is documented. They -are internal headers of the Mesh_2 packages, and should not be used. - -If you want to use some undocumented functionnality, please contact me -(Laurent Rineau ) so that we can see if I can move -some internal details to the documented interface. diff --git a/Mesh_2/test/Mesh_2/CMakeLists.txt b/Mesh_2/test/Mesh_2/CMakeLists.txt index 68453547a9f..e5bb16314ee 100644 --- a/Mesh_2/test/Mesh_2/CMakeLists.txt +++ b/Mesh_2/test/Mesh_2/CMakeLists.txt @@ -4,17 +4,13 @@ project( Mesh_2_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET COMPONENTS Core) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - include_directories (BEFORE "../../include") + include(${CGAL_USE_FILE}) # create a target per cppfile file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) diff --git a/Mesh_3/archive/applications/CMakeLists.txt b/Mesh_3/archive/applications/CMakeLists.txt index 7324e7ef359..9ce425b3cd8 100644 --- a/Mesh_3/archive/applications/CMakeLists.txt +++ b/Mesh_3/archive/applications/CMakeLists.txt @@ -4,7 +4,7 @@ project( Mesh_3_applications ) -CMAKE_MINIMUM_REQUIRED(VERSION 2.6.2) +CMAKE_MINIMUM_REQUIRED(VERSION 3.1) include_directories(../include) @@ -12,8 +12,6 @@ include_directories(../include) find_package(CGAL COMPONENTS ImageIO) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - find_package( Boost COMPONENTS program_options filesystem system) if ( Boost_FOUND AND Boost_VERSION GREATER 103400) @@ -27,8 +25,6 @@ if ( CGAL_FOUND ) message(FATAL_ERROR "This program requires Boost >= 1.34.1") endif() - include( CGAL_CreateSingleSourceCGALProgram ) - # Compilable examples create_single_source_cgal_program( "mesh_implicit_domains.cpp" "../examples/Mesh_3/implicit_functions.cpp" ) if( CGAL_ImageIO_USE_ZLIB ) diff --git a/Mesh_3/benchmark/Mesh_3/CMakeLists.txt b/Mesh_3/benchmark/Mesh_3/CMakeLists.txt index 9b359370bef..27422304a52 100644 --- a/Mesh_3/benchmark/Mesh_3/CMakeLists.txt +++ b/Mesh_3/benchmark/Mesh_3/CMakeLists.txt @@ -4,7 +4,7 @@ project( Mesh_3_benchmark ) -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.1) # Creates a new CMake option, turned ON by default @@ -35,7 +35,6 @@ if(MSVC AND ACTIVATE_MSVC_PRECOMPILED_HEADERS AND NOT(MSVC_VERSION LESS 1310)) set(CGAL_CXX_FLAGS "${CGAL_CXX_FLAGS} /Zm1000") endif() -include_directories(../../include) include_directories(../../../Triangulation_3/include) include_directories(../../../STL_Extension/include) include_directories(../../../AABB_tree/include) @@ -49,8 +48,6 @@ endif() find_package(CGAL COMPONENTS ImageIO) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - # Activate concurrency ? (turned OFF by default) option(CGAL_ACTIVATE_CONCURRENT_MESH_3 "Activate parallelism in Mesh_3" @@ -82,8 +79,6 @@ if ( CGAL_FOUND ) endif() if ( Boost_FOUND AND Boost_VERSION GREATER 103400 ) - include( CGAL_CreateSingleSourceCGALProgram ) - # Compilable benchmark set (BENCHMARK_SOURCE_FILES "concurrency.cpp") if(TBB_FOUND) diff --git a/Mesh_3/doc/Mesh_3/CGAL/Compact_mesh_cell_base_3.h b/Mesh_3/doc/Mesh_3/CGAL/Compact_mesh_cell_base_3.h index d6ac28deb44..9de1c57ecc6 100644 --- a/Mesh_3/doc/Mesh_3/CGAL/Compact_mesh_cell_base_3.h +++ b/Mesh_3/doc/Mesh_3/CGAL/Compact_mesh_cell_base_3.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgMesh_3MeshClasses +\ingroup PkgMesh3MeshClasses The class `Compact_mesh_cell_base_3` is a model of the concept `MeshCellBase_3`. It is designed to serve as cell base class for the 3D triangulation diff --git a/Mesh_3/doc/Mesh_3/CGAL/Gray_image_mesh_domain_3.h b/Mesh_3/doc/Mesh_3/CGAL/Gray_image_mesh_domain_3.h index cc6d2afdd75..d48567bd057 100644 --- a/Mesh_3/doc/Mesh_3/CGAL/Gray_image_mesh_domain_3.h +++ b/Mesh_3/doc/Mesh_3/CGAL/Gray_image_mesh_domain_3.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgMesh_3Domains +\ingroup PkgMesh3Domains \deprecated The class template `Gray_image_mesh_domain_3` is deprecated since CGAL-4.13, in favor of the class template `Labeled_mesh_domain_3` and diff --git a/Mesh_3/doc/Mesh_3/CGAL/IO/File_medit.h b/Mesh_3/doc/Mesh_3/CGAL/IO/File_medit.h index e50566add7b..69966bf22b5 100644 --- a/Mesh_3/doc/Mesh_3/CGAL/IO/File_medit.h +++ b/Mesh_3/doc/Mesh_3/CGAL/IO/File_medit.h @@ -1,6 +1,6 @@ namespace CGAL { -/// \ingroup PkgMesh_3IOFunctions +/// \ingroup PkgMesh3IOFunctions /// /// \brief Outputs a mesh complex to the medit (`.mesh`) file format. /// See \cgalCite{frey:inria-00069921} for a comprehensive description of this file format. diff --git a/Mesh_3/doc/Mesh_3/CGAL/IO/facets_in_complex_3_to_triangle_mesh.h b/Mesh_3/doc/Mesh_3/CGAL/IO/facets_in_complex_3_to_triangle_mesh.h index 8864ad40203..b672d4d3273 100644 --- a/Mesh_3/doc/Mesh_3/CGAL/IO/facets_in_complex_3_to_triangle_mesh.h +++ b/Mesh_3/doc/Mesh_3/CGAL/IO/facets_in_complex_3_to_triangle_mesh.h @@ -1,5 +1,5 @@ namespace CGAL { -//! \ingroup PkgMesh_3Functions +//! \ingroup PkgMesh3Functions //! //! \brief builds a `TriangleMesh` from the surface facets, with a consistent orientation at the interface of two subdomains. //! diff --git a/Mesh_3/doc/Mesh_3/CGAL/Image_3.h b/Mesh_3/doc/Mesh_3/CGAL/Image_3.h index b973c7d2632..db38404cc9d 100644 --- a/Mesh_3/doc/Mesh_3/CGAL/Image_3.h +++ b/Mesh_3/doc/Mesh_3/CGAL/Image_3.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgMesh_3Domains +\ingroup PkgMesh3Domains The class `Image_3` is a C++ wrapper around the InrImage library. It holds a diff --git a/Mesh_3/doc/Mesh_3/CGAL/Implicit_mesh_domain_3.h b/Mesh_3/doc/Mesh_3/CGAL/Implicit_mesh_domain_3.h index a8dc87d0ea6..904d18d0e97 100644 --- a/Mesh_3/doc/Mesh_3/CGAL/Implicit_mesh_domain_3.h +++ b/Mesh_3/doc/Mesh_3/CGAL/Implicit_mesh_domain_3.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgMesh_3Domains +\ingroup PkgMesh3Domains \deprecated The class template `Implicit_mesh_domain_3` is deprecated since CGAL-4.13, in favor of the class template `Labeled_mesh_domain_3` and diff --git a/Mesh_3/doc/Mesh_3/CGAL/Implicit_to_labeling_function_wrapper.h b/Mesh_3/doc/Mesh_3/CGAL/Implicit_to_labeling_function_wrapper.h index f6b3601a71f..6446729e1c5 100644 --- a/Mesh_3/doc/Mesh_3/CGAL/Implicit_to_labeling_function_wrapper.h +++ b/Mesh_3/doc/Mesh_3/CGAL/Implicit_to_labeling_function_wrapper.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgMesh_3Domains +\ingroup PkgMesh3Domains The class `Implicit_multi_domain_to_labeling_function_wrapper` is a helping class to get a function with integer values labeling the components of a multi-domain. The multidomain is described through a set of functions {fi(p), i=1, ...n}. diff --git a/Mesh_3/doc/Mesh_3/CGAL/Labeled_image_mesh_domain_3.h b/Mesh_3/doc/Mesh_3/CGAL/Labeled_image_mesh_domain_3.h index 0aa10bb88a8..d23791874ac 100644 --- a/Mesh_3/doc/Mesh_3/CGAL/Labeled_image_mesh_domain_3.h +++ b/Mesh_3/doc/Mesh_3/CGAL/Labeled_image_mesh_domain_3.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgMesh_3Domains +\ingroup PkgMesh3Domains \deprecated The class template `Labeled_image_mesh_domain_3` is deprecated since CGAL-4.13, in favor of the class template `Labeled_mesh_domain_3` and diff --git a/Mesh_3/doc/Mesh_3/CGAL/Labeled_mesh_domain_3.h b/Mesh_3/doc/Mesh_3/CGAL/Labeled_mesh_domain_3.h index 26720eb2cc9..399abd9a027 100644 --- a/Mesh_3/doc/Mesh_3/CGAL/Labeled_mesh_domain_3.h +++ b/Mesh_3/doc/Mesh_3/CGAL/Labeled_mesh_domain_3.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgMesh_3Domains +\ingroup PkgMesh3Domains \brief The class `Labeled_mesh_domain_3` implements indexed domains. diff --git a/Mesh_3/doc/Mesh_3/CGAL/Mesh_cell_base_3.h b/Mesh_3/doc/Mesh_3/CGAL/Mesh_cell_base_3.h index 6d4171492d2..f2166607f7d 100644 --- a/Mesh_3/doc/Mesh_3/CGAL/Mesh_cell_base_3.h +++ b/Mesh_3/doc/Mesh_3/CGAL/Mesh_cell_base_3.h @@ -3,7 +3,7 @@ namespace CGAL { /*! -\ingroup PkgMesh_3MeshClasses +\ingroup PkgMesh3MeshClasses ambiguous -#endif //CGAL_COREFINEMENT_POLYHEDRA_DEBUG - - CGAL_assertion( - ( index_p1 == -1 ? nodes.to_exact(get(ppmap,P1)): nodes.exact_node(index_p1) ) != - ( index_q1 == -1 ? nodes.to_exact(get(ppmap,Q1)): nodes.exact_node(index_q1) ) - && - ( index_p2 == -1 ? nodes.to_exact(get(ppmap,P2)): nodes.exact_node(index_p2) ) != - ( index_q1 == -1 ? nodes.to_exact(get(ppmap,Q1)): nodes.exact_node(index_q1) ) - && - ( index_p1 == -1 ? nodes.to_exact(get(ppmap,P1)): nodes.exact_node(index_p1) ) != - ( index_q2 == -1 ? nodes.to_exact(get(ppmap,Q2)): nodes.exact_node(index_q2) ) - && - ( index_p2 == -1 ? nodes.to_exact(get(ppmap,P2)): nodes.exact_node(index_p2) ) != - ( index_q2 == -1 ? nodes.to_exact(get(ppmap,Q2)): nodes.exact_node(index_q2) ) - ); - - bool Q1_is_between_P1P2 = OOP::sorted_around_edge_filtered(indices.first,indices.second,index_p1,index_p2,index_q1,P1,P2,Q1,nodes,ppmap); - bool Q2_is_between_P1P2 = OOP::sorted_around_edge_filtered(indices.first,indices.second,index_p1,index_p2,index_q2,P1,P2,Q2,nodes,ppmap); - - if ( Q1_is_between_P1P2 ){ - is_patch_inside_P.set(patch_id_q1); - if( Q2_is_between_P1P2 ) - { - is_patch_inside_P.set(patch_id_q2); - bool P1_is_between_Q1Q2 = OOP::sorted_around_edge_filtered(indices.first,indices.second,index_q1,index_q2,index_p1,Q1,Q2,P1,nodes,ppmap); - if (!P1_is_between_Q1Q2){ - // case (a4) - // poly_first - poly_second = P1Q1 U Q2P2 - // poly_second - poly_first = {0} - // poly_first \cap poly_second = Q1Q2 - // opposite( poly_first U poly_second ) = P2P1 - impossible_operation.set(P_MINUS_Q); // P-Q is non-manifold - } - else{ - // case (b4) - // poly_first - poly_second = Q2Q1 - // poly_second - poly_first = P2P1 - // poly_first \cap poly_second = P1Q2 U Q1P2 - // opposite( poly_first U poly_second ) = {O} - is_patch_inside_Q.set(patch_id_p1); - is_patch_inside_Q.set(patch_id_p2); - impossible_operation.set(P_INTER_Q); // P \cap Q is non-manifold - } - } - else - { - //case (c4) - // poly_first - poly_second = P1Q1 - // poly_second - poly_first = P2Q2 - // poly_first \cap poly_second = Q1P2 - // opposite( poly_first U poly_second ) = Q2P1 - if ( is_dangling_edge(indices.first, indices.second, first_hedge, is_node_of_degree_one) || - is_dangling_edge(indices.first, indices.second, second_hedge, is_node_of_degree_one) ) - { - impossible_operation.set(); - return; - } - is_patch_inside_Q.set(patch_id_p2); - } - } - else - { - if( Q2_is_between_P1P2 ) - { - //case (d4) - // poly_first - poly_second = Q2P2 - // poly_second - poly_first = Q1P1 - // poly_first \cap poly_second = P1Q2 - // opposite( poly_first U poly_second ) = P2Q1 - if ( is_dangling_edge(indices.first, indices.second, first_hedge, is_node_of_degree_one) || - is_dangling_edge(indices.first, indices.second, second_hedge, is_node_of_degree_one) ) - { - impossible_operation.set(); - return; - } - is_patch_inside_P.set(patch_id_q2); - is_patch_inside_Q.set(patch_id_p1); - } - else - { - bool P1_is_between_Q1Q2 = OOP::sorted_around_edge_filtered(indices.first,indices.second,index_q1,index_q2,index_p1,Q1,Q2,P1,nodes,ppmap); - if (!P1_is_between_Q1Q2){ - //case (e4) - // poly_first - poly_second = P1P2 - // poly_second - poly_first = Q1Q2 - // poly_first \cap poly_second = {0} - // opposite( poly_first U poly_second ) = P2Q1 U Q2P1 - impossible_operation.set(P_UNION_Q); // P U Q is non-manifold - } - else{ - //case (f4) - is_patch_inside_Q.set(patch_id_p1); - is_patch_inside_Q.set(patch_id_p2); - // poly_first - poly_second = {0} - // poly_second - poly_first = Q1P1 U P2Q2 - // poly_first \cap poly_second = P1P2 - // opposite( poly_first U poly_second ) = Q2Q1 - impossible_operation.set(Q_MINUS_P); // Q - P is non-manifold - } - } - } - } - } - - -/////////////////////////////////////////////// -//////////////////////END////////////////////// -/////////////////////////////////////////////// - - // (2-b) Classify isolated surface patches wrt the other support polyhedron -#ifdef CGAL_COREFINEMENT_POLYHEDRA_DEBUG - #warning this does not work with open polyhedra - #warning this should not be done if we have surfaces with boundaries!!! ask the user a flag? -#endif //CGAL_COREFINEMENT_POLYHEDRA_DEBUG - typedef Side_of_triangle_mesh Inside_poly_test; - -#ifdef CGAL_COREFINEMENT_POLYHEDRA_DEBUG - #warning stop using next_marked_halfedge_around_target_vertex and create lists of halfedges instead? -#endif - - if ( patch_status_not_set_P.any() ) - { - CGAL::Bounded_side in_Q = is_Q_inside_out ? ON_UNBOUNDED_SIDE : ON_BOUNDED_SIDE; - - Inside_poly_test inside_Q(*Q_ptr, ppmap); - for (typename Polyhedron::Face_iterator fit=P_ptr->facets_begin(), - fit_end=P_ptr->facets_end(); - fit!=fit_end; ++fit) - { - std::size_t patch_id=P_patch_ids[ get(P_facet_id_pmap, fit) ]; - if ( patch_status_not_set_P.test( patch_id ) ) - { - patch_status_not_set_P.reset( patch_id ); - CGAL::Bounded_side position = inside_Q( get(ppmap,fit->halfedge()->vertex()) ); - if ( position == in_Q ) - is_patch_inside_Q.set(patch_id); - else - if ( position == ON_BOUNDARY ) - { - if (coplanar_facets_P.test(get(P_facet_id_pmap, fit))) - { - coplanar_patches_of_P.set(patch_id); - coplanar_patches_of_P_for_union_and_intersection.set(patch_id); - } - else - { - Vertex_handle vn = fit->halfedge()->opposite()->vertex(); - Bounded_side other_position = inside_Q( get(ppmap, vn) ); - if (other_position==ON_BOUNDARY) - { - // \todo improve this part which is not robust with a kernel with inexact constructions. - other_position = inside_Q(midpoint(get(ppmap, vn), - get(ppmap, fit->halfedge()->vertex()) )); - } - if ( other_position == in_Q ) - is_patch_inside_Q.set(patch_id); - } - } - - if ( patch_status_not_set_P.none() ) break; - } - } - } - - if ( patch_status_not_set_Q.any() ) - { - CGAL::Bounded_side in_P = is_P_inside_out ? ON_UNBOUNDED_SIDE : ON_BOUNDED_SIDE; - - Inside_poly_test inside_P(*P_ptr, ppmap); - for (typename Polyhedron::Face_iterator fit=Q_ptr->facets_begin(), - fit_end=Q_ptr->facets_end(); - fit!=fit_end; ++fit) - { - std::size_t patch_id=Q_patch_ids[ get(Q_facet_id_pmap, fit) ]; - if ( patch_status_not_set_Q.test( patch_id ) ) - { - patch_status_not_set_Q.reset( patch_id ); - Bounded_side position = inside_P( get(ppmap,fit->halfedge()->vertex()) ); - if ( position == in_P ) - is_patch_inside_P.set(patch_id); - else - if ( position == ON_BOUNDARY ) - { - if (coplanar_facets_Q.test(get(Q_facet_id_pmap, fit))) - { - coplanar_patches_of_Q.set(patch_id); - coplanar_patches_of_Q_for_union_and_intersection.set(patch_id); - } - else - { - Vertex_handle vn = fit->halfedge()->opposite()->vertex(); - Bounded_side other_position = inside_P( get(ppmap, vn) ); - if (other_position==ON_BOUNDARY) - { - // \todo improve this part which is not robust with a kernel with inexact constructions. - other_position = inside_P(midpoint(get(ppmap, vn), - get(ppmap, fit->halfedge()->vertex()) )); - } - if ( other_position == in_P ) - is_patch_inside_P.set(patch_id); - } - } - if ( patch_status_not_set_Q.none() ) break; - } - } - } - - /// \todo There might be some patches for which the status is unknown, we need to use - /// for example the centroid of the facet to decide, but this would require an exact - /// inside-polyhedron object or to work with points at endpoints of the intervals. - /// See SL_TMP_ASSERT - //to maintain a polyhedron halfedge on each polyline + pair - //with first = "is the key (pair) was reversed?" and second is the number of edges +1 in the polyline - //typedef std::map< std::pair, std::pair< std::map,std::pair > > An_edge_per_polyline_map; - -#ifdef CGAL_COREFINEMENT_POLYHEDRA_DEBUG - #warning add a mechanism to handle the patches independantly (for example calculating the volume without building the polyhedron) \ - This can be done by using a functor to which we give the bitset, the polyhedra and one facet per patch? -#endif // CGAL_COREFINEMENT_POLYHEDRA_DEBUG - - #ifdef CGAL_COREFINEMENT_DEBUG - std::cout << "is_patch_inside_Q " << is_patch_inside_Q << "\n"; - std::cout << "is_patch_inside_P " << is_patch_inside_P << "\n"; - std::cout << "coplanar_patches_of_P " << coplanar_patches_of_P << "\n"; - std::cout << "coplanar_patches_of_Q " << coplanar_patches_of_Q << "\n"; - std::cout << "coplanar_patches_of_P_for_union_and_intersection " << coplanar_patches_of_P_for_union_and_intersection << "\n"; - std::cout << "coplanar_patches_of_Q_for_union_and_intersection " << coplanar_patches_of_Q_for_union_and_intersection << "\n"; - std::cout << "Size of patches of P: "; - std::copy(P_patch_sizes.rbegin(), P_patch_sizes.rend(), std::ostream_iterator(std::cout," ") ); - std::cout << "\n"; - std::cout << "Size of patches of Q: "; - std::copy(Q_patch_sizes.rbegin(), Q_patch_sizes.rend(), std::ostream_iterator(std::cout," ") ); - std::cout << "\n"; - #endif - - //backup an halfedge per polyline - std::vector P_polylines, Q_polylines; - std::vector polyline_lengths; - - for (typename An_edge_per_polyline_map::const_iterator - it=an_edge_per_polyline.begin(), - it_end=an_edge_per_polyline.end(); - it!=it_end;++it) - { - const std::pair& polyline_info=it->second.second; - - Halfedge_handle qhedge = it->second.first.find( Q_ptr )->second; - Halfedge_handle phedge = it->second.first.find( P_ptr )->second; - - if( polyline_info.first ){ - phedge=phedge->opposite(); - qhedge=qhedge->opposite(); - } - - P_polylines.push_back(phedge); - Q_polylines.push_back(qhedge); - polyline_lengths.push_back(polyline_info.second+1); - } - - //store the patch description in a container to avoid recomputing it several times - Patch_container patches_of_P( P_ptr, P_patch_ids, P_facet_id_pmap, border_halfedges, P_nb_patches), - patches_of_Q( Q_ptr, Q_patch_ids, Q_facet_id_pmap, border_halfedges, Q_nb_patches); - - // for each boolean operation, define two bitsets of patches contributing - // to the result - std::vector< boost::dynamic_bitset<> > patches_of_P_used(4); - std::vector< boost::dynamic_bitset<> > patches_of_Q_used(4); - - /// handle the bitset for the union - if ( !impossible_operation.test(P_UNION_Q) && desired_output[P_UNION_Q] ) - { - //define patches to import from P - patches_of_P_used[P_UNION_Q] = ~is_patch_inside_Q - coplanar_patches_of_P; - //define patches to import from Q - patches_of_Q_used[P_UNION_Q] = ~is_patch_inside_P - coplanar_patches_of_Q; - //handle coplanar patches - if (coplanar_patches_of_P.any()) - { - if (desired_output[P_UNION_Q]==Q_ptr) - patches_of_Q_used[P_UNION_Q] |= coplanar_patches_of_Q_for_union_and_intersection; - else - patches_of_P_used[P_UNION_Q] |= coplanar_patches_of_P_for_union_and_intersection; - } - } - - /// handle the bitset for the intersection - if ( !impossible_operation.test(P_INTER_Q) && desired_output[P_INTER_Q] ) - { - //define patches to import from P - patches_of_P_used[P_INTER_Q] = is_patch_inside_Q; - //define patches to import from Q - patches_of_Q_used[P_INTER_Q] = is_patch_inside_P; - //handle coplanar patches - if (coplanar_patches_of_P.any()) - { - if (desired_output[P_INTER_Q]==Q_ptr) - patches_of_Q_used[P_INTER_Q] |= coplanar_patches_of_Q_for_union_and_intersection; - else - patches_of_P_used[P_INTER_Q] |= coplanar_patches_of_P_for_union_and_intersection; - } - } - - /// handle the bitset for P-Q - if ( !impossible_operation.test(P_MINUS_Q) && desired_output[P_MINUS_Q] ) - { - //define patches to import from P - patches_of_P_used[P_MINUS_Q] = (~is_patch_inside_Q - coplanar_patches_of_P); - //define patches to import from Q - patches_of_Q_used[P_MINUS_Q] = is_patch_inside_P; - //handle coplanar patches - if (coplanar_patches_of_P.any()) - { - if (desired_output[P_MINUS_Q]==Q_ptr) - patches_of_Q_used[P_MINUS_Q] |= ~coplanar_patches_of_Q_for_union_and_intersection & coplanar_patches_of_Q; - else - patches_of_P_used[P_MINUS_Q] |= ~coplanar_patches_of_P_for_union_and_intersection & coplanar_patches_of_P; - } - } - - /// handle the bitset for Q-P - if ( !impossible_operation.test(Q_MINUS_P) && desired_output[Q_MINUS_P] ) - { - //define patches to import from P - patches_of_P_used[Q_MINUS_P] = is_patch_inside_Q; - //define patches to import from Q - patches_of_Q_used[Q_MINUS_P] = ~is_patch_inside_P - coplanar_patches_of_Q; - //handle coplanar patches - if (coplanar_patches_of_P.any()) - { - if (desired_output[Q_MINUS_P]==Q_ptr) - patches_of_Q_used[Q_MINUS_P] |= ~coplanar_patches_of_Q_for_union_and_intersection & coplanar_patches_of_Q; - else - patches_of_P_used[Q_MINUS_P] |= ~coplanar_patches_of_P_for_union_and_intersection & coplanar_patches_of_P; - } - } - - #ifdef CGAL_COREFINEMENT_DEBUG - std::cout << "patches_of_P_used[P_UNION_Q] " << patches_of_P_used[P_UNION_Q] << "\n"; - std::cout << "patches_of_Q_used[P_UNION_Q] " << patches_of_Q_used[P_UNION_Q] << "\n"; - std::cout << "patches_of_P_used[P_INTER_Q] " << patches_of_P_used[P_INTER_Q] << "\n"; - std::cout << "patches_of_Q_used[P_INTER_Q] " << patches_of_Q_used[P_INTER_Q] << "\n"; - std::cout << "patches_of_P_used[P_MINUS_Q] " << patches_of_P_used[P_MINUS_Q] << "\n"; - std::cout << "patches_of_Q_used[P_MINUS_Q] " << patches_of_Q_used[P_MINUS_Q] << "\n"; - std::cout << "patches_of_P_used[Q_MINUS_P] " << patches_of_P_used[Q_MINUS_P] << "\n"; - std::cout << "patches_of_Q_used[Q_MINUS_P] " << patches_of_Q_used[Q_MINUS_P] << "\n"; - #endif // CGAL_COREFINEMENT_DEBUG - // Schedule the order in which the different boolean operations should be - // done. First operations are those filling polyhedra different - // from P and Q, then the one modifying P and finally the one - // modifying Q. - std::vector out_of_place_operations; - Boolean_operation inplace_operation_P=NONE, inplace_operation_Q=NONE; - for (int i=0;i<4;++i) - { - Boolean_operation operation=enum_cast(i); - - if (!desired_output[operation] || impossible_operation.test(operation)) - continue; - - if (desired_output[operation]==P_ptr) - inplace_operation_P=operation; - else - if (desired_output[operation]==Q_ptr) - inplace_operation_Q=operation; - else - out_of_place_operations.push_back(operation); - } - - /// first handle operations in a polyhedron that is neither P nor Q - BOOST_FOREACH(Boolean_operation operation, out_of_place_operations) - { - Polyhedron* ouput_ptr = *desired_output[operation]; - CGAL_assertion(P_ptr!=ouput_ptr && Q_ptr!=ouput_ptr); - - Intersection_polylines polylines(P_polylines, Q_polylines, polyline_lengths); - // skip the import of polylines only incident to patch(es) - // not used by the current operation - fill_polylines_to_skip( - polylines, P_patch_ids, Q_patch_ids, - patches_of_P_used[operation], patches_of_Q_used[operation], - P_facet_id_pmap, Q_facet_id_pmap - ); - - std::vector shared_halfedges; - fill_new_polyhedron( - *ouput_ptr, - patches_of_P_used[operation], patches_of_Q_used[operation], - patches_of_P, patches_of_Q, - operation == Q_MINUS_P, operation == P_MINUS_Q, - polylines, - border_halfedges, - std::back_inserter(shared_halfedges) - ); - BOOST_FOREACH(Halfedge_handle h, shared_halfedges){ - put(edge_mark_pmap, std::make_pair(h,ouput_ptr),true); - put(edge_mark_pmap, std::make_pair(h->opposite(),ouput_ptr),true); - } - } - - Edge_map disconnected_patches_hedge_to_Qhedge; - - /// handle the operations updating P and/or Q - if ( inplace_operation_P!=NONE ) - { - CGAL_assertion( *desired_output[inplace_operation_P] == P_ptr ); - - if ( inplace_operation_Q!=NONE) - { - // operation in P with removal (and optinally inside-out) delayed - // First backup the border edges of patches to be used - Patch_container tmp_patches_of_P(P_ptr, - patches_of_P.patch_ids, - patches_of_P.facet_id_pmap, - patches_of_P.border_halfedges, - patches_of_P.patches.size()); - boost::dynamic_bitset<> patches_of_P_removed = ~patches_of_P_used[inplace_operation_P]; - for (std::size_t i = patches_of_P_removed.find_first(); - i < patches_of_P_removed.npos; - i = patches_of_P_removed.find_next(i)) - { - // we are only interested by patch border halfedges so - // squeeze the auto-filling mechanism - tmp_patches_of_P.patches[i].is_initialized=true; - tmp_patches_of_P.patches[i].patch_border_halfedges= - patches_of_P[i].patch_border_halfedges; - } - - Intersection_polylines polylines_in_P( - P_polylines, Q_polylines, polyline_lengths); - Intersection_polylines polylines_in_Q=polylines_in_P; - fill_polylines_to_skip( - polylines_in_P, P_patch_ids, Q_patch_ids, - patches_of_P_used[inplace_operation_P], - patches_of_Q_used[inplace_operation_P], - P_facet_id_pmap, Q_facet_id_pmap); - fill_polylines_to_skip( - polylines_in_Q, P_patch_ids, Q_patch_ids, - patches_of_P_used[inplace_operation_Q], - patches_of_Q_used[inplace_operation_Q], - P_facet_id_pmap, Q_facet_id_pmap); - // force the initialization of the patches of P used - // for the operation in Q before P is modified - for (std::size_t i=patches_of_P_used[inplace_operation_Q].find_first(); - i < patches_of_P_used[inplace_operation_Q].npos; - i = patches_of_P_used[inplace_operation_Q].find_next(i)) - { - patches_of_P[i]; - } - // Operation in P: disconnect patches not use and append the one from Q - compute_inplace_operation_delay_removal_and_insideout( - P_ptr, - patches_of_P_used[inplace_operation_P], patches_of_Q_used[inplace_operation_P], - patches_of_P, patches_of_Q, - inplace_operation_P == P_MINUS_Q || inplace_operation_P == Q_MINUS_P, - polylines_in_P, disconnected_patches_hedge_to_Qhedge); - // Operation in Q: discard patches and append the one from Q - CGAL_assertion( *desired_output[inplace_operation_Q] == Q_ptr ); - compute_inplace_operation( Q_ptr, - patches_of_Q_used[inplace_operation_Q], - patches_of_P_used[inplace_operation_Q], - patches_of_Q, patches_of_P, - inplace_operation_Q==P_MINUS_Q, - inplace_operation_Q==Q_MINUS_P, - disconnected_patches_hedge_to_Qhedge); - // remove polylines only on the border of patches not kept in Q - if (polylines_in_Q.to_skip.any()) - remove_unused_polylines(Q_ptr, - ~patches_of_Q_used[inplace_operation_Q], - patches_of_Q); - // now remove patches temporarily kept in P - remove_disconnected_patches(*P_ptr, patches_of_P, patches_of_P_removed); - // remove polylines only on the border of patches not kept in P - if (polylines_in_P.to_skip.any()) - remove_unused_polylines(P_ptr, - ~patches_of_P_used[inplace_operation_P], - tmp_patches_of_P); - // finally reverse orientation of P if needed - if (inplace_operation_P == Q_MINUS_P) - CGAL::Polygon_mesh_processing::reverse_face_orientations(*P_ptr); - } - else{ - /// handle the operation updating only P - CGAL_assertion( *desired_output[inplace_operation_P] == P_ptr ); - Intersection_polylines polylines( - P_polylines, Q_polylines, polyline_lengths); - fill_polylines_to_skip( - polylines, P_patch_ids, Q_patch_ids, - patches_of_P_used[inplace_operation_P], - patches_of_Q_used[inplace_operation_P], - P_facet_id_pmap, Q_facet_id_pmap - ); - - compute_inplace_operation( - P_ptr, - patches_of_P_used[inplace_operation_P], - patches_of_Q_used[inplace_operation_P], - patches_of_P, patches_of_Q, - inplace_operation_P == Q_MINUS_P, - inplace_operation_P == P_MINUS_Q, - polylines - ); - // remove polylines only on the border of patches not kept - if (polylines.to_skip.any()) - remove_unused_polylines(P_ptr, - ~patches_of_P_used[inplace_operation_P], - patches_of_P); - } - } - else - if ( inplace_operation_Q!=NONE ) - { - /// handle the operation updating only Q - CGAL_assertion( *desired_output[inplace_operation_Q] == Q_ptr ); - Intersection_polylines polylines( - Q_polylines, P_polylines, polyline_lengths); - fill_polylines_to_skip( - polylines, Q_patch_ids, P_patch_ids, - patches_of_Q_used[inplace_operation_Q], - patches_of_P_used[inplace_operation_Q], - Q_facet_id_pmap, P_facet_id_pmap - ); - - compute_inplace_operation( Q_ptr, - patches_of_Q_used[inplace_operation_Q], - patches_of_P_used[inplace_operation_Q], - patches_of_Q, patches_of_P, - inplace_operation_Q==P_MINUS_Q, - inplace_operation_Q==Q_MINUS_P, - polylines); - - // remove polylines only on the border of patches not kept - if (polylines.to_skip.any()) - remove_unused_polylines(Q_ptr, - ~patches_of_Q_used[inplace_operation_Q], - patches_of_Q); - } - } -}; - -} } // end of namespace CGAL::Corefinement - -#include - -#endif // CGAL_INTERNAL_COREFINEMENT_POLYHEDRA_OUTPUT_BUILDER_H diff --git a/Operations_on_polyhedra/include/CGAL/internal/corefinement/Polyhedron_constness_types.h b/Operations_on_polyhedra/include/CGAL/internal/corefinement/Polyhedron_constness_types.h deleted file mode 100644 index 9c76535af3a..00000000000 --- a/Operations_on_polyhedra/include/CGAL/internal/corefinement/Polyhedron_constness_types.h +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) 2011 GeometryFactory (France). -// All rights reserved. -// -// This file is part of CGAL (www.cgal.org). -// You can redistribute it and/or modify it under the terms of the GNU -// General Public License as published by the Free Software Foundation, -// either version 3 of the License, or (at your option) any later version. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -// -// $URL$ -// $Id$ -// SPDX-License-Identifier: GPL-3.0+ -// -// -// Author(s) : Sebastien Loriot - -#ifndef CGAL_INTERNAL_POLYHEDRON_CONSTNESS_TYPES_H -#define CGAL_INTERNAL_POLYHEDRON_CONSTNESS_TYPES_H - -#include - - -namespace CGAL { -namespace internal_IOP{ - -template -struct Polyhedron_types; - -template -struct Polyhedron_types{ - typedef Polyhedron& Polyhedron_ref; - typedef typename Polyhedron::Halfedge_handle Halfedge_handle; - typedef typename Polyhedron::Halfedge_iterator Halfedge_iterator; - typedef typename Polyhedron::Facet_iterator Facet_iterator; - typedef typename Polyhedron::Facet_handle Facet_handle; - typedef typename Polyhedron::Vertex_handle Vertex_handle; - typedef typename Polyhedron::Vertex Vertex; - typedef typename Polyhedron::Halfedge Halfedge; - typedef typename Polyhedron::Facet Facet; -}; - -template -struct Polyhedron_types{ - typedef const Polyhedron& Polyhedron_ref; - typedef typename Polyhedron::Halfedge_const_handle Halfedge_handle; - typedef typename Polyhedron::Halfedge_const_iterator Halfedge_iterator; - typedef typename Polyhedron::Facet_const_iterator Facet_iterator; - typedef typename Polyhedron::Facet_const_handle Facet_handle; - typedef typename Polyhedron::Vertex_const_handle Vertex_handle; - typedef const typename Polyhedron::Vertex Vertex; - typedef const typename Polyhedron::Halfedge Halfedge; - typedef const typename Polyhedron::Facet Facet; -}; - -#include -#include -#include - -template -struct Polyhedron_types_with_mpl -{ - typedef typename boost::remove_const::type Polyhedron; - typedef typename boost::mpl::if_< boost::is_const, - typename Polyhedron::Face_const_handle, - typename Polyhedron::Face_handle>::type Face_handle; - typedef typename boost::mpl::if_< boost::is_const, - typename Polyhedron::Face_const_iterator, - typename Polyhedron::Face_iterator>::type Face_iterator; - typedef typename boost::mpl::if_< boost::is_const, - typename Polyhedron::Halfedge_const_handle, - typename Polyhedron::Halfedge_handle>::type Halfedge_handle; - typedef Face_handle Facet_handle; - typedef Face_iterator Facet_iterator; -}; - -} } //namespace CGAL::internal_IOP - -#endif //CGAL_INTERNAL_POLYHEDRON_CONSTNESS_TYPES_H diff --git a/Operations_on_polyhedra/include/CGAL/internal/corefinement/connected_components.h b/Operations_on_polyhedra/include/CGAL/internal/corefinement/connected_components.h deleted file mode 100644 index 324e6e027e8..00000000000 --- a/Operations_on_polyhedra/include/CGAL/internal/corefinement/connected_components.h +++ /dev/null @@ -1,344 +0,0 @@ -// Copyright (c) 2011, 2015 GeometryFactory (France). -// All rights reserved. -// -// This file is part of CGAL (www.cgal.org). -// You can redistribute it and/or modify it under the terms of the GNU -// General Public License as published by the Free Software Foundation, -// either version 3 of the License, or (at your option) any later version. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -// -// $URL$ -// $Id$ -// SPDX-License-Identifier: GPL-3.0+ -// -// -// Author(s) : Sebastien Loriot and Andreas Fabri - -#ifndef CGAL_INTERNAL_POLYHEDRON_SUBSET_EXTRACTION_H -#define CGAL_INTERNAL_POLYHEDRON_SUBSET_EXTRACTION_H - -#include - - -#include -#include - -#include - -#include -#include - -#include -#include -#include -#include -#include - -namespace CGAL { - namespace internal{ - namespace corefinement{ - -template -struct Compare_handle_ptr{ - typedef typename Polyhedron::Facet_const_handle Facet_const_handle; - typedef typename Polyhedron::Vertex_const_handle Vertex_const_handle; - - bool operator()(Facet_const_handle f1,Facet_const_handle f2) const { - return &(*f1) < &(*f2); - } - - bool operator()(Vertex_const_handle v1,Vertex_const_handle v2) const { - return &(*v1) < &(*v2); - } -}; - -struct Dummy_true{ - template - bool operator()(T) const {return true;} -}; - -template -class Build_polyhedron_subset : public ::CGAL::Modifier_base { - typedef typename Polyhedron::Facet_const_handle Facet_const_handle; - typedef typename Polyhedron::Vertex_const_handle Vertex_const_handle; - typedef typename Polyhedron::Halfedge_const_handle Halfedge_const_handle; - - typedef typename HDS::Vertex::Point Point; - std::list points; - std::list< std::vector > facets; - - template - typename Polyhedron::Halfedge_const_handle get_facet_halfedge(Facet_iterator facet_it) const - { - return (*facet_it)->halfedge(); - } - - typename Polyhedron::Halfedge_const_handle get_facet_halfedge(typename Polyhedron::Facet_const_handle facet) const - { - return facet->halfedge(); - } - -public: - template - Build_polyhedron_subset(const Polyhedron&,Facets_const_iterator begin,Facets_const_iterator end) - { - typedef std::map > Vertices; - Vertices vertices; - unsigned int index=0; - //get vertices and get face description relatively to the restricted set of vertices - for (Facets_const_iterator it=begin;it!=end;++it) - { - Halfedge_const_handle start=get_facet_halfedge(it); - Halfedge_const_handle curr=start; - facets.push_back(std::vector()); - std::vector& indices = facets.back(); - do{ - bool is_new_vertex; - typename Vertices::iterator it_vertex; - ::CGAL::cpp11::tie(it_vertex,is_new_vertex)=vertices.insert(std::make_pair(curr->vertex(),index)); - if (is_new_vertex) { - ++index; - points.push_back(curr->vertex()); - } - indices.push_back(it_vertex->second); - curr=curr->next(); - }while(curr!=start); - } - } - - void operator()( HDS& hds) { - ::CGAL::Polyhedron_incremental_builder_3 B( hds, true); - B.begin_surface( points.size(), facets.size() ); - for (typename std::list::iterator it=points.begin();it!=points.end();++it) - B.add_vertex((*it)->point()); - for (typename std::list< std::vector >::iterator - it=facets.begin();it!=facets.end();++it) - { - B.begin_facet(); - for (std::vector::iterator it_i=it->begin();it_i!=it->end();++it_i) - B.add_vertex_to_facet(*it_i); - B.end_facet(); - } - B.end_surface(); - } -}; - - - -template -void extract_connected_components( - Polyhedron& P, - const Adjacency_criterium& adjacent, - CGAL::Union_find::Facet_handle>& uf, - Face_to_UF_handle_map& map_f2h, - Result& result - ) -{ - typedef typename internal_IOP::Polyhedron_types_with_mpl::Facet_handle Facet_handle; - typedef typename internal_IOP::Polyhedron_types_with_mpl::Facet_iterator Facet_iterator; - typedef typename internal_IOP::Polyhedron_types_with_mpl::Halfedge_handle Halfedge_handle; - typedef ::CGAL::Union_find UF; - typedef typename UF::handle UF_handle; - typedef typename UF::iterator UF_iterator; - -//init union-find: each facet is in its own set - for (Facet_iterator it=P.facets_begin();it!=P.facets_end();++it){ - map_f2h.insert(std::make_pair(it,uf.make_set(it))); - } -//merge 2 facets if they share a common edge - for (Facet_iterator it=P.facets_begin();it!=P.facets_end();++it){ - Facet_handle facet=it; - - UF_handle current=map_f2h.find(it)->second; - std::vector neighbors; - Halfedge_handle hedge=facet->halfedge(); - do - { - neighbors.push_back( hedge->opposite() ); - hedge=hedge->next(); - } - while(hedge!=facet->halfedge()); - - std::size_t nb_edges=neighbors.size(); - for (std::size_t i=0;iis_border() ) continue; - UF_handle neigh=map_f2h.find(neighbors[i]->facet())->second; - if ( adjacent(neighbors[i]) && !uf.same_set(current,neigh) ){ - uf.unify_sets(current,neigh); - } - } - } - -//recover merged sets - for (UF_iterator it=uf.begin();it!=uf.end();++it){ - UF_handle master=uf.find(it); - result[*master].push_back(*it); - } -} - -template -void extract_connected_components(const Polyhedron& P,const Adjacency_criterium& adjacent,Output_iterator out) -{ - typedef typename Polyhedron::Facet_const_handle Facet_const_handle; - typedef ::CGAL::Union_find UF; - typedef typename UF::handle UF_handle; - typedef std::map,Compare_handle_ptr > Result; - typedef std::map > Facet_to_handle_map; - - UF uf; - Facet_to_handle_map map_f2h; - Result result; - - extract_connected_components(P,adjacent,uf,map_f2h,result); - - for (typename Result::iterator it=result.begin();it!=result.end();++it) - { - typedef std::list Facets; - const Facets& facets=it->second; - Polyhedron new_poly; - Build_polyhedron_subset modifier(new_poly,facets.begin(),facets.end()); - new_poly.delegate(modifier); - *out++=new_poly; - } -} - -template -void mark_connected_components(Polyhedron& P, const Adjacency_criterium& adjacent, Face_marker& face_marker) -{ - typedef typename Polyhedron::Facet_handle Facet_handle; - typedef ::CGAL::Union_find UF; - typedef typename UF::handle UF_handle; - typedef std::map,Compare_handle_ptr > Result; - typedef std::map > Facet_to_handle_map; - - UF uf; - Facet_to_handle_map map_f2h; - Result result; - - extract_connected_components(P,adjacent,uf,map_f2h,result); - - for (typename Result::iterator it=result.begin();it!=result.end();++it) - { - face_marker.start_new_connected_component(); - typedef std::list Facets; - const Facets& facets=it->second; - face_marker.mark(facets.begin(),facets.end()); - } -} - -template -OutputIterator -mark_connected_components(Polyhedron& P, const Adjacency_criterium& adjacent, Face_marker& face_marker, OutputIterator out) -{ - typedef typename Polyhedron::Facet_handle Facet_handle; - typedef ::CGAL::Union_find UF; - typedef typename UF::handle UF_handle; - typedef std::map,Compare_handle_ptr > Result; - typedef std::map > Facet_to_handle_map; - - UF uf; - Facet_to_handle_map map_f2h; - Result result; - - extract_connected_components(P,adjacent,uf,map_f2h,result); - - for (typename Result::iterator it=result.begin();it!=result.end();++it) - { - face_marker.start_new_connected_component(); - typedef std::list Facets; - const Facets& facets=it->second; - face_marker.mark(facets.begin(),facets.end()); - *out++=*facets.begin(); - } - return out; -} - -template -void extract_connected_components(const Polyhedron& P,Output_iterator out) -{ - extract_connected_components(P,Dummy_true(),out); -} - -template -std::size_t -init_facet_indices( - const Polyhedron& P, - Polyhedron_facet_index_map facet_index_map) -{ - //init facet indices - std::size_t index=0; - for (typename Polyhedron::Facet_const_iterator fit=P.facets_begin(), - fit_end=P.facets_end(); - fit!=fit_end; ++fit) - { - put(facet_index_map, fit, index++); - } - return index; -} - -// alternative method by propagation -template -std::size_t -mark_connected_components_v2( - const Polyhedron& P, - const Adjacency_criterium& adjacent, - Polyhedron_facet_index_map facet_index_map, - std::vector& patch_ids, - std::vector& patch_sizes) -{ - typedef typename Polyhedron::Halfedge_const_handle Halfedge_handle; - - std::size_t max_id=(std::numeric_limits::max)(); - patch_ids.clear(); - patch_ids.resize(P.size_of_facets(), max_id); - - //traversal of the facets to discover connected components - std::size_t patch_id=0; - for (typename Polyhedron::Facet_const_iterator fit=P.facets_begin(), - fit_end=P.facets_end(); - fit!=fit_end; ++fit) - { - std::size_t index=get(facet_index_map, fit); - if ( patch_ids[index]==max_id ) - { - patch_sizes.push_back(0); - patch_ids[index]=patch_id;// set patch id - ++(patch_sizes.back()); - std::vector queue; - if ( adjacent(fit->halfedge()) ) - queue.push_back( fit->halfedge()->opposite() ); - if ( adjacent(fit->halfedge()->next()) ) - queue.push_back( fit->halfedge()->next()->opposite() ); - if ( adjacent(fit->halfedge()->next()->next()) ) - queue.push_back( fit->halfedge()->next()->next()->opposite() ); - while (!queue.empty()) - { - Halfedge_handle h=queue.back(); - queue.pop_back(); - index=get(facet_index_map, h->facet()); - if ( patch_ids[index]!=max_id ) continue; - patch_ids[index]=patch_id; - ++(patch_sizes.back()); - if ( adjacent(h->next()) ) - queue.push_back( h->next()->opposite() ); - if ( adjacent(h->next()->next()) ) - queue.push_back( h->next()->next()->opposite() ); - } - ++patch_id; - } - } - - return patch_id; -} - -} } // end of namespace internal::corefinement - - -} // namespace CGAL - -#endif //CGAL_INTERNAL_POLYHEDRON_SUBSET_EXTRACTION_H diff --git a/Operations_on_polyhedra/include/CGAL/internal/corefinement/intersection_coplanar_triangles_3.h b/Operations_on_polyhedra/include/CGAL/internal/corefinement/intersection_coplanar_triangles_3.h deleted file mode 100644 index eb4136ef265..00000000000 --- a/Operations_on_polyhedra/include/CGAL/internal/corefinement/intersection_coplanar_triangles_3.h +++ /dev/null @@ -1,334 +0,0 @@ -// Copyright (c) 2011 GeometryFactory (France). -// All rights reserved. -// -// This file is part of CGAL (www.cgal.org). -// You can redistribute it and/or modify it under the terms of the GNU -// General Public License as published by the Free Software Foundation, -// either version 3 of the License, or (at your option) any later version. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -// -// $URL$ -// $Id$ -// SPDX-License-Identifier: GPL-3.0+ -// -// -// Author(s) : Sebastien Loriot - -#ifndef CGAL_INTERNAL_INTERSECTION_COPLANAR_TRIANGLES_3_H -#define CGAL_INTERNAL_INTERSECTION_COPLANAR_TRIANGLES_3_H - -#include - - -#include //for Intersection_type -#include -#include -#include - -//TODO rename this file when doing proper integration -namespace CGAL{ -namespace internal_IOP{ - - -//intersection point of two coplanar triangles that keeps track of -//the location of that point onto the triangles. -template -struct Intersection_point_with_info -{ - typedef CGAL::Exact_predicates_exact_constructions_kernel Exact_kernel; - typedef IK Input_kernel; - typedef CGAL::Cartesian_converter Converter; - - Intersection_type type_1,type_2; //intersection type for 1st and 2nd facets - Halfedge_handle info_1,info_2; //halfedge providing primitive indicated by type_1 and type_2 - typename Exact_kernel::Point_3 point; //the geometric embedding of the intersection - PolyhedronPointPMap ppmap; // extract the point from a vertex. Only needed to be stored in the class for is_valid - - //constructor from a vertex of first triangle initialized inside the second triangle - Intersection_point_with_info(Halfedge_handle info1,Halfedge_handle info2, PolyhedronPointPMap ppmap): - type_1(VERTEX),type_2(FACET),info_1(info1),info_2(info2),ppmap(ppmap) - { - Converter converter; - point=converter(get(ppmap,info_1->vertex())); - } - - //constructor for intersection of edges. prev and curr are two points on an edge of the first facet (preserving the - //orientation of the facet). This edge is intersected by info2 from the second facet. - // - //The rational is the following: we first check whether curr and prev are on the same edge. I so we create - //an intersection point between two edges. Otherwise, the point is a vertex of the second facet included into - //the first facet. - // - //(V,F) : point initialy constructed - //(V,E) : (V,F) updated by get_orientation_and_update_info_2 (i.e lies on one edge) - //(V,V) : (V,E) updated by get_orientation_and_update_info_2 (i.e lies on two edges) - //(E,E) : created in the following function when prev and curr lie on the same edge - //(E,V) : (E,E) updated by get_orientation_and_update_info_2 (always done as lies on two edges) - //(E,F) : impossible - //(F,V) : detected when curr and prev and not on the same edge - //(F,E) : impossible - //(F,F) : impossible - // - Intersection_point_with_info(Intersection_point_with_info prev,Intersection_point_with_info curr, - Halfedge_handle info1,Halfedge_handle info2, PolyhedronPointPMap ppmap): - type_2(EDGE),info_2(info2),ppmap(ppmap) - { - #ifdef CGAL_DEBUG_COPLANAR_TRIANGLE_INTERSECTION - std::cout << "prev: "; prev.print_debug(); - std::cout << "curr: "; curr.print_debug(); std::cout << std::endl; - #endif //CGAL_DEBUG_COPLANAR_TRIANGLE_INTERSECTION - Converter converter; - if (prev.type_1==VERTEX && prev.info_1->next() == curr.info_1){ - CGAL_assertion(curr.type_1!=FACET); - type_1=EDGE; - info_1=curr.info_1; - } - else{ - if(curr.type_1==VERTEX && prev.info_1 == curr.info_1){ - CGAL_assertion(prev.type_1!=FACET); - type_1=EDGE; - info_1=curr.info_1; - } - else{ - if (curr.type_1==EDGE && prev.type_1==EDGE && curr.info_1==prev.info_1){ - type_1=EDGE; - info_1=curr.info_1; - } - else{ - //curr and prev are not on the same edge of the first facet. - //The intersection point to be computed is a VERTEX of the second facet - type_1=FACET; - info_1=info1; - type_2=VERTEX; - - //this is used to select the correct endpoint of the edge of the second facet - typename Exact_kernel::Collinear_3 is_collinear = Exact_kernel().collinear_3_object(); - if ( !is_collinear(prev.point,curr.point,converter(get(ppmap,info_2->vertex()) ) ) ){ - info_2=info_2->next()->next(); - CGAL_assertion( is_collinear(prev.point,curr.point,converter(get(ppmap,info_2->vertex())) ) ); - } - point = converter( get(ppmap, info_2->vertex()) ); - return; - } - } - } - - //handle degenerate case when two edges overlap - //at least one of the two vertex has already been found as a vertex of a facet. Here we set it for the second point - if(prev.type_2!=FACET && curr.type_2!=FACET && (prev.type_1==VERTEX || prev.type_2==VERTEX) && (curr.type_1==VERTEX || curr.type_2==VERTEX)){ - typename Exact_kernel::Collinear_3 is_collinear = Exact_kernel().collinear_3_object(); - if ( is_collinear(prev.point,curr.point,converter(get(ppmap, info_2->opposite()->vertex())) ) ){ - info_2=info_2->next()->next(); - type_2=VERTEX; - point = converter( get(ppmap, info_2->vertex()) ); - return; - } - if ( is_collinear(prev.point,curr.point,converter(get(ppmap, info_2->vertex())) ) ){ - type_2=VERTEX; - point = converter( get(ppmap, info_2->vertex()) ); - return; - } - } - - //handle regular intersection of two edges - typename Exact_kernel::Construct_line_3 line_3=Exact_kernel().construct_line_3_object(); - typename Exact_kernel::Line_3 l1= - line_3(converter(get(ppmap, info_2->vertex())),converter(get(ppmap, info_2->opposite()->vertex()))); - typename Exact_kernel::Line_3 l2=line_3(prev.point,curr.point); - CGAL::Object res=Exact_kernel().intersect_3_object()(l1,l2); - const typename Exact_kernel::Point_3* ptptr=CGAL::object_cast(&res); - CGAL_assertion(ptptr!=NULL); - point=*ptptr; - } - - void print_debug() const{ - std::cout << " ("; - if (type_1==VERTEX) std::cout << "V"; - if (type_1==EDGE) std::cout << "E"; - if (type_1==FACET) std::cout << "F"; - if (type_1==EMPTY) std::cout << "?"; - std::cout << "-" << &(*info_1); - std::cout << ";"; - if (type_2==VERTEX) std::cout << "V"; - if (type_2==EDGE) std::cout << "E"; - if (type_2==FACET) std::cout << "F"; - if (type_2==EMPTY) std::cout << "?"; - std::cout << ")" << "[" << CGAL::to_double(point.x()) << "," << CGAL::to_double(point.y()) << "," << CGAL::to_double(point.z()) << "]"; - } - - int debug_unique_type_int() const{ - int res=0; - switch (type_1){ - case VERTEX: res+=1; break; - case EDGE: res+=3; break; - case FACET: res+=7; break; - default: break; - } - switch (type_2){ - case VERTEX: res+=1; break; - case EDGE: res+=3; break; - case FACET: res+=7; break; - default: break; - } - return res; - } - - bool is_valid(Intersection_type type,Halfedge_handle info){ - bool valid=true; - Converter converter; - switch (type){ - case VERTEX: valid&= converter(get(ppmap, info->vertex()))==point; break; - case EDGE:{ - typename Exact_kernel::Segment_3 seg= - Exact_kernel().construct_segment_3_object()( converter(get(ppmap,info->vertex())), - converter(get(ppmap,info->opposite()->vertex())) ); - valid&= Exact_kernel().has_on_3_object()(seg,point); - } - break; - case FACET:{ - typename Exact_kernel::Coplanar_orientation_3 orient=Exact_kernel().coplanar_orientation_3_object(); - typename Exact_kernel::Point_3 p=converter(get(ppmap,info->vertex())); - typename Exact_kernel::Point_3 q=converter(get(ppmap,info->next()->vertex())); - typename Exact_kernel::Point_3 r=converter(get(ppmap,info->opposite()->vertex())); - valid &= orient(p,q,r,point)==POSITIVE; - valid &= orient(q,r,p,point)==POSITIVE; - valid &= orient(r,p,q,point)==POSITIVE; - } - break; - default: valid=false; - } - return valid; - } - - bool is_valid(){ - return is_valid(type_1,info_1) && is_valid(type_2,info_2); - } - -}; - -template -CGAL::Orientation get_orientation_and_update_info_2(Halfedge_handle h,Inter_pt& p, PolyhedronPointPMap ppmap) -{ - typename Inter_pt::Exact_kernel::Coplanar_orientation_3 orient= - typename Inter_pt::Exact_kernel().coplanar_orientation_3_object(); - typename Inter_pt::Converter converter; - - CGAL::Orientation res = orient(converter(get(ppmap,h->opposite()->vertex())), - converter(get(ppmap,h->vertex())), - converter(get(ppmap,h->next()->vertex())), - p.point); - - if ( (p.type_1==VERTEX || p.type_1==EDGE) && res==COLLINEAR){ - if (p.type_2==FACET){ //detect a case (VERTEX,EDGE) - p.type_2=EDGE; - p.info_2=h; - } - else{ - //detect a case (VERTEX,VERTEX) or (EDGE,VERTEX) - CGAL_assertion(p.type_2==EDGE); - p.type_2=VERTEX; - if (p.info_2->next()!=h){ - CGAL_assertion(h->next()==p.info_2); - p.info_2=h; - } - } - } - - return res; -} - -template -void intersection_coplanar_facets_cutoff(Facet_handle f,std::list& inter_pts,Facet_handle other,PolyhedronPointPMap ppmap) -{ - #ifdef CGAL_DEBUG_COPLANAR_TRIANGLE_INTERSECTION - std::cout << "cutoff: " << f->opposite()->vertex()->point() << " " << f->vertex()->point() << std::endl; - #endif //CGAL_DEBUG_COPLANAR_TRIANGLE_INTERSECTION - if ( inter_pts.empty() ) return; - typedef typename std::list::iterator Iterator; - - std::map orientations; - for (Iterator it=inter_pts.begin();it!=inter_pts.end();++it){ - #ifdef CGAL_DEBUG_COPLANAR_TRIANGLE_INTERSECTION - it->print_debug(); - #endif //CGAL_DEBUG_COPLANAR_TRIANGLE_INTERSECTION - orientations[ &(*it) ]=get_orientation_and_update_info_2(f,*it,ppmap); - } - #ifdef CGAL_DEBUG_COPLANAR_TRIANGLE_INTERSECTION - std::cout << std::endl; - #endif //CGAL_DEBUG_COPLANAR_TRIANGLE_INTERSECTION - - int pt_added=0; - - Inter_pt* prev = &(*boost::prior(inter_pts.end())); - bool inter_pts_size_g_2 = inter_pts.size() > 2; - Iterator stop = inter_pts_size_g_2 ? inter_pts.end() : boost::prior(inter_pts.end()); - for (Iterator it=inter_pts.begin();it!=stop;++it) - { - Inter_pt* curr=&(*it); - if (!inter_pts_size_g_2) std::swap(prev,curr); - Orientation or_prev=orientations[prev],or_curr=orientations[curr]; - if ( (or_prev==POSITIVE && or_curr==NEGATIVE) || (or_prev==NEGATIVE && or_curr==POSITIVE) ) - { - Iterator it_curr = inter_pts_size_g_2 ? it:boost::next(it); - prev=&(* inter_pts.insert( it_curr,Inter_pt(*prev,*curr,other,f,ppmap) ) ); - orientations[prev]=COLLINEAR; - ++pt_added; - } - prev=&(*it); - } - - CGAL_kernel_assertion(pt_added<3); - Iterator it=inter_pts.begin(); - std::size_t nb_interpt=inter_pts.size(); - //this boolean allows to reverse order of intersection points in case there were 3 remaining intersection points - //and the point in the middle was removed. In that case the order must be reversed to preserve the orientations - //of the last edge: - // A---X---B --> AB to be consistent with the other cases this should be BA! - // X---B---A --> BA - // B---A---X --> BA - // - bool should_revert_list=false; - - while(it!=inter_pts.end()) - { - if (orientations[&(*it)]==NEGATIVE){ - inter_pts.erase(it++); - if (--nb_interpt == 2 && it!=inter_pts.end() && boost::next(it)==inter_pts.end()) should_revert_list=true; - } - else - ++it; - } - if (should_revert_list && nb_interpt==2) inter_pts.reverse(); -} - -template -void -intersection_coplanar_facets( - Halfedge_handle f1, - Halfedge_handle f2, - PolyhedronPointPMap ppmap, - std::list >& output ) -{ - typedef Intersection_point_with_info Inter_pt; - output.push_back( Inter_pt(f1,f2,ppmap) ); - output.push_back( Inter_pt(f1->next(),f2,ppmap) ); - output.push_back( Inter_pt(f1->next()->next(),f2,ppmap) ); - - //intersect f2 with the three half planes which intersection defines f1 - intersection_coplanar_facets_cutoff(f2,output,f1,ppmap); - intersection_coplanar_facets_cutoff(f2->next(),output,f1,ppmap); - intersection_coplanar_facets_cutoff(f2->next()->next(),output,f1,ppmap); -} - - - -} } //namespace CGAL::internal_IOP - - -#endif //CGAL_INTERNAL_INTERSECTION_COPLANAR_TRIANGLES_3_H - diff --git a/Operations_on_polyhedra/include/CGAL/internal/corefinement/intersection_triangle_segment_3.h b/Operations_on_polyhedra/include/CGAL/internal/corefinement/intersection_triangle_segment_3.h deleted file mode 100644 index 1a892a9fab0..00000000000 --- a/Operations_on_polyhedra/include/CGAL/internal/corefinement/intersection_triangle_segment_3.h +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright (c) 2011 GeometryFactory (France). -// All rights reserved. -// -// This file is part of CGAL (www.cgal.org). -// You can redistribute it and/or modify it under the terms of the GNU -// General Public License as published by the Free Software Foundation, -// either version 3 of the License, or (at your option) any later version. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -// -// $URL$ -// $Id$ -// SPDX-License-Identifier: GPL-3.0+ -// -// -// Author(s) : Sebastien Loriot - -#ifndef CGAL_INTERNAL_INTERSECTION_TRIANGLE_SEGMENT_3_H -#define CGAL_INTERNAL_INTERSECTION_TRIANGLE_SEGMENT_3_H - -#include - - -//TODO rename this file when doing proper integration -#include -#include -namespace CGAL{ -namespace internal_IOP{ - -enum Intersection_type {FACET,EDGE,VERTEX,EMPTY,COPLNR}; - - -//define shortcut for intersection result types -template -struct Intersection_types{ - typedef typename Polyhedron_types::Halfedge_handle Intersection_info; - typedef cpp11::tuple Intersection_result; -}; - - -template -typename Intersection_types::Intersection_result -find_intersection(const typename Kernel::Point_3& p, const typename Kernel::Point_3& q, - const typename Kernel::Point_3& a, const typename Kernel::Point_3& b, const typename Kernel::Point_3& c, - typename Polyhedron_types::Halfedge_handle /*hh*/, - typename Polyhedron_types::Facet_handle fh, - bool is_vertex_coplanar=false,bool is_vertex_opposite_coplanar=false) -{ - typedef typename Intersection_types::Intersection_info Intersection_info; - typedef typename Intersection_types::Intersection_result Intersection_result; - - Orientation ab=orientation(p,q,a,b); - Orientation bc=orientation(p,q,b,c); - Orientation ca=orientation(p,q,c,a); - - if ( ab==POSITIVE || bc==POSITIVE || ca==POSITIVE ) - return Intersection_result(EMPTY,Intersection_info(),false,false); - - int nb_coplanar=(ab==COPLANAR?1:0) + (bc==COPLANAR?1:0) + (ca==COPLANAR?1:0); - - if ( nb_coplanar==0 ) - return cpp11::make_tuple(FACET,Intersection_info(fh->halfedge()),is_vertex_coplanar,is_vertex_opposite_coplanar); - - if (nb_coplanar==1){ - if (ab==COPLANAR) - return cpp11::make_tuple(EDGE,Intersection_info(fh->halfedge()->next()),is_vertex_coplanar,is_vertex_opposite_coplanar); - if (bc==COPLANAR) - return cpp11::make_tuple(EDGE,Intersection_info(fh->halfedge()->next()->next()),is_vertex_coplanar,is_vertex_opposite_coplanar); - CGAL_assertion(ca==COPLANAR); - return cpp11::make_tuple(EDGE,Intersection_info(fh->halfedge()),is_vertex_coplanar,is_vertex_opposite_coplanar); - } - - CGAL_assertion(nb_coplanar==2); - - if (ab!=COPLANAR) - return cpp11::make_tuple(VERTEX,Intersection_info(fh->halfedge()->next()->next()),is_vertex_coplanar,is_vertex_opposite_coplanar); - if (bc!=COPLANAR) - return cpp11::make_tuple(VERTEX,Intersection_info(fh->halfedge()),is_vertex_coplanar,is_vertex_opposite_coplanar); - CGAL_assertion(ca!=COPLANAR); - return cpp11::make_tuple(VERTEX,Intersection_info(fh->halfedge()->next()),is_vertex_coplanar,is_vertex_opposite_coplanar); -} - - -template -typename Intersection_types::Intersection_result -do_intersect(typename Polyhedron_types::Halfedge_handle hh, - typename Polyhedron_types::Facet_handle fh, - PolyhedronPointPmap ppmap) -{ - typedef typename Intersection_types::Intersection_info Intersection_info; - typedef typename Intersection_types::Intersection_result Intersection_result; - - const typename Kernel::Point_3 & a = get(ppmap, fh->halfedge()->vertex() ); - const typename Kernel::Point_3 & b = get(ppmap, fh->halfedge()->next()->vertex() ); - const typename Kernel::Point_3 & c = get(ppmap, fh->halfedge()->next()->next()->vertex() ); - const typename Kernel::Point_3 & p = get(ppmap, hh->vertex() ); - const typename Kernel::Point_3 & q = get(ppmap, hh->opposite()->vertex() ); - - - const Orientation abcp = orientation(a,b,c,p); - const Orientation abcq = orientation(a,b,c,q); - - - switch ( abcp ) { - case POSITIVE: - switch ( abcq ) { - case POSITIVE: - // the segment lies in the positive open halfspaces defined by the - // triangle's supporting plane - return Intersection_result(EMPTY,Intersection_info(),false,false); - case NEGATIVE: - // p sees the triangle in counterclockwise order - return find_intersection(p,q,a,b,c,hh,fh); - case COPLANAR: - // q belongs to the triangle's supporting plane - // p sees the triangle in counterclockwise order - return find_intersection(p,q,a,b,c,hh,fh,false,true); - - default: // should not happen. - CGAL_assertion(false); - return Intersection_result(EMPTY,Intersection_info(),false,false); - } - case NEGATIVE: - switch ( abcq ) { - case POSITIVE: - // q sees the triangle in counterclockwise order - return find_intersection(q,p,a,b,c,hh,fh); - case NEGATIVE: - // the segment lies in the negative open halfspaces defined by the - // triangle's supporting plane - return Intersection_result(EMPTY,Intersection_info(),false,false); - case COPLANAR: - // q belongs to the triangle's supporting plane - // p sees the triangle in clockwise order - return find_intersection(q,p,a,b,c,hh,fh,false,true); - default: // should not happen. - CGAL_assertion(false); - return Intersection_result(EMPTY,Intersection_info(),false,false); - } - case COPLANAR: // p belongs to the triangle's supporting plane - switch ( abcq ) { - case POSITIVE: - // q sees the triangle in counterclockwise order - return find_intersection(q,p,a,b,c,hh,fh,true,false); - case NEGATIVE: - // q sees the triangle in clockwise order - return find_intersection(p,q,a,b,c,hh,fh,true,false); - case COPLANAR: - // the segment is coplanar with the triangle's supporting plane - // we test whether the segment intersects the triangle in the common - // supporting plane - if ( ::CGAL::internal::do_intersect_coplanar(a,b,c,p,q,Kernel()) ) - return Intersection_result(COPLNR,Intersection_info(),true,true); - return Intersection_result(EMPTY,Intersection_info(),true,true); - - default: // should not happen. - CGAL_assertion(false); - return Intersection_result(EMPTY,Intersection_info(),false,false); - } - default: // should not happen. - CGAL_assertion(false); - return Intersection_result(EMPTY,Intersection_info(),false,false); - } -} - -}} //namespace CGAL::internal_IOP - -#endif //CGAL_INTERNAL_INTERSECTION_TRIANGLE_SEGMENT_3_H diff --git a/Operations_on_polyhedra/include/CGAL/internal/corefinement/intersection_triangle_segment_3_coplanar.h b/Operations_on_polyhedra/include/CGAL/internal/corefinement/intersection_triangle_segment_3_coplanar.h deleted file mode 100644 index a41fc3c5324..00000000000 --- a/Operations_on_polyhedra/include/CGAL/internal/corefinement/intersection_triangle_segment_3_coplanar.h +++ /dev/null @@ -1,400 +0,0 @@ -// Copyright (c) 2011 GeometryFactory (France). -// All rights reserved. -// -// This file is part of CGAL (www.cgal.org). -// You can redistribute it and/or modify it under the terms of the GNU -// General Public License as published by the Free Software Foundation, -// either version 3 of the License, or (at your option) any later version. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -// -// $URL$ -// $Id$ -// SPDX-License-Identifier: GPL-3.0+ -// -// -// Author(s) : Sebastien Loriot - -#ifndef CGAL_INTERNAL_INTERSECTION_TRIANGLE_SEGMENT_3_COPLANAR_H -#define CGAL_INTERNAL_INTERSECTION_TRIANGLE_SEGMENT_3_COPLANAR_H - -#include - - - -namespace CGAL{ - namespace internal_IOP{ - -//enum Intersection_type {FACET,EDGE,VERTEX,EMPTY,COPLNR}; - -template -struct Intersection_point_coplanar{ - typedef typename Polyhedron_types::Halfedge_handle Halfedge_handle; - - Intersection_type type; - Halfedge_handle info; - Halfedge_handle segment_vertex; - - Intersection_point_coplanar(){}; - - Intersection_point_coplanar(Intersection_type type_, - Halfedge_handle info_, - Halfedge_handle segment_vertex_ - ) :type(type_),info(info_),segment_vertex(segment_vertex_){} -}; - -//test q vs segment bc -template -void point_vs_segment(Inter_pt_coplanar& pt, - Halfedge_handle bc, Halfedge_handle ab, - const Orientation& pqc, const Orientation& pqb) -{ - if (pqb==COLLINEAR){ - pt.type=VERTEX; - pt.info=ab; - } - else{ - if (pqc==COLLINEAR){ - pt.type=VERTEX; - pt.info=bc; - } - else{ - pt.type=EDGE; - pt.info=bc; - } - } -} - - -/* -// c -// / \ -// ___/___\____ with q-------p -// / \ -// a_______b -//supporting line of segment pq intersects ac and bc -*/ - -template -std::pair -decision_tree(const Point_3* a,const Point_3* b,const Point_3* c, - const Point_3* p,const Point_3* q, - const Orientation& pqa,const Orientation& pqb,const Orientation& pqc, - Halfedge_handle pq, - Halfedge_handle ca,Halfedge_handle ab,Halfedge_handle bc) -{ - CGAL_precondition(pqa!=NEGATIVE); - CGAL_precondition(pqb!=NEGATIVE); - CGAL_precondition(pqc!=POSITIVE); - - Inter_pt_coplanar pt1(EMPTY,NULL,NULL),pt2(EMPTY,NULL,NULL); - - //the segment supporting line intersects ac and bc - const Orientation bcq = coplanar_orientation(*b,*c,*q); - switch(bcq){ - case NEGATIVE: //segment does not intersect the triangle - return std::make_pair(pt1,pt2); - case COLLINEAR: //q \in [bc] - point_vs_segment(pt1,bc,ab,pqc,pqb); - pt1.segment_vertex=pq; - return std::make_pair(pt1,pt2); - default: - break; - } - - //===> q is to the left of bc - - const Orientation cap = coplanar_orientation(*c,*a,*p); - switch(cap){ - case NEGATIVE: //segment does not intersect the triangle - return false; - case COLLINEAR: //p \in [ca] - point_vs_segment(pt1,ca,bc,pqa,pqc); - pt1.segment_vertex=pq->opposite(); - return std::make_pair(pt1,pt2); - default: - break; - } - //===> p is to the right of ac - - - const Orientation cqa = coplanar_orientation(*c,*q,*a); - const Orientation cbp = coplanar_orientation(*c,*b,*p); - - if (pqc==COLLINEAR && cqa==POSITIVE && cbp==POSITIVE){ - //special case when c is inside the segment pq - pt1.type=VERTEX; - pt1.info=bc; - return std::make_pair(pt1,pt2); - } - - //where is located q? - switch (cqa){ - case POSITIVE: //q is outside the triangle - point_vs_segment(pt1,ca,bc,pqa,pqc); - break; - case NEGATIVE: //q is inside the triangle - pt1.type=FACET; - pt1.info=pq; - break; - case COLLINEAR: //q \in [ca] - point_vs_segment(pt1,ca,bc,pqa,pqc); - pt1.segment_vertex=pq; - break; - } - - //where is located p? - switch (cbp){ - case POSITIVE: //p is outside the triangle - point_vs_segment(pt2,bc,ab,pqc,pqb); - break; - case NEGATIVE: //p is inside the triangle - pt2.type=FACET; - pt2.info=pq->opposite(); - break; - case COLLINEAR: //p \in [bc] - point_vs_segment(pt2,bc,ab,pqc,pqb); - pt2.segment_vertex=pq->opposite(); - break; - } - return std::make_pair(pt1,pt2); -} - - -/* -// c -// / \ -// / \ -// / \ -// ____a_______b______ with q-------p -//supporting lines of segments pq and ab are the same. -*/ - -template -std::pair -collinear_decision_tree(const Point_3* a,const Point_3* b,const Point_3* c, - const Point_3* p,const Point_3* q, - const Orientation& pqa,const Orientation& pqb,const Orientation& pqc, - Halfedge_handle pq, - Halfedge_handle ca,Halfedge_handle ab,Halfedge_handle bc) -{ - CGAL_precondition(pqa==COLLINEAR); - CGAL_precondition(pqb==COLLINEAR); - CGAL_precondition(pqc==NEGATIVE); - - Inter_pt_coplanar pt1(EMPTY,NULL,NULL),pt2(EMPTY,NULL,NULL); - - //the segment supporting line intersects ac and bc - const Orientation bcq = coplanar_orientation(*b,*c,*q); - switch(bcq){ - case NEGATIVE: //segment does not intersect the triangle - return std::make_pair(pt1,pt2); - case COLLINEAR: // q = b - pt1.type=VERTEX; - pt1.info=ab; - pt1.segment_vertex=pq; - return std::make_pair(pt1,pt2); - default: - break; - } - - //===> q is to the left of b - - const Orientation cap = coplanar_orientation(*c,*a,*p); - switch(cap){ - case NEGATIVE: //segment does not intersect the triangle - return false; - case COLLINEAR: //p = a - pt1.type=VERTEX; - pt1.info=ca; - pt1.segment_vertex=pq->opposite(); - return std::make_pair(pt1,pt2); - default: - break; - } - - //===> p is to the right of a - - - const Orientation cqa = coplanar_orientation(*c,*q,*a); - const Orientation cbp = coplanar_orientation(*c,*b,*p); - - //where is located q? - switch (cqa){ - case POSITIVE: //q is to the left of a - pt1.type=VERTEX; - pt1.info=ca; - break; - case NEGATIVE: //q is to the right of a - pt1.type=EDGE; - pt1.info=ab; - pt1.segment_vertex=pq; - break; - case COLLINEAR: //q = a - pt1.type=VERTEX; - pt1.info=ca; - pt1.segment_vertex=pq; - break; - } - - //where is located p? - switch (cbp){ - case POSITIVE: //p is to the right of b - { - pt2.type=VERTEX; - pt2.info=ab; - } - break; - case NEGATIVE: //p is to the left of b - { - pt2.type=EDGE; - pt2.info=ab; - pt2.segment_vertex=pq->opposite(); - } - break; - case COLLINEAR: //p = b - pt2.type=VERTEX; - pt2.info=ab; - pt2.segment_vertex=pq->opposite(); - break; - } - - return std::make_pair(pt1,pt2); -} - -//std::pair,Intersection_point_coplanar > -template -std::pair,Intersection_point_coplanar > -do_intersect_coplanar(typename Polyhedron_types::Halfedge_handle pq, - typename Polyhedron_types::Face_handle fh) -{ - typedef Intersection_point_coplanar Inter_pt_coplanar; - typedef std::pair Return_type; - - - typedef typename Polyhedron_types::Halfedge_handle Halfedge_handle; - - const typename Kernel::Point_3 & A = fh->halfedge()->vertex()->point(); - const typename Kernel::Point_3 & B = fh->halfedge()->next()->vertex()->point(); - const typename Kernel::Point_3 & C = fh->halfedge()->next()->next()->vertex()->point(); - const typename Kernel::Point_3 & P = pq->vertex()->point(); - const typename Kernel::Point_3 & Q = pq->opposite()->vertex()->point(); - - const typename Kernel::Point_3 * a = &A; - const typename Kernel::Point_3 * b = &B; - const typename Kernel::Point_3 * c = &C; - - const typename Kernel::Point_3* p = &P; - const typename Kernel::Point_3* q = &Q; - - Halfedge_handle ca=fh->halfedge(); - Halfedge_handle ab=fh->halfedge()->next(); - Halfedge_handle bc=fh->halfedge()->next()->next(); - - - // Determine the orientation of the triangle in the common plane - - if (coplanar_orientation(A,B,C) != POSITIVE){ - // The triangle is not counterclockwise oriented swap two vertices. - b = &C; - c = &B; - std::swap(bc,ab); - } - - // Test whether the segment's supporting line intersects the - // triangle in the common plane - - Orientation pqa = coplanar_orientation(*p,*q,*a); - - //ensure pqa >= 0 - if (pqa == NEGATIVE){ - std::swap(p,q); - pqa=POSITIVE; - pq=pq->opposite(); - } - - const Orientation pqb = coplanar_orientation(*p,*q,*b); - const Orientation pqc = coplanar_orientation(*p,*q,*c); - - - - //Handle first case pq collinear with a triangle edge - if (pqa == COLLINEAR){ - if (pqb == COLLINEAR){ - //ab and pq are on the same line - if (pqc == NEGATIVE) - return collinear_decision_tree - (a,b,c,p,q,pqa,pqb,pqc,pq,ca,ab,bc); - else - return collinear_decision_tree - (a,b,c,q,p,pqa,pqb,NEGATIVE,pq->opposite(),ca,ab,bc); - } - if (pqc == COLLINEAR){ - //ac and pq are on the same line - if (pqb == NEGATIVE) - return collinear_decision_tree - (c,a,b,p,q,pqc,pqa,pqb,pq,bc,ca,ab); - else - return collinear_decision_tree - (c,a,b,q,p,pqc,pqa,NEGATIVE,pq->opposite(),bc,ca,ab); - } - } - else - if(pqb ==COLLINEAR && pqc == COLLINEAR){ - //bc and pq are on the same line - return collinear_decision_tree - (b,c,a,q,p,pqb,pqc,NEGATIVE,pq->opposite(),ab,bc,ca); - } - - - CGAL_assertion(pqa!=NEGATIVE); - - switch ( pqa ) { - case POSITIVE: - switch ( pqb ) { - case POSITIVE: - if (pqc == POSITIVE) - return std::make_pair(Inter_pt_coplanar(EMPTY,NULL,NULL),Inter_pt_coplanar(EMPTY,NULL,NULL)); - return decision_tree(a,b,c,p,q,pqa,pqb,pqc,pq,ca,ab,bc); - - case COLLINEAR: - case NEGATIVE: - if (pqc == POSITIVE) // b is isolated on the negative side - return decision_tree(c,a,b,p,q,pqc,pqa,pqb,pq,bc,ca,ab); - return decision_tree - (b,c,a,q,p,POSITIVE,opposite(pqc),NEGATIVE,pq->opposite(),ab,bc,ca); - default:// should not happen. - CGAL_assertion(false); - return std::make_pair(Inter_pt_coplanar(EMPTY,NULL,NULL),Inter_pt_coplanar(EMPTY,NULL,NULL)); - } - case COLLINEAR: - switch ( pqb ) { - case POSITIVE: - if (pqc == POSITIVE) // a is isolated on the negative side - return decision_tree(b,c,a,p,q,pqb,pqc,pqa,pq,ab,bc,ca); - return decision_tree(a,b,c,p,q,pqa,pqb,pqc,pq,ca,ab,bc); - - case NEGATIVE: - if (pqc == NEGATIVE) // a is isolated on the positive side - return decision_tree - (b,c,a,q,p,POSITIVE,POSITIVE,pqa,pq->opposite(),ab,bc,ca); - return decision_tree(c,a,b,p,q,pqc,pqa,pqb,pq,bc,ca,ab); - - default:// should not happen. - CGAL_assertion(false); - return std::make_pair(Inter_pt_coplanar(EMPTY,NULL,NULL),Inter_pt_coplanar(EMPTY,NULL,NULL)); - } - default:// should not happen. - CGAL_assertion(false); - return std::make_pair(Inter_pt_coplanar(EMPTY,NULL,NULL),Inter_pt_coplanar(EMPTY,NULL,NULL)); - - } -} - -}}//namespace CGAL::internal_IOP - -#endif //CGAL_INTERNAL_INTERSECTION_TRIANGLE_SEGMENT_3_COPLANAR_H diff --git a/Operations_on_polyhedra/include/CGAL/internal/corefinement/predicates.h b/Operations_on_polyhedra/include/CGAL/internal/corefinement/predicates.h deleted file mode 100644 index edb8a3f534a..00000000000 --- a/Operations_on_polyhedra/include/CGAL/internal/corefinement/predicates.h +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright (c) 2011 GeometryFactory (France). -// All rights reserved. -// -// This file is part of CGAL (www.cgal.org). -// You can redistribute it and/or modify it under the terms of the GNU -// General Public License as published by the Free Software Foundation, -// either version 3 of the License, or (at your option) any later version. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -// -// $URL$ -// $Id$ -// SPDX-License-Identifier: GPL-3.0+ -// -// -// Author(s) : Sebastien Loriot - -#ifndef CGAL_INTERNAL_COREFINEMENT_PREDICATES_H -#define CGAL_INTERNAL_COREFINEMENT_PREDICATES_H - -#include - - -namespace CGAL{ - -namespace Corefinement{ - -namespace OOP{ -//Considering the plane with normal vector [O_prime,O] and containing O. -//We define the counterclockwise order around O when looking from -//the side of the plane into which the vector [O_prime,O] is pointing. -//We consider the portion of the plane defined by rotating a ray starting at O -//from the planar projection of P1 to the planar projection of P2 in -//counterclockwise order. -//The predicates indicates whether the planar projection of point Q lies in this -//portion of the plane. -//Preconditions: -// O_prime,O,P1 are not collinear -// O_prime,O,P2 are not collinear -// O_prime,O,Q are not collinear -// O_prime,O,P1,Q are not coplanar or coplanar_orientation(O,O_prime,P1,Q)==NEGATIVE -// O_prime,O,P2,Q are not coplanar or coplanar_orientation(O,O_prime,P2,Q)==NEGATIVE -template -bool sorted_around_edge( - const typename Kernel::Point_3& O_prime,const typename Kernel::Point_3& O, - const typename Kernel::Point_3& P1,const typename Kernel::Point_3& P2, - const typename Kernel::Point_3& Q) -{ - //guarantee to have non-flat triangles - CGAL_precondition( !collinear(O_prime,O,P1) ); - CGAL_precondition( !collinear(O_prime,O,P2) ); - CGAL_precondition( !collinear(O_prime,O,Q) ); - - //no two triangles are coplanar and on the same side of their common edge - CGAL_precondition( !coplanar(O_prime,O,P1,Q) - || coplanar_orientation(O,O_prime,P1,Q)==NEGATIVE ); - CGAL_precondition( !coplanar(O_prime,O,P2,Q) - || coplanar_orientation(O,O_prime,P2,Q)==NEGATIVE ); - - Sign s0 = CGAL::sign( determinant(O-O_prime,P1-O,P2-O) ); - - if ( s0==ZERO ) { - //O, O_prime, P1 and P2 are coplanar - Orientation o=orientation(O_prime,O,P1,Q); - CGAL_precondition(o!=COPLANAR); - return o==POSITIVE; - } - - //O, O_prime, P1 and P2 are not coplanar - Sign s1 = CGAL::sign( determinant(O-O_prime,P1-O,Q -O) ); - Sign s2 = CGAL::sign( determinant(O-O_prime,Q -O,P2-O) ); - - if (s0 == POSITIVE) // the angle P1,O,P2 is smaller that Pi. - return ( s1 == POSITIVE ) - && ( s2 ==POSITIVE ); //true if the angles P1,O,Q and Q,O,P2 are smaller than Pi - else - return ( s1 != NEGATIVE ) - || ( s2 != - NEGATIVE ); //true if the angle P1,O,Q or the angle Q,O,P2 is smaller than or equal to Pi -} - -template -bool sorted_around_edge_filtered( int O_prime_index, - int O_index, - int P1_index, - int P2_index, - int Q_index, - Vertex_handle P1, - Vertex_handle P2, - Vertex_handle Q, - const Nodes_vector& nodes, - PolyhedronPointPMap ppmap) -{ - typename Nodes_vector::Protector p; - try { - CGAL_USE(p); - return sorted_around_edge( - nodes.interval_node(O_prime_index), - nodes.interval_node(O_index), - P1_index == -1 ? nodes.to_interval(get(ppmap,P1)) - : nodes.interval_node(P1_index), - P2_index == -1 ? nodes.to_interval(get(ppmap,P2)) - : nodes.interval_node(P2_index), - Q_index == -1 ? nodes.to_interval(get(ppmap,Q)) - : nodes.interval_node(Q_index ) - ); - } catch(Uncertain_conversion_exception&) { - return sorted_around_edge( - nodes.exact_node(O_prime_index), - nodes.exact_node(O_index), - P1_index == -1 ? nodes.to_exact(get(ppmap,P1)) - : nodes.exact_node(P1_index), - P2_index == -1 ? nodes.to_exact(get(ppmap,P2)) - : nodes.exact_node(P2_index), - Q_index == -1 ? nodes.to_exact(get(ppmap,Q)) - : nodes.exact_node(Q_index ) - ); - } -} - -} - -} - -} // end of namespace CGAL::Corefinement::OOP - -#endif //CGAL_INTERNAL_COREFINEMENT_PREDICATES_H diff --git a/Operations_on_polyhedra/include/CGAL/internal/corefinement/utils.h b/Operations_on_polyhedra/include/CGAL/internal/corefinement/utils.h deleted file mode 100644 index f8574d1888a..00000000000 --- a/Operations_on_polyhedra/include/CGAL/internal/corefinement/utils.h +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright (c) 2011 GeometryFactory (France). -// All rights reserved. -// -// This file is part of CGAL (www.cgal.org). -// You can redistribute it and/or modify it under the terms of the GNU -// General Public License as published by the Free Software Foundation, -// either version 3 of the License, or (at your option) any later version. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -// -// $URL$ -// $Id$ -// SPDX-License-Identifier: GPL-3.0+ -// -// -// Author(s) : Sebastien Loriot - -#ifndef CGAL_INTERNAL_COREFINEMENT_UTILS_H -#define CGAL_INTERNAL_COREFINEMENT_UTILS_H - -#include - - -namespace CGAL{ - -namespace internal_IOP { - -template -struct Compare_unik_address{ - typedef typename Polyhedron::Halfedge_handle Halfedge_handle; - typedef typename Polyhedron::Halfedge_const_handle Halfedge_const_handle; - typedef typename Polyhedron::Halfedge Halfedge; - - bool operator()(Halfedge_handle h1,Halfedge_handle h2) const { - Halfedge* ph1=&(*h1) < &(*h1->opposite()) ? &(*h1) : &(*h1->opposite()); - Halfedge* ph2=&(*h2) < &(*h2->opposite()) ? &(*h2) : &(*h2->opposite()); - return ph1 < ph2; - } - - bool operator()(Halfedge_const_handle h1,Halfedge_const_handle h2) const { - const Halfedge* ph1=&(*h1) < &(*h1->opposite()) ? &(*h1) : &(*h1->opposite()); - const Halfedge* ph2=&(*h2) < &(*h2->opposite()) ? &(*h2) : &(*h2->opposite()); - return ph1 < ph2; - } -}; - -template -struct Compare_address{ - typedef typename Polyhedron::Halfedge_handle Halfedge_handle; - typedef typename Polyhedron::Halfedge_const_handle Halfedge_const_handle; - typedef typename Polyhedron::Halfedge Halfedge; - - bool operator()(Halfedge_handle h1,Halfedge_handle h2) const { - return &(*h1) < &(*h2); - } - - bool operator()(Halfedge_const_handle h1,Halfedge_const_handle h2) const { - return &(*h1) < &(*h2); - } -}; - -template -class Non_intersection_halfedge{ - typedef std::map< typename Polyhedron::Halfedge_const_handle, - std::pair, - Compare_unik_address - > Intersection_hedges_set; - Intersection_hedges_set intersection_hedges_; -public: - Non_intersection_halfedge(const Intersection_hedges_set& the_set) : intersection_hedges_(the_set){} - - - bool operator()(typename Polyhedron::Halfedge_const_handle h) const - { - if (h->is_border_edge()) return false; - return intersection_hedges_.find(h)==intersection_hedges_.end(); - } -}; - -} //end of namespace internal_IOP - -namespace Corefinement{ - -template -struct Dummy_edge_mark_property_map{ - typedef bool value_type; - typedef value_type reference; - typedef std::pair key_type; - typedef boost::read_write_property_map_tag category; - - Dummy_edge_mark_property_map(){} - - friend reference get(Dummy_edge_mark_property_map,key_type) {return false;} - friend void put(Dummy_edge_mark_property_map,key_type,value_type) {} -}; - - -template -int node_index_of_incident_vertex(Halfedge_const_handle h, - const Border_halfedges_map& border_halfedges) -{ - //WARNING this may be expensive - Halfedge_const_handle start=h; - Halfedge_const_handle curr=start; - do { - typename Border_halfedges_map::const_iterator it_border = - border_halfedges.find(curr ); - if (it_border!=border_halfedges.end()) - return it_border->first==curr?it_border->second.second - :it_border->second.first; - curr=curr->next()->opposite(); - } while(curr!=start); - - return -1; -} - -template -int get_node_id(Vertex_handle vh, - const Vertex_to_node_id& vertex_to_node_id) -{ - typename Vertex_to_node_id::const_iterator it=vertex_to_node_id.find(vh); - if (it==vertex_to_node_id.end()) - return -1; - return it->second; -} - -} } //end of namespace CGAL::Corefinement - -#endif // CGAL_INTERNAL_COREFINEMENT_UTILS_H diff --git a/Operations_on_polyhedra/include/CGAL/intersection_of_Polyhedra_3.h b/Operations_on_polyhedra/include/CGAL/intersection_of_Polyhedra_3.h deleted file mode 100644 index 9d7bb7ec679..00000000000 --- a/Operations_on_polyhedra/include/CGAL/intersection_of_Polyhedra_3.h +++ /dev/null @@ -1,2187 +0,0 @@ -// Copyright (c) 2010-2012 GeometryFactory (France). -// All rights reserved. -// -// This file is part of CGAL (www.cgal.org). -// You can redistribute it and/or modify it under the terms of the GNU -// General Public License as published by the Free Software Foundation, -// either version 3 of the License, or (at your option) any later version. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -// -// $URL$ -// $Id$ -// SPDX-License-Identifier: GPL-3.0+ -// -// -// Author(s) : Sebastien Loriot - -#ifndef CGAL_INTERSECTION_OF_POLYHEDRA_3_H -#define CGAL_INTERSECTION_OF_POLYHEDRA_3_H - -#include - -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include - -#include - -#ifdef CGAL_COREFINEMENT_DEBUG -#warning look at CGAL/Mesh_3/Robust_intersection_traits.h and the statically filtered decision tree -#endif - -namespace CGAL{ - -//This functor computes the pairwise intersection of polyhedral surfaces. -//Intersection are given as a set of polylines -//The algorithm works as follow: -//From each polyhedral surface we can get it as a set of segments or as a set of triangles. -//We first use Box_intersection_d to filter intersection between all polyhedral -//surface segments and polyhedral triangles. -//From this filtered set, for each pair (segment,triangle), we look at the -//intersection type. If not empty, we can have three different cases -// 1)the segment intersect the interior of the triangle: -// We compute the intersection point and for each triangle incident -// to the segment, we write the fact that the point belong to the intersection -// of these two triangles. -// 2)the segment intersect the triangle on an edge -// We do the same thing as described above but -// for all triangle incident to the edge intersected -// 3)the segment intersect the triangle at a vertex -// for each edge incident to the vertex, we do -// the same operations as in 2) -// -//In case the segment intersect the triangle at one of the segment endpoint, -//we repeat the same procedure for each segment incident to this -//endpoint. -// -//Note that given a pair (segment,triangle)=(S,T), if S belongs -//to the plane of T, we have nothing to do in the following cases: -// -- no triangle T' contains S such that T and T' are coplanar -// -- at least one triangle contains S -// Indeed, the intersection points of S and T will be found using segments -// of T or segments adjacent to S. -// -// -- Sebastien Loriot, 2010/04/07 - -template -struct Default_polyhedron_ppmap{ - typedef typename Polyhedron::Point_3 value_type; - typedef const value_type& reference; - typedef typename Polyhedron::Vertex_handle key_type; - typedef boost::read_write_property_map_tag category; - - friend reference get(Default_polyhedron_ppmap, key_type vh) {return vh->point();} - friend reference get(Default_polyhedron_ppmap, typename Polyhedron::Vertex_const_handle vh) {return vh->point();} - friend void put(Default_polyhedron_ppmap,key_type vh, const value_type& v) {vh->point()=v;} -}; - - -namespace internal_IOP { - //an enum do decide which kind of intersection points are needed - struct No_predicates_on_constructions{}; - struct Predicates_on_constructions{}; -} // namespace internal_IOP - -template -struct Empty_node_visitor{ - typedef typename Polyhedron::Halfedge_const_handle Halfedge_handle; - void new_node_added(int,internal_IOP::Intersection_type,Halfedge_handle,Halfedge_handle,bool,bool){} - template - void annotate_graph(Iterator,Iterator){} - void update_terminal_nodes(std::vector&){} - void set_number_of_intersection_points_from_coplanar_facets(int){} - void input_have_coplanar_facets(){} - void add_filtered_intersection(Halfedge_handle,Halfedge_handle,const Polyhedron&,const Polyhedron&){} - void start_new_polyline(int,int){} - void add_node_to_polyline(int){} - void new_input_polyhedron(const Polyhedron&){} - template - void finalize(T&){} - typedef internal_IOP::No_predicates_on_constructions Node_storage_type; - typedef Tag_true Is_polyhedron_const; - static const bool do_need_vertex_graph = false; -}; - -namespace internal_IOP{ - -template -struct Compare_handles{ - typedef typename Polyhedron_types::Halfedge_handle Halfedge_handle; - typedef typename Polyhedron_types::Halfedge Halfedge; - typedef typename Polyhedron_types::Vertex Vertex; - typedef typename Polyhedron_types::Facet Facet; - typedef typename Polyhedron_types::Facet_handle Facet_handle; - typedef std::pair Vertex_handle_pair; - - static inline Vertex_handle_pair - make_sorted_pair_of_vertices(Halfedge_handle h) { - const Vertex* v1=&(* h->vertex() ); - const Vertex* v2=&(* h->opposite()->vertex() ); - if ( v1 < v2 ) - return Vertex_handle_pair(v1,v2); - return Vertex_handle_pair(v2,v1); - } - - bool operator()(Halfedge_handle h1,Halfedge_handle h2) const { - Vertex_handle_pair p1=make_sorted_pair_of_vertices(h1); - Vertex_handle_pair p2=make_sorted_pair_of_vertices(h2); - return p1 < p2; - } - - bool operator()(Facet_handle f1,Facet_handle f2) const { - return &(*f1) < &(*f2); - } - - bool operator()(const std::pair& p1, const std::pair& p2) const{ - Halfedge* h1= (std::min) ( &(*(p1.first)), &(*(p1.first->opposite())) ); - Halfedge* h2= (std::min) ( &(*(p2.first)), &(*(p2.first->opposite())) ); - return h1 -struct Compare_handle_pairs{ - typedef typename Polyhedron_types::Facet Facet; - typedef typename Polyhedron_types::Facet_handle Facet_handle; - typedef std::pair Facet_pair; - typedef std::pair Facet_pair_and_int; - - bool operator()(const Facet_pair& p1, const Facet_pair& p2) const{ - Facet* f1=&(*p1.first); - Facet* f2=&(*p2.first); - if (f1==f2){ - f1=&(*p1.second); - f2=&(*p2.second); - } - return f1f2) return false; - return p1.second -struct Order_along_a_halfedge{ - typedef typename Polyhedron_types::Halfedge_handle Halfedge_handle; - const Nodes_vector& nodes; - Halfedge_handle hedge; - PolyhedronPointPMap ppmap; - - Order_along_a_halfedge(Halfedge_handle hedge_,const Nodes_vector& nodes_, PolyhedronPointPMap ppmap):nodes(nodes_),hedge(hedge_), ppmap(ppmap){} - bool operator()(int i,int j) const { - //returns true, iff q lies strictly between p and r. - typename Nodes_vector::Protector p; - try{ - CGAL::internal::use(p); - - return CGAL::collinear_are_strictly_ordered_along_line(nodes.to_interval(get(ppmap, hedge->vertex())), - nodes.interval_node(j), - nodes.interval_node(i)); - } - catch(CGAL::Uncertain_conversion_exception&){ - return CGAL::collinear_are_strictly_ordered_along_line(nodes.to_exact(get(ppmap, hedge->vertex())), - nodes.exact_node(j), - nodes.exact_node(i)); - } - } -}; - - -template -class Split_halfedge : public CGAL::Modifier_base { - typedef typename HDS::Halfedge_handle Halfedge_handle; - typedef typename HDS::Vertex_handle Vertex_handle; - typedef typename HDS::Vertex Vertex; - Halfedge_handle hedge; - - typename HDS::Halfedge::Base* - unlock_halfedge(Halfedge_handle h){ - return static_cast(&(*h)); - } - -public: - - Split_halfedge(Halfedge_handle h) : hedge(h){} - - // new_hedge hedge - // -----------> -----------> - // v - // <----------- <----------- - // new_opposite opposite - // - void operator()( HDS& hds) { - - Vertex_handle v=hds.vertices_push_back(Vertex()); - - Halfedge_handle opposite=hedge->opposite(); - - Halfedge_handle new_hedge=hds.edges_push_back(*hedge); - Halfedge_handle new_opposite=new_hedge->opposite(); - - //update next relations - unlock_halfedge(new_hedge)->set_next(hedge); - unlock_halfedge(new_hedge->prev())->set_next(new_hedge); - unlock_halfedge(hedge)->set_prev(new_hedge); - - unlock_halfedge(opposite)->set_next(new_opposite); - unlock_halfedge(new_opposite)->set_prev(opposite); - unlock_halfedge(new_opposite->next())->set_prev(new_opposite); - - unlock_halfedge(opposite)->set_vertex(v); - unlock_halfedge(new_hedge)->set_vertex(v); - - v->set_halfedge(new_hedge); - new_opposite->vertex()->set_halfedge(new_opposite); - } -}; - - - -} //namespace internal_IOP - - - -//WARNING THIS IS DONE ONLY FOR POLYHEDRON -// Warning this will split only existing edges, newly created edge intersected -// by the intersection polyline won't be split -template, - class Kernel=typename Kernel_traits< typename boost::property_traits::value_type>::Kernel > -class Node_visitor_for_polyline_split{ -//typedefs - typedef typename Polyhedron::Halfedge_handle Halfedge_handle; - typedef typename Polyhedron::Halfedge Halfedge; - typedef typename Polyhedron::Vertex_handle Vertex_handle; - //Info stores information about a particular intersection on an - //edge or a vertex of a polyhedron. The two first elements in - //the template describe the intersected simplex of the considered - //polyhedron; the two last elements describe the element of the - //second polyhedron (can be either a vertex, an edge of a facet) - //involved in the intersection - typedef CGAL::cpp11::tuple Info; - typedef std::map Hedge_to_polyhedron_map; - typedef std::vector Infos; - typedef std::map Node_to_infos_map; -//data members - Node_to_infos_map node_infos; - Hedge_to_polyhedron_map hedge_to_polyhedron; - Halfedge_predicate is_on_polyline; - Set_vertex_corner set_as_corner; - PolyhedronPointPMap ppmap; -//functions - void handle_principal_edge(int node_id, - internal_IOP::Intersection_type type, - Halfedge_handle principal_edge, - Halfedge_handle additional_edge, - bool is_vertex_coplanar, - bool is_vertex_opposite_coplanar) - { - bool coplanar_v=false; - if (is_vertex_coplanar) coplanar_v=true; - else if (is_vertex_opposite_coplanar){ - principal_edge=principal_edge->opposite(); - coplanar_v=true; - } - - if (coplanar_v) - handle_on_vertex(node_id,principal_edge,type,additional_edge); - else{ - if ( is_on_polyline(principal_edge) ){ - typename Node_to_infos_map::iterator it_res= - node_infos.insert(std::make_pair(node_id,Infos())).first; - it_res->second.push_back( Info(internal_IOP::EDGE,principal_edge,type,additional_edge) ); - } - } - } - - void handle_on_vertex(int node_id,Halfedge_handle edge,internal_IOP::Intersection_type type,Halfedge_handle additional_edge){ - Halfedge_handle current=edge; - do{ - if (is_on_polyline(current)){ - typename Node_to_infos_map::iterator it_res= - node_infos.insert(std::make_pair(node_id,Infos())).first; - it_res->second.push_back( Info(internal_IOP::VERTEX,current,type,additional_edge) ); - break; - } - current=current->next()->opposite(); - } - while(current!=edge); - } - - Halfedge* make_unique_key(Halfedge_handle h){ - if (&(*h) < &(*h->opposite())) - return &(*h); - else - return &(*h->opposite()); - } - - // new_hedge hedge - // -----------> -----------> - // v - // <----------- <----------- - // new_opposite opposite - // - void split_edge_and_retriangulate(Halfedge_handle hedge,const typename Kernel::Point_3& point,Polyhedron& P){ - internal_IOP::Split_halfedge delegated(hedge); - P.delegate( delegated ); - - Vertex_handle vh=boost::prior(P.vertices_end()); - put(ppmap, vh, point); - CGAL_assertion(get(ppmap,vh)==point); - - CGAL_assertion(P.is_valid()); - //triangulate the two adjacent facets - if (!hedge->is_border()) - P.split_facet(hedge->prev(),hedge->next()); - if (!hedge->opposite()->is_border()) - P.split_facet(hedge->opposite(),hedge->opposite()->next()->next()); - CGAL_assertion(P.is_valid()); - } - - //sort node ids so that we can split the hedge - //consecutively - template - void sort_vertices_along_hedge(std::vector& node_ids,Halfedge_handle hedge,const Nodes_vector& nodes) - { - std::sort(node_ids.begin(), - node_ids.end(), - internal_IOP::Order_along_a_halfedge(hedge,nodes,ppmap) - ); - } - -public: - static const bool do_need_vertex_graph = false; - typedef internal_IOP::Predicates_on_constructions Node_storage_type; - typedef Tag_false Is_polyhedron_const; - - Node_visitor_for_polyline_split(){} - Node_visitor_for_polyline_split(const Halfedge_predicate& getting, - const Set_vertex_corner& setting, - PolyhedronPointPMap ppmap) - :is_on_polyline(getting),set_as_corner(setting),ppmap(ppmap){} - - void new_node_added(int node_id, - internal_IOP::Intersection_type type, - Halfedge_handle principal_edge, - Halfedge_handle additional_edge, - bool is_vertex_coplanar, - bool is_vertex_opposite_coplanar) - { - switch(type) - { - case internal_IOP::FACET: //Facet intersected by an edge - handle_principal_edge(node_id,type,principal_edge,additional_edge,is_vertex_coplanar,is_vertex_opposite_coplanar); - break; - case internal_IOP::EDGE: //Edge intersected by an edge - handle_principal_edge(node_id,type,principal_edge,additional_edge,is_vertex_coplanar,is_vertex_opposite_coplanar); - if ( is_on_polyline(additional_edge) ){ - typename Node_to_infos_map::iterator it_res= - node_infos.insert(std::make_pair(node_id,Infos())).first; - it_res->second.push_back( Info(type,additional_edge, - ( is_vertex_coplanar||is_vertex_opposite_coplanar ) ? internal_IOP::VERTEX:internal_IOP::EDGE, - is_vertex_opposite_coplanar?principal_edge->opposite():principal_edge) ); - } - break; - case internal_IOP::VERTEX://Vertex intersected by an edge - handle_principal_edge(node_id,type,principal_edge,additional_edge,is_vertex_coplanar,is_vertex_opposite_coplanar); - handle_on_vertex( node_id,additional_edge, - ( is_vertex_coplanar||is_vertex_opposite_coplanar ) ? internal_IOP::VERTEX:internal_IOP::EDGE, - is_vertex_opposite_coplanar?principal_edge->opposite():principal_edge); - break; - default: - break; - } - } - - template - void annotate_graph(Iterator begin,Iterator end){ - for(Iterator it=begin;it!=end;++it){ - typename Node_to_infos_map::iterator it_res=node_infos.find(static_cast(std::distance(begin, it))); - if (it_res!=node_infos.end()) - it->make_terminal(); - } - } - - void update_terminal_nodes(std::vector& terminal_bools){ - for (typename Node_to_infos_map::iterator it=node_infos.begin();it!=node_infos.end();++it){ - terminal_bools[it->first]=true; - } - } - - void new_input_polyhedron(const Polyhedron&){} - void start_new_polyline(int,int){} - void add_node_to_polyline(int){} - void set_number_of_intersection_points_from_coplanar_facets(int){} - - void add_filtered_intersection(Halfedge_handle eh,Halfedge_handle fh,Polyhedron& Pe,Polyhedron& Pf){ - hedge_to_polyhedron.insert(std::make_pair(make_unique_key(eh),&Pe)); - hedge_to_polyhedron.insert(std::make_pair(make_unique_key(fh),&Pf)); - hedge_to_polyhedron.insert(std::make_pair(make_unique_key(fh->next()),&Pf)); - hedge_to_polyhedron.insert(std::make_pair(make_unique_key(fh->next()->next()),&Pf)); - } - - //split_halfedges - template - void finalize(const Nodes_vector& nodes){ - typedef std::map, - std::vector,internal_IOP::Compare_handles > Halfedges_to_split; - - Halfedges_to_split halfedges_to_split; - - for (typename Node_to_infos_map::iterator it=node_infos.begin();it!=node_infos.end();++it){ - int node_id=it->first; - const Infos& infos=it->second; - std::map > hedges_to_split; - - //collect information about halfedge to split - typename Infos::const_iterator it_info=infos.begin(); - for (;it_info!=infos.end();++it_info) - { - typename Hedge_to_polyhedron_map::iterator it_poly= - hedge_to_polyhedron.find(make_unique_key(CGAL::cpp11::get<1>(*it_info))); - CGAL_assertion(it_poly!=hedge_to_polyhedron.end()); - //associate information to an intersection point: - //we give which simplex of the other polyhedron intersect the simplex considered - set_as_corner.add_info_to_node(node_id,it_poly->second,*it_info); - switch(CGAL::cpp11::get<0>(*it_info)) - { - case internal_IOP::EDGE: - { - halfedges_to_split.insert( - std::make_pair( std::make_pair(CGAL::cpp11::get<1>(*it_info),&(*(it_poly->second))),std::vector() ) - ).first->second.push_back(node_id); - break; - } - case internal_IOP::VERTEX: - set_as_corner(CGAL::cpp11::get<1>(*it_info)->vertex(),node_id,it_poly->second); - break; - default: - CGAL_assertion(false); - //should never be here - } - } - } - - - //do the split - for(typename Halfedges_to_split::iterator it=halfedges_to_split.begin();it!=halfedges_to_split.end();++it){ - Halfedge_handle hedge=it->first.first; - Polyhedron* P=it->first.second; - std::vector& node_ids=it->second; - - sort_vertices_along_hedge(node_ids,hedge,nodes); - for (std::vector::iterator it_id=node_ids.begin();it_id!=node_ids.end();++it_id){ - split_edge_and_retriangulate(hedge,nodes[*it_id],*P); - set_as_corner(hedge->opposite()->vertex(),*it_id,(Polyhedron*)(0)); - } - } - } - void input_have_coplanar_facets() {} -}; - - -namespace internal_IOP{ - - template - typename Exact_kernel::Point_3 - compute_triangle_segment_intersection_point( - typename Polyhedron::Vertex_const_handle vh1,typename Polyhedron::Vertex_const_handle vh2, - typename Polyhedron::Vertex_const_handle vf1,typename Polyhedron::Vertex_const_handle vf2,typename Polyhedron::Vertex_const_handle vf3, - const Exact_kernel& ek, - PolyhedronPointPMap ppmap) - { - CGAL::Cartesian_converter to_exact; - typename Exact_kernel::Triangle_3 t(to_exact( get(ppmap, vf1) ), - to_exact( get(ppmap, vf2) ), - to_exact( get(ppmap, vf3) ) - ); - - typename Exact_kernel::Segment_3 s (to_exact( get(ppmap, vh1) ), - to_exact( get(ppmap, vh2) ) - ); - - typename Exact_kernel::Intersect_3 exact_intersect=ek.intersect_3_object(); - CGAL::Object inter=exact_intersect(t,s); - CGAL_assertion(CGAL::do_intersect(t,s)); - const typename Exact_kernel::Point_3* e_pt=CGAL::object_cast(&inter); - CGAL_assertion(e_pt!=NULL); - return *e_pt; - } - - template - typename Exact_kernel::Point_3 - compute_triangle_segment_intersection_point( - typename Polyhedron::Halfedge_const_handle edge, - typename Polyhedron::Facet_const_handle facet, - const Exact_kernel& ek, - PolyhedronPointPMap pmap) - { - return compute_triangle_segment_intersection_point( - edge->vertex(),edge->opposite()->vertex(), - facet->halfedge()->vertex(),facet->halfedge()->next()->vertex(),facet->halfedge()->opposite()->vertex(), - ek, - pmap); - - } - - - //A class containing a vector of the intersection points. - //The third template parameter indicates whether an - //exact representation is required - template ::value> - class Triangle_segment_intersection_points; - - - //Store only the double version of the intersection points. - template - class Triangle_segment_intersection_points - { - //typedefs - typedef std::vector Nodes_vector; - typedef typename Polyhedron::Halfedge_const_handle Halfedge_handle; - typedef typename Polyhedron::Facet_const_handle Facet_handle; - typedef CGAL::Exact_predicates_exact_constructions_kernel Exact_kernel; - typedef CGAL::Cartesian_converter Exact_to_double; - //members - Nodes_vector nodes; - Exact_kernel ek; - Exact_to_double exact_to_double; - PolyhedronPointPMap ppmap; - public: - - Triangle_segment_intersection_points(PolyhedronPointPMap ppmap): - ppmap(ppmap){} - - typedef CGAL::Interval_nt::Protector Protector; - - const typename Kernel::Point_3& - operator[](int i) const { - return nodes[i]; - } - - const typename Kernel::Point_3& exact_node(int i) const {return nodes[i];} - const typename Kernel::Point_3& interval_node(int i) const {return nodes[i];} - const typename Kernel::Point_3& to_exact(const typename Kernel::Point_3& p) const {return p;} - const typename Kernel::Point_3& to_interval(const typename Kernel::Point_3& p) const {return p;} - - size_t size() const {return nodes.size();} - - void add_new_node(const typename Exact_kernel::Point_3& p) - { - nodes.push_back( exact_to_double(p) ); - } - - //add a new node in the final graph. - //it is the intersection of the triangle with the segment - void add_new_node(Halfedge_handle edge,Facet_handle facet) - { - add_new_node( - compute_triangle_segment_intersection_point(edge,facet,ek, ppmap) - ); - } - - void add_new_node(const typename Kernel::Point_3& p) - { - nodes.push_back(p); - } - }; // end specialization - // Triangle_segment_intersection_points - - - //second specializations: store an exact copy of the points so that we can answer exactly predicates - //FYI, it used to have two specializations (one in the case the polyhedron - //can be edited and on if it cannot) building exact representation on demand. - //In the former case, we were using facet and halfedge while in the latter - //triple of vertex_handle and pair of vertex_handle - template - class Triangle_segment_intersection_points - { - //typedefs - public: - typedef CGAL::Simple_cartesian > Ikernel; - typedef CGAL::Exact_predicates_exact_constructions_kernel Exact_kernel; - private: - typedef CGAL::Cartesian_converter Interval_to_double; - typedef CGAL::Cartesian_converter Double_to_interval; - typedef CGAL::Cartesian_converter Exact_to_interval; - typedef CGAL::Cartesian_converter Double_to_exact; - - typedef typename Polyhedron::Vertex_const_handle Vertex_handle; - typedef typename Polyhedron::Halfedge_const_handle Halfedge_handle; - typedef typename Polyhedron::Facet_const_handle Facet_handle; - - typedef std::vector Interval_nodes; - typedef std::vector Exact_nodes; - - - //members - Interval_nodes inodes; - Exact_nodes enodes; - - Interval_to_double interval_to_double; - Exact_to_interval exact_to_interval; - Double_to_interval double_to_interval; - Double_to_exact double_to_exact; - Exact_kernel ek; - PolyhedronPointPMap ppmap; - - public: - - Triangle_segment_intersection_points(PolyhedronPointPMap ppmap): - ppmap(ppmap){} - - typedef CGAL::Interval_nt::Protector Protector; - - typename Kernel::Point_3 - operator[](int i) const { - return interval_to_double(inodes[i]); - } - - const typename Ikernel::Point_3& - interval_node(int i) const { - return inodes[i]; - } - - typename Ikernel::Point_3 - to_interval(const typename Kernel::Point_3& p) const { - return double_to_interval(p); - } - - const Exact_kernel::Point_3 - exact_node(int i) const { - return enodes[i]; - } - - typename Exact_kernel::Point_3 - to_exact(const typename Kernel::Point_3& p) const { - return double_to_exact(p); - } - - - size_t size() const {return enodes.size();} - - void add_new_node(const Exact_kernel::Point_3& p){ - const Ikernel::Point_3& p_approx=p.approx(); - if ( !has_smaller_relative_precision(p_approx.x(),Lazy_exact_nt::get_relative_precision_of_to_double()) || - !has_smaller_relative_precision(p_approx.y(),Lazy_exact_nt::get_relative_precision_of_to_double()) || - !has_smaller_relative_precision(p_approx.z(),Lazy_exact_nt::get_relative_precision_of_to_double()) ) p.exact(); - enodes.push_back(p); - inodes.push_back( exact_to_interval(p) ); - } - - void add_new_node(Halfedge_handle edge,Facet_handle facet) - { - add_new_node( compute_triangle_segment_intersection_point(edge,facet,ek,ppmap) ); - } - - //the point is an input - void add_new_node(const typename Kernel::Point_3& p){ - enodes.push_back(to_exact(p)); - inodes.push_back( double_to_interval(p) ); - } - }; // end specialization - // Triangle_segment_intersection_points - - //Third specialization: The kernel already has exact constructions. - template - class Triangle_segment_intersection_points - { - //typedefs - typedef std::vector Nodes_vector; - typedef typename Polyhedron::Halfedge_const_handle Halfedge_handle; - typedef typename Polyhedron::Facet_const_handle Facet_handle; - //members - Nodes_vector nodes; - Kernel k; - PolyhedronPointPMap ppmap; - public: - typedef Kernel Ikernel; - typedef Kernel Exact_kernel; - typedef void* Protector; - - Triangle_segment_intersection_points(PolyhedronPointPMap ppmap): - ppmap(ppmap){} - - const typename Kernel::Point_3& - operator[](int i) const { - return nodes[i]; - } - - size_t size() const {return nodes.size();} - const typename Kernel::Point_3& exact_node(int i) const {return nodes[i];} - const typename Kernel::Point_3& interval_node(int i) const {return nodes[i];} - - //add a new node in the final graph. - //it is the intersection of the triangle with the segment - void add_new_node(Halfedge_handle edge,Facet_handle facet) - { - nodes.push_back ( - compute_triangle_segment_intersection_point(edge,facet,k,ppmap) - ); - } - - void add_new_node(const typename Kernel::Point_3& p) - { - nodes.push_back(p); - } - - const typename Kernel::Point_3& to_interval(const typename Kernel::Point_3& p) const { return p; } - const typename Kernel::Point_3& to_exact(const typename Kernel::Point_3& p) const { return p; } - - }; // end specialization - // Triangle_segment_intersection_points - -} - -#ifdef CGAL_COREFINEMENT_DO_REPORT_SELF_INTERSECTIONS -struct Intersection_of_Polyhedra_3_self_intersection_exception - : public std::logic_error - { - Intersection_of_Polyhedra_3_self_intersection_exception() - : std::logic_error("Self-intersection found in the facets involved in the intersection") - {} - }; -#endif - -//TODO an important requirement is that the Polyhedron should be based on a list-based -//HDS. We use a lot of maps that use the address of Facet,Halfedge and a reallocation would -//be dramatic. - -template< class Polyhedron, - class Kernel_=Default, - class Node_visitor_=Default, - class Node_storage_type_=Default, - class Use_const_polyhedron_=Default, - class PolyhedronPointPMap_=Default - > -class Intersection_of_Polyhedra_3{ -//Default template parameters - typedef typename Default::Get >::type Node_visitor; - typedef typename Default::Get::type Node_storage_type; - typedef typename Default::Get > ::type PolyhedronPointPMap; - typedef typename Default::Get::type Use_const_polyhedron; - typedef typename Default::Get::value_type >::Kernel >::type Kernel; - -//typedefs - typedef typename Kernel::Triangle_3 Triangle; - typedef typename Kernel::Segment_3 Segment; - typedef internal_IOP:: - Polyhedron_types Polyhedron_types; - - typedef typename Polyhedron_types::Polyhedron_ref Polyhedron_ref; - typedef typename Polyhedron_types::Halfedge_handle Halfedge_handle; - typedef typename Polyhedron_types::Halfedge_iterator Halfedge_iterator; - typedef typename Polyhedron_types::Facet_iterator Facet_iterator; - typedef typename Polyhedron_types::Facet_handle Facet_handle; - typedef typename Polyhedron_types::Vertex_handle Vertex_handle; - typedef typename Polyhedron_types::Vertex Vertex; - typedef typename Polyhedron_types::Facet Facet; - typedef CGAL::Box_intersection_d::Box_with_handle_d< - double, 3, Halfedge_handle> Box; - typedef std::pair Facet_pair; - typedef std::pair Facet_pair_and_int; - - typedef internal_IOP:: - Compare_handles Compare_handles; - - typedef internal_IOP:: - Compare_handle_pairs Compare_handle_pairs; - - - typedef std::map,Compare_handle_pairs> Facets_to_nodes_map;//Indeed the boundary of the intersection of two coplanar triangles may contain several segments. - typedef std::set Coplanar_facets_set;//any insertion should be done with make_sorted_pair_of_facets - typedef typename Kernel::Point_3 Node; - typedef internal_IOP::Triangle_segment_intersection_points - Nodes_vector; - - typedef typename internal_IOP:: - Intersection_types - ::Intersection_result Intersection_result; - - typedef std::set Facet_set; - - typedef std::map - Edge_to_intersected_facets; - #ifdef USE_DETECTION_MULTIPLE_DEFINED_EDGES - typedef std::set Coplanar_duplicated_intersection_set; - #endif -//member data - PolyhedronPointPMap ppmap; -//helper functions - static inline Facet_pair - make_sorted_pair_of_facets(Facet_handle fh1,Facet_handle fh2) { - const Facet* f1=&(*fh1); - const Facet* f2=&(*fh2); - if (f1 < f2) - return Facet_pair(fh1,fh2); - return Facet_pair(fh2,fh1); - } - - static inline Facet_pair_and_int - make_sorted_pair_of_facets_with_int(Facet_handle fh1,Facet_handle fh2,int i) { - return std::make_pair(make_sorted_pair_of_facets(fh1,fh2),i); - } - - static inline std::pair make_sorted_void_pair(void* v1,void* v2){ - if (v1opposite()) ) return h; - return h->opposite(); - } - -//member variables - Edge_to_intersected_facets edge_to_sfacet; //Associate a segment to a filtered set of facets that may be intersected - Facets_to_nodes_map f_to_node; //Associate a pair of triangle to their intersection points - Coplanar_facets_set coplanar_facets;//Contains all pairs of triangular facets intersecting that are coplanar - Nodes_vector nodes; //Contains intersection points of polyhedra - Node_visitor* visitor; - bool is_default_visitor; //indicates whether the visitor need to be deleted - #ifdef USE_DETECTION_MULTIPLE_DEFINED_EDGES - //this does not occur only when one extremity of an edge is inside a face. - // The problem occur every time an edge or a part of an edge with two incident triangles - // is on the intersection polyline, I choose to direcly filter the output by removing duplicated edges - Coplanar_duplicated_intersection_set coplanar_duplicated_intersection;//Set containing edges that are duplicated because of edges (partially) included in a triangle - #endif - -//functions that should come from a traits class - bool has_at_least_two_incident_faces(Halfedge_handle edge) - { - return !edge->is_border_edge(); - } - - template - void get_incident_facets(Halfedge_handle edge,Output_iterator out){ - if (!edge->is_border()) *out++=edge->facet(); - if (!edge->opposite()->is_border()) *out++=edge->opposite()->facet(); - } - - template - void get_incident_edges_to_vertex(Halfedge_handle edge,Output_iterator out){ - Halfedge_handle current=edge; - do{ - *out++=current; - current=current->next()->opposite(); - } - while(current!=edge); - } - -//internal functions - - class Map_edge_facet_bbox_intersection { - Edge_to_intersected_facets& edge_to_sfacet; - Polyhedron_ref polyhedron_triangle; - Polyhedron_ref polyhedron_edge; - Node_visitor& visitor; - public: - Map_edge_facet_bbox_intersection(Edge_to_intersected_facets& map_, - Polyhedron_ref P, - Polyhedron_ref Q, - Node_visitor& visitor_) - :edge_to_sfacet(map_),polyhedron_triangle(P),polyhedron_edge(Q),visitor(visitor_){} - - void operator()( const Box* fb, const Box* eb) const { - Halfedge_handle fh = fb->handle(); - Halfedge_handle eh = eb->handle(); - - // The following call to map::insert() attempts an insertion of a pair - // into 'edge_to_sfacet'. If 'eh' is already inserted in the map, - // then the result 'res' is the current entry in the map for 'eh'. - typename Edge_to_intersected_facets::iterator res= - edge_to_sfacet.insert(std::make_pair(eh,Facet_set())).first; - - res->second.insert(fh->facet()); - // That could have been shortened to: - // - // edge_to_sfacet[eh].insert(fh->facet()) - // - // -- Laurent Rineau, 2012/11/01 - - visitor.add_filtered_intersection(eh,fh,polyhedron_edge,polyhedron_triangle); - } - }; - - class Map_edge_facet_bbox_intersection_extract_coplanar { - Edge_to_intersected_facets& edge_to_sfacet; - Coplanar_facets_set& coplanar_facets; - Polyhedron_ref polyhedron_triangle; - Polyhedron_ref polyhedron_edge; - Node_visitor& visitor; - PolyhedronPointPMap ppmap; - public: - Map_edge_facet_bbox_intersection_extract_coplanar( - Edge_to_intersected_facets& map_, - Coplanar_facets_set& coplanar_facets_, - Polyhedron_ref P, - Polyhedron_ref Q, - Node_visitor& visitor_, - PolyhedronPointPMap ppmap) - :edge_to_sfacet(map_),coplanar_facets(coplanar_facets_),polyhedron_triangle(P),polyhedron_edge(Q),visitor(visitor_),ppmap(ppmap) - {} - - void operator()( const Box* fb, const Box* eb) const { - Halfedge_handle fh = fb->handle(); //handle for the face - Halfedge_handle eh = eb->handle(); //handle for the edge - if(eh->is_border()) eh = eh->opposite(); - CGAL_assertion(!eh->is_border()); - - //check if the segment intersects the plane of the facet or if it is included in the plane - const typename Kernel::Point_3 & a = get(ppmap, fh->vertex()); - const typename Kernel::Point_3 & b = get(ppmap, fh->next()->vertex()); - const typename Kernel::Point_3 & c = get(ppmap, fh->next()->next()->vertex()); - const Orientation abcp = orientation(a,b,c, get(ppmap, eh->vertex())); - const Orientation abcq = orientation(a,b,c, get(ppmap, eh->opposite()->vertex())); - if (abcp==abcq){ - if (abcp!=COPLANAR){ -// std::cout << "rejected " << &(*fh->facet()) << "{" << &(*eh->facet()) << " " <<&(*eh->opposite()->facet()) << " "<< get(ppmap, eh->vertex()) << " " << get(eh->opposite()->vertex()) << "}" <is_border() && */ orientation(a,b,c,get(ppmap, eh->next()->vertex()))==COPLANAR){ - coplanar_facets.insert(make_sorted_pair_of_facets(eh->facet(),fh->facet())); - } - if (!eh->opposite()->is_border() && orientation(a,b,c,get(ppmap, eh->opposite()->next()->vertex()))==COPLANAR){ - coplanar_facets.insert(make_sorted_pair_of_facets(eh->opposite()->facet(),fh->facet())); - } - visitor.add_filtered_intersection(eh,fh,polyhedron_edge,polyhedron_triangle); - //in case only the edge is coplanar, the intersection points will be detected using an incident facet - //(see remark at the beginning of the file) - return; - } - - typename Edge_to_intersected_facets::iterator res= - edge_to_sfacet.insert(std::make_pair(eh,Facet_set())).first; - res->second.insert(fh->facet()); - visitor.add_filtered_intersection(eh,fh,polyhedron_edge,polyhedron_triangle); - } - }; - - class Map_edge_facet_bbox_intersection_extract_coplanar_filter_self_intersections { - Polyhedron_ref polyhedron_triangle; - Polyhedron_ref polyhedron_edge; - - std::set& m_reported_facets; - std::vector >& m_intersecting_bboxes; - PolyhedronPointPMap ppmap; - public: - Map_edge_facet_bbox_intersection_extract_coplanar_filter_self_intersections( - Polyhedron_ref P, - Polyhedron_ref Q, - std::set& reported_facets, - std::vector >& intersecting_bboxes, - PolyhedronPointPMap ppmap - ) - : polyhedron_triangle(P) - , polyhedron_edge(Q) - , m_reported_facets(reported_facets) - , m_intersecting_bboxes(intersecting_bboxes) - , ppmap(ppmap) - {} - - void operator()( const Box* fb, const Box* eb) { - m_reported_facets.insert( fb->handle()->facet() ); - m_intersecting_bboxes.push_back( std::make_pair(fb, eb) ); - } - - bool self_intersections_found() - { - try{ - typedef typename CGAL::Box_intersection_d::Box_with_info_d Box; - - // make one box per facet - std::vector boxes; - boxes.reserve(m_reported_facets.size()); - - BOOST_FOREACH(Facet_handle fh, m_reported_facets) - { - boxes.push_back( Box( fh->halfedge()->vertex()->point().bbox() + - fh->halfedge()->next()->vertex()->point().bbox() + - fh->halfedge()->opposite()->vertex()->point().bbox(), fh ) - ); - } - - // generate box pointers - std::vector box_ptr; - box_ptr.reserve(boxes.size()); - typename std::vector::iterator b; - for(b = boxes.begin(); - b != boxes.end(); - b++) - box_ptr.push_back(&*b); - - // compute self-intersections filtered out by boxes - typedef boost::function_output_iterator OutputIterator; - OutputIterator out; - internal::Intersect_facets - intersect_facets(polyhedron_triangle, out, ppmap, Kernel()); - std::ptrdiff_t cutoff = 2000; - CGAL::box_self_intersection_d(box_ptr.begin(), box_ptr.end(),intersect_facets,cutoff); - return false; - } - catch( internal::Throw_at_output::Throw_at_output_exception& ) - { - return true; - } - } - }; - - // This function tests the intersection of the faces of P with the edges of Q - void filter_intersections( Polyhedron_ref P, Polyhedron_ref Q) { - std::vector facet_boxes, edge_boxes; - facet_boxes.reserve( P.size_of_facets()); - for ( Facet_iterator i = P.facets_begin(); i != P.facets_end(); ++i){ - facet_boxes.push_back( - Box( get(ppmap, i->halfedge()->vertex()).bbox() - + get(ppmap, i->halfedge()->next()->vertex()).bbox() - + get(ppmap, i->halfedge()->next()->next()->vertex()).bbox(), - i->halfedge())); - } - std::vector facet_box_ptr; - facet_box_ptr.reserve( P.size_of_facets()); - for ( typename std::vector::iterator j = facet_boxes.begin(); j != facet_boxes.end(); ++j){ - facet_box_ptr.push_back( &*j); - } - - for ( Halfedge_iterator i = Q.halfedges_begin(); i != Q.halfedges_end(); ++i){ - if(&*i < &*(i->opposite())){ - edge_boxes.push_back( - Box( get(ppmap, i->vertex()).bbox() - + get(ppmap, i->opposite()->vertex()).bbox(), - i)); - } - } - - std::vector edge_box_ptr; - edge_box_ptr.reserve( Q.size_of_halfedges()/2); - for ( typename std::vector::iterator j = edge_boxes.begin(); j != edge_boxes.end(); ++j){ - edge_box_ptr.push_back( &*j); - } - - #ifdef CGAL_COREFINEMENT_DO_REPORT_SELF_INTERSECTIONS - // this version first collect faces involved in the intersection and first - // check if they are involved in a self-intersection. - std::set reported_facets; - std::vector > intersecting_bboxes; - Map_edge_facet_bbox_intersection_extract_coplanar_filter_self_intersections - inter_functor4selfi(P, Q, reported_facets, intersecting_bboxes, ppmap); - CGAL::box_intersection_d( facet_box_ptr.begin(), facet_box_ptr.end(), - edge_box_ptr.begin(), edge_box_ptr.end(), - inter_functor4selfi, std::ptrdiff_t(2000) ); - - if (inter_functor4selfi.self_intersections_found()) throw Intersection_of_Polyhedra_3_self_intersection_exception(); - - #ifdef DO_NOT_HANDLE_COPLANAR_FACETS - Map_edge_facet_bbox_intersection inter_functor(edge_to_sfacet,P,Q,*visitor); - #else // not DO_NOT_HANDLE_COPLANAR_FACETS - Map_edge_facet_bbox_intersection_extract_coplanar inter_functor(edge_to_sfacet,coplanar_facets,P,Q,*visitor,ppmap); - #endif // not DO_NOT_HANDLE_COPLANAR_FACETS - - typedef std::pair Type_pair; - BOOST_FOREACH(const Type_pair& p, intersecting_bboxes) - inter_functor(p.first, p.second); - #else - CGAL::box_intersection_d( facet_box_ptr.begin(), facet_box_ptr.end(), - edge_box_ptr.begin(), edge_box_ptr.end(), - #ifdef DO_NOT_HANDLE_COPLANAR_FACETS - // Note that 'edge_to_sfacet' is passed by - // non-const reference, here, to be filled. - Map_edge_facet_bbox_intersection(edge_to_sfacet,P,Q,*visitor), - #else // not DO_NOT_HANDLE_COPLANAR_FACETS - Map_edge_facet_bbox_intersection_extract_coplanar(edge_to_sfacet,coplanar_facets,P,Q,*visitor,ppmap), - #endif // not DO_NOT_HANDLE_COPLANAR_FACETS - std::ptrdiff_t(2000) - ); - #endif - } - - - void add_intersection_point_to_facet_and_all_edge_incident_facets(Facet_handle facet, - Halfedge_handle edge, - int node_id) - { - std::vector incident_facets; - get_incident_facets(edge,std::back_inserter(incident_facets)); - for (typename std::vector::iterator it=incident_facets.begin(); - it!=incident_facets.end();++it) - { - CGAL_assertion(cgal_do_intersect_debug(facet,*it)); - - Facet_pair facet_pair = make_sorted_pair_of_facets(facet,*it); - if ( !coplanar_facets.empty() && coplanar_facets.find(facet_pair)!=coplanar_facets.end() ) continue; - typename Facets_to_nodes_map::iterator it_list= - f_to_node.insert( std::make_pair( Facet_pair_and_int(facet_pair,0),std::set()) ).first; - it_list->second.insert(node_id); - } - } - - void cip_handle_case_edge(int node_id, - Facet_set* fset, - Halfedge_handle edge, - Halfedge_handle edge_intersected) - { - //associate the intersection point to all facets incident to the intersected edge using edge - std::vector incident_facets; - get_incident_facets(edge_intersected,std::back_inserter(incident_facets)); - for (typename std::vector::iterator it=incident_facets.begin(); - it!=incident_facets.end();++it) - { - add_intersection_point_to_facet_and_all_edge_incident_facets(*it,edge,node_id); - if (fset!=NULL) fset->erase(*it); - } - incident_facets.clear(); - - //associate the intersection point to all facets incident to edge using the intersected edge - //at least one pair of facets is already handle above - - typename Edge_to_intersected_facets::iterator it_fset=edge_to_sfacet.find(edge_intersected); - if (it_fset==edge_to_sfacet.end()) return; - Facet_set& fset_bis=it_fset->second; - get_incident_facets(edge,std::back_inserter(incident_facets)); - for (typename std::vector::iterator it=incident_facets.begin(); - it!=incident_facets.end();++it) - { -// add_intersection_point_to_facet_and_all_edge_incident_facets(*it,edge_intersected,node_id); //this call is not needed, already done in the first loop - fset_bis.erase(*it); - } - } - - void cip_handle_case_vertex(int node_id, - Facet_set* fset, - Halfedge_handle edge, - Halfedge_handle vertex_intersected) - { - std::vector incident_halfedges; - get_incident_edges_to_vertex(vertex_intersected,std::back_inserter(incident_halfedges)); - for (typename std::vector::iterator - it=incident_halfedges.begin();it!=incident_halfedges.end();++it) - { - cip_handle_case_edge(node_id,fset,edge,*it); - } - } - - //add a new node in the final graph. - //it is the intersection of the triangle with the segment - void add_new_node(Halfedge_handle edge, - Facet_handle facet, - const Intersection_result& inter_res, - Nodes_vector& nodes) - { - bool is_vertex_coplanar = CGAL::cpp11::get<2>(inter_res); - if (is_vertex_coplanar) - nodes.add_new_node(get(ppmap, edge->vertex())); - else{ - bool is_opposite_vertex_coplanar = CGAL::cpp11::get<3>(inter_res); - if (is_opposite_vertex_coplanar) - nodes.add_new_node(get(ppmap, edge->opposite()->vertex())); - else - nodes.add_new_node(edge,facet); - } - } - - //either the exact or input point can be used to create a node - //with this function - template - void add_new_node(const Point& pt) - { - nodes.add_new_node(pt); - } - - - #ifdef USE_DETECTION_MULTIPLE_DEFINED_EDGES - void check_coplanar_edge(Halfedge_handle hedge,Facet_handle facet) - { - const typename Kernel::Point_3& p0=get(ppmap, facet->halfedge()->vertex()); - const typename Kernel::Point_3& p1=get(ppmap, facet->halfedge()->next()->vertex()); - const typename Kernel::Point_3& p2=get(ppmap, facet->halfedge()->opposite()->vertex()); - CGAL_precondition( orientation( p0,p1,p2,get(ppmap, hedge->vertex()) ) == COPLANAR ); - - if ( has_at_least_two_incident_faces(hedge) && orientation( p0,p1,p2,get(ppmap, hedge->opposite()->vertex()) ) == COPLANAR ) - { - //In case two facets are incident along such this edge, the intersection - //will be reported twice. We keep track of this so that at the end, we can remove one intersecting edge out of the two - //choose the smaller of the two faces (only one need to de deleted) - Facet_handle smaller=make_sorted_pair_of_facets(hedge->face(),hedge->opposite()->face()).first; - coplanar_duplicated_intersection.insert(make_sorted_pair_of_facets(smaller,facet)); - } - } - - bool are_incident_facets_coplanar(Halfedge_handle hedge){ - const typename Kernel::Point_3& p0=get(ppmap, hedge->vertex()); - const typename Kernel::Point_3& p1=get(ppmap, hedge->next()->vertex()); - const typename Kernel::Point_3& p2=get(ppmap, hedge->opposite()->vertex()); - const typename Kernel::Point_3& p3=get(ppmap, hedge->opposite()->next()->vertex()); - return orientation( p0,p1,p2,p3 ) == COPLANAR; - } - - void check_coplanar_edge(Halfedge_handle hedge,Halfedge_handle additional_edge,internal_IOP::Intersection_type type) - { - switch(type){ - case internal_IOP::FACET: - check_coplanar_edge(hedge,additional_edge->face()); - break; - - case internal_IOP::EDGE: - if ( !additional_edge->is_border() ){ - check_coplanar_edge(hedge,additional_edge->face()); - } - if (!additional_edge->opposite()->is_border()) - check_coplanar_edge(hedge,additional_edge->opposite()->face()); - break; - case internal_IOP::VERTEX: - { - //consider all incident faces - Halfedge_handle current=additional_edge; - do{ - if( !current->is_border() ) - check_coplanar_edge(hedge,current->face()); - current=current->next()->opposite(); - } - while(current!=additional_edge); - } - break; - - default: - CGAL_assertion(type==internal_IOP::COPLNR); - break; - } - } - - void check_coplanar_edge_old(Halfedge_handle hedge,Halfedge_handle additional_edge,internal_IOP::Intersection_type type) - { - switch(type){ - case internal_IOP::FACET: - check_coplanar_edge(hedge,additional_edge->face()); - break; - - case internal_IOP::EDGE: - { - if ( !additional_edge->is_border() ){ - if (!additional_edge->opposite()->is_border()){ - if ( are_incident_facets_coplanar(additional_edge) ) - { - Facet_handle facet=additional_edge->face(); - const typename Kernel::Point_3& p0=get(ppmap, facet->halfedge()->vertex()); - const typename Kernel::Point_3& p1=get(ppmap, facet->halfedge()->next()->vertex()); - const typename Kernel::Point_3& p2=get(ppmap, facet->halfedge()->opposite()->vertex()); - CGAL_precondition( orientation( p0,p1,p2, get(ppmap, hedge->vertex()) ) == COPLANAR ); - - if ( has_at_least_two_incident_faces(hedge) && orientation( p0,p1,p2, get(ppmap, hedge->opposite()->vertex()) ) == COPLANAR ) - { - //In case two facets are incident along a common edge of two coplanar triangles. - //We need to remove three out of the four reported pair - Facet_handle smaller=make_sorted_pair_of_facets(hedge->face(),hedge->opposite()->face()).first; - coplanar_duplicated_intersection.insert(make_sorted_pair_of_facets(hedge->face(),facet)); - coplanar_duplicated_intersection.insert(make_sorted_pair_of_facets(hedge->opposite()->face(),facet)); - coplanar_duplicated_intersection.insert(make_sorted_pair_of_facets(hedge->opposite()->face(),additional_edge->opposite()->face())); - } - } - else - { - check_coplanar_edge(hedge,additional_edge->face()); - check_coplanar_edge(hedge,additional_edge->opposite()->face()); - } - } - else - check_coplanar_edge(hedge,additional_edge->face()); - } - else{ - CGAL_assertion(!additional_edge->opposite()->is_border()); - check_coplanar_edge(hedge,additional_edge->opposite()->face()); - } - } - break; - case internal_IOP::VERTEX: - - break; - - default: - CGAL_assertion(type==internal_IOP::COPLNR); - break; - } - } - - template - void check_coplanar_edges(Hedge_iterator begin,Hedge_iterator end,Halfedge_handle additional_edge,internal_IOP::Intersection_type type) - { - for (Hedge_iterator it=begin;it!=end;++it) - check_coplanar_edge(*it,additional_edge,type); - } - #endif // USE_DETECTION_MULTIPLE_DEFINED_EDGES - - void print_type_debug(internal_IOP::Intersection_type type,bool cpl,bool opp_cpl) - { - switch(type){ - case internal_IOP::COPLNR: - std::cout << "COPLNR " << cpl << " " << opp_cpl << std::endl; - break; - case internal_IOP::EMPTY: - std::cout << "EMPTY " << cpl << " " << opp_cpl << std::endl; - break; - - case internal_IOP::FACET: - std::cout << "FACET " << cpl << " " << opp_cpl << std::endl; - break; - - case internal_IOP::EDGE: - std::cout << "EDGE " << cpl << " " << opp_cpl << std::endl; - break; - case internal_IOP::VERTEX: - std::cout << "VERTEX " << cpl << " " << opp_cpl << std::endl; - break; - } - } - - - void handle_coplanar_case_VERTEX_FACET(Halfedge_handle vertex,Halfedge_handle facet,int node_id, bool is_new_node){ - if (is_new_node) - visitor->new_node_added(node_id,internal_IOP::FACET,vertex,facet,true,false); - std::vector all_edges; - get_incident_edges_to_vertex(vertex,std::back_inserter(all_edges)); - typename std::vector::iterator it_edge=all_edges.begin(); - for (;it_edge!=all_edges.end();++it_edge){ - add_intersection_point_to_facet_and_all_edge_incident_facets(facet->facet(),*it_edge,node_id); - typename Edge_to_intersected_facets::iterator it_ets=edge_to_sfacet.find(*it_edge); - if (it_ets!=edge_to_sfacet.end()) it_ets->second.erase(facet->facet()); - } - } - - void handle_coplanar_case_VERTEX_EDGE(Halfedge_handle vertex,Halfedge_handle edge,int node_id, bool is_new_node){ - if(is_new_node) - visitor->new_node_added(node_id,internal_IOP::VERTEX,edge,vertex,false,false); - std::vector all_edges; - get_incident_edges_to_vertex(vertex,std::back_inserter(all_edges)); - typename std::vector::iterator it_edge=all_edges.begin(); - for (;it_edge!=all_edges.end();++it_edge){ - typename Edge_to_intersected_facets::iterator it_ets=edge_to_sfacet.find(*it_edge); - Facet_set* fset = (it_ets!=edge_to_sfacet.end())?&(it_ets->second):NULL; - cip_handle_case_edge(node_id,fset,*it_edge,edge); - } - } - - void handle_coplanar_case_VERTEX_VERTEX(Halfedge_handle vertex1,Halfedge_handle vertex2,int node_id, bool is_new_node){ - if (is_new_node) - visitor->new_node_added(node_id,internal_IOP::VERTEX,vertex2,vertex1,true,false); - std::vector all_edges; - get_incident_edges_to_vertex(vertex1,std::back_inserter(all_edges)); - typename std::vector::iterator it_edge=all_edges.begin(); - for (;it_edge!=all_edges.end();++it_edge){ - typename Edge_to_intersected_facets::iterator it_ets=edge_to_sfacet.find(*it_edge); - Facet_set* fset = (it_ets!=edge_to_sfacet.end())?&(it_ets->second):NULL; - cip_handle_case_vertex(node_id,fset,*it_edge,vertex2); - } - } - - - template - std::pair get_or_create_node(Cpl_inter_pt& ipt,int& current_node,Coplanar_node_map& coplanar_node_map){ - void *v1, *v2; - switch(ipt.type_1){ - case internal_IOP::VERTEX: v1=(void*)( &(*(ipt.info_1->vertex())) ); break; - case internal_IOP::EDGE : v1=(void*)( &(*smaller_handle(ipt.info_1)) ); break; - case internal_IOP::FACET : v1=(void*)( &(*(ipt.info_1->facet())) ); break; - default: CGAL_error_msg("Should not get there!"); - } - - switch(ipt.type_2){ - case internal_IOP::VERTEX: v2=(void*)( &(*(ipt.info_2->vertex())) ); break; - case internal_IOP::EDGE : v2=(void*)( &(*smaller_handle(ipt.info_2)) ); break; - case internal_IOP::FACET : v2=(void*)( &(*(ipt.info_2->facet())) ); break; - default: CGAL_error_msg("Should not get there!"); - } - - std::pair key=make_sorted_void_pair(v1,v2); - - std::pair res=coplanar_node_map.insert(std::make_pair(key,current_node+1)); - if (res.second){ //insert a new node - - if (ipt.type_1==internal_IOP::VERTEX) - add_new_node(get(ppmap, ipt.info_1->vertex())); - else{ - if(ipt.type_2==internal_IOP::VERTEX) - add_new_node(get(ppmap, ipt.info_2->vertex())); - else - add_new_node(ipt.point); - } - return std::pair(++current_node, true); - } - return std::pair(res.first->second, false); - } - - void compute_intersection_of_coplanar_facets(int& current_node){ - typedef std::map,int> Coplanar_node_map; - Coplanar_node_map coplanar_node_map; - - for (typename Coplanar_facets_set::iterator it=coplanar_facets.begin();it!=coplanar_facets.end();++it){ - Facet_handle f1=it->first; - Facet_handle f2=it->second; - typedef internal_IOP::Intersection_point_with_info Cpl_inter_pt; - std::list inter_pts; - internal_IOP::intersection_coplanar_facets(f1->halfedge(),f2->halfedge(),ppmap,inter_pts); -// std::cout << "found " << inter_pts.size() << " inter pts: "; - std::size_t nb_pts=inter_pts.size(); - if (inter_pts.empty()) continue; - std::vector cpln_nodes; cpln_nodes.reserve(nb_pts); - for (typename std::list::iterator iti=inter_pts.begin();iti!=inter_pts.end();++iti){ - #ifdef CGAL_COREFINEMENT_DEBUG - //iti->print_debug(); - #endif - CGAL_assertion(iti->is_valid()); - int node_id; - bool is_new_node; - cpp11::tie(node_id, is_new_node)=get_or_create_node(*iti,current_node,coplanar_node_map); - cpln_nodes.push_back(node_id); - - switch(iti->type_1){ - case internal_IOP::VERTEX: - { - switch(iti->type_2){ - case internal_IOP::VERTEX: handle_coplanar_case_VERTEX_VERTEX(iti->info_1,iti->info_2,node_id, is_new_node); break; - case internal_IOP::EDGE : handle_coplanar_case_VERTEX_EDGE(iti->info_1,iti->info_2,node_id, is_new_node); break; - case internal_IOP::FACET : handle_coplanar_case_VERTEX_FACET(iti->info_1,iti->info_2,node_id, is_new_node); break; - default: CGAL_error_msg("Should not get there!"); - } - } - break; - case internal_IOP::EDGE:{ - switch(iti->type_2){ - case internal_IOP::VERTEX:handle_coplanar_case_VERTEX_EDGE(iti->info_2,iti->info_1,node_id, is_new_node);break; - case internal_IOP::EDGE: - { - if (is_new_node) - visitor->new_node_added(node_id,internal_IOP::EDGE,iti->info_1,iti->info_2,false,false); - typename Edge_to_intersected_facets::iterator it_ets=edge_to_sfacet.find(iti->info_1); - Facet_set* fset = (it_ets!=edge_to_sfacet.end())?&(it_ets->second):NULL; - cip_handle_case_edge(node_id,fset,iti->info_1,iti->info_2); - } - break; - default: CGAL_error_msg("Should not get there!"); - } - } - break; - - case internal_IOP::FACET: - { - CGAL_assertion(iti->type_2==internal_IOP::VERTEX); - handle_coplanar_case_VERTEX_FACET(iti->info_2,iti->info_1,node_id, is_new_node); - } - break; - - default: CGAL_error_msg("Should not get there!"); - } - } - switch (nb_pts){ - case 0: break; - case 1: - { - typename Facets_to_nodes_map::iterator it_list= - f_to_node.insert( std::make_pair( Facet_pair_and_int(*it,1),std::set()) ).first; - it_list->second.insert(cpln_nodes[0]); - } - break; - default: - { - int i=0; - std::size_t stop=nb_pts + (nb_pts<3?-1:0); - for (std::size_t k=0;k()) ).first; - it_list->second.insert( cpln_nodes[k] ); - it_list->second.insert( cpln_nodes[(k+1)%nb_pts] ); - } - } - } -// std::cout << std::endl; - } - } - - void compute_intersection_points(int& current_node){ - for(typename Edge_to_intersected_facets::iterator it=edge_to_sfacet.begin();it!=edge_to_sfacet.end();++it){ - Halfedge_handle edge=it->first; - Facet_set& fset=it->second; - while (!fset.empty()){ - Facet_handle facet=*fset.begin(); - - Intersection_result res=internal_IOP::do_intersect(edge,facet,ppmap); - internal_IOP::Intersection_type type=CGAL::cpp11::get<0>(res); - - //handle degenerate case: one extremity of edge below to facet - std::vector all_edges; - if ( CGAL::cpp11::get<2>(res) ) - get_incident_edges_to_vertex(edge,std::back_inserter(all_edges)); - else{ - if ( CGAL::cpp11::get<3>(res) ) - get_incident_edges_to_vertex(edge->opposite(),std::back_inserter(all_edges)); - else - all_edges.push_back(edge); - } - - CGAL_precondition(*all_edges.begin()==edge || *all_edges.begin()==edge->opposite()); -// print_type_debug(type,CGAL::cpp11::get<2>(res),CGAL::cpp11::get<3>(res)); - - #ifdef USE_DETECTION_MULTIPLE_DEFINED_EDGES - check_coplanar_edges(boost::next(all_edges.begin()),all_edges.end(),CGAL::cpp11::get<1>(res),type); - #endif - - typename std::vector::iterator it_edge=all_edges.begin(); - switch(type){ - case internal_IOP::COPLNR: - #ifndef DO_NOT_HANDLE_COPLANAR_FACETS - assert(!"COPLNR : this point should never be reached!"); - #else - //nothing need to be done, cf. comments at the beginning of the file - #endif - break; - case internal_IOP::EMPTY: - fset.erase(fset.begin()); - CGAL_assertion(!cgal_do_intersect_debug(edge,facet)); - break; - - // Case when the edge pierces the facet in its interior. - case internal_IOP::FACET: - { - CGAL_assertion(cgal_do_intersect_debug(edge,facet)); - CGAL_assertion(facet==CGAL::cpp11::get<1>(res)->face()); - - int node_id=++current_node; - add_new_node(edge,facet,res,nodes); - visitor->new_node_added(node_id,internal_IOP::FACET,edge,facet->halfedge(),CGAL::cpp11::get<2>(res),CGAL::cpp11::get<3>(res)); - for (;it_edge!=all_edges.end();++it_edge){ - add_intersection_point_to_facet_and_all_edge_incident_facets(facet,*it_edge,node_id); - //erase facet from the list to test intersection with it_edge - if ( it_edge==all_edges.begin() ) - fset.erase(fset.begin()); - else - { - typename Edge_to_intersected_facets::iterator it_ets=edge_to_sfacet.find(*it_edge); - if(it_ets!=edge_to_sfacet.end()) it_ets->second.erase(facet); - } - } - } // end case FACET - break; - - // Case when the edge intersect one edge of the facet. - case internal_IOP::EDGE: - { - CGAL_assertion(cgal_do_intersect_debug(edge,facet)); - int node_id=++current_node; - add_new_node(edge,facet,res,nodes); - Halfedge_handle edge_intersected=CGAL::cpp11::get<1>(res); - visitor->new_node_added(node_id,internal_IOP::EDGE,edge,edge_intersected,CGAL::cpp11::get<2>(res),CGAL::cpp11::get<3>(res)); - for (;it_edge!=all_edges.end();++it_edge){ - if ( it_edge!=all_edges.begin() ){ - typename Edge_to_intersected_facets::iterator it_ets=edge_to_sfacet.find(*it_edge); - Facet_set* fset_bis = (it_ets!=edge_to_sfacet.end())?&(it_ets->second):NULL; - cip_handle_case_edge(node_id,fset_bis,*it_edge,edge_intersected); - } - else - cip_handle_case_edge(node_id,&fset,*it_edge,edge_intersected); - } - } // end case EDGE - break; - - case internal_IOP::VERTEX: - { - CGAL_assertion(cgal_do_intersect_debug(edge,facet)); - int node_id=++current_node; - Halfedge_handle vertex_intersected=CGAL::cpp11::get<1>(res); - add_new_node(get(ppmap, vertex_intersected->vertex())); //we use the original vertex to create the node - //before it was internal_IOP::FACET but do not remember why, probably a bug... - visitor->new_node_added(node_id,internal_IOP::VERTEX,edge,vertex_intersected,CGAL::cpp11::get<2>(res),CGAL::cpp11::get<3>(res)); - for (;it_edge!=all_edges.end();++it_edge){ - if ( it_edge!=all_edges.begin() ){ - typename Edge_to_intersected_facets::iterator it_ets=edge_to_sfacet.find(*it_edge); - Facet_set* fset_bis = (it_ets!=edge_to_sfacet.end())?&(it_ets->second):NULL; - cip_handle_case_vertex(node_id,fset_bis,*it_edge,vertex_intersected); - } - else - cip_handle_case_vertex(node_id,&fset,*it_edge,vertex_intersected); - } - } // end case VERTEX - break; - - } // end switch on the type of the intersection - } // end loop on all facets that intersect the edge - } // end loop on all entries (edges) in 'edge_to_sfacet' - CGAL_assertion(nodes.size()==unsigned(current_node+1)); - } - - #ifdef USE_DETECTION_MULTIPLE_DEFINED_EDGES - void remove_duplicated_intersecting_edges() - { - for (typename Coplanar_duplicated_intersection_set::iterator - it=coplanar_duplicated_intersection.begin(); - it!=coplanar_duplicated_intersection.end(); - ++it) - { - typename Facets_to_nodes_map::iterator res=f_to_node.find(*it); - //CGAL_assertion(res!=f_to_node.end()); - //we cannot use a precondition here: in some cases the coplanarity test is not sufficient. - //if on surface1 we have to coplanar triangle incident along edge e. Then in surface2, take a triangle - //with one edge inside one triangle of surface1 such that one vertex in on e. Then the collinearity test - //return true for both faces but only one implies a duplicated edge - if(res!=f_to_node.end()) - f_to_node.erase(res); - } - } - #else // not USE_DETECTION_MULTIPLE_DEFINED_EDGES - void remove_duplicated_intersecting_edges() - { - std::set< std::pair > already_seen; - std::list to_erase; - for (typename Facets_to_nodes_map::iterator - it=f_to_node.begin(); - it!=f_to_node.end(); - ++it - ) - { - if (it->second.size()==1) continue; - CGAL_precondition(it->second.size()==2); - //it->second is a set so int are already sorted - bool is_new=already_seen.insert( std::make_pair( - *(it->second.begin()), - *boost::next(it->second.begin()) ) - ).second; - - if (!is_new) - to_erase.push_back(it); - } - - for ( typename std::list::iterator - it=to_erase.begin();it!=to_erase.end();++it - ) - f_to_node.erase(*it); - } - #endif // not USE_DETECTION_MULTIPLE_DEFINED_EDGES - - - struct Graph_node{ - std::set neighbors; - unsigned degree; - - Graph_node():degree(0){} - - void insert(int i){ - ++degree; - CGAL_assertion(neighbors.find(i)==neighbors.end()); - neighbors.insert(i); - } - - void erase(int i){ - CGAL_assertion(neighbors.find(i)!=neighbors.end()); - neighbors.erase(i); - } - void make_terminal() {if (degree==2) degree=45;} - bool is_terminal()const {return degree!=2;} - bool empty() const {return neighbors.empty();} - int top() const {return *neighbors.begin();} - void pop() { - CGAL_assertion(!neighbors.empty()); - neighbors.erase(neighbors.begin()); - } - }; - - - template - void construct_polylines(Nodes_vector& nodes,Output_iterator out){ - std::size_t nb_nodes=nodes.size(); - std::vector graph(nb_nodes); - //counts the number of time each node has been seen - bool isolated_point_seen=false; - for (typename Facets_to_nodes_map::iterator it=f_to_node.begin();it!=f_to_node.end();++it){ - const std::set& segment=it->second; - CGAL_assertion(segment.size()==2 || segment.size()==1); - if (segment.size()==2){ - int i=*segment.begin(); - int j=*boost::next(segment.begin()); - graph[i].insert(j); - graph[j].insert(i); - } - else{ - CGAL_assertion(segment.size()==1); - isolated_point_seen=true; - } - } - - //visitor call - visitor->annotate_graph(graph.begin(),graph.end()); - - //collect terminal and interior nodes - boost::dynamic_bitset<> terminal_nodes(nb_nodes), interior_nodes(nb_nodes); - for (std::size_t i=0;i(1,nodes[static_cast(i)]); - visitor->start_new_polyline(static_cast(i),static_cast(i)); - terminal_nodes.reset(i); - } - } - - //handle polylines - while(terminal_nodes.any()) - { - int i = static_cast(terminal_nodes.find_first()); - Graph_node& node_i = graph[i]; - std::vector polyline; - - int j=node_i.top(); - visitor->start_new_polyline(i,j); - CGAL_assertion(i!=j); - node_i.pop(); - if (node_i.empty()) - terminal_nodes.reset(i); - polyline.push_back(nodes[i]); - while(true){ - Graph_node& node_j=graph[j]; - CGAL_assertion(!node_j.empty()); - node_j.erase(i); - i=j; - polyline.push_back(nodes[i]); - if (node_j.is_terminal()) - { - if (node_j.empty()) - terminal_nodes.reset(j); - break; - } - else{ - j=node_j.top(); - visitor->add_node_to_polyline(j); - node_j.pop(); - CGAL_assertion(node_j.empty()); - interior_nodes.reset(i); - } - } - *out++=polyline; - } - - //handle cycles - while(interior_nodes.any()) - { - int i=static_cast(interior_nodes.find_first()); - Graph_node& node_i=graph[i]; - std::vector polyline; - - int j=node_i.top(); - visitor->start_new_polyline(i,j); - interior_nodes.reset(i); - polyline.push_back(nodes[i]); - int first=i; - do{ - Graph_node& node_j=graph[j]; - interior_nodes.reset(j); - node_j.erase(i); - i=j; - polyline.push_back(nodes[i]); - j=node_j.top(); - visitor->add_node_to_polyline(j); - }while(j!=first); - polyline.push_back(nodes[j]);// we duplicate first point for cycles - *out++=polyline; - } - } - - int get_other_int(const std::set& s,int i) const { - if (*s.begin()!=i) return *s.begin(); - return *boost::next(s.begin()); - } - - template - bool is_grabbed(const Dispatch_out_it&) const{ - return CGAL::Is_in_tuple::value; - } - - - template - struct Is_dispatch_based_ouput_iterator{ - typedef boost::false_type type; - }; - - template class Dispatch_based_output_it,class V,class O> - struct Is_dispatch_based_ouput_iterator >{ - typedef typename boost::is_base_of< Dispatch_output_iterator, - Dispatch_based_output_it >::type type; - }; - - template - inline void construct_polylines_with_info(Nodes_vector& nodes,Output_iterator out){ - return construct_polylines_with_info(nodes,out,typename Is_dispatch_based_ouput_iterator::type()); - } - - template - void construct_polylines_with_info(Nodes_vector& nodes,Output_iterator out,boost::false_type){ - construct_polylines_with_info(nodes, - dispatch_or_drop_output >(out),boost::true_type()); - } - - template class Dispatch_based_output_it,class V,class O> - void construct_polylines_with_info(Nodes_vector& nodes, - Dispatch_based_output_it out,boost::true_type) - { - typedef typename Facets_to_nodes_map::value_type Edge; - typedef std::list Polyline_info; - - - std::size_t nb_nodes=nodes.size(); - std::vector node_mult(nb_nodes,0); - std::vector terminal_bools(nb_nodes,false); - std::vector< std::set > connections(nb_nodes); - // --counts the number of time each node has been seen - // --associate to each node its incident edges. An edge = a pair of Facet_handle+2 indices of intersection points - for (typename Facets_to_nodes_map::iterator it=f_to_node.begin();it!=f_to_node.end();++it){ - const std::set& segment=it->second; - CGAL_assertion(segment.size()==2 || segment.size()==1); - if (segment.size()==2){ - int i=*segment.begin(); - int j=*boost::next(segment.begin()); - connections[i].insert(&(*it)); - connections[j].insert(&(*it)); - ++(node_mult[i]); - ++(node_mult[j]); - } - } - - //detect terminal nodes and isolated nodes - for (unsigned k=0;k(1,nodes[k]); - if ( is_grabbed >(out)) - *out++=std::vector(); - } - } - - //visitor call - visitor->update_terminal_nodes(terminal_bools); - - //We start from a node N and recursively walk one edge to find other - // node. If this is a cycle we stop when we are back at the node N; - //otherwise we stop at a terminal node and restart a walk from N - //following another edge (if N is not terminal) until finding a terminal - //node. With this we can associate to each edge the pair of facet_handle - //intersecting that define this edge. - unsigned current_node=0; - while (current_node!=nb_nodes){ - if (connections[current_node].empty()){ - ++current_node; - continue; - } - - Edge* edge=*connections[current_node].begin(); - connections[current_node].erase(connections[current_node].begin()); - - Polyline_info polyline_info; - std::list polyline_embedding; - - if ( is_grabbed >(out)) - polyline_info.push_back(edge->first.first); - polyline_embedding.push_back(nodes[current_node]); - - unsigned i=current_node; - unsigned start_node=current_node; - bool reverse=false; - while (true){ - i=get_other_int(edge->second,i); - connections[i].erase(edge); - - if (reverse) polyline_embedding.push_front(nodes[i]); - else polyline_embedding.push_back(nodes[i]); - - if (i==start_node) break; - if (terminal_bools[i]){ - if (reverse || terminal_bools[current_node]) break; - reverse=true; - i=current_node; - if ( connections[i].empty() ) break; - } - - edge=*connections[i].begin(); - connections[i].erase(connections[i].begin()); - - if ( is_grabbed >(out)){ - if (reverse) polyline_info.push_front(edge->first.first); - else polyline_info.push_back(edge->first.first); - } - - } - - *out++=std::vector(polyline_embedding.begin(),polyline_embedding.end()); - if ( is_grabbed >(out)){ - CGAL_assertion(polyline_embedding.size()==polyline_info.size()+1); - *out++=std::vector(polyline_info.begin(),polyline_info.end()); - } - } - } - -//debug functions - - bool cgal_do_intersect_debug(Halfedge_handle eh,Facet_handle fh){ - Triangle t( get(ppmap, fh->halfedge()->vertex()), - get(ppmap, fh->halfedge()->next()->vertex()), - get(ppmap, fh->halfedge()->next()->next()->vertex())); - - Segment s( get(ppmap, eh->vertex()), - get(ppmap, eh->opposite()->vertex())); - - return CGAL::do_intersect( s, t); - } - - bool cgal_do_intersect_debug(Facet_handle fh1,Facet_handle fh2){ - Triangle t1( get(ppmap, fh1->halfedge()->vertex()), - get(ppmap, fh1->halfedge()->next()->vertex()), - get(ppmap, fh1->halfedge()->next()->next()->vertex())); - Triangle t2( get(ppmap, fh2->halfedge()->vertex()), - get(ppmap, fh2->halfedge()->next()->vertex()), - get(ppmap, fh2->halfedge()->next()->next()->vertex())); - - - return CGAL::do_intersect( t1, t2); - } - - void print_f_to_node_debug(){ - std::cout << "print_f_to_node_debug " << &f_to_node << std::endl; - for (typename Facets_to_nodes_map::iterator it=f_to_node.begin();it!=f_to_node.end();++it){ - std::cout << &(*(it->first.first.first)) << " " << &(*(it->first.first.second)) << " " << it->first.second << " -> {"; - std::copy(it->second.begin(),it->second.end(),std::ostream_iterator(std::cout,",")); - std::cout << "}" <& graph){ - for (typename std::map::const_iterator it=graph.begin();it!=graph.end();++it){ - std::cout << it->first << " -> {"; - std::copy(it->second.neighbors.begin(),it->second.neighbors.end(),std::ostream_iterator(std::cout,",")); - std::cout << "}" <second; - std::cout << &fset << " fset size " << fset.size() << std::endl; - } - } - - - template - OutputIterator main_run(OutputIterator out,bool build_polylines=true){ - // std::cout << edge_to_sfacet.size() << std::endl; - int current_node=-1; - - //print_edge_to_sfacet_debug(); - #ifndef DO_NOT_HANDLE_COPLANAR_FACETS - //first handle coplanar triangles - compute_intersection_of_coplanar_facets(current_node); - visitor->set_number_of_intersection_points_from_coplanar_facets(current_node+1); - if (!coplanar_facets.empty()) - visitor->input_have_coplanar_facets(); - #endif // not DO_NOT_HANDLE_COPLANAR_FACETS - //print_edge_to_sfacet_debug(); - //compute intersection points of segments and triangles. - //build node of the graph - //build connectivity info - compute_intersection_points(current_node); // 'current_node' is passed by - // non-const reference - - if (!build_polylines){ - visitor->finalize(nodes); - return out; - } - //remove duplicated intersecting edges: - // In case two facets are incident along such an edge coplanar in a facet of another polyhedron (and one extremity inside the facet), the intersection - // will be reported twice. We kept track (check_coplanar_edge(s)) of this so that, we can remove one intersecting edge out of the two - //print_f_to_node_debug(); - remove_duplicated_intersecting_edges(); - - //std::cout << "f_to_node "<< f_to_node.size() << std::endl; - //print_f_to_node_debug(); - //collect connectivity infos and create polylines - if ( Node_visitor::do_need_vertex_graph ) - construct_polylines(nodes,out); //using the graph approach (at some point we know all connections between intersection points) - else - construct_polylines_with_info(nodes,out); //direct construction by propagation - - visitor->finalize(nodes); - - return out; - } - -public: - Intersection_of_Polyhedra_3(PolyhedronPointPMap ppmap=PolyhedronPointPMap()) - :ppmap(ppmap),nodes(ppmap), - visitor(new Node_visitor()), - is_default_visitor(true){} - Intersection_of_Polyhedra_3(Node_visitor& v, - PolyhedronPointPMap ppmap=PolyhedronPointPMap()) - :ppmap(ppmap),nodes(ppmap),visitor(&v),is_default_visitor(false){} - ~Intersection_of_Polyhedra_3(){if (is_default_visitor) delete visitor;} - //pairwise intersection between all elements in the range - template - OutputIterator - operator()(InputIterator begin, InputIterator end, OutputIterator out) { - for(InputIterator it1=begin;it1!=end;++it1){ - CGAL_precondition( it1->is_pure_triangle() ); - Polyhedron_ref P=*it1; - visitor->new_input_polyhedron(P); - for(InputIterator it2=boost::next(it1);it2!=end;++it2){ - CGAL_precondition( it2->is_pure_triangle() ); - Polyhedron_ref Q=*it2; - filter_intersections(P, Q); - filter_intersections(Q, P); - } - } - - return main_run(out); - } - - //pairwise intersection between all elements in the range - //(pointers version) - template - OutputIterator - operator()(InputIterator begin, InputIterator end, OutputIterator out, int) { - for(InputIterator it1=begin;it1!=end;++it1){ - CGAL_precondition( (*it1)->is_pure_triangle() ); - Polyhedron_ref P=**it1; - visitor->new_input_polyhedron(P); - for(InputIterator it2=boost::next(it1);it2!=end;++it2){ - CGAL_precondition( (*it2)->is_pure_triangle() ); - Polyhedron_ref Q=**it2; - filter_intersections(P, Q); - filter_intersections(Q, P); - } - } - - return main_run(out); - } - - //intersection between P and each element in the range - template - OutputIterator - operator()( Polyhedron_ref P, InputIterator begin, InputIterator end, OutputIterator out) { - CGAL_precondition( P.is_pure_triangle() ); - visitor->new_input_polyhedron(P); - for(InputIterator it=begin;it!=end;++it){ - CGAL_precondition( it->is_pure_triangle() ); - Polyhedron_ref Q=*it; - visitor->new_input_polyhedron(Q); - filter_intersections(P, Q); - filter_intersections(Q, P); - } - return main_run(out); - } - - //intersection between P and each element in the range - //(pointers version) - template - OutputIterator - operator()(Polyhedron_ref P, InputIterator begin, InputIterator end, OutputIterator out, int) { - CGAL_precondition( P.is_pure_triangle() ); - visitor->new_input_polyhedron(P); - for(InputIterator it=begin;it!=end;++it){ - CGAL_precondition( (*it)->is_pure_triangle() ); - Polyhedron_ref Q=**it; - visitor->new_input_polyhedron(Q); - filter_intersections(P, Q); - filter_intersections(Q, P); - } - return main_run(out); - } - - //intersection between P and Q - template - OutputIterator - operator()(Polyhedron_ref P, Polyhedron_ref Q, OutputIterator out) { - visitor->new_input_polyhedron(P); - visitor->new_input_polyhedron(Q); - filter_intersections(P, Q); - filter_intersections(Q, P); - return main_run(out); - } - - //intersection between P and Q, only visitor called not polyline is constructed - void operator()(Polyhedron_ref P, Polyhedron_ref Q) { - visitor->new_input_polyhedron(P); - visitor->new_input_polyhedron(Q); - filter_intersections(P, Q); - filter_intersections(Q, P); - main_run(Emptyset_iterator(),false); - } -}; - -template -OutputIterator -intersection_Polyhedron_3_Polyhedron_3(const Polyhedron& P, const Polyhedron& Q, OutputIterator out) -{ - return Intersection_of_Polyhedra_3()(P,Q,out); -} - -}// namespace CGAL - -#include - -#endif //CGAL_INTERSECTION_OF_POLYHEDRA_3_H - -/* - // Local variables for Emacs: - // - set special indentation of case labels, compared to usual C/C++ - // indentation styles. - Local Variables: - c-file-offsets:((case-label . +)) - End: -*/ diff --git a/Operations_on_polyhedra/include/CGAL/intersection_of_Polyhedra_3_refinement_visitor.h b/Operations_on_polyhedra/include/CGAL/intersection_of_Polyhedra_3_refinement_visitor.h deleted file mode 100644 index 71533b11402..00000000000 --- a/Operations_on_polyhedra/include/CGAL/intersection_of_Polyhedra_3_refinement_visitor.h +++ /dev/null @@ -1,1163 +0,0 @@ -// Copyright (c) 2011 GeometryFactory (France). -// All rights reserved. -// -// This file is part of CGAL (www.cgal.org). -// You can redistribute it and/or modify it under the terms of the GNU -// General Public License as published by the Free Software Foundation, -// either version 3 of the License, or (at your option) any later version. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -// -// $URL$ -// $Id$ -// SPDX-License-Identifier: GPL-3.0+ -// -// -// Author(s) : Sebastien Loriot - -#ifndef CGAL_INTERSECTION_OF_POLYHEDRA_3_REFINEMENT_VISITOR_H -#define CGAL_INTERSECTION_OF_POLYHEDRA_3_REFINEMENT_VISITOR_H - -#include - -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include - -// TODOCUMENT -// --We suppose that the two input polyhedra are triangulated orientable surfaces. -// --Any polyhedron defines two bounding volumes: one inside and one outside. -// The convention used is the following: the normal of a triangle always indicates -// the outside of the object. -// --The input polyhedra should not touch at only one point locally. If so, the current -// implementation just ignore it (TAG SL001) -// --Polyhedron type should be list-based or should guarantee no reallocation. We use maps -// on pointer of halfedges,facets and vertices -// --Polyhedral_mesh_domain requires the domain tp be closed: do not provided as input -// an open polyhedral surface and a polyhedron with a connected component free from intersection -//OPTIMIZATIONS -// --cdt: try using intervals? in that case, only points inside the face should be considered -// and points on edge should be handled by hand (simply start using the point opposite to the edge) -// --sorted_around_edge_filtered: can be done using the original supporting planes -// --in intersection_of_Polyhedra_3: upon call to Triangle_segment_intersection_point::add_new_node, interval and exact nodes are -// inserted into a vector. Since we do not know the final size of vector this lead to reallocation of data. -// --in Triangle_segment_intersection_point, try using EPEC instead of Interval_nt+SC -// --use a sorted pair of indices in edge_to_hedge+simplify the code TAG_SLXX1 -// --in sew_2_marked_darts arrange how darts are passed to avoid comparing to a Point_3 -//TODO: -// --validity of the embedding: points inserted in polyhedron are approximation of the real -// intersection points. It may happen that because of the approximation, the embedding gets -// wrong. To avoid this, for each new triangle created, we should make an orientation test -// with the approximated point to check if this is correct. If not, points must be moved -// within their double interval so that all triangles incident to each of these points are correctly -// oriented. This is probably an expensive test that can be activated only with a template parameter -// of something similar. -// -- We should have an option to report intersection at a point and refinement of polyhedra -// so that the point is included into the other polyhedra. Please be careful if the point -// already exists bool report_isolated_point or a template parameter (polyline with a unique point) -namespace CGAL -{ - - namespace internal_IOP - { - - template - class Triangulate_a_face : public CGAL::Modifier_base { - typedef typename HDS::Halfedge_handle Halfedge_handle; - typedef typename HDS::Vertex_handle Vertex_handle; - typedef typename HDS::Face_handle Face_handle; - typedef typename HDS::Vertex Vertex; - typedef typename HDS::Halfedge Halfedge; - typedef typename HDS::Face Face; - typedef typename boost::property_traits::value_type Point; - - //data members - Face_handle current_face; - std::map nodes_; - std::map& node_to_polyhedron_vertex_; - std::map,Halfedge_handle>& edge_to_hedge_; - std::vector > edges_to_create_; - std::vector > faces_to_create_; - NestedFacetConstruct facet_construct; - NewNodeVertexVisitor& node_vertex_visitor; - PolyhedronPointPMap ppmap; - - typename HDS::Halfedge::Base* - unlock_halfedge(Halfedge_handle h){ - return static_cast(&(*h)); - } - - typename HDS::Face::Base* - unlock_face(Face_handle f){ - return static_cast(&(*f)); - } - - public: - - template - Triangulate_a_face( Face_handle face, - const Nodes_vector& nodes, - const std::vector& node_ids, - std::map& node_to_polyhedron_vertex, - std::map,Halfedge_handle>& edge_to_hedge, - const Triangulation& triangulation, - const NestedFacetConstruct& fc, - NewNodeVertexVisitor& nv, - PolyhedronPointPMap ppmap) - :current_face(face), node_to_polyhedron_vertex_(node_to_polyhedron_vertex), edge_to_hedge_(edge_to_hedge), facet_construct(fc), node_vertex_visitor(nv), ppmap(ppmap) - { - //grab vertices to be inserted to copy them from the vector - for (std::vector::const_iterator it=node_ids.begin();it!=node_ids.end();++it) - { - nodes_.insert(std::make_pair(*it,nodes[*it])); - } - //grab edges that are not on the convex hull (these have already been created) - for (typename Triangulation::Finite_edges_iterator - it=triangulation.finite_edges_begin(); - it!=triangulation.finite_edges_end(); - ++it) - { - typename Triangulation::Vertex_handle v0=it->first->vertex((it->second+1)%3); - typename Triangulation::Vertex_handle v1=it->first->vertex((it->second+2)%3); - //warning in degenerate cases you can insert outsite expected convex hull edges: need exact here. - //an alternative is to test if one the incident faces are infinite (cf assertion below) - if ( edge_to_hedge_.find(std::make_pair(v0->info(),v1->info()))==edge_to_hedge_.end() && - edge_to_hedge_.find(std::make_pair(v1->info(),v0->info()))==edge_to_hedge_.end() ) - { - edges_to_create_.push_back( std::make_pair(v0->info(),v1->info()) ); - } - else - CGAL_assertion( triangulation.is_infinite(it->first->vertex(it->second)) || triangulation.is_infinite( triangulation.mirror_vertex(it->first,it->second)) ); - } - //grab triangles. - for (typename Triangulation::Finite_faces_iterator - it=triangulation.finite_faces_begin(); - it!=triangulation.finite_faces_end(); - ++it) - { - typename Triangulation::Vertex_handle v0=it->vertex(0); - typename Triangulation::Vertex_handle v1=it->vertex(1); - typename Triangulation::Vertex_handle v2=it->vertex(2); - //warning in degenerate case we can have non wanted triangles: need exact here - faces_to_create_.push_back( CGAL::cpp11::make_tuple( v0->info(),v1->info(),v2->info() ) ); - } - } - - - - void operator()( HDS& hds) { -// std::cerr << "node_to_polyhedron_vertex_"<< std::endl; -// for (typename std::map::iterator it=node_to_polyhedron_vertex_.begin();it!=node_to_polyhedron_vertex_.end();++it) -// std::cerr << it->first << " " << &(*(it->second)) << std::endl; - - //insert the intersection point interior to the face inside the polyhedron and - //save their Polyhedron::vertex_handle - for (typename std::map::iterator it=nodes_.begin();it!=nodes_.end();++it) - { - Vertex_handle v=hds.vertices_push_back(Vertex()); - node_vertex_visitor.new_vertex_added(it->first, v); - put(ppmap, v, it->second); - CGAL_assertion( node_to_polyhedron_vertex_.find( it->first ) == node_to_polyhedron_vertex_.end()); - node_to_polyhedron_vertex_.insert( std::make_pair(it->first,v) ); -// std::cerr << "vertices " << it->first << " " << &(*v) << std::endl; - } - - //insert the new halfedge and set their incident vertex - for (typename std::vector >::iterator - it=edges_to_create_.begin();it!=edges_to_create_.end();++it) - { - Halfedge_handle he=hds.edges_push_back(Halfedge(),Halfedge()); - - //associate edge to halfedge going from i to j with j as incident vertex - CGAL_assertion(node_to_polyhedron_vertex_.find(it->second)!= node_to_polyhedron_vertex_.end()); - Vertex_handle v=node_to_polyhedron_vertex_.find(it->second)->second; - unlock_halfedge(he)->set_vertex( v ); - v->set_halfedge(he); -// std::cerr << " --in edge " << &(*v) << std::endl; - edge_to_hedge_.insert( std::make_pair(*it,he) ); - v=node_to_polyhedron_vertex_.find(it->first)->second; -// std::cerr << " --in edge " << &(*v) << std::endl; - unlock_halfedge( he->opposite() )->set_vertex( v ); - v->set_halfedge(he->opposite()); - edge_to_hedge_.insert( std::make_pair(std::make_pair(it->second,it->first),he->opposite()) ); -// std::cerr << "edges " << it->first << " " << it->second << std::endl; - } - - std::vector >::iterator it=faces_to_create_.begin(); - Face_handle face_triangulated = current_face; - //create the new faces and update adjacencies - while (true) - { - int i=cpp11::get<0>(*it),j=cpp11::get<1>(*it),k=cpp11::get<2>(*it); -// std::cerr << "faces " << i << " " << j << " " << k<< std::endl; - Halfedge_handle current = edge_to_hedge_.find(std::make_pair(i,j))->second; - Halfedge_handle next = edge_to_hedge_.find(std::make_pair(j,k))->second; - Halfedge_handle previous = edge_to_hedge_.find(std::make_pair(k,i))->second; - - - CGAL_assertion (edge_to_hedge_.find(std::make_pair(i,j))!=edge_to_hedge_.end()); - CGAL_assertion (edge_to_hedge_.find(std::make_pair(j,k))!=edge_to_hedge_.end()); - CGAL_assertion (edge_to_hedge_.find(std::make_pair(k,i))!=edge_to_hedge_.end()); - - CGAL_assertion(current->vertex()==node_to_polyhedron_vertex_.find(j)->second); - CGAL_assertion(next->vertex()==node_to_polyhedron_vertex_.find(k)->second); - CGAL_assertion(previous->vertex()==node_to_polyhedron_vertex_.find(i)->second); - - unlock_halfedge(current)->set_next(next); - unlock_halfedge(next)->set_next(previous); - unlock_halfedge(previous)->set_next(current); - - unlock_halfedge(current)->set_prev(previous); - unlock_halfedge(next)->set_prev(current); - unlock_halfedge(previous)->set_prev(next); - - //update face halfedge - unlock_face(current_face)->set_halfedge(current); - - //update face of halfedges - unlock_halfedge(current) ->set_face(current_face); - unlock_halfedge(next) ->set_face(current_face); - unlock_halfedge(previous) ->set_face(current_face); - - if ( ++it!=faces_to_create_.end() ) - current_face=hds.faces_push_back( facet_construct(*face_triangulated) ); - else - break; - } - } - }; - - template - Halfedge_handle - next_marked_halfedge_around_target_vertex(Halfedge_handle h, const Marked_set& is_marked) - { - CGAL_assertion( is_marked.find(h)!=is_marked.end() ); - Halfedge_handle next=h->next(); - while( is_marked.find(next)==is_marked.end() ) - { - next=next->opposite()->next(); - } - CGAL_assertion(next!=h); - return next; - } - - template - Halfedge_handle - next_marked_halfedge_around_source_vertex(Halfedge_handle h, const Marked_set& is_marked) - { - CGAL_assertion( is_marked.find(h)!=is_marked.end() ); - Halfedge_handle prev=h->prev(); - while(is_marked.find(prev)==is_marked.end()) - { - prev=prev->opposite()->prev(); - } - CGAL_assertion(prev!=h); - return prev; - } - - } //namespace internal_IOP - -template -struct Default_facet_construct{ - typename Polyhedron::Facet operator()( const typename Polyhedron::Facet& f) - { return f; } -}; - -template -struct Default_node_vertex_visitor{ - void new_node_added( int /* node_id */, - internal_IOP::Intersection_type /* type */, - typename Polyhedron::Halfedge_handle /* principal_edge */, - typename Polyhedron::Halfedge_handle /* additional_edge */, - bool /* is_vertex_coplanar */, - bool /* is_vertex_opposite_coplanar */ ) - {} - - void new_vertex_added(int /* node_id */, typename Polyhedron::Vertex_handle /* vh */){} -}; - -struct Default_output_builder{ - template - void operator()(const T1&, const T2&, const T3&, const T4&, const T5&){} - void input_have_coplanar_facets(){} -}; - -template< class Polyhedron, - class OutputBuilder_=Default, - class Kernel_=Default, - class EdgeMarkPropertyMap_=Default, - class NestedFacetConstruct_=Default, - class NewNodeVertexVisitor_=Default, - class PolyhedronPointPMap_=Default - > -class Node_visitor_refine_polyhedra{ -//Default typedefs - typedef typename Default::Get::type OutputBuilder; - typedef typename Default::Get >::type EdgeMarkPropertyMap; - typedef typename Default::Get >::type NestedFacetConstruct; - typedef typename Default::Get >::type NewNodeVertexVisitor; - typedef typename Default::Get >::type PolyhedronPointPMap; - typedef typename Default::Get::value_type >::Kernel >::type Kernel; -//typedefs - typedef typename Polyhedron::Halfedge_handle Halfedge_handle; - typedef typename Polyhedron::Halfedge_const_handle Halfedge_const_handle; - typedef typename Polyhedron::Face_handle Face_handle; - typedef typename Polyhedron::Halfedge Halfedge; - typedef typename Polyhedron::Vertex_handle Vertex_handle; - typedef internal_IOP::Compare_handles Cmp_handle; //This ensures uniqueness of edges when comparing halfedges - typedef internal_IOP::Compare_unik_address Cmp_unik_ad; //This ensures uniqueness of edges when comparing halfedges - - //constrained triangulation used for triangulation interior of faces - #ifdef DO_NO_USE_EXACT_CDT - typedef CGAL::Triangulation_vertex_base_with_info_2 Vbi; - typedef CGAL::Constrained_triangulation_face_base_2 Fb; - typedef CGAL::Triangulation_data_structure_2 TDS_2; - typedef CGAL::Constrained_Delaunay_triangulation_2 CDT; //DO WE NEED DELAUNAY???? - #else - /// \todo change this, use it only if not already exact - typedef CGAL::Exact_predicates_exact_constructions_kernel Exact_kernel; - typedef CGAL::Triangulation_vertex_base_with_info_2 Vbi; - typedef CGAL::Constrained_triangulation_face_base_2 Fb; - typedef CGAL::Triangulation_data_structure_2 TDS_2; - typedef CGAL::Constrained_Delaunay_triangulation_2 CDT; //DO WE NEED DELAUNAY???? - #endif - - typedef std::map Hedge_to_polyhedron_map; - - typedef std::vector Node_ids; - typedef std::map< Face_handle,Node_ids,Cmp_handle > In_face_map; - typedef std::map< Halfedge_handle,Node_ids,Cmp_unik_ad > In_halfedge_map; - //to keep the correspondance between node_id and vertex_handle in each polyhedron - typedef std::map Node_to_polyhedron_vertex_map; - typedef std::map Poly_to_map_node; - //to maintain an polyhedron halfedge on each polyline + pair - //with first = "is the key (pair) was reversed?" and second is the number of edges +1 in the polyline - typedef std::map< std::pair, std::pair< std::map,std::pair > > An_edge_per_polyline_map; - //to handle coplanar halfedge of polyhedra that are full in the intersection - typedef std::map< int,Halfedge_handle > Node_to_target_of_hedge_map; - typedef std::map< Polyhedron*,Node_to_target_of_hedge_map> Poly_to_vertices_on_intersection_map; - -//data members - Hedge_to_polyhedron_map hedge_to_polyhedron; - In_face_map in_face; - In_halfedge_map in_hedge; - std::map< int,std::set > graph_of_constraints; - boost::dynamic_bitset<> is_node_of_degree_one; - std::map< int,std::set > coplanar_constraints; - An_edge_per_polyline_map an_edge_per_polyline; - typename An_edge_per_polyline_map::iterator last_polyline; - Poly_to_vertices_on_intersection_map poly_to_vertices_on_inter; - Poly_to_map_node polyhedron_to_map_node_to_polyhedron_vertex; - std::set non_manifold_nodes; //contain nodes that are original vertices of input polyhedron and that neighborhood is not a topological disk - std::map nodes_that_are_original_vertices;//to keep the correspondance between original polyhedron vertices that are also nodes - - OutputBuilder output_builder; - - // new_hedge hedge - // -----------> -----------> - // v - // <----------- <----------- - // new_opposite opposite - // - template - Vertex_handle split_edge( Halfedge_handle hedge, - int node_id, - const Nodes_vector& nodes, - Polyhedron& P) - { - internal_IOP::Split_halfedge delegated(hedge); - P.delegate( delegated ); - CGAL_assertion(P.is_valid()); - - Vertex_handle vh=boost::prior(P.vertices_end()); - node_vertex_visitor.new_vertex_added(node_id, vh); - put(ppmap, vh, nodes[node_id]); - CGAL_assertion(get(ppmap,vh)==nodes[node_id]); - - //update marker tags. If the edge was marked, then the resulting edges in the split must be marked - if ( get(m_edge_mark_pmap,std::make_pair(hedge,&P)) ) - { - CGAL_assertion( get(m_edge_mark_pmap,std::make_pair(hedge->opposite(),&P)) ); - put(m_edge_mark_pmap,std::make_pair(hedge->prev(),&P),true); - put(m_edge_mark_pmap,std::make_pair(hedge->prev()->opposite(),&P),true); - } - - return vh; - } - - //sort node ids so that we can split the hedge - //consecutively - template - void sort_vertices_along_hedge(std::vector& node_ids,Halfedge_handle hedge,const Nodes_vector& nodes) - { - std::sort(node_ids.begin(), - node_ids.end(), - internal_IOP::Order_along_a_halfedge(hedge,nodes, ppmap) - ); - } - - //insert intersection as constrained edges in a CDT triangulation - template - void insert_constrained_edges_coplanar_case(int node_id, - CDT& triangulation, - std::map& id_to_CDT_vh) - { - if (node_id < number_coplanar_vertices){ - //XSL_TAG_CPL_VERT - //Insert constrained edges from coplanar facets that have been retriangulated. This ensure that triangulations are compatible - std::map< int,std::set >::iterator it_neighbors=coplanar_constraints.find(node_id); - if (it_neighbors!=coplanar_constraints.end()) - { - typename CDT::Vertex_handle vh=id_to_CDT_vh.find(node_id)->second; - for (std::set::iterator it_n=it_neighbors->second.begin();it_n!=it_neighbors->second.end();++it_n){ - typename std::map::iterator it_vh=id_to_CDT_vh.find(*it_n); - // this condition ensures to consider only graph edges that are in the same triangle (not in a neighbor one when involving node on a triangle edge) - // here we can't make the difference between a point on the interior or the boundary, so points_on_triangle is not used. - if ( it_vh!=id_to_CDT_vh.end() ){ - triangulation.insert_constraint(vh,id_to_CDT_vh.find(*it_n)->second); - } - } - } - } - } - //insert intersection as constrained edges in a CDT triangulation - template - void insert_constrained_edges(Node_ids& node_ids, //index of vertices we are interested in - CDT& triangulation, - std::map& id_to_CDT_vh, - Constrained_edges_map& constrained_edges, //list of pair of int to indicate edges that are constrained - bool points_on_triangle=false) - { - for (Node_ids::iterator it_node_id=node_ids.begin();it_node_id!=node_ids.end();++it_node_id){ - std::map< int,std::set >::iterator it_neighbors=graph_of_constraints.find(*it_node_id); - if (it_neighbors!=graph_of_constraints.end()) - { - typename CDT::Vertex_handle vh=id_to_CDT_vh.find(*it_node_id)->second; - for (std::set::iterator it_n=it_neighbors->second.begin();it_n!=it_neighbors->second.end();++it_n){ - typename std::map::iterator it_vh=id_to_CDT_vh.find(*it_n); - // this condition ensures to consider only graph edges that are in the same triangle (not in a neighbor one when involving node on a triangle edge) - if ( !points_on_triangle || it_vh!=id_to_CDT_vh.end() ){ - CGAL_assertion(it_vh!=id_to_CDT_vh.end()); - triangulation.insert_constraint(vh,id_to_CDT_vh.find(*it_n)->second); - constrained_edges.push_back(std::make_pair(*it_node_id,*it_n)); - } - } - } - #ifdef CGAL_COREFINEMENT_DEBUG - else - { - std::cout << "X0: Found an isolated point" << std::endl; - } - #endif - - insert_constrained_edges_coplanar_case(*it_node_id,triangulation,id_to_CDT_vh); - } - } - - std::pair make_sorted_pair(int i,int j) const {return i indices,typename Polyhedron::Halfedge_handle hedge) - { - std::pair sorted_pair=make_sorted_pair(indices.first,indices.second); - typename An_edge_per_polyline_map::iterator it=an_edge_per_polyline.find(sorted_pair); - if (it!=an_edge_per_polyline.end()){ - it->second.first.insert(std::make_pair( P,sorted_pair.first==indices.first?hedge:hedge->opposite() )); - } - } - - //keep track of the fact that a polyhedron original vertex is a node - void all_incident_faces_got_a_node_as_vertex(Halfedge_handle incident_to_vertex_edge,int node_id) - { - nodes_that_are_original_vertices.insert(std::make_pair(incident_to_vertex_edge->vertex(),node_id)); - } - - //if an original polyhedron vertex is also a node, do no use a fake id - void set_triangle_boundary_indices( - Vertex_handle* triangle_boundary, - int* triangle_boundary_indices) - { - triangle_boundary_indices[0]=-1; - triangle_boundary_indices[1]=-2; - triangle_boundary_indices[2]=-3; - - for (int k=0;k<3;++k){ - typename std::map::iterator it=nodes_that_are_original_vertices.find(triangle_boundary[k]); - if (it!=nodes_that_are_original_vertices.end()) - triangle_boundary_indices[k]=it->second; - } - } - - int number_coplanar_vertices; //number of intersection points between coplanar facets, see fixes XSL_TAG_CPL_VERT - EdgeMarkPropertyMap m_edge_mark_pmap; //property map to mark halfedge of the original polyhedra that are on the intersection - NestedFacetConstruct facet_construct; // functor called to create new triangular faces inside a given face - NewNodeVertexVisitor node_vertex_visitor; // functor called when a new node is created and when a new vertex is added - PolyhedronPointPMap ppmap; -public: - Node_visitor_refine_polyhedra ( - OutputBuilder output_builder_=OutputBuilder(), - PolyhedronPointPMap ppmap = PolyhedronPointPMap(), - EdgeMarkPropertyMap pmap=EdgeMarkPropertyMap(), - const NestedFacetConstruct& fc = NestedFacetConstruct(), - const NewNodeVertexVisitor& nv = NewNodeVertexVisitor() ) - : output_builder(output_builder_) - , m_edge_mark_pmap(pmap) - , facet_construct(fc) - , node_vertex_visitor(nv) - , ppmap(ppmap) - {} - - typedef internal_IOP::Predicates_on_constructions Node_storage_type; - typedef Tag_false Is_polyhedron_const; - static const bool do_need_vertex_graph = true; //because we need to know which edges are constrained - - void set_number_of_intersection_points_from_coplanar_facets(int n){ - number_coplanar_vertices=n; - } - - void input_have_coplanar_facets() - { - output_builder.input_have_coplanar_facets(); - } - - void check_node_on_non_manifold_vertex(int node_id,Halfedge_handle hedge){ - //we turn around the hedge and check no halfedge is a border halfedge - Halfedge_handle curr=hedge; - do{ - if ( curr->is_border_edge() ){ - non_manifold_nodes.insert(node_id); - return; - } - curr=curr->next()->opposite(); - } - while(curr!=hedge); - } - - void check_node_on_non_manifold_edge(int node_id,Halfedge_handle hedge){ - if ( hedge->is_border_edge() ) non_manifold_nodes.insert(node_id); - } - - void new_node_added(int node_id, - internal_IOP::Intersection_type type, - Halfedge_handle principal_edge, - Halfedge_handle additional_edge, - bool is_vertex_coplanar, - bool is_vertex_opposite_coplanar) - { - //forward to the visitor - node_vertex_visitor.new_node_added(node_id, type, principal_edge, additional_edge, is_vertex_coplanar, is_vertex_opposite_coplanar); - switch(type) - { - case internal_IOP::FACET: //Facet intersected by an edge - { - typename In_face_map::iterator it_fmap=in_face.insert(std::make_pair(additional_edge->face(), Node_ids())).first; - it_fmap->second.push_back(node_id); - } - break; - case internal_IOP::EDGE: //Edge intersected by an edge - { - typename In_halfedge_map::iterator it_hedge_map=in_hedge.insert(std::make_pair(additional_edge,Node_ids())).first; - it_hedge_map->second.push_back(node_id); - check_node_on_non_manifold_edge(node_id,additional_edge); - } - break; - case internal_IOP::VERTEX: - { - //grab original vertex that is on commom intersection - typename Hedge_to_polyhedron_map::iterator it=hedge_to_polyhedron.find(additional_edge->facet()->halfedge()); - CGAL_assertion(it!=hedge_to_polyhedron.end()); - poly_to_vertices_on_inter[it->second].insert(std::make_pair(node_id,additional_edge)); - polyhedron_to_map_node_to_polyhedron_vertex[it->second].insert(std::make_pair(node_id,additional_edge->vertex())); - all_incident_faces_got_a_node_as_vertex(additional_edge,node_id); - check_node_on_non_manifold_vertex(node_id,additional_edge); - } - break; - default: - return; - } - - CGAL_assertion(!is_vertex_coplanar || !is_vertex_opposite_coplanar); //coplanar edge are not forwarded - - - if ( is_vertex_coplanar ) - { - //grab original vertex that is on commom intersection - typename Hedge_to_polyhedron_map::iterator it=hedge_to_polyhedron.find(principal_edge->facet()->halfedge()); - poly_to_vertices_on_inter[it->second].insert(std::make_pair(node_id,principal_edge)); - polyhedron_to_map_node_to_polyhedron_vertex[it->second].insert(std::make_pair(node_id,principal_edge->vertex())); - all_incident_faces_got_a_node_as_vertex(principal_edge,node_id); - check_node_on_non_manifold_vertex(node_id,principal_edge); - } - else{ - if ( is_vertex_opposite_coplanar ){ - //grab original vertex that is on commom intersection - typename Hedge_to_polyhedron_map::iterator it=hedge_to_polyhedron.find(principal_edge->facet()->halfedge()); - poly_to_vertices_on_inter[it->second].insert(std::make_pair(node_id,principal_edge->opposite())); - polyhedron_to_map_node_to_polyhedron_vertex[it->second].insert(std::make_pair(node_id,principal_edge->opposite()->vertex())); - all_incident_faces_got_a_node_as_vertex(principal_edge->opposite(),node_id); - check_node_on_non_manifold_vertex(node_id,principal_edge->opposite()); - } - else{ - //handle intersection on principal edge - typename In_halfedge_map::iterator it_hedge_map=in_hedge.insert(std::make_pair(principal_edge,Node_ids())).first; - it_hedge_map->second.push_back(node_id); - check_node_on_non_manifold_edge(node_id,principal_edge); - } - } - } - - template - void annotate_graph(Iterator begin,Iterator end) - { -// std::cout << "Annotation graph..." << std::endl; - int node_id = 0; - is_node_of_degree_one.resize(std::distance(begin, end)); - for (Iterator it=begin;it!=end;++it, ++node_id) - { - if (non_manifold_nodes.count(node_id)) it->make_terminal(); - const std::set& neighbors = it->neighbors; - graph_of_constraints.insert(std::make_pair(node_id,neighbors)); - if (neighbors.size()==1) - is_node_of_degree_one.set(node_id); - } - } - - void update_terminal_nodes(std::vector&) - { - CGAL_assertion(!"Must not call this function"); - } - - void add_filtered_intersection(Halfedge_handle eh,Halfedge_handle fh,Polyhedron& Pe,Polyhedron& Pf){ - //use the representant halfedge of the facet as key - //--set polyhedron for the two facets incident to the edge - CGAL_assertion(!eh->is_border()); - hedge_to_polyhedron.insert(std::make_pair(eh->facet()->halfedge(),&Pe)); - if ( !eh->opposite()->is_border() ) - hedge_to_polyhedron.insert(std::make_pair(eh->opposite()->facet()->halfedge(),&Pe)); - //--set polyhedron for the facet intersected by the edge - hedge_to_polyhedron.insert(std::make_pair(fh->facet()->halfedge(),&Pf)); - } - - - struct Polyhedron_face_boundary{ - std::vector node_ids_array[3]; // the node_ids on each halfedges - std::map hedges_ids; - Halfedge_handle halfedges[3]; //the three halfedges of the original face - Vertex_handle vertices[3]; //the three vertices of the original face - //node_ids_array[0] corresponds to the original edge vertices[0],vertices[1] = halfedges[0] - //node_ids_array[1] corresponds to the original edge vertices[1],vertices[2] = halfedges[1] - //node_ids_array[2] corresponds to the original edge vertices[2],vertices[0] = halfedges[2] - Polyhedron_face_boundary(Halfedge_handle first) - { - CGAL_assertion(first->next()->next()->next()==first); //the face is a triangle - hedges_ids.insert(std::make_pair(first,0)); - hedges_ids.insert(std::make_pair(first->next(),1)); - hedges_ids.insert(std::make_pair(first->next()->next(),2)); - halfedges[0]=first; - halfedges[1]=first->next(); - halfedges[2]=first->next()->next(); - - vertices[0]=halfedges[0]->opposite()->vertex(); - vertices[1]=halfedges[1]->opposite()->vertex(); - vertices[2]=halfedges[2]->opposite()->vertex(); - } - - //used when object was created with hedge but opposite was used to split the original face - void update_original_halfedge(Halfedge_handle original,Halfedge_handle new_hedge) - { - typename std::map::iterator it_id=hedges_ids.find(original); - CGAL_assertion(it_id!=hedges_ids.end()); - int index=it_id->second; - CGAL_assertion(halfedges[index]==original); - hedges_ids.erase(it_id); - hedges_ids.insert(std::make_pair(new_hedge,index)); - halfedges[index]=new_hedge; - } - - template - void copy_node_ids(Halfedge_handle hedge,Iterator begin,Iterator end) - { - typename std::map::iterator it_id=hedges_ids.find(hedge); - CGAL_assertion(it_id!=hedges_ids.end()); - std::copy(begin,end,std::back_inserter(node_ids_array[it_id->second])); - } - }; - - - void start_new_polyline(int i, int j) - { - if ( i==j ) //case of a single point - { - //TAG SL001 - //nothing is done - return; - } - std::pair res= - an_edge_per_polyline.insert( - std::make_pair( make_sorted_pair(i,j), - std::make_pair( std::map(),std::make_pair(false,0)) ) - ); - CGAL_assertion(res.second); - last_polyline=res.first; - if ( i !=last_polyline->first.first ) - last_polyline->second.second.first=true; - } - - void add_node_to_polyline(int){ - ++(last_polyline->second.second.second); - } - - void new_input_polyhedron(Polyhedron& P) - { - typedef std::pair Res; - CGAL_USE_TYPE(Res); - CGAL_assertion_code(Res res = ) - polyhedron_to_map_node_to_polyhedron_vertex.insert(std::make_pair( &P,Node_to_polyhedron_vertex_map() )); - CGAL_assertion(res.second == true); - } - - //1) split_halfedges and retriangulate faces with no intersection point interior to the facet - //2) retriangulate using a constrained Delaunay triangulation each triangle in each Polyhedron that contains at least - // one intersection point inside the facet - //3) mark polyhedron edges that are on the intersection - //4) create one output polyhedron per connected component of polyhedron, connected by an edge which is not an intersection edge - //5) import each piece into a common combinatorial map - //6) glue all the pieces together - template - void finalize(const Nodes_vector& nodes){ - //mark halfedge that are on the intersection - //SL: I needed to use a map because to get the orientation around the edge, - // I need to know in the case the third vertex is a node its index (for exact construction) - typedef std::map,Cmp_unik_ad > Border_halfedges_map; - Border_halfedges_map border_halfedges; - - //store for each triangle facet which boundary is intersected by the other surface, - //original vertices (and halfedges in the refined mesh pointing on these vertices) - typedef std::map Faces_boundary; - Faces_boundary faces_boundary; - - //0) For each polyhedron, collect original vertices that belongs to the intersection. - // From the graph of constraints, extract intersection edges that are incident to such vertices. In case - // there exists another original vertex adjacent to the first one found, this halfedge must be - // marked on the boundary (and possibly update an_edge_per_polyline). - // This is done first to avoid halfedges stored to be modified in the steps following. - for (typename Poly_to_vertices_on_intersection_map::iterator - it=poly_to_vertices_on_inter.begin(); - it!=poly_to_vertices_on_inter.end(); - ++it) - { - Polyhedron* poly=it->first; - std::set > already_done; - Node_to_target_of_hedge_map& nodes_to_hedge=it->second; - for(typename Node_to_target_of_hedge_map::iterator - it_node_2_hedge=nodes_to_hedge.begin(); - it_node_2_hedge!=nodes_to_hedge.end(); - ++it_node_2_hedge) - { - int node_id_of_first=it_node_2_hedge->first; - std::map< int,std::set >::iterator it_neighbors=graph_of_constraints.find(node_id_of_first); - if ( it_neighbors!=graph_of_constraints.end() ) - { - std::set& neighbors=it_neighbors->second; - for (std::set::iterator it_id=neighbors.begin();it_id!=neighbors.end();++it_id){ - if ( already_done.find(std::make_pair(*it_id,node_id_of_first))!=already_done.end() ) continue;//already done for the opposite - typename Node_to_target_of_hedge_map::iterator it_node_2_hedge_two=nodes_to_hedge.find(*it_id); - if ( it_node_2_hedge_two!=nodes_to_hedge.end() ) //a full edge is on intersection - { - //get the corresponding halfedge with vertex corresponding to node_id_of_first - Halfedge_handle hedge=it_node_2_hedge->second; - CGAL_assertion_code(Halfedge_handle start=hedge;) - while ( hedge->opposite()->vertex()!=it_node_2_hedge_two->second->vertex() ){ - hedge=hedge->next()->opposite(); - CGAL_assertion(hedge!=start); - } - std::pair edge_pair(*it_id,node_id_of_first); - if ( border_halfedges.insert( std::make_pair(hedge,edge_pair) ).second) - { - put(m_edge_mark_pmap,std::make_pair(hedge,poly),true); - put(m_edge_mark_pmap,std::make_pair(hedge->opposite(),poly),true); - } - update_edge_per_polyline(poly,edge_pair,hedge); - //save the fact that we already handle this edge - already_done.insert(std::make_pair(node_id_of_first,*it_id)); - } - } - } - #ifdef CGAL_COREFINEMENT_DEBUG - else - { - std::cout << "X1: Found an isolated point" << std::endl; - } - #endif - } - } - - //1) First split halfedges cut by the intersection polyline(s) - for (typename In_halfedge_map::iterator it=in_hedge.begin();it!=in_hedge.end();++it) - { - Halfedge_handle hedge=it->first; //the halfedge to be split (and its opposite too) - Node_ids& node_ids = it->second; //indices of the intersection points to be inserted - CGAL_assertion( std::set(node_ids.begin(), node_ids.end()).size()==node_ids.size() ); - typename Hedge_to_polyhedron_map::iterator it_poly=hedge_to_polyhedron.find( hedge->facet()->halfedge() ); - CGAL_assertion(it_poly!=hedge_to_polyhedron.end()); - Polyhedron* P=it_poly->second; //the polyhedron in which vertices should be added - - sort_vertices_along_hedge(node_ids,hedge,nodes); - - //save original face and nodes for face of hedge (1) - if ( !hedge->is_border() ){ - typename Faces_boundary::iterator it_face=faces_boundary.find(hedge->face()); - if (it_face==faces_boundary.end()) - it_face=faces_boundary.insert(std::make_pair(hedge->face(),Polyhedron_face_boundary(hedge))).first; - it_face->second.copy_node_ids(hedge,node_ids.begin(),node_ids.end()); - } - - //save original face and nodes for face of hedge->opposite (2) - typename Faces_boundary::iterator opposite_original_info=faces_boundary.end(); - if ( !hedge->opposite()->is_border() ){ - opposite_original_info=faces_boundary.find(hedge->opposite()->face()); - if (opposite_original_info==faces_boundary.end()) - opposite_original_info=faces_boundary.insert(std::make_pair(hedge->opposite()->face(),Polyhedron_face_boundary(hedge->opposite()))).first; - opposite_original_info->second.copy_node_ids(hedge->opposite(),node_ids.rbegin(),node_ids.rend()); - } - - typename Poly_to_map_node::iterator it_map=polyhedron_to_map_node_to_polyhedron_vertex.find(P); - CGAL_assertion(it_map!=polyhedron_to_map_node_to_polyhedron_vertex.end()); - //a map to identify the vertex in the polyhedron corresponding to an intersection point - Node_to_polyhedron_vertex_map& node_to_polyhedron_vertex=it_map->second; - - CGAL_assertion_code(Vertex_handle original_vertex=hedge->opposite()->vertex();) - - //We need an edge incident to the source vertex of hedge. This is the first opposite edge created. - bool first=true; Halfedge_handle hedge_incident_to_src; - //do split the edges - for (std::vector::const_iterator it_id=node_ids.begin();it_id!=node_ids.end();++it_id){ - Vertex_handle v=split_edge(hedge, *it_id, nodes, *P); - node_to_polyhedron_vertex.insert(std::make_pair(*it_id,v)); - if (first){ - first=false; - hedge_incident_to_src=hedge->opposite()->next(); - } - } - - CGAL_assertion(hedge_incident_to_src->vertex()==original_vertex); - CGAL_assertion(hedge_incident_to_src->face()==hedge->opposite()->face()); - - //save original face and nodes for face of hedge->opposite (2) - if ( !hedge->opposite()->is_border() ){ - CGAL_assertion(opposite_original_info!=faces_boundary.end()); - opposite_original_info->second.update_original_halfedge(hedge->opposite(),hedge_incident_to_src); - } - - //insert the two incident faces in in_face map so that they will be triangulated. - if (!hedge->is_border()) in_face.insert(std::make_pair(hedge->face(),Node_ids())); - if (!hedge->opposite()->is_border()) in_face.insert(std::make_pair(hedge->opposite()->face(),Node_ids())); - } - - //2)triangulation of the triangle faces containing intersection point in their interior - // and also those with intersection points only on the boundary. - for (typename In_face_map::iterator it=in_face.begin();it!=in_face.end();++it) - { - Face_handle f = it->first; //the face to be retriangulated - Node_ids& node_ids = it->second; //the index of the intersection point that are interior to the face - CGAL_assertion(std::set(node_ids.begin(), node_ids.end()).size()==node_ids.size()); - typename Faces_boundary::iterator it_fb=faces_boundary.find(f); - - - typename Hedge_to_polyhedron_map::iterator it_polyhedron = hedge_to_polyhedron.find (f->halfedge()); //we can do this because the halfedge is still the same (at least its address)+no Face::set_halfedge called - CGAL_assertion(it_polyhedron != hedge_to_polyhedron.end()); - Polyhedron* P=it_polyhedron->second; - typename Poly_to_map_node::iterator it_map=polyhedron_to_map_node_to_polyhedron_vertex.find(P); - CGAL_assertion(it_map!=polyhedron_to_map_node_to_polyhedron_vertex.end()); - //a map to identify the vertex in the polyhedron corresponding to an intersection point - Node_to_polyhedron_vertex_map& node_to_polyhedron_vertex=it_map->second; - - std::map id_to_CDT_vh; - - //associate an edge of the triangulation to a halfedge in a given polyhedron - std::map,Halfedge_handle> edge_to_hedge; - - Vertex_handle triangle_boundary[3]; - int triangle_boundary_indices[3]; //the node_id of the triangle original vertex or a fake id - if (it_fb!=faces_boundary.end()){ //the boundary of the triangle face was refined - triangle_boundary[0]=it_fb->second.vertices[0]; - triangle_boundary[1]=it_fb->second.vertices[1]; - triangle_boundary[2]=it_fb->second.vertices[2]; - set_triangle_boundary_indices(triangle_boundary,triangle_boundary_indices); - } - else{ - triangle_boundary[0]=f->halfedge()->vertex(); //-1 - triangle_boundary[1]=f->halfedge()->next()->vertex(); //-2 - triangle_boundary[2]=f->halfedge()->next()->next()->vertex(); //-3 - CGAL_assertion(f->halfedge()->next()->next()->next()==f->halfedge());//check this is a triangle - set_triangle_boundary_indices(triangle_boundary,triangle_boundary_indices); - edge_to_hedge.insert (std::make_pair( std::make_pair( triangle_boundary_indices[2],triangle_boundary_indices[0] ) , f->halfedge() ) ); - edge_to_hedge.insert (std::make_pair( std::make_pair( triangle_boundary_indices[0],triangle_boundary_indices[1] ) , f->halfedge()->next() ) ); - edge_to_hedge.insert (std::make_pair( std::make_pair( triangle_boundary_indices[1],triangle_boundary_indices[2] ) , f->halfedge()->next()->next() ) ); - } - - - #ifdef DO_NO_USE_EXACT_CDT - typename Kernel::Plane_3 plane( get(ppmap,triangle_boundary[0]),get(ppmap,triangle_boundary[1]),get(ppmap,triangle_boundary[2])); - #else - CGAL::Cartesian_converter convert; - typename Exact_kernel::Plane_3 plane(convert(get(ppmap,triangle_boundary[0])),convert(get(ppmap,triangle_boundary[1])),convert(get(ppmap,triangle_boundary[2]))); - #endif - CDT triangulation; - //insert point inside face - for (std::vector::iterator it_node_id=node_ids.begin();it_node_id!=node_ids.end();++it_node_id){ - #ifdef DO_NO_USE_EXACT_CDT - typename CDT::Vertex_handle vh=triangulation.insert(plane.to_2d(nodes[*it_node_id])); - #else - typename CDT::Vertex_handle vh=triangulation.insert(plane.to_2d(nodes.exact_node(*it_node_id))); - #endif - vh->info()=*it_node_id; - id_to_CDT_vh.insert(std::make_pair(*it_node_id,vh)); - } - - - typename CDT::Vertex_handle triangle_vertices[3]; - #ifdef DO_NO_USE_EXACT_CDT - triangle_vertices[0]=triangulation.insert(plane.to_2d(get(ppmap,triangle_boundary[0]))); - triangle_vertices[1]=triangulation.insert(plane.to_2d(get(ppmap,triangle_boundary[1]))); - triangle_vertices[2]=triangulation.insert(plane.to_2d(get(ppmap,triangle_boundary[2]))); - #else - //we can do this because these are input points. - triangle_vertices[0]=triangulation.insert(plane.to_2d(convert(get(ppmap,triangle_boundary[0])))); - triangle_vertices[1]=triangulation.insert(plane.to_2d(convert(get(ppmap,triangle_boundary[1])))); - triangle_vertices[2]=triangulation.insert(plane.to_2d(convert(get(ppmap,triangle_boundary[2])))); - #endif - - triangle_vertices[0]->info()=triangle_boundary_indices[0]; - triangle_vertices[1]->info()=triangle_boundary_indices[1]; - triangle_vertices[2]->info()=triangle_boundary_indices[2]; - //insert face_extremities: we use operator[] because indice -1,-2,-3 are used in each loop and are specific to the current face - node_to_polyhedron_vertex[-1]=triangle_boundary[0]; - node_to_polyhedron_vertex[-2]=triangle_boundary[1]; - node_to_polyhedron_vertex[-3]=triangle_boundary[2]; - - //if one of the triangle original vertex is also a node - for (int ik=0;ik<3;++ik){ - if ( triangle_boundary_indices[ik]>=0 ) - id_to_CDT_vh.insert(std::make_pair(triangle_boundary_indices[ik],triangle_vertices[ik])); - } - //insert points on edges - #ifdef DO_NO_USE_EXACT_CDT - //and constrains these edges - #endif - if (it_fb!=faces_boundary.end()) //is there at least one intersection point on the boundary of the face? - { - //in the following loop, for each original edge of the triangle, we insert the constrained edges - // and we recover the halfedge_handle corresponding to these constrained (they are already in the polyhedron) - for (int i=0;i<3;++i){ -// std::cerr << "Boundary edges" << std::endl; -// std::cerr << " " << -1-i <second.node_ids_array[i]; - typename CDT::Vertex_handle previous=triangle_vertices[i]; - int previous_index=triangle_boundary_indices[i]; //index of original Polyhedron vertex - Halfedge_handle hedge = it_fb->second.halfedges[ (i+2) % 3]->next(); - CGAL_assertion( hedge->opposite()->vertex()==it_fb->second.vertices[i] ); - if (!bounding_ids.empty()){ //is there al least one intersection point on this edge? - for (Node_ids::iterator it_id=bounding_ids.begin();it_id!=bounding_ids.end();++it_id){ -// std::cerr << " "<< *it_id << std::endl; - #ifdef DO_NO_USE_EXACT_CDT - typename CDT::Vertex_handle vh=triangulation.insert(plane.to_2d(nodes[*it_id])); - #else - typename CDT::Vertex_handle vh=triangulation.insert(plane.to_2d(nodes.exact_node(*it_id))); - #endif - vh->info()=*it_id; - id_to_CDT_vh.insert(std::make_pair(*it_id,vh)); - #ifdef DO_NO_USE_EXACT_CDT - triangulation.insert_constraint(previous,vh); - #endif - edge_to_hedge.insert (std::make_pair( std::make_pair(previous_index,*it_id),hedge) ); - previous=vh; - hedge=hedge->next(); - previous_index=*it_id; - } - } - else{ - CGAL_assertion( it_fb->second.halfedges[i]->vertex() == it_fb->second.vertices[ (i+1) % 3 ] ); - CGAL_assertion( it_fb->second.halfedges[i]->opposite()->vertex() == it_fb->second.vertices[ i ] ); - } - CGAL_assertion(hedge==it_fb->second.halfedges[i]); - edge_to_hedge.insert (std::make_pair( std::make_pair(previous_index,triangle_boundary_indices[(i+1) % 3]) , it_fb->second.halfedges[i] ) ); -// std::cerr << " " << -1 - ( (i+1) % 3 ) < > constrained_edges; - - //insert constraints that are interior to the triangle (in the case no edges are collinear in the meshes) - insert_constrained_edges(node_ids,triangulation,id_to_CDT_vh,constrained_edges); - - //insert constraints between points that are on the boundary (not a contrained on the triangle boundary) - if (it_fb!=faces_boundary.end()) //is there at least one intersection point on the boundary of the face? - { - for (int i=0;i<3;++i){ - Node_ids& bounding_ids=it_fb->second.node_ids_array[i]; - insert_constrained_edges(bounding_ids,triangulation,id_to_CDT_vh,constrained_edges,true); - } - } - - //insert coplanar edges for endpoints of triangles - for (int i=0;i<3;++i){ - int nindex=triangle_vertices[i]->info(); - if ( nindex >=0 ) - insert_constrained_edges_coplanar_case(nindex,triangulation,id_to_CDT_vh); - } - - //XSL_TAG_CPL_VERT - //collect edges incident to a point that is the intersection of two coplanar faces. - //This ensure that triangulations are compatible. - if (it_fb!=faces_boundary.end()) //is there at least one intersection point on the boundary of the face? - { - for (typename CDT::Finite_vertices_iterator vit=triangulation.finite_vertices_begin(), - vit_end=triangulation.finite_vertices_end();vit_end!=vit;++vit) - { - //skip original vertices (that are not nodes) and non-coplanar facet issued vertices - //(this is working because intersection points between coplanar facets are the first inserted) - if ( vit->info() < 0 || vit->info() >= number_coplanar_vertices) continue; - std::map< int,std::set >::iterator res=coplanar_constraints.insert(std::make_pair(vit->info(),std::set())).first; - //turn around the vertex and get incident edge - typename CDT::Edge_circulator start=triangulation.incident_edges(vit); - typename CDT::Edge_circulator curr=start; - do{ - if (triangulation.is_infinite(*curr) ) continue; - typename CDT::Edge mirror_edge=triangulation.mirror_edge(*curr); - if ( triangulation.is_infinite( curr->first->vertex(curr->second) ) || - triangulation.is_infinite( mirror_edge.first->vertex(mirror_edge.second) ) ) - continue; //skip edges that are on the boundary of the triangle (these are already constrained) - //insert edges in the set of constraints - int nindex = - curr->first->vertex( (curr->second+1)%3 )==static_cast(vit)? - (curr->second+2)%3:(curr->second+1)%3; - typename CDT::Vertex_handle vn=curr->first->vertex(nindex); - if ( vit->info() > vn->info() ) continue; //take only one out of the two edges + skip negative vn->info() - CGAL_assertion(vn->info()>=0); - res->second.insert( vn->info() ); - }while(start!=++curr); - } - -// this is a working alternative that should be slower -// for (typename CDT::Finite_edges_iterator eit=triangulation.finite_edges_begin(), -// eit_end=triangulation.finite_edges_end();eit_end!=eit;++eit) -// { -// typename CDT::Edge mirror_edge=triangulation.mirror_edge(*eit); -// if ( triangulation.is_infinite( eit->first->vertex(eit->second) ) || -// triangulation.is_infinite( mirror_edge.first->vertex(mirror_edge.second) ) ) -// continue; //skip edges that are on the boundary of the triangle (these are already constrained) -// typename CDT::Vertex_handle v1=eit->first->vertex( (eit->second+1)%3 ), -// v2=eit->first->vertex( (eit->second+2)%3 ); -// if (v1->info()<0 || v2->info()<0) continue; -// if ( v1->info() > v2->info() ) std::swap(v1,v2); -// coplanar_constraints.insert(std::make_pair(v1->info(),std::set())).first->second.insert(v2->info()); -// } - } - - - //create a modifier to insert nodes and copy the triangulation of the face - //inside the polyhedron - internal_IOP::Triangulate_a_face modifier( - f, nodes, node_ids, node_to_polyhedron_vertex, edge_to_hedge, triangulation, facet_construct, node_vertex_visitor, ppmap); - - CGAL_assertion(P->is_valid()); - P->delegate(modifier); - CGAL_assertion(P->is_valid()); - - //3) mark halfedges that are common to two polyhedral surfaces - //recover halfedges inserted that are on the intersection - for (std::list >::iterator it_cst=constrained_edges.begin();it_cst!=constrained_edges.end();++it_cst) - { - typename std::map,Halfedge_handle>::iterator it_poly_hedge=edge_to_hedge.find(*it_cst); - //we cannot have an assertion here in the case an edge or part of an edge is a constraints. - //Indeed, the graph_of_constraints report an edge 0,1 and 1,0 for example while only one of the two - //is defined as one of them defines an adjacent face - //CGAL_assertion(it_poly_hedge!=edge_to_hedge.end()); - if( it_poly_hedge!=edge_to_hedge.end() ){ - if ( border_halfedges.insert( std::make_pair(Halfedge_const_handle(it_poly_hedge->second),*it_cst) ).second) - { - put(m_edge_mark_pmap,std::make_pair(it_poly_hedge->second,P),true); - put(m_edge_mark_pmap,std::make_pair(it_poly_hedge->second->opposite(),P),true); //setting the opposite is only needed for border edges (done in adjacent triangle otherwise) - } - update_edge_per_polyline(P,it_poly_hedge->first,it_poly_hedge->second); - } - else{ - //WARNING: in few case this is needed if the marked edge is on the border - //to optimize it might be better to only use sorted pair. TAG_SLXX1 - std::pair opposite_pair(it_cst->second,it_cst->first); - it_poly_hedge=edge_to_hedge.find(opposite_pair); - CGAL_assertion( it_poly_hedge!=edge_to_hedge.end() ); - - if ( border_halfedges.insert( std::make_pair(Halfedge_const_handle(it_poly_hedge->second),opposite_pair) ).second ) - { - put(m_edge_mark_pmap,std::make_pair(it_poly_hedge->second,P),true); - put(m_edge_mark_pmap,std::make_pair(it_poly_hedge->second->opposite(),P),true); //setting the opposite is only needed for border edges (done in adjacent triangle otherwise) - } - update_edge_per_polyline(P,it_poly_hedge->first,it_poly_hedge->second); - } - } - } - output_builder(border_halfedges, nodes, an_edge_per_polyline, is_node_of_degree_one, polyhedron_to_map_node_to_polyhedron_vertex); - } - - template - PolylineOfHalfedgeOutputIterator - explicitly_compute_polylines( - Polyhedron* P, - const Marked_set& is_marked, - PolylineOfHalfedgeOutputIterator out) - { - typedef std::pair< const std::pair, - std::pair< std::map, - std::pair > > Complicated_pair; - BOOST_FOREACH( - Complicated_pair& p, - an_edge_per_polyline) - { - const std::pair& reversed_and_nbpts = p.second.second; - Halfedge_handle hedge = p.second.first[P]; - std::vector polyline; - int nbsegments=reversed_and_nbpts.second-1; - polyline.reserve( nbsegments ); - polyline.push_back( reversed_and_nbpts.first?hedge->opposite():hedge ); - for (int i=1; i - -#endif //CGAL_INTERSECTION_OF_POLYHEDRA_3_REFINEMENT_VISITOR_H diff --git a/Operations_on_polyhedra/package_info/Operations_on_polyhedra/copyright b/Operations_on_polyhedra/package_info/Operations_on_polyhedra/copyright deleted file mode 100644 index d6bcad90777..00000000000 --- a/Operations_on_polyhedra/package_info/Operations_on_polyhedra/copyright +++ /dev/null @@ -1,2 +0,0 @@ -GeometryFactory -INRIA Sophia-Antipolis diff --git a/Operations_on_polyhedra/package_info/Operations_on_polyhedra/dependencies b/Operations_on_polyhedra/package_info/Operations_on_polyhedra/dependencies deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/Operations_on_polyhedra/package_info/Operations_on_polyhedra/description.txt b/Operations_on_polyhedra/package_info/Operations_on_polyhedra/description.txt deleted file mode 100644 index fb0b8c5d6c6..00000000000 --- a/Operations_on_polyhedra/package_info/Operations_on_polyhedra/description.txt +++ /dev/null @@ -1,3 +0,0 @@ -Package gathering non-documented functionalities used in a polyhedron demo plugin -and some other packages. At some point, we might decide to document them properly. - diff --git a/Operations_on_polyhedra/package_info/Operations_on_polyhedra/license.txt b/Operations_on_polyhedra/package_info/Operations_on_polyhedra/license.txt deleted file mode 100644 index 8bb8efcb72b..00000000000 --- a/Operations_on_polyhedra/package_info/Operations_on_polyhedra/license.txt +++ /dev/null @@ -1 +0,0 @@ -GPL (v3 or later) diff --git a/Operations_on_polyhedra/package_info/Operations_on_polyhedra/maintainer b/Operations_on_polyhedra/package_info/Operations_on_polyhedra/maintainer deleted file mode 100644 index 5b055eb65c1..00000000000 --- a/Operations_on_polyhedra/package_info/Operations_on_polyhedra/maintainer +++ /dev/null @@ -1 +0,0 @@ -Sébastien Loriot 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 0904749fa9e..347644cd409 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 @@ -9,16 +9,16 @@ if(NOT POLICY CMP0070 AND POLICY CMP0053) endif() # Include this package's headers first -include_directories( BEFORE ./ ./include ../../include ) +include_directories( BEFORE ./ ./include ) # Find CGAL and CGAL Qt5 find_package(CGAL COMPONENTS Qt5) -include( ${CGAL_USE_FILE} ) # Find Qt5 itself find_package(Qt5 5.4 QUIET COMPONENTS OpenGL) if(Qt5_FOUND) add_definitions(-DQT_NO_KEYWORDS) + set(CMAKE_INCLUDE_CURRENT_DIR ON) endif(Qt5_FOUND) # Find CImg diff --git a/Optimal_transportation_reconstruction_2/demo/Optimal_transportation_reconstruction_2/random.h b/Optimal_transportation_reconstruction_2/demo/Optimal_transportation_reconstruction_2/random.h deleted file mode 100644 index b8886e54b7c..00000000000 --- a/Optimal_transportation_reconstruction_2/demo/Optimal_transportation_reconstruction_2/random.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef _RANDOM_ -#define _RANDOM_ 1 - -inline -double random_double(const double min, const double max) -{ - double range = max - min; - return min + (double(rand()) / double(RAND_MAX)) * range; -} - -inline -int random_int(const int min, const int max) -{ - int range = max - min; - return min + int((double(rand())/double(RAND_MAX)) * range); -} - -template -Vector random_vec(const double scale) -{ - double dx = random_double(-scale, scale); - double dy = random_double(-scale, scale); - return Vector(dx, dy); -} - -#endif diff --git a/Optimal_transportation_reconstruction_2/demo/Optimal_transportation_reconstruction_2/render.cpp b/Optimal_transportation_reconstruction_2/demo/Optimal_transportation_reconstruction_2/render.cpp index ac0893ed1e9..794ac675167 100644 --- a/Optimal_transportation_reconstruction_2/demo/Optimal_transportation_reconstruction_2/render.cpp +++ b/Optimal_transportation_reconstruction_2/demo/Optimal_transportation_reconstruction_2/render.cpp @@ -335,7 +335,7 @@ void R_s_k_2::draw_relevance(const float line_width, const int nb) MultiIndex mindex; FT min_value = (std::numeric_limits::max)(); FT max_value = -(std::numeric_limits::max)(); - unsigned nb_initial = 0; + unsigned int nb_initial = 0; for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); ei != m_dt.finite_edges_end(); ++ei) { Edge edge = *ei; diff --git a/Optimal_transportation_reconstruction_2/demo/Optimal_transportation_reconstruction_2/scene.h b/Optimal_transportation_reconstruction_2/demo/Optimal_transportation_reconstruction_2/scene.h index 4a9d9c8f73b..5c2444aefc9 100644 --- a/Optimal_transportation_reconstruction_2/demo/Optimal_transportation_reconstruction_2/scene.h +++ b/Optimal_transportation_reconstruction_2/demo/Optimal_transportation_reconstruction_2/scene.h @@ -18,7 +18,7 @@ #define cimg_display 0 // To avoid X11 or Windows-GDI dependency #include #endif -#include "random.h" +#include #include // std::pair #include #include @@ -104,7 +104,17 @@ private: double m_bbox_x; double m_bbox_y; double m_bbox_size; - + + //Random + CGAL::Random random; + + template + Vector random_vec(const double scale) + { + double dx = random.get_double(-scale, scale); + double dy = random.get_double(-scale, scale); + return Vector(dx, dy); + } public: Scene() { @@ -523,7 +533,7 @@ public: std::vector::iterator it; for (it = m_samples.begin(); it != m_samples.end(); it++) { - const double rd = random_double(0.0, 1.0); + const double rd = random.get_double(0.0, 1.0); if (rd >= percentage) selected.push_back(*it); } @@ -542,7 +552,7 @@ public: Sample_& s = *it; samples.push_back(&s); - FT rv = random_double(0.0, 1.0); + FT rv = random.get_double(0.0, 1.0); if (rv <= percentage) vertices.push_back(&s); } diff --git a/Optimal_transportation_reconstruction_2/doc/Optimal_transportation_reconstruction_2/PackageDescription.txt b/Optimal_transportation_reconstruction_2/doc/Optimal_transportation_reconstruction_2/PackageDescription.txt index 4bca3636d37..08b34f772fa 100644 --- a/Optimal_transportation_reconstruction_2/doc/Optimal_transportation_reconstruction_2/PackageDescription.txt +++ b/Optimal_transportation_reconstruction_2/doc/Optimal_transportation_reconstruction_2/PackageDescription.txt @@ -1,24 +1,24 @@ -/// \defgroup PkgOptimalTransportationReconstruction2 Optimal Transportation Curve Reconstruction Reference +/// \defgroup PkgOptimalTransportationReconstruction2Ref Optimal Transportation Curve Reconstruction Reference /// \defgroup PkgOptimalTransportationReconstruction2Concepts Concepts -/// \ingroup PkgOptimalTransportationReconstruction2 +/// \ingroup PkgOptimalTransportationReconstruction2Ref /// \defgroup PkgOptimalTransportationReconstruction2Classes Classes -/// \ingroup PkgOptimalTransportationReconstruction2 +/// \ingroup PkgOptimalTransportationReconstruction2Ref /*! -\addtogroup PkgOptimalTransportationReconstruction2 -\cgalPkgDescriptionBegin{Optimal Transportation Curve Reconstruction, PkgOptimalTransportationReconstruction2Summary} +\addtogroup PkgOptimalTransportationReconstruction2Ref +\cgalPkgDescriptionBegin{Optimal Transportation Curve Reconstruction, PkgOptimalTransportationReconstruction2} \cgalPkgPicture{RS_2_small.png} \cgalPkgSummaryBegin \cgalPkgAuthor{Pierre Alliez, David Cohen-Steiner, Fernando de Goes, Clément Jamin, Ivo Vigan} \cgalPkgDesc{This package provides an algorithm to reconstruct and simplify a shape from a point set in the plane, possibly hampered with noise and outliers. It generates as output a set of line segments and isolated points, which approximate the input point set.} -\cgalPkgManuals{Chapter_Optimal_Transportation_Curve_Reconstruction, PkgOptimalTransportationReconstruction2} +\cgalPkgManuals{Chapter_Optimal_Transportation_Curve_Reconstruction, PkgOptimalTransportationReconstruction2Ref} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{4.8} -\cgalPkgDependsOn{\ref PkgTriangulation2Summary} +\cgalPkgDependsOn{\ref PkgTriangulation2} \cgalPkgBib{cgal:gavj-rs} \cgalPkgLicense{\ref licensesGPL "GPL"} \cgalPkgDemo{2D Optimal Transportation Curve Reconstruction,otr2.zip} diff --git a/Optimal_transportation_reconstruction_2/examples/Optimal_transportation_reconstruction_2/CMakeLists.txt b/Optimal_transportation_reconstruction_2/examples/Optimal_transportation_reconstruction_2/CMakeLists.txt index 83536913dd4..8bfa8321c43 100644 --- a/Optimal_transportation_reconstruction_2/examples/Optimal_transportation_reconstruction_2/CMakeLists.txt +++ b/Optimal_transportation_reconstruction_2/examples/Optimal_transportation_reconstruction_2/CMakeLists.txt @@ -1,6 +1,6 @@ project( Optimal_transportation_reconstruction_2_Examples ) -cmake_minimum_required(VERSION 2.6.2) +cmake_minimum_required(VERSION 3.1) if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" VERSION_GREATER 2.6) if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}" VERSION_GREATER 2.8.3) cmake_policy(VERSION 2.8.4) @@ -13,12 +13,6 @@ find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - include_directories (BEFORE "../../include") - include_directories (BEFORE "include") create_single_source_cgal_program( "otr2_simplest_example.cpp" ) diff --git a/Optimal_transportation_reconstruction_2/include/CGAL/Optimal_transportation_reconstruction_2.h b/Optimal_transportation_reconstruction_2/include/CGAL/Optimal_transportation_reconstruction_2.h index 6553bea8450..4e487ef93a9 100644 --- a/Optimal_transportation_reconstruction_2/include/CGAL/Optimal_transportation_reconstruction_2.h +++ b/Optimal_transportation_reconstruction_2/include/CGAL/Optimal_transportation_reconstruction_2.h @@ -79,11 +79,11 @@ Furthermore, we can relocate the vertices by calling `relocate_all_points()`. \tparam Traits a model of the concept `OptimalTransportationReconstructionTraits_2`. \tparam PointPMap a model of `ReadablePropertyMap` with value type `Traits::Point_2`. - Defaults to `boost::typed_identity_property_map` + Defaults to `boost::typed_identity_property_map` (for the case the input is points without mass). \tparam MassPMap a model of `ReadablePropertyMap` with value type `Traits::FT` - Defaults to `boost::static_property_map` + Defaults to `boost::static_property_map` (for the case the input is points without mass). */ @@ -839,7 +839,7 @@ public: bool random_pedge(Rec_edge_2& pedge) { - for (unsigned i = 0; i < 10; ++i) { + for (unsigned int i = 0; i < 10; ++i) { Edge edge = m_dt.random_finite_edge(); if (m_dt.is_pinned(edge)) continue; @@ -992,7 +992,7 @@ public: Face_handle copy_face( Face_handle f0, Face_handle f1, Vertex_handle_map& vmap) const { - for (unsigned i = 0; i < 3; ++i) { + for (unsigned int i = 0; i < 3; ++i) { Vertex_handle v0i = f0->vertex(i); Vertex_handle v1i = vmap[v0i]; f1->set_vertex(i, v1i); @@ -1014,7 +1014,7 @@ public: cf->set_neighbor(i, cfi); } - for (unsigned j = 0; j < 2; ++j) { + for (unsigned int j = 0; j < 2; ++j) { i = (i + 1) % 3; Face_handle fi = f->neighbor(i); Face_handle cfi = fmap[fi]; @@ -1049,8 +1049,8 @@ public: outer_faces.push_back(outer); } - for (unsigned i = 0; i < outer_faces.size(); ++i) { - unsigned j = (i + 1) % outer_faces.size(); + for (unsigned int i = 0; i < outer_faces.size(); ++i) { + unsigned int j = (i + 1) % outer_faces.size(); outer_faces[i]->set_neighbor(2, outer_faces[j]); outer_faces[j]->set_neighbor(1, outer_faces[i]); } @@ -1534,15 +1534,15 @@ public: `false` if the algorithm was prematurely ended because no more edge collapse was possible. */ - bool run(const unsigned steps) { + bool run(const unsigned int steps) { m_tolerance = (FT)(-1.); CGAL::Real_timer timer; if (m_verbose > 0) std::cerr << "reconstruct " << steps; timer.start(); - unsigned performed = 0; - for (unsigned i = 0; i < steps; ++i) { + unsigned int performed = 0; + for (unsigned int i = 0; i < steps; ++i) { bool ok = decimate(); if (!ok) break; @@ -1579,7 +1579,7 @@ public: std::cerr << "reconstruct under tolerance " << tolerance; timer.start(); - unsigned performed = 0; + unsigned int performed = 0; while (decimate ()) performed++; diff --git a/Optimal_transportation_reconstruction_2/test/Optimal_transportation_reconstruction_2/CMakeLists.txt b/Optimal_transportation_reconstruction_2/test/Optimal_transportation_reconstruction_2/CMakeLists.txt index a643ec4ce5c..fb284c89da7 100644 --- a/Optimal_transportation_reconstruction_2/test/Optimal_transportation_reconstruction_2/CMakeLists.txt +++ b/Optimal_transportation_reconstruction_2/test/Optimal_transportation_reconstruction_2/CMakeLists.txt @@ -1,6 +1,6 @@ project( Optimal_transportation_reconstruction_2_Tests ) -cmake_minimum_required(VERSION 2.6.2) +cmake_minimum_required(VERSION 3.1) if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" VERSION_GREATER 2.6) if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}" VERSION_GREATER 2.8.3) cmake_policy(VERSION 2.8.4) @@ -13,12 +13,6 @@ find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - include_directories (BEFORE "../../include") - include_directories (BEFORE "include") create_single_source_cgal_program( "test_basic.cpp" ) diff --git a/Partition_2/doc/Partition_2/CGAL/Partition_is_valid_traits_2.h b/Partition_2/doc/Partition_2/CGAL/Partition_is_valid_traits_2.h index 0907ad2079c..20d1a76929e 100644 --- a/Partition_2/doc/Partition_2/CGAL/Partition_is_valid_traits_2.h +++ b/Partition_2/doc/Partition_2/CGAL/Partition_is_valid_traits_2.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgPolygonPartitioning2 +\ingroup PkgPartition2Ref Class that derives a traits class for `partition_is_valid_2()` from a given traits class by defining the validity testing function object diff --git a/Partition_2/doc/Partition_2/CGAL/Partition_traits_2.h b/Partition_2/doc/Partition_2/CGAL/Partition_traits_2.h index 9996785a690..5677ddd2732 100644 --- a/Partition_2/doc/Partition_2/CGAL/Partition_traits_2.h +++ b/Partition_2/doc/Partition_2/CGAL/Partition_traits_2.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgPolygonPartitioning2 +\ingroup PkgPartition2Ref Traits class that can be used with all the 2-dimensional polygon partitioning algorithms. It is parameterized by diff --git a/Partition_2/doc/Partition_2/CGAL/is_y_monotone_2.h b/Partition_2/doc/Partition_2/CGAL/is_y_monotone_2.h index 06cde3ab9f6..8717cfdf24f 100644 --- a/Partition_2/doc/Partition_2/CGAL/is_y_monotone_2.h +++ b/Partition_2/doc/Partition_2/CGAL/is_y_monotone_2.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgPolygonPartitioning2 +\ingroup PkgPartition2Ref determines if the sequence of points in the range [`first`, `beyond`) defines a \f$ y\f$-monotone diff --git a/Partition_2/doc/Partition_2/CGAL/partition_2.h b/Partition_2/doc/Partition_2/CGAL/partition_2.h index d94eddd399a..d09b2bff7c7 100644 --- a/Partition_2/doc/Partition_2/CGAL/partition_2.h +++ b/Partition_2/doc/Partition_2/CGAL/partition_2.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgPolygonPartitioning2 +\ingroup PkgPartition2Ref \brief computes a partition of the polygon defined by the points in the range [`first`, `beyond`) into convex polygons. The @@ -70,7 +70,7 @@ const Traits& traits = Default_traits); namespace CGAL { /*! -\ingroup PkgPolygonPartitioning2 +\ingroup PkgPartition2Ref \brief computes a partition of the polygon defined by the points in the range [`first`, `beyond`) into convex @@ -144,7 +144,7 @@ const Traits& traits = Default_traits); namespace CGAL { /*! -\ingroup PkgPolygonPartitioning2 +\ingroup PkgPartition2Ref \brief computes a partition of the polygon defined by the points in the range [`first`, `beyond`) into convex @@ -218,7 +218,7 @@ const Traits& traits = Default_traits); namespace CGAL { /*! -\ingroup PkgPolygonPartitioning2 +\ingroup PkgPartition2Ref \brief computes a partition of the polygon defined by the points in the range [`first`, `beyond`) into \f$ y\f$-monotone diff --git a/Partition_2/doc/Partition_2/CGAL/partition_is_valid_2.h b/Partition_2/doc/Partition_2/CGAL/partition_is_valid_2.h index afcca9a1f4b..ca42719bf12 100644 --- a/Partition_2/doc/Partition_2/CGAL/partition_is_valid_2.h +++ b/Partition_2/doc/Partition_2/CGAL/partition_is_valid_2.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgPolygonPartitioning2 +\ingroup PkgPartition2Ref \brief determines if the polygons in the range [`poly_first`, `poly_beyond`) define a valid convex partition of the polygon defined by the points in the @@ -65,7 +65,7 @@ const Traits& traits = Default_traits); namespace CGAL { /*! -\ingroup PkgPolygonPartitioning2 +\ingroup PkgPartition2Ref \brief returns `true` iff the polygons in the range [`poly_first`, `poly_beyond`) define a valid partition of the polygon defined by the @@ -125,7 +125,7 @@ const Traits& traits = Default_traits); namespace CGAL { /*! -\ingroup PkgPolygonPartitioning2 +\ingroup PkgPartition2Ref \brief determines if the polygons in the range [`poly_first`, `poly_beyond`) define a valid \f$ y\f$-monotone partition of the simple, counterclockwise-oriented polygon represented by the points diff --git a/Partition_2/doc/Partition_2/CGAL/polygon_function_objects.h b/Partition_2/doc/Partition_2/CGAL/polygon_function_objects.h index 813b921eb5f..56585fe0eb2 100644 --- a/Partition_2/doc/Partition_2/CGAL/polygon_function_objects.h +++ b/Partition_2/doc/Partition_2/CGAL/polygon_function_objects.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgPolygonPartitioning2FunctionObjectClasses +\ingroup PkgPartition2FunctionObjectClasses Function object class for testing if a sequence of points represents a convex polygon or not. @@ -51,7 +51,7 @@ bool operator()(InputIterator first, InputIterator beyond); namespace CGAL { /*! -\ingroup PkgPolygonPartitioning2FunctionObjectClasses +\ingroup PkgPartition2FunctionObjectClasses Function object class that indicates all sequences of points are valid. @@ -98,7 +98,7 @@ bool operator()(InputIterator first, InputIterator beyond); namespace CGAL { /*! -\ingroup PkgPolygonPartitioning2FunctionObjectClasses +\ingroup PkgPartition2FunctionObjectClasses Function object class that tests whether a sequence of points represents a \f$ y\f$-monotone polygon or not. diff --git a/Partition_2/doc/Partition_2/Concepts/ConvexPartitionIsValidTraits_2.h b/Partition_2/doc/Partition_2/Concepts/ConvexPartitionIsValidTraits_2.h index bb4d5a7db39..9dc02ba5cd6 100644 --- a/Partition_2/doc/Partition_2/Concepts/ConvexPartitionIsValidTraits_2.h +++ b/Partition_2/doc/Partition_2/Concepts/ConvexPartitionIsValidTraits_2.h @@ -1,5 +1,5 @@ /*! -\ingroup PkgPolygonPartitioning2Concepts +\ingroup PkgPartition2Concepts \cgalConcept Requirements of a traits class used diff --git a/Partition_2/doc/Partition_2/Concepts/IsYMonotoneTraits_2.h b/Partition_2/doc/Partition_2/Concepts/IsYMonotoneTraits_2.h index 5995ffbccae..c301038e26d 100644 --- a/Partition_2/doc/Partition_2/Concepts/IsYMonotoneTraits_2.h +++ b/Partition_2/doc/Partition_2/Concepts/IsYMonotoneTraits_2.h @@ -1,5 +1,5 @@ /*! -\ingroup PkgPolygonPartitioning2Concepts +\ingroup PkgPartition2Concepts \cgalConcept Requirements of a traits class to be diff --git a/Partition_2/doc/Partition_2/Concepts/OptimalConvexPartitionTraits_2.h b/Partition_2/doc/Partition_2/Concepts/OptimalConvexPartitionTraits_2.h index 61ff4069437..75b8650c179 100644 --- a/Partition_2/doc/Partition_2/Concepts/OptimalConvexPartitionTraits_2.h +++ b/Partition_2/doc/Partition_2/Concepts/OptimalConvexPartitionTraits_2.h @@ -1,5 +1,5 @@ /*! -\ingroup PkgPolygonPartitioning2Concepts +\ingroup PkgPartition2Concepts \cgalConcept Requirements of a traits class to be diff --git a/Partition_2/doc/Partition_2/Concepts/PartitionIsValidTraits_2.h b/Partition_2/doc/Partition_2/Concepts/PartitionIsValidTraits_2.h index dcf5f15b0df..21504a9e40d 100644 --- a/Partition_2/doc/Partition_2/Concepts/PartitionIsValidTraits_2.h +++ b/Partition_2/doc/Partition_2/Concepts/PartitionIsValidTraits_2.h @@ -1,5 +1,5 @@ /*! -\ingroup PkgPolygonPartitioning2Concepts +\ingroup PkgPartition2Concepts \cgalConcept Requirements of a traits class that is used diff --git a/Partition_2/doc/Partition_2/Concepts/PartitionTraits_2.h b/Partition_2/doc/Partition_2/Concepts/PartitionTraits_2.h index 3200b387d4b..efba38f7d02 100644 --- a/Partition_2/doc/Partition_2/Concepts/PartitionTraits_2.h +++ b/Partition_2/doc/Partition_2/Concepts/PartitionTraits_2.h @@ -1,5 +1,5 @@ /*! -\ingroup PkgPolygonPartitioning2Concepts +\ingroup PkgPartition2Concepts \cgalConcept The polygon partitioning functions are each parameterized by a traits class diff --git a/Partition_2/doc/Partition_2/Concepts/PolygonIsValid.h b/Partition_2/doc/Partition_2/Concepts/PolygonIsValid.h index daef60f6fe1..574be222ee7 100644 --- a/Partition_2/doc/Partition_2/Concepts/PolygonIsValid.h +++ b/Partition_2/doc/Partition_2/Concepts/PolygonIsValid.h @@ -1,5 +1,5 @@ /*! -\ingroup PkgPolygonPartitioning2FunctionObjectConcepts +\ingroup PkgPartition2FunctionObjectConcepts \cgalConcept Function object that determines if a sequence of points represents a diff --git a/Partition_2/doc/Partition_2/Concepts/YMonotonePartitionIsValidTraits_2.h b/Partition_2/doc/Partition_2/Concepts/YMonotonePartitionIsValidTraits_2.h index bd81dee898f..779f7a0d3be 100644 --- a/Partition_2/doc/Partition_2/Concepts/YMonotonePartitionIsValidTraits_2.h +++ b/Partition_2/doc/Partition_2/Concepts/YMonotonePartitionIsValidTraits_2.h @@ -1,5 +1,5 @@ /*! -\ingroup PkgPolygonPartitioning2Concepts +\ingroup PkgPartition2Concepts \cgalConcept Requirements of a traits class that is used diff --git a/Partition_2/doc/Partition_2/Concepts/YMonotonePartitionTraits_2.h b/Partition_2/doc/Partition_2/Concepts/YMonotonePartitionTraits_2.h index 80adf1be07f..cc4fb20a81c 100644 --- a/Partition_2/doc/Partition_2/Concepts/YMonotonePartitionTraits_2.h +++ b/Partition_2/doc/Partition_2/Concepts/YMonotonePartitionTraits_2.h @@ -1,5 +1,5 @@ /*! -\ingroup PkgPolygonPartitioning2Concepts +\ingroup PkgPartition2Concepts \cgalConcept Requirements of a traits class to be diff --git a/Partition_2/doc/Partition_2/PackageDescription.txt b/Partition_2/doc/Partition_2/PackageDescription.txt index aa18a804b3f..f2a090985c9 100644 --- a/Partition_2/doc/Partition_2/PackageDescription.txt +++ b/Partition_2/doc/Partition_2/PackageDescription.txt @@ -1,19 +1,19 @@ -/// \defgroup PkgPolygonPartitioning2 2D Polygon Partitioning Reference -/// \defgroup PkgPolygonPartitioning2Concepts Concepts -/// \ingroup PkgPolygonPartitioning2 -/// \defgroup PkgPolygonPartitioning2FunctionObjectConcepts Function Object Concepts -/// \ingroup PkgPolygonPartitioning2 -/// \defgroup PkgPolygonPartitioning2FunctionObjectClasses Function Object Classes -/// \ingroup PkgPolygonPartitioning2 +/// \defgroup PkgPartition2Ref 2D Polygon Partitioning Reference +/// \defgroup PkgPartition2Concepts Concepts +/// \ingroup PkgPartition2Ref +/// \defgroup PkgPartition2FunctionObjectConcepts Function Object Concepts +/// \ingroup PkgPartition2Ref +/// \defgroup PkgPartition2FunctionObjectClasses Function Object Classes +/// \ingroup PkgPartition2Ref /*! -\addtogroup PkgPolygonPartitioning2 +\addtogroup PkgPartition2Ref \todo check generated documentation -\cgalPkgDescriptionBegin{2D Polygon Partitioning,PkgPolygonPartitioning2Summary} +\cgalPkgDescriptionBegin{2D Polygon Partitioning,PkgPartition2} \cgalPkgPicture{Partition_2/fig/Partition_2-teaser-small.png} \cgalPkgSummaryBegin \cgalPkgAuthor{Susan Hert} \cgalPkgDesc{This package provides functions for partitioning polygons in monotone or convex polygons. The algorithms can produce results with the minimal number of polygons, as well as approximations which have no more than four times the optimal number of convex pieces but they differ in their runtime complexities.} -\cgalPkgManuals{Chapter_2D_Polygon_Partitioning,PkgPolygonPartitioning2} +\cgalPkgManuals{Chapter_2D_Polygon_Partitioning,PkgPartition2Ref} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{2.3} diff --git a/Partition_2/examples/Partition_2/CMakeLists.txt b/Partition_2/examples/Partition_2/CMakeLists.txt index 67e965a1c1c..aafa87d0e5b 100644 --- a/Partition_2/examples/Partition_2/CMakeLists.txt +++ b/Partition_2/examples/Partition_2/CMakeLists.txt @@ -4,18 +4,12 @@ project( Partition_2_Examples ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Partition_2/test/Partition_2/CMakeLists.txt b/Partition_2/test/Partition_2/CMakeLists.txt index 3c0a08ca96a..915bee9792f 100644 --- a/Partition_2/test/Partition_2/CMakeLists.txt +++ b/Partition_2/test/Partition_2/CMakeLists.txt @@ -4,18 +4,12 @@ project( Partition_2_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Periodic_2_triangulation_2/doc/Periodic_2_triangulation_2/Concepts/Periodic_2TriangulationTraits_2.h b/Periodic_2_triangulation_2/doc/Periodic_2_triangulation_2/Concepts/Periodic_2TriangulationTraits_2.h index 20d5c2a68ec..781ffd7b85d 100644 --- a/Periodic_2_triangulation_2/doc/Periodic_2_triangulation_2/Concepts/Periodic_2TriangulationTraits_2.h +++ b/Periodic_2_triangulation_2/doc/Periodic_2_triangulation_2/Concepts/Periodic_2TriangulationTraits_2.h @@ -11,7 +11,7 @@ the geometric primitives used in the triangulation and some function object types for the required predicates on those primitives. It refines the concept -`TriangulationTraits_2` from the \cgal \ref PkgTriangulation2 package. It redefines the +`TriangulationTraits_2` from the \cgal \ref PkgTriangulation2Ref package. It redefines the geometric objects, predicates and constructions to work with point-offset pairs. In most cases the offsets will be (0,0) and the predicates from `TriangulationTraits_2` can be used diff --git a/Periodic_2_triangulation_2/doc/Periodic_2_triangulation_2/PackageDescription.txt b/Periodic_2_triangulation_2/doc/Periodic_2_triangulation_2/PackageDescription.txt index a1e8dcd7e66..bfdd048ef36 100644 --- a/Periodic_2_triangulation_2/doc/Periodic_2_triangulation_2/PackageDescription.txt +++ b/Periodic_2_triangulation_2/doc/Periodic_2_triangulation_2/PackageDescription.txt @@ -1,35 +1,35 @@ -/// \defgroup PkgPeriodic2Triangulation2 2D Periodic Triangulations Reference +/// \defgroup PkgPeriodic2Triangulation2Ref 2D Periodic Triangulations Reference /// \defgroup PkgPeriodic2Triangulation2Concepts Concepts -/// \ingroup PkgPeriodic2Triangulation2 +/// \ingroup PkgPeriodic2Triangulation2Ref /// \defgroup PkgPeriodic2Triangulation2MainClasses Main Classes -/// \ingroup PkgPeriodic2Triangulation2 +/// \ingroup PkgPeriodic2Triangulation2Ref /// \defgroup PkgPeriodic2Triangulation2TraitsClasses Traits Classes -/// \ingroup PkgPeriodic2Triangulation2 +/// \ingroup PkgPeriodic2Triangulation2Ref /// \defgroup PkgPeriodic2Triangulation2VertexFaceClasses Vertex and Face Classes -/// \ingroup PkgPeriodic2Triangulation2 +/// \ingroup PkgPeriodic2Triangulation2Ref /// \defgroup PkgPeriodic2Triangulation2Enums Enums -/// \ingroup PkgPeriodic2Triangulation2 +/// \ingroup PkgPeriodic2Triangulation2Ref /*! -\addtogroup PkgPeriodic2Triangulation2 +\addtogroup PkgPeriodic2Triangulation2Ref -\cgalPkgDescriptionBegin{2D Periodic Triangulations,PkgPeriodic2Triangulation2Summary} +\cgalPkgDescriptionBegin{2D Periodic Triangulations,PkgPeriodic2Triangulation2} \cgalPkgPicture{Periodic_2_triangulation_2/fig/p2Delaunay2_thumb.png} \cgalPkgSummaryBegin \cgalPkgAuthor{Nico Kruithof} \cgalPkgDesc{This package allows to build and handle triangulations of point sets in the two dimensional flat torus. Triangulations are built incrementally and can be modified by insertion or removal of vertices. They offer point location facilities. The package provides Delaunay triangulations and offers nearest neighbor queries and primitives to build the dual Voronoi diagrams.} -\cgalPkgManuals{Chapter_2D_Periodic_Triangulations,PkgPeriodic2Triangulation2} +\cgalPkgManuals{Chapter_2D_Periodic_Triangulations,PkgPeriodic2Triangulation2Ref} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{4.3} -\cgalPkgDependsOn{\ref PkgTriangulation2Summary} +\cgalPkgDependsOn{\ref PkgTriangulation2} \cgalPkgBib{cgal:k-pt2-13} \cgalPkgLicense{\ref licensesGPL "GPL"} \cgalPkgDemo{Periodic Delaunay Triangulation,Periodic_2_Delaunay_triangulation_2.zip} diff --git a/Periodic_2_triangulation_2/examples/Periodic_2_triangulation_2/CMakeLists.txt b/Periodic_2_triangulation_2/examples/Periodic_2_triangulation_2/CMakeLists.txt index fef2d14441a..2f9d63ad422 100644 --- a/Periodic_2_triangulation_2/examples/Periodic_2_triangulation_2/CMakeLists.txt +++ b/Periodic_2_triangulation_2/examples/Periodic_2_triangulation_2/CMakeLists.txt @@ -4,18 +4,12 @@ project( Periodic_2_triangulation_2_Examples ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Periodic_2_triangulation_2/test/Periodic_2_triangulation_2/CMakeLists.txt b/Periodic_2_triangulation_2/test/Periodic_2_triangulation_2/CMakeLists.txt index f7baf2d32ae..3c8e59f8f34 100644 --- a/Periodic_2_triangulation_2/test/Periodic_2_triangulation_2/CMakeLists.txt +++ b/Periodic_2_triangulation_2/test/Periodic_2_triangulation_2/CMakeLists.txt @@ -4,19 +4,13 @@ project( Periodic_2_triangulation_2_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - include_directories (BEFORE "../../include") - - include_directories (BEFORE "include") + include_directories (BEFORE "include") # create a target per cppfile file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) diff --git a/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/CGAL/Implicit_to_labeled_subdomains_function_wrapper.h b/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/CGAL/Implicit_to_labeled_subdomains_function_wrapper.h index 691fbfa9e93..a5062549d69 100644 --- a/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/CGAL/Implicit_to_labeled_subdomains_function_wrapper.h +++ b/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/CGAL/Implicit_to_labeled_subdomains_function_wrapper.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgPeriodic_3_mesh_3Domains +\ingroup PkgPeriodic3Mesh3Domains The class `Implicit_to_labeled_subdomains_function_wrapper` is a helper class designed to wrap an implicit function which describes a domain by diff --git a/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/CGAL/Periodic_3_function_wrapper.h b/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/CGAL/Periodic_3_function_wrapper.h index bd70868f339..fba61fc6749 100644 --- a/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/CGAL/Periodic_3_function_wrapper.h +++ b/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/CGAL/Periodic_3_function_wrapper.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgPeriodic_3_mesh_3Domains +\ingroup PkgPeriodic3Mesh3Domains The class `Periodic_3_function_wrapper` is a helper class designed to wrap an (a priori non-periodic) implicit function describing a domain through the relationship diff --git a/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/CGAL/Periodic_3_mesh_3/IO/File_medit.h b/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/CGAL/Periodic_3_mesh_3/IO/File_medit.h index dcd2c767721..e252de45571 100644 --- a/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/CGAL/Periodic_3_mesh_3/IO/File_medit.h +++ b/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/CGAL/Periodic_3_mesh_3/IO/File_medit.h @@ -1,6 +1,6 @@ namespace CGAL { -/// \ingroup PkgPeriodic_3_mesh_3IOFunctions +/// \ingroup PkgPeriodic3Mesh3IOFunctions /// /// \brief Outputs a periodic mesh to the medit (`.mesh`) file format. /// See \cgalCite{frey:inria-00069921} for a comprehensive description of this file format. diff --git a/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/CGAL/Periodic_3_mesh_triangulation_3.h b/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/CGAL/Periodic_3_mesh_triangulation_3.h index ffb975e1719..9587ffca702 100644 --- a/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/CGAL/Periodic_3_mesh_triangulation_3.h +++ b/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/CGAL/Periodic_3_mesh_triangulation_3.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgPeriodic_3_mesh_3MeshClasses +\ingroup PkgPeriodic3Mesh3MeshClasses The class `Periodic_3_mesh_triangulation_3` is a class template which provides the triangulation type to be used for the 3D periodic triangulation embedding the mesh. diff --git a/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/CGAL/make_periodic_3_mesh_3.h b/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/CGAL/make_periodic_3_mesh_3.h index 2c524429a92..d6e097fc9e6 100644 --- a/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/CGAL/make_periodic_3_mesh_3.h +++ b/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/CGAL/make_periodic_3_mesh_3.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgPeriodic_3_mesh_3Functions +\ingroup PkgPeriodic3Mesh3Functions The function `make_periodic_3_mesh_3()` is a 3D periodic mesh generator. It produces simplicial meshes which discretize 3D periodic domains. diff --git a/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/CGAL/optimize_periodic_3_mesh_3.h b/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/CGAL/optimize_periodic_3_mesh_3.h index 9562583d471..af1e2224ca8 100644 --- a/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/CGAL/optimize_periodic_3_mesh_3.h +++ b/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/CGAL/optimize_periodic_3_mesh_3.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgPeriodic_3_mesh_3Functions +\ingroup PkgPeriodic3Mesh3Functions The function `lloyd_optimize_periodic_3_mesh_3()` is a periodic mesh optimization process based on the minimization of a global energy function. @@ -23,7 +23,7 @@ lloyd_optimize_periodic_3_mesh_3(C3T3& c3t3, /*! -\ingroup PkgPeriodic_3_mesh_3Functions +\ingroup PkgPeriodic3Mesh3Functions The function `odt_optimize_periodic_3_mesh_3()` is a periodic mesh optimization process based on the minimization of a global energy function. @@ -42,7 +42,7 @@ odt_optimize_periodic_3_mesh_3(C3T3& c3t3, bool parameters::do_freeze=true); /*! -\ingroup PkgPeriodic_3_mesh_3Functions +\ingroup PkgPeriodic3Mesh3Functions The function `perturb_periodic_3_mesh_3()` is a mesh optimizer that improves the quality of a Delaunay mesh by changing the positions of some vertices of the mesh. @@ -58,7 +58,7 @@ perturb_periodic_3_mesh_3(C3T3& c3t3, double parameters::sliver_bound=0); /*! -\ingroup PkgPeriodic_3_mesh_3Functions +\ingroup PkgPeriodic3Mesh3Functions The function `exude_periodic_3_mesh_3()` performs a sliver exudation process on a periodic Delaunay mesh. diff --git a/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/CGAL/refine_periodic_3_mesh_3.h b/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/CGAL/refine_periodic_3_mesh_3.h index 87214665c29..ea2d35cc1bf 100644 --- a/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/CGAL/refine_periodic_3_mesh_3.h +++ b/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/CGAL/refine_periodic_3_mesh_3.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgPeriodic_3_mesh_3Functions +\ingroup PkgPeriodic3Mesh3Functions The function `refine_periodic_3_mesh_3()` is a 3D periodic mesh generator. It produces periodic simplicial meshes which discretize diff --git a/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/Concepts/Periodic_3MeshDomainWithFeatures_3.h b/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/Concepts/Periodic_3MeshDomainWithFeatures_3.h index 349a1affc29..ff1d013160a 100644 --- a/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/Concepts/Periodic_3MeshDomainWithFeatures_3.h +++ b/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/Concepts/Periodic_3MeshDomainWithFeatures_3.h @@ -1,5 +1,5 @@ /*! -\ingroup PkgPeriodic_3_mesh_3Concepts +\ingroup PkgPeriodic3Mesh3Concepts \cgalConcept \cgalRefines `MeshDomainWithFeatures_3` and `Periodic_3MeshDomain_3` diff --git a/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/Concepts/Periodic_3MeshDomain_3.h b/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/Concepts/Periodic_3MeshDomain_3.h index 79a06b57837..ec9ee6390df 100644 --- a/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/Concepts/Periodic_3MeshDomain_3.h +++ b/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/Concepts/Periodic_3MeshDomain_3.h @@ -1,5 +1,5 @@ /*! -\ingroup PkgPeriodic_3_mesh_3Concepts +\ingroup PkgPeriodic3Mesh3Concepts \cgalConcept \cgalRefines `MeshDomain_3` diff --git a/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/PackageDescription.txt b/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/PackageDescription.txt index bdeb479abca..a528c15071a 100644 --- a/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/PackageDescription.txt +++ b/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/PackageDescription.txt @@ -1,42 +1,42 @@ -/// \defgroup PkgPeriodic_3_mesh_3 3D Periodic Mesh Generation Reference +/// \defgroup PkgPeriodic3Mesh3Ref 3D Periodic Mesh Generation Reference -/// \defgroup PkgPeriodic_3_mesh_3Concepts Concepts -/// \ingroup PkgPeriodic_3_mesh_3 +/// \defgroup PkgPeriodic3Mesh3Concepts Concepts +/// \ingroup PkgPeriodic3Mesh3Ref /// The concepts of this package. -/// \defgroup PkgPeriodic_3_mesh_3MeshClasses Mesh Classes -/// \ingroup PkgPeriodic_3_mesh_3 +/// \defgroup PkgPeriodic3Mesh3MeshClasses Mesh Classes +/// \ingroup PkgPeriodic3Mesh3Ref /// The classes in this group are the main classes involved in the mesh generation process. -/// \defgroup PkgPeriodic_3_mesh_3Domains Domain Classes -/// \ingroup PkgPeriodic_3_mesh_3 +/// \defgroup PkgPeriodic3Mesh3Domains Domain Classes +/// \ingroup PkgPeriodic3Mesh3Ref /// The classes in this group are models of domain concepts and their associated classes. -/// \defgroup PkgPeriodic_3_mesh_3Functions Mesh Generation Functions -/// \ingroup PkgPeriodic_3_mesh_3 +/// \defgroup PkgPeriodic3Mesh3Functions Mesh Generation Functions +/// \ingroup PkgPeriodic3Mesh3Ref /// The two main functions to generate a periodic mesh are `make_periodic_3_mesh_3()` /// and `refine_periodic_3_mesh_3()`. Other functions are provided to optimize /// an existing periodic mesh. -/// \defgroup PkgPeriodic_3_mesh_3IOFunctions Input/Output Functions -/// \ingroup PkgPeriodic_3_mesh_3 +/// \defgroup PkgPeriodic3Mesh3IOFunctions Input/Output Functions +/// \ingroup PkgPeriodic3Mesh3Ref /// The free functions that can be used to read and write periodic meshes. /*! -\addtogroup PkgPeriodic_3_mesh_3 -\cgalPkgDescriptionBegin{3D Periodic Mesh Generation,PkgPeriodic_3_mesh_3Summary} +\addtogroup PkgPeriodic3Mesh3Ref +\cgalPkgDescriptionBegin{3D Periodic Mesh Generation,PkgPeriodic3Mesh3} \cgalPkgPicture{periodic_mesher_small.png} \cgalPkgSummaryBegin \cgalPkgAuthors{Mikhail Bogdanov, Aymeric Pellé, Mael Rouxel-Labbé, and Monique Teillaud} \cgalPkgDesc{This package is devoted to the generation of isotropic simplicial meshes discretizing periodic 3D domains. The domain to be meshed is a region of the three-dimensional flat torus. The periodic mesh generator provides users with the same -flexibility that is offered in the \ref PkgMesh_3Summary package.} -\cgalPkgManuals{Chapter_3D_Periodic_Mesh_Generation,PkgPeriodic_3_mesh_3} +flexibility that is offered in the \ref PkgMesh3 package.} +\cgalPkgManuals{Chapter_3D_Periodic_Mesh_Generation,PkgPeriodic3Mesh3Ref} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{4.13} -\cgalPkgDependsOn{\ref PkgPeriodic3Triangulation3Summary, \ref PkgMesh_3Summary, and \ref thirdpartyEigen} +\cgalPkgDependsOn{\ref PkgPeriodic3Triangulation3, \ref PkgMesh3, and \ref thirdpartyEigen} \cgalPkgBib{cgal:btprl-p3m3} \cgalPkgLicense{\ref licensesGPL "GPL"} \cgalPkgShortInfoEnd @@ -49,24 +49,24 @@ manipulating duplicate points, well-chosen "dummy" points are inserted at the beginning of the meshing process, thus ensuring that the underlying periodic triangulation forms at all times a simplicial complex within a single copy of the periodic space \f$ \mathbb T_c^3\f$ (see Sections \ref P3Triangulation3secspace and \ref P3Triangulation3secintro -of the package \ref PkgPeriodic3Triangulation3Summary). +of the package \ref PkgPeriodic3Triangulation3). By identifying a single copy of the flat torus \f$ \mathbb T_c^3\f$ (where `c` denotes the period) with a cube of side `c` in \f$ \mathbb R^3\f$, the meshing process can be exclusively conducted within a cube of side `c`. -The mesh within a single copy is created using %CGAL's \ref PkgMesh_3Summary package, but -because %CGAL's \ref PkgMesh_3Summary package aims to mesh traditional (non-periodic) -domains, an interface is necessary between %CGAL's \ref PkgMesh_3Summary package -and %CGAL's \ref PkgPeriodic3Triangulation3Summary. +The mesh within a single copy is created using %CGAL's \ref PkgMesh3 package, but +because %CGAL's \ref PkgMesh3 package aims to mesh traditional (non-periodic) +domains, an interface is necessary between %CGAL's \ref PkgMesh3 package +and %CGAL's \ref PkgPeriodic3Triangulation3. This package offers these interfaces. \cgalClassifedRefPages ## Concepts ## -This package relies entirely on the \ref PkgMesh_3Concepts -and the \ref PkgMesh_3SecondaryConcepts described in the \ref PkgMesh_3Summary package. +This package relies entirely on the \ref PkgMesh3Concepts +and the \ref PkgMesh3SecondaryConcepts described in the \ref PkgMesh3 package. The following concepts are essentially identical to the concepts `MeshDomain_3` -and `MeshDomainWithFeatures_3` in the package \ref PkgMesh_3Summary : +and `MeshDomainWithFeatures_3` in the package \ref PkgMesh3 : - `Periodic_3MeshDomain_3` - `Periodic_3MeshDomainWithFeatures_3` @@ -97,10 +97,10 @@ The following functions handle the generation of a periodic mesh: ## Classes and Functions of `Mesh_3` ## Many classes and functions used by this package are defined within the package -\ref PkgMesh_3Summary, see \ref PkgMesh_3MeshClasses, \ref PkgMesh_3Domains, -and \ref PkgMesh_3Parameters. +\ref PkgMesh3, see \ref PkgMesh3MeshClasses, \ref PkgMesh3Domains, +and \ref PkgMesh3Parameters. ## Input/Output Functions ## -- \link PkgPeriodic_3_mesh_3IOFunctions `CGAL::output_periodic_mesh_to_medit()` \endlink +- \link PkgPeriodic3Mesh3IOFunctions `CGAL::output_periodic_mesh_to_medit()` \endlink */ diff --git a/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/Periodic_3_mesh_3.txt b/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/Periodic_3_mesh_3.txt index a571d3dfd36..a2f6e580de4 100644 --- a/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/Periodic_3_mesh_3.txt +++ b/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/Periodic_3_mesh_3.txt @@ -20,7 +20,7 @@ A cut view of a periodic mesh. This package is devoted to the generation of isotropic simplicial meshes discretizing periodic 3D domains. The domain to be meshed is a subset of the three-dimensional flat torus -(see Section \ref P3Triangulation3secspace of the package \ref PkgPeriodic3Triangulation3Summary). +(see Section \ref P3Triangulation3secspace of the package \ref PkgPeriodic3Triangulation3). The domain may be connected or composed of multiple components and/or subdivided in several subdomains. The current implementation provides classes to represent @@ -60,24 +60,24 @@ by a mesh optimization phase to remove slivers and provide a good quality mesh. \subsection Periodic_3_mesh_3Mesh_3 Relation to the 3D Mesh Generation and 3D Periodic Triangulations Packages -This package is fundamentally linked to the package \ref PkgMesh_3Summary, +This package is fundamentally linked to the package \ref PkgMesh3, which is devoted to the generation of isotropic simplicial -meshes discretizing (non-periodic) 3D domains and to the \ref PkgPeriodic3Triangulation3Summary of %CGAL, +meshes discretizing (non-periodic) 3D domains and to the \ref PkgPeriodic3Triangulation3 of %CGAL, which are used as underlying triangulation structures of the mesh. A periodic mesh extends, by definition, infinitely in space. We consider the flat torus \f$ \mathbb T_c^3\f$, whose canonical cube has side length `c` (this canonical cube is named original domain -in Chapter \ref PkgPeriodic3Triangulation3Summary; we rename it here to avoid the confusion -with the domain defined in Chapter \ref PkgMesh_3Summary). Well-chosen "dummy" points +in Chapter \ref PkgPeriodic3Triangulation3; we rename it here to avoid the confusion +with the domain defined in Chapter \ref PkgMesh3). Well-chosen "dummy" points are inserted at the beginning of the meshing process, ensuring that the projection of the periodic triangulation into the flat torus \f$ \mathbb T_c^3\f$ forms at all times a simplicial complex (see Sections \ref P3Triangulation3secspace and \ref P3Triangulation3secintro of the manual of 3D periodic triangulations). Thanks to this construction, the meshing process can be exclusively conducted within the canonical cube. -The mesh can then be created using the \ref PkgMesh_3Summary package of %CGAL. +The mesh can then be created using the \ref PkgMesh3 package of %CGAL. As this package originally aims to mesh non-periodic domains of \f$ \mathbb R^3\f$, an interface -is necessary between the packages \ref PkgMesh_3Summary and \ref PkgPeriodic3Triangulation3Summary. +is necessary between the packages \ref PkgMesh3 and \ref PkgPeriodic3Triangulation3. This package provides this interface. \subsection Periodic_3_mesh_3InputDomain Input Domain @@ -227,7 +227,7 @@ and to guarantee that the refinement process terminates whatever may be the dihedral angles formed by input surface patches incident to a given 1-feature or the angles formed by two 1-features incident to a 0-feature. See Section \ref Mesh_3Protectionof0and1dimensionalExposed in the documentation -of the package \ref PkgMesh_3Summary for further information. +of the package \ref PkgMesh3 for further information. Section \ref Periodic_3_mesh_3MeshingDomainswithSharpFeatures details how to prescribe sharp features and examples of periodic meshes with features. @@ -236,7 +236,7 @@ to prescribe sharp features and examples of periodic meshes with features. The optimization phase is a succession of optimization processes which aim to improve the quality of the mesh in terms of shape of its elements. -All the optimizers offered by the package \ref PkgMesh_3Summary are also available +All the optimizers offered by the package \ref PkgMesh3 are also available for periodic mesh generation: - The Lloyd and ODT-smoother are global optimizers, moving the mesh vertices @@ -245,7 +245,7 @@ to minimize a mesh energy. the worst mesh elements. See Sections \ref Mesh_3OptimizationPhase, \ref Mesh_3TheOptimizationParameters, -and \ref Mesh_3TuningMeshOptimization in the documentation of the package \ref PkgMesh_3Summary +and \ref Mesh_3TuningMeshOptimization in the documentation of the package \ref PkgMesh3 for further information. \section Periodic_3_mesh_3_section_interface Interface @@ -416,7 +416,7 @@ This section presents various use cases of the periodic mesh generator. \subsection Periodic_3_mesh_3SubMultipleCopies Visualizing Multiple Copies of a Periodic Mesh Generated meshes can be output to the `.mesh` file format, which can be visualized with the demo -of the package \ref PkgPolyhedronSummary. The function \link PkgPeriodic_3_mesh_3IOFunctions `CGAL::output_periodic_mesh_to_medit()` \endlink +of the package \ref PkgPolyhedron. The function \link PkgPeriodic3Mesh3IOFunctions `CGAL::output_periodic_mesh_to_medit()` \endlink takes a stream, a mesh complex, and - optionally - the number of periodic copies that should be drawn, making it easier to observe the periodicity of the result. \cgalFigureRef{Periodic_3_mesh_3Periodic_copies} illustrates the different output @@ -674,16 +674,16 @@ A periodic mesh without (left) and with (right) sharp features protection. Advanced use cases of the 3D mesh generator with implicit domains, its optimizers, and protection mechanisms can be found in Section \ref Mesh_3_section_examples -of the package \ref PkgMesh_3Summary. +of the package \ref PkgMesh3. \section Periodic_3_mesh_3DesignAndImpl Design and Implementation History \subsection Periodic_3_mesh_3TheoreticalFoundations Theoretical Foundations Theoretical foundations of periodic meshes are explained in detail in the package -\ref PkgPeriodic3Triangulation3Summary. +\ref PkgPeriodic3Triangulation3. For the theoretical foundations of the mesh generation process, see Section -\ref Mesh_3TheoreticalFoundations of the package \ref PkgMesh_3Summary. +\ref Mesh_3TheoreticalFoundations of the package \ref PkgMesh3. \subsection Periodic_3_mesh_3ImplementationHistory Implementation History 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 8049fb9a7a1..ef572651d9f 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 @@ -3,7 +3,7 @@ project( Periodic_3_mesh_3_Examples ) -cmake_minimum_required( VERSION 2.8.11 ) +cmake_minimum_required(VERSION 3.1) # CGAL and its components find_package( CGAL QUIET ) @@ -13,11 +13,7 @@ if ( NOT CGAL_FOUND ) return() endif() -# include helper file -include( ${CGAL_USE_FILE} ) - # include for local package -include_directories( BEFORE ../../include ) # Use Eigen find_package(Eigen3 3.1.0 REQUIRED) #(3.1.0 or greater) @@ -39,8 +35,6 @@ endif() # Creating entries for all C++ files with "main" routine # ########################################################## -include( CGAL_CreateSingleSourceCGALProgram ) - 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 bb7f4203a11..7097e37e4fe 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 @@ -3,16 +3,12 @@ project( Periodic_3_mesh_3_Tests ) -cmake_minimum_required( VERSION 2.8.11 ) +cmake_minimum_required(VERSION 3.1) find_package( CGAL QUIET ) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include_directories( BEFORE ../../include ) - # Use Eigen find_package(Eigen3 3.1.0 REQUIRED) #(3.1.0 or greater) if (NOT EIGEN3_FOUND) @@ -22,7 +18,6 @@ if ( CGAL_FOUND ) include( ${EIGEN3_USE_FILE} ) endif() - include( CGAL_CreateSingleSourceCGALProgram ) create_single_source_cgal_program( "test_implicit_shapes_bunch.cpp" ) create_single_source_cgal_program( "test_implicit_shapes_with_features.cpp" ) create_single_source_cgal_program( "test_triply_periodic_minimal_surfaces.cpp" ) 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 ed5aad38c95..78cf24b1e25 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 @@ -12,7 +12,6 @@ endif() # Find CGAL find_package(CGAL COMPONENTS Qt5) -include( ${CGAL_USE_FILE} ) # Find Qt5 itself find_package(Qt5 QUIET COMPONENTS Xml OpenGL Help Core) @@ -20,6 +19,7 @@ find_package(Qt5 QUIET COMPONENTS Xml OpenGL Help Core) if(Qt5_FOUND) add_definitions(-DQT_NO_KEYWORDS) + set(CMAKE_INCLUDE_CURRENT_DIR ON) endif(Qt5_FOUND) if (CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND TARGET Qt5::qcollectiongenerator) @@ -51,7 +51,6 @@ if (CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND TARGET Qt5::qcollectiongener # Make sure the compiler can find generated .moc files include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) include_directories( ${QT_INCLUDE_DIR} ) - include_directories( ../../include .) # The executable itself add_executable ( periodic_3_triangulation_3_demo 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 d711a8dd6c7..ffd9b3d7e2e 100644 --- a/Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/CMakeLists.txt +++ b/Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/CMakeLists.txt @@ -18,15 +18,13 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) find_package(CGAL COMPONENTS Qt5) -include(${CGAL_USE_FILE}) - find_package(Qt5 QUIET COMPONENTS Xml Script Help OpenGL Svg) if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND TARGET Qt5::qcollectiongenerator ) - include_directories (BEFORE ../../include ./ ) + include_directories (BEFORE ./ ) # ui file, created wih Qt Designer qt5_wrap_ui( uis MainWindow.ui ) diff --git a/Periodic_3_triangulation_3/doc/Periodic_3_triangulation_3/PackageDescription.txt b/Periodic_3_triangulation_3/doc/Periodic_3_triangulation_3/PackageDescription.txt index 10ba236de93..74b8122babb 100644 --- a/Periodic_3_triangulation_3/doc/Periodic_3_triangulation_3/PackageDescription.txt +++ b/Periodic_3_triangulation_3/doc/Periodic_3_triangulation_3/PackageDescription.txt @@ -1,18 +1,18 @@ -/// \defgroup PkgPeriodic3Triangulation3 3D Periodic Triangulations Reference +/// \defgroup PkgPeriodic3Triangulation3Ref 3D Periodic Triangulations Reference /// \defgroup PkgPeriodic3Triangulation3Concepts Concepts -/// \ingroup PkgPeriodic3Triangulation3 +/// \ingroup PkgPeriodic3Triangulation3Ref /// \defgroup PkgPeriodic3Triangulation3MainClasses Main Classes -/// \ingroup PkgPeriodic3Triangulation3 +/// \ingroup PkgPeriodic3Triangulation3Ref /// \defgroup PkgPeriodic3Triangulation3TraitsClasses Traits Classes -/// \ingroup PkgPeriodic3Triangulation3 +/// \ingroup PkgPeriodic3Triangulation3Ref /*! -\addtogroup PkgPeriodic3Triangulation3 +\addtogroup PkgPeriodic3Triangulation3Ref -\cgalPkgDescriptionBegin{3D Periodic Triangulations,PkgPeriodic3Triangulation3Summary} +\cgalPkgDescriptionBegin{3D Periodic Triangulations,PkgPeriodic3Triangulation3} \cgalPkgPicture{p3Delaunay3_small.jpg} \cgalPkgSummaryBegin \cgalPkgAuthors{Manuel Caroli, Aymeric Pellé, Mael Rouxel-Labbé, and Monique Teillaud} @@ -21,11 +21,11 @@ in the three dimensional flat torus. Triangulations are built incrementally and can be modified by insertion or removal of vertices. They offer point location facilities. The package provides Delaunay and regular triangulations and offers nearest neighbor queries and primitives to build the dual Voronoi diagrams.} -\cgalPkgManuals{Chapter_3D_Periodic_Triangulations,PkgPeriodic3Triangulation3} +\cgalPkgManuals{Chapter_3D_Periodic_Triangulations,PkgPeriodic3Triangulation3Ref} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{3.5} -\cgalPkgDependsOn{\ref PkgTDS3Summary} +\cgalPkgDependsOn{\ref PkgTDS3} \cgalPkgBib{cgal:ct-pt3} \cgalPkgLicense{\ref licensesGPL "GPL"} \cgalPkgDemo{3D Periodic Delaunay Triangulation,periodic_3_triangulation_3.zip,3D Periodic Lloyd,periodic_3_lloyd.zip} diff --git a/Periodic_3_triangulation_3/examples/Periodic_3_triangulation_3/CMakeLists.txt b/Periodic_3_triangulation_3/examples/Periodic_3_triangulation_3/CMakeLists.txt index da8a29ac953..2a5ab412405 100644 --- a/Periodic_3_triangulation_3/examples/Periodic_3_triangulation_3/CMakeLists.txt +++ b/Periodic_3_triangulation_3/examples/Periodic_3_triangulation_3/CMakeLists.txt @@ -4,18 +4,12 @@ project( Periodic_3_triangulation_3_Examples ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_Delaunay_triangulation_3.h b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_Delaunay_triangulation_3.h index 42c1ab0267c..a9a82d642b1 100644 --- a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_Delaunay_triangulation_3.h +++ b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_Delaunay_triangulation_3.h @@ -503,21 +503,27 @@ public: is_large_point_set = false; std::vector points(first, last); - CGAL::cpp98::random_shuffle (points.begin(), points.end()); - Cell_handle hint; std::vector dummy_points, double_vertices; typename std::vector::iterator pbegin = points.begin(); if(is_large_point_set) + { dummy_points = insert_dummy_points(); - else while(!is_1_cover()) { - insert(*pbegin); - ++pbegin; - if(pbegin == points.end()) - return number_of_vertices() - n; + } else { + CGAL::cpp98::random_shuffle(points.begin(), points.end()); + pbegin = points.begin(); + while(!is_1_cover()) { + insert(*pbegin); + ++pbegin; + if(pbegin == points.end()) + return number_of_vertices() - n; + } } + CGAL_postcondition(is_1_cover()); + spatial_sort (pbegin, points.end(), this->geom_traits()); + Cell_handle hint; Conflict_tester tester(*pbegin,this); Point_hider hider; Cover_manager cover_manager(*this); diff --git a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_regular_triangulation_3.h b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_regular_triangulation_3.h index e1f4cd07b7c..73f43e5c81d 100644 --- a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_regular_triangulation_3.h +++ b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_regular_triangulation_3.h @@ -479,8 +479,6 @@ public: is_large_point_set = false; std::vector points(first, last); - CGAL::cpp98::random_shuffle(points.begin(), points.end()); - Cell_handle hint; std::vector dummy_points_vhs, double_vertices; std::vector dummy_points; typename std::vector::iterator pbegin = points.begin(); @@ -493,6 +491,8 @@ public: } else { + CGAL::cpp98::random_shuffle(points.begin(), points.end()); + pbegin = points.begin(); while(!is_1_cover()) { insert(*pbegin); @@ -502,6 +502,8 @@ public: } } + CGAL_postcondition(is_1_cover()); + // Spatial sorting can only be applied to bare points, so we need an adaptor typedef typename Geom_traits::Construct_point_3 Construct_point_3; typedef typename boost::result_of::type Ret; @@ -513,6 +515,7 @@ public: CGAL::internal::boost_::make_function_property_map( geom_traits().construct_point_3_object()), geom_traits())); + Cell_handle hint; Conflict_tester tester(*pbegin, this); Point_hider hider(this); Cover_manager cover_manager(*this); diff --git a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3.h b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3.h index 1daf1183438..a44ef206fa9 100644 --- a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3.h +++ b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3.h @@ -2063,11 +2063,11 @@ inline void Periodic_3_triangulation_3:: make_canonical(Vertex_triple& t) const { - int i = (&*(t.first) < &*(t.second))? 0 : 1; + int i = (t.first < t.second) ? 0 : 1; if(i==0) { - i = (&*(t.first) < &*(t.third))? 0 : 2; + i = (t.first < t.third) ? 0 : 2; } else { - i = (&*(t.second) < &*(t.third))? 1 : 2; + i = (t.second < t.third) ? 1 : 2; } Vertex_handle tmp; switch(i) { diff --git a/Periodic_3_triangulation_3/test/Periodic_3_triangulation_3/CMakeLists.txt b/Periodic_3_triangulation_3/test/Periodic_3_triangulation_3/CMakeLists.txt index d6ad1237ec8..8c11ea11b00 100644 --- a/Periodic_3_triangulation_3/test/Periodic_3_triangulation_3/CMakeLists.txt +++ b/Periodic_3_triangulation_3/test/Periodic_3_triangulation_3/CMakeLists.txt @@ -4,19 +4,14 @@ project( Periodic_3_triangulation_3_Tests ) -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET COMPONENTS Core ) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - include_directories (BEFORE "../../include") - - include_directories (BEFORE "include") + include(${CGAL_USE_FILE}) + include_directories (BEFORE "include") create_single_source_cgal_program( "test_p3rt3_as_p3t3.cpp" ) create_single_source_cgal_program( "test_p3rt3_insert_remove_point_set.cpp" ) diff --git a/Point_set_2/doc/Point_set_2/CGAL/Point_set_2.h b/Point_set_2/doc/Point_set_2/CGAL/Point_set_2.h index 505d18591cd..6938484d48e 100644 --- a/Point_set_2/doc/Point_set_2/CGAL/Point_set_2.h +++ b/Point_set_2/doc/Point_set_2/CGAL/Point_set_2.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgPointSet2 +\ingroup PkgPointSet2Ref An instance `PS` of the data type `Point_set_2` is a Delaunay Triangulation of its vertex set. The class `Point_set_2` is inherited from the \cgal Delaunay triangulation, diff --git a/Point_set_2/doc/Point_set_2/PackageDescription.txt b/Point_set_2/doc/Point_set_2/PackageDescription.txt index c6a422cf1e9..9c3e34d682e 100644 --- a/Point_set_2/doc/Point_set_2/PackageDescription.txt +++ b/Point_set_2/doc/Point_set_2/PackageDescription.txt @@ -1,26 +1,26 @@ -/// \defgroup PkgPointSet2 2D Range and Neighbor Search Reference +/// \defgroup PkgPointSet2Ref 2D Range and Neighbor Search Reference /// \defgroup PkgPointSet2Concepts Concepts -/// \ingroup PkgPointSet2 +/// \ingroup PkgPointSet2Ref /// \defgroup PkgPointSet2RangeSearch Range Search -/// \ingroup PkgPointSet2 +/// \ingroup PkgPointSet2Ref /// \defgroup PkgPointSet2NeighborSearch Nearest Neighbor Search -/// \ingroup PkgPointSet2 +/// \ingroup PkgPointSet2Ref /*! -\addtogroup PkgPointSet2 +\addtogroup PkgPointSet2Ref \todo check generated documentation -\cgalPkgDescriptionBegin{2D Range and Neighbor Search,PkgPointSet2Summary} +\cgalPkgDescriptionBegin{2D Range and Neighbor Search,PkgPointSet2} \cgalPkgPicture{Point_set_2/fig/point_set.png} \cgalPkgSummaryBegin \cgalPkgAuthor{Matthias Bäsken} \cgalPkgDesc{This package supports circular, triangular, and isorectangular range search queries as well as (k) nearest neighbor search queries on 2D point sets. In contrast to the spatial searching package, this package uses a Delaunay triangulation as underlying data structure.} -\cgalPkgManuals{Chapter_2D_Range_and_Neighbor_Search,PkgPointSet2} +\cgalPkgManuals{Chapter_2D_Range_and_Neighbor_Search,PkgPointSet2Ref} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{2.1} -\cgalPkgDependsOn{\ref PkgTriangulation2Summary} +\cgalPkgDependsOn{\ref PkgTriangulation2} \cgalPkgBib{cgal:b-ss2} \cgalPkgLicense{\ref licensesGPL "GPL"} \cgalPkgShortInfoEnd diff --git a/Point_set_2/examples/Point_set_2/CMakeLists.txt b/Point_set_2/examples/Point_set_2/CMakeLists.txt index 08cb68781c7..5c0becc7051 100644 --- a/Point_set_2/examples/Point_set_2/CMakeLists.txt +++ b/Point_set_2/examples/Point_set_2/CMakeLists.txt @@ -4,18 +4,12 @@ project( Point_set_2_Examples ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Point_set_2/test/Point_set_2/CMakeLists.txt b/Point_set_2/test/Point_set_2/CMakeLists.txt index 4c04d6fad2e..603c5f5a225 100644 --- a/Point_set_2/test/Point_set_2/CMakeLists.txt +++ b/Point_set_2/test/Point_set_2/CMakeLists.txt @@ -4,18 +4,12 @@ project( Point_set_2_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Point_set_3/doc/Point_set_3/PackageDescription.txt b/Point_set_3/doc/Point_set_3/PackageDescription.txt index ba953ea5b1e..9353b29bc54 100644 --- a/Point_set_3/doc/Point_set_3/PackageDescription.txt +++ b/Point_set_3/doc/Point_set_3/PackageDescription.txt @@ -1,12 +1,12 @@ /*! -\defgroup PkgPointSet3 3D Point Set Reference +\defgroup PkgPointSet3Ref 3D Point Set Reference -\cgalPkgDescriptionBegin{3D Point Set, PkgPointSet3Summary} +\cgalPkgDescriptionBegin{3D Point Set, PkgPointSet3} \cgalPkgPicture{point_set_3.png} \cgalPkgSummaryBegin \cgalPkgAuthors{Simon Giraudot} \cgalPkgDesc{This component provides the user with a flexible 3D point set data structure. The user can define any additional property needed such as normal vectors, colors or labels. \cgal algorithms can be easily applied to this data structure.} -\cgalPkgManuals{Chapter_Point_Set_3, PkgPointSet3} +\cgalPkgManuals{Chapter_Point_Set_3, PkgPointSet3Ref} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{4.10} @@ -22,10 +22,10 @@ - `CGAL::Point_set_3` \defgroup PkgPointSet3IO Input/Output -\ingroup PkgPointSet3 +\ingroup PkgPointSet3Ref \brief This module offers convenience overloads of input/ouput -functions available in the \ref PkgPointSetProcessingSummary package. +functions available in the \ref PkgPointSetProcessing3 package. These overloads, available after including `CGAL/Point_set_3/IO.h`, allow the user to call point set processing algorithms without having to handle manually property maps and iterators. @@ -40,6 +40,6 @@ the `CGAL::Point_set_3` class with the name and type given by the PLY header or by the LAS standard. For a complete documentation of these functions, please refer to the -\ref PkgPointSetProcessing manual. +\ref PkgPointSetProcessing3Ref manual. */ diff --git a/Point_set_3/doc/Point_set_3/Point_set_3.txt b/Point_set_3/doc/Point_set_3/Point_set_3.txt index 60a5ba36a3b..30f5616795a 100644 --- a/Point_set_3/doc/Point_set_3/Point_set_3.txt +++ b/Point_set_3/doc/Point_set_3/Point_set_3.txt @@ -69,7 +69,7 @@ structure: the points and attributes are then accessed through ranges and property maps. The `CGAL::Point_set_3` class is a range that provides property maps: applying \cgal algorithms is straightforward. -As the \ref PkgPointSetProcessing "Point Set Processing" algorithms +As the \ref PkgPointSetProcessing3Ref "Point Set Processing" algorithms use \ref BGLNamedParameters to handle property maps, a method `CGAL::Point_set_3::parameters()` is provided: it returns a named parameter object with the right point and normal maps to read and diff --git a/Point_set_3/examples/Point_set_3/CMakeLists.txt b/Point_set_3/examples/Point_set_3/CMakeLists.txt index f80a868d040..008ba8e45fc 100644 --- a/Point_set_3/examples/Point_set_3/CMakeLists.txt +++ b/Point_set_3/examples/Point_set_3/CMakeLists.txt @@ -4,7 +4,7 @@ project( Point_set_3_Examples ) -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.1) # CGAL and its components find_package( CGAL QUIET COMPONENTS ) @@ -16,10 +16,6 @@ if ( NOT CGAL_FOUND ) endif() -# include helper file -include( ${CGAL_USE_FILE} ) - - # Boost and its components find_package( Boost REQUIRED ) @@ -35,14 +31,10 @@ endif() include_directories( BEFORE include ) # 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( "point_set.cpp" ) create_single_source_cgal_program( "point_set_property.cpp" ) create_single_source_cgal_program( "point_set_read_xyz.cpp" ) diff --git a/Point_set_3/include/CGAL/Point_set_3.h b/Point_set_3/include/CGAL/Point_set_3.h index 65b406f19c1..fa44d2404ee 100644 --- a/Point_set_3/include/CGAL/Point_set_3.h +++ b/Point_set_3/include/CGAL/Point_set_3.h @@ -41,7 +41,7 @@ namespace CGAL { /*! - \ingroup PkgPointSet3 + \ingroup PkgPointSet3Ref \brief A collection of points with dynamically associated properties. @@ -67,7 +67,7 @@ namespace CGAL { removed elements. A garbage collection method must be called to really remove it from memory. - For convenience, all functions of the package \ref PkgPointSetProcessing + For convenience, all functions of the package \ref PkgPointSetProcessing3Ref are provided with an overload that takes a Point_set_3 object as an argument. @@ -418,7 +418,9 @@ public: { -- m_nb_removed; iterator out = m_indices.end() - m_nb_removed - 1; + Index idx = *out; m_base.reset(*out); + *out = idx; return out; } } diff --git a/Point_set_3/test/Point_set_3/CMakeLists.txt b/Point_set_3/test/Point_set_3/CMakeLists.txt index 71739f186d8..31df0bdf038 100644 --- a/Point_set_3/test/Point_set_3/CMakeLists.txt +++ b/Point_set_3/test/Point_set_3/CMakeLists.txt @@ -4,7 +4,7 @@ project( Point_set_3_Tests ) -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.1) # CGAL and its components find_package( CGAL QUIET COMPONENTS ) @@ -16,10 +16,6 @@ if ( NOT CGAL_FOUND ) endif() -# include helper file -include( ${CGAL_USE_FILE} ) - - # Boost and its components find_package( Boost REQUIRED ) @@ -34,14 +30,10 @@ 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( "point_set_test.cpp" ) create_single_source_cgal_program( "point_set_test_join.cpp" ) diff --git a/Point_set_processing_3/doc/Point_set_processing_3/NamedParameters.txt b/Point_set_processing_3/doc/Point_set_processing_3/NamedParameters.txt index 154688a883d..dcb0f56f626 100644 --- a/Point_set_processing_3/doc/Point_set_processing_3/NamedParameters.txt +++ b/Point_set_processing_3/doc/Point_set_processing_3/NamedParameters.txt @@ -1,6 +1,6 @@ /*! \defgroup psp_namedparameters Named Parameters for Point Set Processing -\ingroup PkgPointSetProcessing +\ingroup PkgPointSetProcessing3Ref In this package, all functions optional parameters are implemented as BGL optional named parameters (see \ref BGLNamedParameters for more information on how to use them). diff --git a/Point_set_processing_3/doc/Point_set_processing_3/PackageDescription.txt b/Point_set_processing_3/doc/Point_set_processing_3/PackageDescription.txt index b03c31e380f..fd9ed9c57b9 100644 --- a/Point_set_processing_3/doc/Point_set_processing_3/PackageDescription.txt +++ b/Point_set_processing_3/doc/Point_set_processing_3/PackageDescription.txt @@ -1,42 +1,42 @@ /*! -\defgroup PkgPointSetProcessing Point Set Processing Reference +\defgroup PkgPointSetProcessing3Ref Point Set Processing Reference -\defgroup PkgPointSetProcessingAlgorithms Algorithms -\ingroup PkgPointSetProcessing +\defgroup PkgPointSetProcessing3Algorithms Algorithms +\ingroup PkgPointSetProcessing3Ref Collection of algorithms of point set processing (smoothing, simplification, etc.). -\defgroup PkgPointSetProcessingIO IO (XYZ/OFF Formats) -\ingroup PkgPointSetProcessing +\defgroup PkgPointSetProcessing3IO IO (XYZ/OFF Formats) +\ingroup PkgPointSetProcessing3Ref Read and write points (with or without normal vectors) in XYZ and OFF formats. -\defgroup PkgPointSetProcessingIOPly IO (PLY Format) -\ingroup PkgPointSetProcessing +\defgroup PkgPointSetProcessing3IOPly IO (PLY Format) +\ingroup PkgPointSetProcessing3Ref Read and write points (with or without additional properties) in PLY format. -\defgroup PkgPointSetProcessingIOLas IO (LAS Format) -\ingroup PkgPointSetProcessing +\defgroup PkgPointSetProcessing3IOLas IO (LAS Format) +\ingroup PkgPointSetProcessing3Ref Read and write points (with or without additional properties) in LAS format. -\addtogroup PkgPointSetProcessing -\cgalPkgDescriptionBegin{Point Set Processing,PkgPointSetProcessingSummary} +\addtogroup PkgPointSetProcessing3Ref +\cgalPkgDescriptionBegin{Point Set Processing,PkgPointSetProcessing3} \cgalPkgPicture{point_set_processing_detail.png} \cgalPkgSummaryBegin \cgalPkgAuthors{Pierre Alliez, Simon Giraudot, Clément Jamin, Florent Lafarge, Quentin Mérigot, Jocelyn Meyron, Laurent Saboret, Nader Salman, Shihao Wu} \cgalPkgDesc{This \cgal component implements methods to analyze and process unorganized point sets. The input is an unorganized point set, possibly with normal attributes (unoriented or oriented). The point set can be analyzed to measure its average spacing, and processed through functions devoted to the simplification, outlier removal, smoothing, normal estimation, normal orientation and feature edges estimation.} -\cgalPkgManuals{Chapter_Point_Set_Processing,PkgPointSetProcessing} +\cgalPkgManuals{Chapter_Point_Set_Processing,PkgPointSetProcessing3Ref} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{3.5} -\cgalPkgDependsOn{\ref PkgSolverSummary} +\cgalPkgDependsOn{\ref PkgSolverInterface} \cgalPkgBib{cgal:ass-psp} \cgalPkgLicense{\ref licensesGPL "GPL"} \cgalPkgDemo{Polyhedron demo,polyhedron_3.zip} diff --git a/Point_set_processing_3/doc/Point_set_processing_3/Point_set_processing_3.txt b/Point_set_processing_3/doc/Point_set_processing_3/Point_set_processing_3.txt index ccd0c750df0..33275ed4ff1 100644 --- a/Point_set_processing_3/doc/Point_set_processing_3/Point_set_processing_3.txt +++ b/Point_set_processing_3/doc/Point_set_processing_3/Point_set_processing_3.txt @@ -80,7 +80,7 @@ as, e.g., a class derived from the \cgal 3D point, or as a `std::pair, Vector_3>`, or as a `boost::tuple<..,Point_3, ..., Vector_3 >`. -The following classes described in Chapter \ref PkgProperty_mapSummary +The following classes described in Chapter \ref PkgPropertyMap provide property maps for the implementations of points with normals listed above: @@ -143,7 +143,7 @@ CGAL::jet_estimate_normals normal_map (CGAL::Second_of_pair_property_map())); \endcode -Please refer to the [Reference Manual](@ref PkgPointSetProcessing) for +Please refer to the [Reference Manual](@ref PkgPointSetProcessing3Ref) for the detailed API of the Point Set Processing functions. @@ -584,7 +584,7 @@ points that are on sharp edges: The function `structure_point_set()` generates a structured version of the input point set assigned to a set of planes. Such an input can be produced by a shape detection algorithm (see \ref -PkgPointSetShapeDetection3Summary). Point set structuring is based on +PkgPointSetShapeDetection3). Point set structuring is based on the article \cgalCite{cgal:la-srpss-13}. - __Planes__: inliers of each detected plane are replaced by sets of @@ -636,7 +636,7 @@ point set: Several functions of this package provide a callback mechanism that enables the user to track the progress of the algorithms and to interrupt them if needed. A callback, in this package, is an instance of `CGAL::cpp11::function` that takes the advancement as a parameter (between 0. when the algorithm begins to 1. when the algorithm is completed) and that returns `true` if the algorithm should carry on, `false` otherwise. It is passed as a named parameter with an empty function as default. -Algorithms that support this mechanism are detailed in the [Reference Manual](@ref PkgPointSetProcessing), along with the effect that an early interruption has on the output. +Algorithms that support this mechanism are detailed in the [Reference Manual](@ref PkgPointSetProcessing3Ref), along with the effect that an early interruption has on the output. \subsection Point_set_processing_3Example_callbacks Example 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 d936b3be7ad..1005afbe75d 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 @@ -2,7 +2,7 @@ project( Point_set_processing_3_Examples ) -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.1) # Find CGAL @@ -10,9 +10,6 @@ find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - include( CGAL_CreateSingleSourceCGALProgram ) - find_package(Boost QUIET) # VisualC++ optimization for applications dealing with large data @@ -42,7 +39,7 @@ if ( CGAL_FOUND ) endif() # Executables that do *not* require EIGEN or LAPACK - create_single_source_cgal_program( "average_spacing_example.cpp" ) + create_single_source_cgal_program( "average_spacing_example.cpp" ) create_single_source_cgal_program( "bilateral_smooth_point_set_example.cpp" ) create_single_source_cgal_program( "grid_simplification_example.cpp" ) create_single_source_cgal_program( "grid_simplify_indices.cpp" ) diff --git a/Point_set_processing_3/include/CGAL/IO/read_las_points.h b/Point_set_processing_3/include/CGAL/IO/read_las_points.h index c28d8d16a6d..538ef68dcfd 100644 --- a/Point_set_processing_3/include/CGAL/IO/read_las_points.h +++ b/Point_set_processing_3/include/CGAL/IO/read_las_points.h @@ -134,7 +134,7 @@ namespace CGAL { /** - \ingroup PkgPointSetProcessingIOLas + \ingroup PkgPointSetProcessing3IOLas Generates a %LAS property handler to read 3D points. Points are constructed from the input the using 3 %LAS properties @@ -328,7 +328,7 @@ namespace internal { /** - \ingroup PkgPointSetProcessingIOLas + \ingroup PkgPointSetProcessing3IOLas Reads user-selected points properties from a .las or .laz stream. Potential additional properties are ignored. @@ -429,7 +429,7 @@ bool read_las_points_with_properties (std::istream& stream, /// \endcond /** - \ingroup PkgPointSetProcessingIOLas + \ingroup PkgPointSetProcessing3IOLas Reads points (position only) from a .las or .laz stream. Potential additional properties are ignored. diff --git a/Point_set_processing_3/include/CGAL/IO/read_off_points.h b/Point_set_processing_3/include/CGAL/IO/read_off_points.h index e0e2b9d0f21..2c7e1c03d0a 100644 --- a/Point_set_processing_3/include/CGAL/IO/read_off_points.h +++ b/Point_set_processing_3/include/CGAL/IO/read_off_points.h @@ -42,7 +42,7 @@ namespace CGAL { /** - \ingroup PkgPointSetProcessingIO + \ingroup PkgPointSetProcessing3IO Reads points (positions + normals, if available) from a .off ASCII stream. The function expects for each point a line with the x y z position, optionally followed by the nx ny nz normal. diff --git a/Point_set_processing_3/include/CGAL/IO/read_ply_points.h b/Point_set_processing_3/include/CGAL/IO/read_ply_points.h index f6322ceef2a..d828d8052c3 100644 --- a/Point_set_processing_3/include/CGAL/IO/read_ply_points.h +++ b/Point_set_processing_3/include/CGAL/IO/read_ply_points.h @@ -77,7 +77,7 @@ namespace CGAL { // double double-precision float 8 /** - \ingroup PkgPointSetProcessingIOPly + \ingroup PkgPointSetProcessing3IOPly Class used to identify a %PLY property as a type and a name. @@ -91,46 +91,77 @@ namespace CGAL { PLY_property (const char* name) : name (name) { } }; + /// \cond SKIP_IN_MANUAL + template + struct GetFTFromMap + { + typedef typename Kernel_traits::value_type>::Kernel::FT type; + }; + /// \endcond + /** - \ingroup PkgPointSetProcessingIOPly + \ingroup PkgPointSetProcessing3IOPly Generates a %PLY property handler to read 3D points. Points are - constructed from the input using 3 %PLY properties of type - `double` and named `x`, `y` and `z`. + constructed from the input using 3 %PLY properties of type `FT` + and named `x`, `y` and `z`. `FT` is `float` if the points use + `CGAL::Simple_cartesian` and `double` otherwise. \sa `read_ply_points_with_properties()` \tparam PointMap the property map used to store points. */ template +#ifdef DOXYGEN_RUNNING std::tuple::Kernel::Construct_point_3, - PLY_property, PLY_property, PLY_property > + PLY_property, PLY_property, PLY_property > +#else + std::tuple::Kernel::Construct_point_3, + PLY_property::type>, + PLY_property::type>, + PLY_property::type> > +#endif make_ply_point_reader(PointMap point_map) { return std::make_tuple (point_map, typename Kernel_traits::Kernel::Construct_point_3(), - PLY_property("x"), PLY_property("y"), PLY_property("z")); + PLY_property::type>("x"), + PLY_property::type>("y"), + PLY_property::type>("z")); } /** - \ingroup PkgPointSetProcessingIOPly + \ingroup PkgPointSetProcessing3IOPly Generates a %PLY property handler to read 3D normal vectors. Vectors are constructed from the input using 3 PLY - properties of type `double` and named `nx`, `ny` and `nz`. + properties of type `FT` and named `nx`, `ny` and `nz`. `FT` + is `float` if the points use `CGAL::Simple_cartesian` and + `double` otherwise. \sa `read_ply_points_with_properties()` \tparam VectorMap the property map used to store vectors. */ template +#ifdef DOXYGEN_RUNNING std::tuple::Kernel::Construct_vector_3, - PLY_property, PLY_property, PLY_property > + PLY_property, PLY_property, PLY_property > +#else + std::tuple::Kernel::Construct_vector_3, + PLY_property::type>, + PLY_property::type>, + PLY_property::type> > +#endif make_ply_normal_reader(VectorMap normal_map) { return std::make_tuple (normal_map, typename Kernel_traits::Kernel::Construct_vector_3(), - PLY_property("nx"), PLY_property("ny"), PLY_property("nz")); + PLY_property::type>("nx"), + PLY_property::type>("ny"), + PLY_property::type>("nz")); } /// \cond SKIP_IN_MANUAL @@ -157,13 +188,19 @@ namespace internal { // The two following functions prevent the stream to only extract // ONE character (= what the types char imply) by requiring // explicitely an integer object when reading the stream - void read_ascii (std::istream& stream, boost::int8_t& c) const + void read_ascii (std::istream& stream, char& c) const { short s; stream >> s; c = static_cast(s); } - void read_ascii (std::istream& stream, boost::uint8_t& c) const + void read_ascii (std::istream& stream, signed char& c) const + { + short s; + stream >> s; + c = static_cast(s); + } + void read_ascii (std::istream& stream, unsigned char& c) const { unsigned short s; stream >> s; @@ -667,7 +704,7 @@ namespace internal { /* - \ingroup PkgPointSetProcessingIOPly + \ingroup PkgPointSetProcessing3IOPly Reads user-selected points properties from a .ply stream (ASCII or binary). @@ -755,7 +792,7 @@ bool read_ply_points_with_properties (std::istream& stream, /// \endcond /** - \ingroup PkgPointSetProcessingIOPly + \ingroup PkgPointSetProcessing3IOPly Reads points (positions + normals, if available) from a .ply stream (ASCII or binary). Potential additional point properties and faces are ignored. diff --git a/Point_set_processing_3/include/CGAL/IO/read_xyz_points.h b/Point_set_processing_3/include/CGAL/IO/read_xyz_points.h index 4af3a2c15ea..8a9ea1df92c 100644 --- a/Point_set_processing_3/include/CGAL/IO/read_xyz_points.h +++ b/Point_set_processing_3/include/CGAL/IO/read_xyz_points.h @@ -40,7 +40,7 @@ namespace CGAL { /** - \ingroup PkgPointSetProcessingIO + \ingroup PkgPointSetProcessing3IO Reads points (positions + normals, if available) from a .xyz ASCII stream. The function expects for each point a line with the x y z position, optionally followed by the nx ny nz normal. diff --git a/Point_set_processing_3/include/CGAL/IO/write_las_points.h b/Point_set_processing_3/include/CGAL/IO/write_las_points.h index 422c759c21a..07cb6e244f7 100644 --- a/Point_set_processing_3/include/CGAL/IO/write_las_points.h +++ b/Point_set_processing_3/include/CGAL/IO/write_las_points.h @@ -71,7 +71,7 @@ namespace CGAL { /** - \ingroup PkgPointSetProcessingIOLas + \ingroup PkgPointSetProcessing3IOLas Generates a %LAS property handler to write 3D points. @@ -92,41 +92,41 @@ namespace internal { namespace LAS { - void output_value(LASpoint& r, unsigned short& v, LAS_property::Intensity&) + void output_value(LASpoint& r, const unsigned short& v, LAS_property::Intensity&) { r.set_intensity(v); } - void output_value(LASpoint& r, unsigned char& v, LAS_property::Return_number&) + void output_value(LASpoint& r, const unsigned char& v, LAS_property::Return_number&) { r.set_return_number(v); } - void output_value(LASpoint& r, unsigned char& v, LAS_property::Number_of_returns&) + void output_value(LASpoint& r, const unsigned char& v, LAS_property::Number_of_returns&) { r.set_number_of_returns(v); } - void output_value(LASpoint& r, unsigned char& v, LAS_property::Scan_direction_flag&) + void output_value(LASpoint& r, const unsigned char& v, LAS_property::Scan_direction_flag&) { r.set_scan_direction_flag(v); } - void output_value(LASpoint& r, unsigned char& v, LAS_property::Edge_of_flight_line&) + void output_value(LASpoint& r, const unsigned char& v, LAS_property::Edge_of_flight_line&) { r.set_edge_of_flight_line(v); } - void output_value(LASpoint& r, unsigned char& v, LAS_property::Classification&) + void output_value(LASpoint& r, const unsigned char& v, LAS_property::Classification&) { r.set_classification(v); } - void output_value(LASpoint& r, unsigned char& v, LAS_property::Synthetic_flag&) + void output_value(LASpoint& r, const unsigned char& v, LAS_property::Synthetic_flag&) { r.set_synthetic_flag(v); } - void output_value(LASpoint& r, unsigned char& v, LAS_property::Keypoint_flag&) + void output_value(LASpoint& r, const unsigned char& v, LAS_property::Keypoint_flag&) { r.set_keypoint_flag(v); } - void output_value(LASpoint& r, unsigned char& v, LAS_property::Withheld_flag&) + void output_value(LASpoint& r, const unsigned char& v, LAS_property::Withheld_flag&) { r.set_withheld_flag(v); } - void output_value(LASpoint& r, float& v, LAS_property::Scan_angle&) + void output_value(LASpoint& r, const float& v, LAS_property::Scan_angle&) { r.set_scan_angle_rank(char(v)); } - void output_value(LASpoint& r, unsigned char& v, LAS_property::User_data&) + void output_value(LASpoint& r, const unsigned char& v, LAS_property::User_data&) { r.set_user_data(v); } - void output_value(LASpoint& r, unsigned short& v, LAS_property::Point_source_ID&) + void output_value(LASpoint& r, const unsigned short& v, LAS_property::Point_source_ID&) { r.set_point_source_ID(v); } - void output_value(LASpoint& r, unsigned int& v, LAS_property::Deleted_flag&) + void output_value(LASpoint& r, const unsigned int& v, LAS_property::Deleted_flag&) { r.set_deleted_flag(v); } - void output_value(LASpoint& r, double& v, LAS_property::GPS_time&) + void output_value(LASpoint& r, const double& v, LAS_property::GPS_time&) { r.set_gps_time(v); } - void output_value(LASpoint& r, unsigned short& v, LAS_property::R&) + void output_value(LASpoint& r, const unsigned short& v, LAS_property::R&) { r.set_R(v); } - void output_value(LASpoint& r, unsigned short& v, LAS_property::G&) + void output_value(LASpoint& r, const unsigned short& v, LAS_property::G&) { r.set_G(v); } - void output_value(LASpoint& r, unsigned short& v, LAS_property::B&) + void output_value(LASpoint& r, const unsigned short& v, LAS_property::B&) { r.set_B(v); } - void output_value(LASpoint& r, unsigned short& v, LAS_property::I&) + void output_value(LASpoint& r, const unsigned short& v, LAS_property::I&) { r.set_I(v); } template @@ -170,7 +170,7 @@ namespace internal { /** - \ingroup PkgPointSetProcessingIOLas + \ingroup PkgPointSetProcessing3IOLas Saves the range of `points` with properties to a .las stream. @@ -257,7 +257,7 @@ bool write_las_points_with_properties (std::ostream& stream, ///< output stream } /** - \ingroup PkgPointSetProcessingIOLas + \ingroup PkgPointSetProcessing3IOLas Saves the range of `points` (positions only) to a .las stream. diff --git a/Point_set_processing_3/include/CGAL/IO/write_off_points.h b/Point_set_processing_3/include/CGAL/IO/write_off_points.h index 3f9ebfd728d..d7bf4c8d6f5 100644 --- a/Point_set_processing_3/include/CGAL/IO/write_off_points.h +++ b/Point_set_processing_3/include/CGAL/IO/write_off_points.h @@ -36,7 +36,7 @@ namespace CGAL { /** - \ingroup PkgPointSetProcessingIO + \ingroup PkgPointSetProcessing3IO Saves the range of `points` (positions + normals, if available) to a .off ASCII stream. The function writes for each point a line with the x y z position followed by the nx ny nz normal (if available). diff --git a/Point_set_processing_3/include/CGAL/IO/write_ply_points.h b/Point_set_processing_3/include/CGAL/IO/write_ply_points.h index c2b60e4f337..7d9886858b9 100644 --- a/Point_set_processing_3/include/CGAL/IO/write_ply_points.h +++ b/Point_set_processing_3/include/CGAL/IO/write_ply_points.h @@ -46,39 +46,61 @@ namespace CGAL { /** - \ingroup PkgPointSetProcessingIOPly + \ingroup PkgPointSetProcessing3IOPly Generates a %PLY property handler to write 3D points. Points are - written as 3 %PLY properties of type `double` and named `x`, `y` - and `z`. + written as 3 %PLY properties of type `FT` and named `x`, `y` and + `z`. `FT` is `float` if the points use + `CGAL::Simple_cartesian` and `double` otherwise. \sa `write_ply_points_with_properties()` \tparam PointMap the property map used to store points. */ template - std::tuple, PLY_property, PLY_property > +#ifdef DOXYGEN_RUNNING + std::tuple, PLY_property, PLY_property > +#else + std::tuple::type>, + PLY_property::type>, + PLY_property::type> > +#endif make_ply_point_writer(PointMap point_map) { - return std::make_tuple (point_map, PLY_property("x"), PLY_property("y"), PLY_property("z")); + return std::make_tuple (point_map, + PLY_property::type>("x"), + PLY_property::type>("y"), + PLY_property::type>("z")); } /** - \ingroup PkgPointSetProcessingIOPly + \ingroup PkgPointSetProcessing3IOPly Generates a %PLY property handler to write 3D normal - vectors. Vectors are written as 3 %PLY properties of type `double` - and named `nx`, `ny` and `nz`. + vectors. Vectors are written as 3 %PLY properties of type `FT` + and named `nx`, `ny` and `nz`. `FT` is `float` if the vectors use + `CGAL::Simple_cartesian` and `double` otherwise. \sa `write_ply_points_with_properties()` \tparam VectorMap the property map used to store vectors. */ template - std::tuple, PLY_property, PLY_property > +#ifdef DOXYGEN_RUNNING + std::tuple, PLY_property, PLY_property > +#else + std::tuple::type>, + PLY_property::type>, + PLY_property::type> > +#endif make_ply_normal_writer(VectorMap normal_map) { - return std::make_tuple (normal_map, PLY_property("nx"), PLY_property("ny"), PLY_property("nz")); + return std::make_tuple (normal_map, + PLY_property::type>("nx"), + PLY_property::type>("ny"), + PLY_property::type>("nz")); } /// \cond SKIP_IN_MANUAL @@ -87,9 +109,14 @@ namespace internal { namespace PLY { - template void property_header_type (std::ostream& stream) { stream << "undefined_type"; } + template void property_header_type (std::ostream& stream) + { + CGAL_assertion_msg (false, "Unknown PLY type"); + stream << "undefined_type"; + } template <> void property_header_type (std::ostream& stream) { stream << "char"; } + template <> void property_header_type (std::ostream& stream) { stream << "char"; } template <> void property_header_type (std::ostream& stream) { stream << "uchar"; } template <> void property_header_type (std::ostream& stream) { stream << "short"; } template <> void property_header_type (std::ostream& stream) { stream << "ushort"; } @@ -187,14 +214,20 @@ namespace internal { stream << CGAL::oformat(get (map, *it)); } + template + T no_char_character (const T& t) { return t; } + int no_char_character (const char& t) { return int(t); } + int no_char_character (const signed char& t) { return int(t); } + int no_char_character (const unsigned char& t) { return int(t); } + template void simple_property_write (std::ostream& stream, ForwardIterator it, - std::pair >&& map) + std::pair > map) { if (CGAL::get_mode(stream) == IO::ASCII) - stream << get (map.first, *it); + stream << no_char_character(get (map.first, *it)); else { typename PropertyMap::value_type value = get(map.first, *it); @@ -214,7 +247,7 @@ namespace internal { { stream << value.size(); for (std::size_t i = 0; i < value.size(); ++ i) - stream << " " << value[i]; + stream << " " << no_char_character(value[i]); } else { @@ -262,7 +295,7 @@ namespace internal { void output_properties (std::ostream& stream, ForwardIterator it, std::pair >&& current, - NextPropertyHandler& next, + NextPropertyHandler&& next, PropertyHandler&& ... properties) { simple_property_write (stream, it, current); @@ -298,7 +331,7 @@ namespace internal { /** - \ingroup PkgPointSetProcessingIOPly + \ingroup PkgPointSetProcessing3IOPly Saves the range of `points` with properties to a .ply stream. %PLY is either ASCII or binary depending on the value of `CGAL::get_mode(stream)`. @@ -364,7 +397,7 @@ write_ply_points_with_properties( } /** - \ingroup PkgPointSetProcessingIOPly + \ingroup PkgPointSetProcessing3IOPly Saves the range of `points` (positions + normals, if available) to a .ply stream. %PLY is either ASCII or binary depending on the value of `CGAL::get_mode(stream)`. diff --git a/Point_set_processing_3/include/CGAL/IO/write_xyz_points.h b/Point_set_processing_3/include/CGAL/IO/write_xyz_points.h index 7ff6cf06b0c..f8ebf39fcbc 100644 --- a/Point_set_processing_3/include/CGAL/IO/write_xyz_points.h +++ b/Point_set_processing_3/include/CGAL/IO/write_xyz_points.h @@ -39,7 +39,7 @@ namespace CGAL { /** - \ingroup PkgPointSetProcessingIO + \ingroup PkgPointSetProcessing3IO Saves the range of `points` (positions + normals, if available) to a .xyz ASCII stream. The function writes for each point a line with the x y z position followed by the nx ny nz normal (if available). diff --git a/Point_set_processing_3/include/CGAL/bilateral_smooth_point_set.h b/Point_set_processing_3/include/CGAL/bilateral_smooth_point_set.h index 4c0d896f1fb..e8a2fe1b01f 100644 --- a/Point_set_processing_3/include/CGAL/bilateral_smooth_point_set.h +++ b/Point_set_processing_3/include/CGAL/bilateral_smooth_point_set.h @@ -387,7 +387,7 @@ public: /** - \ingroup PkgPointSetProcessingAlgorithms + \ingroup PkgPointSetProcessing3Algorithms This function smooths an input point set by iteratively projecting each point onto the implicit surface patch fitted over its k nearest neighbors. diff --git a/Point_set_processing_3/include/CGAL/compute_average_spacing.h b/Point_set_processing_3/include/CGAL/compute_average_spacing.h index b557ac389d4..a1807ac9f08 100644 --- a/Point_set_processing_3/include/CGAL/compute_average_spacing.h +++ b/Point_set_processing_3/include/CGAL/compute_average_spacing.h @@ -149,7 +149,7 @@ compute_average_spacing(const typename Kernel::Point_3& query, ///< 3D point who // ---------------------------------------------------------------------------- /** - \ingroup PkgPointSetProcessingAlgorithms + \ingroup PkgPointSetProcessing3Algorithms Computes average spacing from k nearest neighbors. \pre `k >= 2.` diff --git a/Point_set_processing_3/include/CGAL/edge_aware_upsample_point_set.h b/Point_set_processing_3/include/CGAL/edge_aware_upsample_point_set.h index 0c468cab86f..13874b85ef2 100644 --- a/Point_set_processing_3/include/CGAL/edge_aware_upsample_point_set.h +++ b/Point_set_processing_3/include/CGAL/edge_aware_upsample_point_set.h @@ -281,7 +281,7 @@ update_new_point( // ---------------------------------------------------------------------------- /** - \ingroup PkgPointSetProcessingAlgorithms + \ingroup PkgPointSetProcessing3Algorithms This method progressively upsamples the point set while approaching the edge singularities (detected by normal variation), which generates a denser point set from an input point set. This has applications diff --git a/Point_set_processing_3/include/CGAL/estimate_scale.h b/Point_set_processing_3/include/CGAL/estimate_scale.h index 6243bfc4307..860bf5a183e 100644 --- a/Point_set_processing_3/include/CGAL/estimate_scale.h +++ b/Point_set_processing_3/include/CGAL/estimate_scale.h @@ -443,7 +443,7 @@ public: // ---------------------------------------------------------------------------- /** - \ingroup PkgPointSetProcessingAlgorithms + \ingroup PkgPointSetProcessing3Algorithms Estimates the local scale in a K nearest neighbors sense on a set of user-defined query points. The computed scales correspond to @@ -535,7 +535,7 @@ estimate_local_k_neighbor_scales( /// \endcond /** - \ingroup PkgPointSetProcessingAlgorithms + \ingroup PkgPointSetProcessing3Algorithms Estimates the global scale in a K nearest neighbors sense. The computed scale corresponds to the smallest scale such that the K @@ -591,7 +591,7 @@ estimate_global_k_neighbor_scale(const PointRange& points) /// \endcond /** - \ingroup PkgPointSetProcessingAlgorithms + \ingroup PkgPointSetProcessing3Algorithms Estimates the local scale in a range sense on a set of user-defined query points. The computed scales correspond to the @@ -683,7 +683,7 @@ estimate_local_range_scales( /// \endcond /** - \ingroup PkgPointSetProcessingAlgorithms + \ingroup PkgPointSetProcessing3Algorithms Estimates the global scale in a range sense. The computed scale corresponds to the smallest scale such that the subsets of points diff --git a/Point_set_processing_3/include/CGAL/grid_simplify_point_set.h b/Point_set_processing_3/include/CGAL/grid_simplify_point_set.h index 2dcb7ab6c7e..a4d59e32f92 100644 --- a/Point_set_processing_3/include/CGAL/grid_simplify_point_set.h +++ b/Point_set_processing_3/include/CGAL/grid_simplify_point_set.h @@ -170,7 +170,7 @@ public: // ---------------------------------------------------------------------------- /** - \ingroup PkgPointSetProcessingAlgorithms + \ingroup PkgPointSetProcessing3Algorithms Merges points which belong to the same cell of a grid of cell size = `epsilon`. This method modifies the order of input points so as to pack all remaining points first, diff --git a/Point_set_processing_3/include/CGAL/hierarchy_simplify_point_set.h b/Point_set_processing_3/include/CGAL/hierarchy_simplify_point_set.h index 15580c55cdb..b12bda49e87 100644 --- a/Point_set_processing_3/include/CGAL/hierarchy_simplify_point_set.h +++ b/Point_set_processing_3/include/CGAL/hierarchy_simplify_point_set.h @@ -115,7 +115,7 @@ namespace CGAL { /// \endcond /** - \ingroup PkgPointSetProcessingAlgorithms + \ingroup PkgPointSetProcessing3Algorithms Recursively split the point set in smaller clusters until the clusters have less than `size` elements or until their variation diff --git a/Point_set_processing_3/include/CGAL/jet_estimate_normals.h b/Point_set_processing_3/include/CGAL/jet_estimate_normals.h index 362bf0abf19..646f2c5a8bc 100644 --- a/Point_set_processing_3/include/CGAL/jet_estimate_normals.h +++ b/Point_set_processing_3/include/CGAL/jet_estimate_normals.h @@ -166,7 +166,7 @@ jet_estimate_normal(const typename Kernel::Point_3& query, ///< point to compute // ---------------------------------------------------------------------------- /** - \ingroup PkgPointSetProcessingAlgorithms + \ingroup PkgPointSetProcessing3Algorithms Estimates normal directions of the range of `points` using jet fitting on the k nearest neighbors. The output normals are randomly oriented. diff --git a/Point_set_processing_3/include/CGAL/jet_smooth_point_set.h b/Point_set_processing_3/include/CGAL/jet_smooth_point_set.h index e9054ba2147..e0557b3b412 100644 --- a/Point_set_processing_3/include/CGAL/jet_smooth_point_set.h +++ b/Point_set_processing_3/include/CGAL/jet_smooth_point_set.h @@ -169,7 +169,7 @@ jet_smooth_point( // ---------------------------------------------------------------------------- /** - \ingroup PkgPointSetProcessingAlgorithms + \ingroup PkgPointSetProcessing3Algorithms Smoothes the range of `points` using jet fitting on the k nearest neighbors and reprojection onto the jet. As this method relocates the points, it diff --git a/Point_set_processing_3/include/CGAL/mst_orient_normals.h b/Point_set_processing_3/include/CGAL/mst_orient_normals.h index f441f209de9..4935cd7d208 100644 --- a/Point_set_processing_3/include/CGAL/mst_orient_normals.h +++ b/Point_set_processing_3/include/CGAL/mst_orient_normals.h @@ -499,7 +499,7 @@ create_mst_graph( // ---------------------------------------------------------------------------- /** - \ingroup PkgPointSetProcessingAlgorithms + \ingroup PkgPointSetProcessing3Algorithms Orients the normals of the range of `points` using the propagation of a seed orientation through a minimum spanning tree of the Riemannian graph. This method modifies the order of input points so as to pack all sucessfully oriented points first, diff --git a/Point_set_processing_3/include/CGAL/pca_estimate_normals.h b/Point_set_processing_3/include/CGAL/pca_estimate_normals.h index 68da25df8d8..133e793384a 100644 --- a/Point_set_processing_3/include/CGAL/pca_estimate_normals.h +++ b/Point_set_processing_3/include/CGAL/pca_estimate_normals.h @@ -157,7 +157,7 @@ pca_estimate_normal(const typename Kernel::Point_3& query, ///< point to compute // ---------------------------------------------------------------------------- /** - \ingroup PkgPointSetProcessingAlgorithms + \ingroup PkgPointSetProcessing3Algorithms Estimates normal directions of the range of `points` by linear least squares fitting of a plane over the k nearest neighbors. The output normals are randomly oriented. diff --git a/Point_set_processing_3/include/CGAL/random_simplify_point_set.h b/Point_set_processing_3/include/CGAL/random_simplify_point_set.h index b8137129d57..51017d05771 100644 --- a/Point_set_processing_3/include/CGAL/random_simplify_point_set.h +++ b/Point_set_processing_3/include/CGAL/random_simplify_point_set.h @@ -42,7 +42,7 @@ namespace CGAL { /** - \ingroup PkgPointSetProcessingAlgorithms + \ingroup PkgPointSetProcessing3Algorithms Randomly deletes a user-specified fraction of the input points. This method modifies the order of input points so as to pack all remaining points first, diff --git a/Point_set_processing_3/include/CGAL/remove_outliers.h b/Point_set_processing_3/include/CGAL/remove_outliers.h index 3300d2c6696..d3df9cae48b 100644 --- a/Point_set_processing_3/include/CGAL/remove_outliers.h +++ b/Point_set_processing_3/include/CGAL/remove_outliers.h @@ -109,7 +109,7 @@ compute_avg_knn_sq_distance_3( // ---------------------------------------------------------------------------- /** - \ingroup PkgPointSetProcessingAlgorithms + \ingroup PkgPointSetProcessing3Algorithms Removes outliers: - computes average squared distance to the K nearest neighbors, - and sorts the points in increasing order of average distance. diff --git a/Point_set_processing_3/include/CGAL/structure_point_set.h b/Point_set_processing_3/include/CGAL/structure_point_set.h index 3721e82f110..9f23fb9ba7c 100644 --- a/Point_set_processing_3/include/CGAL/structure_point_set.h +++ b/Point_set_processing_3/include/CGAL/structure_point_set.h @@ -54,7 +54,7 @@ namespace CGAL { /*! -\ingroup PkgPointSetProcessingAlgorithms +\ingroup PkgPointSetProcessing3Algorithms \brief A 3D point set with structure information based on a set of detected planes. @@ -1497,7 +1497,7 @@ private: // ---------------------------------------------------------------------------- /** - \ingroup PkgPointSetProcessingAlgorithms + \ingroup PkgPointSetProcessing3Algorithms This is an implementation of the Point Set Structuring algorithm. This algorithm takes advantage of a set of detected planes: it detects adjacency diff --git a/Point_set_processing_3/include/CGAL/vcm_estimate_edges.h b/Point_set_processing_3/include/CGAL/vcm_estimate_edges.h index 7c1ef5a1542..66e2505e19d 100644 --- a/Point_set_processing_3/include/CGAL/vcm_estimate_edges.h +++ b/Point_set_processing_3/include/CGAL/vcm_estimate_edges.h @@ -30,7 +30,7 @@ namespace CGAL { -/// \ingroup PkgPointSetProcessingAlgorithms +/// \ingroup PkgPointSetProcessing3Algorithms /// determines if a point is on a sharp feature edge from a point set /// for which the Voronoi covariance Measures have been computed. /// diff --git a/Point_set_processing_3/include/CGAL/vcm_estimate_normals.h b/Point_set_processing_3/include/CGAL/vcm_estimate_normals.h index ef01e0a3b64..96cd7f8f7c1 100644 --- a/Point_set_processing_3/include/CGAL/vcm_estimate_normals.h +++ b/Point_set_processing_3/include/CGAL/vcm_estimate_normals.h @@ -213,7 +213,7 @@ vcm_convolve (ForwardIterator first, // ---------------------------------------------------------------------------- /** - \ingroup PkgPointSetProcessingAlgorithms + \ingroup PkgPointSetProcessing3Algorithms computes the Voronoi Covariance Measure (VCM) of a point cloud, a construction that can be used for normal estimation and sharp feature detection. @@ -411,7 +411,7 @@ vcm_estimate_normals_internal (PointRange& points, /** - \ingroup PkgPointSetProcessingAlgorithms + \ingroup PkgPointSetProcessing3Algorithms Estimates normal directions of the range of `points` using the Voronoi Covariance Measure with a radius for the convolution. The output normals are randomly oriented. @@ -497,7 +497,7 @@ vcm_estimate_normals (ForwardIterator first, ///< iterator over the first input /** - \ingroup PkgPointSetProcessingAlgorithms + \ingroup PkgPointSetProcessing3Algorithms Estimates normal directions of the range of `points` using the Voronoi Covariance Measure with a number of neighbors for the convolution. The output normals are randomly oriented. diff --git a/Point_set_processing_3/include/CGAL/wlop_simplify_and_regularize_point_set.h b/Point_set_processing_3/include/CGAL/wlop_simplify_and_regularize_point_set.h index 3d9c0f43c52..27d4205cf8d 100644 --- a/Point_set_processing_3/include/CGAL/wlop_simplify_and_regularize_point_set.h +++ b/Point_set_processing_3/include/CGAL/wlop_simplify_and_regularize_point_set.h @@ -407,7 +407,7 @@ public: // ---------------------------------------------------------------------------- /** - \ingroup PkgPointSetProcessingAlgorithms + \ingroup PkgPointSetProcessing3Algorithms This is an implementation of the Weighted Locally Optimal Projection (WLOP) simplification algorithm. The WLOP simplification algorithm can produce a set of denoised, outlier-free and evenly distributed particles over the original 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 c5b10e20dd0..8e97896cd6e 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 @@ -2,7 +2,7 @@ project( Point_set_processing_3_Tests ) -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.1) # Find CGAL @@ -10,9 +10,6 @@ find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - include( CGAL_CreateSingleSourceCGALProgram ) - # VisualC++ optimization for applications dealing with large data if (MSVC) if ( CMAKE_SIZEOF_VOID_P EQUAL 4 ) diff --git a/Point_set_shape_detection_3/doc/Point_set_shape_detection_3/PackageDescription.txt b/Point_set_shape_detection_3/doc/Point_set_shape_detection_3/PackageDescription.txt index 908d1c28ae3..e9a6eda262e 100644 --- a/Point_set_shape_detection_3/doc/Point_set_shape_detection_3/PackageDescription.txt +++ b/Point_set_shape_detection_3/doc/Point_set_shape_detection_3/PackageDescription.txt @@ -1,23 +1,23 @@ /*! -\defgroup PkgPointSetShapeDetection3 Point Set Shape Detection Reference +\defgroup PkgPointSetShapeDetection3Ref Point Set Shape Detection Reference \defgroup PkgPointSetShapeDetection3Concepts Concepts -\ingroup PkgPointSetShapeDetection3 +\ingroup PkgPointSetShapeDetection3Ref \defgroup PkgPointSetShapeDetection3Shapes Shapes -\ingroup PkgPointSetShapeDetection3 +\ingroup PkgPointSetShapeDetection3Ref -\addtogroup PkgPointSetShapeDetection3 +\addtogroup PkgPointSetShapeDetection3Ref -\cgalPkgDescriptionBegin{Point Set Shape Detection, PkgPointSetShapeDetection3Summary} +\cgalPkgDescriptionBegin{Point Set Shape Detection, PkgPointSetShapeDetection3} \cgalPkgPicture{shapes_detail.png} \cgalPkgSummaryBegin \cgalPkgAuthors{Sven Oesau, Yannick Verdie, Clément Jamin, Pierre Alliez, Florent Lafarge, Simon Giraudot} \cgalPkgDesc{This component implements two primitive shape detection algorithms: efficient RANSAC and region growing. Planes are detected from point sets with unoriented normals. RANSAC also handles the following shapes: sphere, cylinder, cone and torus. Other types of shapes can be detected through implementing a class deriving from the base shape class.} -\cgalPkgManuals{Chapter_Point_Set_Shape_Detection, PkgPointSetShapeDetection3} +\cgalPkgManuals{Chapter_Point_Set_Shape_Detection, PkgPointSetShapeDetection3Ref} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin diff --git a/Point_set_shape_detection_3/examples/Point_set_shape_detection_3/CMakeLists.txt b/Point_set_shape_detection_3/examples/Point_set_shape_detection_3/CMakeLists.txt index 380426c2f72..20060193620 100644 --- a/Point_set_shape_detection_3/examples/Point_set_shape_detection_3/CMakeLists.txt +++ b/Point_set_shape_detection_3/examples/Point_set_shape_detection_3/CMakeLists.txt @@ -4,7 +4,7 @@ project( Point_set_shape_detection_3_Examples ) -cmake_minimum_required(VERSION 2.6.2) +cmake_minimum_required(VERSION 3.1) if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" VERSION_GREATER 2.6) if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}" VERSION_GREATER 2.8.3) cmake_policy(VERSION 2.8.4) @@ -17,12 +17,6 @@ find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - include_directories (BEFORE "../../include") - # Use Eigen find_package(Eigen3 3.1.0 QUIET) #(3.1.0 or greater) if (EIGEN3_FOUND) diff --git a/Point_set_shape_detection_3/include/CGAL/Shape_detection_3.h b/Point_set_shape_detection_3/include/CGAL/Shape_detection_3.h index 4bf090f5e56..e8c8d8c28a9 100644 --- a/Point_set_shape_detection_3/include/CGAL/Shape_detection_3.h +++ b/Point_set_shape_detection_3/include/CGAL/Shape_detection_3.h @@ -21,7 +21,7 @@ // /** -* \ingroup PkgPointSetShapeDetection3 +* \ingroup PkgPointSetShapeDetection3Ref * \file CGAL/Shape_detection_3.h * Convenience header file including the headers of this package. */ diff --git a/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/Efficient_RANSAC.h b/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/Efficient_RANSAC.h index 5694bf54031..7c52d6ef45e 100644 --- a/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/Efficient_RANSAC.h +++ b/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/Efficient_RANSAC.h @@ -59,7 +59,7 @@ namespace CGAL { namespace Shape_detection_3 { /*! -\ingroup PkgPointSetShapeDetection3 +\ingroup PkgPointSetShapeDetection3Ref \brief A shape detection algorithm using a RANSAC method. Given a point set in 3D space with unoriented normals, sampled on surfaces, diff --git a/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/Efficient_RANSAC_traits.h b/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/Efficient_RANSAC_traits.h index dc2e8bddaea..8af00b65b00 100644 --- a/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/Efficient_RANSAC_traits.h +++ b/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/Efficient_RANSAC_traits.h @@ -39,7 +39,7 @@ namespace CGAL { namespace Shape_detection_3 { /*! - \ingroup PkgPointSetShapeDetection3 + \ingroup PkgPointSetShapeDetection3Ref \brief %Default traits class to use the shape detection class `Efficient_RANSAC`. \cgalModels `Shape_detection_3::Traits` diff --git a/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/Region_growing.h b/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/Region_growing.h index 2e0566b6bd1..9aa50891591 100644 --- a/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/Region_growing.h +++ b/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/Region_growing.h @@ -44,7 +44,7 @@ namespace Shape_detection_3 { /*! -\ingroup PkgPointSetShapeDetection3 +\ingroup PkgPointSetShapeDetection3Ref \brief A shape detection algorithm using a region growing method. Given a point set in 3D space with unoriented normals, sampled on surfaces, diff --git a/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/Shape_detection_traits.h b/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/Shape_detection_traits.h index e8f0852d845..3faacfc4e01 100644 --- a/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/Shape_detection_traits.h +++ b/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/Shape_detection_traits.h @@ -31,7 +31,7 @@ namespace CGAL { namespace Shape_detection_3 { /*! - \ingroup PkgPointSetShapeDetection3 + \ingroup PkgPointSetShapeDetection3Ref \brief %Default traits class to use the shape detection class `Efficient_RANSAC`. \cgalModels `Shape_detection_3::Traits` diff --git a/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/property_maps.h b/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/property_maps.h index f26597397a7..bf0e0e2c9f0 100644 --- a/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/property_maps.h +++ b/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/property_maps.h @@ -32,7 +32,7 @@ namespace CGAL { namespace Shape_detection_3 { /*! - \ingroup PkgPointSetShapeDetection3 + \ingroup PkgPointSetShapeDetection3Ref Property map that associate a point index to its assigned shape found by a shape detection algorithm (such as @@ -87,7 +87,7 @@ namespace Shape_detection_3 { }; /*! - \ingroup PkgPointSetShapeDetection3 + \ingroup PkgPointSetShapeDetection3Ref Property map that associates a detected plane object (`CGAL::Shape_detection_3::Plane`) to a `CGAL::Plane_3` object. diff --git a/Point_set_shape_detection_3/include/CGAL/regularize_planes.h b/Point_set_shape_detection_3/include/CGAL/regularize_planes.h index 14cb4907b22..a6271363d01 100644 --- a/Point_set_shape_detection_3/include/CGAL/regularize_planes.h +++ b/Point_set_shape_detection_3/include/CGAL/regularize_planes.h @@ -21,7 +21,7 @@ // /** - * \ingroup PkgPointSetShapeDetection3 + * \ingroup PkgPointSetShapeDetection3Ref * \file CGAL/regularize_planes.h * */ @@ -540,7 +540,7 @@ void subgraph_mutually_orthogonal_clusters (std::vector >& // Public section // ---------------------------------------------------------------------------- -/// \ingroup PkgPointSetShapeDetection3 +/// \ingroup PkgPointSetShapeDetection3Ref /*! @@ -781,6 +781,13 @@ void regularize_planes (const PointRange& points, /// \cond SKIP_IN_MANUAL +// Workaround for bug reported here: +// https://developercommunity.visualstudio.com/content/problem/340310/unaccepted-typename-that-other-compilers-require.html +#if _MSC_VER == 1915 +#define CGAL_TYPENAME_FOR_MSC +#else +#define CGAL_TYPENAME_FOR_MSC typename +#endif // This variant deduces the kernel from the point property map. template ::value_type>::Kernel::Vector_3 symmetry_direction - = typename Kernel_traits + = CGAL_TYPENAME_FOR_MSC Kernel_traits ::value_type>::Kernel::Vector_3 - (typename Kernel_traits + ( + CGAL_TYPENAME_FOR_MSC Kernel_traits ::value_type>::Kernel::FT(0.), - typename Kernel_traits + CGAL_TYPENAME_FOR_MSC Kernel_traits ::value_type>::Kernel::FT(0.), - typename Kernel_traits + CGAL_TYPENAME_FOR_MSC Kernel_traits ::value_type>::Kernel::FT(1.))) { @@ -824,6 +832,10 @@ void regularize_planes (const PointRange& points, tolerance_angle, tolerance_coplanarity, symmetry_direction); } +#ifdef CGAL_TYPENAME_FOR_MSC +#undef CGAL_TYPENAME_FOR_MSC +#endif + /// \endcond diff --git a/Point_set_shape_detection_3/test/Point_set_shape_detection_3/CMakeLists.txt b/Point_set_shape_detection_3/test/Point_set_shape_detection_3/CMakeLists.txt index 80a84e0bcf0..9c9fab81715 100644 --- a/Point_set_shape_detection_3/test/Point_set_shape_detection_3/CMakeLists.txt +++ b/Point_set_shape_detection_3/test/Point_set_shape_detection_3/CMakeLists.txt @@ -4,7 +4,7 @@ project( Point_set_shape_detection_3_Tests ) -cmake_minimum_required(VERSION 2.6.2) +cmake_minimum_required(VERSION 3.1) if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" VERSION_GREATER 2.6) if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}" VERSION_GREATER 2.8.3) cmake_policy(VERSION 2.8.4) @@ -17,12 +17,6 @@ find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - include_directories (BEFORE "../../include") - create_single_source_cgal_program( "test_cone_connected_component.cpp" ) create_single_source_cgal_program( "test_cone_parameters.cpp" ) create_single_source_cgal_program( "test_cylinder_connected_component.cpp" ) diff --git a/Poisson_surface_reconstruction_3/doc/Poisson_surface_reconstruction_3/PackageDescription.txt b/Poisson_surface_reconstruction_3/doc/Poisson_surface_reconstruction_3/PackageDescription.txt index 380bf560294..dbf4add6e55 100644 --- a/Poisson_surface_reconstruction_3/doc/Poisson_surface_reconstruction_3/PackageDescription.txt +++ b/Poisson_surface_reconstruction_3/doc/Poisson_surface_reconstruction_3/PackageDescription.txt @@ -1,16 +1,16 @@ -/// \defgroup PkgPoissonSurfaceReconstruction Poisson Surface Reconstruction Reference +/// \defgroup PkgPoissonSurfaceReconstruction3Ref Poisson Surface Reconstruction Reference /*! -\addtogroup PkgPoissonSurfaceReconstruction -\cgalPkgDescriptionBegin{Poisson Surface Reconstruction,PkgPoissonSurfaceReconstructionSummary} +\addtogroup PkgPoissonSurfaceReconstruction3Ref +\cgalPkgDescriptionBegin{Poisson Surface Reconstruction,PkgPoissonSurfaceReconstruction3} \cgalPkgPicture{surface_reconstruction_points_detail.png} \cgalPkgSummaryBegin \cgalPkgAuthors{Pierre Alliez, Laurent Saboret, Gaël Guennebaud} \cgalPkgDesc{This package implements a surface reconstruction method: Poisson Surface Reconstruction. It takes as input a set of points with oriented normals and computes an implicit function. The \cgal surface mesh generator can then be used to extract an iso-surface from this function. } -\cgalPkgManuals{Chapter_Poisson_Surface_Reconstruction,PkgPoissonSurfaceReconstruction} +\cgalPkgManuals{Chapter_Poisson_Surface_Reconstruction,PkgPoissonSurfaceReconstruction3Ref} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{3.5} -\cgalPkgDependsOn{\ref PkgSolverSummary} +\cgalPkgDependsOn{\ref PkgSolverInterface} \cgalPkgBib{cgal:asg-srps} \cgalPkgLicense{\ref licensesGPL "GPL"} \cgalPkgDemo{Polyhedron demo,polyhedron_3.zip} 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 8006e0aa06b..b3bba3377a4 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 @@ -2,17 +2,13 @@ project( Poisson_surface_reconstruction_3_Examples ) -cmake_minimum_required(VERSION 2.8.11) - +cmake_minimum_required(VERSION 3.1) # Find CGAL find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - include( CGAL_CreateSingleSourceCGALProgram ) - # VisualC++ optimization for applications dealing with large data if (MSVC) # Allow Windows 32bit applications to use up to 3GB of RAM diff --git a/Poisson_surface_reconstruction_3/examples/Poisson_surface_reconstruction_3/cgal_test_with_cmake b/Poisson_surface_reconstruction_3/examples/Poisson_surface_reconstruction_3/cgal_test_with_cmake index a40dfb9baac..f95394fe687 100755 --- a/Poisson_surface_reconstruction_3/examples/Poisson_surface_reconstruction_3/cgal_test_with_cmake +++ b/Poisson_surface_reconstruction_3/examples/Poisson_surface_reconstruction_3/cgal_test_with_cmake @@ -49,7 +49,7 @@ configure() { echo "Configuring... " - if eval 'cmake --no-warn-unused-cli "$CMAKE_GENERATOR" -DRUNNING_CGAL_AUTO_TEST=TRUE \ + if eval 'cmake --no-warn-unused-cli ${INIT_FILE:+"-C${INIT_FILE}"} "$CMAKE_GENERATOR" -DRUNNING_CGAL_AUTO_TEST=TRUE \ -DCGAL_DIR="$CGAL_DIR" \ .' ; then diff --git a/Poisson_surface_reconstruction_3/include/CGAL/Poisson_reconstruction_function.h b/Poisson_surface_reconstruction_3/include/CGAL/Poisson_reconstruction_function.h index c4d72553b36..baabc5b928b 100644 --- a/Poisson_surface_reconstruction_3/include/CGAL/Poisson_reconstruction_function.h +++ b/Poisson_surface_reconstruction_3/include/CGAL/Poisson_reconstruction_function.h @@ -149,7 +149,7 @@ struct Special_wrapper_of_two_functions_keep_pointers { /*! -\ingroup PkgPoissonSurfaceReconstruction +\ingroup PkgPoissonSurfaceReconstruction3Ref \brief Implementation of the Poisson Surface Reconstruction method. diff --git a/Poisson_surface_reconstruction_3/include/CGAL/poisson_surface_reconstruction.h b/Poisson_surface_reconstruction_3/include/CGAL/poisson_surface_reconstruction.h index 3fa7f6b5fb9..85736134ff1 100644 --- a/Poisson_surface_reconstruction_3/include/CGAL/poisson_surface_reconstruction.h +++ b/Poisson_surface_reconstruction_3/include/CGAL/poisson_surface_reconstruction.h @@ -34,7 +34,7 @@ namespace CGAL { /*! - \ingroup PkgPoissonSurfaceReconstruction + \ingroup PkgPoissonSurfaceReconstruction3Ref Performs surface reconstruction as follows: 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 5f9c38fb499..877911b52d0 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 @@ -2,17 +2,13 @@ project( Poisson_surface_reconstruction_3_Tests ) -cmake_minimum_required(VERSION 2.8.11) - +cmake_minimum_required(VERSION 3.1) # Find CGAL find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - include( CGAL_CreateSingleSourceCGALProgram ) - # VisualC++ optimization for applications dealing with large data if (MSVC) # Allow Windows 32bit applications to use up to 3GB of RAM diff --git a/Poisson_surface_reconstruction_3/test/Poisson_surface_reconstruction_3/cgal_test_with_cmake b/Poisson_surface_reconstruction_3/test/Poisson_surface_reconstruction_3/cgal_test_with_cmake index 80ba7fc5820..61ad14fd1d6 100755 --- a/Poisson_surface_reconstruction_3/test/Poisson_surface_reconstruction_3/cgal_test_with_cmake +++ b/Poisson_surface_reconstruction_3/test/Poisson_surface_reconstruction_3/cgal_test_with_cmake @@ -49,7 +49,7 @@ configure() { echo "Configuring... " - if eval 'cmake --no-warn-unused-cli "$CMAKE_GENERATOR" -DRUNNING_CGAL_AUTO_TEST=TRUE \ + if eval 'cmake --no-warn-unused-cli ${INIT_FILE:+"-C${INIT_FILE}"} "$CMAKE_GENERATOR" -DRUNNING_CGAL_AUTO_TEST=TRUE \ -DCGAL_DIR="$CGAL_DIR" \ .' ; then diff --git a/Polygon/doc/Polygon/PackageDescription.txt b/Polygon/doc/Polygon/PackageDescription.txt index 84e1a8d5c77..988baca5d1d 100644 --- a/Polygon/doc/Polygon/PackageDescription.txt +++ b/Polygon/doc/Polygon/PackageDescription.txt @@ -1,20 +1,20 @@ -/// \defgroup PkgPolygon2 2D Polygon Reference +/// \defgroup PkgPolygon2Ref 2D Polygon Reference /// \defgroup PkgPolygon2Concepts Concepts -/// \ingroup PkgPolygon2 +/// \ingroup PkgPolygon2Ref /// \defgroup PkgPolygon2Functions Global Functions -/// \ingroup PkgPolygon2 +/// \ingroup PkgPolygon2Ref /*! -\addtogroup PkgPolygon2 +\addtogroup PkgPolygon2Ref -\cgalPkgDescriptionBegin{2D Polygons,PkgPolygon2Summary} +\cgalPkgDescriptionBegin{2D Polygons,PkgPolygon2} \cgalPkgPicture{polygon.png} \cgalPkgSummaryBegin \cgalPkgAuthors{Geert-Jan Giezeman and Wieger Wesselink} \cgalPkgDesc{This package provides a 2D polygon class and operations on sequences of points, like bounding box, extremal points, signed area, simplicity and convexity test, orientation, and point location. The demo includes operations on polygons, such as computing a convex partition, and the straight skeleton.} -\cgalPkgManuals{Chapter_2D_Polygon,PkgPolygon2} +\cgalPkgManuals{Chapter_2D_Polygon,PkgPolygon2Ref} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{0.9} diff --git a/Polygon/examples/Polygon/CMakeLists.txt b/Polygon/examples/Polygon/CMakeLists.txt index 19bae0815b9..af10e6bde24 100644 --- a/Polygon/examples/Polygon/CMakeLists.txt +++ b/Polygon/examples/Polygon/CMakeLists.txt @@ -4,18 +4,12 @@ project( Polygon_Examples ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Polygon/include/CGAL/General_polygon_with_holes_2.h b/Polygon/include/CGAL/General_polygon_with_holes_2.h index 3e896d71c6f..b2d07098c02 100644 --- a/Polygon/include/CGAL/General_polygon_with_holes_2.h +++ b/Polygon/include/CGAL/General_polygon_with_holes_2.h @@ -33,7 +33,7 @@ namespace CGAL { /*! -\ingroup PkgPolygon2 +\ingroup PkgPolygon2Ref The class `General_polygon_with_holes_2` models the concept `GeneralPolygonWithHoles_2`. It represents a general polygon with diff --git a/Polygon/include/CGAL/Polygon_2.h b/Polygon/include/CGAL/Polygon_2.h index 443cefca305..e3458435161 100644 --- a/Polygon/include/CGAL/Polygon_2.h +++ b/Polygon/include/CGAL/Polygon_2.h @@ -49,7 +49,7 @@ namespace CGAL { -/// \ingroup PkgPolygon2 +/// \ingroup PkgPolygon2Ref /// The class Polygon_2 implements polygons. The Polygon_2 is /// parameterized by a traits class and a container class. The latter /// can be any class that fulfills the requirements for an STL diff --git a/Polygon/include/CGAL/Polygon_with_holes_2.h b/Polygon/include/CGAL/Polygon_with_holes_2.h index 0f63f43805d..70fcb52a4ee 100644 --- a/Polygon/include/CGAL/Polygon_with_holes_2.h +++ b/Polygon/include/CGAL/Polygon_with_holes_2.h @@ -34,7 +34,7 @@ namespace CGAL { /*! -\ingroup PkgPolygon2 +\ingroup PkgPolygon2Ref The class `Polygon_with_holes_2` models the concept `GeneralPolygonWithHoles_2`. It represents a linear polygon with holes. It is parameterized with two diff --git a/Polygon/test/Polygon/CMakeLists.txt b/Polygon/test/Polygon/CMakeLists.txt index 7302bbe5e9b..bff643827c4 100644 --- a/Polygon/test/Polygon/CMakeLists.txt +++ b/Polygon/test/Polygon/CMakeLists.txt @@ -4,18 +4,12 @@ project( Polygon_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Polygon_mesh_processing/benchmark/Polygon_mesh_processing/CMakeLists.txt b/Polygon_mesh_processing/benchmark/Polygon_mesh_processing/CMakeLists.txt index 46b9c01221b..b5c986dcaf0 100644 --- a/Polygon_mesh_processing/benchmark/Polygon_mesh_processing/CMakeLists.txt +++ b/Polygon_mesh_processing/benchmark/Polygon_mesh_processing/CMakeLists.txt @@ -4,7 +4,7 @@ project( Polygon_mesh_processing ) -cmake_minimum_required(VERSION 2.6.2) +cmake_minimum_required(VERSION 3.1) if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" VERSION_GREATER 2.6) if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}" VERSION_GREATER 2.8.3) cmake_policy(VERSION 2.8.4) @@ -24,10 +24,6 @@ if ( NOT CGAL_FOUND ) endif() -# include helper file -include( ${CGAL_USE_FILE} ) - - # Boost and its components find_package( Boost REQUIRED ) @@ -42,9 +38,6 @@ endif() # include for local directory # include for local package -include_directories( BEFORE ../../include ) - - find_package(Eigen3 3.2.0) #(requires 3.2.0 or greater) if (EIGEN3_FOUND) # Executables that require Eigen 3.2 @@ -54,11 +47,8 @@ endif(EIGEN3_FOUND) # Creating entries for all .cpp/.C files with "main" routine # ########################################################## -include( CGAL_CreateSingleSourceCGALProgram ) - create_single_source_cgal_program( "polygon_mesh_slicer.cpp" ) - create_single_source_cgal_program( "hole_filling.cpp" ) diff --git a/Polygon_mesh_processing/doc/Polygon_mesh_processing/NamedParameters.txt b/Polygon_mesh_processing/doc/Polygon_mesh_processing/NamedParameters.txt index 839bd7b52ff..6176b34f75c 100644 --- a/Polygon_mesh_processing/doc/Polygon_mesh_processing/NamedParameters.txt +++ b/Polygon_mesh_processing/doc/Polygon_mesh_processing/NamedParameters.txt @@ -1,6 +1,6 @@ /*! \defgroup pmp_namedparameters Named Parameters for Polygon Mesh Processing -\ingroup PkgPolygonMeshProcessing +\ingroup PkgPolygonMeshProcessingRef In this package, all functions optional parameters are implemented as BGL optional named parameters (see \ref BGLNamedParameters for more information on how to use them). @@ -19,7 +19,7 @@ the type is more specific: predicates evaluated. Everywhere in this package, a \cgal `Kernel` fulfills the requirements.
  • -The following named parameters, offered by the package \ref PkgBGLSummary +The following named parameters, offered by the package \ref PkgBGL (see \ref bgl_namedparameters), are used in this package: \cgalNPTableBegin @@ -329,15 +329,15 @@ Parameter used in `isotropic_remeshing()` to specify an alternative vertex proje \cgalNPBegin{apply_per_connected_component} \anchor PMP_apply_per_connected_component Parameter used to indicate whether an algorithm should consider each connected component of a mesh independently.\n -\b Type : `bool` \n -\b Default value is `false` +Type: `bool` \n +Default: `false` \cgalNPEnd \cgalNPBegin{visitor} \anchor PMP_visitor Parameter used to pass a visitor class to a function. Its type and behavior depend on the visited function. \n -\b Type : `A class` \n -\b Default Specific to the function visited +Type: `A class` \n +Default: Specific to the function visited \cgalNPEnd \cgalNPBegin{throw_on_self_intersection} \anchor PMP_throw_on_self_intersection @@ -345,25 +345,48 @@ Parameter used in corefinement-related functions to make the functions throw an case some faces involved in the intersection of the input are self-intersecting and make the operation impossible with the current version of the code. \n -\b Type : `bool` \n -\b Default value is `false` +Type: `bool` \n +Default: `false` \cgalNPEnd \cgalNPBegin{clip_volume} \anchor PMP_clip_volume Parameter used in `clip()` functions to clip a volume rather than a surface. \n -\b Type : `bool` \n -\b Default value is `false` +Type: `bool` \n +Default: `false` \cgalNPEnd \cgalNPBegin{use_compact_clipper} \anchor PMP_use_compact_clipper Parameter used in `clip()` functions to indicate whether the boundary of the clipper should be considered as part of the clipping volume or not. \n -\b Type : `bool` \n -\b Default value is `true` +Type: `bool` \n +Default: `true` \cgalNPEnd +\cgalNPBegin{output_iterator} \anchor PMP_output_iterator +Parameter to pass an output iterator. +\n +\b Type : a model of `OutputIterator` \n +\b Default : `Emptyset_iterator` +\cgalNPEnd + +\cgalNPBegin{erase_all_duplicates} \anchor PMP_erase_all_duplicates +Parameter used in the function `merge_duplicate_polygons_in_polygon_soup()` to indicate, +when multiple faces are duplicates, whether all the duplicate faces should be removed +or if one (arbitrarily chosen) face should be kept. +\n +Type: `bool` \n +Default: `false` +\cgalNPEnd + +\cgalNPBegin{require_same_orientation} \anchor PMP_require_same_orientation +Parameter used in the function `merge_duplicate_polygons_in_polygon_soup()` to indicate +if orientation should matter when determining whether two faces are duplicates. +\n +Type: `bool` \n +Default: `false` +\cgalNPEnd \cgalNPTableEnd diff --git a/Polygon_mesh_processing/doc/Polygon_mesh_processing/PackageDescription.txt b/Polygon_mesh_processing/doc/Polygon_mesh_processing/PackageDescription.txt index 3baa705dad3..d9e33fd88f3 100644 --- a/Polygon_mesh_processing/doc/Polygon_mesh_processing/PackageDescription.txt +++ b/Polygon_mesh_processing/doc/Polygon_mesh_processing/PackageDescription.txt @@ -1,6 +1,6 @@ -/// \defgroup PkgPolygonMeshProcessing Polygon Mesh Processing Reference +/// \defgroup PkgPolygonMeshProcessingRef Polygon Mesh Processing Reference /// \defgroup PkgPolygonMeshProcessingConcepts Concepts -/// \ingroup PkgPolygonMeshProcessing +/// \ingroup PkgPolygonMeshProcessingRef /// \defgroup keep_connected_components_grp Connected Components /// @@ -8,60 +8,61 @@ /// of adjacent faces such that all edges between two consecutive faces of the /// path are not marked as constrained. /// -/// \ingroup PkgPolygonMeshProcessing +/// \ingroup PkgPolygonMeshProcessingRef /// \defgroup hole_filling_grp Hole Filling /// Functions to fill holes given as a range of halfedges or as range of points. -/// \ingroup PkgPolygonMeshProcessing +/// \ingroup PkgPolygonMeshProcessingRef /// \defgroup PMP_meshing_grp Meshing /// Functions to triangulate faces, and to refine and fair regions of a polygon mesh. -/// \ingroup PkgPolygonMeshProcessing +/// \ingroup PkgPolygonMeshProcessingRef /// \defgroup PMP_normal_grp Normal Computation /// Functions to compute unit normals for individual/all vertices or faces. -/// \ingroup PkgPolygonMeshProcessing +/// \ingroup PkgPolygonMeshProcessingRef /// \defgroup measure_grp Geometric Measure Functions /// Functions to compute lengths of edges and borders, areas of faces and patches, as well as volumes of closed meshes. -/// \ingroup PkgPolygonMeshProcessing +/// \ingroup PkgPolygonMeshProcessingRef /// \defgroup PMP_orientation_grp Orientation Functions /// Functions to compute or change the orientation of faces and surfaces. -/// \ingroup PkgPolygonMeshProcessing +/// \ingroup PkgPolygonMeshProcessingRef /// \defgroup PMP_intersection_grp Intersection Functions /// Functions to test if there are self intersections, and to report faces that do intersect. -/// \ingroup PkgPolygonMeshProcessing +/// \ingroup PkgPolygonMeshProcessingRef /// \defgroup PMP_repairing_grp Combinatorial Repairing -/// Functions to orient polygon soups and to stitch geometrically identical boundaries. -/// \ingroup PkgPolygonMeshProcessing +/// Functions to repair polygon soups and polygon meshes. +/// \ingroup PkgPolygonMeshProcessingRef + /// \defgroup PMP_distance_grp Distance Functions /// Functions to compute the distance between meshes, between a mesh and a point set and between a point set and a mesh. -/// \ingroup PkgPolygonMeshProcessing +/// \ingroup PkgPolygonMeshProcessingRef /// \defgroup PMP_corefinement_grp Corefinement and Boolean Operations /// Functions to corefine triangulated surface meshes and compute triangulated /// surface meshes of the union, difference and intersection /// of the bounded volumes. -/// \ingroup PkgPolygonMeshProcessing +/// \ingroup PkgPolygonMeshProcessingRef /// \defgroup PMP_detect_features_grp Feature Detection Functions /// Functions to detect sharp edges and surface patches of polygon meshes. -/// \ingroup PkgPolygonMeshProcessing +/// \ingroup PkgPolygonMeshProcessingRef /// \defgroup PMP_predicates_grp Intersection Detection Functions /// Functions to detect intersections. /// Note that those functions will be exact as long as the underlying do-intersect predicates used are exact. /// In practice, it means that the 3D point type used must come from a \cgal kernel with exact predicates. -/// \ingroup PkgPolygonMeshProcessing +/// \ingroup PkgPolygonMeshProcessingRef /*! -\addtogroup PkgPolygonMeshProcessing +\addtogroup PkgPolygonMeshProcessingRef -\cgalPkgDescriptionBegin{Polygon Mesh Processing, PkgPolygonMeshProcessingSummary} +\cgalPkgDescriptionBegin{Polygon Mesh Processing, PkgPolygonMeshProcessing} \cgalPkgPicture{hole_filling_ico.png} \cgalPkgSummaryBegin @@ -69,12 +70,12 @@ \cgalPkgDesc{This package provides a collection of methods and classes for polygon mesh processing, ranging from basic operations on simplices, to complex geometry processing algorithms.} -\cgalPkgManuals{Chapter_PolygonMeshProcessing,PkgPolygonMeshProcessing} +\cgalPkgManuals{Chapter_PolygonMeshProcessing,PkgPolygonMeshProcessingRef} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{4.7} -\cgalPkgDependsOn{documented for each function; \ref PkgSolverSummary} +\cgalPkgDependsOn{documented for each function; \ref PkgSolverInterface} \cgalPkgBib{cgal:lty-pmp} \cgalPkgLicense{\ref licensesGPL "GPL"} \cgalPkgDemo{Polyhedron demo,polyhedron_3.zip} @@ -113,19 +114,33 @@ and provides a list of the parameters that are used in this package. - `CGAL::Polygon_mesh_processing::self_intersections()` - \link PMP_predicates_grp `CGAL::Polygon_mesh_processing::do_intersect()` \endlink - `CGAL::Polygon_mesh_processing::intersecting_meshes()` +- `CGAL::Polygon_mesh_processing::is_degenerate_edge()` +- `CGAL::Polygon_mesh_processing::degenerate_edges()` +- `CGAL::Polygon_mesh_processing::is_degenerate_triangle_face()` +- `CGAL::Polygon_mesh_processing::degenerate_faces()` +- `CGAL::Polygon_mesh_processing::is_needle_triangle_face()` +- `CGAL::Polygon_mesh_processing::is_cap_triangle_face()` ## Orientation Functions ## -- `CGAL::Polygon_mesh_processing::is_outward_oriented()` -- `CGAL::Polygon_mesh_processing::reverse_face_orientations()` - `CGAL::Polygon_mesh_processing::orient_polygon_soup()` - `CGAL::Polygon_mesh_processing::orient()` - `CGAL::Polygon_mesh_processing::orient_to_bound_a_volume()` +- `CGAL::Polygon_mesh_processing::is_outward_oriented()` +- `CGAL::Polygon_mesh_processing::reverse_face_orientations()` ## Combinatorial Repairing Functions ## -- \link PMP_repairing_grp `CGAL::Polygon_mesh_processing::stitch_borders()` \endlink +- `CGAL::Polygon_mesh_processing::merge_duplicate_points_in_polygon_soup()` +- `CGAL::Polygon_mesh_processing::merge_duplicate_polygons_in_polygon_soup()` +- `CGAL::Polygon_mesh_processing::remove_isolated_points_in_polygon_soup()` +- `CGAL::Polygon_mesh_processing::repair_polygon_soup()` +- `CGAL::Polygon_mesh_processing::stitch_borders()` - `CGAL::Polygon_mesh_processing::is_polygon_soup_a_polygon_mesh()` - `CGAL::Polygon_mesh_processing::polygon_soup_to_polygon_mesh()` - `CGAL::Polygon_mesh_processing::remove_isolated_vertices()` +- `CGAL::Polygon_mesh_processing::is_non_manifold_vertex()` +- `CGAL::Polygon_mesh_processing::duplicate_non_manifold_vertices()` +- `CGAL::Polygon_mesh_processing::merge_duplicated_vertices_in_boundary_cycle()` +- `CGAL::Polygon_mesh_processing::merge_duplicated_vertices_in_boundary_cycles()` ## Normal Computation Functions ## - `CGAL::Polygon_mesh_processing::compute_face_normal()` @@ -171,6 +186,9 @@ and provides a list of the parameters that are used in this package. - `CGAL::Polygon_mesh_processing::detect_sharp_edges()` - `CGAL::Polygon_mesh_processing::detect_vertex_incident_patches()` +## Collision Detection +- `CGAL::Rigid_triangle_mesh_collision_detection` + ## Miscellaneous ## - `CGAL::Polygon_mesh_slicer` - `CGAL::Side_of_triangle_mesh` @@ -179,6 +197,7 @@ and provides a list of the parameters that are used in this package. - `CGAL::Polygon_mesh_processing::edge_bbox()` - `CGAL::Polygon_mesh_processing::face_bbox()` - `CGAL::Polygon_mesh_processing::border_halfedges()` +- `CGAL::Polygon_mesh_processing::extract_boundary_cycles()` - `CGAL::Polygon_mesh_processing::transform()` */ diff --git a/Polygon_mesh_processing/doc/Polygon_mesh_processing/Polygon_mesh_processing.txt b/Polygon_mesh_processing/doc/Polygon_mesh_processing/Polygon_mesh_processing.txt index 55a15ab5be5..004aad17948 100644 --- a/Polygon_mesh_processing/doc/Polygon_mesh_processing/Polygon_mesh_processing.txt +++ b/Polygon_mesh_processing/doc/Polygon_mesh_processing/Polygon_mesh_processing.txt @@ -27,7 +27,7 @@ A polygon mesh can have any number of connected components, and also some self-i In this package, a polygon mesh is considered to have the topology of a 2-manifold. \subsection PMPAPI API -This package follows the BGL API described in \ref PkgBGLSummary. +This package follows the BGL API described in \ref PkgBGL. It can thus be used either with `Polyhedron_3`, `Surface_mesh`, or any class model of the concept `FaceGraph`. Each function or class of this package details the requirements on the input polygon mesh. @@ -43,14 +43,14 @@ meshes, refinement, optimization by fairing, and isotropic remeshing of triangul - \ref Coref_section : methods to corefine triangle meshes and to compute boolean operations out of corefined closed triangle meshes. - \ref PMPHoleFilling : available hole filling algorithms, which can possibly be combined with refinement and fairing. -- \ref PMPPredicates : predicates that can be evaluated on the processed polygon +- \ref PMPPredicates : predicates that can be evaluated on the processed polygon. mesh, which includes point location and self intersection tests. -- \ref PMPOrientation : checking or fixing the \ref PMPOrientation of a polygon soup. -- \ref PMPRepairing : reparation of polygon meshes and polygon soups. +- \ref PMPOrientation : checking or fixing the orientation of a polygon soup. +- \ref PMPRepairing : repair of polygon meshes and polygon soups. - \ref PMPNormalComp : normal computation at vertices and on faces of a polygon mesh. - \ref PMPSlicer : functor able to compute the intersections of a polygon mesh with arbitrary planes (slicer). - \ref PMPConnectedComponents : methods to deal with connected - components of a polygon mesh (extraction, marks, removal, ...) + components of a polygon mesh (extraction, marks, removal, ...). **************************************** \section PMPMeshing Meshing @@ -229,7 +229,7 @@ centered in the output volume is a topological ball. At the surface level this m that no non-manifold vertex or edge is allowed in the output. For example, it is not possible to compute the union of two cubes that are disjoint but sharing an edge. In case you have to deal with such scenarios, you should consider using the -package \ref PkgNef3Summary. +package \ref PkgNef3. It is possible to update the input so that it contains the result (in-place operation). In that case the whole mesh will not be copied and only the region around the @@ -309,7 +309,7 @@ This package provides an algorithm for filling one closed hole that is either in or defined by a sequence of points that describe a polyline. The main steps of the algorithm are described in \cgalCite{liepa2003filling} and can be summarized as follows. -First, the largest patch triangulating the boundary of the hole is generated without introducing any new vertex. +First, the largest patch triangulating the boundary of the hole is generated without introducing any new vertex. The patch is selected so as to minimize a quality function evaluated for all possible triangular patches. The quality function first minimizes the worst dihedral angle between patch triangles, then the total surface area of the patch as a tiebreaker. @@ -335,10 +335,10 @@ From left to right: (a) the hole, \subsection HoleFillingAPI API This package provides four functions for hole filling: - - `triangulate_hole_polyline()` : given a sequence of points defining the hole, triangulates the hole. - - `triangulate_hole()` : given a border halfedge on the boundary of the hole on a mesh, triangulates the hole. - - `triangulate_and_refine_hole()` : in addition to `triangulate_hole()` the generated patch is refined. - - `triangulate_refine_and_fair_hole()` : in addition to `triangulate_and_refine_hole()` the generated patch is also faired. + - `triangulate_hole_polyline()` : given a sequence of points defining the hole, triangulates the hole. + - `triangulate_hole()` : given a border halfedge on the boundary of the hole on a mesh, triangulates the hole. + - `triangulate_and_refine_hole()` : in addition to `triangulate_hole()` the generated patch is refined. + - `triangulate_refine_and_fair_hole()` : in addition to `triangulate_and_refine_hole()` the generated patch is also faired. \subsection HFExamples Examples @@ -372,51 +372,65 @@ iteratively filled, refined and faired to get a faired mesh with no hole. The hole filling algorithm has a complexity which depends on the number of vertices. While \cgalCite{liepa2003filling} has a running time of \f$ O(n^3)\f$ , \cgalCite{zou2013algorithm} in most cases has -running time of \f$ O(n \log n)\f$. We were running -`triangulate_refine_and_fair_hole()` for the below meshes (and two -more meshes with smaller holes). The machine used is a PC running -Windows 10 with an Intel Core i7 CPU clocked at 2.70 GHz. -The program has been compiled with Visual C++ 2013 compiler with the O2 -option which maximizes speed. +running time of \f$ O(n \log n)\f$. We benchmarked the function +`triangulate_refine_and_fair_hole()` for the two meshes below (as well as two +more meshes with smaller holes). The machine used was a PC running +Windows 10 with an Intel Core i7 CPU clocked at 2.70 GHz. +The program was compiled with the Visual C++ 2013 compiler with the O2 +option, which maximizes speed. \cgalFigureBegin{Elephants, elephants-with-holes.png} The elephant on the left/right has a hole with 963/7657 vertices. \cgalFigureEnd -This takes time +The following running times were observed: +
    | # vertices | without Delaunay (sec.) | with Delaunay (sec.)| -| ----: | ----: | ----: | +| ----: | ----: | ----: | 565 | 8.5 | 0.03 | 774 | 21 | 0.035 | 967 | 43 | 0.06 | 7657 | na | 0.4 | - +
    *************************************** \section PMPPredicates Predicates This packages provides several predicates to be evaluated with respect to a triangle mesh. -\subsection PMPSelIntersections Self Intersections +\subsection PMPDoIntersect Intersections Detection +Intersection tests between triangle meshes and/or polylines can be done using +\link PMP_predicates_grp `CGAL::Polygon_mesh_processing::do_intersect()` \endlink. +Additionally, the function `CGAL::Polygon_mesh_processing::intersecting_meshes()` +records all pairs of intersecting meshes in a range. -Self intersections can be detected from a triangle mesh, by calling the predicate +\subsubsection PMPSelIntersections Self Intersections + +Self intersections within a triangle mesh can be detected by calling the function `CGAL::Polygon_mesh_processing::does_self_intersect()`. Additionally, the function `CGAL::Polygon_mesh_processing::self_intersections()` reports all pairs of intersecting triangles. -\cgalFigureBegin{SelfIntersections, selfintersections.jpg} -Detecting self-intersections on a triangle mesh. -The intersecting triangles are displayed in dark grey on the right image. -\cgalFigureEnd - \subsubsection SIExample Self Intersections Example + +The following example illustrates the detection of self intersection in the `pig.off` mesh. +The detected self-intersection is illustrated on Figure \cgalFigureRef{SelfIntersections}. + \cgalExample{Polygon_mesh_processing/self_intersections_example.cpp} +\cgalFigureAnchor{SelfIntersections} +
    + +
    +\cgalFigureCaptionBegin{SelfIntersections} +Detecting self-intersections on a triangle mesh. +The intersecting triangles are displayed in dark grey and red on the right image. +\cgalFigureCaptionEnd \subsection PMPInsideTest Side of Triangle Mesh -The class `CGAL::Side_of_triangle_mesh` provides a functor that tests whether a query point is +The class `CGAL::Side_of_triangle_mesh` provides a functor that tests whether a query point is inside, outside, or on the boundary of the domain bounded by a given closed triangle mesh. A point is said to be on the bounded side of the domain bounded by the input triangle mesh @@ -435,40 +449,102 @@ input triangle mesh. \subsubsection InsideExample Inside Test Example \cgalExample{Polygon_mesh_processing/point_inside_example.cpp} -\subsection PMPDoIntersect Intersections Detection -Intersection tests between triangle meshes and/or polylines can be done using -\link PMP_predicates_grp `CGAL::Polygon_mesh_processing::do_intersect()` \endlink. -Additionally, the function `CGAL::Polygon_mesh_processing::intersecting_meshes()` -records all pairs of intersecting meshes in a range. +\subsection PMPShapePredicates Shape Predicates + +Badly shaped or, even worse, completely degenerate elements of a polygon mesh are problematic +in many algorithms which one might want to use on the mesh. +This package offers a toolkit of functions to detect such undesirable elements. +- `CGAL::Polygon_mesh_processing::is_degenerate_edge()`, to detect if an edge is degenerate + (that is, if its two vertices share the same geometric location). +- `CGAL::Polygon_mesh_processing::is_degenerate_triangle_face()`, to detect if a face is + degenerate (that is, if its three vertices are collinear). +- `CGAL::Polygon_mesh_processing::degenerate_edges()`, to collect degenerate edges within a range of edges. +- `CGAL::Polygon_mesh_processing::degenerate_faces()`, to collect degenerate faces within a range of faces. +- `CGAL::Polygon_mesh_processing::is_cap_triangle_face()` +- `CGAL::Polygon_mesh_processing::is_needle_triangle_face()` **************************************** \section PMPOrientation Orientation +This package offers multiple functions to compute consistent face orientations for set of faces +(Section \ref PolygonSoups) and polygon meshes (Section \ref OrientingPolygonMeshes). +Section \ref PolygonSoupExample offers an example of combination of these functions. + +\subsection PolygonSoups Polygon Soups + +When the faces of a polygon mesh are given but the connectivity is unknown, +this set of faces is called a \e polygon \e soup. + +Before running any of the algorithms on a polygon soup, +one should ensure that the polygons are consistently oriented. +To do so, this package provides the function +`CGAL::Polygon_mesh_processing::orient_polygon_soup()`, +described in \cgalCite{gueziec2001cutting}. + +To deal with polygon soups that cannot be converted to a +combinatorially manifold surface, some points must be duplicated. +Because a polygon soup does not have any connectivity (each point +has as many occurences as the number of polygons it belongs to), +duplicating one point (or a pair of points) +amounts to duplicating the polygon to which it belongs. +The duplicated points are either an endpoint of an edge incident to more +than two polygons, an endpoint of an edge between +two polygons with incompatible orientations (during the re-orientation process), +or more generally a point \a p at which the intersection +of an infinitesimally small ball centered at \a p +with the polygons incident to it is not a topological disk. + +Once the polygon soup is consistently oriented, +with possibly duplicated (or more) points, +the connectivity can be recovered and made consistent +to build a valid polygon mesh. +The function `CGAL::Polygon_mesh_processing::polygon_soup_to_polygon_mesh()` +performs this mesh construction step. + +\subsection OrientingPolygonMeshes Polygon Meshes + This package provides functions dealing with the orientation of faces in a closed polygon mesh. -The function `CGAL::Polygon_mesh_processing::is_outward_oriented()` checks whether +- The function `CGAL::Polygon_mesh_processing::orient()` makes each connected component +of a closed polygon mesh outward- or inward-oriented. +- The function `CGAL::Polygon_mesh_processing::orient_to_bound_a_volume()` orients +the connected components of a closed polygon mesh so that it bounds a volume +(see \ref coref_def_subsec for the precise definition). +- The function `CGAL::Polygon_mesh_processing::is_outward_oriented()` checks whether an oriented polygon mesh is oriented such that the normals to all faces are oriented towards the outside of the domain bounded by the input polygon mesh. - -The function -`CGAL::Polygon_mesh_processing::reverse_face_orientations()` reverses the orientation +- The function `CGAL::Polygon_mesh_processing::reverse_face_orientations()` reverses the orientation of halfedges around faces. As a consequence, the normal computed for each face (see Section \ref PMPNormalComp) is also reversed. -The \ref PolygonSoupExample puts these functions at work on a polygon soup. +\subsection PolygonSoupExample Orientation Example -The function `CGAL::Polygon_mesh_processing::orient()` makes each connected component -of a closed polygon mesh outward or inward oriented. - -The function `CGAL::Polygon_mesh_processing::orient_to_bound_a_volume()` orients -the connected components of a closed polygon mesh so that it bounds a volume -(see \ref coref_def_subsec for the precise definition). +This example shows how to generate a mesh from a polygon soup. +The first step is to get a soup of consistently oriented faces, before +rebuilding the connectivity. +In this example, some orientation tests are performed on the output +polygon mesh to illustrate +Section \ref PMPOrientation. +\cgalExample{Polygon_mesh_processing/orient_polygon_soup_example.cpp} **************************************** -\section PMPRepairing Combinatorial Repairing +\section PMPRepairing Combinatorial Repairing + ******************* +\subsection PSRepairing Polygon Soup Repairing +To ensure that a polygon soup can be oriented (see Section \ref PolygonSoups) and transformed +into a workable polygon mesh, it might be necessary to preprocess the data to remove combinatorial +and geometrical errors. This package offers the following functions: +- `CGAL::Polygon_mesh_processing::merge_duplicate_points_in_polygon_soup()`, +- `CGAL::Polygon_mesh_processing::merge_duplicate_polygons_in_polygon_soup()`, +- `CGAL::Polygon_mesh_processing::remove_isolated_points_in_polygon_soup()`, + +as well as the function `CGAL::Polygon_mesh_processing::repair_polygon_soup()`, +which bundles the previous functions and an additional handful of repairing techniques +to obtain an as-clean-as-possible polygon soup. + \subsection Stitching It happens that a polygon mesh has several edges and vertices that are duplicated. @@ -490,16 +566,14 @@ with duplicated border edges. \cgalExample{Polygon_mesh_processing/stitch_borders_example.cpp} -******************* -\cond +\if READY_TO_PUBLISH + \subsection DegenerateFaces Removing Degenerate Faces Some degenerate faces may be part of a given triangle mesh. A face is considered \e degenerate if two of its vertices -share the same location, -or in general if its three vertices are collinear. -The function -`CGAL::Polygon_mesh_processing::remove_degenerate_faces()` +share the same location, or more generally if its three vertices are collinear. +The function `CGAL::Polygon_mesh_processing::remove_degenerate_faces()` removes those faces and fixes the connectivity of the newly cleaned up mesh. It is also possible to remove isolated vertices from any polygon mesh, using the function `CGAL::Polygon_mesh_processing::remove_isolated_vertices()`. @@ -511,54 +585,36 @@ are removed, the connectivity is fixed, and the number of removed faces is output. \cgalExample{Polygon_mesh_processing/remove_degeneracies_example.cpp} -\endcond +\endif -******************* -\subsection PolygonSoups Polygon Soups +\subsection PMPManifoldness Polygon Mesh Manifoldness +This package offers repairing methods to clean ill-formed polygon soups, +see Section \ref PMPRepairing. -When the faces of a polygon mesh are given but the connectivity is unknown, -we must deal with of a \e polygon \e soup. +Non-manifold vertices can be detected using the function `CGAL::Polygon_mesh_processing::is_non_manifold_vertex()`. +The function `CGAL::Polygon_mesh_processing::duplicate_non_manifold_vertices()` can be used +to attempt to create a combinatorially manifold surface mesh by splitting any non-manifold vertex +into as many vertices as there are manifold sheets at this geometric position. +Note however that the mesh will still not be manifold from a geometric +point of view, as the positions of the new vertices introduced at a non-manifold vertex are identical +to the input non-manifold vertex. -Before running any of the algorithms on the so-called -polygon soup, one should ensure that the polygons are consistently oriented. -To do so, this package provides the function -`CGAL::Polygon_mesh_processing::orient_polygon_soup()`, -described in \cgalCite{gueziec2001cutting}. +\subsubsection FixNMVerticeExample Manifoldness Repair Example -To deal with polygon soups that cannot be converted to a -combinatorial manifold surface, some points are duplicated. -Because a polygon soup does not have any connectivity (each point -has as many occurrences as the number of polygons it belongs to), -duplicating one point (or a pair of points) -amounts to duplicate the polygon to which it belongs. +In the following example, a non-manifold configuration is artifically created and +fixed with the help of the functions described above. -The duplicated points are either an endpoint of an edge incident to more -than two polygons, an endpoint of an edge between -two polygons with incompatible orientations (during the re-orientation process), -or more generally a point \a p at which the intersection -of an infinitesimally small ball centered at \a p -with the polygons incident to it is not a topological disk. - -Once the polygon soup is consistently oriented, -with possibly duplicated (or more) points, -the connectivity can be recovered and made consistent -to build a valid polygon mesh. -The function `CGAL::Polygon_mesh_processing::polygon_soup_to_polygon_mesh()` -performs this mesh construction step. - - -\subsubsection PolygonSoupExample Polygon Soup Example - -This example shows how to generate a mesh from a polygon soup. -The first step is to get a soup of consistently oriented faces, before -rebuilding the connectivity. -In this example, some orientation tests are performed on the output -polygon mesh to illustrate -Section \ref PMPOrientation. - -\cgalExample{Polygon_mesh_processing/polygon_soup_example.cpp} +\cgalExample{Polygon_mesh_processing/manifoldness_repair_example.cpp} +\subsection PMPDuplicateVertexBoundaryCycle Duplicated Vertices in Boundary Cycles +Similarly to the problematic configuration described in the previous section, another issue that can be present +in a polygon mesh is the occurrence of a "pinched" hole, that is the configuration where, when +starting from a border halfedge and walking the halfedges of this border, a geometric position appears +more than once (although, with different vertices) before reaching the initial border halfedge again. The functions +`CGAL::Polygon_mesh_processing::merge_duplicated_vertices_in_boundary_cycle()` and +`CGAL::Polygon_mesh_processing::merge_duplicated_vertices_in_boundary_cycle()`, which merge +vertices at identical positions, can be used to repair this configuration. **************************************** \section PMPNormalComp Computing Normals @@ -570,7 +626,7 @@ These computations are performed with : - `CGAL::Polygon_mesh_processing::compute_face_normal()` - `CGAL::Polygon_mesh_processing::compute_vertex_normal()` -We further provide functions to compute all the normals to faces, +Furthermore, we provide functions to compute all the normals to faces, or to vertices, or to both : - `CGAL::Polygon_mesh_processing::compute_face_normals()` - `CGAL::Polygon_mesh_processing::compute_vertex_normals()` @@ -578,14 +634,12 @@ or to vertices, or to both : Property maps are used to record the computed normals. - \subsection NormalsExample Normals Computation Examples -Property maps are an API introduced in the boost library, that allows to +Property maps are an API introduced in the boost library that allows to associate values to keys. In the following examples we associate a normal vector to each vertex and to each face. - \subsubsection NormalsExampleSM Normals Computation for a Surface Mesh The following example illustrates how to @@ -711,7 +765,7 @@ In the following example, a mesh is isotropically remeshed and the approximate d \subsection PoissonDistanceExample Max Distance Between Point Set and Surface Example In \ref Poisson_surface_reconstruction_3/poisson_reconstruction_example.cpp, a triangulated surface mesh is constructed from a point set using the -\link PkgPoissonSurfaceReconstructionSummary Poisson reconstruction algorithm \endlink, +\link PkgPoissonSurfaceReconstruction3 Poisson reconstruction algorithm \endlink, and the distance between the point set and the reconstructed surface is computed with the following code: @@ -729,7 +783,7 @@ that respectively detect the sharp edges, compute the patch indices, and give ea \subsection DetectFeaturesExample Feature Detection Example In the following example, we count how many edges of `pmesh` are incident to two faces -which normals form an angle smaller than 90 degrees, +whose normals form an angle smaller than 90 degrees, and the number of surface patches that are separated by these edges. \cgalExample{Polygon_mesh_processing/detect_features_example.cpp} diff --git a/Polygon_mesh_processing/doc/Polygon_mesh_processing/examples.txt b/Polygon_mesh_processing/doc/Polygon_mesh_processing/examples.txt index 2811a37ecef..f5aa23b864b 100644 --- a/Polygon_mesh_processing/doc/Polygon_mesh_processing/examples.txt +++ b/Polygon_mesh_processing/doc/Polygon_mesh_processing/examples.txt @@ -8,7 +8,7 @@ \example Polygon_mesh_processing/triangulate_faces_example.cpp \example Polygon_mesh_processing/connected_components_example.cpp \example Polygon_mesh_processing/face_filtered_graph_example.cpp -\example Polygon_mesh_processing/polygon_soup_example.cpp +\example Polygon_mesh_processing/orient_polygon_soup_example.cpp \example Polygon_mesh_processing/triangulate_polyline_example.cpp \example Polygon_mesh_processing/refine_fair_example.cpp \example Polygon_mesh_processing/mesh_slicer_example.cpp @@ -21,4 +21,6 @@ \example Polygon_mesh_processing/corefinement_mesh_union_and_intersection.cpp \example Polygon_mesh_processing/corefinement_consecutive_bool_op.cpp \example Polygon_mesh_processing/detect_features_example.cpp +\example Polygon_mesh_processing/manifoldness_repair_example.cpp +\example Polygon_mesh_processing/repair_polygon_soup_example.cpp */ diff --git a/Polygon_mesh_processing/doc/Polygon_mesh_processing/fig/selfintersections.jpg b/Polygon_mesh_processing/doc/Polygon_mesh_processing/fig/selfintersections.jpg index 7504ff7b865..ffc0bc0cfc2 100644 Binary files a/Polygon_mesh_processing/doc/Polygon_mesh_processing/fig/selfintersections.jpg and b/Polygon_mesh_processing/doc/Polygon_mesh_processing/fig/selfintersections.jpg differ diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/CMakeLists.txt b/Polygon_mesh_processing/examples/Polygon_mesh_processing/CMakeLists.txt index ed6a9a6e8f9..2f853f6cbe6 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/CMakeLists.txt +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/CMakeLists.txt @@ -4,7 +4,7 @@ project( Polygon_mesh_processing_Examples ) -cmake_minimum_required(VERSION 2.6.2) +cmake_minimum_required(VERSION 3.1) if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" VERSION_GREATER 2.6) if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}" VERSION_GREATER 2.8.3) cmake_policy(VERSION 2.8.4) @@ -24,10 +24,6 @@ if ( NOT CGAL_FOUND ) endif() -# include helper file -include( ${CGAL_USE_FILE} ) - - # Boost and its components find_package( Boost REQUIRED ) @@ -51,16 +47,12 @@ endif() # include for local directory # include for local package -include_directories( BEFORE ../../include ) - find_package(Eigen3 3.2.0) #(requires 3.2.0 or greater) # Creating entries for all .cpp/.C files with "main" routine # ########################################################## -include( CGAL_CreateSingleSourceCGALProgram ) - find_package( TBB ) create_single_source_cgal_program( "hausdorff_distance_remeshing_example.cpp") if( TBB_FOUND ) @@ -86,7 +78,7 @@ create_single_source_cgal_program( "point_inside_example.cpp") create_single_source_cgal_program( "triangulate_faces_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( "polygon_soup_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") @@ -104,6 +96,8 @@ create_single_source_cgal_program( "random_perturbation_SM_example.cpp" ) create_single_source_cgal_program( "corefinement_LCC.cpp") create_single_source_cgal_program( "hole_filling_example_LCC.cpp" ) create_single_source_cgal_program( "detect_features_example.cpp" ) +create_single_source_cgal_program( "manifoldness_repair_example.cpp" ) +create_single_source_cgal_program( "repair_polygon_soup_example.cpp" ) if(OpenMesh_FOUND) create_single_source_cgal_program( "compute_normals_example_OM.cpp" ) diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/manifoldness_repair_example.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/manifoldness_repair_example.cpp new file mode 100644 index 00000000000..64c3a91cab6 --- /dev/null +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/manifoldness_repair_example.cpp @@ -0,0 +1,82 @@ +#include + +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + +namespace PMP = CGAL::Polygon_mesh_processing; +namespace NP = CGAL::parameters; + +typedef CGAL::Exact_predicates_inexact_constructions_kernel K; +typedef CGAL::Surface_mesh Mesh; + +typedef boost::graph_traits::vertex_descriptor vertex_descriptor; +typedef boost::graph_traits::halfedge_descriptor halfedge_descriptor; + +void merge_vertices(vertex_descriptor v_keep, vertex_descriptor v_rm, Mesh& mesh) +{ + std::cout << "merging vertices " << v_keep << " and " << v_rm << std::endl; + + BOOST_FOREACH(halfedge_descriptor h, CGAL::halfedges_around_target(v_rm, mesh)){ + set_target(h, v_keep, mesh); // to ensure that no halfedge points at the deleted vertex + } + + remove_vertex(v_rm, mesh); +} + +int main(int argc, char* argv[]) +{ + const char* filename = (argc > 1) ? argv[1] : "data/blobby.off"; + std::ifstream input(filename); + + Mesh mesh; + if(!input || !(input >> mesh) || num_vertices(mesh) == 0) + { + std::cerr << filename << " is not a valid off file.\n"; + return EXIT_FAILURE; + } + + // Artificially create non-manifoldness for the sake of the example by merging some vertices + vertex_descriptor v0 = *(vertices(mesh).begin()); + vertex_descriptor v1 = *(--(vertices(mesh).end())); + merge_vertices(v0, v1, mesh); + + // Count non manifold vertices + int counter = 0; + BOOST_FOREACH(vertex_descriptor v, vertices(mesh)) + { + if(PMP::is_non_manifold_vertex(v, mesh)) + { + std::cout << "vertex " << v << " is non-manifold" << std::endl; + ++counter; + } + } + + std::cout << counter << " non-manifold occurrence(s)" << std::endl; + + // Fix manifoldness by splitting non-manifold vertices + std::vector > duplicated_vertices; + std::size_t new_vertices_nb = PMP::duplicate_non_manifold_vertices(mesh, + NP::output_iterator( + std::back_inserter(duplicated_vertices))); + + std::cout << new_vertices_nb << " vertices have been added to fix mesh manifoldness" << std::endl; + + for(std::size_t i=0; i + #include -#include +#include + #include #include #include +#include + #include #include #include -typedef CGAL::Exact_predicates_inexact_constructions_kernel K; -typedef CGAL::Polyhedron_3 Polyhedron; +typedef CGAL::Exact_predicates_inexact_constructions_kernel K; +typedef CGAL::Polyhedron_3 Polyhedron; int main(int argc, char* argv[]) { const char* filename = (argc > 1) ? argv[1] : "data/tet-shuffled.off"; std::ifstream input(filename); - if (!input) + std::vector points; + std::vector > polygons; + + if(!input || !CGAL::read_OFF(input, points, polygons) || points.empty()) { std::cerr << "Cannot open file " << std::endl; - return 1; - } - - std::vector points; - std::vector< std::vector > polygons; - if (!CGAL::read_OFF(input, points, polygons)) - { - std::cerr << "Error parsing the OFF file " << std::endl; - return 1; + return EXIT_FAILURE; } CGAL::Polygon_mesh_processing::orient_polygon_soup(points, polygons); @@ -36,8 +35,13 @@ int main(int argc, char* argv[]) Polyhedron mesh; CGAL::Polygon_mesh_processing::polygon_soup_to_polygon_mesh(points, polygons, mesh); - if (CGAL::is_closed(mesh) && (!CGAL::Polygon_mesh_processing::is_outward_oriented(mesh))) - CGAL::Polygon_mesh_processing::reverse_face_orientations(mesh); + // Number the faces because 'orient_to_bound_a_volume' needs a face <--> index map + int index = 0; + for(Polyhedron::Face_iterator fb=mesh.facets_begin(), fe=mesh.facets_end(); fb!=fe; ++fb) + fb->id() = index++; + + if(CGAL::is_closed(mesh)) + CGAL::Polygon_mesh_processing::orient_to_bound_a_volume(mesh); std::ofstream out("tet-oriented1.off"); out << mesh; @@ -48,5 +52,5 @@ int main(int argc, char* argv[]) out2 << mesh; out2.close(); - return 0; + return EXIT_SUCCESS; } diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/repair_polygon_soup_example.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/repair_polygon_soup_example.cpp new file mode 100644 index 00000000000..e44be56106e --- /dev/null +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/repair_polygon_soup_example.cpp @@ -0,0 +1,82 @@ +#include +#include + +#include +#include +#include + +#include +#include + +typedef CGAL::Exact_predicates_inexact_constructions_kernel K; +typedef K::Point_3 Point_3; + +typedef std::vector Polygon; +typedef CGAL::Surface_mesh Mesh; + +namespace PMP = CGAL::Polygon_mesh_processing; + +int main(int, char**) +{ + // First, construct a polygon soup with some problems + std::vector points; + std::vector polygons; + + points.push_back(Point_3(0,0,0)); + points.push_back(Point_3(1,0,0)); + points.push_back(Point_3(0,1,0)); + points.push_back(Point_3(-1,0,0)); + points.push_back(Point_3(0,-1,0)); + points.push_back(Point_3(0,1,0)); // duplicate point + points.push_back(Point_3(0,-2,0)); // unused point + + Polygon p; + p.push_back(0); p.push_back(1); p.push_back(2); + polygons.push_back(p); + + // degenerate face + p.clear(); + p.push_back(0); p.push_back(0); p.push_back(0); + polygons.push_back(p); + + p.clear(); + p.push_back(0); p.push_back(1); p.push_back(4); + polygons.push_back(p); + + // duplicate face with different orientation + p.clear(); + p.push_back(0); p.push_back(4); p.push_back(1); + polygons.push_back(p); + + p.clear(); + p.push_back(0); p.push_back(3); p.push_back(5); + polygons.push_back(p); + + // degenerate face + p.clear(); + p.push_back(0); p.push_back(3); p.push_back(0); + polygons.push_back(p); + + p.clear(); + p.push_back(0); p.push_back(3); p.push_back(4); + polygons.push_back(p); + + // pinched and degenerate face + p.clear(); + p.push_back(0); p.push_back(1); p.push_back(2); p.push_back(3); + p.push_back(4); p.push_back(3); p.push_back(2); p.push_back(1); + polygons.push_back(p); + + PMP::repair_polygon_soup(points, polygons); + PMP::orient_polygon_soup(points, polygons); + + Mesh mesh; + PMP::polygon_soup_to_polygon_mesh(points, polygons, mesh); + + std::cout << "Mesh has " << num_vertices(mesh) << " vertices and " << num_faces(mesh) << " faces" << std::endl; + + assert(num_vertices(mesh) == 5); + assert(num_faces(mesh) == 4); + + return 0; +} diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h index 0c73a8655dd..c3207e9acbb 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h @@ -39,7 +39,7 @@ namespace CGAL { namespace Polygon_mesh_processing { /*! - * \ingroup PkgPolygonMeshProcessing + * \ingroup PkgPolygonMeshProcessingRef * computes a bounding box of a polygon mesh. * * @tparam PolygonMesh a model of `HalfedgeListGraph` @@ -88,7 +88,7 @@ namespace CGAL { } /*! - * \ingroup PkgPolygonMeshProcessing + * \ingroup PkgPolygonMeshProcessingRef * computes a bounding box of a vertex of a polygon mesh. * * @tparam PolygonMesh a model of `HalfedgeGraph` @@ -131,7 +131,7 @@ namespace CGAL { } /*! - * \ingroup PkgPolygonMeshProcessing + * \ingroup PkgPolygonMeshProcessingRef * computes a bounding box of an edge of a polygon mesh. * * @tparam PolygonMesh a model of `HalfedgeGraph` @@ -175,7 +175,7 @@ namespace CGAL { } /*! - * \ingroup PkgPolygonMeshProcessing + * \ingroup PkgPolygonMeshProcessingRef * computes a bounding box of a face of a polygon mesh. * * @tparam PolygonMesh a model of `HalfedgeGraph` @@ -257,7 +257,7 @@ namespace CGAL { // deprecated function #ifndef CGAL_NO_DEPRECATED_CODE /*! - * \ingroup PkgPolygonMeshProcessing + * \ingroup PkgPolygonMeshProcessingRef * \deprecated This function is deprecated since \cgal 4.10, `CGAL::Polygon_mesh_processing::bbox()` should be used instead. */ template diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/border.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/border.h index 6c30cb6d077..1c6d870c28f 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/border.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/border.h @@ -24,16 +24,16 @@ #include +#include +#include +#include +#include #include #include #include #include -#include -#include -#include - #include namespace CGAL{ @@ -147,7 +147,7 @@ namespace Polygon_mesh_processing { }//end namespace internal /*! - \ingroup PkgPolygonMeshProcessing + \ingroup PkgPolygonMeshProcessingRef * collects the border halfedges of a surface patch defined as a face range. * For each returned halfedge `h`, `opposite(h, pmesh)` belongs to a face of the patch, * but `face(h, pmesh)` does not belong to the patch. @@ -257,6 +257,38 @@ namespace Polygon_mesh_processing { return border_counter; } + + /// @ingroup PkgPolygonMeshProcessing + /// extracts boundary cycles as a list of halfedges, with one halfedge per border. + /// + /// @tparam PolygonMesh a model of `HalfedgeListGraph` + /// @tparam OutputIterator a model of `OutputIterator` holding objects of type + /// `boost::graph_traits::%halfedge_descriptor` + /// + /// @param pm a polygon mesh + /// @param out an output iterator where the border halfedges will be put + /// + /// @todo It could make sense to also return the length of each cycle. + /// @todo It should probably go into BGL package (like the rest of this file). + template + OutputIterator extract_boundary_cycles(PolygonMesh& pm, + OutputIterator out) + { + typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; + + boost::unordered_set hedge_handled; + BOOST_FOREACH(halfedge_descriptor h, halfedges(pm)) + { + if(is_border(h, pm) && hedge_handled.insert(h).second) + { + *out++ = h; + BOOST_FOREACH(halfedge_descriptor h2, halfedges_around_face(h, pm)) + hedge_handled.insert(h2); + } + } + return out; + } + } // end of namespace Polygon_mesh_processing } // end of namespace CGAL diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/clip.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/clip.h index d33dde326a2..1c2ac748d32 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/clip.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/clip.h @@ -29,6 +29,7 @@ #include #include #include +#include #include @@ -37,132 +38,6 @@ namespace Polygon_mesh_processing { namespace internal { -template -bool -clip_open_impl( TriangleMesh& tm, - TriangleMesh& clipper, - const NamedParameters1& np_tm, - const NamedParameters2& np_c) -{ - typedef typename GetVertexPointMap::type Vpm; - typedef typename GetGeomTraits::type GeomTraits; - typedef boost::graph_traits GT; - typedef typename GT::halfedge_descriptor halfedge_descriptor; - typedef typename GT::face_descriptor face_descriptor; - -// First build an AABB-tree of the clipper triangles as it will be modified - typedef std::vector Clipper_triangles; - typedef typename Clipper_triangles::iterator Tr_iterator; - typedef CGAL::AABB_triangle_primitive Primitive; - typedef CGAL::AABB_traits AABB_triangle_traits; - typedef CGAL::AABB_tree Clipper_tree; - - // vector of clipper triangles - Clipper_triangles clipper_triangles; - clipper_triangles.reserve( num_faces(clipper) ); - Vpm vpm_c = boost::choose_param(boost::get_param(np_c, internal_np::vertex_point), - get_property_map(vertex_point, clipper)); - BOOST_FOREACH(face_descriptor f, faces(clipper)) - { - halfedge_descriptor h = halfedge(f, clipper); - clipper_triangles.push_back( typename GeomTraits::Triangle_3( - get(vpm_c, source(h, clipper)), - get(vpm_c, target(h, clipper)), - get(vpm_c, target(next(h, clipper), clipper)) ) ); - } - // tree - Clipper_tree clipper_tree(clipper_triangles.begin(), clipper_triangles.end()); - // predicate functor - Side_of_triangle_mesh side_of(clipper_tree); - -// Second corefine the meshes - typedef CGAL::dynamic_edge_property_t Ecm_tag; - typedef typename boost::property_map::type Ecm; - Ecm ecm = get(Ecm_tag(), tm); - - corefine(tm, clipper, np_tm.edge_is_constrained_map(ecm), np_c); - -// Extract connected components - typedef typename GetFaceIndexMap::type Fid_map; - - Fid_map fid_map = boost::choose_param(boost::get_param(np_tm, internal_np::face_index), - get_property_map(boost::face_index, tm)); - Vpm vpm1 = boost::choose_param(boost::get_param(np_tm, internal_np::vertex_point), - get_property_map(vertex_point, tm)); - - typedef CGAL::dynamic_vertex_property_t Vid_tag; - typedef typename boost::property_map::type Vid_map; - Vid_map vid_map = get(Vid_tag(), tm); - - // init indices if needed - helpers::init_face_indices(tm, fid_map); - helpers::init_vertex_indices(tm, vid_map); - - // set the connected component id of each face - std::vector face_cc(num_faces(tm), std::size_t(-1)); - std::size_t nb_cc = - connected_components(tm, - bind_property_maps(fid_map, make_property_map(face_cc)), - parameters::face_index_map(fid_map). - edge_is_constrained_map(ecm)); - - - boost::dynamic_bitset<> cc_not_handled(nb_cc); - cc_not_handled.set(); - std::vector ccs_to_remove; - - BOOST_FOREACH(face_descriptor f, faces(tm)) - { - std::size_t cc_id = face_cc[ get(fid_map, f) ]; - if ( !cc_not_handled.test(cc_id) ) continue; - - halfedge_descriptor h=halfedge(f, tm); - for(int i=0;i<3;++i) - { - // look for a vertex not on a constrained edge - bool no_marked_edge=true; - BOOST_FOREACH(halfedge_descriptor h2, halfedges_around_target(h, tm)) - if ( get(ecm, edge(h2, tm)) ){ - no_marked_edge=false; - break; - } - if (no_marked_edge){ - if ( side_of( get(vpm1, target(h, tm) ) ) == ON_UNBOUNDED_SIDE ) - ccs_to_remove.push_back(cc_id); - cc_not_handled.reset(cc_id); - break; - } - h=next(h, tm); - } - if (!cc_not_handled.any()) break; - } - - if (cc_not_handled.any()) - { - // A patch without no vertex incident to a non-constrained edges - // is a coplanar patch: drop it or keep it! - if (!boost::choose_param(boost::get_param(np_tm, internal_np::use_compact_clipper), true)) - { - for (std::size_t cc_id = cc_not_handled.find_first(); - cc_id < cc_not_handled.npos; - cc_id = cc_not_handled.find_next(cc_id)) - { - ccs_to_remove.push_back(cc_id); - } - } - } -// Filter out the cc - remove_connected_components(tm, - ccs_to_remove, - bind_property_maps(fid_map, make_property_map(face_cc)), - parameters::vertex_index_map(vid_map)); - - return true; -} template int @@ -414,7 +289,7 @@ clip_to_bbox(const Plane_3& plane, * \cgalParamEnd * \cgalParamBegin{face_index_map} a property map containing the index of each face of `tm` (`clipper`). * Note that if the property map is writable, the indices of the faces - * of `tm` and `clipper` will be set after the refining `tm` with the intersection with `plane`. + * of `tm` and `clipper` will be set after refining `tm` with the intersection with `clipper`. * \cgalParamEnd * \cgalParamBegin{visitor} a class model of `PMPCorefinementVisitor` * that is used to track the creation of new faces. @@ -445,13 +320,14 @@ clip( TriangleMesh& tm, const NamedParameters1& np_tm, const NamedParameters2& np_c) { - const bool close = + const bool clip_volume = boost::choose_param(boost::get_param(np_tm, internal_np::clip_volume), false); - if (close && is_closed(tm)) + if (clip_volume && is_closed(tm)) return corefine_and_compute_intersection(tm, clipper, tm, np_tm, np_c); - - return internal::clip_open_impl(tm, clipper, np_tm, np_c); + return corefine_and_compute_intersection(tm, clipper, tm, + np_tm.use_bool_op_to_clip_surface(true), + np_c); } namespace internal{ @@ -530,14 +406,13 @@ bool clip( TriangleMesh& tm, CGAL::Bbox_3 bbox = ::CGAL::Polygon_mesh_processing::bbox(tm); //extend the bbox a bit to avoid border cases - double xd=(bbox.xmax()-bbox.xmin())/100; - double yd=(bbox.ymax()-bbox.ymin())/100; - double zd=(bbox.zmax()-bbox.zmin())/100; + double xd=(std::max)(1.,(bbox.xmax()-bbox.xmin())/100); + double yd=(std::max)(1.,(bbox.ymax()-bbox.ymin())/100); + double zd=(std::max)(1.,(bbox.zmax()-bbox.zmin())/100); bbox=CGAL::Bbox_3(bbox.xmin()-xd, bbox.ymin()-yd, bbox.zmin()-zd, bbox.xmax()+xd, bbox.ymax()+yd, bbox.zmax()+zd); TriangleMesh clipper; Oriented_side os = internal::clip_to_bbox(plane, bbox, clipper, parameters::all_default()); - switch(os) { case ON_NEGATIVE_SIDE: diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/connected_components.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/connected_components.h index c72b3d54d98..df4a7fd80ab 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/connected_components.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/connected_components.h @@ -277,7 +277,7 @@ void keep_connected_components(PolygonMesh& pmesh * * \param pmesh the polygon mesh * \param nb_components_to_keep the number of components to be kept - * \param np optional \ref pmp_namedparameters "Named Parameters" described below + * \param np optional \ref pmp_namedparameters "Named Parameters", amongst those described below * * \cgalNamedParamsBegin * \cgalParamBegin{edge_is_constrained_map} a property map containing the constrained-or-not status of each edge of `pmesh` \cgalParamEnd @@ -360,7 +360,7 @@ std::size_t keep_largest_connected_components(PolygonMesh& pmesh, * * \param pmesh the polygon mesh * \param threshold_components_to_keep the number of faces a component must have so that it is kept - * \param np optional \ref pmp_namedparameters "Named Parameters" described below + * \param np optional \ref pmp_namedparameters "Named Parameters", amongst those described below * * \cgalNamedParamsBegin * \cgalParamBegin{edge_is_constrained_map} a property map containing the constrained-or-not status of each edge of `pmesh` \cgalParamEnd @@ -664,7 +664,7 @@ void remove_connected_components(PolygonMesh& pmesh * * \param components_to_remove a face range, including one face or more on each component to be removed * \param pmesh the polygon mesh -* \param np optional \ref pmp_namedparameters "Named Parameters" described below +* \param np optional \ref pmp_namedparameters "Named Parameters", amongst those described below * * \cgalNamedParamsBegin * \cgalParamBegin{edge_is_constrained_map} a property map containing the constrained-or-not status of each edge of `pmesh` \cgalParamEnd @@ -722,7 +722,7 @@ void remove_connected_components(PolygonMesh& pmesh * * \param pmesh the polygon mesh * \param components_to_keep a face range, including one face or more on each component to be kept -* \param np optional \ref pmp_namedparameters "Named Parameters" described below +* \param np optional \ref pmp_namedparameters "Named Parameters", amongst those described below * * \cgalNamedParamsBegin * \cgalParamBegin{edge_is_constrained_map} a property map containing the constrained-or-not status of each edge of `pmesh` \cgalParamEnd diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/corefinement.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/corefinement.h index 1f7383346ed..0dcfea83909 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/corefinement.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/corefinement.h @@ -428,7 +428,6 @@ corefine_and_compute_boolean_operations( *(*output[Corefinement::INTERSECTION]), parameters::vertex_point_map(vpm1), parameters::vertex_point_map(*cpp11::get(vpm_out_tuple))); - if (output[Corefinement::TM1_MINUS_TM2] != boost::none) if (&tm1 == *output[Corefinement::TM1_MINUS_TM2]) @@ -512,6 +511,20 @@ corefine_and_compute_boolean_operations( Ob ob(tm1, tm2, vpm1, vpm2, fid_map1, fid_map2, ecm_in, vpm_out_tuple, ecms_out, uv, output); + // special case used for clipping open meshes + if ( boost::choose_param( boost::get_param(np1, internal_np::use_bool_op_to_clip_surface), + false) ) + { + CGAL_assertion(output[Corefinement::INTERSECTION] != boost::none); + CGAL_assertion(output[Corefinement::UNION] == boost::none); + CGAL_assertion(output[Corefinement::TM1_MINUS_TM2] == boost::none); + CGAL_assertion(output[Corefinement::TM2_MINUS_TM1] == boost::none); + const bool use_compact_clipper = + boost::choose_param( boost::get_param(np1, internal_np::use_compact_clipper), + true); + ob.setup_for_clipping_a_surface(use_compact_clipper); + } + Corefinement::Intersection_of_triangle_meshes functor(tm1, tm2, vpm1, vpm2, Algo_visitor(uv,ob,ecm_in)); functor(CGAL::Emptyset_iterator(), throw_on_self_intersection, true); diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/detect_features.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/detect_features.h index f4f7827c191..8fa0ea22c95 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/detect_features.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/detect_features.h @@ -97,14 +97,16 @@ template typename PatchIdMapWrapper::value_type get(PatchIdMapWrapper& map, Handle_type h) { - return get(map.map, h) - map.offset; + typedef typename PatchIdMapWrapper::value_type value_type; + return value_type(get(map.map, h) - map.offset); } template void put(PatchIdMapWrapper& map, Handle_type h, typename PatchIdMapWrapper::value_type pid) { - put(map.map, h, pid + map.offset); + typedef typename PatchIdMapWrapper::value_type value_type; + put(map.map, h, value_type(pid + map.offset)); } @@ -127,14 +129,14 @@ template typename PatchIdMapWrapper >::value_type get(PatchIdMapWrapper >& map, Handle_type h) { - return get(map.map, h).first - map.offset; + return Int(get(map.map, h).first - map.offset); } template void put(PatchIdMapWrapper >& map, Handle_type h, typename PatchIdMapWrapper >::value_type pid) { - put(map.map, h, std::pair(pid+map.offset, 0)); + put(map.map, h, std::pair(Int(pid+map.offset), 0)); } template + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +namespace CGAL { + +template +class Traversal_traits_with_transformation_helper +{ + Bbox_3 + compute_transformed_bbox_impl(const CGAL::Aff_transformation_3& at, + const Bbox_3& bbox, + bool has_rotation, + /*SUPPORTS_ROTATION*/ Tag_true) const + { + CGAL_expensive_assertion(FPU_get_cw() == CGAL_FE_UPWARD); + + if(!has_rotation) + return compute_transformed_bbox_impl(at, bbox, has_rotation, Tag_false()); + + typedef Simple_cartesian AK; + typedef Cartesian_converter C2F; + C2F c2f; + + AK::Aff_transformation_3 a_at = c2f(at); + + AK::FT xtrm[6] = { c2f(bbox.min(0)), c2f(bbox.max(0)), + c2f(bbox.min(1)), c2f(bbox.max(1)), + c2f(bbox.min(2)), c2f(bbox.max(2)) }; + + typename AK::Point_3 ps[8]; + ps[0] = a_at( AK::Point_3(xtrm[0], xtrm[2], xtrm[4]) ); + ps[1] = a_at( AK::Point_3(xtrm[0], xtrm[2], xtrm[5]) ); + ps[2] = a_at( AK::Point_3(xtrm[0], xtrm[3], xtrm[4]) ); + ps[3] = a_at( AK::Point_3(xtrm[0], xtrm[3], xtrm[5]) ); + + ps[4] = a_at( AK::Point_3(xtrm[1], xtrm[2], xtrm[4]) ); + ps[5] = a_at( AK::Point_3(xtrm[1], xtrm[2], xtrm[5]) ); + ps[6] = a_at( AK::Point_3(xtrm[1], xtrm[3], xtrm[4]) ); + ps[7] = a_at( AK::Point_3(xtrm[1], xtrm[3], xtrm[5]) ); + + return bbox_3(ps, ps+8); + } + + Bbox_3 + compute_transformed_bbox_impl(const CGAL::Aff_transformation_3& at, + const Bbox_3& bbox, + bool, + /*SUPPORTS_ROTATION*/ Tag_false) const + { + CGAL_expensive_assertion(FPU_get_cw() == CGAL_FE_UPWARD); + + typedef Simple_cartesian AK; + typedef Cartesian_converter C2F; + C2F c2f; + + AK::Aff_transformation_3 a_at = c2f(at); + + AK::FT xtrm[6] = { c2f(bbox.min(0)), c2f(bbox.max(0)), + c2f(bbox.min(1)), c2f(bbox.max(1)), + c2f(bbox.min(2)), c2f(bbox.max(2)) }; + + typename AK::Point_3 ps[2]; + ps[0] = a_at( AK::Point_3(xtrm[0], xtrm[2], xtrm[4]) ); + ps[1] = a_at( AK::Point_3(xtrm[1], xtrm[3], xtrm[5]) ); + + return bbox_3(ps, ps+2); + } + +public: + + bool has_rotation(const CGAL::Aff_transformation_3& at) const + { + return ( at.m(0,1) != 0 || at.m(0,2) != 0 || at.m(1,0) != 0 + || at.m(1,2) != 0 || at.m(2,0) != 0 || at.m(2,1) !=0); + } + + Bbox_3 + compute_transformed_bbox(const CGAL::Aff_transformation_3& at, + const Bbox_3& bbox, + bool has_rotation) const + { + return compute_transformed_bbox_impl(at, bbox, has_rotation, SUPPORTS_ROTATION()); + } +}; + +// traversal traits for a tree vs a primitive +template +class Do_intersect_traversal_traits_with_transformation + : public Traversal_traits_with_transformation_helper +{ + typedef typename AABBTraits::Primitive Primitive; + typedef ::CGAL::AABB_node Node; + typedef Traversal_traits_with_transformation_helper Base; + + void register_transformation(CGAL::Tag_true) + { + m_has_rotation = this->has_rotation(m_transfo); + } + + void register_transformation(CGAL::Tag_false) + {} + +public: + Do_intersect_traversal_traits_with_transformation(): + m_traits_ptr(NULL) + {} + + Do_intersect_traversal_traits_with_transformation(const AABBTraits& traits) + : m_is_found(false), m_traits_ptr(&traits), m_has_rotation(false) + {} + + bool go_further() const { return !m_is_found; } + + template + void intersection(const Query& query, const Primitive& primitive) + { + if( CGAL::do_intersect(query, + internal::Primitive_helper::get_datum(primitive, *m_traits_ptr).transform(m_transfo)) ) + m_is_found = true; + } + + template + bool do_intersect(const Query& query, const Node& node) const + { + return m_traits_ptr->do_intersect_object()(query, compute_transformed_bbox(node.bbox())); + } + + bool is_intersection_found() const { return m_is_found; } + + void reset() + { + m_is_found = false; + } + + const Aff_transformation_3& + transformation() const + { + return m_transfo; + } + + void set_transformation(const Aff_transformation_3& transfo) + { + m_transfo = transfo; + register_transformation(SUPPORTS_ROTATION()); + } + + Bbox_3 + compute_transformed_bbox(const Bbox_3& bbox) const + { + return Base::compute_transformed_bbox(m_transfo, bbox, m_has_rotation); + } + + // helper for Point_inside_vertical_ray_cast + class Transformed_tree_helper + { + typedef AABB_tree Tree; + typedef CGAL::AABB_node Node; + typedef Do_intersect_traversal_traits_with_transformation Traversal_traits; + + Traversal_traits m_tt; + + public: + + Transformed_tree_helper(const Traversal_traits& tt) + : m_tt(tt) + {} + + Bbox_3 get_tree_bbox(const AABB_tree& tree) const + { + return m_tt.compute_transformed_bbox(tree.bbox()); + } + + typename AABBTraits::Primitive::Datum + get_primitive_datum(const typename AABBTraits::Primitive& primitive, const AABBTraits& traits) const + { + return internal::Primitive_helper::get_datum(primitive, traits).transform(m_tt.transformation()); + } + + Bbox_3 get_node_bbox(const Node& node) const + { + return m_tt.compute_transformed_bbox(node.bbox()); + } + }; + + Transformed_tree_helper get_helper() const + { + return Transformed_tree_helper(*this); + } + +private: + bool m_is_found; + const AABBTraits* m_traits_ptr; + Aff_transformation_3 m_transfo; + bool m_has_rotation; +}; + + +// traversal traits for a tree +template +class Do_intersect_traversal_traits_for_two_trees + : public Traversal_traits_with_transformation_helper +{ + typedef typename AABBTraits::Primitive Primitive; + typedef ::CGAL::AABB_node Node; + typedef Traversal_traits_with_transformation_helper Base; + typedef Do_intersect_traversal_traits_with_transformation Query_traversal_traits; + + void register_transformation(CGAL::Tag_true) + { + m_has_rotation = this->has_rotation(m_transfo); + } + + void register_transformation(CGAL::Tag_false) + {} + + Bbox_3 + compute_transformed_bbox(const Bbox_3& bbox) const + { + return Base::compute_transformed_bbox(m_transfo, bbox, m_has_rotation); + } + +public: + Do_intersect_traversal_traits_for_two_trees(const AABBTraits& traits, + const Aff_transformation_3& transfo, + const Query_traversal_traits& query_traversal_traits) + : m_is_found(false) + , m_traits(traits) + , m_transfo(transfo) + , m_has_rotation(false) + , m_query_traversal_traits(query_traversal_traits) + + { + register_transformation(SUPPORTS_ROTATION()); + } + + bool go_further() const { return !m_is_found; } + + void intersection(const AABB_tree& query, const Primitive& primitive) + { + query.traversal( internal::Primitive_helper::get_datum(primitive,m_traits).transform(m_transfo), m_query_traversal_traits ); + m_is_found = m_query_traversal_traits.is_intersection_found(); + m_query_traversal_traits.reset(); + } + + bool do_intersect(const AABB_tree& query, const Node& node) + { + query.traversal( compute_transformed_bbox(node.bbox()), m_query_traversal_traits ); + bool res = m_query_traversal_traits.is_intersection_found(); + m_query_traversal_traits.reset(); + return res; + } + + bool is_intersection_found() const { return m_is_found; } + +private: + bool m_is_found; + const AABBTraits& m_traits; + const Aff_transformation_3& m_transfo; + bool m_has_rotation; + Do_intersect_traversal_traits_with_transformation m_query_traversal_traits; +}; + +}//end CGAL + +#endif //CGAL_AABB_AABB_do_intersect_transform_traits_H diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/Face_graph_output_builder.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/Face_graph_output_builder.h index 6fe903aa52b..5913eb21694 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/Face_graph_output_builder.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/Face_graph_output_builder.h @@ -159,6 +159,8 @@ class Face_graph_output_builder } }; Mesh_to_intersection_edges mesh_to_intersection_edges; + bool used_to_clip_a_surface; + bool use_compact_clipper; typename An_edge_per_polyline_map::iterator last_polyline; @@ -369,12 +371,20 @@ public: , requested_output(requested_output) , is_tm1_closed( is_closed(tm1)) , is_tm2_closed( is_closed(tm2)) - , is_tm1_inside_out( is_tm1_closed && !PMP::is_outward_oriented(tm1) ) - , is_tm2_inside_out( is_tm2_closed && !PMP::is_outward_oriented(tm2) ) + , is_tm1_inside_out( is_tm1_closed && !PMP::is_outward_oriented(tm1, parameters::vertex_point_map(vpm1)) ) + , is_tm2_inside_out( is_tm2_closed && !PMP::is_outward_oriented(tm2, parameters::vertex_point_map(vpm2)) ) , NID((std::numeric_limits::max)()) , mesh_to_intersection_edges(tm1, tm2) + , used_to_clip_a_surface(false) + , use_compact_clipper(false) {} + void setup_for_clipping_a_surface(bool ucc) + { + used_to_clip_a_surface = true; + use_compact_clipper = ucc; + } + bool union_is_valid() const { return !impossible_operation[UNION]; @@ -652,15 +662,21 @@ public: else { //Nothing allowed - impossible_operation.set(); - return; + if (!used_to_clip_a_surface) + { + impossible_operation.set(); + return; + } } } else { //Ambiguous, we can do nothing - impossible_operation.set(); - return; + if (!used_to_clip_a_surface) + { + impossible_operation.set(); + return; + } } } else @@ -872,7 +888,8 @@ public: // opposite( poly_first U poly_second ) = {O} is_patch_inside_tm2.set(patch_id_p1); is_patch_inside_tm2.set(patch_id_p2); - impossible_operation.set(INTERSECTION); // tm1 n tm2 is non-manifold + if (!used_to_clip_a_surface) + impossible_operation.set(INTERSECTION); // tm1 n tm2 is non-manifold } } else @@ -885,8 +902,11 @@ public: if ( is_dangling_edge(ids.first, ids.second, h1, tm1, is_node_of_degree_one) || is_dangling_edge(ids.first, ids.second, h2, tm2, is_node_of_degree_one) ) { - impossible_operation.set(); - return; + if (!used_to_clip_a_surface) + { + impossible_operation.set(); + return; + } } is_patch_inside_tm2.set(patch_id_p2); } @@ -903,8 +923,11 @@ public: if ( is_dangling_edge(ids.first, ids.second, h1, tm1, is_node_of_degree_one) || is_dangling_edge(ids.first, ids.second, h2, tm2, is_node_of_degree_one) ) { - impossible_operation.set(); - return; + if (!used_to_clip_a_surface) + { + impossible_operation.set(); + return; + } } is_patch_inside_tm1.set(patch_id_q2); is_patch_inside_tm2.set(patch_id_p1); @@ -1002,6 +1025,8 @@ public: } } + if (used_to_clip_a_surface) patch_status_not_set_tm2.reset(); + if ( patch_status_not_set_tm2.any() ) { CGAL::Bounded_side in_tm1 = is_tm1_inside_out @@ -1155,6 +1180,18 @@ public: patches_of_tm1_used[INTERSECTION] |= coplanar_patches_of_tm1_for_union_and_intersection; } } + // handle special cases for clipping case + if (used_to_clip_a_surface) + { + if (coplanar_patches_of_tm1.any()) + { + if (use_compact_clipper) + patches_of_tm1_used[INTERSECTION] |= coplanar_patches_of_tm1; + else + patches_of_tm1_used[INTERSECTION] -= coplanar_patches_of_tm1; + } + patches_of_tm2_used[INTERSECTION].reset(); + } /// handle the bitset for P-Q if ( !impossible_operation.test(TM1_MINUS_TM2) && requested_output[TM1_MINUS_TM2] ) @@ -1190,7 +1227,6 @@ public: } } - #ifdef CGAL_COREFINEMENT_DEBUG std::cout << "patches_of_tm1_used[UNION] " << patches_of_tm1_used[UNION] << "\n"; std::cout << "patches_of_tm2_used[UNION] " << patches_of_tm2_used[UNION] << "\n"; diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/remesh_impl.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/remesh_impl.h index bfbe181b40e..7dd14e43a7d 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/remesh_impl.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/remesh_impl.h @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -90,21 +91,6 @@ namespace internal { }; // A property map - template - struct No_constraint_pmap - { - public: - typedef Descriptor key_type; - typedef bool value_type; - typedef value_type& reference; - typedef boost::read_write_property_map_tag category; - - friend bool get(const No_constraint_pmap& , const key_type& ) { - return false; - } - friend void put(No_constraint_pmap& , const key_type& , const bool ) {} - }; - template struct Border_constraint_pmap { @@ -325,6 +311,7 @@ namespace internal { public: Incremental_remesher(PolygonMesh& pmesh , VertexPointMap& vpmap + , const GeomTraits& gt , const bool protect_constraints , EdgeIsConstrainedMap ecmap , VertexIsConstrainedMap vcmap @@ -333,6 +320,7 @@ namespace internal { , const bool build_tree = true)//built by the remesher : mesh_(pmesh) , vpmap_(vpmap) + , gt_(gt) , build_tree_(build_tree) , has_border_(false) , input_triangles_() @@ -364,9 +352,10 @@ namespace internal { BOOST_FOREACH(face_descriptor f, face_range) { - if (is_degenerate_triangle_face(halfedge(f,mesh_),mesh_,vpmap_,GeomTraits())){ + if(is_degenerate_triangle_face(f, mesh_, parameters::vertex_point_map(vpmap_) + .geom_traits(gt_))) continue; - } + Patch_id pid = get_patch_id(f); input_triangles_.push_back(triangle(f)); input_patch_ids_.push_back(pid); @@ -694,25 +683,35 @@ namespace internal { vertex_descriptor va = source(he, mesh_); vertex_descriptor vb = target(he, mesh_); - bool is_va_constrained = is_constrained(va) || is_on_patch_border(va); - bool is_vb_constrained = is_constrained(vb) || is_on_patch_border(vb); - + bool is_va_constrained = is_constrained(va) || is_corner(va); + bool is_vb_constrained = is_constrained(vb) || is_corner(vb); // do not collapse edge with two constrained vertices if (is_va_constrained && is_vb_constrained) continue; bool can_swap = !is_vb_constrained; - if (is_va_constrained) + + //do not collapse an edge connecting two different constrained polylines + if (is_va_constrained && is_vb_constrained && !is_on_patch_border(he)) + continue; + + bool is_va_on_constrained_polyline = is_on_patch_border(va); + bool is_vb_on_constrained_polyline = is_on_patch_border(vb); + + // swap if vb is not constrained and va is constrained or the only vertex on a constrained polyline + if (can_swap && (is_va_constrained || (is_va_on_constrained_polyline && !is_vb_on_constrained_polyline))) { he = opposite(he, mesh_); e=edge(he, mesh_); std::swap(va, vb); + // no need to swap is_vX_on_constrained_polyline and is_vX_constrained can_swap=false; } if(!collapse_does_not_invert_face(he)) { if (can_swap//if swap allowed (no constrained vertices) + && (!is_vb_on_constrained_polyline || is_va_on_constrained_polyline) && collapse_does_not_invert_face(opposite(he, mesh_))) { he = opposite(he, mesh_); @@ -786,7 +785,8 @@ namespace internal { ++nb_collapses; //fix constrained case - CGAL_assertion((is_constrained(vkept) || is_on_patch_border(vb)) == (is_va_constrained || is_vb_constrained)); + CGAL_assertion((is_constrained(vkept) || is_corner(vkept) || is_on_patch_border(vkept)) == + (is_va_constrained || is_vb_constrained || is_va_on_constrained_polyline || is_vb_on_constrained_polyline)); fix_degenerate_faces(vkept, short_edges, sq_low, collapse_constraints); #ifdef CGAL_PMP_REMESHING_DEBUG @@ -817,7 +817,8 @@ namespace internal { debug_status_map(); debug_self_intersections(); CGAL_assertion(0 == PMP::remove_degenerate_faces(mesh_, - PMP::parameters::vertex_point_map(vpmap_).geom_traits(GeomTraits()))); + parameters::vertex_point_map(vpmap_) + .geom_traits(gt_))); #endif } @@ -922,7 +923,7 @@ namespace internal { debug_status_map(); CGAL_assertion(0 == PMP::remove_degenerate_faces(mesh_ , PMP::parameters::vertex_point_map(vpmap_) - .geom_traits(GeomTraits()))); + .geom_traits(gt_))); debug_self_intersections(); #endif @@ -964,9 +965,9 @@ namespace internal { else if (is_on_patch(v)) { - Vector_3 vn = PMP::compute_vertex_normal(v, mesh_ - , PMP::parameters::vertex_point_map(vpmap_) - .geom_traits(GeomTraits())); + Vector_3 vn = PMP::compute_vertex_normal(v, mesh_, + parameters::vertex_point_map(vpmap_) + .geom_traits(gt_)); put(propmap_normals, v, vn); Vector_3 move = CGAL::NULL_VECTOR; @@ -1458,20 +1459,8 @@ private: if (f == boost::graph_traits::null_face()) return CGAL::NULL_VECTOR; - halfedge_descriptor hd = halfedge(f, mesh_); - typename boost::property_traits::reference - p = get(vpmap_, target(hd, mesh_)); - hd = next(hd,mesh_); - typename boost::property_traits::reference - q = get(vpmap_, target(hd, mesh_)); - hd = next(hd,mesh_); - typename boost::property_traits::reference - r =get(vpmap_, target(hd, mesh_)); - - if (GeomTraits().collinear_3_object()(p,q,r)) - return CGAL::NULL_VECTOR; - else - return PMP::compute_face_normal(f, mesh_, parameters::vertex_point_map(vpmap_)); + return PMP::compute_face_normal(f, mesh_, parameters::vertex_point_map(vpmap_) + .geom_traits(gt_)); } template @@ -1513,7 +1502,7 @@ private: // update status using constrained edge map if (!boost::is_same >::value) + Constant_property_map >::value) { BOOST_FOREACH(edge_descriptor e, edges(mesh_)) { @@ -1587,27 +1576,31 @@ private: const bool collapse_constraints) { CGAL_assertion_code(std::size_t nb_done = 0); + boost::unordered_set degenerate_faces; BOOST_FOREACH(halfedge_descriptor h, halfedges_around_target(halfedge(v, mesh_), mesh_)) { - if (is_border(h, mesh_)) - continue; - if (is_degenerate_triangle_face(h, mesh_, vpmap_, GeomTraits())) + if(!is_border(h, mesh_) && + is_degenerate_triangle_face(face(h, mesh_), mesh_, + parameters::vertex_point_map(vpmap_) + .geom_traits(gt_))) degenerate_faces.insert(h); } + while(!degenerate_faces.empty()) { halfedge_descriptor h = *(degenerate_faces.begin()); degenerate_faces.erase(degenerate_faces.begin()); - if (!is_degenerate_triangle_face(h, mesh_, vpmap_, GeomTraits())) + if (!is_degenerate_triangle_face(face(h, mesh_), mesh_, + parameters::vertex_point_map(vpmap_) + .geom_traits(gt_))) //this can happen when flipping h has consequences further in the mesh continue; //check that opposite is not also degenerate - if (degenerate_faces.find(opposite(h, mesh_)) != degenerate_faces.end()) - degenerate_faces.erase(opposite(h, mesh_)); + degenerate_faces.erase(opposite(h, mesh_)); if(is_border(h, mesh_)) continue; @@ -1653,11 +1646,15 @@ private: short_edges.insert(typename Bimap::value_type(hf, sqlen)); } - if (!is_border(hf, mesh_) - && is_degenerate_triangle_face(hf, mesh_, vpmap_, GeomTraits())) + if(!is_border(hf, mesh_) && + is_degenerate_triangle_face(face(hf, mesh_), mesh_, + parameters::vertex_point_map(vpmap_) + .geom_traits(gt_))) degenerate_faces.insert(hf); - if (!is_border(hfo, mesh_) - && is_degenerate_triangle_face(hfo, mesh_, vpmap_, GeomTraits())) + if(!is_border(hfo, mesh_) && + is_degenerate_triangle_face(face(hfo, mesh_), mesh_, + parameters::vertex_point_map(vpmap_) + .geom_traits(gt_))) degenerate_faces.insert(hfo); break; @@ -1674,9 +1671,10 @@ private: BOOST_FOREACH(halfedge_descriptor h, halfedges_around_target(he, mesh_)) { - if (is_border(h, mesh_)) - continue; - if (is_degenerate_triangle_face(h, mesh_, vpmap_, GeomTraits())) + if(!is_border(h, mesh_) && + is_degenerate_triangle_face(face(h, mesh_), mesh_, + parameters::vertex_point_map(vpmap_) + .geom_traits(gt_))) return true; } return false; @@ -1817,10 +1815,10 @@ private: { std::cout << "Test self intersections..."; std::vector > facets; - PMP::self_intersections( - mesh_, - std::back_inserter(facets), - PMP::parameters::vertex_point_map(vpmap_)); + PMP::self_intersections(mesh_, + std::back_inserter(facets), + PMP::parameters::vertex_point_map(vpmap_) + .geom_traits(gt_)); //CGAL_assertion(facets.empty()); std::cout << "done ("<< facets.size() <<" facets)." << std::endl; } @@ -1829,11 +1827,11 @@ private: { std::cout << "Test self intersections..."; std::vector > facets; - PMP::self_intersections( - faces_around_target(halfedge(v, mesh_), mesh_), - mesh_, - std::back_inserter(facets), - PMP::parameters::vertex_point_map(vpmap_)); + PMP::self_intersections(faces_around_target(halfedge(v, mesh_), mesh_), + mesh_, + std::back_inserter(facets), + PMP::parameters::vertex_point_map(vpmap_) + .geom_traits(gt_)); //CGAL_assertion(facets.empty()); std::cout << "done ("<< facets.size() <<" facets)." << std::endl; } @@ -1859,7 +1857,6 @@ private: if (n == CGAL::NULL_VECTOR) //for degenerate faces continue; Patch_id pid = get_patch_id(face(hd, mesh_)); - normals_per_patch.insert(std::make_pair(pid, n)); } @@ -1916,6 +1913,7 @@ private: private: PolygonMesh& mesh_; VertexPointMap& vpmap_; + const GeomTraits& gt_; bool build_tree_; bool has_border_; std::vector trees; diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Side_of_triangle_mesh/Point_inside_vertical_ray_cast.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Side_of_triangle_mesh/Point_inside_vertical_ray_cast.h index 5ce1ae97897..2bb77654b4b 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Side_of_triangle_mesh/Point_inside_vertical_ray_cast.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Side_of_triangle_mesh/Point_inside_vertical_ray_cast.h @@ -36,9 +36,32 @@ namespace CGAL { namespace internal { +template +struct Default_tree_helper +{ + typedef typename AABBTree::AABB_traits AABB_traits; + typedef typename CGAL::AABB_node Node; + + Bbox_3 get_tree_bbox(const AABBTree& tree) const + { + return tree.bbox(); + } + + typename AABBTree::Primitive::Datum + get_primitive_datum(const typename AABBTree::Primitive& primitive, const AABB_traits& traits) const + { + return internal::Primitive_helper::get_datum(primitive, traits); + } + + Bbox_3 get_node_bbox(const Node& node) const + { + return node.bbox(); + } +}; + // internal class for point inside test, using existing AABB tree -template -class Point_inside_vertical_ray_cast +template > +class Point_inside_vertical_ray_cast { typedef typename Kernel::Point_3 Point; typedef typename Kernel::Ray_3 Ray; @@ -46,14 +69,20 @@ class Point_inside_vertical_ray_cast static const unsigned int seed = 1340818006; + Helper m_helper; + public: + Point_inside_vertical_ray_cast(const Helper& h = Helper()) + : m_helper(h) + {} + Bounded_side operator()( const Point& point, const AABBTree& tree, typename Kernel::Construct_ray_3 ray_functor = Kernel().construct_ray_3_object(), typename Kernel::Construct_vector_3 vector_functor = Kernel().construct_vector_3_object() ) const { - const typename Traits::Bounding_box& bbox = tree.bbox(); + typename Traits::Bounding_box bbox = m_helper.get_tree_bbox(tree); if( point.x() < bbox.xmin() || point.x() > bbox.xmax() || point.y() < bbox.ymin() || point.y() > bbox.ymax() @@ -64,7 +93,7 @@ public: //the direction of the vertical ray depends on the position of the point in the bbox //in order to limit the expected number of nodes visited. - Ray query = ray_functor(point, vector_functor(0,0,(2*point.z() < tree.bbox().zmax()+tree.bbox().zmin()?-1:1))); + Ray query = ray_functor(point, vector_functor(0,0,(2*point.z() < bbox.zmax()+bbox.zmin()?-1:1))); boost::optional res = is_inside_ray_tree_traversal(query, tree); if(res == boost::none) @@ -88,8 +117,8 @@ private: std::pair status( boost::logic::tribool(boost::logic::indeterminate), 0); - Ray_3_Triangle_3_traversal_traits > - traversal_traits(status, tree.traits()); + Ray_3_Triangle_3_traversal_traits > + traversal_traits(status, tree.traits(), m_helper); tree.traversal(ray, traversal_traits); diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Side_of_triangle_mesh/Ray_3_Triangle_3_traversal_traits.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Side_of_triangle_mesh/Ray_3_Triangle_3_traversal_traits.h index 9df35906309..c4e94d216f2 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Side_of_triangle_mesh/Ray_3_Triangle_3_traversal_traits.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Side_of_triangle_mesh/Ray_3_Triangle_3_traversal_traits.h @@ -15,7 +15,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0+ -// +// // // Author(s) : Sebastien Loriot @@ -36,7 +36,7 @@ namespace CGAL { namespace internal { -template +template class Ray_3_Triangle_3_traversal_traits { protected: @@ -46,11 +46,13 @@ protected: const AABBTraits& m_aabb_traits; typedef typename AABBTraits::Primitive Primitive; typedef CGAL::AABB_node Node; + Helper m_helper; public: Ray_3_Triangle_3_traversal_traits(std::pair& status, - const AABBTraits& aabb_traits) - :m_status(status),m_stop(false), m_aabb_traits(aabb_traits) + const AABBTraits& aabb_traits, + const Helper& h) + :m_status(status),m_stop(false), m_aabb_traits(aabb_traits), m_helper(h) {m_status.first=true;} bool go_further() const { return !m_stop; } @@ -60,10 +62,8 @@ public: { internal::r3t3_do_intersect_endpoint_position_visitor visitor; std::pair res= - internal::do_intersect( - (internal::Primitive_helper::get_datum(primitive, m_aabb_traits)), - query,Kernel(),visitor); - + internal::do_intersect(m_helper.get_primitive_datum(primitive, m_aabb_traits), query,Kernel(),visitor); + if (res.first){ switch (res.second){ case internal::R3T3_intersection::CROSS_FACET: @@ -79,40 +79,40 @@ public: } } } - + template bool do_intersect(const Query& query, const Node& node) const { - return m_aabb_traits.do_intersect_object()(query, node.bbox()); + return m_aabb_traits.do_intersect_object()(query, m_helper.get_node_bbox(node)); } }; //specialization for vertical ray -template -class Ray_3_Triangle_3_traversal_traits: - public Ray_3_Triangle_3_traversal_traits +template +class Ray_3_Triangle_3_traversal_traits: + public Ray_3_Triangle_3_traversal_traits { - typedef Ray_3_Triangle_3_traversal_traits Base; + typedef Ray_3_Triangle_3_traversal_traits Base; typedef typename Kernel::Point_3 Point; typedef typename Base::Primitive Primitive; typedef CGAL::AABB_node Node; public: - Ray_3_Triangle_3_traversal_traits(std::pair& status, const AABBTraits& aabb_traits) - :Base(status, aabb_traits){} + Ray_3_Triangle_3_traversal_traits(std::pair& status, const AABBTraits& aabb_traits, const TraversalTraits& tt) + :Base(status, aabb_traits, tt){} template bool do_intersect(const Query& query, const Bbox_3& bbox) const { const Point& source=query.point(0); const Point& target=query.point(1); - + bool inc_z=target.z()>source.z(); - + //the ray does not intersect the z-slab if ( ( inc_z && source.z()>bbox.zmax() )|| (!inc_z && source.z() bbox.xmax() || source.x() bool do_intersect(const Query& query, const Node& node) const { - return do_intersect(query,node.bbox()); + return do_intersect(query,this->m_helper.get_node_bbox(node)); } private: @@ -139,45 +139,42 @@ public: template void intersection(const Query& query, const Primitive& primitive) { - typename Kernel::Triangle_3 t - = (internal::Primitive_helper::get_datum(primitive, this->m_aabb_traits)); + typename Kernel::Triangle_3 t = this->m_helper.get_primitive_datum(primitive, this->m_aabb_traits); if ( !do_intersect(query,t.bbox()) ) return; - + typename Kernel::Point_2 p0=z_project(t[0]); typename Kernel::Point_2 p1=z_project(t[1]); typename Kernel::Point_2 p2=z_project(t[2]); int indices[3]={0,1,2}; //to track whether triangle points have been swapt typename Kernel::Point_2 q=z_project( query.source() ); - + Orientation orient_2=orientation(p0,p1,p2); - + //check whether the face has a normal vector in the xy-plane if (orient_2==COLLINEAR){ //in that case the projection of the triangle along the z-axis is a segment. const typename Kernel::Point_2& other_point = p0!=p1?p1:p2; - //~ if ( orientation(p0,other_point,q) != COLLINEAR ) return;///no intersection if ( orientation(p0,other_point,q) != COLLINEAR ) return;///no intersection - - //check if the ray source is above or below the triangle and compare it + + //check if the ray source is above or below the triangle and compare it //with the direction of the ray //TODO and if yes return //this is just an optimisation, the current code is valid - + this->m_status.first=boost::logic::indeterminate; this->m_stop=true; return; } - - + //regular case if (orient_2==NEGATIVE){ std::swap(p1,p2); std::swap(indices[1],indices[2]); } - + //check whether the ray intersect the supporting plane Orientation orient_3 = orientation(t[indices[0]],t[indices[1]],t[indices[2]],query.source()); - if ( orient_3!=COPLANAR && + if ( orient_3!=COPLANAR && ( //indicates whether the ray is oriented toward the positive side of the plane ( POSITIVE == CGAL::sign( query.to_vector().z() ) ) @@ -186,7 +183,6 @@ public: (orient_3==POSITIVE) ) ) return; //no intersection - //position against first segment switch( orientation(p0,p1,q) ){ diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/intersection.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/intersection.h index 9dc79169d25..a36b14d8803 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/intersection.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/intersection.h @@ -359,7 +359,7 @@ struct Throw_at_first_output { // Note this is not officially documented /* * reports all the pairs of faces intersecting between two triangulated surface meshes. - * This function depends on the package \ref PkgBoxIntersectionDSummary. + * This function depends on the package \ref PkgBoxIntersectionD. * * \pre `CGAL::is_triangle_mesh(tm1)` * \pre `CGAL::is_triangle_mesh(tm2)` @@ -478,7 +478,7 @@ compute_face_face_intersection(const FaceRange& face_range1, * a triangulated surface mesh and a polyline. * \attention If a polyline vertex intersects a face, the intersection will * be reported twice (even more if it is on a vertex, edge, or point). - * This function depends on the package \ref PkgBoxIntersectionDSummary. + * This function depends on the package \ref PkgBoxIntersectionD. * * \pre `CGAL::is_triangle_mesh(tm)` * @@ -603,7 +603,7 @@ compute_face_polyline_intersection( const FaceRange& face_range, * a triangulated surface mesh and a range of polylines. * \attention If a polyline vertex intersects a face, the intersection will * be reported twice (even more if it is on a vertex, edge, or point). - * This function depends on the package \ref PkgBoxIntersectionDSummary. + * This function depends on the package \ref PkgBoxIntersectionD. * * \pre `CGAL::is_triangle_mesh(tm)` * @@ -732,7 +732,7 @@ compute_face_polylines_intersection(const FaceRange& face_range, // Note this is not officially documented /* * detects and records intersections between two polylines. - * This function depends on the package \ref PkgBoxIntersectionDSummary. + * This function depends on the package \ref PkgBoxIntersectionD. * \attention If a polyline vertex intersects another polyline, the intersection will * be reported twice (even more if it is on a vertex). * \tparam Polyline a `RandomAccessRange` of points. @@ -815,7 +815,7 @@ compute_polyline_polyline_intersection(const Polyline& polyline1, * detects and records intersections between two ranges of polylines. * \attention If a polyline vertex intersects another polyline, the intersection will * be reported twice (even more if it is on a vertex). - * This function depends on the package \ref PkgBoxIntersectionDSummary. + * This function depends on the package \ref PkgBoxIntersectionD. * * \tparam PolylineRange a `RandomAccessRange` of `RandomAccessRange` of points. * \tparam OutputIterator a model of `OutputIterator` holding objects of type @@ -915,7 +915,7 @@ compute_polylines_polylines_intersection(const PolylineRange& polylines1, // Note this is not officially documented /* * reports all the pairs of faces intersecting between two triangulated surface meshes. - * This function depends on the package \ref PkgBoxIntersectionDSummary. + * This function depends on the package \ref PkgBoxIntersectionD. * * @pre `CGAL::is_triangle_mesh(tm1)` * @pre `CGAL::is_triangle_mesh(tm2)` @@ -960,7 +960,7 @@ compute_face_face_intersection(const TriangleMesh& tm1, * and a polyline. * \attention If a polyline vertex intersects a face or another polyline, the intersection will * be reported twice (even more if it is on a vertex, edge, or point). - * This function depends on the package \ref PkgBoxIntersectionDSummary. + * This function depends on the package \ref PkgBoxIntersectionD. * * \pre `CGAL::is_triangle_mesh(tm)` * @@ -1081,7 +1081,7 @@ bool is_mesh2_in_mesh1(const TriangleMesh& tm1, * \ingroup PMP_predicates_grp * returns `true` if any segment of any polyline of `polylines1` intersects * any segment of any polyline of `polylines2`, and `false` otherwise. - * This function depends on the package \ref PkgBoxIntersectionDSummary. + * This function depends on the package \ref PkgBoxIntersectionD. * * \tparam PolylineRange a `RandomAccessRange` of `RandomAccessRange` of points. * The point type must be from a 3D point from a \cgal Kernel. @@ -1123,7 +1123,7 @@ bool do_intersect(const PolylineRange& polylines1, /** * \ingroup PMP_predicates_grp * returns `true` if any segment of `polyline1` intersects any segment of `polyline2`, and `false` otherwise. - * This function depends on the package \ref PkgBoxIntersectionDSummary. + * This function depends on the package \ref PkgBoxIntersectionD. * * \tparam Polyline a `RandomAccessRange` of points. * The point type must be from a 3D point type from \cgal Kernel. @@ -1169,7 +1169,7 @@ bool do_intersect(const Polyline& polyline1, * \ingroup PMP_predicates_grp * returns `true` if any face of `tm1` intersects any face of `tm2`, and `false` otherwise. * If `do_overlap_test_of_bounded_sides` is set to `true`, the overlap of bounded sides are tested as well. In that case, the meshes must be closed. - * This function depends on the package \ref PkgBoxIntersectionDSummary. + * This function depends on the package \ref PkgBoxIntersectionD. * * @pre `CGAL::is_triangle_mesh(tm1)` * @pre `CGAL::is_triangle_mesh(tm2)` @@ -1251,13 +1251,13 @@ bool do_intersect(const TriangleMesh& tm1, { CGAL_precondition(CGAL::is_triangle_mesh(tm1)); CGAL_precondition(CGAL::is_triangle_mesh(tm2)); - return do_intersect(tm1, tm2, parameters::all_default(), parameters::all_default()); + return CGAL::Polygon_mesh_processing::do_intersect(tm1, tm2, parameters::all_default(), parameters::all_default()); } /** * \ingroup PMP_predicates_grp * returns `true` if any face of `tm` and any segment of any polyline of `polylines` intersects, and `false` otherwise. - * This function depends on the package \ref PkgBoxIntersectionDSummary. + * This function depends on the package \ref PkgBoxIntersectionD. * @pre `CGAL::is_triangle_mesh(tm)` * * \tparam TriangleMesh a model of `FaceListGraph` @@ -1313,7 +1313,7 @@ bool do_intersect(const TriangleMesh& tm, /** * \ingroup PMP_predicates_grp * returns `true` if any face of `tm` and any segment of `polyline` intersects, and `false` otherwise. - * This function depends on the package \ref PkgBoxIntersectionDSummary. + * This function depends on the package \ref PkgBoxIntersectionD. * @pre `CGAL::is_triangle_mesh(tm)` * * \tparam TriangleMesh a model of `FaceListGraph` @@ -1382,7 +1382,7 @@ bool do_intersect(const TriangleMesh& tm, { CGAL_precondition(CGAL::is_triangle_mesh(tm)); - return do_intersect(tm, polylines, parameters::all_default()); + return CGAL::Polygon_mesh_processing::do_intersect(tm, polylines, parameters::all_default()); } @@ -1405,7 +1405,7 @@ bool do_intersect(const TriangleMesh& tm, { CGAL_precondition(CGAL::is_triangle_mesh(tm)); - return do_intersect(tm, polyline, parameters::all_default()); + return CGAL::Polygon_mesh_processing::do_intersect(tm, polyline, parameters::all_default()); } namespace internal{ @@ -1529,7 +1529,7 @@ struct Mesh_callback * A pair of meshes intersecting is put in the output iterator `out` as a `std::pair`, * each index refering to the index of the triangle mesh in the input range. * If `do_overlap_test_of_bounded_sides` is `true`, the overlap of bounded sides are tested as well. In that case, the meshes must be closed. - * This function depends on the package \ref PkgBoxIntersectionDSummary. + * This function depends on the package \ref PkgBoxIntersectionD. * * \tparam TriangleMeshRange a model of `RandomAccessRange` of triangulated surface meshes model of `FaceListGraph`. * \tparam OutputIterator an output iterator in which `std::pair` can be put. diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/merge_border_vertices.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/merge_border_vertices.h new file mode 100644 index 00000000000..d4600321959 --- /dev/null +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/merge_border_vertices.h @@ -0,0 +1,293 @@ +// Copyright (c) 2018 GeometryFactory (France). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org). +// You can redistribute it and/or modify it under the terms of the GNU +// General Public License as published by the Free Software Foundation, +// either version 3 of the License, or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: GPL-3.0+ +// +// +// Author(s) : Sebastien Loriot + +#ifndef CGAL_POLYGON_MESH_PROCESSING_MERGE_BORDER_VERTICES_H +#define CGAL_POLYGON_MESH_PROCESSING_MERGE_BORDER_VERTICES_H + +#include + +#include +#include +#include +#include +#include +#include + +#include +#include + +namespace CGAL { + +namespace Polygon_mesh_processing { + +namespace internal { + +template +struct Less_on_point_of_target +{ + typedef typename boost::graph_traits::halfedge_descriptor + halfedge_descriptor; + typedef typename boost::property_traits::reference Point; + + Less_on_point_of_target(const PM& pm, + const VertexPointMap& vpm) + : pm(pm), + vpm(vpm) + {} + + bool operator()(const std::pair& h1, + const std::pair& h2) const + { + if ( get(vpm, target(h1.first, pm)) < get(vpm, target(h2.first, pm)) ) + return true; + if ( get(vpm, target(h1.first, pm)) > get(vpm, target(h2.first, pm)) ) + return false; + return h1.second < h2.second; + } + + const PM& pm; + const VertexPointMap& vpm; +}; + + +// warning: cycle_hedges will be altered (sorted) +template +void detect_identical_mergeable_vertices( + std::vector< std::pair >& cycle_hedges, + std::vector< std::vector >& hedges_with_identical_point_target, + const PolygonMesh& pm, + Vpm vpm) +{ + // sort vertices using their point to ease the detection + // of vertices with identical points + Less_on_point_of_target less(pm, vpm); + std::sort( cycle_hedges.begin(), cycle_hedges.end(), less); + + std::size_t nbv=cycle_hedges.size(); + std::size_t i=1; + + std::set< std::pair > intervals; + + while(i!=nbv) + { + if ( get(vpm, target(cycle_hedges[i].first, pm)) == + get(vpm, target(cycle_hedges[i-1].first, pm)) ) + { + hedges_with_identical_point_target.push_back( std::vector() ); + hedges_with_identical_point_target.back().push_back(cycle_hedges[i-1].first); + hedges_with_identical_point_target.back().push_back(cycle_hedges[i].first); + intervals.insert( std::make_pair(cycle_hedges[i-1].second, cycle_hedges[i].second) ); + std::size_t previous = cycle_hedges[i].second; + while(++i!=nbv) + { + if ( get(vpm, target(cycle_hedges[i].first, pm)) == + get(vpm, target(cycle_hedges[i-1].first, pm)) ) + { + hedges_with_identical_point_target.back().push_back(cycle_hedges[i].first); + intervals.insert( std::make_pair(previous, cycle_hedges[i].second) ); + previous = cycle_hedges[i].second; + } + else + { + ++i; + break; + } + } + } + else + ++i; + } + + // check that intervals are disjoint or strictly nested + // if there is only one issue we drop the whole cycle. + /// \todo shall we try to be more conservative? + if (hedges_with_identical_point_target.empty()) return; + std::set< std::pair >::iterator it1 = intervals.begin(), + end2 = intervals.end(), + end1 = cpp11::prev(end2), + it2; + for (; it1!=end1; ++it1) + for(it2=cpp11::next(it1); it2!= end2; ++it2 ) + { + CGAL_assertion(it1->firstfirst); + CGAL_assertion(it1->first < it1->second && it2->first < it2->second); + if (it1->second > it2->first && it2->second > it1->second) + { + std::cerr << "Merging is skipt to avoid bad cycle connections\n"; + hedges_with_identical_point_target.clear(); + return; + } + } +} + +// \ingroup PMP_repairing_grp +// merges target vertices of a list of halfedges. +// Halfedges must be sorted in the list. +// +// @tparam PolygonMesh a model of `FaceListGraph` and `MutableFaceGraph`. +// @tparam HalfedgeRange a range of halfedge descriptors of `PolygonMesh`, model of `Range`. +// +// @param sorted_hedges a sorted list of halfedges. +// @param pm the polygon mesh which contains the list of halfedges. +// +template +void merge_vertices_in_range(const HalfedgeRange& sorted_hedges, + PolygonMesh& pm) +{ + typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; + typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; + + halfedge_descriptor in_h_kept = *boost::begin(sorted_hedges); + halfedge_descriptor out_h_kept = next(in_h_kept, pm); + vertex_descriptor v_kept = target(in_h_kept, pm); + + std::vector vertices_to_rm; + + BOOST_FOREACH(halfedge_descriptor in_h_rm, sorted_hedges) + { + vertex_descriptor vd = target(in_h_rm, pm); + if (vd==v_kept) continue; // skip identical vertices (in particular this skips the first halfedge) + if (edge(vd, v_kept, pm).second) continue; // skip null edges + bool shall_continue=false; + BOOST_FOREACH(halfedge_descriptor h, halfedges_around_target(v_kept, pm)) + { + if (edge(vd, source(h, pm), pm).second) + { + shall_continue=true; + break; + } + } + if (shall_continue) continue; // skip vertices already incident to the same vertex + // update the vertex of the halfedges incident to the vertex to remove + internal::update_target_vertex(in_h_rm, v_kept, pm); + // update next/prev pointers around the 2 vertices to be merged + halfedge_descriptor out_h_rm = next(in_h_rm, pm); + set_next(in_h_kept, out_h_rm, pm); + set_next(in_h_rm, out_h_kept, pm); + vertices_to_rm.push_back(vd); + out_h_kept=out_h_rm; + } + + BOOST_FOREACH(vertex_descriptor vd, vertices_to_rm) + remove_vertex(vd, pm); +} + +} // end of internal + +/// \ingroup PMP_repairing_grp +/// merges identical vertices around a cycle of boundary edges. +/// +/// @tparam PolygonMesh a model of `FaceListGraph` and `MutableFaceGraph`. +/// @tparam NamedParameter a sequence of \ref pmp_namedparameters "Named Parameters". +/// +/// @param h a halfedge that belongs to a boundary cycle. +/// @param pm the polygon mesh which contains the boundary cycle. +/// @param np optional parameter of \ref pmp_namedparameters "Named Parameters" listed below. +/// +/// \cgalNamedParamsBegin +/// \cgalParamBegin{vertex_point_map} +/// the property map with the points associated to the vertices of `pm`. +/// If this parameter is omitted, an internal property map for +/// `CGAL::vertex_point_t` should be available in `PolygonMesh` +/// \cgalParamEnd +/// \cgalNamedParamsEnd +template +void merge_duplicated_vertices_in_boundary_cycle( + typename boost::graph_traits::halfedge_descriptor h, + PolygonMesh& pm, + const NamedParameter& np) +{ + typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; + typedef typename GetVertexPointMap::const_type Vpm; + + Vpm vpm = choose_param(get_param(np, internal_np::vertex_point), + get_const_property_map(vertex_point, pm)); + + // collect all the halfedges of the cycle + std::vector< std::pair > cycle_hedges; + halfedge_descriptor start=h; + std::size_t index=0; + do{ + cycle_hedges.push_back( std::make_pair(h, index) ); + h=next(h, pm); + ++index; + }while(start!=h); + + std::vector< std::vector > hedges_with_identical_point_target; + internal::detect_identical_mergeable_vertices(cycle_hedges, hedges_with_identical_point_target, pm, vpm); + + BOOST_FOREACH(const std::vector& hedges, + hedges_with_identical_point_target) + { + start=hedges.front(); + // hedges are sorted along the cycle + internal::merge_vertices_in_range(hedges, pm); + } +} + +/// \ingroup PMP_repairing_grp +/// extracts boundary cycles and merges the duplicated vertices of each cycle. +/// +/// @tparam PolygonMesh a model of `FaceListGraph` and `MutableFaceGraph`. +/// @tparam NamedParameter a sequence of \ref pmp_namedparameters "Named Parameters". +/// +/// @param pm the polygon mesh which contains the cycles. +/// @param np optional parameter of \ref pmp_namedparameters "Named Parameters" listed below. +/// +/// \cgalNamedParamsBegin +/// \cgalParamBegin{vertex_point_map} +/// the property map with the points associated to the vertices of `pm`. +/// If this parameter is omitted, an internal property map for +/// `CGAL::vertex_point_t` should be available in `PolygonMesh` +/// \cgalParamEnd +/// \cgalNamedParamsEnd +/// +/// \sa `merge_duplicated_vertices_in_boundary_cycle()` +template +void merge_duplicated_vertices_in_boundary_cycles( PolygonMesh& pm, + const NamedParameter& np) +{ + typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; + + std::vector cycles; + extract_boundary_cycles(pm, std::back_inserter(cycles)); + + BOOST_FOREACH(halfedge_descriptor h, cycles) + merge_duplicated_vertices_in_boundary_cycle(h, pm, np); +} + +template +void merge_duplicated_vertices_in_boundary_cycles(PolygonMesh& pm) +{ + merge_duplicated_vertices_in_boundary_cycles(pm, parameters::all_default()); +} + +template +void merge_duplicated_vertices_in_boundary_cycle( + typename boost::graph_traits::halfedge_descriptor h, + PolygonMesh& pm) +{ + merge_duplicated_vertices_in_boundary_cycle(h, pm, parameters::all_default()); +} + +} } // end of CGAL::Polygon_mesh_processing + +#endif //CGAL_POLYGON_MESH_PROCESSING_MERGE_BORDER_VERTICES_H diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/orient_polygon_soup.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/orient_polygon_soup.h index aa1f8d78594..67b22a81ac0 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/orient_polygon_soup.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/orient_polygon_soup.h @@ -463,13 +463,13 @@ struct Polygon_soup_orienter * The algorithm is described in \cgalCite{gueziec2001cutting}. * * @tparam PointRange a model of the concepts `RandomAccessContainer` - * and `BackInsertionSequence` whose value type is the point type + * and `BackInsertionSequence` whose value type is the point type. * @tparam PolygonRange a model of the concept `RandomAccessContainer` * whose value_type is a model of the concept `RandomAccessContainer` * whose value_type is `std::size_t`. * - * @param points points of the soup of polygons. Some points might be pushed back to resolve - * non-manifold or non-orientability issues. + * @param points points of the soup of polygons. Some additional points might be pushed back to resolve + * non-manifoldness or non-orientability issues. * @param polygons each element in the vector describes a polygon using the index of the points in `points`. * If needed the order of the indices of a polygon might be reversed. * @return `true` if the orientation operation succeded. diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/orientation.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/orientation.h index 7434a130cec..c2b32d54d63 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/orientation.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/orientation.h @@ -77,7 +77,7 @@ namespace internal{ //VertexPointMap typedef typename GetVertexPointMap::const_type VPMap; - VPMap vpmap = choose_param(get_param(np, vertex_point), + VPMap vpmap = choose_param(get_param(np, internal_np::vertex_point), get_const_property_map(vertex_point, pmesh)); //Kernel typedef typename GetGeomTraits::type GT; diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/polygon_soup_to_polygon_mesh.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/polygon_soup_to_polygon_mesh.h index b8b6d1a5472..d3f70c87401 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/polygon_soup_to_polygon_mesh.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/polygon_soup_to_polygon_mesh.h @@ -204,7 +204,8 @@ public: * @param polygons each element in the vector describes a polygon using the index of the points in `points` * @param out the polygon mesh to be built * - * @pre `CGAL::Polygon_mesh_processing::is_polygon_soup_a_polygon_mesh(polygons)` + * @pre \link CGAL::Polygon_mesh_processing::is_polygon_soup_a_polygon_mesh() + * CGAL::Polygon_mesh_processing::is_polygon_soup_a_polygon_mesh(polygons) \endlink * * \sa `CGAL::Polygon_mesh_processing::orient_polygon_soup()` * \sa `CGAL::Polygon_mesh_processing::is_polygon_soup_a_polygon_mesh()` diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/random_perturbation.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/random_perturbation.h index ea7362e1a95..8a210843b1e 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/random_perturbation.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/random_perturbation.h @@ -174,10 +174,10 @@ void random_perturbation(VertexRange vertices typedef typename boost::lookup_named_param_def < internal_np::vertex_is_constrained_t, NamedParameters, - internal::No_constraint_pmap//default + Constant_property_map // default > ::type VCMap; VCMap vcmap = choose_param(get_param(np, internal_np::vertex_is_constrained), - internal::No_constraint_pmap()); + Constant_property_map(false)); unsigned int seed = choose_param(get_param(np, internal_np::random_seed), -1); bool do_project = choose_param(get_param(np, internal_np::do_project), true); diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/remesh.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/remesh.h index d87cd651b6a..337a62e49f3 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/remesh.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/remesh.h @@ -163,6 +163,7 @@ void isotropic_remeshing(const FaceRange& faces boost::is_default_param(get_param(np, internal_np::projection_functor)); typedef typename GetGeomTraits::type GT; + GT gt = choose_param(get_param(np, internal_np::geom_traits), GT()); typedef typename GetVertexPointMap::type VPMap; VPMap vpmap = choose_param(get_param(np, internal_np::vertex_point), @@ -175,18 +176,18 @@ void isotropic_remeshing(const FaceRange& faces typedef typename boost::lookup_named_param_def < internal_np::edge_is_constrained_t, NamedParameters, - internal::No_constraint_pmap//default + Constant_property_map // default (no constraint pmap) > ::type ECMap; - ECMap ecmap = choose_param(get_param(np, internal_np::edge_is_constrained) - , internal::No_constraint_pmap()); + ECMap ecmap = choose_param(get_param(np, internal_np::edge_is_constrained), + Constant_property_map(false)); typedef typename boost::lookup_named_param_def < internal_np::vertex_is_constrained_t, NamedParameters, - internal::No_constraint_pmap//default + Constant_property_map // default (no constraint pmap) > ::type VCMap; VCMap vcmap = choose_param(get_param(np, internal_np::vertex_is_constrained), - internal::No_constraint_pmap()); + Constant_property_map(false)); bool protect = choose_param(get_param(np, internal_np::protect_constraints), false); typedef typename boost::lookup_named_param_def < @@ -227,7 +228,7 @@ void isotropic_remeshing(const FaceRange& faces #endif typename internal::Incremental_remesher - remesher(pmesh, vpmap, protect, ecmap, vcmap, fpmap, fimap, need_aabb_tree); + remesher(pmesh, vpmap, gt, protect, ecmap, vcmap, fpmap, fimap, need_aabb_tree); remesher.init_remeshing(faces); #ifdef CGAL_PMP_REMESHING_VERBOSE @@ -308,7 +309,7 @@ void isotropic_remeshing( * @param edges the range of edges to be split if they are longer than given threshold * @param max_length the edge length above which an edge from `edges` is split * into to sub-edges -* @param np optional \ref pmp_namedparameters "Named Parameters" described below +* @param np optional \ref pmp_namedparameters "Named Parameters", amongst those described below * \cgalNamedParamsBegin * \cgalParamBegin{vertex_point_map} the property map with the points associated @@ -340,6 +341,8 @@ void split_long_edges(const EdgeRange& edges using boost::get_param; typedef typename GetGeomTraits::type GT; + GT gt = choose_param(get_param(np, internal_np::geom_traits), GT()); + typedef typename GetVertexPointMap::type VPMap; VPMap vpmap = choose_param(get_param(np, internal_np::vertex_point), get_property_map(vertex_point, pmesh)); @@ -351,22 +354,21 @@ void split_long_edges(const EdgeRange& edges typedef typename boost::lookup_named_param_def < internal_np::edge_is_constrained_t, NamedParameters, - internal::No_constraint_pmap//default + Constant_property_map // default (no constraint pmap) > ::type ECMap; ECMap ecmap = choose_param(get_param(np, internal_np::edge_is_constrained), - internal::No_constraint_pmap()); + Constant_property_map(false)); typename internal::Incremental_remesher, + Constant_property_map, // no constraint pmap internal::Connected_components_pmap, FIMap > - remesher(pmesh, vpmap, false/*protect constraints*/ - , ecmap - , internal::No_constraint_pmap() - , internal::Connected_components_pmap(faces(pmesh), pmesh, ecmap, fimap, false) - , fimap - , false/*need aabb_tree*/); + remesher(pmesh, vpmap, gt, false/*protect constraints*/, ecmap, + Constant_property_map(false), + internal::Connected_components_pmap(faces(pmesh), pmesh, ecmap, fimap, false), + fimap, + false/*need aabb_tree*/); remesher.split_long_edges(edges, max_length); } diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair.h index 6fcb1e929dd..64f83de0869 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair.h @@ -24,12 +24,9 @@ #include - -#include -#include -#include #include #include +#include #include #include @@ -40,21 +37,33 @@ #include #include +#include #include #include +#include + #ifdef CGAL_PMP_REMOVE_DEGENERATE_FACES_DEBUG #include #include -#include -#include #endif +#include +#include +#include + +#include +#include +#include +#include +#include +#include + namespace CGAL{ namespace Polygon_mesh_processing { - namespace debug{ + template std::ostream& dump_edge_neighborhood( typename boost::graph_traits::edge_descriptor ed, @@ -142,8 +151,11 @@ namespace debug{ << vids[ target(next(next(halfedge(f, tm), tm), tm), tm) ] << "\n"; } } + } //end of namespace debug +namespace internal { + template struct Less_vertex_point{ typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; @@ -157,33 +169,158 @@ struct Less_vertex_point{ } }; -///\cond SKIP_IN_MANUAL +} // end namespace internal -template -OutputIterator -degenerate_faces(const TriangleMesh& tm, - const VertexPointMap& vpmap, - const Traits& traits, - OutputIterator out) +/// \ingroup PMP_repairing_grp +/// collects the degenerate edges within a given range of edges. +/// +/// @tparam EdgeRange a model of `Range` with value type `boost::graph_traits::%edge_descriptor` +/// @tparam TriangleMesh a model of `HalfedgeGraph` +/// @tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters" +/// +/// @param edges a subset of edges of `tm` +/// @param tm a triangle mesh +/// @param out an output iterator in which the degenerate edges are written +/// @param np optional \ref pmp_namedparameters "Named Parameters" described below +/// +/// \cgalNamedParamsBegin +/// \cgalParamBegin{vertex_point_map} the property map with the points associated to the vertices of `tm`. +/// The type of this map is model of `ReadWritePropertyMap`. +/// If this parameter is omitted, an internal property map for +/// `CGAL::vertex_point_t` should be available in `TriangleMesh` +/// \cgalParamEnd +/// \cgalParamBegin{geom_traits} a geometric traits class instance. +/// The traits class must provide the nested type `Point_3`, +/// and the nested functor `Equal_3` to check whether two points are identical. +/// \cgalParamEnd +/// \cgalNamedParamsEnd +template +OutputIterator degenerate_edges(const EdgeRange& edges, + const TriangleMesh& tm, + OutputIterator out, + const NamedParameters& np) { - typedef typename boost::graph_traits::face_descriptor face_descriptor; - BOOST_FOREACH(face_descriptor fd, faces(tm)) + typedef typename boost::graph_traits::edge_descriptor edge_descriptor; + + BOOST_FOREACH(edge_descriptor ed, edges) { - if ( is_degenerate_triangle_face(fd, tm, vpmap, traits) ) - *out++=fd; + if(is_degenerate_edge(ed, tm, np)) + *out++ = ed; } return out; } +template +OutputIterator degenerate_edges(const EdgeRange& edges, + const TriangleMesh& tm, + OutputIterator out, + typename boost::enable_if< + typename boost::has_range_iterator + >::type* = 0) +{ + return degenerate_edges(edges, tm, out, CGAL::parameters::all_default()); +} + +/// \ingroup PMP_repairing_grp +/// calls the function `degenerate_edges()` with the range: `edges(tm)`. +/// +/// See above for the comprehensive description of the parameters. +/// +template +OutputIterator degenerate_edges(const TriangleMesh& tm, + OutputIterator out, + const NamedParameters& np +#ifndef DOXYGEN_RUNNING + , typename boost::disable_if< + boost::has_range_iterator + >::type* = 0 +#endif + ) +{ + return degenerate_edges(edges(tm), tm, out, np); +} + template OutputIterator -degenerate_faces(const TriangleMesh& tm, OutputIterator out) +degenerate_edges(const TriangleMesh& tm, OutputIterator out) { - typedef typename boost::property_map::type Vpm; - typedef typename boost::property_traits::value_type Point; - typedef typename Kernel_traits::Kernel Kernel; + return degenerate_edges(edges(tm), tm, out, CGAL::parameters::all_default()); +} - return degenerate_faces(tm, get(vertex_point, tm), Kernel(), out); +/// \ingroup PMP_repairing_grp +/// collects the degenerate faces within a given range of faces. +/// +/// @tparam FaceRange a model of `Range` with value type `boost::graph_traits::%face_descriptor` +/// @tparam TriangleMesh a model of `FaceGraph` +/// @tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters" +/// +/// @param faces a subset of faces of `tm` +/// @param tm a triangle mesh +/// @param out an output iterator in which the degenerate faces are put +/// @param np optional \ref pmp_namedparameters "Named Parameters" described below +/// +/// \cgalNamedParamsBegin +/// \cgalParamBegin{vertex_point_map} the property map with the points associated to the vertices of `tm`. +/// The type of this map is model of `ReadWritePropertyMap`. +/// If this parameter is omitted, an internal property map for +/// `CGAL::vertex_point_t` should be available in `TriangleMesh` +/// \cgalParamEnd +/// \cgalParamBegin{geom_traits} a geometric traits class instance. +/// The traits class must provide the nested functor `Collinear_3` +/// to check whether three points are collinear. +/// \cgalParamEnd +/// \cgalNamedParamsEnd +/// +template +OutputIterator degenerate_faces(const FaceRange& faces, + const TriangleMesh& tm, + OutputIterator out, + const NamedParameters& np) +{ + typedef typename boost::graph_traits::face_descriptor face_descriptor; + + BOOST_FOREACH(face_descriptor fd, faces) + { + if(is_degenerate_triangle_face(fd, tm, np)) + *out++ = fd; + } + return out; +} + +template +OutputIterator degenerate_faces(const FaceRange& faces, + const TriangleMesh& tm, + OutputIterator out, + typename boost::enable_if< + boost::has_range_iterator + >::type* = 0) +{ + return degenerate_faces(faces, tm, out, CGAL::parameters::all_default()); +} + +/// \ingroup PMP_repairing_grp +/// calls the function `degenerate_faces()` with the range: `faces(tm)`. +/// +/// See above for the comprehensive description of the parameters. +/// +template +OutputIterator degenerate_faces(const TriangleMesh& tm, + OutputIterator out, + const NamedParameters& np +#ifndef DOXYGEN_RUNNING + , typename boost::disable_if< + boost::has_range_iterator + >::type* = 0 +#endif + ) +{ + return degenerate_faces(faces(tm), tm, out, np); +} + +template +OutputIterator degenerate_faces(const TriangleMesh& tm, OutputIterator out) +{ + return degenerate_faces(faces(tm), tm, out, CGAL::parameters::all_default()); } // this function remove a border edge even if it does not satisfy the link condition. @@ -365,10 +502,9 @@ remove_a_border_edge(typename boost::graph_traits::edge_descriptor } template -std::size_t remove_null_edges( - const EdgeRange& edge_range, - TriangleMesh& tmesh, - const NamedParameters& np) +bool remove_degenerate_edges(const EdgeRange& edge_range, + TriangleMesh& tmesh, + const NamedParameters& np) { CGAL_assertion(CGAL::is_triangle_mesh(tmesh)); @@ -385,317 +521,351 @@ std::size_t remove_null_edges( typedef typename GetVertexPointMap::type VertexPointMap; VertexPointMap vpmap = choose_param(get_param(np, internal_np::vertex_point), get_property_map(vertex_point, tmesh)); + typedef typename GetGeomTraits::type Traits; - Traits traits = choose_param(get_param(np, internal_np::geom_traits), Traits()); std::size_t nb_deg_faces = 0; - + bool all_removed=false; + bool some_removed=true; // collect edges of length 0 - std::set null_edges_to_remove; - BOOST_FOREACH(edge_descriptor ed, edge_range) + while(some_removed && !all_removed) { - if ( traits.equal_3_object()(get(vpmap, target(ed, tmesh)), get(vpmap, source(ed, tmesh))) ) - null_edges_to_remove.insert(ed); - } + some_removed=false; + all_removed=true; + std::set degenerate_edges_to_remove; + degenerate_edges(edge_range, tmesh, std::inserter(degenerate_edges_to_remove, + degenerate_edges_to_remove.end())); #ifdef CGAL_PMP_REMOVE_DEGENERATE_FACES_DEBUG - std::cout << "Found " << null_edges_to_remove.size() << " null edges.\n"; + std::cout << "Found " << degenerate_edges_to_remove.size() << " null edges.\n"; #endif - while (!null_edges_to_remove.empty()) - { - edge_descriptor ed = *null_edges_to_remove.begin(); - null_edges_to_remove.erase(null_edges_to_remove.begin()); - - halfedge_descriptor h = halfedge(ed, tmesh); - - if (CGAL::Euler::does_satisfy_link_condition(ed,tmesh)) + while (!degenerate_edges_to_remove.empty()) { - // remove edges that could also be set for removal - if ( face(h, tmesh)!=GT::null_face() ) + edge_descriptor ed = *degenerate_edges_to_remove.begin(); + degenerate_edges_to_remove.erase(degenerate_edges_to_remove.begin()); + + halfedge_descriptor h = halfedge(ed, tmesh); + + if (CGAL::Euler::does_satisfy_link_condition(ed,tmesh)) { - ++nb_deg_faces; - null_edges_to_remove.erase(edge(prev(h, tmesh), tmesh)); - } - if (face(opposite(h, tmesh), tmesh)!=GT::null_face()) - { - ++nb_deg_faces; - null_edges_to_remove.erase(edge(prev(opposite(h, tmesh), tmesh), tmesh)); - } - //now remove the edge - CGAL::Euler::collapse_edge(ed, tmesh); - } - else{ - //handle the case when the edge is incident to a triangle hole - //we first fill the hole and try again - if ( is_border(ed, tmesh) ) - { - halfedge_descriptor hd = halfedge(ed,tmesh); - if (!is_border(hd,tmesh)) hd=opposite(hd,tmesh); - if (is_triangle(hd, tmesh)) + // remove edges that could also be set for removal + if ( face(h, tmesh)!=GT::null_face() ) { - Euler::fill_hole(hd, tmesh); - null_edges_to_remove.insert(ed); - continue; + ++nb_deg_faces; + degenerate_edges_to_remove.erase(edge(prev(h, tmesh), tmesh)); } - } - - // When the edge does not satisfy the link condition, it means that it cannot be - // collapsed as is. In the following we assume that there is no topological issue - // with contracting the edge (no volume will disappear). - // We start by marking the faces that are incident to an edge endpoint. - // If the set of marked faces is a topologically disk, then we simply remove all the simplicies - // inside the disk and star the hole with the edge vertex kept. - // If the set of marked faces is not a topological disk, it has some non-manifold vertices - // on its boundary. We need to mark additional faces to make it a topological disk. - // We can then apply the star hole procedure. - // Right now we additionally mark the smallest connected components of non-marked faces - // (using the numnber of faces) - - //backup central point - typename Traits::Point_3 pt = get(vpmap, source(ed, tmesh)); - - // mark faces of the link of each endpoints of the edge which collapse is not topologically valid - std::set marked_faces; - // first endpoint - BOOST_FOREACH( halfedge_descriptor hd, CGAL::halfedges_around_target(halfedge(ed,tmesh), tmesh) ) - if (!is_border(hd,tmesh)) marked_faces.insert( face(hd, tmesh) ); - // second endpoint - BOOST_FOREACH( halfedge_descriptor hd, CGAL::halfedges_around_target(opposite(halfedge(ed, tmesh), tmesh), tmesh) ) - if (!is_border(hd,tmesh)) marked_faces.insert( face(hd, tmesh) ); - - // extract the halfedges on the boundary of the marked region - std::vector border; - BOOST_FOREACH(face_descriptor fd, marked_faces) - BOOST_FOREACH(halfedge_descriptor hd, CGAL::halfedges_around_face(halfedge(fd,tmesh), tmesh)) + if (face(opposite(h, tmesh), tmesh)!=GT::null_face()) { - halfedge_descriptor hd_opp = opposite(hd, tmesh); - if ( is_border(hd_opp, tmesh) || - marked_faces.count( face(hd, tmesh) )!= - marked_faces.count( face(hd_opp, tmesh) ) ) + ++nb_deg_faces; + degenerate_edges_to_remove.erase(edge(prev(opposite(h, tmesh), tmesh), tmesh)); + } + //now remove the edge + CGAL::Euler::collapse_edge(ed, tmesh); + some_removed = true; + } + else{ + //handle the case when the edge is incident to a triangle hole + //we first fill the hole and try again + if ( is_border(ed, tmesh) ) + { + halfedge_descriptor hd = halfedge(ed,tmesh); + if (!is_border(hd,tmesh)) hd=opposite(hd,tmesh); + if (is_triangle(hd, tmesh)) { - border.push_back( hd ); + Euler::fill_hole(hd, tmesh); + degenerate_edges_to_remove.insert(ed); + continue; } } - CGAL_assertion( !border.empty() ); // a whole connected component got selected and will disappear (not handled for now) - // define cc of border halfedges: two halfedges are in the same cc - // if they are on the border of the cc of non-marked faces. - typedef CGAL::Union_find UF_ds; - UF_ds uf; - std::map handles; - // one cc per border halfedge - BOOST_FOREACH(halfedge_descriptor hd, border) - handles.insert( std::make_pair(hd, uf.make_set(hd)) ); - - // join cc's - BOOST_FOREACH(halfedge_descriptor hd, border) - { - CGAL_assertion( marked_faces.count( face( hd, tmesh) ) > 0); - CGAL_assertion( marked_faces.count( face( opposite(hd, tmesh), tmesh) ) == 0 ); - halfedge_descriptor candidate = hd; - - do{ - candidate = prev( opposite(candidate, tmesh), tmesh ); - } while( !marked_faces.count( face( opposite(candidate, tmesh), tmesh) ) ); - uf.unify_sets( handles[hd], handles[opposite(candidate, tmesh)] ); - } - - std::size_t nb_cc = uf.number_of_sets(); - if ( nb_cc != 1 ) - { - // if more than one connected component is found then the patch - // made of marked faces contains "non-manifold" vertices. - // The smallest components need to be marked so that the patch - // made of marked faces is a topological disk - - // we will explore in parallel the connected components and will stop - // when all but one connected component have been entirely explored. - // We add one face at a time for each cc in order to not explore a - // potentially very large cc. - std::vector< std::vector > stacks_per_cc(nb_cc); - std::vector< std::set > faces_per_cc(nb_cc); - std::vector< bool > exploration_finished(nb_cc, false); - - - // init the stacks of halfedges using the cc of the boundary - std::size_t index=0; - std::map< halfedge_descriptor, std::size_t > ccs; - typedef std::pair Pair_type; - BOOST_FOREACH(Pair_type p, handles) + else { - halfedge_descriptor opp_hedge = opposite(p.first, tmesh); - if (is_border(opp_hedge, tmesh)) continue; // nothing to do on the boundary - - typedef typename std::map< halfedge_descriptor, std::size_t >::iterator Map_it; - std::pair insert_res= - ccs.insert( std::make_pair(*uf.find( p.second ), index) ); - if (insert_res.second) ++index; - - stacks_per_cc[ insert_res.first->second ].push_back( prev(opp_hedge, tmesh) ); - stacks_per_cc[ insert_res.first->second ].push_back( next(opp_hedge, tmesh) ); - faces_per_cc[ insert_res.first->second ].insert( face(opp_hedge, tmesh) ); - } - - std::size_t nb_ccs_to_be_explored = nb_cc; - index=0; - //explore the cc's - do{ - // try to extract one more face for a given cc - do{ - CGAL_assertion( !exploration_finished[index] ); - halfedge_descriptor hd = stacks_per_cc[index].back(); - stacks_per_cc[index].pop_back(); - hd = opposite(hd, tmesh); - if ( !is_border(hd,tmesh) && !marked_faces.count(face(hd, tmesh) ) ) + halfedge_descriptor hd = halfedge(ed,tmesh); + // if both vertices are boundary vertices we can't do anything + bool impossible = false; + BOOST_FOREACH(halfedge_descriptor h, halfedges_around_target(hd, tmesh)) + { + if (is_border(h, tmesh)) { - if ( faces_per_cc[index].insert( face(hd, tmesh) ).second ) + impossible = true; + break; + } + } + if (impossible) + { + BOOST_FOREACH(halfedge_descriptor h, halfedges_around_source(hd, tmesh)) + { + if (is_border(h, tmesh)) { - stacks_per_cc[index].push_back( next(hd, tmesh) ); - stacks_per_cc[index].push_back( prev(hd, tmesh) ); + impossible = true; break; } } - if (stacks_per_cc[index].empty()) break; + if (impossible) + { + all_removed=false; + continue; + } } - while(true); - // the exploration of a cc is finished when its stack is empty - exploration_finished[index]=stacks_per_cc[index].empty(); - if ( exploration_finished[index] ) --nb_ccs_to_be_explored; - if ( nb_ccs_to_be_explored==1 ) break; - while ( exploration_finished[(++index)%nb_cc] ); - index=index%nb_cc; - }while(true); + } - /// \todo use the area criteria? this means maybe continue exploration of larger cc - // mark faces of completetly explored cc - for (index=0; index< nb_cc; ++index) - if( exploration_finished[index] ) + // When the edge does not satisfy the link condition, it means that it cannot be + // collapsed as is. In the following we assume that there is no topological issue + // with contracting the edge (no volume will disappear). + // We start by marking the faces that are incident to an edge endpoint. + // If the set of marked faces is a topologically disk, then we simply remove all the simplicies + // inside the disk and star the hole with the edge vertex kept. + // If the set of marked faces is not a topological disk, it has some non-manifold vertices + // on its boundary. We need to mark additional faces to make it a topological disk. + // We can then apply the star hole procedure. + // Right now we additionally mark the smallest connected components of non-marked faces + // (using the numnber of faces) + some_removed = true; + + //backup central point + typename Traits::Point_3 pt = get(vpmap, source(ed, tmesh)); + + // mark faces of the link of each endpoints of the edge which collapse is not topologically valid + std::set marked_faces; + // first endpoint + BOOST_FOREACH( halfedge_descriptor hd, CGAL::halfedges_around_target(halfedge(ed,tmesh), tmesh) ) + if (!is_border(hd,tmesh)) marked_faces.insert( face(hd, tmesh) ); + // second endpoint + BOOST_FOREACH( halfedge_descriptor hd, CGAL::halfedges_around_target(opposite(halfedge(ed, tmesh), tmesh), tmesh) ) + if (!is_border(hd,tmesh)) marked_faces.insert( face(hd, tmesh) ); + + // extract the halfedges on the boundary of the marked region + std::vector border; + BOOST_FOREACH(face_descriptor fd, marked_faces) + BOOST_FOREACH(halfedge_descriptor hd, CGAL::halfedges_around_face(halfedge(fd,tmesh), tmesh)) { - BOOST_FOREACH(face_descriptor fd, faces_per_cc[index]) - marked_faces.insert(fd); + halfedge_descriptor hd_opp = opposite(hd, tmesh); + if ( is_border(hd_opp, tmesh) || + marked_faces.count( face(hd, tmesh) )!= + marked_faces.count( face(hd_opp, tmesh) ) ) + { + border.push_back( hd ); + } } - } + CGAL_assertion( !border.empty() ); // a whole connected component got selected and will disappear (not handled for now) + // define cc of border halfedges: two halfedges are in the same cc + // if they are on the border of the cc of non-marked faces. + typedef CGAL::Union_find UF_ds; + UF_ds uf; + std::map handles; + // one cc per border halfedge + BOOST_FOREACH(halfedge_descriptor hd, border) + handles.insert( std::make_pair(hd, uf.make_set(hd)) ); - // collect simplices to be removed - std::set vertices_to_keep; - std::set halfedges_to_keep; - BOOST_FOREACH(halfedge_descriptor hd, border) - if ( !marked_faces.count(face(opposite(hd, tmesh), tmesh)) ) + // join cc's + BOOST_FOREACH(halfedge_descriptor hd, border) { - halfedges_to_keep.insert( hd ); - vertices_to_keep.insert( target(hd, tmesh) ); + CGAL_assertion( marked_faces.count( face( hd, tmesh) ) > 0); + CGAL_assertion( marked_faces.count( face( opposite(hd, tmesh), tmesh) ) == 0 ); + halfedge_descriptor candidate = hd; + + do{ + candidate = prev( opposite(candidate, tmesh), tmesh ); + } while( !marked_faces.count( face( opposite(candidate, tmesh), tmesh) ) ); + uf.unify_sets( handles[hd], handles[opposite(candidate, tmesh)] ); } - // backup next,prev relationships to set after patch removal - std::vector< std::pair > next_prev_halfedge_pairs; - halfedge_descriptor first_border_hd=*( halfedges_to_keep.begin() ); - halfedge_descriptor current_border_hd=first_border_hd; - do{ - halfedge_descriptor prev_border_hd=current_border_hd; - current_border_hd=next(current_border_hd, tmesh); - while( marked_faces.count( face( opposite(current_border_hd, tmesh), tmesh) ) ) - current_border_hd=next(opposite(current_border_hd, tmesh), tmesh); - next_prev_halfedge_pairs.push_back( std::make_pair(prev_border_hd, current_border_hd) ); - }while(current_border_hd!=first_border_hd); - - // collect vertices and edges to remove and do remove faces - std::set edges_to_remove; - std::set vertices_to_remove; - BOOST_FOREACH(face_descriptor fd, marked_faces) - { - halfedge_descriptor hd=halfedge(fd, tmesh); - for(int i=0; i<3; ++i) + std::size_t nb_cc = uf.number_of_sets(); + if ( nb_cc != 1 ) { - if ( !halfedges_to_keep.count(hd) ) - edges_to_remove.insert( edge(hd, tmesh) ); - if ( !vertices_to_keep.count(target(hd,tmesh)) ) - vertices_to_remove.insert( target(hd,tmesh) ); - hd=next(hd, tmesh); + // if more than one connected component is found then the patch + // made of marked faces contains "non-manifold" vertices. + // The smallest components need to be marked so that the patch + // made of marked faces is a topological disk + + // we will explore in parallel the connected components and will stop + // when all but one connected component have been entirely explored. + // We add one face at a time for each cc in order to not explore a + // potentially very large cc. + std::vector< std::vector > stacks_per_cc(nb_cc); + std::vector< std::set > faces_per_cc(nb_cc); + std::vector< bool > exploration_finished(nb_cc, false); + + + // init the stacks of halfedges using the cc of the boundary + std::size_t index=0; + std::map< halfedge_descriptor, std::size_t > ccs; + typedef std::pair Pair_type; + BOOST_FOREACH(Pair_type p, handles) + { + halfedge_descriptor opp_hedge = opposite(p.first, tmesh); + if (is_border(opp_hedge, tmesh)) continue; // nothing to do on the boundary + + typedef typename std::map< halfedge_descriptor, std::size_t >::iterator Map_it; + std::pair insert_res= + ccs.insert( std::make_pair(*uf.find( p.second ), index) ); + if (insert_res.second) ++index; + + stacks_per_cc[ insert_res.first->second ].push_back( prev(opp_hedge, tmesh) ); + stacks_per_cc[ insert_res.first->second ].push_back( next(opp_hedge, tmesh) ); + faces_per_cc[ insert_res.first->second ].insert( face(opp_hedge, tmesh) ); + } + + std::size_t nb_ccs_to_be_explored = nb_cc; + index=0; + //explore the cc's + do{ + // try to extract one more face for a given cc + do{ + CGAL_assertion( !exploration_finished[index] ); + halfedge_descriptor hd = stacks_per_cc[index].back(); + stacks_per_cc[index].pop_back(); + hd = opposite(hd, tmesh); + if ( !is_border(hd,tmesh) && !marked_faces.count(face(hd, tmesh) ) ) + { + if ( faces_per_cc[index].insert( face(hd, tmesh) ).second ) + { + stacks_per_cc[index].push_back( next(hd, tmesh) ); + stacks_per_cc[index].push_back( prev(hd, tmesh) ); + break; + } + } + if (stacks_per_cc[index].empty()) break; + } + while(true); + // the exploration of a cc is finished when its stack is empty + exploration_finished[index]=stacks_per_cc[index].empty(); + if ( exploration_finished[index] ) --nb_ccs_to_be_explored; + if ( nb_ccs_to_be_explored==1 ) break; + while ( exploration_finished[(++index)%nb_cc] ); + index=index%nb_cc; + }while(true); + + /// \todo use the area criteria? this means maybe continue exploration of larger cc + // mark faces of completetly explored cc + for (index=0; index< nb_cc; ++index) + if( exploration_finished[index] ) + { + BOOST_FOREACH(face_descriptor fd, faces_per_cc[index]) + marked_faces.insert(fd); + } } - remove_face(fd, tmesh); + + // collect simplices to be removed + std::set vertices_to_keep; + std::set halfedges_to_keep; + BOOST_FOREACH(halfedge_descriptor hd, border) + if ( !marked_faces.count(face(opposite(hd, tmesh), tmesh)) ) + { + halfedges_to_keep.insert( hd ); + vertices_to_keep.insert( target(hd, tmesh) ); + } + + // backup next,prev relationships to set after patch removal + std::vector< std::pair > next_prev_halfedge_pairs; + halfedge_descriptor first_border_hd=*( halfedges_to_keep.begin() ); + halfedge_descriptor current_border_hd=first_border_hd; + do{ + halfedge_descriptor prev_border_hd=current_border_hd; + current_border_hd=next(current_border_hd, tmesh); + while( marked_faces.count( face( opposite(current_border_hd, tmesh), tmesh) ) ) + current_border_hd=next(opposite(current_border_hd, tmesh), tmesh); + next_prev_halfedge_pairs.push_back( std::make_pair(prev_border_hd, current_border_hd) ); + }while(current_border_hd!=first_border_hd); + + // collect vertices and edges to remove and do remove faces + std::set edges_to_remove; + std::set vertices_to_remove; + BOOST_FOREACH(face_descriptor fd, marked_faces) + { + halfedge_descriptor hd=halfedge(fd, tmesh); + for(int i=0; i<3; ++i) + { + if ( !halfedges_to_keep.count(hd) ) + edges_to_remove.insert( edge(hd, tmesh) ); + if ( !vertices_to_keep.count(target(hd,tmesh)) ) + vertices_to_remove.insert( target(hd,tmesh) ); + hd=next(hd, tmesh); + } + remove_face(fd, tmesh); + } + + // remove vertices + BOOST_FOREACH(vertex_descriptor vd, vertices_to_remove) + remove_vertex(vd, tmesh); + // remove edges + BOOST_FOREACH(edge_descriptor ed, edges_to_remove) + { + degenerate_edges_to_remove.erase(ed); + remove_edge(ed, tmesh); + } + + // add a new face, set all border edges pointing to it + // and update halfedge vertex of patch boundary vertices + face_descriptor new_face = add_face(tmesh); + typedef std::pair Pair_type; + BOOST_FOREACH(const Pair_type& p, next_prev_halfedge_pairs) + { + set_face(p.first, new_face, tmesh); + set_next(p.first, p.second, tmesh); + set_halfedge(target(p.first, tmesh), p.first, tmesh); + } + set_halfedge(new_face, first_border_hd, tmesh); + // triangulate the new face and update the coordinate of the central vertex + halfedge_descriptor new_hd=Euler::add_center_vertex(first_border_hd, tmesh); + put(vpmap, target(new_hd, tmesh), pt); + + BOOST_FOREACH(halfedge_descriptor hd, halfedges_around_target(new_hd, tmesh)) + if(is_degenerate_edge(edge(hd, tmesh), tmesh, np)) + degenerate_edges_to_remove.insert(edge(hd, tmesh)); + + CGAL_assertion( is_valid_polygon_mesh(tmesh) ); } - - // remove vertices - BOOST_FOREACH(vertex_descriptor vd, vertices_to_remove) - remove_vertex(vd, tmesh); - // remove edges - BOOST_FOREACH(edge_descriptor ed, edges_to_remove) - { - null_edges_to_remove.erase(ed); - remove_edge(ed, tmesh); - } - - // add a new face, set all border edges pointing to it - // and update halfedge vertex of patch boundary vertices - face_descriptor new_face = add_face(tmesh); - typedef std::pair Pair_type; - BOOST_FOREACH(const Pair_type& p, next_prev_halfedge_pairs) - { - set_face(p.first, new_face, tmesh); - set_next(p.first, p.second, tmesh); - set_halfedge(target(p.first, tmesh), p.first, tmesh); - } - set_halfedge(new_face, first_border_hd, tmesh); - // triangulate the new face and update the coordinate of the central vertex - halfedge_descriptor new_hd=Euler::add_center_vertex(first_border_hd, tmesh); - put(vpmap, target(new_hd, tmesh), pt); - - BOOST_FOREACH(halfedge_descriptor hd, halfedges_around_target(new_hd, tmesh)) - if ( traits.equal_3_object()(get(vpmap, target(hd, tmesh)), get(vpmap, source(hd, tmesh))) ) - null_edges_to_remove.insert(edge(hd, tmesh)); - - CGAL_assertion( is_valid_polygon_mesh(tmesh) ); } } - return nb_deg_faces; + return all_removed; } template -std::size_t remove_null_edges( - const EdgeRange& edge_range, - TriangleMesh& tmesh) +bool remove_degenerate_edges(const EdgeRange& edge_range, + TriangleMesh& tmesh) { - return remove_null_edges(edge_range, tmesh, - parameters::all_default()); + return remove_degenerate_edges(edge_range, tmesh, parameters::all_default()); } -/// \ingroup PMP_repairing_grp -/// removes the degenerate faces from a triangulated surface mesh. -/// A face is considered degenerate if two of its vertices share the same location, -/// or more generally if all its vertices are collinear. -/// -/// @pre `CGAL::is_triangle_mesh(tmesh)` -/// -/// @tparam TriangleMesh a model of `FaceListGraph` and `MutableFaceGraph` -/// @tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters" -/// -/// @param tmesh the triangulated surface mesh to be repaired -/// @param np optional \ref pmp_namedparameters "Named Parameters" described below -/// -/// \cgalNamedParamsBegin -/// \cgalParamBegin{vertex_point_map} the property map with the points associated to the vertices of `pmesh`. The type of this map is model of `ReadWritePropertyMap`. -/// If this parameter is omitted, an internal property map for -/// `CGAL::vertex_point_t` must be available in `TriangleMesh` -/// \cgalParamEnd -/// \cgalParamBegin{geom_traits} a geometric traits class instance. -/// The traits class must provide the nested type `Point_3`, -/// and the nested functors : -/// - `Compare_distance_3` to compute the distance between 2 points -/// - `Collinear_are_ordered_along_line_3` to check whether 3 collinear points are ordered -/// - `Collinear_3` to check whether 3 points are collinear -/// - `Less_xyz_3` to compare lexicographically two points -/// - `Equal_3` to check whether 2 points are identical -/// - for each functor Foo, a function `Foo foo_object()` -/// \cgalParamEnd -/// \cgalNamedParamsEnd -/// -/// \todo the function might not be able to remove all degenerate faces. -/// We should probably do something with the return type. -/// \return number of removed degenerate faces +// \ingroup PMP_repairing_grp +// removes the degenerate faces from a triangulated surface mesh. +// A face is considered degenerate if two of its vertices share the same location, +// or more generally if all its vertices are collinear. +// +// @pre `CGAL::is_triangle_mesh(tmesh)` +// +// @tparam TriangleMesh a model of `FaceListGraph` and `MutableFaceGraph` +// @tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters" +// +// @param tmesh the triangulated surface mesh to be repaired +// @param np optional \ref pmp_namedparameters "Named Parameters" described below +// +// \cgalNamedParamsBegin +// \cgalParamBegin{vertex_point_map} the property map with the points associated to the vertices of `pmesh`. +// The type of this map is model of `ReadWritePropertyMap`. +// If this parameter is omitted, an internal property map for +// `CGAL::vertex_point_t` must be available in `TriangleMesh` +// \cgalParamEnd +// \cgalParamBegin{geom_traits} a geometric traits class instance. +// The traits class must provide the nested type `Point_3`, +// and the nested functors: +// - `Compare_distance_3` to compute the distance between 2 points +// - `Collinear_3` to check whether 3 points are collinear +// - `Less_xyz_3` to compare lexicographically two points +/// - `Equal_3` to check whether 2 points are identical. +/// For each functor Foo, a function `Foo foo_object()` must be provided. +// \cgalParamEnd +// \cgalNamedParamsEnd +// +// \todo the function might not be able to remove all degenerate faces. +// We should probably do something with the return type. +// +/// \return `true` if all degenerate faces were successfully removed, and `false` otherwise. template -std::size_t remove_degenerate_faces(TriangleMesh& tmesh, - const NamedParameters& np) +bool remove_degenerate_faces( TriangleMesh& tmesh, + const NamedParameters& np) { CGAL_assertion(CGAL::is_triangle_mesh(tmesh)); @@ -717,8 +887,9 @@ std::size_t remove_degenerate_faces(TriangleMesh& tmesh, typedef typename boost::property_traits::value_type Point_3; typedef typename boost::property_traits::reference Point_ref; + // First remove edges of length 0 - std::size_t nb_deg_faces = remove_null_edges(edges(tmesh), tmesh, np); + bool all_removed = remove_degenerate_edges(edges(tmesh), tmesh, np); #ifdef CGAL_PMP_REMOVE_DEGENERATE_FACES_DEBUG { @@ -731,10 +902,21 @@ std::size_t remove_degenerate_faces(TriangleMesh& tmesh, // Then, remove triangles made of 3 collinear points std::set degenerate_face_set; - BOOST_FOREACH(face_descriptor fd, faces(tmesh)) - if ( is_degenerate_triangle_face(fd, tmesh, vpmap, traits) ) - degenerate_face_set.insert(fd); - nb_deg_faces+=degenerate_face_set.size(); + degenerate_faces(tmesh, std::inserter(degenerate_face_set, degenerate_face_set.begin()), np); +// Ignore faces with null edges + if (!all_removed) + { + BOOST_FOREACH(edge_descriptor ed, edges(tmesh)) + { + if ( traits.equal_3_object()(get(vpmap, target(ed, tmesh)), get(vpmap, source(ed, tmesh))) ) + { + halfedge_descriptor h = halfedge(ed, tmesh); + if (!is_border(h, tmesh)) degenerate_face_set.erase(face(h, tmesh)); + h=opposite(h, tmesh); + if (!is_border(h, tmesh)) degenerate_face_set.erase(face(h, tmesh)); + } + } + } // first remove degree 3 vertices that are part of a cap // (only the vertex in the middle of the opposite edge) @@ -747,7 +929,7 @@ std::size_t remove_degenerate_faces(TriangleMesh& tmesh, BOOST_FOREACH(halfedge_descriptor hd, halfedges_around_face(halfedge(fd, tmesh), tmesh)) { vertex_descriptor vd = target(hd, tmesh); - if (degree(vd, tmesh) == 3) + if (degree(vd, tmesh) == 3 && is_border(vd, tmesh)==GT::null_halfedge()) { vertices_to_remove.insert(vd); break; @@ -763,7 +945,7 @@ std::size_t remove_degenerate_faces(TriangleMesh& tmesh, degenerate_face_set.erase( face(hd2, tmesh) ); // remove the central vertex and check if the new face is degenerated hd=CGAL::Euler::remove_center_vertex(hd, tmesh); - if (is_degenerate_triangle_face(face(hd, tmesh), tmesh, vpmap, traits)) + if (is_degenerate_triangle_face(face(hd, tmesh), tmesh, np)) { degenerate_face_set.insert( face(hd, tmesh) ); } @@ -855,15 +1037,17 @@ std::size_t remove_degenerate_faces(TriangleMesh& tmesh, { Euler::flip_edge(edge_to_flip, tmesh); } + else + { + all_removed=false; #ifdef CGAL_PMP_REMOVE_DEGENERATE_FACES_DEBUG - else{ std::cout << " WARNING: flip is not possible\n"; // \todo Let p and q be the vertices opposite to `edge_to_flip`, and let // r be the vertex of `edge_to_flip` that is the furthest away from // the edge `pq`. In that case I think we should remove all the triangles // so that the triangle pqr is in the mesh. - } #endif + } } } else @@ -964,7 +1148,7 @@ std::size_t remove_degenerate_faces(TriangleMesh& tmesh, // preliminary step to check if the operation is possible // sort the boundary points along the common supporting line // we first need a reference point - typedef Less_vertex_point Less_vertex; + typedef internal::Less_vertex_point Less_vertex; std::pair< typename std::set::iterator, typename std::set::iterator > ref_vertices = @@ -1278,10 +1462,9 @@ std::size_t remove_degenerate_faces(TriangleMesh& tmesh, } } - return nb_deg_faces; + return all_removed; } - template std::size_t remove_degenerate_faces(TriangleMesh& tmesh) { @@ -1289,52 +1472,207 @@ std::size_t remove_degenerate_faces(TriangleMesh& tmesh) CGAL::Polygon_mesh_processing::parameters::all_default()); } -template -std::size_t duplicate_non_manifold_vertices(TriangleMesh& tm, Vpm vpm) +namespace internal { + +template +struct Vertex_collector { + typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; + + void collect_vertices(vertex_descriptor v1, vertex_descriptor v2) + { + std::vector& verts = collections[v1]; + if(verts.empty()) + verts.push_back(v1); + verts.push_back(v2); + } + + void dump(OutputIterator out) + { + typedef std::pair > Pair_type; + BOOST_FOREACH(const Pair_type& p, collections) { + *out++ = p.second; + } + } + + std::map > collections; +}; + +template +struct Vertex_collector +{ + typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; + void collect_vertices(vertex_descriptor, vertex_descriptor) + {} + + void dump(Emptyset_iterator) + {} +}; + +} // end namespace internal + +/// \ingroup PMP_repairing_grp +/// checks whether a vertex of a polygon mesh is non-manifold. +/// +/// @tparam PolygonMesh a model of `HalfedgeListGraph` +/// +/// @param v a vertex of `pm` +/// @param pm a triangle mesh containing `v` +/// +/// \sa `duplicate_non_manifold_vertices()` +/// +/// \return `true` if the vertex is non-manifold, `false` otherwise. +template +bool is_non_manifold_vertex(typename boost::graph_traits::vertex_descriptor v, + const PolygonMesh& pm) +{ + typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; + boost::unordered_set halfedges_handled; + + std::size_t incident_null_faces_counter = 0; + BOOST_FOREACH(halfedge_descriptor h, halfedges_around_target(v, pm)) + { + halfedges_handled.insert(h); + if(CGAL::is_border(h, pm)) + ++incident_null_faces_counter; + } + + if(incident_null_faces_counter > 1) + { + // The vertex is the sole connection between two connected components --> non-manifold + return true; + } + + BOOST_FOREACH(halfedge_descriptor h, halfedges(pm)) + { + if(v == target(h, pm)) + { + // More than one umbrella incident to 'v' --> non-manifold + if(halfedges_handled.count(h) == 0) + return true; + } + } + + return false; +} + +/// \ingroup PMP_repairing_grp +/// duplicates all the non-manifold vertices of the input mesh. +/// +/// @tparam TriangleMesh a model of `HalfedgeListGraph` and `MutableHalfedgeGraph` +/// @tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters" +/// +/// @param tm the triangulated surface mesh to be repaired +/// @param np optional \ref pmp_namedparameters "Named Parameters" described below +/// +/// \cgalNamedParamsBegin +/// \cgalParamBegin{vertex_point_map} the property map with the points associated to the vertices of `pmesh`. +/// The type of this map is model of `ReadWritePropertyMap`. +/// If this parameter is omitted, an internal property map for +/// `CGAL::vertex_point_t` should be available in `TriangleMesh` +/// \cgalParamEnd +/// \cgalParamBegin{vertex_is_constrained_map} a writable property map with `vertex_descriptor` +/// as key and `bool` as `value_type`. `put(pmap, v, true)` will be called for each duplicated +/// vertices, as well as the original non-manifold vertex in the input mesh. +/// \cgalParamEnd +/// \cgalParamBegin{output_iterator} a model of `OutputIterator` with value type +/// `std::vector`. The first vertex of each vector is a non-manifold vertex +/// of the input mesh, followed by the new vertices that were created to fix this precise +/// non-manifold configuration. +/// \cgalParamEnd +/// \cgalNamedParamsEnd +/// +/// \return the number of vertices created. +template +std::size_t duplicate_non_manifold_vertices(TriangleMesh& tm, + const NamedParameters& np) +{ + CGAL_assertion(CGAL::is_triangle_mesh(tm)); + + using boost::get_param; + using boost::choose_param; + typedef boost::graph_traits GT; typedef typename GT::vertex_descriptor vertex_descriptor; typedef typename GT::halfedge_descriptor halfedge_descriptor; + typedef typename GetVertexPointMap::type VertexPointMap; + VertexPointMap vpm = choose_param(get_param(np, internal_np::vertex_point), + get_property_map(vertex_point, tm)); + + typedef typename boost::lookup_named_param_def < + internal_np::vertex_is_constrained_t, + NamedParameters, + Constant_property_map // default (no constraint pmap) + > ::type VerticesMap; + VerticesMap cmap + = choose_param(get_param(np, internal_np::vertex_is_constrained), + Constant_property_map(false)); + + typedef typename boost::lookup_named_param_def < + internal_np::output_iterator_t, + NamedParameters, + Emptyset_iterator + > ::type Output_iterator; + Output_iterator out + = choose_param(get_param(np, internal_np::output_iterator), + Emptyset_iterator()); + + internal::Vertex_collector dmap; boost::unordered_set vertices_handled; boost::unordered_set halfedges_handled; - std::size_t nb_new_vertices=0; + std::size_t nb_new_vertices = 0; std::vector non_manifold_cones; BOOST_FOREACH(halfedge_descriptor h, halfedges(tm)) { - if (halfedges_handled.insert(h).second) + // If 'h' is not visited yet, we walk around the target of 'h' and mark these + // halfedges as visited. Thus, if we are here and the target is already marked as visited, + // it means that the vertex is non manifold. + if(halfedges_handled.insert(h).second) { vertex_descriptor vd = target(h, tm); - if ( !vertices_handled.insert(vd).second ) + if(!vertices_handled.insert(vd).second) { + put(cmap, vd, true); // store the originals non_manifold_cones.push_back(h); } else + { set_halfedge(vd, h, tm); - halfedge_descriptor start=opposite(next(h, tm), tm); - h=start; - do{ + } + + halfedge_descriptor start = opposite(next(h, tm), tm); + h = start; + do + { halfedges_handled.insert(h); - h=opposite(next(h, tm), tm); - }while(h!=start); + h = opposite(next(h, tm), tm); + } + while(h != start); } } - if (!non_manifold_cones.empty()) { + if(!non_manifold_cones.empty()) + { BOOST_FOREACH(halfedge_descriptor h, non_manifold_cones) { halfedge_descriptor start = h; vertex_descriptor new_vd = add_vertex(tm); ++nb_new_vertices; + put(cmap, new_vd, true); // store the duplicates + dmap.collect_vertices(target(h, tm), new_vd); put(vpm, new_vd, get(vpm, target(h, tm))); set_halfedge(new_vd, h, tm); - do{ + do + { set_target(h, new_vd, tm); - h=opposite(next(h, tm), tm); - } while(h!=start); + h = opposite(next(h, tm), tm); + } + while(h != start); } + dmap.dump(out); } return nb_new_vertices; @@ -1343,12 +1681,9 @@ std::size_t duplicate_non_manifold_vertices(TriangleMesh& tm, Vpm vpm) template std::size_t duplicate_non_manifold_vertices(TriangleMesh& tm) { - return duplicate_non_manifold_vertices(tm, get(vertex_point, tm)); + return duplicate_non_manifold_vertices(tm, parameters::all_default()); } -/// \endcond - - /// \ingroup PMP_repairing_grp /// removes the isolated vertices from any polygon mesh. /// A vertex is considered isolated if it is not incident to any simplex diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_polygon_soup.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_polygon_soup.h new file mode 100644 index 00000000000..7ac9ac2a1ba --- /dev/null +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_polygon_soup.h @@ -0,0 +1,1035 @@ +// Copyright (c) 2018 GeometryFactory (France). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org). +// You can redistribute it and/or modify it under the terms of the GNU +// General Public License as published by the Free Software Foundation, +// either version 3 of the License, or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: GPL-3.0+ +// +// Author(s) : Mael Rouxel-Labbé + +#ifndef CGAL_POLYGON_MESH_PROCESSING_REPAIR_POLYGON_SOUP +#define CGAL_POLYGON_MESH_PROCESSING_REPAIR_POLYGON_SOUP + +#include + +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#ifdef CGAL_PMP_REPAIR_POLYGON_SOUP_VERBOSE_PP + #ifndef CGAL_PMP_REPAIR_POLYGON_SOUP_VERBOSE + #define CGAL_PMP_REPAIR_POLYGON_SOUP_VERBOSE + #endif +#endif + +namespace CGAL { + +namespace Polygon_mesh_processing { + +namespace internal { + +template +struct Polygon_types +{ + typedef typename boost::range_value::type Point_3; + typedef typename boost::range_value::type Polygon_3; + + typedef typename boost::range_iterator::type V_ID_iterator; + typedef typename std::iterator_traits::value_type V_ID; + typedef typename std::vector::size_type P_ID; +}; + +template +struct GetPolygonGeomTraits +{ + typedef typename boost::lookup_named_param_def < + internal_np::geom_traits_t, + NamedParameters, + typename CGAL::Kernel_traits< + typename internal::Polygon_types< + PointRange, PolygonRange>::Point_3 >::type + > ::type type; +}; + +template +void print_polygon(Stream& out, const Polygon& polygon) +{ + const std::size_t polygon_size = polygon.size(); + out << "(" << polygon_size << ")"; + for(std::size_t i=0; i +struct Vertex_ID_comparer +{ + Vertex_ID_comparer(const PointRange& points, const Traits& traits = Traits()) + : points(points), traits(traits) + { } + + template + bool operator()(const VID id_1, const VID id_2) const { + return traits.less_xyz_3_object()(points[id_1], points[id_2]); + } + +private: + const PointRange& points; + const Traits& traits; +}; + +template +bool polygon_has_unique_vertices(const PointRange& points, + const Polygon& polygon, + const Traits& traits = Traits()) +{ + typedef Vertex_ID_comparer Comparer; + + Comparer comp(points, traits); + std::set unique_vertices(comp); + unique_vertices.insert(polygon.begin(), polygon.end()); + + return (unique_vertices.size() == polygon.size()); +} + +template +bool simplify_polygon(PointRange& points, + Polygon& polygon, + const Traits& traits = Traits()) +{ + const std::size_t ini_polygon_size = polygon.size(); + + // Start at the last since if two points are identical, the second one gets removed. + // By starting at 'last', we ensure that 'to_remove' is ordered from closest to .begin() + // to closest to .end() + std::size_t last = ini_polygon_size - 1, i = last; + bool stop = false; + std::vector to_remove; + + do + { + std::size_t next_i = (i == last) ? 0 : i+1; + stop = (next_i == last); + + while(polygon[i] == polygon[next_i] || // combinatorial equality + traits.equal_3_object()(points[polygon[i]], points[polygon[next_i]])) // geometric equality + { + to_remove.push_back(next_i); +#ifdef CGAL_PMP_REPAIR_POLYGON_SOUP_VERBOSE_PP + std::cout << "Duplicate point: polygon[" << next_i << "] = " << polygon[next_i] << std::endl; +#endif + next_i = (next_i == last) ? 0 : next_i+1; + + // Every duplicate in front of 'last' (circularly-speaking) has already been cleared + if(next_i == last) + { + stop = true; + break; + } + } + + i = next_i; + } + while(!stop); + + while(!to_remove.empty()) + { + polygon.erase(polygon.begin() + to_remove.back()); + to_remove.pop_back(); + } + + const std::size_t removed_points_n = ini_polygon_size - polygon.size(); + return (removed_points_n != 0); +} + +// \ingroup PMP_repairing_grp +// +// For each polygon of the soup, removes consecutive identical (in a geometric sense) points. +// +// \tparam PointRange a model of the concept `RandomAccessContainer` whose value type is the point type. +// \tparam PolygonRange a model of the concept `SequenceContainer` +// whose value_type is itself a model of the concept `SequenceContainer` +// whose value_type is `std::size_t`. +// \tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters" +// +// \param points points of the soup of polygons. +// \param polygons a vector of polygons. Each element in the vector describes a polygon +// using the indices of the points in `points`. +// \param np optional \ref pmp_namedparameters "Named Parameters" described below +// +// \cgalNamedParamsBegin +// \cgalParamBegin{geom_traits} a geometric traits class instance. +// The traits class must provide the nested functor `Equal_3` +// to compare lexicographically two points a function `Equal_3 equal_3_object()`. +// \cgalParamEnd +// \cgalNamedParamsEnd +// +template +std::size_t simplify_polygons_in_polygon_soup(PointRange& points, + PolygonRange& polygons, + const Traits& traits = Traits()) +{ + typedef typename Polygon_types::P_ID P_ID; + typedef typename Polygon_types::Polygon_3 Polygon_3; + + std::size_t simplified_polygons_n = 0; + + for(P_ID polygon_index=0, end=polygons.size(); polygon_index!=end; ++polygon_index) + { + Polygon_3& polygon = polygons[polygon_index]; + if(polygon.size() <= 1) + continue; + + if(simplify_polygon(points, polygon, traits)) + ++simplified_polygons_n; + } + +#ifdef CGAL_PMP_REPAIR_POLYGON_SOUP_VERBOSE + if(simplified_polygons_n > 0) + std::cout << "Cleaned consecutive duplicate vertices in " << simplified_polygons_n << " polygon(s)" << std::endl; +#endif + + return simplified_polygons_n; +} + +// \ingroup PMP_repairing_grp +// +// Splits "pinched" polygons, that is polygons for which a point appears more than once, +// into multiple non-pinched polygons. +// +// \tparam PointRange a model of the concept `RandomAccessContainer` whose value type is the point type. +// \tparam PolygonRange a model of the concept `SequenceContainer` +// whose value_type is itself a model of the concepts `SequenceContainer` +// and `Swappable` whose value_type is `std::size_t`. +// \tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters" +// +// \param points points of the soup of polygons. +// \param polygons a vector of polygons. Each element in the vector describes a polygon +// using the indices of the points in `points`. +// \param np optional \ref pmp_namedparameters "Named Parameters" described below +// +// \cgalNamedParamsBegin +// \cgalParamBegin{geom_traits} a geometric traits class instance. +// The traits class must provide the nested functor `Less_xyz_3` +// to compare lexicographically two points a function `Less_xyz_3 less_xyz_3_object()`. +// \cgalParamEnd +// \cgalNamedParamsEnd +// +template +std::size_t split_pinched_polygons_in_polygon_soup(PointRange& points, + PolygonRange& polygons, + const Traits& traits = Traits()) +{ + typedef typename Polygon_types::P_ID P_ID; + typedef typename Polygon_types::Point_3 Point_3; + typedef typename Polygon_types::Polygon_3 Polygon_3; + + typedef typename Traits::Less_xyz_3 Less_xyz_3; + + std::size_t new_polygons_n = 0; + + // It is important that polygons.size() is re-evaluated at each loop iteration + // because new polygons are intentionally added at the back of 'polygons' to also be examined + for(P_ID polygon_index=0; polygon_index < polygons.size(); ++polygon_index) + { + Polygon_3& polygon = polygons[polygon_index]; + const std::size_t ini_polygon_size = polygon.size(); + +#ifdef CGAL_PMP_REPAIR_POLYGON_SOUP_VERBOSE_PP + std::cout << "Input polygon: "; + internal::print_polygon(std::cout, polygon); +#endif + + if(ini_polygon_size <= 3) + continue; + + // 'polygon' must not have consecutive duplicates + CGAL_assertion(!simplify_polygon(points, polygon, traits)); + + typedef std::map Unique_point_container; + Unique_point_container unique_points(traits.less_xyz_3_object()); + + for(std::size_t i=0, polygon_size = polygon.size(); i is_insert_successful = + unique_points.insert(std::make_pair(p, i)); + + if(!is_insert_successful.second) + { +#ifdef CGAL_PMP_REPAIR_POLYGON_SOUP_VERBOSE + std::cout << "Pinched polygon: "; + internal::print_polygon(std::cout, polygon); +#endif + + // We have already met that point, split the polygon into two smaller polygons + std::size_t prev_id = is_insert_successful.first->second; + CGAL_assertion(prev_id < i-1); + + Polygon_3 split_polygon_1(polygon.begin() + prev_id, polygon.begin() + i); + CGAL_postcondition(internal::polygon_has_unique_vertices(points, split_polygon_1, traits)); + + Polygon_3 split_polygon_2; // might be pinched too, but it'll be checked later + split_polygon_2.insert(split_polygon_2.end(), polygon.begin(), polygon.begin() + prev_id); + split_polygon_2.insert(split_polygon_2.end(), polygon.begin() + i, polygon.end()); + +#ifdef CGAL_PMP_REPAIR_POLYGON_SOUP_VERBOSE_PP + std::cout << "New polygons:" << std::endl; + std::cout << "P1:"; + internal::print_polygon(std::cout, split_polygon_1); + + std::cout << "P2:"; + internal::print_polygon(std::cout, split_polygon_2); +#endif + + std::swap(polygon, split_polygon_1); + polygons.push_back(split_polygon_2); + + ++new_polygons_n; + break; + } + } + } + + return new_polygons_n; +} + +// \ingroup PMP_repairing_grp +// +// Removes polygons with fewer than 2 points from the soup. +// +// \tparam PointRange a model of the concept `Container` whose value type is the point type. +// \tparam PolygonRange a model of the concept `SequenceContainer` +// whose value_type is itself a model of the concept `Container` +// whose value_type is `std::size_t`. +// \tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters" +// +// \param points points of the soup of polygons. +// \param polygons a vector of polygons. Each element in the vector describes a polygon +// using the indices of the points in `points`. +// +template +std::size_t remove_invalid_polygons_in_polygon_soup(PointRange& /*points*/, + PolygonRange& polygons) +{ + std::vector to_remove; + const std::size_t ini_polygons_size = polygons.size(); + for(std::size_t polygon_index=0; polygon_index!=ini_polygons_size; ++polygon_index) + { + if(polygons[polygon_index].size() <= 2) + { +#ifdef CGAL_PMP_REPAIR_POLYGON_SOUP_VERBOSE_PP + std::cout << "Invalid polygon:"; + print_polygon(std::cout, polygons[polygon_index]); +#endif + to_remove.push_back(polygon_index); + } + } + + while(!to_remove.empty()) + { + polygons.erase(polygons.begin() + to_remove.back()); + to_remove.pop_back(); + } + + const std::size_t removed_polygons_n = ini_polygons_size - polygons.size(); + +#ifdef CGAL_PMP_REPAIR_POLYGON_SOUP_VERBOSE + if(removed_polygons_n > 0) + std::cout << "Removed " << removed_polygons_n << " invalid polygon(s)" << std::endl; +#endif + + return removed_polygons_n; +} + +} // end namespace internal + +template +std::size_t remove_degenerate_polygons_in_polygon_soup(PointRange& points, + PolygonRange& polygons) +{ + return remove_degenerate_polygons_in_polygon_soup(points, polygons, CGAL::parameters::all_default()); +} + +/// \ingroup PMP_repairing_grp +/// +/// Removes the isolated points from a polygon soup. +/// A point is considered isolated if it does not appear in any polygon of the soup. +/// +/// \tparam PointRange a model of the concept `SequenceContainer` whose value type is the point type. +/// \tparam PolygonRange a model of the concept `RandomAccessContainer` +/// whose value_type is itself a model of the concept `RandomAccessContainer` +/// whose value_type is `std::size_t`. +/// +/// \param points points of the soup of polygons. +/// \param polygons a vector of polygons. Each element in the vector describes a polygon +/// using the indices of the points in `points`. +/// +/// \returns the number of removed isolated points +/// +template +std::size_t remove_isolated_points_in_polygon_soup(PointRange& points, + PolygonRange& polygons) +{ + typedef typename internal::Polygon_types::P_ID P_ID; + typedef typename internal::Polygon_types::Polygon_3 Polygon_3; + + if(points.empty()) + return 0; + + // Go through all the polygons to find points that are never used. + const std::size_t ini_points_size = points.size(); + std::vector visited(ini_points_size, false); + std::vector id_remapping(ini_points_size); + for(std::size_t i=0; i 0) + std::cout << "Removed " << removed_points_n << " isolated point(s)" << std::endl; +#endif + + return removed_points_n; +} + +/// \ingroup PMP_repairing_grp +/// +/// Merges the duplicate points in a polygon soup. +/// Note that the index of a point that is merged with another point will thus change +/// in all the polygons that the point appears in. +/// +/// \tparam PointRange a model of the concepts `SequenceContainer` and `Swappable` +/// whose value type is the point type. +/// \tparam PolygonRange a model of the concept `RandomAccessContainer` +/// whose value_type is itself a model of the concept `RandomAccessContainer` +/// whose value_type is `std::size_t`. +/// \tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters" +/// +/// \param points points of the soup of polygons. +/// \param polygons a vector of polygons. Each element in the vector describes a polygon +/// using the indices of the points in `points`. +/// \param np optional \ref pmp_namedparameters "Named Parameters" described below +/// +/// \cgalNamedParamsBegin +/// \cgalParamBegin{geom_traits} a geometric traits class instance. +/// The traits class must provide the nested functor `Less_xyz_3` +/// to compare lexicographically two points a function `Less_xyz_3 less_xyz_3_object()`. +/// \cgalParamEnd +/// \cgalNamedParamsEnd +/// +/// \returns the number of removed points +/// +template +std::size_t merge_duplicate_points_in_polygon_soup(PointRange& points, + PolygonRange& polygons, + const NamedParameters& np) +{ + typedef typename internal::Polygon_types::P_ID P_ID; + typedef typename internal::Polygon_types::Point_3 Point_3; + typedef typename internal::Polygon_types::Polygon_3 Polygon_3; + + using boost::get_param; + using boost::choose_param; + + typedef typename internal::GetPolygonGeomTraits::type Traits; + Traits traits = choose_param(get_param(np, internal_np::geom_traits), Traits()); + + typedef typename Traits::Less_xyz_3 Less_xyz_3; + + const std::size_t ini_points_n = points.size(); + std::vector point_index(ini_points_n, 0); + + typedef std::map Unique_point_container; + Unique_point_container point_to_id(traits.less_xyz_3_object()); + + std::vector unique_points; + unique_points.reserve(ini_points_n); + + for(std::size_t i=0; i is_insert_successful = + point_to_id.insert(std::make_pair(points[i], unique_points.size())); + +#ifdef CGAL_PMP_REPAIR_POLYGON_SOUP_VERBOSE_PP + if(!is_insert_successful.second) + std::cout << "points[" <second; + + if(id == unique_points.size()) + unique_points.push_back(points[i]); + point_index[i] = id; + } + + if(unique_points.size() != ini_points_n) + { + for(P_ID polygon_index=0, end=polygons.size(); polygon_index!=end; ++polygon_index) + { + Polygon_3& polygon = polygons[polygon_index]; +#ifdef CGAL_PMP_REPAIR_POLYGON_SOUP_VERBOSE_PP + std::cout << "Input polygon: "; + internal::print_polygon(std::cout, polygon); +#endif + + for(std::size_t i=0, polygon_size = polygon.size(); i +std::size_t merge_duplicate_points_in_polygon_soup(PointRange& points, + PolygonRange& polygons) +{ + return merge_duplicate_points_in_polygon_soup(points, polygons, CGAL::parameters::all_default()); +} + +namespace internal { + +// Find the position of the (arbitrarily chose) first point of the canonical point +// and whether we should order from left to right or the opposite +template +void canonical_polygon_markers(const PointRange& points, + const Polygon& polygon, + std::size_t& first, + bool& reversed, + const Traits& traits = Traits()) +{ + CGAL_precondition(polygon.size() > 0); + CGAL_precondition(polygon_has_unique_vertices(points, polygon, traits)); + + typedef typename boost::range_iterator::type V_ID_iterator; + typedef Vertex_ID_comparer Vertex_comparer; + + // Find the bottom-left-front-most point that will be the first point of the polygon + Vertex_comparer comp(points, traits); + V_ID_iterator min_id = std::min_element(polygon.begin(), polygon.end(), comp); + first = min_id - polygon.begin(); + +#ifdef CGAL_PMP_REPAIR_POLYGON_SOUP_VERBOSE_PP + std::cout << "first: " << first + << " points[" << *min_id << "] = " << points[*min_id] << std::endl; +#endif + + // Decide arbitrarily whether we are reading from left to right or the opposite + const std::size_t last = polygon.size() - 1; + std::size_t pos_prev = (first == 0) ? last : first - 1; + std::size_t pos_next = (first == last) ? 0 : first + 1; + + reversed = traits.less_xyz_3_object()(points[polygon[pos_prev]], points[polygon[pos_next]]); + +#ifdef CGAL_PMP_REPAIR_POLYGON_SOUP_VERBOSE_PP + std::cout << "pos_prev: " << pos_prev + << " points[" << polygon[pos_prev] << "] = " << points[polygon[pos_prev]] << std::endl; + std::cout << "pos_next: " << pos_next + << " points[" << polygon[pos_next] << "] = " << points[polygon[pos_next]] << std::endl; + std::cout << "reversed: " << std::boolalpha << reversed << std::endl; +#endif +} + +template +Polygon construct_canonical_polygon_with_markers(const Polygon& polygon, + const std::size_t first, + const bool reversed) +{ + const std::size_t polygon_size = polygon.size(); + Polygon canonical_polygon; + + if(reversed) + { + std::size_t rfirst = polygon_size - 1 - first; + canonical_polygon.insert(canonical_polygon.end(), polygon.rbegin() + rfirst, polygon.rend()); + canonical_polygon.insert(canonical_polygon.end(), polygon.rbegin(), polygon.rbegin() + rfirst); + } + else + { + canonical_polygon.insert(canonical_polygon.end(), polygon.begin() + first, polygon.end()); + canonical_polygon.insert(canonical_polygon.end(), polygon.begin(), polygon.begin() + first); + } + + CGAL_postcondition(canonical_polygon[0] == polygon[first]); + CGAL_postcondition(canonical_polygon.size() == polygon_size); + return canonical_polygon; +} + +// 'reversed' indicates whether the canonical polygon has the same order as input polygon. +template +Polygon construct_canonical_polygon(const PointRange& points, + const Polygon& polygon, + bool& reversed, + const Traits& traits = Traits()) +{ + if(polygon.size() < 2) + return polygon; + +#ifdef CGAL_PMP_REPAIR_POLYGON_SOUP_VERBOSE_PP + std::cout << "Input polygon:"; + internal::print_polygon(std::cout, polygon); +#endif + + std::size_t first; + canonical_polygon_markers(points, polygon, first, reversed, traits); + Polygon canonical_polygon = construct_canonical_polygon_with_markers(polygon, first, reversed); + +#ifdef CGAL_PMP_REPAIR_POLYGON_SOUP_VERBOSE_PP + std::cout << "Canonical polygon:"; + internal::print_polygon(std::cout, canonical_polygon); +#endif + + return canonical_polygon; +} + +template +Polygon construct_canonical_polygon(const PointRange& points, + const Polygon& polygon, + const Traits& traits = Traits()) +{ + bool useless = false; + return construct_canonical_polygon(points, polygon, useless, traits); +} + +template +struct Polygon_hash +{ + typedef std::size_t result_type; + typedef typename internal::Polygon_types::Polygon_3 Polygon_3; + + Polygon_hash(const PointRange& points, const PolygonRange& canonical_polygons, const Traits& traits) + : points(points), canonical_polygons(canonical_polygons), traits(traits) + { } + + template + result_type operator() (const Polygon_ID& polygon_index) const + { + const Polygon_3& canonical_polygon = canonical_polygons[polygon_index]; + + std::size_t seed = 0; + for(std::size_t i=0, end=canonical_polygon.size(); i +struct Polygon_equality_tester +{ + typedef bool result_type; + typedef typename internal::Polygon_types::Polygon_3 Polygon_3; + + Polygon_equality_tester(const PointRange& points, + const PolygonRange& canonical_polygons, + const Reversed_markers& reversed_markers, + const Traits& traits, + const bool same_orientation = false) + : points(points), + canonical_polygons(canonical_polygons), + reversed_markers(reversed_markers), + traits(traits), + same_orientation(same_orientation) + { } + + template + bool operator()(const Polygon_ID& polygon_index_1, const Polygon_ID& polygon_index_2) const + { + const Polygon_3& canonical_polygon_1 = canonical_polygons[polygon_index_1]; + const Polygon_3& canonical_polygon_2 = canonical_polygons[polygon_index_2]; + + if(same_orientation && + reversed_markers[polygon_index_1] != reversed_markers[polygon_index_2]) + return false; + + return (canonical_polygon_1 == canonical_polygon_2); + } + +private: + const PointRange& points; + const PolygonRange& canonical_polygons; + const Reversed_markers& reversed_markers; + const Traits& traits; + const bool same_orientation; +}; + +template +struct Duplicate_collector +{ + void collect_duplicates(const ValueType& v1, const ValueType& v2) + { + std::vector& verts = collections[v1]; + if(verts.empty()) + verts.push_back(v1); + verts.push_back(v2); + } + + void dump(OutputIterator out) + { + typedef std::pair > Pair_type; + BOOST_FOREACH(const Pair_type& p, collections) + *out++ = p.second; + } + + CGAL::cpp11::unordered_map > collections; +}; + +template +struct Duplicate_collector +{ + void collect_duplicates(const ValueType&, const ValueType&) { } + void dump(CGAL::Emptyset_iterator) { } +}; + +// \ingroup PMP_repairing_grp +// +// Collects duplicate polygons in a polygon soup, that is polygons that share the same vertices in the same +// order. +// +// \tparam PointRange a model of the concept `RandomAccessContainer` whose value type is the point type. +// \tparam PolygonRange a model of the concept `RandomAccessContainer` +// whose value_type is itself a model of the concepts `RandomAccessContainer` +// and `ReversibleContainer` whose value_type is `std::size_t`. +// \tparam DuplicateOutputIterator a model of `OutputIterator` with value type +// `std::vector >`. +// +// \param points points of the soup of polygons. +// \param polygons a vector of polygons. Each element in the vector describes a polygon +// using the indices of the points in `points`. +// \param out the output iterator in which duplicate polygons are put. Each entry is a vector of +// polygon ids `i0`, `i1`, etc. such that `polygons[i0] = polygons[i1] = ...` +// \param same_orientation whether two polygons should have the same orientation to be duplicates. +// +template +DuplicateOutputIterator collect_duplicate_polygons(const PointRange& points, + const PolygonRange& polygons, + DuplicateOutputIterator out, + const Traits& traits = Traits(), + const bool same_orientation = false) +{ + typedef typename internal::Polygon_types::P_ID P_ID; + + typedef internal::Polygon_hash Hasher; + typedef boost::dynamic_bitset<> Reversed_markers; + typedef internal::Polygon_equality_tester Equality; + typedef CGAL::cpp11::unordered_set Unique_polygons; + + const std::size_t polygons_n = polygons.size(); + + // We want the hash function to return the same value if the polygons are the same, + // regardless of circular permutations and different orientations. + PolygonRange canonical_polygons(polygons_n); + Reversed_markers is_reversed(polygons_n, 0); + for(P_ID polygon_index=0, end=polygons.size(); polygon_index!=end; ++polygon_index) + { + bool reversed; + canonical_polygons[polygon_index] = + internal::construct_canonical_polygon(points, polygons[polygon_index], reversed, traits); + + if(reversed) + is_reversed.set(polygon_index); + } + + Hasher hash(points, canonical_polygons, traits); + Equality equal(points, canonical_polygons, is_reversed, traits, same_orientation); + + Unique_polygons unique_polygons(polygons_n /*bucket size*/, hash, equal); + Duplicate_collector duplicates; + + for(P_ID polygon_index=0, end=polygons.size(); polygon_index!=end; ++polygon_index) + { + std::pair is_insert_successful = + unique_polygons.insert(polygon_index); + + if(!is_insert_successful.second) + { + const P_ID other_polygon_id = *(is_insert_successful.first); +#ifdef CGAL_PMP_REPAIR_POLYGON_SOUP_VERBOSE_PP + std::cout << "polygon: " << polygon_index << " is a duplicate of polygon: " << other_polygon_id << std::endl; +#endif + duplicates.collect_duplicates(other_polygon_id, polygon_index); + } + } + + duplicates.dump(out); + return out; +} + +} // end namespace internal + +/// \ingroup PMP_repairing_grp +/// +/// Merges the duplicate polygons in a polygon soup. Two polygons are duplicate if they share the same +/// vertices in the same order. Note that the first vertex of the polygon does not matter, that is +/// the triangle `0,1,2` is a duplicate of the triangle `2,0,1`. +/// +/// \tparam PointRange a model of the concept `RandomAccessContainer` whose value type is the point type. +/// \tparam PolygonRange a model of the concept `SequenceContainer` +/// whose value_type is itself a model of the concepts `RandomAccessContainer` +/// and `ReversibleContainer` whose value_type is `std::size_t`. +/// \tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters" +/// +/// \param points points of the soup of polygons. +/// \param polygons a vector of polygons. Each element in the vector describes a polygon +/// using the indices of the points in `points`. +/// \param np optional \ref pmp_namedparameters "Named Parameters", amongst those described below +/// +/// \cgalNamedParamsBegin +/// \cgalParamBegin{geom_traits} a geometric traits class instance. +/// The traits class must provide the nested functor `Less_xyz_3` +/// to compare lexicographically two points a function `Less_xyz_3 less_xyz_3_object()`. +/// \cgalParamEnd +/// \cgalParamBegin{erase_all_duplicates} +/// Parameter to indicate, when multiple polygons are duplicates, whether all the duplicate polygons +/// should be removed or if one (arbitrarily chosen) face should be kept. %Default is `false`. +/// \cgalParamEnd +/// \cgalParamBegin{require_same_orientation} +/// Parameter to indicate if polygon orientation should be taken into account when determining +/// whether two polygons are duplicates, that is, whether e.g. the triangles `0,1,2` and `0,2,1` +/// are duplicates. %Default is `false`. +/// \cgalParamEnd +/// \cgalNamedParamsEnd +/// +/// \returns the number of removed polygons +/// +template +std::size_t merge_duplicate_polygons_in_polygon_soup(const PointRange& points, + PolygonRange& polygons, + const NamedParameters& np) +{ + using boost::get_param; + using boost::choose_param; + + typedef typename internal::Polygon_types::P_ID P_ID; + + const bool erase_all_duplicates = choose_param(get_param(np, internal_np::erase_all_duplicates), false); + const bool same_orientation = choose_param(get_param(np, internal_np::require_same_orientation), false); + +#ifdef CGAL_PMP_REPAIR_POLYGON_SOUP_VERBOSE_PP + std::cout << "Only polygons with the same orientation are duplicates: " << std::boolalpha << same_orientation << std::endl; + std::cout << "Erase all duplicate polygons: " << std::boolalpha << erase_all_duplicates << std::endl; +#endif + + typedef typename internal::GetPolygonGeomTraits::type Traits; + Traits traits = choose_param(get_param(np, internal_np::geom_traits), Traits()); + + std::vector > all_duplicate_polygons; + internal::collect_duplicate_polygons(points, polygons, std::back_inserter(all_duplicate_polygons), traits, same_orientation); + + if(all_duplicate_polygons.empty()) + return 0; + +#ifdef CGAL_PMP_REPAIR_POLYGON_SOUP_VERBOSE_PP + std::cout << all_duplicate_polygons.size() << " duplicate(s)" << std::endl; +#endif + + // Move all polygons that will be removed to the end of container + const std::size_t init_polygons_n = polygons.size(); + std::size_t swap_position = init_polygons_n - 1; + + while(!all_duplicate_polygons.empty()) + { + const std::vector& duplicate_polygons = all_duplicate_polygons.back(); + CGAL_assertion(duplicate_polygons.size() >= 2); + + std::size_t i = erase_all_duplicates ? 0 : 1; + for(; i +std::size_t merge_duplicate_polygons_in_polygon_soup(PointRange& points, + PolygonRange& polygons) +{ + return merge_duplicate_polygons_in_polygon_soup(points, polygons, CGAL::parameters::all_default()); +} + +/// \ingroup PMP_repairing_grp +/// +/// Cleans a given polygon soup through various repairing operations. More precisely, this function +/// carries out the following tasks, in the same order as they are listed: +/// - merging of duplicate points, using the function +/// `CGAL::Polygon_mesh_processing::merge_duplicate_points_in_polygon_soup()`; +/// - simplification of polygons to remove geometrically identical consecutive vertices; +/// - splitting of "pinched" polygons, that is polygons in which a geometric position appears more than once. +/// The splitting process results in multiple non-pinched polygons; +/// - removal of invalid polygons, that is polygons with fewer than 2 vertices; +/// - removal of duplicate polygons, using the function +/// `CGAL::Polygon_mesh_processing::merge_duplicate_polygons_in_polygon_soup()`; +/// - removal of isolated points, +/// using the function `CGAL::Polygon_mesh_processing::remove_isolated_points_in_polygon_soup()`. +/// +/// Note that the point and polygon containers will be modified by the repairing operations, +/// and thus the indexation of the polygons will also be changed. +/// +/// \tparam PointRange a model of the concepts `SequenceContainer` and `Swappable` +/// and whose value type is the point type. +/// \tparam PolygonRange a model of the concept `SequenceContainer`. +/// whose value_type is itself a model of the concepts `SequenceContainer`, +/// `Swappable`, and `ReversibleContainer` whose value_type is `std::size_t`. +/// \tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters" +/// +/// \param points points of the soup of polygons. +/// \param polygons a vector of polygons. Each element in the vector describes a polygon +/// using the indices of the points in `points`. +/// \param np optional \ref pmp_namedparameters "Named Parameters", amongst those described below +/// +/// \cgalNamedParamsBegin +/// \cgalParamBegin{geom_traits} a geometric traits class instance. +/// The traits class must provide the nested functors : +/// - `Less_xyz_3` to compare lexicographically two points +/// - `Equal_3` to check whether 2 points are identical +/// +/// and, for each functor `Foo`, a function `Foo foo_object()`. +/// \cgalParamEnd +/// \cgalParamBegin{erase_all_duplicates} +/// Parameter forwarded to the function `merge_duplicate_polygons_in_polygon_soup()` to indicate, +/// when multiple polygons are duplicates, whether all the duplicate polygons +/// should be removed or if one (arbitrarily chosen) face should be kept. %Default is `false`. +/// \cgalParamEnd +/// \cgalParamBegin{require_same_orientation} +/// Parameter forwarded to the function `merge_duplicate_polygons_in_polygon_soup()` +/// to indicate if polygon orientation should be taken into account when determining whether +/// two polygons are duplicates, that is, whether e.g. the triangles `0,1,2` and `0,2,1` are duplicates. +/// %Default is `false`. +/// \cgalParamEnd +/// \cgalNamedParamsEnd +/// +template +void repair_polygon_soup(PointRange& points, + PolygonRange& polygons, + const NamedParameters& np) +{ + using boost::get_param; + using boost::choose_param; + + typedef typename internal::GetPolygonGeomTraits::type Traits; + Traits traits = choose_param(get_param(np, internal_np::geom_traits), Traits()); + +#ifdef CGAL_PMP_REPAIR_POLYGON_SOUP_VERBOSE + std::cout << "Repairing soup with " << points.size() << " points and " << polygons.size() << " polygons" << std::endl; +#endif + + merge_duplicate_points_in_polygon_soup(points, polygons, np); + internal::simplify_polygons_in_polygon_soup(points, polygons, traits); + internal::split_pinched_polygons_in_polygon_soup(points, polygons, traits); + internal::remove_invalid_polygons_in_polygon_soup(points, polygons); + merge_duplicate_polygons_in_polygon_soup(points, polygons, np); + remove_isolated_points_in_polygon_soup(points, polygons); +} + +template +void repair_polygon_soup(PointRange& points, + PolygonRange& polygons) +{ + return repair_polygon_soup(points, polygons, CGAL::parameters::all_default()); +} + +} // end namespace Polygon_mesh_processing + +} // end namespace CGAL + +#endif // CGAL_POLYGON_MESH_PROCESSING_REPAIR_POLYGON_SOUP diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/self_intersections.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/self_intersections.h index 230870511b8..9efc2527619 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/self_intersections.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/self_intersections.h @@ -235,7 +235,7 @@ self_intersections( const FaceRange& face_range, /** * \ingroup PMP_intersection_grp * detects and records self-intersections of a triangulated surface mesh. - * This function depends on the package \ref PkgBoxIntersectionDSummary + * This function depends on the package \ref PkgBoxIntersectionD * @pre `CGAL::is_triangle_mesh(tmesh)` * * @tparam TriangleMesh a model of `FaceListGraph` @@ -391,7 +391,7 @@ OutputIterator self_intersections(const FaceRange& face_range, /** * \ingroup PMP_intersection_grp * tests if a triangulated surface mesh self-intersects. - * This function depends on the package \ref PkgBoxIntersectionDSummary + * This function depends on the package \ref PkgBoxIntersectionD * @pre `CGAL::is_triangle_mesh(tmesh)` * * @tparam TriangleMesh a model of `FaceListGraph` @@ -431,7 +431,7 @@ bool does_self_intersect(const TriangleMesh& tmesh /** * \ingroup PMP_intersection_grp * tests if a set of faces of a triangulated surface mesh self-intersects. - * This function depends on the package \ref PkgBoxIntersectionDSummary + * This function depends on the package \ref PkgBoxIntersectionD * @pre `CGAL::is_triangle_mesh(tmesh)` * * @tparam FaceRange a range of `face_descriptor` diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/shape_predicates.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/shape_predicates.h new file mode 100644 index 00000000000..c1f0b7c040b --- /dev/null +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/shape_predicates.h @@ -0,0 +1,358 @@ +// Copyright (c) 2015, 2018 GeometryFactory (France). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org). +// You can redistribute it and/or modify it under the terms of the GNU +// General Public License as published by the Free Software Foundation, +// either version 3 of the License, or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: GPL-3.0+ +// +// +// Author(s) : Konstantinos Katrioplas, +// Mael Rouxel-Labbé + +#ifndef CGAL_POLYGON_MESH_PROCESSING_SHAPE_PREDICATES_H +#define CGAL_POLYGON_MESH_PROCESSING_SHAPE_PREDICATES_H + +#include + +#include +#include + +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +namespace CGAL { + +namespace Polygon_mesh_processing { + +/// \ingroup PMP_repairing_grp +/// checks whether an edge is degenerate. +/// An edge is considered degenerate if the geometric positions of its two extremities are identical. +/// +/// @tparam PolygonMesh a model of `HalfedgeGraph` +/// @tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters" +/// +/// @param e an edge of `pm` +/// @param pm polygon mesh containing `e` +/// @param np optional \ref pmp_namedparameters "Named Parameters" described below +/// +/// \cgalNamedParamsBegin +/// \cgalParamBegin{vertex_point_map} the property map with the points associated to the vertices of `pm`. +/// The type of this map is model of `ReadWritePropertyMap`. +/// If this parameter is omitted, an internal property map for +/// `CGAL::vertex_point_t` should be available in `PolygonMesh` +/// \cgalParamEnd +/// \cgalParamBegin{geom_traits} a geometric traits class instance. +/// The traits class must provide the nested type `Point_3`, +/// and the nested functor `Equal_3` to check whether two points are identical. +/// \cgalParamEnd +/// \cgalNamedParamsEnd +/// +/// \sa `degenerate_edges()` +/// +/// \return `true` if the edge `e` is degenerate, `false` otherwise. +template +bool is_degenerate_edge(typename boost::graph_traits::edge_descriptor e, + const PolygonMesh& pm, + const NamedParameters& np) +{ + using boost::get_param; + using boost::choose_param; + + typedef typename GetVertexPointMap::const_type VertexPointMap; + VertexPointMap vpmap = choose_param(get_param(np, internal_np::vertex_point), + get_const_property_map(vertex_point, pm)); + + typedef typename GetGeomTraits::type Traits; + Traits traits = choose_param(get_param(np, internal_np::geom_traits), Traits()); + + return traits.equal_3_object()(get(vpmap, source(e, pm)), get(vpmap, target(e, pm))); +} + +template +bool is_degenerate_edge(typename boost::graph_traits::edge_descriptor e, + const PolygonMesh& pm) +{ + return is_degenerate_edge(e, pm, parameters::all_default()); +} + +/// \ingroup PMP_repairing_grp +/// checks whether a triangle face is degenerate. +/// A triangle face is considered degenerate if the geometric positions of its vertices are collinear. +/// +/// @tparam TriangleMesh a model of `FaceGraph` +/// @tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters" +/// +/// @param f a triangle face of `tm` +/// @param tm a triangle mesh containing `f` +/// @param np optional \ref pmp_namedparameters "Named Parameters" described below +/// +/// \cgalNamedParamsBegin +/// \cgalParamBegin{vertex_point_map} the property map with the points associated to the vertices of `tm`. +/// The type of this map is model of `ReadWritePropertyMap`. +/// If this parameter is omitted, an internal property map for +/// `CGAL::vertex_point_t` should be available in `TriangleMesh` +/// \cgalParamEnd +/// \cgalParamBegin{geom_traits} a geometric traits class instance. +/// The traits class must provide the nested functor `Collinear_3` +/// to check whether three points are collinear. +/// \cgalParamEnd +/// \cgalNamedParamsEnd +/// +/// \sa `degenerate_faces()` +/// +/// \return `true` if the face `f` is degenerate, `false` otherwise. +template +bool is_degenerate_triangle_face(typename boost::graph_traits::face_descriptor f, + const TriangleMesh& tm, + const NamedParameters& np) +{ + CGAL_precondition(CGAL::is_triangle(halfedge(f, tm), tm)); + + using boost::get_param; + using boost::choose_param; + + typedef typename GetVertexPointMap::const_type VertexPointMap; + VertexPointMap vpmap = choose_param(get_param(np, internal_np::vertex_point), + get_const_property_map(vertex_point, tm)); + + typedef typename GetGeomTraits::type Traits; + Traits traits = choose_param(get_param(np, internal_np::geom_traits), Traits()); + + typename boost::graph_traits::halfedge_descriptor h = halfedge(f, tm); + + return traits.collinear_3_object()(get(vpmap, source(h, tm)), + get(vpmap, target(h, tm)), + get(vpmap, target(next(h, tm), tm))); +} + +template +bool is_degenerate_triangle_face(typename boost::graph_traits::face_descriptor f, + const TriangleMesh& tm) +{ + return CGAL::Polygon_mesh_processing::is_degenerate_triangle_face(f, tm, parameters::all_default()); +} + +/// \ingroup PMP_repairing_grp +/// checks whether a triangle face is needle. +/// A triangle is said to be a needle if its longest edge is much longer than its shortest edge. +/// +/// @tparam TriangleMesh a model of `FaceGraph` +/// @tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters" +/// +/// @param f a triangle face of `tm` +/// @param tm triangle mesh containing `f` +/// @param threshold a bound on the ratio of the longest edge length and the shortest edge length +/// @param np optional \ref pmp_namedparameters "Named Parameters" described below +/// +/// \cgalNamedParamsBegin +/// \cgalParamBegin{vertex_point_map} the property map with the points associated to the vertices of `tm`. +/// The type of this map is model of `ReadWritePropertyMap`. +/// If this parameter is omitted, an internal property map for +/// `CGAL::vertex_point_t` should be available in `TriangleMesh` +/// \cgalParamEnd +/// \cgalParamBegin{geom_traits} a geometric traits class instance. +/// The traits class must provide the nested type `FT` and +/// the nested functor `Compute_squared_distance_3`. +/// \cgalParamEnd +/// \cgalNamedParamsEnd +/// +/// \return the shortest halfedge if the triangle face is a needle, and a null halfedge otherwise. +/// If the face contains degenerate edges, a halfedge corresponding to one of these edges is returned. +template +typename boost::graph_traits::halfedge_descriptor +is_needle_triangle_face(typename boost::graph_traits::face_descriptor f, + const TriangleMesh& tm, + const double threshold, + const NamedParameters& np) +{ + CGAL_precondition(threshold >= 1.); + + using boost::get_param; + using boost::choose_param; + + typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; + + typedef typename GetVertexPointMap::const_type VertexPointMap; + VertexPointMap vpmap = choose_param(get_param(np, internal_np::vertex_point), + get_const_property_map(vertex_point, tm)); + + typedef typename GetGeomTraits::type Traits; + Traits traits = choose_param(get_param(np, internal_np::geom_traits), Traits()); + + typedef typename Traits::FT FT; + + CGAL::Halfedge_around_face_iterator hit, hend; + boost::tie(hit, hend) = CGAL::halfedges_around_face(halfedge(f, tm), tm); + CGAL_precondition(std::distance(hit, hend) == 3); + + const halfedge_descriptor h0 = *hit++; + FT sq_length = traits.compute_squared_distance_3_object()(get(vpmap, source(h0, tm)), + get(vpmap, target(h0, tm))); + + FT min_sq_length = sq_length, max_sq_length = sq_length; + halfedge_descriptor min_h = h0; + + for(; hit!=hend; ++hit) + { + const halfedge_descriptor h = *hit; + sq_length = traits.compute_squared_distance_3_object()(get(vpmap, source(h, tm)), + get(vpmap, target(h, tm))); + + if(max_sq_length < sq_length) + max_sq_length = sq_length; + + if(min_sq_length > sq_length) + { + min_h = h; + min_sq_length = sq_length; + } + } + + if(min_sq_length == 0) + return min_h; + + const FT sq_threshold = threshold * threshold; + if(max_sq_length / min_sq_length >= sq_threshold) + { + CGAL_assertion(min_h != boost::graph_traits::null_halfedge()); + return min_h; + } + else + return boost::graph_traits::null_halfedge(); +} + +template +typename boost::graph_traits::halfedge_descriptor +is_needle_triangle_face(typename boost::graph_traits::face_descriptor f, + const TriangleMesh& tm, + const double threshold) +{ + return is_needle_triangle_face(f, tm, threshold, parameters::all_default()); +} + +/// \ingroup PMP_repairing_grp +/// checks whether a triangle face is a cap. +/// A triangle is said to be a cap if one of the its angles is close to `180` degrees. +/// +/// @tparam TriangleMesh a model of `FaceGraph` +/// @tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters" +/// +/// @param f a triangle face of `tm` +/// @param tm triangle mesh containing `f` +/// @param threshold the cosine of a minimum angle such that if `f` has an angle greater than this bound, +/// it is a cap. The threshold is in range `[-1 0]` and corresponds to an angle +/// between `90` and `180` degrees. +/// @param np optional \ref pmp_namedparameters "Named Parameters" described below +/// +/// \cgalNamedParamsBegin +/// \cgalParamBegin{vertex_point_map} the property map with the points associated to the vertices of `tm`. +/// The type of this map is model of `ReadWritePropertyMap`. +/// If this parameter is omitted, an internal property map for +/// `CGAL::vertex_point_t` should be available in `TriangleMesh` +/// \cgalParamEnd +/// \cgalParamBegin{geom_traits} a geometric traits class instance. +/// The traits class must provide the nested type `Point_3` and +/// the nested functors `Compute_squared_distance_3`, `Construct_vector_3`, +/// and `Compute_scalar_product_3`. +/// \cgalParamEnd +/// \cgalNamedParamsEnd +/// +/// \return the halfedge opposite of the largest angle if the face is a cap, and a null halfedge otherwise. +template +typename boost::graph_traits::halfedge_descriptor +is_cap_triangle_face(typename boost::graph_traits::face_descriptor f, + const TriangleMesh& tm, + const double threshold, + const NamedParameters& np) +{ + CGAL_precondition(CGAL::is_triangle_mesh(tm)); + CGAL_precondition(threshold >= -1.); + CGAL_precondition(threshold <= 0.); + + using boost::get_param; + using boost::choose_param; + + typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; + typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; + + typedef typename GetVertexPointMap::const_type VertexPointMap; + VertexPointMap vpmap = choose_param(get_param(np, internal_np::vertex_point), + get_const_property_map(vertex_point, tm)); + + typedef typename GetGeomTraits::type Traits; + Traits traits = choose_param(get_param(np, internal_np::geom_traits), Traits()); + + typedef typename Traits::FT FT; + typedef typename Traits::Vector_3 Vector_3; + + const FT sq_threshold = threshold * threshold; + const halfedge_descriptor h0 = halfedge(f, tm); + + cpp11::array sq_lengths; + int pos = 0; + BOOST_FOREACH(halfedge_descriptor h, halfedges_around_face(h0, tm)) + { + const FT sq_d = traits.compute_squared_distance_3_object()(get(vpmap, source(h, tm)), + get(vpmap, target(h, tm))); + + // If even one edge is degenerate, it cannot be a cap + if(sq_d == 0) + return boost::graph_traits::null_halfedge(); + + sq_lengths[pos++] = sq_d; + } + + pos = 0; + BOOST_FOREACH(halfedge_descriptor h, halfedges_around_face(h0, tm)) + { + const vertex_descriptor v0 = source(h, tm); + const vertex_descriptor v1 = target(h, tm); + const vertex_descriptor v2 = target(next(h, tm), tm); + const Vector_3 a = traits.construct_vector_3_object()(get(vpmap, v1), get(vpmap, v2)); + const Vector_3 b = traits.construct_vector_3_object()(get(vpmap, v1), get(vpmap, v0)); + const FT dot_ab = traits.compute_scalar_product_3_object()(a, b); + const bool neg_sp = (dot_ab <= 0); + const FT sq_a = sq_lengths[(pos+1)%3]; + const FT sq_b = sq_lengths[pos]; + const FT sq_cos = dot_ab * dot_ab / (sq_a * sq_b); + + if(neg_sp && sq_cos >= sq_threshold) + return prev(h, tm); + + ++pos; + } + return boost::graph_traits::null_halfedge(); +} + +template +typename boost::graph_traits::halfedge_descriptor +is_cap_triangle_face(typename boost::graph_traits::face_descriptor f, + const TriangleMesh& tm, + const double threshold) +{ + return is_cap_triangle_face(f, tm, threshold, parameters::all_default()); +} + +} } // end namespaces CGAL and PMP + +#endif // CGAL_POLYGON_MESH_PROCESSING_SHAPE_PREDICATES_H diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/stitch_borders.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/stitch_borders.h index 830cca479a0..7b79a6c68b5 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/stitch_borders.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/stitch_borders.h @@ -32,18 +32,24 @@ #include #include +#include #include + #include +#include #include +#include #include -#include -#include -#include #include #include #include +#include +#include +#include +#include + #ifdef DOXYGEN_RUNNING #define CGAL_PMP_NP_TEMPLATE_PARAMETERS NamedParameters #define CGAL_PMP_NP_CLASS NamedParameters @@ -523,49 +529,106 @@ void stitch_borders_impl(PM& pmesh, run_stitch_borders(pmesh, to_stitch, uf_vertices, uf_handles); } -template -void stitch_boundary_cycle_2(PM& pmesh) +// \ingroup PMP_repairing_grp +// +// Stitches together, whenever possible, two halfedges of the same border. +// +// \tparam PolygonMesh a model of `FaceListGraph` and `MutableFaceGraph` +// \tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters" +// +// \param pm the polygon mesh to be modified by stitching +// \param np optional sequence of \ref pmp_namedparameters "Named Parameters" among the ones listed below +// +// \cgalNamedParamsBegin +// \cgalParamBegin{vertex_point_map} the property map with the points associated to the vertices of `pmesh`. +// If this parameter is omitted, an internal property map for `CGAL::vertex_point_t` must be available in `PolygonMesh`. +// \cgalParamEnd +// \cgalNamedParamsEnd +// +template +std::size_t stitch_boundary_cycles(PolygonMesh& pm, + const NamedParameters& np) { - typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; + using boost::choose_param; + using boost::get_param; - std::vector cycles; - BOOST_FOREACH(halfedge_descriptor hd, halfedges(pmesh)) + typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; + + typedef typename GetVertexPointMap::const_type VPMap; + VPMap vpm = choose_param(get_param(np, internal_np::vertex_point), + get_const_property_map(vertex_point, pm)); + + std::vector boundary_cycles; + extract_boundary_cycles(pm, std::back_inserter(boundary_cycles)); + + std::size_t stitched_boundary_cycles_n = 0; + + // A boundary cycle might need to be stitched starting from different extremities + // + // v11 ------ v10 + // | | + // v0 --- v1(v13) === v2(v12) v5(v9) === v6(v8) --- v7 + // | | + // v3 ------- v4 + // so we mark which edges have been stitched + cpp11::unordered_set stitched_hedges; + + BOOST_FOREACH(halfedge_descriptor h, boundary_cycles) { - if ( is_border(hd, pmesh) ) + std::vector stitching_starting_points; + halfedge_descriptor hn = next(h, pm); + while(hn != h) { - if ( hd < next(hd, pmesh) && next(next(hd, pmesh), pmesh) == hd ) + if(get(vpm, source(hn, pm)) == get(vpm, target(next(hn, pm), pm))) + stitching_starting_points.push_back(hn); + + hn = next(hn, pm); + } + + for(std::size_t i=0, end=stitching_starting_points.size(); i 0) // already treated + continue; + + std::vector > hedges_to_stitch; + + halfedge_descriptor hn = next(h, pm); + bool do_stitching = true; + do { - cycles.push_back(hd); + hedges_to_stitch.push_back(std::make_pair(h, hn)); + stitched_hedges.insert(h); + stitched_hedges.insert(hn); + + if(next(hn, pm) == h) + break; + + h = prev(h, pm); + hn = next(hn, pm); + + if(get(vpm, source(h, pm)) != get(vpm, target(hn, pm))) + do_stitching = false; } + while(do_stitching); + + internal::stitch_borders_impl(pm, hedges_to_stitch); + ++stitched_boundary_cycles_n; } } - BOOST_FOREACH(halfedge_descriptor hd, cycles) - { - halfedge_descriptor nhd = next(hd, pmesh); + return stitched_boundary_cycles_n; +} - //nhd and its opposite will be removed - //update face pointer - set_face(hd, face(opposite(nhd, pmesh), pmesh), pmesh); - set_halfedge(face(hd, pmesh), hd, pmesh); - //update next/prev pointers - halfedge_descriptor tmp = prev(opposite(nhd, pmesh), pmesh); - set_next(tmp, hd, pmesh); - tmp = next(opposite(nhd, pmesh), pmesh); - set_next(hd, tmp, pmesh); - //update vertex pointers - set_halfedge(source(hd, pmesh), opposite(hd, pmesh), pmesh); - set_halfedge(target(hd, pmesh), hd, pmesh); - - // remove the extra halfedges - remove_edge(edge(nhd, pmesh), pmesh); - } +template +std::size_t stitch_boundary_cycles(PolygonMesh& pm) +{ + return stitch_boundary_cycles(pm, CGAL::parameters::all_default()); } } //end of namespace internal - - /*! * \ingroup PMP_repairing_grp * Stitches together border halfedges in a polygon mesh. @@ -635,13 +698,15 @@ void stitch_borders(PolygonMesh& pmesh, const CGAL_PMP_NP_CLASS& np) VPMap vpm = choose_param(get_param(np, internal_np::vertex_point), get_const_property_map(vertex_point, pmesh)); + internal::stitch_boundary_cycles(pmesh, np); + internal::collect_duplicated_stitchable_boundary_edges(pmesh, std::back_inserter(hedge_pairs_to_stitch), internal::Less_for_halfedge(pmesh, vpm), vpm, np); stitch_borders(pmesh, hedge_pairs_to_stitch); - internal::stitch_boundary_cycle_2(pmesh); + internal::stitch_boundary_cycles(pmesh, np); } diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/transform.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/transform.h index efff419092c..cb2fac6ed76 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/transform.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/transform.h @@ -28,7 +28,7 @@ namespace CGAL{ namespace Polygon_mesh_processing{ /** - * \ingroup PkgPolygonMeshProcessing + * \ingroup PkgPolygonMeshProcessingRef * applies a transformation to every vertex of a `PolygonMesh`. * * @tparam Transformation a functor that has an `operator()(Point_3)`, with `Point_3` diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/triangulate_faces.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/triangulate_faces.h index be59a7eb69a..3c667639fca 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/triangulate_faces.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/triangulate_faces.h @@ -400,7 +400,7 @@ public: /** * \ingroup PMP_meshing_grp -* triangulates a single face of a polygon mesh. This function depends on the package \ref PkgTriangulation2Summary +* triangulates a single face of a polygon mesh. This function depends on the package \ref PkgTriangulation2 * @tparam PolygonMesh a model of `FaceListGraph` and `MutableFaceGraph` * @tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters" * @@ -449,7 +449,7 @@ bool triangulate_face(typename boost::graph_traits::face_descriptor /** * \ingroup PMP_meshing_grp -* triangulates given faces of a polygon mesh. This function depends on the package \ref PkgTriangulation2Summary +* triangulates given faces of a polygon mesh. This function depends on the package \ref PkgTriangulation2 * * @tparam FaceRange range of `boost::graph_traits::%face_descriptor`, model of `Range`. @@ -501,7 +501,7 @@ bool triangulate_faces(FaceRange face_range, PolygonMesh& pmesh) /** * \ingroup PMP_meshing_grp -* triangulates all faces of a polygon mesh. This function depends on the package \ref PkgTriangulation2Summary +* triangulates all faces of a polygon mesh. This function depends on the package \ref PkgTriangulation2 * @tparam PolygonMesh a model of `FaceListGraph` and `MutableFaceGraph` * @tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters" * diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_slicer.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_slicer.h index cda6a7e6c77..68d94378079 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_slicer.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_slicer.h @@ -44,7 +44,7 @@ namespace CGAL { -/// \ingroup PkgPolygonMeshProcessing +/// \ingroup PkgPolygonMeshProcessingRef /// Function object that computes the intersection of a plane with /// a triangulated surface mesh. /// @@ -63,7 +63,7 @@ namespace CGAL { /// orthogonal to a frame axis, the non-null coefficient being 1 or -1. /// The default is `true`. /// -/// The implemenation of this class depends on the package \ref PkgAABB_treeSummary. +/// The implemenation of this class depends on the package \ref PkgAABBTree. /// \todo Shall we document more in details what is required? /// `Traits` must provide: /// - `Plane_3` diff --git a/Polygon_mesh_processing/include/CGAL/Rigid_triangle_mesh_collision_detection.h b/Polygon_mesh_processing/include/CGAL/Rigid_triangle_mesh_collision_detection.h new file mode 100644 index 00000000000..71bc10f7f23 --- /dev/null +++ b/Polygon_mesh_processing/include/CGAL/Rigid_triangle_mesh_collision_detection.h @@ -0,0 +1,639 @@ +// Copyright (c) 2018 GeometryFactory (France). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org). +// You can redistribute it and/or modify it under the terms of the GNU +// General Public License as published by the Free Software Foundation, +// either version 3 of the License, or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: GPL-3.0+ +// +// +// Author(s) : Maxime Gimeno and Sebastien Loriot + + +#ifndef CGAL_RIGID_TRIANGLE_MESH_COLLISION_DETECTION_H +#define CGAL_RIGID_TRIANGLE_MESH_COLLISION_DETECTION_H + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +#ifndef CGAL_RMCD_CACHE_BOXES +#define CGAL_RMCD_CACHE_BOXES 0 +#endif + +#if CGAL_RMCD_CACHE_BOXES +#include +#endif + +namespace CGAL { + +/*! + * \ingroup PkgPolygonMeshProcessing + * This class provides methods to perform some intersection tests between triangle meshes + * that undergo affine transformations (rotation, translation, and scaling). + * Meshes are added to an internal set and are referenced using an id assigned when added to the set. + * Note that the exact predicate framework applies on the meshes after having applied the transformation + * to the coordinates of the points of the vertices of each mesh. + * + * @tparam TriangleMesh a model of `HalfedgeListGraph` and `FaceListGraph` + * @tparam VertexPointMap a model of `ReadablePropertyMap` with the vertex descriptor of `TriangleMesh` as key type, + * and a point from a CGAL Kernel as value type. %Default is the internal point property map + * of `TriangleMesh` if it exists. + * @tparam Kernel a model of CGAL Kernel. %Default is the kernel of the value type of `VertexPointMap` retrieved using + * `Kernel_traits`. + * @tparam AABBTree an `AABB_tree` that can containing faces of `TriangleMesh`. %Default is using `AABB_traits` with + * `AABB_face_graph_triangle_primitive` as primitive type. + * @tparam Has_rotation tag indicating whether the transformations applied to meshes may contain rotations (`Tag_true`) + * or if only translations and scalings are applied (`Tag_false`). Some optimizations are + * switch on in case there are no rotations. + */ +template +class Rigid_triangle_mesh_collision_detection +{ +// Vertex point map type + typedef typename property_map_selector::const_type Default_vpm; + typedef typename Default::Get::type Vpm; + +// Kernel type + typedef typename Kernel_traits< + typename boost::property_traits::value_type>::Kernel Default_kernel; + typedef typename Default::Get::type K; + +// AABB-tree type + typedef AABB_face_graph_triangle_primitive Default_primitive; + typedef AABB_traits Default_tree_traits; + typedef CGAL::AABB_tree Default_tree; + typedef typename Default::Get::type Tree; + typedef typename Tree::AABB_traits Tree_traits; + +// Transformed Tree traversal traits + typedef Do_intersect_traversal_traits_with_transformation + Traversal_traits; + +// Data members + std::vector m_own_aabb_trees; + std::vector m_aabb_trees; + std::vector m_is_closed; + std::vector< std::vector > m_points_per_cc; + std::vector m_traversal_traits; + std::size_t m_free_id; // position in m_id_pool of the first free element + std::vector m_id_pool; // 0-> m_id_pool-1 are valid mesh ids +#if CGAL_RMCD_CACHE_BOXES + boost::dynamic_bitset<> m_bboxes_is_invalid; + std::vector m_bboxes; +#endif + +// internal functions + std::size_t get_id_for_new_mesh() + { + if (m_free_id==m_id_pool.size()) + { + m_id_pool.push_back(m_free_id); + ++m_free_id; + m_own_aabb_trees.resize(m_free_id); + m_aabb_trees.resize(m_free_id, NULL); + m_is_closed.resize(m_free_id); + m_points_per_cc.resize(m_free_id); + m_traversal_traits.resize(m_free_id); + #if CGAL_RMCD_CACHE_BOXES + m_bboxes.resize(m_free_id); + m_bboxes_is_invalid.resize(m_free_id, true); + #endif + return m_id_pool.back(); + } + return m_id_pool[m_free_id++]; + } + + template + void add_cc_points(const TriangleMesh& tm, std::size_t id, const NamedParameters& np) + { + collect_one_point_per_connected_component(tm, m_points_per_cc[id], np); + } + + // precondition A and B does not intersect + bool does_A_contains_a_CC_of_B(std::size_t id_A, std::size_t id_B) const + { + typename K::Construct_ray_3 ray_functor; + typename K::Construct_vector_3 vector_functor; + typedef typename Traversal_traits::Transformed_tree_helper Helper; + + BOOST_FOREACH(const typename K::Point_3& q, m_points_per_cc[id_B]) + { + if( internal::Point_inside_vertical_ray_cast(m_traversal_traits[id_A].get_helper())( + m_traversal_traits[id_B].transformation()( q ), *m_aabb_trees[id_A], + ray_functor, vector_functor) == CGAL::ON_BOUNDED_SIDE) + { + return true; + } + } + return false; + } + + // this function expects a protector was initialized + bool does_A_intersect_B(std::size_t id_A, std::size_t id_B) const + { +#if CGAL_RMCD_CACHE_BOXES + if (!do_overlap(m_bboxes[id_B], m_bboxes[id_A])) continue; +#endif + + Do_intersect_traversal_traits_for_two_trees traversal_traits( + m_aabb_trees[id_B]->traits(), m_traversal_traits[id_B].transformation(), m_traversal_traits[id_A]); + m_aabb_trees[id_B]->traversal(*m_aabb_trees[id_A], traversal_traits); + return traversal_traits.is_intersection_found(); + } + +public: +#ifdef DOXYGEN_RUNNING + /// The AABB_tree type representing the triangles of each input mesh + typedef unspecified_type AABB_tree; + /// The vertex point map type used with `TriangleMesh` + typedef unspecified_type Vertex_point_map; +#else + typedef Tree AABB_tree; + typedef Vpm Vertex_point_map; +#endif + /// Point type + typedef typename boost::property_traits::value_type Point_3; + + Rigid_triangle_mesh_collision_detection() + : m_free_id(0) + {} + + ~Rigid_triangle_mesh_collision_detection() + { + for (std::size_t k=0; k + std::size_t add_mesh(const TriangleMesh& tm, + const NamedParameters& np) + { + // handle vpm + using Polygon_mesh_processing::GetVertexPointMap; + typedef typename GetVertexPointMap::const_type Local_vpm; + CGAL_USE_TYPE(Local_vpm); + CGAL_assertion_code( + static const bool same_vpm = (boost::is_same::value); ) + CGAL_static_assertion(same_vpm); + + Vpm vpm = + boost::choose_param(boost::get_param(np, internal_np::vertex_point), + get_const_property_map(boost::vertex_point, tm) ); + // now add the mesh + std::size_t id = get_id_for_new_mesh(); + CGAL_assertion( m_aabb_trees[id] == NULL ); + m_is_closed[id] = is_closed(tm); + m_own_aabb_trees[id] = true; + Tree* t = new Tree(boost::begin(faces(tm)), boost::end(faces(tm)), tm, vpm); + t->build(); + m_aabb_trees[id] = t; + m_traversal_traits[id] = Traversal_traits(m_aabb_trees[id]->traits()); + add_cc_points(tm, id, np); + + return id; + } + + /*! + * adds an instance of a triangulated surface mesh using an external tree of its faces. + * \warning The tree is not copied and the lifetime of `tree` must be longer than that of this class. + * + * @tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters" + * + * \return the id of `tm` used to refer to that mesh. + * + * @param tree an AABB-tree of faces of a mesh + * @param tm triangulated surface mesh + * @param np optional sequence of \ref pmp_namedparameters "Named Parameters" among the ones listed below + * + * \cgalNamedParamsBegin + * \cgalParamBegin{vertex_point_map} + * the property map with the points associated to the vertices of `tm`. + * If this parameter is omitted, an internal property map for + * `CGAL::vertex_point_t` must be available in `TriangleMesh` + * \cgalParamEnd + * \cgalParamBegin{face_index_map} + * a property map containing the index of each face of `tm`. It must be initialized + * and the value must be unique per face and in the range `[0, num_faces(tm)[`. + * \cgalParamEnd + * \cgalParamBegin{apply_per_connected_component} + * if `false`, `tm` is assumed to have only one connected component, avoiding + * the extraction of connected components. Default is `true`. + * \cgalParamEnd + * \cgalNamedParamsEnd + */ + template + std::size_t add_mesh(const AABB_tree& tree, const TriangleMesh& tm, const NamedParameters& np) + { + std::size_t id = get_id_for_new_mesh(); + CGAL_assertion( m_aabb_trees[id] == NULL ); + m_is_closed[id] = is_closed(tm); + m_own_aabb_trees[id] = false ; + m_aabb_trees[id] = const_cast(&tree); + m_traversal_traits[id] = Traversal_traits(m_aabb_trees[id]->traits()); + collect_one_point_per_connected_component(tm, m_points_per_cc[id], np); + return id; + } + + /*! + * sets the transformation associated to a mesh identified by its id in the set. + */ + void set_transformation(std::size_t mesh_id, const Aff_transformation_3& aff_trans) + { + CGAL_assertion(m_aabb_trees[mesh_id] != NULL); + m_traversal_traits[mesh_id].set_transformation(aff_trans); +#if CGAL_RMCD_CACHE_BOXES + m_bboxes_is_invalid.set(mesh_id); +#endif + } + +#if CGAL_RMCD_CACHE_BOXES + void update_bboxes() + { + // protector is supposed to have been set + for (boost::dynamic_bitset<>::size_type i = m_bboxes_is_invalid.find_first(); + i != m_bboxes_is_invalid.npos; + i = m_bboxes_is_invalid.find_next(i)) + { + m_bboxes[i]=m_traversal_traits[i].get_helper().get_tree_bbox(*m_aabb_trees[i]); + } + m_bboxes_is_invalid.reset(); + } +#endif + + /*! + * returns a vector of the ids of meshes within `ids` that have at least a face + * intersecting a face of the mesh with id `mesh_id`. + * If `mesh_id` is in `ids` it is not reported. + * \tparam MeshIdRange a range of ids convertible to `std::size_t`. + */ + template + std::vector + get_all_intersections(std::size_t mesh_id, const MeshIdRange& ids) const + { + CGAL_assertion(m_aabb_trees[mesh_id] != NULL); + CGAL::Interval_nt_advanced::Protector protector; +#if CGAL_RMCD_CACHE_BOXES + update_bboxes(); +#endif + std::vector res; + + // TODO: use a non-naive version + BOOST_FOREACH(std::size_t k, ids) + { + CGAL_assertion(m_aabb_trees[k] != NULL); + if(k==mesh_id) continue; + + if (does_A_intersect_B(mesh_id, k)) + res.push_back(k); + } + return res; + } + + /*! + * returns a vector of the ids of meshes in the set that have at least a face + * intersecting a face of the mesh with id `mesh_id` + */ + std::vector + get_all_intersections(std::size_t mesh_id) const + { + return get_all_intersections( + mesh_id, + make_range(m_id_pool.begin(),m_id_pool.begin()+m_free_id) ); + } + + /*! + * returns a vector of the ids of meshes within `ids` that are intersecting with the mesh with id `mesh_id`, + * considering volume inclusions for closed meshes. + * More precisely, if at least one face of a mesh with id `i` intersects a face + * of the mesh with id `mesh_id`, the pair `(i, false)` is put in the output vector. + * If there is no face intersection, but at least one of the meshes with ids `i` and `mesh_id` is closed, + * and at least one connected component is included in the bounded volume defined by a closed mesh then the pair + * `(i, true)` is put in the output vector (independently of mesh `i` or `mesh_id` being the one including the other). + * The inclusion test is done using `Side_of_triangle_mesh`, in particular surface orientation is ignored and only the + * nesting level of connected components defines a bounded volume. If a mesh has some self-intersection the inclusion + * test may return incorrect results. + * If `mesh_id` is in `ids` it is not reported. + * + * \tparam MeshIdRange a range of ids convertible to `std::size_t`. + * + * \note If a mesh is made of several connected components and at least one component is not closed, + * then no inclusion test will be made even if some components are closed. + * + */ + template + std::vector > + get_all_intersections_and_inclusions(std::size_t mesh_id, const MeshIdRange& ids) const + { + CGAL_assertion(m_aabb_trees[mesh_id] != NULL); + CGAL::Interval_nt_advanced::Protector protector; +#if CGAL_RMCD_CACHE_BOXES + update_bboxes(); +#endif + std::vector > res; + + // TODO: use a non-naive version + BOOST_FOREACH(std::size_t k, ids) + { + CGAL_assertion(m_aabb_trees[k] != NULL); + if(k==mesh_id) continue; + + if (does_A_intersect_B(mesh_id, k)) + res.push_back(std::make_pair(k, false)); + else{ + if (m_is_closed[mesh_id]) + { + if ( does_A_contains_a_CC_of_B(mesh_id, k) ) + { + res.push_back(std::make_pair(k, true)); + continue; + } + } + if (m_is_closed[k]) + { + if ( does_A_contains_a_CC_of_B(k, mesh_id) ) + { + res.push_back(std::make_pair(k, true)); + continue; + } + } + } + } + return res; + } + + /*! + * returns a vector of the ids of meshes in the set that are intersecting with the mesh with id `mesh_id`, + * considering volume inclusions for closed meshes. + * See the previous overload for details. + */ + std::vector > + get_all_intersections_and_inclusions(std::size_t mesh_id) const + { + return get_all_intersections_and_inclusions(mesh_id, + make_range(m_id_pool.begin(),m_id_pool.begin()+m_free_id) ); + } + +/// \name Memory Management + /*! + * increases the capacity of data structures used internally, `size` being the number of meshes expected to be added. + */ + void reserve(std::size_t size) + { + m_own_aabb_trees.reserve(size); + m_aabb_trees.reserve(size); + m_is_closed.reserve(size); + m_points_per_cc.reserve(size); + m_traversal_traits.reserve(size); +#if CGAL_RMCD_CACHE_BOXES + m_bboxes.reserve(size); +#endif + } + + /*! + * removes the mesh with id `mesh_id` from the set, the indices of other meshes are kept unchanged. + */ + void remove_mesh(std::size_t mesh_id) + { + std::vector::iterator itf = + std::find(m_id_pool.begin(), m_id_pool.begin()+m_free_id, mesh_id); + if (itf == m_id_pool.begin()+m_free_id) return; + + if (m_own_aabb_trees[mesh_id]) delete m_aabb_trees[mesh_id]; + m_points_per_cc[mesh_id].clear(); + m_aabb_trees[mesh_id] = NULL; + if (m_id_pool[m_free_id-1]!=mesh_id) + std::swap(m_id_pool[m_free_id-1], *itf); + --m_free_id; + } + + /*! + * returns the number of meshes in the set + */ + std::size_t size() const + { + return m_free_id; + } + + +#ifndef DOXYGEN_RUNNING + /*! + * returns the number of times `add_mesh()` was called minus the number of times `remove_mesh()` (with a valid mesh id) was called + */ + std::size_t size_of_garbage() + { + return m_id_pool.size() - m_free_id; + } + + /*! + * returns `false` if `mesh_id` corresponds to an id not used (removed and/or not affected), and `true` otherwise. + */ + bool is_valid_index(std::size_t mesh_id) + { + if (mesh_id >= m_id_pool.size()) return false; + return m_aabb_trees[mesh_id] != NULL; + } + +/// \name Helper Static Function + + /*! + * fills `points` with one point per connected component of `tm`. This is a helper function + * intended to be used before calling the `add_mesh()` overload taking an AABB-tree instead of a mesh + * as input parameter. + * + * @tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters" + * + * @param tm input triangulated surface mesh + * @param [out] points will contain one point per connected component of `tm` + * @param np optional sequence of \ref pmp_namedparameters "Named Parameters" among the ones listed below + * + * \cgalNamedParamsBegin + * \cgalParamBegin{vertex_point_map} + * the property map with the points associated to the vertices of `tm`. + * If this parameter is omitted, an internal property map for + * `CGAL::vertex_point_t` must be available in `TriangleMesh` + * \cgalParamEnd + * \cgalParamBegin{face_index_map} + * a property map containing the index of each face of `tm`. It must be initialized + * and the value must be unique per face and in the range `[0, num_faces(tm)[`. + * \cgalParamEnd + * \cgalParamBegin{apply_per_connected_component} + * if `false`, `tm` is assumed to have only one connected component, avoiding + * the extraction of connected components. %Default is `true`. + * \cgalParamEnd + * \cgalNamedParamsEnd + */ + template + static + void collect_one_point_per_connected_component( + const TriangleMesh& tm, + std::vector& points, + const NamedParameters& np) + { + using Polygon_mesh_processing::GetVertexPointMap; + using Polygon_mesh_processing::GetFaceIndexMap; + + const bool maybe_several_cc = + boost::choose_param( + boost::get_param(np, internal_np::apply_per_connected_component), true); + + typedef typename GetVertexPointMap::const_type Local_vpm; + CGAL_USE_TYPE(Local_vpm); + + CGAL_assertion_code( + static const bool same_vpm = (boost::is_same::value); ) + CGAL_static_assertion(same_vpm); + + Vpm vpm = + boost::choose_param(boost::get_param(np, internal_np::vertex_point), + get_const_property_map(boost::vertex_point, tm) ); + + if (maybe_several_cc) + { + // used for face cc id map + std::vector cc_ids(num_faces(tm)); + + // face index map + typedef typename GetFaceIndexMap::type Fid_map; + + Fid_map fid_map = + boost::choose_param(boost::get_param(np, internal_np::face_index), + get_const_property_map(boost::face_index, tm)); + + std::size_t nb_cc = + Polygon_mesh_processing::connected_components( + tm, bind_property_maps(fid_map, make_property_map(cc_ids)), + parameters::face_index_map(fid_map)); + if (nb_cc != 1) + { + typedef boost::graph_traits GrTr; + std::vector + vertex_per_cc(nb_cc, GrTr::null_vertex()); + + BOOST_FOREACH(typename GrTr::face_descriptor f, faces(tm)) + { + std::size_t cc_id = cc_ids[get(fid_map, f)]; + if (vertex_per_cc[cc_id] == GrTr::null_vertex()) + { + vertex_per_cc[cc_id] = target( halfedge(f, tm), tm); + points.push_back( get(vpm, vertex_per_cc[cc_id]) ); + } + } + return; + } + } + // only one CC + points.push_back( get(vpm, *boost::begin(vertices(tm))) ); + } + + /*! + * adds an instance of a triangulated surface mesh using an external tree of its faces. + * \warning The tree is not copied and the lifetime of `tree` must be longer than that of this class. + * + * \return the id of the instance used to refer to that mesh. + * + * @param tree an AABB-tree of faces of a mesh + * @param is_closed `true` is the mesh in `tree` is closed, and `false` otherwise. + * \link is_closed() `CGAL::is_closed()` \endlink can be used for that purpose. + * @param points_per_cc a vector containing one point of a vertex for each connected + * component of the triangle surface mesh in `tree` + */ + std::size_t add_mesh(const AABB_tree& tree, + bool is_closed, + const std::vector& points_per_cc) + { + std::size_t id = get_id_for_new_mesh(); + CGAL_assertion( m_aabb_trees[id] == NULL ); + m_is_closed[id] = is_closed; + m_own_aabb_trees[id] = false ; + m_aabb_trees[id] = const_cast(&tree); + m_traversal_traits[id] = Traversal_traits(m_aabb_trees[id]->traits()); + m_points_per_cc[id] = points_per_cc; + + return id; + } + + // versions without NP + static + void collect_one_point_per_connected_component( + const TriangleMesh& tm, + std::vector& points) + { + collect_one_point_per_connected_component(tm, points, parameters::all_default()); + } + + std::size_t add_mesh(const TriangleMesh& tm) + { + return add_mesh(tm, parameters::all_default()); + } + + std::size_t add_mesh(const AABB_tree& tree, const TriangleMesh& tm) + { + return add_mesh(tree, tm, parameters::all_default()); + } +#endif +}; + +} // end of CGAL namespace + +#undef CGAL_RMCD_CACHE_BOXES + +#endif // CGAL_RIGID_TRIANGLE_MESH_COLLISION_DETECTION_H diff --git a/Polygon_mesh_processing/include/CGAL/Side_of_triangle_mesh.h b/Polygon_mesh_processing/include/CGAL/Side_of_triangle_mesh.h index b59b027fd90..7b5b1254f43 100644 --- a/Polygon_mesh_processing/include/CGAL/Side_of_triangle_mesh.h +++ b/Polygon_mesh_processing/include/CGAL/Side_of_triangle_mesh.h @@ -37,7 +37,7 @@ namespace CGAL { /** - * \ingroup PkgPolygonMeshProcessing + * \ingroup PkgPolygonMeshProcessingRef * This class provides an efficient point location functionality with respect to a domain bounded * by one or several disjoint closed triangle meshes. * @@ -55,7 +55,7 @@ namespace CGAL { * will return in turns `CGAL::ON_BOUNDED_SIDE` and `CGAL::ON_UNBOUNDED_SIDE`, * following the aforementioned parity criterion. * - * This class depends on the package \ref PkgAABB_treeSummary. + * This class depends on the package \ref PkgAABBTree. * * @tparam TriangleMesh a triangulated surface mesh, model of `FaceListGraph` * @tparam GeomTraits a geometric traits class, model of `Kernel` diff --git a/Polygon_mesh_processing/include/CGAL/polygon_mesh_processing.h b/Polygon_mesh_processing/include/CGAL/polygon_mesh_processing.h index 7d587ad4b84..1bfacaf330a 100644 --- a/Polygon_mesh_processing/include/CGAL/polygon_mesh_processing.h +++ b/Polygon_mesh_processing/include/CGAL/polygon_mesh_processing.h @@ -20,7 +20,7 @@ // Author(s) : Jane Tournois /** -* \ingroup PkgPolygonMeshProcessing +* \ingroup PkgPolygonMeshProcessingRef * \file CGAL/polygon_mesh_processing.h * Convenience header file including the headers for all * the free functions of this package. @@ -49,6 +49,9 @@ #include #include #include +#include +#include +#include // the named parameter header being not documented the doc is put here for now #ifdef DOXYGEN_RUNNING diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/CMakeLists.txt b/Polygon_mesh_processing/test/Polygon_mesh_processing/CMakeLists.txt index 299a1900dc8..26186f07088 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/CMakeLists.txt +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/CMakeLists.txt @@ -4,7 +4,7 @@ project( Polygon_mesh_processing_Tests ) -cmake_minimum_required(VERSION 2.6.2) +cmake_minimum_required(VERSION 3.1) if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" VERSION_GREATER 2.6) if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}" VERSION_GREATER 2.8.3) cmake_policy(VERSION 2.8.4) @@ -24,10 +24,6 @@ if ( NOT CGAL_FOUND ) endif() -# include helper file -include( ${CGAL_USE_FILE} ) - - # Boost and its components find_package( Boost REQUIRED ) @@ -42,13 +38,10 @@ endif() # include for local directory # include for local package -include_directories( BEFORE ../../include ) - find_package(Eigen3 3.2.0) #(requires 3.2.0 or greater) find_package( TBB ) -include( CGAL_CreateSingleSourceCGALProgram ) if (EIGEN3_FOUND) include( ${EIGEN3_USE_FILE} ) @@ -101,6 +94,10 @@ endif() create_single_source_cgal_program("test_orient_cc.cpp") create_single_source_cgal_program("test_pmp_transform.cpp") create_single_source_cgal_program("extrude_test.cpp") + create_single_source_cgal_program("test_merging_border_vertices.cpp") + create_single_source_cgal_program("test_repair_polygon_soup.cpp") + create_single_source_cgal_program("test_shape_predicates.cpp") + create_single_source_cgal_program("test_pmp_collision_detection.cpp") create_single_source_cgal_program("test_snap.cpp") if( TBB_FOUND ) diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/data/merge_points.off b/Polygon_mesh_processing/test/Polygon_mesh_processing/data/merge_points.off new file mode 100644 index 00000000000..7a83712189f --- /dev/null +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/data/merge_points.off @@ -0,0 +1,95 @@ +OFF +47 45 0 + +-0.026804100000000001 -0.30492799999999998 0.142542 +-0.018234400000000001 -0.28125499999999998 0.15192700000000001 +-0.074329900000000004 -0.27701599999999998 0.17852999999999999 +-0.075232300000000002 -0.238787 0.19677600000000001 +-0.092496499999999995 -0.26196000000000003 0.18681900000000001 +-0.107975 -0.220055 0.202264 +-0.098042799999999999 -0.24015500000000001 0.197738 +-0.076830499999999996 -0.20389099999999999 0.20217599999999999 +-0.10664999999999999 -0.18507100000000001 0.204627 +-0.048507700000000001 -0.30671799999999999 0.14971999999999999 +-0.10985300000000001 -0.27012399999999998 0.16877500000000001 +0.020159400000000001 -0.26358599999999999 0.11985899999999999 +-0.0820192 -0.303394 0.145977 +-0.11151800000000001 -0.28692499999999999 0.148566 +0.033791700000000001 -0.209923 0.115845 +0.019949499999999998 -0.19298699999999999 0.125832 +0.00080011299999999997 -0.19967099999999999 0.13874900000000001 +0.0102764 -0.16375000000000001 0.13344700000000001 +0.015325999999999999 -0.12934699999999999 0.14213100000000001 +0.043303899999999999 -0.239647 0.099889199999999997 +-0.010328800000000001 -0.10643 0.14183100000000001 +-0.032521000000000001 -0.10838299999999999 0.13683899999999999 +-0.085985000000000006 -0.101282 0.15809300000000001 +-0.108849 -0.11043600000000001 0.16941700000000001 +-0.052558500000000001 -0.097836599999999996 0.13975499999999999 +-0.10316599999999999 -0.15746599999999999 0.19631499999999999 +-0.112763 -0.133107 0.183753 +-0.063495300000000005 -0.15489 0.17952499999999999 +-0.064211199999999996 -0.12604799999999999 0.16286 +-0.086169300000000004 -0.13996600000000001 0.183699 +-0.063495300000000005 -0.15489 0.17952499999999999 +-0.023309900000000001 -0.17152600000000001 0.15354100000000001 +-0.0254547 -0.133829 0.14063300000000001 +-0.079254099999999994 -0.17391000000000001 0.197354 +-0.0458796 -0.210094 0.18626999999999999 +-0.063495300000000005 -0.15489 0.17952499999999999 +-0.0097084900000000002 -0.22793099999999999 0.15407299999999999 +-0.0458796 -0.210094 0.18626999999999999 +-0.0458796 -0.210094 0.18626999999999999 +-0.075232300000000002 -0.238787 0.19677600000000001 +-0.049308200000000003 -0.25528899999999999 0.18343899999999999 +-0.0218198 -0.25775500000000001 0.16445000000000001 +-0.049308200000000003 -0.25528899999999999 0.18343899999999999 +-0.041782300000000001 -0.28198800000000002 0.16825000000000001 +0.00026201499999999999 -0.25824399999999997 0.14286599999999999 +0.015174200000000001 -0.229959 0.128466 +-0.0097084900000000002 -0.22793099999999999 0.15407299999999999 +3 43 0 1 +3 2 3 4 +3 5 6 3 +3 7 5 3 +3 5 7 8 +3 0 43 9 +3 10 2 4 +3 1 44 41 +3 11 45 44 +3 12 9 2 +3 13 12 2 +3 14 15 45 +3 16 45 15 +3 43 1 41 +3 17 16 15 +3 16 31 36 +3 31 16 17 +3 17 18 32 +3 11 19 45 +3 43 2 9 +3 18 20 32 +3 20 21 32 +3 13 2 10 +3 29 28 22 +3 45 19 14 +3 23 29 22 +3 24 22 28 +3 21 24 28 +3 32 21 28 +3 33 29 25 +3 8 33 25 +3 8 7 33 +3 26 29 23 +3 34 33 7 +3 25 29 26 +3 4 3 6 +3 31 17 32 +3 29 27 28 +3 32 30 31 +3 34 35 33 +3 31 37 36 +3 40 38 39 +3 41 42 43 +3 45 46 44 +3 44 46 41 diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/data/non_manifold_vertex_duplicated.off b/Polygon_mesh_processing/test/Polygon_mesh_processing/data/non_manifold_vertex_duplicated.off new file mode 100644 index 00000000000..5733b99f480 --- /dev/null +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/data/non_manifold_vertex_duplicated.off @@ -0,0 +1,20 @@ +OFF +8 8 0 +0 1 0 +1 0 0 +0 0 0 +0 0 1 +2 1 0 +2 0 0 +2 0 -1 +1 0 0 +3 0 1 2 +3 2 3 0 +3 1 3 2 +3 0 3 1 +3 7 5 4 +3 7 6 5 +3 4 6 7 +3 5 6 4 + + diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/data_degeneracies/caps_and_needles.off b/Polygon_mesh_processing/test/Polygon_mesh_processing/data_degeneracies/caps_and_needles.off new file mode 100644 index 00000000000..4e206746788 --- /dev/null +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/data_degeneracies/caps_and_needles.off @@ -0,0 +1,17 @@ +OFF +9 3 0 +0 0 0 +1 0 0 +1 1 0 +0 0 1 +1 0 1 +10 10 1 +0 0 2 +1 0 2 +-0.99619469809 0.08715574274 2 +3 0 1 2 +3 3 4 5 +3 6 7 8 + + + diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/data_degeneracies/degtri_edge.off b/Polygon_mesh_processing/test/Polygon_mesh_processing/data_degeneracies/degtri_edge.off new file mode 100644 index 00000000000..afd48de232f --- /dev/null +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/data_degeneracies/degtri_edge.off @@ -0,0 +1,6 @@ +OFF +3 1 0 +0 0 0 +1 0 0 +0 0 0 +3 0 1 2 diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/data_stitching/boundary_cycle.off b/Polygon_mesh_processing/test/Polygon_mesh_processing/data_stitching/boundary_cycle.off new file mode 100644 index 00000000000..ef756556af0 --- /dev/null +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/data_stitching/boundary_cycle.off @@ -0,0 +1,42 @@ +OFF +20 20 0 +5 -20 0 +5 20 0 +0 0 0 +1 0 0 +2 0 0 +3 0 0 +4 -3 0 +6 -3 0 +7 0 0 +8 0 0 +9 0 0 +10 0 0 +8 0 0 +7 0 0 +6 3 0 +5 5 0 +5 7 0 +5 5 0 +3 0 0 +2 0 0 +3 0 3 2 +3 0 4 3 +3 0 5 4 +3 6 5 0 +3 7 6 0 +3 8 7 0 +3 9 8 0 +3 10 9 0 +3 11 10 0 +3 1 10 11 +3 1 12 10 +3 1 13 12 +3 1 14 13 +3 1 15 14 +3 1 16 15 +3 1 17 16 +3 18 17 1 +3 19 18 1 +3 3 19 1 +3 1 2 3 diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/data_stitching/boundary_cycle_2.off b/Polygon_mesh_processing/test/Polygon_mesh_processing/data_stitching/boundary_cycle_2.off new file mode 100644 index 00000000000..d8a8bfc0d2d --- /dev/null +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/data_stitching/boundary_cycle_2.off @@ -0,0 +1,18 @@ +OFF +8 8 0 +2 -1 0 +2 1 0 +0 0 0 +1 0 0 +2 0 0 +3 0 0 +4 0 0 +2 0 0 +3 0 2 3 +3 0 3 4 +3 0 4 5 +3 0 5 6 +3 3 2 1 +3 7 3 1 +3 5 7 1 +3 6 5 1 diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/remove_degeneracies_test.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/remove_degeneracies_test.cpp index 386e27723a1..b37cc61eb92 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/remove_degeneracies_test.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/remove_degeneracies_test.cpp @@ -11,11 +11,34 @@ //the last test (on trihole.off) does not terminate // -typedef CGAL::Exact_predicates_inexact_constructions_kernel K; +namespace PMP = CGAL::Polygon_mesh_processing; -typedef CGAL::Surface_mesh Surface_mesh; +typedef CGAL::Exact_predicates_inexact_constructions_kernel K; -void fix(const char* fname) +typedef CGAL::Surface_mesh Surface_mesh; + +typedef boost::graph_traits::edge_descriptor edge_descriptor; +typedef boost::graph_traits::face_descriptor face_descriptor; + +void detect_degeneracies(const Surface_mesh& mesh) +{ + std::vector dfaces; + + PMP::degenerate_faces(mesh, std::back_inserter(dfaces)); + PMP::degenerate_faces(faces(mesh), mesh, std::back_inserter(dfaces)); + PMP::degenerate_faces(mesh, std::back_inserter(dfaces), CGAL::parameters::all_default()); + PMP::degenerate_faces(faces(mesh), mesh, std::back_inserter(dfaces), CGAL::parameters::all_default()); + assert(!dfaces.empty()); + + std::set dedges; + PMP::degenerate_edges(mesh, std::inserter(dedges, dedges.end())); + PMP::degenerate_edges(edges(mesh), mesh, std::inserter(dedges, dedges.begin())); + PMP::degenerate_edges(mesh, std::inserter(dedges, dedges.end()), CGAL::parameters::all_default()); + PMP::degenerate_edges(edges(mesh), mesh, std::inserter(dedges, dedges.begin()), CGAL::parameters::all_default()); + assert(dedges.empty()); +} + +void fix_degeneracies(const char* fname) { std::ifstream input(fname); @@ -24,20 +47,22 @@ void fix(const char* fname) std::cerr << fname << " is not a valid off file.\n"; exit(1); } - CGAL::Polygon_mesh_processing::remove_degenerate_faces(mesh); + detect_degeneracies(mesh); + + CGAL::Polygon_mesh_processing::remove_degenerate_faces(mesh); assert( CGAL::is_valid_polygon_mesh(mesh) ); } int main() { - fix("data_degeneracies/degtri_2dt_1edge_split_twice.off"); - fix("data_degeneracies/degtri_four-2.off"); - fix("data_degeneracies/degtri_four.off"); - fix("data_degeneracies/degtri_on_border.off"); - fix("data_degeneracies/degtri_three.off"); - fix("data_degeneracies/degtri_single.off"); - fix("data_degeneracies/trihole.off"); + fix_degeneracies("data_degeneracies/degtri_2dt_1edge_split_twice.off"); + fix_degeneracies("data_degeneracies/degtri_four-2.off"); + fix_degeneracies("data_degeneracies/degtri_four.off"); + fix_degeneracies("data_degeneracies/degtri_on_border.off"); + fix_degeneracies("data_degeneracies/degtri_three.off"); + fix_degeneracies("data_degeneracies/degtri_single.off"); + fix_degeneracies("data_degeneracies/trihole.off"); return 0; } diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/run_test_corefinement_bool_op_full.sh b/Polygon_mesh_processing/test/Polygon_mesh_processing/run_test_corefinement_bool_op_full.sh index 3d54c2f0f47..2cea97cfb6b 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/run_test_corefinement_bool_op_full.sh +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/run_test_corefinement_bool_op_full.sh @@ -4,27 +4,19 @@ GREEN="\\033[1;32m" NORMAL="\\033[0;39m" RED="\\033[1;31m" -METHOD="SM" - -if [ ! -e $1 ""]; then - METHOD=$1 -fi - -echo "Testing with $METHOD" - k=`wc -l test_corefinement_bool_op_full.cmd | awk '{print $1}'` for i in `seq 1 $k`; do files=`head -n $i test_corefinement_bool_op_full.cmd | tail -n 1` f1=`echo $files | awk '{print $1}'` f2=`echo $files | awk '{print $2}'` - ru=`echo $files | awk '{print $5}'` - ri=`echo $files | awk '{print $6}'` - rm=`echo $files | awk '{print $7}'` - rmr=`echo $files | awk '{print $8}'` + ru=`echo $files | awk '{print $4}'` + ri=`echo $files | awk '{print $5}'` + rm=`echo $files | awk '{print $6}'` + rmr=`echo $files | awk '{print $7}'` echo -n "==== " $f1 $f2 " " - if (./test_corefinement_bool_op $f1 $f2 $METHOD ALL $ru $ri $rm $rmr|| false ) > /dev/null 2>&1; then + if (./test_corefinement_bool_op $f1 $f2 ALL $ru $ri $rm $rmr|| false ) > /dev/null 2>&1; then echo -e " ==> $GREEN SUCCEED" echo -e -n "$NORMAL" else diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_corefinement_bool_op.cmd b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_corefinement_bool_op.cmd index 15f6bd5c23d..3740f7caf89 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_corefinement_bool_op.cmd +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_corefinement_bool_op.cmd @@ -1 +1 @@ -data-coref/elephant.off data-coref/sphere.off SM ALL 1 1 1 1 +data-coref/elephant.off data-coref/sphere.off ALL 1 1 1 1 diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_corefinement_bool_op.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_corefinement_bool_op.cpp index 97e23b20cf2..ec1664aef97 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_corefinement_bool_op.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_corefinement_bool_op.cpp @@ -1,23 +1,15 @@ // #define CGAL_COREFINEMENT_POLYHEDRA_DEBUG // #define CGAL_COREFINEMENT_DEBUG -// #define CGAL_TODO_WARNINGS #include #include #include -#include - #include #include #include #include -// includes for Operations on polyhedra -#include -#include -#include - #include #include @@ -28,16 +20,6 @@ typedef CGAL::Surface_mesh Surface_mesh; namespace PMP = CGAL::Polygon_mesh_processing; namespace CFR = PMP::Corefinement; -//includes typedefs for Operations on polyhedra -typedef CGAL::Polyhedron_3 Polyhedron; -typedef std::map Facet_id_map; -typedef boost::associative_property_map Facet_id_pmap; -typedef CGAL::Corefinement - ::Polyhedra_output_builder< Polyhedron, - Facet_id_pmap> Output_builder; -typedef CGAL::Node_visitor_refine_polyhedra Split_visitor; - struct Result_checking { bool check; @@ -49,111 +31,6 @@ struct Result_checking Result_checking() : check(false) {} }; -void run_boolean_operations( - Polyhedron& P, - Polyhedron& Q, - Polyhedron& union_, - Polyhedron& inter, - Polyhedron& P_minus_Q, - Polyhedron& Q_minus_P, - std::string scenario, - std::size_t id, - const Result_checking& rc) -{ - std::cout << "Scenario #" << id << " - " << scenario << "\n"; - - CGAL::Emptyset_iterator output_it; - Facet_id_map P_facet_id_map, Q_facet_id_map; - - CGAL::cpp11::array, 4 > output; - - output[Output_builder::P_UNION_Q]=boost::make_optional( &union_ ); - output[Output_builder::P_INTER_Q]=boost::make_optional( &inter ); - output[Output_builder::P_MINUS_Q]=boost::make_optional( &P_minus_Q ); - output[Output_builder::Q_MINUS_P]=boost::make_optional( &Q_minus_P ); - - Output_builder output_builder(P, Q, - output, - Facet_id_pmap(P_facet_id_map), - Facet_id_pmap(Q_facet_id_map) ); - Split_visitor visitor(output_builder); - - CGAL::Intersection_of_Polyhedra_3 polyline_intersections(visitor); - std::cout << " Vertices before " << P.size_of_vertices() - << " " << Q.size_of_vertices() << std::endl; - polyline_intersections(P, Q, output_it); - std::cout << " Vertices after " << P.size_of_vertices() - << " " << Q.size_of_vertices() << std::endl; - - - if ( output_builder.union_valid() ){ - std::cout << " Union is a valid operation\n"; - assert(union_.is_valid()); - #ifdef CGAL_COREFINEMENT_DEBUG - std::stringstream fname; - fname << scenario << "_P_union_Q.off"; - std::ofstream output(fname.str().c_str()); - output << std::setprecision(17) << union_; - #endif - } - else - std::cout << " Union is invalid\n"; - - if ( output_builder.intersection_valid() ){ - std::cout << " Intersection is a valid operation\n"; - assert(inter.is_valid()); - #ifdef CGAL_COREFINEMENT_DEBUG - std::stringstream fname; - fname << scenario << "_P_inter_Q.off"; - std::ofstream output(fname.str().c_str()); - output << std::setprecision(17) << inter; - #endif - } - else - std::cout << " Intersection is invalid\n"; - - if ( output_builder.P_minus_Q_valid() ){ - std::cout << " P-Q is a valid operation\n"; - assert(P_minus_Q.is_valid()); - #ifdef CGAL_COREFINEMENT_DEBUG - std::stringstream fname; - fname << scenario << "_P_minus_Q.off"; - std::ofstream output(fname.str().c_str()); - output << std::setprecision(17) << P_minus_Q; - #endif - } - else - std::cout << " P-Q is invalid\n"; - - if ( output_builder.Q_minus_P_valid() ){ - std::cout << " Q-P is a valid operation\n"; - assert(Q_minus_P.is_valid()); - #ifdef CGAL_COREFINEMENT_DEBUG - std::stringstream fname; - fname << scenario << "_Q_minus_P.off"; - std::ofstream output(fname.str().c_str()); - output << std::setprecision(17) << Q_minus_P; - #endif - } - else - std::cout << " Q-P is invalid\n"; - - if (rc.check) - { - if(output_builder.union_valid()!=rc.union_res || - output_builder.intersection_valid()!=rc.inter_res || - output_builder.P_minus_Q_valid()!=rc.P_minus_Q_res || - output_builder.Q_minus_P_valid()!=rc.Q_minus_P_res) - { - std::cerr << " ERROR: at least one operation is not as expected!\n"; - exit(EXIT_FAILURE); - } - else - std::cout << " All operations are as expected.\n"; - } -} - - void run_boolean_operations( Surface_mesh& tm1, Surface_mesh& tm2, @@ -344,34 +221,26 @@ void run(char* P_fname, char* Q_fname, int k, int main(int argc,char** argv) { if (argc<3){ - std::cerr << "Usage "<< argv[0] << " file1.off file2.off [SM/POLY] [scenario_id/ALL] [0/1 0/1 0/1 0/1 (expected valid operations U I P-Q Q-P)]\n"; + std::cerr << "Usage "<< argv[0] << " file1.off file2.off [scenario_id/ALL] [0/1 0/1 0/1 0/1 (expected valid operations U I P-Q Q-P)]\n"; return 1; } Result_checking rc; - if (argc==9) + if (argc==8) { rc.check=true; - rc.union_res = atoi(argv[5])!=0; - rc.inter_res = atoi(argv[6])!=0; - rc.P_minus_Q_res = atoi(argv[7])!=0; - rc.Q_minus_P_res = atoi(argv[8])!=0; + rc.union_res = atoi(argv[4])!=0; + rc.inter_res = atoi(argv[5])!=0; + rc.P_minus_Q_res = atoi(argv[6])!=0; + rc.Q_minus_P_res = atoi(argv[7])!=0; } int scenario = -1; - if (argc>=5 && std::string(argv[4])!=std::string("ALL")) + if (argc>=5 && std::string(argv[3])!=std::string("ALL")) scenario = atoi(argv[4]); - if ( argc==3 || std::string(argv[3])==std::string("SM") ) - run(argv[1], argv[2], scenario, rc); - else - if ( std::string(argv[3])==std::string("POLY") ) - run(argv[1], argv[2], scenario, rc); - else - { - std::cout <<"Invalid value, only SM or POLY can be given\n"; - return 1; - } + run(argv[1], argv[2], scenario, rc); + return 0; } diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_corefinement_bool_op_full.cmd b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_corefinement_bool_op_full.cmd index 8b49a99ecf9..1c03b1ed689 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_corefinement_bool_op_full.cmd +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_corefinement_bool_op_full.cmd @@ -1,49 +1,49 @@ -data-coref/sphere.off data-coref/sphere-2.off SM ALL 1 1 1 1 -data-coref/cube.off data-coref/coplanar_with_cube.off SM ALL 1 1 1 1 -data-coref/cube.off data-coref/coplanar_with_cube1.off SM ALL 1 1 1 1 -data-coref/cube.off data-coref/coplanar_with_cube2.off SM ALL 1 1 1 1 -data-coref/cube.off data-coref/with_cube.off SM ALL 1 1 1 0 -data-coref/open_large_cube.off data-coref/open_small_cube.off SM ALL 1 1 1 1 -data-coref/open_large_cube.off data-coref/open_small_cube_inout.off SM ALL 0 0 0 0 -data-coref/elephant.off data-coref/elephant_plane/plane_1.off SM ALL 1 1 1 1 -data-coref/elephant.off data-coref/elephant_plane/plane_2.off SM ALL 1 1 1 1 -data-coref/elephant.off data-coref/elephant_plane/plane_3.off SM ALL 1 1 1 1 -data-coref/open_tet_1.off data-coref/open_tet_2.off SM ALL 1 1 1 1 -data-coref/small_cube_coplanar_inside.off data-coref/small_cube_coplanar_outside.off SM ALL 1 1 1 1 -data-coref/large_cube_coplanar.off data-coref/small_cube_coplanar_inside.off SM ALL 1 1 1 1 -data-coref/large_cube_coplanar.off data-coref/small_cube_coplanar_outside.off SM ALL 1 1 1 1 -data-coref/P7.off data-coref/Q7.off SM ALL 1 1 1 1 -data-coref/square1.off data-coref/square2.off SM ALL 1 1 1 1 -data-coref/square_pair.off data-coref/square2.off SM ALL 1 1 1 1 -data-coref/elephant.off data-coref/sphere.off SM ALL 1 1 1 1 -data-coref/elephant_split_1.off data-coref/elephant_split_2.off SM ALL 1 1 1 1 -data-coref/cube.off data-coref/cube_on_cube_edge.off SM ALL 0 1 1 1 -data-coref/cube.off data-coref/cube_on_cube_corner.off SM ALL 1 1 1 1 -data-coref/cow.off data-coref/cross.off SM ALL 1 1 1 1 -data-coref/sphere.off data-coref/sphere_trans_cut.off SM ALL 0 0 0 0 -data-coref/open_t11.off data-coref/open_t12.off SM ALL 1 1 1 1 -data-coref/cube.off data-coref/coplanar_with_cube3.off SM ALL 1 1 1 1 -data-coref/cube.off data-coref/coplanar_with_cube4.off SM ALL 1 1 1 1 -data-coref/square1.off data-coref/square_pair.off SM ALL 1 1 1 1 -data-coref/cube_meshed.off data-coref/cube.off SM ALL 1 1 1 1 -data-coref/cube.off data-coref/cube_interior_tgt.off SM ALL 1 1 1 1 -data-coref/cube.off data-coref/edge_tangent_to_cube.off SM ALL 1 1 0 1 -data-coref/cube_dig.off data-coref/wedge.off SM ALL 1 1 1 1 -data-coref/star_tgt1-0.off data-coref/star_tgt2-0.off SM ALL 1 1 1 0 -data-coref/star_tgt1-0.off data-coref/star_tgt2-1.off SM ALL 1 1 1 0 -data-coref/star_tgt1-0.off data-coref/star_tgt2-2.off SM ALL 0 1 1 1 -data-coref/star_tgt1-0.off data-coref/star_tgt2-3.off SM ALL 1 1 1 0 -data-coref/star_tgt1-0.off data-coref/star_tgt2-4.off SM ALL 0 1 1 1 -data-coref/star_tgt1-0.off data-coref/star_tgt2-5.off SM ALL 1 1 1 0 -data-coref/star_tgt1-1.off data-coref/star_tgt2-0.off SM ALL 1 1 1 0 -data-coref/star_tgt1-1.off data-coref/star_tgt2-1.off SM ALL 1 1 1 0 -data-coref/star_tgt1-1.off data-coref/star_tgt2-2.off SM ALL 0 1 1 1 -data-coref/star_tgt1-1.off data-coref/star_tgt2-3.off SM ALL 1 1 1 0 -data-coref/star_tgt1-1.off data-coref/star_tgt2-4.off SM ALL 0 1 1 1 -data-coref/star_tgt1-1.off data-coref/star_tgt2-5.off SM ALL 1 1 1 0 -data-coref/star_tgt1-2.off data-coref/star_tgt2-0.off SM ALL 1 1 1 0 -data-coref/star_tgt1-2.off data-coref/star_tgt2-1.off SM ALL 1 1 1 0 -data-coref/star_tgt1-2.off data-coref/star_tgt2-2.off SM ALL 0 1 1 1 -data-coref/star_tgt1-2.off data-coref/star_tgt2-3.off SM ALL 1 1 1 1 -data-coref/star_tgt1-2.off data-coref/star_tgt2-4.off SM ALL 0 1 1 1 -data-coref/star_tgt1-2.off data-coref/star_tgt2-5.off SM ALL 1 1 1 1 +data-coref/sphere.off data-coref/sphere-2.off ALL 1 1 1 1 +data-coref/cube.off data-coref/coplanar_with_cube.off ALL 1 1 1 1 +data-coref/cube.off data-coref/coplanar_with_cube1.off ALL 1 1 1 1 +data-coref/cube.off data-coref/coplanar_with_cube2.off ALL 1 1 1 1 +data-coref/cube.off data-coref/with_cube.off ALL 1 1 1 0 +data-coref/open_large_cube.off data-coref/open_small_cube.off ALL 1 1 1 1 +data-coref/open_large_cube.off data-coref/open_small_cube_inout.off ALL 0 0 0 0 +data-coref/elephant.off data-coref/elephant_plane/plane_1.off ALL 1 1 1 1 +data-coref/elephant.off data-coref/elephant_plane/plane_2.off ALL 1 1 1 1 +data-coref/elephant.off data-coref/elephant_plane/plane_3.off ALL 1 1 1 1 +data-coref/open_tet_1.off data-coref/open_tet_2.off ALL 1 1 1 1 +data-coref/small_cube_coplanar_inside.off data-coref/small_cube_coplanar_outside.off ALL 1 1 1 1 +data-coref/large_cube_coplanar.off data-coref/small_cube_coplanar_inside.off ALL 1 1 1 1 +data-coref/large_cube_coplanar.off data-coref/small_cube_coplanar_outside.off ALL 1 1 1 1 +data-coref/P7.off data-coref/Q7.off ALL 1 1 1 1 +data-coref/square1.off data-coref/square2.off ALL 1 1 1 1 +data-coref/square_pair.off data-coref/square2.off ALL 1 1 1 1 +data-coref/elephant.off data-coref/sphere.off ALL 1 1 1 1 +data-coref/elephant_split_1.off data-coref/elephant_split_2.off ALL 1 1 1 1 +data-coref/cube.off data-coref/cube_on_cube_edge.off ALL 0 1 1 1 +data-coref/cube.off data-coref/cube_on_cube_corner.off ALL 1 1 1 1 +data-coref/cow.off data-coref/cross.off ALL 1 1 1 1 +data-coref/sphere.off data-coref/sphere_trans_cut.off ALL 0 0 0 0 +data-coref/open_t11.off data-coref/open_t12.off ALL 1 1 1 1 +data-coref/cube.off data-coref/coplanar_with_cube3.off ALL 1 1 1 1 +data-coref/cube.off data-coref/coplanar_with_cube4.off ALL 1 1 1 1 +data-coref/square1.off data-coref/square_pair.off ALL 1 1 1 1 +data-coref/cube_meshed.off data-coref/cube.off ALL 1 1 1 1 +data-coref/cube.off data-coref/cube_interior_tgt.off ALL 1 1 1 1 +data-coref/cube.off data-coref/edge_tangent_to_cube.off ALL 1 1 0 1 +data-coref/cube_dig.off data-coref/wedge.off ALL 1 1 1 1 +data-coref/star_tgt1-0.off data-coref/star_tgt2-0.off ALL 1 1 1 0 +data-coref/star_tgt1-0.off data-coref/star_tgt2-1.off ALL 1 1 1 0 +data-coref/star_tgt1-0.off data-coref/star_tgt2-2.off ALL 0 1 1 1 +data-coref/star_tgt1-0.off data-coref/star_tgt2-3.off ALL 1 1 1 0 +data-coref/star_tgt1-0.off data-coref/star_tgt2-4.off ALL 0 1 1 1 +data-coref/star_tgt1-0.off data-coref/star_tgt2-5.off ALL 1 1 1 0 +data-coref/star_tgt1-1.off data-coref/star_tgt2-0.off ALL 1 1 1 0 +data-coref/star_tgt1-1.off data-coref/star_tgt2-1.off ALL 1 1 1 0 +data-coref/star_tgt1-1.off data-coref/star_tgt2-2.off ALL 0 1 1 1 +data-coref/star_tgt1-1.off data-coref/star_tgt2-3.off ALL 1 1 1 0 +data-coref/star_tgt1-1.off data-coref/star_tgt2-4.off ALL 0 1 1 1 +data-coref/star_tgt1-1.off data-coref/star_tgt2-5.off ALL 1 1 1 0 +data-coref/star_tgt1-2.off data-coref/star_tgt2-0.off ALL 1 1 1 0 +data-coref/star_tgt1-2.off data-coref/star_tgt2-1.off ALL 1 1 1 0 +data-coref/star_tgt1-2.off data-coref/star_tgt2-2.off ALL 0 1 1 1 +data-coref/star_tgt1-2.off data-coref/star_tgt2-3.off ALL 1 1 1 1 +data-coref/star_tgt1-2.off data-coref/star_tgt2-4.off ALL 0 1 1 1 +data-coref/star_tgt1-2.off data-coref/star_tgt2-5.off ALL 1 1 1 1 diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_merging_border_vertices.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_merging_border_vertices.cpp new file mode 100644 index 00000000000..ed21427f4d1 --- /dev/null +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_merging_border_vertices.cpp @@ -0,0 +1,54 @@ +#include +#include + +#include +#include + +#include + + +typedef CGAL::Exact_predicates_inexact_constructions_kernel K; +typedef CGAL::Surface_mesh Surface_mesh; + + +void test_merge_duplicated_vertices_in_boundary_cycles(const char* fname, + std::size_t expected_nb_vertices) +{ + std::ifstream input(fname); + + Surface_mesh mesh; + if (!input || !(input >> mesh) || mesh.is_empty()) { + std::cerr << fname << " is not a valid off file.\n"; + exit(1); + } + + std::cout << "Testing merging in cycles " << fname << "\n"; + std::cout << " input mesh has " << vertices(mesh).size() << " vertices.\n"; + CGAL::Polygon_mesh_processing::merge_duplicated_vertices_in_boundary_cycles(mesh); + std::cout << " output mesh has " << vertices(mesh).size() << " vertices.\n"; + + assert(expected_nb_vertices==0 || + expected_nb_vertices == vertices(mesh).size()); + if (expected_nb_vertices==0) + { + std::cout << "writting output to out1.off\n"; + std::ofstream output("out1.off"); + output << std::setprecision(17); + output << mesh; + } +} + +int main(int argc, char** argv) +{ + if (argc==1) + { + test_merge_duplicated_vertices_in_boundary_cycles("data/merge_points.off", 43); + } + else + { + for (int i=1; i< argc; ++i) + test_merge_duplicated_vertices_in_boundary_cycles(argv[i], 0); + } + + return EXIT_SUCCESS; +} diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_clip.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_clip.cpp index ea5e22a7795..3dae87fb73c 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_clip.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_clip.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include #include @@ -18,6 +19,7 @@ void test() { // test with a clipper mesh TriangleMesh tm1, tm2; + std::ifstream input("data-coref/elephant.off"); input >> tm1; input.close(); @@ -31,7 +33,6 @@ void test() params::face_index_map(get(CGAL::dynamic_face_property_t(), tm2)) ); assert(!CGAL::is_closed(tm1)); - CGAL::clear(tm1); CGAL::clear(tm2); @@ -46,9 +47,10 @@ void test() .face_index_map(get(CGAL::dynamic_face_property_t(), tm1)), params::face_index_map(get(CGAL::dynamic_face_property_t(), tm2))); assert(CGAL::is_closed(tm1)); + CGAL::clear(tm1); + CGAL::clear(tm2); // test with a plane - CGAL::clear(tm1); input.open("data-coref/cube.off"); input >> tm1; input.close(); @@ -96,6 +98,124 @@ void test() PMP::clip(tm1, K::Plane_3(0, 0, 1, -2)); assert(!CGAL::is_empty(tm1)); CGAL::clear(tm1); + + // clipping with identity + input.open("data-coref/cube.off"); + input >> tm1; + input.close(); + input.open("data-coref/cube.off"); + input >> tm2; + input.close(); + PMP::clip(tm1, tm2,params::clip_volume(true) + .use_compact_clipper(true) + .face_index_map(get(CGAL::dynamic_face_property_t(), tm1)), + params::face_index_map(get(CGAL::dynamic_face_property_t(), tm2))); + assert(num_vertices(tm1)==8); + CGAL::clear(tm1); + CGAL::clear(tm2); + + input.open("data-coref/cube.off"); + input >> tm1; + input.close(); + input.open("data-coref/cube.off"); + input >> tm2; + input.close(); + PMP::clip(tm1, tm2,params::clip_volume(false) + .use_compact_clipper(false) + .face_index_map(get(CGAL::dynamic_face_property_t(), tm1)), + params::face_index_map(get(CGAL::dynamic_face_property_t(), tm2))); + assert(CGAL::is_empty(tm1)); + CGAL::clear(tm1); + CGAL::clear(tm2); + + input.open("data-coref/cube.off"); + input >> tm1; + input.close(); + input.open("data-coref/cube.off"); + input >> tm2; + input.close(); + PMP::clip(tm1, tm2,params::clip_volume(false) + .use_compact_clipper(true) + .face_index_map(get(CGAL::dynamic_face_property_t(), tm1)), + params::face_index_map(get(CGAL::dynamic_face_property_t(), tm2))); + assert(num_vertices(tm1)==8); + CGAL::clear(tm1); + CGAL::clear(tm2); + + input.open("data-coref/cube.off"); + input >> tm1; + input.close(); + input.open("data-coref/cube.off"); + input >> tm2; + input.close(); + PMP::transform(K::Aff_transformation_3(CGAL::TRANSLATION, K::Vector_3(1,0,0)), tm2); + PMP::clip(tm1, tm2,params::clip_volume(false) + .use_compact_clipper(false) + .face_index_map(get(CGAL::dynamic_face_property_t(), tm1)), + params::face_index_map(get(CGAL::dynamic_face_property_t(), tm2))); + assert(CGAL::is_empty(tm1)); + CGAL::clear(tm1); + CGAL::clear(tm2); + + input.open("data-coref/cube.off"); + input >> tm1; + input.close(); + input.open("data-coref/cube.off"); + input >> tm2; + input.close(); + PMP::transform(K::Aff_transformation_3(CGAL::TRANSLATION, K::Vector_3(1,0,0)), tm2); + PMP::clip(tm1, tm2,params::clip_volume(false) + .use_compact_clipper(true) + .face_index_map(get(CGAL::dynamic_face_property_t(), tm1)), + params::face_index_map(get(CGAL::dynamic_face_property_t(), tm2))); + assert(vertices(tm1).size()==4); + CGAL::clear(tm1); + CGAL::clear(tm2); + + // test orientation + patch without input vertex + CGAL::make_tetrahedron( + K::Point_3(0.53, -1.3, 0.2), + K::Point_3(0.53, 1.1, 0.2), + K::Point_3(0.53, -1.3, 0.4), + K::Point_3(0.73, -1.3, 0.2), + tm2); + input.open("data-coref/cube.off"); + input >> tm1; + input.close(); + PMP::clip(tm1, tm2,params::clip_volume(false) + .face_index_map(get(CGAL::dynamic_face_property_t(), tm1)), + params::face_index_map(get(CGAL::dynamic_face_property_t(), tm2))); + assert(vertices(tm1).size()==6); + CGAL::clear(tm1); + CGAL::clear(tm2); + + CGAL::make_tetrahedron( + K::Point_3(0.53, -1.3, 0.2), + K::Point_3(0.53, 1.1, 0.2), + K::Point_3(0.53, -1.3, 0.4), + K::Point_3(0.73, -1.3, 0.2), + tm2); + PMP::reverse_face_orientations(tm2); + input.open("data-coref/cube.off"); + input >> tm1; + input.close(); + PMP::clip(tm1, tm2,params::clip_volume(false) + .face_index_map(get(CGAL::dynamic_face_property_t(), tm1)), + params::face_index_map(get(CGAL::dynamic_face_property_t(), tm2))); + assert(vertices(tm1).size()==6+8); + CGAL::clear(tm1); + CGAL::clear(tm2); + + // clip meshes with intersection polyline opened + make_triangle( K::Point_3(0, 0, 0), K::Point_3(0, 4, 0), K::Point_3(4, 0, 0), tm1 ); + PMP::clip(tm1, K::Plane_3(1, 0, 0, -2)); + assert(vertices(tm1).size()==4); + CGAL::clear(tm1); + + make_triangle( K::Point_3(0, 0, 0), K::Point_3(0, 4, 0), K::Point_3(4, 0, 0), tm1 ); + PMP::clip(tm1, K::Plane_3(-1, 0, 0, 2)); + assert(vertices(tm1).size()==3); + CGAL::clear(tm1); } int main() diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_collision_detection.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_collision_detection.cpp new file mode 100644 index 00000000000..0ed2887110f --- /dev/null +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_collision_detection.cpp @@ -0,0 +1,174 @@ +#include +#include +#include + +#include + +#include +#include + +typedef CGAL::Exact_predicates_inexact_constructions_kernel K; +typedef CGAL::Surface_mesh Surface_mesh; +typedef CGAL::Polyhedron_3 Polyhedron_3; +namespace params = CGAL::parameters; + +void test_remove() +{ + std::cout << "test_remove()" << std::endl; + Surface_mesh sm; + CGAL::Rigid_triangle_mesh_collision_detection collision_detection; + collision_detection.add_mesh(sm); // 0 + collision_detection.add_mesh(sm); // 1 + collision_detection.add_mesh(sm); // 2 + collision_detection.add_mesh(sm); // 3 + collision_detection.add_mesh(sm); // 4 + + assert( collision_detection.is_valid_index(0) ); + assert( collision_detection.is_valid_index(1) ); + assert( collision_detection.is_valid_index(2) ); + assert( collision_detection.is_valid_index(3) ); + assert( collision_detection.is_valid_index(4) ); + assert(!collision_detection.is_valid_index(5) ); + + assert(collision_detection.size() == 5); + + collision_detection.remove_mesh(4); + assert(collision_detection.size() == 4); + assert(!collision_detection.is_valid_index(4)); + + std::size_t id = collision_detection.add_mesh(sm); + assert(id == 4); + + collision_detection.remove_mesh(2); + assert(collision_detection.size() == 4); + assert(!collision_detection.is_valid_index(2)); + id = collision_detection.add_mesh(sm); + assert(id == 2); + + assert( collision_detection.is_valid_index(0) ); + assert( collision_detection.is_valid_index(1) ); + assert( collision_detection.is_valid_index(2) ); + assert( collision_detection.is_valid_index(3) ); + assert( collision_detection.is_valid_index(4) ); + + collision_detection.remove_mesh(3); + assert( collision_detection.size()==4); + assert( collision_detection.size_of_garbage()==1); + collision_detection.remove_mesh(3); + assert( collision_detection.size()==4); + assert( collision_detection.size_of_garbage()==1); + collision_detection.remove_mesh(2); + assert( collision_detection.size()==3); + assert( collision_detection.size_of_garbage()==2); + collision_detection.remove_mesh(1); + assert( collision_detection.size()==2); + assert( collision_detection.size_of_garbage()==3); + collision_detection.remove_mesh(4); + assert( collision_detection.size()==1); + assert( collision_detection.size_of_garbage()==4); + collision_detection.remove_mesh(0); + assert( collision_detection.size()==0); + assert( collision_detection.size_of_garbage()==5); +} + +template +void test_intersections(Index index, const char* type) +{ + std::cout << "test_intersections<"<()" << std::endl; + TriangleMesh tm1, tm2, tm3; + std::ifstream input("data/small_spheres.off"); + assert(input); + input >> tm1; + input.close(); + input.open("data/blobby.off"); + assert(input); + input >> tm2; + input.close(); + input.open("data-coref/large_cube_coplanar.off"); + assert(input); + input >> tm3; + input.close(); + + CGAL::Rigid_triangle_mesh_collision_detection collision_detection; + collision_detection.add_mesh(tm1, params::face_index_map(get(index, tm1))); // 0 + // add tm1 using an external tree + typename CGAL::Rigid_triangle_mesh_collision_detection::AABB_tree + tm1_tree(boost::begin(faces(tm1)), boost::end(faces(tm1)), tm1); + collision_detection.add_mesh(tm1_tree, tm1, params::face_index_map(get(index, tm1))); // 1 small_spheres + collision_detection.add_mesh(tm2, params::face_index_map(get(index, tm2))); // 2 blobby + collision_detection.add_mesh(tm3, params::face_index_map(get(index, tm3))); // 3 large_cube_coplanar + // pool is 0 1 2 3 + collision_detection.remove_mesh(0); + // pool is now 3 1 2 + std::vector inter_res; + std::vector< std::pair > inter_and_inclus_res; + + // spheres intersects both cube and blobby + inter_res = collision_detection.get_all_intersections(1); + assert(inter_res.size() == 2); + assert(inter_res[0] == 3); + assert(inter_res[1] == 2); + + // blobby intersects only spheres + inter_res = collision_detection.get_all_intersections(2); + assert(inter_res.size() == 1); + assert(inter_res[0] == 1); + + // blobby is included into cube + inter_and_inclus_res = collision_detection.get_all_intersections_and_inclusions(2); + assert(inter_and_inclus_res.size() == 2); + assert(inter_and_inclus_res[0].first == 3 && inter_and_inclus_res[0].second); + assert(inter_and_inclus_res[1].first == 1 && !inter_and_inclus_res[1].second); + + // set transformations + K::Aff_transformation_3 tm1_transf(-0.22115682390903474, 0.97263618730220114, 0.071193443439028392, + -2.3805504333121519, 0.37717228816945586, 0.017983434697950496, + 0.92596849898551192, -4.6543355030238258, 0.89935016777420218, + 0.23163644624001295, -0.37082857562196114, -5.4867495857613582); + + K::Aff_transformation_3 tm2_transf(-0.10062050938738221, -0.92610032901754502, -0.36361200981845854, + -2.1218726603809985, 0.98718082597554757, -0.13844084127856282, + 0.079423864753106477, -4.6627185424110094, -0.1238932198179533, + -0.35095913445824267, 0.92815847570523291, -5.349009707055858); + + K::Aff_transformation_3 tm3_transf(0.8523140340417823, -0.41651563577194606, -0.3163471392835962, + -2.0549216027623891, 0.34883891716890358, 0.90335137983769587, + -0.24953495629622252, -5.8394794922248607, 0.3897078357485903, + 0.10232795171810326, 0.91523592207328008, -5.2436990668816268); + + collision_detection.set_transformation(1, tm1_transf); + collision_detection.set_transformation(2, tm2_transf); + collision_detection.set_transformation(3, tm3_transf); + + // spheres intersects blobby + inter_res = collision_detection.get_all_intersections(1); + assert(inter_res.size() == 1); + assert(inter_res[0] == 2); + + // blobby intersect spheres and cube + inter_res = collision_detection.get_all_intersections(2); + assert(inter_res.size() == 2); + assert(inter_res[0] == 3); + assert(inter_res[1] == 1); + + // cube contains one CC of spheres + inter_and_inclus_res = collision_detection.get_all_intersections_and_inclusions(3); + assert(inter_and_inclus_res.size() == 2); + assert(inter_and_inclus_res[0].first == 1 && inter_and_inclus_res[0].second); + assert(inter_and_inclus_res[1].first == 2 && !inter_and_inclus_res[1].second); + + // one CC of spheres is contained by cube + inter_and_inclus_res = collision_detection.get_all_intersections_and_inclusions(1); + assert(inter_and_inclus_res.size() == 2); + assert(inter_and_inclus_res[0].first == 3 && inter_and_inclus_res[0].second); + assert(inter_and_inclus_res[1].first == 2 && !inter_and_inclus_res[1].second); +} + +int main() +{ + test_remove(); + test_intersections(boost::face_index, "Surface_mesh"); + test_intersections(boost::face_external_index, "Polyhedron_3"); + + return 0; +} diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_repair_polygon_soup.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_repair_polygon_soup.cpp new file mode 100644 index 00000000000..eec039ec43e --- /dev/null +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_repair_polygon_soup.cpp @@ -0,0 +1,551 @@ +#define CGAL_PMP_REPAIR_POLYGON_SOUP_VERBOSE_PP + +#include + +#include + +#include + +#include +#include +#include +#include +#include + +namespace PMP = CGAL::Polygon_mesh_processing; +namespace params = PMP::parameters; + +typedef CGAL::Exact_predicates_inexact_constructions_kernel K; +typedef K::Point_3 Point_3; + +typedef CGAL::Surface_mesh Mesh; +typedef std::vector Polygon; + +void test_polygon_canonicalization(const bool verbose = false) +{ + std::cout << "test polygon canonicalization... " << std::endl; + + std::vector points; + points.push_back(Point_3(0,0,0)); // #0 + points.push_back(Point_3(1,0,0)); // #1 + points.push_back(Point_3(0,1,0)); // #2 + points.push_back(Point_3(1,1,0)); // #3 + points.push_back(Point_3(1,1,2)); // #4 + points.push_back(Point_3(1,1,-2)); // #5 + + // empty + Polygon polygon; + Polygon canonical_polygon = PMP::internal::construct_canonical_polygon(points, polygon, K()); + assert(canonical_polygon.empty()); + + // 1 point + polygon.push_back(5); + + canonical_polygon = PMP::internal::construct_canonical_polygon(points, polygon, K()); + assert(canonical_polygon == polygon); + + // 2 points + polygon.clear(); + polygon.push_back(4); polygon.push_back(3); + + canonical_polygon = PMP::internal::construct_canonical_polygon(points, polygon, K()); + assert(canonical_polygon[0] == 3 && canonical_polygon[1] == 4); + std::swap(polygon[0], polygon[1]); + canonical_polygon = PMP::internal::construct_canonical_polygon(points, polygon, K()); + assert(canonical_polygon[0] == 3 && canonical_polygon[1] == 4); + + // 3 points + polygon.clear(); + polygon.push_back(4); polygon.push_back(1); polygon.push_back(3); + + canonical_polygon = PMP::internal::construct_canonical_polygon(points, polygon, K()); + assert(canonical_polygon[0] == 1 && canonical_polygon[1] == 3 && canonical_polygon[2] == 4); + std::swap(polygon[0], polygon[2]); + canonical_polygon = PMP::internal::construct_canonical_polygon(points, polygon, K()); + assert(canonical_polygon[0] == 1 && canonical_polygon[1] == 3 && canonical_polygon[2] == 4); + + // Generic case + polygon.clear(); + polygon.push_back(0); polygon.push_back(2); polygon.push_back(5); polygon.push_back(4); polygon.push_back(1); + + // Whether reversed or with cyclic permutations, it should always yield the same canonical polygon + canonical_polygon = PMP::internal::construct_canonical_polygon(points, polygon, K()); + assert(canonical_polygon.size() == 5); + assert(canonical_polygon[0] == 0); + + // all cyclic permutations + for(std::size_t i=0, end=polygon.size(); i points; + std::vector polygons; + + // empty + std::size_t res = PMP::merge_duplicate_points_in_polygon_soup(points, polygons); + assert(res == 0 && points.empty() && polygons.empty()); + + points.push_back(Point_3(0,0,0)); // #0 + points.push_back(Point_3(1,2,0)); // #1 + points.push_back(Point_3(1,1,0)); // #2 + points.push_back(Point_3(1,1,0)); // #3 // identical to #2 + points.push_back(Point_3(0,1,0)); // #4 + points.push_back(Point_3(1,1,0)); // #5 // identical to #2 + points.push_back(Point_3(0,0,0)); // #6 // idental to #0 + + Polygon polygon; + polygon.push_back(0); polygon.push_back(1); polygon.push_back(2); + polygons.push_back(polygon); + + polygon.clear(); + polygon.push_back(6); polygon.push_back(3); polygon.push_back(1); polygon.push_back(0); + polygons.push_back(polygon); + + polygon.clear(); + polygon.push_back(5); + polygons.push_back(polygon); + + res = PMP::merge_duplicate_points_in_polygon_soup(points, polygons, params::geom_traits(K())); + assert(res == 3 && points.size() == 4 && polygons.size() == 3); + + assert(polygons[0][0] == 0 && polygons[0][1] == 1 && polygons[0][2] == 2); + assert(polygons[1][0] == 0 && polygons[1][1] == 2 && polygons[1][2] == 1 && polygons[1][3] == 0); + + for(std::size_t i=0, psn=polygons.size(); i points; + std::vector polygons; + + points.push_back(Point_3(0,0,0)); // #0 + points.push_back(Point_3(1,0,0)); // #1 + points.push_back(Point_3(0,1,0)); // #2 + points.push_back(Point_3(1,1,0)); // #3 + points.push_back(Point_3(1,1,2)); // #4 + + // ------------------------------------------------------- + // empty + std::vector > all_duplicate_polygons; + PMP::internal::collect_duplicate_polygons(points, polygons, + std::back_inserter(all_duplicate_polygons), + K(), true /*only equal if same orientation*/); + assert(polygons.empty() && all_duplicate_polygons.empty()); + + std::size_t res = PMP::merge_duplicate_polygons_in_polygon_soup(points, polygons, params::geom_traits(K())); + assert(res == 0 && polygons.empty()); + + // ------------------------------------------------------- + // 1 polygon + Polygon polygon; + polygon.push_back(0); polygon.push_back(1); polygon.push_back(2); + polygons.push_back(polygon); + + PMP::internal::collect_duplicate_polygons(points, polygons, + std::back_inserter(all_duplicate_polygons), + K(), false /*equal regardless of orientation*/); + assert(all_duplicate_polygons.empty()); + + PMP::internal::collect_duplicate_polygons(points, polygons, + std::back_inserter(all_duplicate_polygons), + K(), true /*only equal if same orientation*/); + assert(all_duplicate_polygons.empty()); + + res = PMP::merge_duplicate_polygons_in_polygon_soup(points, polygons, params::geom_traits(K())); + assert(res == 0 && polygons.size() == 1); + + // ------------------------------------------------------- + // 2 different polygons + polygon.clear(); + polygon.push_back(0); polygon.push_back(1); polygon.push_back(3); polygon.push_back(4); + polygons.push_back(polygon); + + PMP::internal::collect_duplicate_polygons(points, polygons, + std::back_inserter(all_duplicate_polygons), + K(), false /*equal regardless of orientation*/); + assert(all_duplicate_polygons.empty()); + + PMP::internal::collect_duplicate_polygons(points, polygons, + std::back_inserter(all_duplicate_polygons), + K(), true /*only equal if same orientation*/); + assert(all_duplicate_polygons.empty()); + + res = PMP::merge_duplicate_polygons_in_polygon_soup(points, polygons); + assert(res == 0 && polygons.size() == 2); + + // ------------------------------------------------------- + // Multiple duplicates + // duplicate, same orientations + polygon.clear(); + polygon.push_back(2); polygon.push_back(0); polygon.push_back(1); + polygons.push_back(polygon); + + // duplicate, different orientations + polygon.clear(); + polygon.push_back(2); polygon.push_back(1); polygon.push_back(0); + polygons.push_back(polygon); + + // duplicate, different orientations + polygon.clear(); + polygon.push_back(4); polygon.push_back(3); polygon.push_back(1); polygon.push_back(0); + polygons.push_back(polygon); + + // same vertices, not a duplicate + polygon.clear(); + polygon.push_back(3); polygon.push_back(4); polygon.push_back(1); polygon.push_back(0); + polygons.push_back(polygon); + + PMP::internal::collect_duplicate_polygons(points, polygons, + std::back_inserter(all_duplicate_polygons), + K(), true /*only equal if same orientation*/); + assert(all_duplicate_polygons.size() == 1); // one duplication + assert(all_duplicate_polygons[0].size() == 2); // two polygons are equal + all_duplicate_polygons.clear(); + + PMP::internal::collect_duplicate_polygons(points, polygons, + std::back_inserter(all_duplicate_polygons), + K(), false /*equal regardless of orientation*/); + assert(all_duplicate_polygons.size() == 2); + + // not sure which duplicate is output first + if(all_duplicate_polygons[0][0] == 0) + assert(all_duplicate_polygons[0].size() == 3 && all_duplicate_polygons[1].size() == 2); + else + assert(all_duplicate_polygons[0].size() == 2 && all_duplicate_polygons[1].size() == 3); + + // Keep one for each duplicate + std::vector polygons_copy(polygons); + res = PMP::merge_duplicate_polygons_in_polygon_soup(points, polygons_copy, + params::all_default()); + assert(res == 3 && polygons_copy.size() == 3); + + // Remove all duplicates + polygons_copy = polygons; + res = PMP::merge_duplicate_polygons_in_polygon_soup(points, polygons_copy, + params::erase_all_duplicates(true) + .require_same_orientation(false)); + assert(res == 5 && polygons_copy.size() == 1); + + // Remove all duplicates but different orientations are different polygons + res = PMP::merge_duplicate_polygons_in_polygon_soup(points, polygons, + params::erase_all_duplicates(true) + .require_same_orientation(true)); + assert(res == 2 && polygons.size() == 4); +} + +void test_simplify_polygons(const bool /*verbose*/ = false) +{ + std::cout << "test simplify_polygons... " << std::endl; + + std::vector points; + std::vector polygons; + + points.push_back(Point_3(0,0,0)); // #0 + points.push_back(Point_3(1,2,0)); // #1 + points.push_back(Point_3(1,0,0)); // #2 + points.push_back(Point_3(1,3,0)); // #3 + points.push_back(Point_3(0,1,0)); // #4 + points.push_back(Point_3(1,1,0)); // #5 + points.push_back(Point_3(0,0,0)); // #6 + + // ------ + Polygon polygon; + polygon.push_back(0); polygon.push_back(2); polygon.push_back(4); + polygons.push_back(polygon); + + std::size_t res = PMP::internal::simplify_polygons_in_polygon_soup(points, polygons); + assert(res == 0 && polygons.back().size() == 3); + + // ------ + polygon.clear(); + polygon.push_back(0); polygon.push_back(0); + polygons.push_back(polygon); + + res = PMP::internal::simplify_polygons_in_polygon_soup(points, polygons, K()); + assert(res == 1 && polygons.back().size() == 1); + + // ------ + polygon.clear(); + polygon.push_back(0); polygon.push_back(0); polygon.push_back(0); polygon.push_back(0); + polygons.push_back(polygon); + + res = PMP::internal::simplify_polygons_in_polygon_soup(points, polygons, K()); + assert(res == 1 && polygons.back().size() == 1); + + // ------ + polygon.clear(); + polygon.push_back(0); polygon.push_back(3); polygon.push_back(3); polygon.push_back(3); polygon.push_back(0); + polygons.push_back(polygon); + + res = PMP::internal::simplify_polygons_in_polygon_soup(points, polygons, K()); + assert(res == 1 && polygons.back().size() == 2); + + // ------ + // Now with the same geometric positions, but different combinatorial information + polygon.clear(); + polygon.push_back(0); polygon.push_back(2); polygon.push_back(1); polygon.push_back(6); + polygons.push_back(polygon); + + res = PMP::internal::simplify_polygons_in_polygon_soup(points, polygons, K()); + assert(res == 1 && polygons.back().size() == 3); + + // ------ + polygon.clear(); + polygon.push_back(0); polygon.push_back(6); polygon.push_back(0); polygon.push_back(5); + polygons.push_back(polygon); + + res = PMP::internal::simplify_polygons_in_polygon_soup(points, polygons, K()); + assert(res == 1 && polygons.back().size() == 2); + + // ------ + polygon.clear(); + polygon.push_back(0); polygon.push_back(6); polygon.push_back(5); polygon.push_back(3); polygon.push_back(3); + polygons.push_back(polygon); + + res = PMP::internal::simplify_polygons_in_polygon_soup(points, polygons, K()); + assert(res == 1 && polygons.back().size() == 3); +} + +void test_remove_invalid_polygons(const bool /*verbose*/ = false) +{ + std::cout << "test remove_invalid_polygons... " << std::endl; + + // points are not actually needed since only the size of the polygons is considered + std::vector points; + std::vector polygons; + + std::size_t res = PMP::internal::remove_invalid_polygons_in_polygon_soup(points, polygons); + assert(res == 0 && polygons.size() == 0); + + // non-trivial polygon + Polygon polygon; + polygon.push_back(0); polygon.push_back(2); polygon.push_back(4); + polygons.push_back(polygon); + + res = PMP::internal::remove_invalid_polygons_in_polygon_soup(points, polygons); + assert(res == 0 && polygons.size() == 1); + + // another non-trivial polygon + polygon.clear(); + polygon.push_back(1); polygon.push_back(3); polygon.push_back(3); polygon.push_back(7); + polygons.push_back(polygon); + + // empty polygon + polygon.clear(); + polygons.push_back(polygon); + + // 1-vertex polygon + polygon.push_back(0); + polygons.push_back(polygon); + + // 2-vertex polygon + polygon.push_back(1); + polygons.push_back(polygon); + + // another non-trivial polygon + polygon.clear(); + polygon.push_back(8); polygon.push_back(9); polygon.push_back(7); polygon.push_back(6); + polygons.push_back(polygon); + + res = PMP::internal::remove_invalid_polygons_in_polygon_soup(points, polygons); + assert(res == 3 && polygons.size() == 3); +} + +template +std::size_t test_remove_isolated_points_data_set(PointRange& points, + PolygonRange& polygons, + const bool verbose = false) +{ + if(verbose) + { + std::cout << "Input:" << std::endl; + std::cout << points.size() << " points" << std::endl; + std::cout << polygons.size() << " polygons" << std::endl; + } + + std::size_t rm_nv = PMP::remove_isolated_points_in_polygon_soup(points, polygons); + + if(verbose) + { + std::cout << "Removed " << rm_nv << " points" << std::endl; + std::cout << points.size() << " points" << std::endl; + std::cout << polygons.size() << " polygons" << std::endl; + + std::cout << "Polygons:" << std::endl; + for(std::size_t i=0; i points; + std::vector polygons; + + // everything empty + std::size_t res = test_remove_isolated_points_data_set(points, polygons, verbose); + assert(res == 0 && points.empty() && polygons.empty()); + + points.push_back(Point_3(0,0,0)); + points.push_back(Point_3(1,2,0)); + points.push_back(Point_3(1,0,0)); + points.push_back(Point_3(1,3,0)); + points.push_back(Point_3(0,1,0)); + points.push_back(Point_3(1,1,0)); + + // no polygons (all points are unused) + std::deque points_copy(points.begin(), points.end()); + res = test_remove_isolated_points_data_set(points_copy, polygons, verbose); + assert(res == 6 && points_copy.empty() && polygons.empty()); + + Polygon polygon; + polygon.push_back(0); polygon.push_back(2); polygon.push_back(4); + polygons.push_back(polygon); + + polygon.clear(); + polygon.push_back(4); polygon.push_back(0); polygon.push_back(2); polygon.push_back(5); + polygons.push_back(polygon); + + // generic test + res = test_remove_isolated_points_data_set(points, polygons, verbose); + assert(res == 2 && points.size() == 4 && polygons.size() == 2); +} + +void test_slit_pinched_polygons(const bool /*verbose*/ = false) +{ + std::cout << "test split_pinched_polygons... " << std::endl; + + std::vector points; + std::vector polygons; + + // everything empty + std::size_t res = PMP::internal::split_pinched_polygons_in_polygon_soup(points, polygons); + assert(res == 0 && points.empty() && polygons.empty()); + + points.push_back(Point_3(0,0,0)); // #0 + points.push_back(Point_3(1,0,0)); // #1 + points.push_back(Point_3(0,1,0)); // #2 + points.push_back(Point_3(1,1,0)); // #3 + points.push_back(Point_3(1,3,0)); // #4 + points.push_back(Point_3(1,1,0)); // #5 + + // no pinch + Polygon polygon; + polygon.push_back(0); polygon.push_back(2); polygon.push_back(4); + polygons.push_back(polygon); + + res = PMP::internal::split_pinched_polygons_in_polygon_soup(points, polygons, K()); + assert(res == 0 && polygons.size() == 1); + + // pinch via same ID (2) + polygon.clear(); + polygons.clear(); + polygon.push_back(0); polygon.push_back(2); polygon.push_back(4); polygon.push_back(3); polygon.push_back(2); + polygons.push_back(polygon); + + res = PMP::internal::split_pinched_polygons_in_polygon_soup(points, polygons, K()); + assert(res == 1 && polygons.size() == 2); + assert(polygons[0].size() == 3 && polygons[1].size() == 2); + + // pinch via same point (5 & 3) + polygon.clear(); + polygons.clear(); + polygon.push_back(5); polygon.push_back(1); polygon.push_back(0); + polygon.push_back(3); polygon.push_back(4); polygon.push_back(2); + polygons.push_back(polygon); + + res = PMP::internal::split_pinched_polygons_in_polygon_soup(points, polygons, K()); + assert(res == 1 && polygons.size() == 2); + assert(polygons[0].size() == 3 && polygons[1].size() == 3); + + // pinch on last point + polygon.clear(); + polygons.clear(); + polygon.push_back(1); polygon.push_back(5); polygon.push_back(0); + polygon.push_back(2); polygon.push_back(4); polygon.push_back(3); + polygons.push_back(polygon); + + res = PMP::internal::split_pinched_polygons_in_polygon_soup(points, polygons, K()); + assert(res == 1 && polygons.size() == 2); + assert(polygons[0].size() == 4 && polygons[1].size() == 2); + + // multiple pinches + polygon.clear(); + polygons.clear(); + polygon.push_back(5); polygon.push_back(1); polygon.push_back(3); // pinch 5&3, pinch 3... + polygon.push_back(2); polygon.push_back(4); polygon.push_back(0); + polygon.push_back(1); polygon.push_back(3); polygon.push_back(1); // ... and 3, pinch 1... + polygon.push_back(2); polygon.push_back(4); polygon.push_back(1); // ... and 1 + polygons.push_back(polygon); + + res = PMP::internal::split_pinched_polygons_in_polygon_soup(points, polygons, K()); + assert(res == 3 && polygons.size() == 4); + assert(polygons[0].size() == 2); // 5 1 + assert(polygons[1].size() == 5); // 3 2 4 5 1 + assert(polygons[2].size() == 3); // 1 2 4 + assert(polygons[3].size() == 2); // 1 3 +} + +int main() +{ + test_polygon_canonicalization(true); + test_merge_duplicate_points(false); + test_merge_duplicate_polygons(false); + test_simplify_polygons(false); + test_remove_invalid_polygons(false); + test_remove_isolated_points(false); + test_slit_pinched_polygons(false); + + return EXIT_SUCCESS; +} diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_shape_predicates.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_shape_predicates.cpp new file mode 100644 index 00000000000..378c438102b --- /dev/null +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_shape_predicates.cpp @@ -0,0 +1,251 @@ +#include + +#include + +#include +#include + +#include + +#include +#include + +typedef CGAL::Exact_predicates_inexact_constructions_kernel K; +typedef K::FT FT; +typedef K::Point_3 Point_3; +typedef CGAL::Surface_mesh Surface_mesh; + +void check_edge_degeneracy(const char* fname) +{ + std::cout << "test edge degeneracy..."; + + typedef boost::graph_traits::edge_descriptor edge_descriptor; + + std::ifstream input(fname); + Surface_mesh mesh; + if (!input || !(input >> mesh) || mesh.is_empty()) { + std::cerr << fname << " is not a valid off file.\n"; + std::exit(1); + } + std::vector all_edges(edges(mesh).begin(), edges(mesh).end()); + + assert(!CGAL::Polygon_mesh_processing::is_degenerate_edge(all_edges[0], mesh)); + assert(!CGAL::Polygon_mesh_processing::is_degenerate_edge(all_edges[1], mesh)); + assert(CGAL::Polygon_mesh_processing::is_degenerate_edge(all_edges[2], mesh)); + std::cout << "done" << std::endl; +} + +void check_triangle_face_degeneracy(const char* fname) +{ + std::cout << "test face degeneracy..."; + + typedef boost::graph_traits::face_descriptor face_descriptor; + + std::ifstream input(fname); + Surface_mesh mesh; + if (!input || !(input >> mesh) || mesh.is_empty()) { + std::cerr << fname << " is not a valid off file.\n"; + std::exit(1); + } + + std::vector all_faces(faces(mesh).begin(), faces(mesh).end()); + assert(CGAL::Polygon_mesh_processing::is_degenerate_triangle_face(all_faces[0], mesh)); + assert(!CGAL::Polygon_mesh_processing::is_degenerate_triangle_face(all_faces[1], mesh)); + assert(!CGAL::Polygon_mesh_processing::is_degenerate_triangle_face(all_faces[2], mesh)); + assert(!CGAL::Polygon_mesh_processing::is_degenerate_triangle_face(all_faces[3], mesh)); + + std::cout << "done" << std::endl; +} + +// tests merge_and_duplication +template +void merge_identical_points(typename boost::graph_traits::vertex_descriptor v_keep, + typename boost::graph_traits::vertex_descriptor v_rm, + PolygonMesh& mesh) +{ + typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; + + halfedge_descriptor h = halfedge(v_rm, mesh); + halfedge_descriptor start = h; + + do + { + set_target(h, v_keep, mesh); + h = opposite(next(h, mesh), mesh); + } + while( h != start ); + + remove_vertex(v_rm, mesh); +} + +void test_vertex_non_manifoldness(const char* fname) +{ + std::cout << "test vertex non manifoldness..."; + + typedef boost::graph_traits::vertex_descriptor vertex_descriptor; + typedef boost::graph_traits::vertices_size_type size_type; + + std::ifstream input(fname); + Surface_mesh mesh; + if (!input || !(input >> mesh) || mesh.is_empty()) { + std::cerr << fname << " is not a valid off file.\n"; + std::exit(1); + } + + size_type ini_nv = num_vertices(mesh); + + // create non-manifold vertex + Surface_mesh::Vertex_index vertex_to_merge_onto(1); + Surface_mesh::Vertex_index vertex_to_merge(7); + merge_identical_points(vertex_to_merge_onto, vertex_to_merge, mesh); + mesh.collect_garbage(); + + assert(num_vertices(mesh) == ini_nv - 1); + + BOOST_FOREACH(vertex_descriptor v, vertices(mesh)) + { + if(v == vertex_to_merge_onto) + assert(CGAL::Polygon_mesh_processing::is_non_manifold_vertex(v, mesh)); + else + assert(!CGAL::Polygon_mesh_processing::is_non_manifold_vertex(v, mesh)); + } + + std::cout << "done" << std::endl; +} + +void test_vertices_merge_and_duplication(const char* fname) +{ + std::cout << "test non manifold vertex duplication..."; + + typedef boost::graph_traits::vertex_descriptor vertex_descriptor; + + std::ifstream input(fname); + Surface_mesh mesh; + if (!input || !(input >> mesh) || mesh.is_empty()) { + std::cerr << fname << " is not a valid off file.\n"; + std::exit(1); + } + const std::size_t initial_vertices = num_vertices(mesh); + + // create non-manifold vertex + Surface_mesh::Vertex_index vertex_to_merge_onto(1); + Surface_mesh::Vertex_index vertex_to_merge(7); + Surface_mesh::Vertex_index vertex_to_merge_2(14); + Surface_mesh::Vertex_index vertex_to_merge_3(21); + + Surface_mesh::Vertex_index vertex_to_merge_onto_2(2); + Surface_mesh::Vertex_index vertex_to_merge_4(8); + + merge_identical_points(vertex_to_merge_onto, vertex_to_merge, mesh); + merge_identical_points(vertex_to_merge_onto, vertex_to_merge_2, mesh); + merge_identical_points(vertex_to_merge_onto, vertex_to_merge_3, mesh); + merge_identical_points(vertex_to_merge_onto_2, vertex_to_merge_4, mesh); + mesh.collect_garbage(); + + const std::size_t vertices_after_merge = num_vertices(mesh); + assert(vertices_after_merge == initial_vertices - 4); + + std::vector > duplicated_vertices; + std::size_t new_vertices_nb = + CGAL::Polygon_mesh_processing::duplicate_non_manifold_vertices(mesh, + CGAL::parameters::output_iterator(std::back_inserter(duplicated_vertices))); + + const std::size_t final_vertices_size = vertices(mesh).size(); + assert(final_vertices_size == initial_vertices); + assert(new_vertices_nb == 4); + assert(duplicated_vertices.size() == 2); // two non-manifold vertex + assert(duplicated_vertices.front().size() == 4); + assert(duplicated_vertices.back().size() == 2); + + std::cout << "done" << std::endl; +} + +void test_needles_and_caps(const char* fname) +{ + std::cout << "test needles&caps..."; + + namespace PMP = CGAL::Polygon_mesh_processing; + + typedef boost::graph_traits::halfedge_descriptor halfedge_descriptor; + typedef boost::graph_traits::face_iterator face_iterator; + typedef boost::graph_traits::face_descriptor face_descriptor; + + std::ifstream input(fname); + Surface_mesh mesh; + if (!input || !(input >> mesh) || mesh.is_empty()) { + std::cerr << fname << " is not a valid off file.\n"; + std::exit(1); + } + + const FT eps = std::numeric_limits::epsilon(); + + face_iterator fit, fend; + boost::tie(fit, fend) = faces(mesh); + + // (0 0 0) -- (1 0 0) -- (1 1 0) (90° cap angle) + face_descriptor f = *fit; + halfedge_descriptor res = PMP::is_needle_triangle_face(f, mesh, 2/*needle_threshold*/); + assert(res == boost::graph_traits::null_halfedge()); // not a needle + res = PMP::is_needle_triangle_face(f, mesh, CGAL::sqrt(FT(2) - eps)/*needle_threshold*/); + assert(res != boost::graph_traits::null_halfedge()); // is a needle + + res = PMP::is_cap_triangle_face(f, mesh, 0./*cos(pi/2)*/); + assert(mesh.point(target(res, mesh)) == CGAL::ORIGIN); + res = PMP::is_cap_triangle_face(f, mesh, std::cos(91 * CGAL_PI / 180)); + assert(res == boost::graph_traits::null_halfedge()); + res = PMP::is_cap_triangle_face(f, mesh, std::cos(2 * CGAL_PI / 3)); + assert(res == boost::graph_traits::null_halfedge()); + ++ fit; + + // (0 0 1) -- (1 0 1) -- (10 10 1) + f = *fit; + res = PMP::is_needle_triangle_face(f, mesh, 20); + assert(res == boost::graph_traits::null_halfedge()); + res = PMP::is_needle_triangle_face(f, mesh, 10 * CGAL::sqrt(FT(2) - eps)); + assert(mesh.point(target(res, mesh)) == Point_3(1,0,1)); + res = PMP::is_needle_triangle_face(f, mesh, 1); + assert(mesh.point(target(res, mesh)) == Point_3(1,0,1)); + + res = PMP::is_cap_triangle_face(f, mesh, 0./*cos(pi/2)*/); + assert(mesh.point(target(res, mesh)) == Point_3(0,0,1)); + res = PMP::is_cap_triangle_face(f, mesh, std::cos(2 * CGAL_PI / 3)); + assert(mesh.point(target(res, mesh)) == Point_3(0,0,1)); + res = PMP::is_cap_triangle_face(f, mesh, std::cos(0.75 * CGAL_PI)); + assert(res == boost::graph_traits::null_halfedge()); + ++ fit; + + // (0 0 2) -- (1 0 2) -- (-0.99619469809 0.08715574274 2) (175° cap angle) + f = *fit; + res = PMP::is_needle_triangle_face(f, mesh, 2); + assert(res == boost::graph_traits::null_halfedge()); + res = PMP::is_needle_triangle_face(f, mesh, 1.9); + assert(mesh.point(target(res, mesh)) == Point_3(0,0,2) || + mesh.point(target(res, mesh)) == Point_3(1,0,2)); + res = PMP::is_needle_triangle_face(f, mesh, 1); + assert(mesh.point(target(res, mesh)) == Point_3(0,0,2) || + mesh.point(target(res, mesh)) == Point_3(1,0,2)); + + res = PMP::is_cap_triangle_face(f, mesh, 0./*cos(pi/2)*/); + assert(res != boost::graph_traits::null_halfedge() && + mesh.point(target(res, mesh)) != Point_3(0,0,2) && + mesh.point(target(res, mesh)) != Point_3(1,0,2)); + res = PMP::is_cap_triangle_face(f, mesh, std::cos(2 * CGAL_PI / 3)); + assert(res != boost::graph_traits::null_halfedge()); + res = PMP::is_cap_triangle_face(f, mesh, std::cos(175 * CGAL_PI / 180)); + assert(res != boost::graph_traits::null_halfedge()); + res = PMP::is_cap_triangle_face(f, mesh, std::cos(176 * CGAL_PI / 180)); + assert(res == boost::graph_traits::null_halfedge()); + + std::cout << "done" << std::endl; +} + +int main() +{ + check_edge_degeneracy("data_degeneracies/degtri_edge.off"); + check_triangle_face_degeneracy("data_degeneracies/degtri_four.off"); + test_vertex_non_manifoldness("data/blobby.off"); + test_vertices_merge_and_duplication("data/blobby.off"); + test_needles_and_caps("data_degeneracies/caps_and_needles.off"); + + return EXIT_SUCCESS; +} diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_stitching.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_stitching.cpp index 078a44338d2..975c1dbee5b 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_stitching.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_stitching.cpp @@ -1,23 +1,46 @@ #include #include + #include #include + +#include #include +#include #include #include -#include -typedef CGAL::Exact_predicates_inexact_constructions_kernel Epic; -typedef CGAL::Exact_predicates_exact_constructions_kernel Epec; +namespace PMP = CGAL::Polygon_mesh_processing; +namespace params = CGAL::parameters; + +typedef CGAL::Exact_predicates_inexact_constructions_kernel EPICK; +typedef CGAL::Exact_predicates_exact_constructions_kernel EPECK; + +void test_stitch_boundary_cycles(const char* fname) +{ + typedef CGAL::Surface_mesh Mesh; + + std::ifstream input(fname); + Mesh mesh; + if (!input || !(input >> mesh)){ + std::cerr << "Error: can not read file."; + return; + } + + std::size_t res = PMP::internal::stitch_boundary_cycles(mesh); + assert(res > 0); + assert(is_valid(mesh)); +} template void test_polyhedron(const char* fname) { - typedef CGAL::Polyhedron_3 Polyhedron; - std::cout << "Testing Polyhedron_3 " << fname << "..." << std::flush; + + typedef CGAL::Polyhedron_3 Polyhedron; + std::ifstream input(fname); Polyhedron poly; if (!input || !(input >> poly)){ @@ -26,8 +49,8 @@ void test_polyhedron(const char* fname) } assert(poly.size_of_vertices() > 0); - - CGAL::Polygon_mesh_processing::stitch_borders(poly); + + PMP::stitch_borders(poly); poly.normalize_border(); assert(poly.is_valid(false, 5)); @@ -37,9 +60,10 @@ void test_polyhedron(const char* fname) template void test_polyhedron_cc(const char* fname) { - typedef CGAL::Polyhedron_3 Polyhedron; - std::cout << "Testing Polyhedron_3 " << fname << "..." << std::flush; + + typedef CGAL::Polyhedron_3 Polyhedron; + std::ifstream input(fname); Polyhedron poly; if (!input || !(input >> poly)){ @@ -48,10 +72,8 @@ void test_polyhedron_cc(const char* fname) } assert(poly.size_of_vertices() > 0); - - CGAL::Polygon_mesh_processing:: - stitch_borders(poly, - CGAL::Polygon_mesh_processing::parameters::apply_per_connected_component(true)); + + PMP::stitch_borders(poly, params::apply_per_connected_component(true)); poly.normalize_border(); assert(poly.is_valid(false, 5)); @@ -60,66 +82,61 @@ void test_polyhedron_cc(const char* fname) void test_surface_mesh(const char* fname) { - typedef Epic K; - typedef K::Point_3 Point; - typedef CGAL::Surface_mesh Mesh; - std::cout << "Testing Surface_mesh " << fname << "..." << std::flush; + + typedef CGAL::Surface_mesh Mesh; + std::ifstream input(fname); - Mesh m; - if (!input || !(input >> m)){ + Mesh mesh; + if (!input || !(input >> mesh)){ std::cerr << "Error: can not read file."; return; } - - CGAL::Polygon_mesh_processing::stitch_borders(m); - //todo : add a validity test - assert(is_valid_polygon_mesh(m)); + PMP::stitch_borders(mesh); + assert(is_valid_polygon_mesh(mesh)); std::cout << "OK\n"; } void test_surface_mesh_cc(const char* fname) { - typedef Epic K; - typedef K::Point_3 Point; - typedef CGAL::Surface_mesh Mesh; - std::cout << "Testing Surface_mesh " << fname << "..." << std::flush; + + typedef CGAL::Surface_mesh Mesh; + std::ifstream input(fname); - Mesh m; - if (!input || !(input >> m)){ + Mesh mesh; + if (!input || !(input >> mesh)){ std::cerr << "Error: can not read file."; return; } - CGAL::Polygon_mesh_processing::stitch_borders(m, - CGAL::Polygon_mesh_processing::parameters::apply_per_connected_component(true)); - //todo : add a validity test - - assert(is_valid(m)); + PMP::stitch_borders(mesh, params::apply_per_connected_component(true)); + assert(is_valid(mesh)); std::cout << "OK\n"; } int main() { - test_polyhedron("data_stitching/full_border.off"); + test_stitch_boundary_cycles("data_stitching/boundary_cycle.off"); + test_stitch_boundary_cycles("data_stitching/boundary_cycle_2.off"); - test_polyhedron("data_stitching/full_border.off"); - test_polyhedron("data_stitching/full_border_quads.off"); - test_polyhedron("data_stitching/half_border.off"); - test_polyhedron("data_stitching/mid_border.off"); - test_polyhedron("data_stitching/multiple_incidence.off"); - test_polyhedron("data_stitching/incidence_3.off"); - test_polyhedron("data_stitching/incoherent_patch_orientation.off"); - test_polyhedron("data_stitching/non_stitchable.off"); - test_polyhedron("data_stitching/deg_border.off"); - test_polyhedron("data_stitching/two_patches.off"); - test_polyhedron("data_stitching/non_manifold.off"); - test_polyhedron("data_stitching/non_manifold2.off"); - test_polyhedron_cc("data_stitching/nm_cubes.off"); + test_polyhedron("data_stitching/full_border.off"); + test_polyhedron("data_stitching/full_border.off"); + test_polyhedron("data_stitching/full_border_quads.off"); + test_polyhedron("data_stitching/half_border.off"); + test_polyhedron("data_stitching/mid_border.off"); + test_polyhedron("data_stitching/multiple_incidence.off"); + test_polyhedron("data_stitching/incidence_3.off"); + test_polyhedron("data_stitching/incoherent_patch_orientation.off"); + test_polyhedron("data_stitching/non_stitchable.off"); + test_polyhedron("data_stitching/deg_border.off"); + test_polyhedron("data_stitching/two_patches.off"); + test_polyhedron("data_stitching/non_manifold.off"); + test_polyhedron("data_stitching/non_manifold2.off"); + test_polyhedron_cc("data_stitching/nm_cubes.off"); test_surface_mesh("data_stitching/full_border.off"); test_surface_mesh("data_stitching/full_border_quads.off"); @@ -133,6 +150,5 @@ int main() test_surface_mesh("data_stitching/non_manifold.off"); test_surface_mesh_cc("data_stitching/nm_cubes.off"); - return 0; + return EXIT_SUCCESS; } - diff --git a/Polyhedron/demo/Polyhedron/C2t3_type.h b/Polyhedron/demo/Polyhedron/C2t3_type.h index d0fc441d49c..40025b29274 100644 --- a/Polyhedron/demo/Polyhedron/C2t3_type.h +++ b/Polyhedron/demo/Polyhedron/C2t3_type.h @@ -1,7 +1,6 @@ #ifndef C2T3_TYPE_H #define C2T3_TYPE_H -#include "Polyhedron_type.h" #include #include diff --git a/Polyhedron/demo/Polyhedron/C3t3_type.h b/Polyhedron/demo/Polyhedron/C3t3_type.h index d059f437a35..db47e612a0f 100644 --- a/Polyhedron/demo/Polyhedron/C3t3_type.h +++ b/Polyhedron/demo/Polyhedron/C3t3_type.h @@ -6,7 +6,6 @@ #include #include -#include "Polyhedron_type.h" #include "SMesh_type.h" #ifdef CGAL_MESH_3_DEMO_ACTIVATE_SEGMENTED_IMAGES #include "Image_type.h" @@ -47,18 +46,16 @@ private: #endif typedef CGAL::Polyhedral_mesh_domain_with_features_3< - Kernel, Polyhedron, CGAL::Default, CGAL::Tag_true> Polyhedral_mesh_domain; -typedef CGAL::Polyhedral_mesh_domain_with_features_3< - Kernel, SMesh, CGAL::Default, int> Polyhedral_mesh_domain_sm; + EPICK, SMesh, CGAL::Default, int> Polyhedral_mesh_domain; // The last `Tag_true` says the Patch_id type will be int, and not pair #ifdef CGAL_MESH_3_DEMO_ACTIVATE_SEGMENTED_IMAGES -typedef CGAL::Labeled_mesh_domain_3 Image_domain; +typedef CGAL::Labeled_mesh_domain_3 Image_domain; typedef CGAL::Mesh_domain_with_polyline_features_3 Image_mesh_domain; #endif #ifdef CGAL_MESH_3_DEMO_ACTIVATE_IMPLICIT_FUNCTIONS -typedef Wrapper Function_wrapper; -typedef CGAL::Labeled_mesh_domain_3 Function_mesh_domain; +typedef Wrapper Function_wrapper; +typedef CGAL::Labeled_mesh_domain_3 Function_mesh_domain; #endif //Robust_cc_geom_traits diff --git a/Polyhedron/demo/Polyhedron/CMakeLists.txt b/Polyhedron/demo/Polyhedron/CMakeLists.txt index fcc77ebd995..b3f3f88a19b 100644 --- a/Polyhedron/demo/Polyhedron/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/CMakeLists.txt @@ -46,7 +46,7 @@ endif() set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}") # Include this package's headers first -include_directories( BEFORE ./ ./include ../../include ./CGAL_demo ) +include_directories( BEFORE ./ ./include ./CGAL_demo ) list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_CURRENT_SOURCE_DIR}") # Find CGAL @@ -56,7 +56,7 @@ option( POLYHEDRON_QTSCRIPT_DEBUGGER # Find Qt5 itself find_package(CGAL COMPONENTS Qt5 ImageIO) -include( ${CGAL_USE_FILE} ) +include(${CGAL_USE_FILE}) find_package(Qt5 QUIET @@ -124,6 +124,7 @@ endif() if(CGAL_Qt5_FOUND AND Qt5_FOUND AND OPENGL_FOUND ) + include(${CGAL_USE_FILE}) set(Boost_USE_MULTITHREADED ON) find_package(Boost COMPONENTS thread system filesystem) @@ -134,6 +135,7 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND AND OPENGL_FOUND ) qt5_wrap_ui( Show_point_dialogUI_FILES Show_point_dialog.ui ) qt5_wrap_ui( PreferencesUI_FILES Preferences.ui ) qt5_wrap_ui( Show_point_dialogUI_FILES Show_point_dialog.ui ) + qt5_wrap_ui( ViewerUI_FILES LightingDialog.ui) qt5_generate_moc( "File_loader_dialog.h" "${CMAKE_CURRENT_BINARY_DIR}/File_loader_dialog_moc.cpp" ) include( ${CMAKE_CURRENT_SOURCE_DIR}/polyhedron_demo_macros.cmake ) @@ -230,14 +232,11 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND AND OPENGL_FOUND ) endmacro(add_item) add_item(scene_c3t3_item Scene_c3t3_item.cpp) - target_link_libraries(scene_c3t3_item PUBLIC scene_polyhedron_item scene_polygon_soup_item scene_basic_objects ${TBB_LIBRARIES}) + target_link_libraries(scene_c3t3_item PUBLIC scene_surface_mesh_item scene_polygon_soup_item scene_basic_objects ${TBB_LIBRARIES}) if(TBB_FOUND) CGAL_target_use_TBB(scene_c3t3_item) endif() - add_item(scene_polyhedron_item Scene_polyhedron_item.cpp) - add_item(scene_polyhedron_transform_item Plugins/PCA/Scene_facegraph_transform_item.cpp ) - add_item(scene_sm_transform_item Plugins/PCA/Scene_facegraph_transform_item.cpp ) - target_compile_definitions(scene_sm_transform_item PUBLIC "-DCGAL_USE_SURFACE_MESH" ) + add_item(scene_transform_item Plugins/PCA/Scene_facegraph_transform_item.cpp ) add_item(scene_edit_box_item Plugins/PCA/Scene_edit_box_item.cpp ) add_item(scene_image_item Scene_image_item.cpp) add_item(scene_surface_mesh_item Scene_surface_mesh_item.cpp) @@ -247,57 +246,38 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND AND OPENGL_FOUND ) add_item(scene_polylines_item Scene_polylines_item.cpp) target_link_libraries(scene_polylines_item PUBLIC scene_basic_objects) - add_item(scene_polyhedron_item_decorator Scene_polyhedron_item_decorator.cpp ) - target_link_libraries(scene_polyhedron_item_decorator PUBLIC scene_polyhedron_item) + add_item(scene_item_decorator Scene_polyhedron_item_decorator.cpp ) + target_link_libraries(scene_item_decorator PUBLIC scene_surface_mesh_item) + + add_item(scene_k_ring_selection Plugins/PMP/Scene_facegraph_item_k_ring_selection.cpp) + target_link_libraries(scene_k_ring_selection PUBLIC scene_surface_mesh_item) + + add_item(scene_selection_item Scene_polyhedron_selection_item.cpp) + target_link_libraries(scene_selection_item PUBLIC scene_item_decorator scene_k_ring_selection) + + add_item(scene_shortest_path_item Plugins/Surface_mesh/Scene_polyhedron_shortest_path_item.cpp) + target_link_libraries(scene_shortest_path_item PUBLIC scene_item_decorator scene_surface_mesh_item scene_polylines_item) + + add_item(scene_movable_sm_item Plugins/AABB_tree/Scene_movable_sm_item.cpp) - add_item(scene_surface_mesh_item_decorator Scene_polyhedron_item_decorator.cpp ) - target_link_libraries(scene_surface_mesh_item_decorator PUBLIC scene_surface_mesh_item) - target_compile_definitions(scene_surface_mesh_item_decorator PUBLIC "-DUSE_SURFACE_MESH" ) - - add_item(scene_polyhedron_and_sm_item_k_ring_selection Scene_polyhedron_item_k_ring_selection.cpp) - target_link_libraries(scene_polyhedron_and_sm_item_k_ring_selection PUBLIC scene_polyhedron_item scene_surface_mesh_item) - - add_item(scene_poly_item_k_ring_selection Plugins/PMP/Scene_facegraph_item_k_ring_selection.cpp) - target_link_libraries(scene_poly_item_k_ring_selection PUBLIC scene_polyhedron_item) - - add_item(scene_sm_item_k_ring_selection Plugins/PMP/Scene_facegraph_item_k_ring_selection.cpp) - target_link_libraries(scene_sm_item_k_ring_selection PUBLIC scene_surface_mesh_item) - target_compile_definitions(scene_sm_item_k_ring_selection PUBLIC "-DUSE_SURFACE_MESH" ) - - add_item(scene_polyhedron_selection_item Scene_polyhedron_selection_item.cpp) - target_link_libraries(scene_polyhedron_selection_item PUBLIC scene_polyhedron_item_decorator scene_poly_item_k_ring_selection) - - add_item(scene_surface_mesh_selection_item Scene_polyhedron_selection_item.cpp) - target_link_libraries(scene_surface_mesh_selection_item PUBLIC scene_surface_mesh_item_decorator scene_sm_item_k_ring_selection) - target_compile_definitions(scene_surface_mesh_selection_item PUBLIC "-DUSE_SURFACE_MESH" ) - - add_item(scene_polyhedron_shortest_path_item Plugins/Surface_mesh/Scene_polyhedron_shortest_path_item.cpp) - target_link_libraries(scene_polyhedron_shortest_path_item PUBLIC scene_polyhedron_item_decorator scene_polyhedron_item scene_polylines_item) - - add_item(scene_sm_shortest_path_item Plugins/Surface_mesh/Scene_polyhedron_shortest_path_item.cpp) - target_link_libraries(scene_sm_shortest_path_item PUBLIC scene_surface_mesh_item_decorator scene_surface_mesh_item scene_polylines_item) - if(EIGEN3_FOUND ) - add_item(scene_textured_polyhedron_item Scene_textured_polyhedron_item.cpp texture.cpp) - add_item(scene_textured_surface_mesh_item Scene_textured_surface_mesh_item.cpp texture.cpp) + add_item(scene_textured_item Scene_textured_surface_mesh_item.cpp texture.cpp) qt5_wrap_ui( editionUI_FILES Plugins/Surface_mesh_deformation/Deform_mesh.ui ) - add_item(scene_edit_polyhedron_item Plugins/Surface_mesh_deformation/Scene_edit_polyhedron_item.cpp + add_item(scene_edit_item Plugins/Surface_mesh_deformation/Scene_edit_polyhedron_item.cpp ${editionUI_FILES}) - target_link_libraries(scene_edit_polyhedron_item PUBLIC scene_polyhedron_item scene_surface_mesh_item scene_polyhedron_and_sm_item_k_ring_selection + target_link_libraries(scene_edit_item PUBLIC scene_surface_mesh_item scene_k_ring_selection scene_basic_objects) - add_item(scene_mcf_poly_item Plugins/PMP/Scene_mcf_item.cpp) - add_item(scene_mcf_sm_item Plugins/PMP/Scene_mcf_item.cpp) - target_compile_definitions(scene_mcf_sm_item PUBLIC "-DUSE_SURFACE_MESH" ) + add_item(scene_mcf_item Plugins/PMP/Scene_mcf_item.cpp) endif() add_item(scene_implicit_function_item Scene_implicit_function_item.cpp ) target_link_libraries(scene_implicit_function_item PUBLIC scene_color_ramp) add_item(scene_polygon_soup_item Scene_polygon_soup_item.cpp) - target_link_libraries(scene_polygon_soup_item PUBLIC scene_polyhedron_item scene_surface_mesh_item) + target_link_libraries(scene_polygon_soup_item PUBLIC scene_surface_mesh_item) add_item(scene_nef_polyhedron_item Scene_nef_polyhedron_item.cpp) - target_link_libraries(scene_nef_polyhedron_item PUBLIC scene_polyhedron_item scene_surface_mesh_item) + target_link_libraries(scene_nef_polyhedron_item PUBLIC scene_surface_mesh_item) find_package(LASLIB) if (LASLIB_FOUND) @@ -321,7 +301,6 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND AND OPENGL_FOUND ) demo_framework scene_basic_objects scene_color_ramp - scene_polyhedron_item scene_polygon_soup_item scene_nef_polyhedron_item) add_to_cached_list( CGAL_EXECUTABLE_TARGETS ${lib} ) @@ -386,20 +365,15 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND AND OPENGL_FOUND ) export( TARGETS demo_framework - scene_polyhedron_item scene_surface_mesh_item scene_points_with_normal_item scene_color_ramp scene_implicit_function_item scene_polylines_item scene_basic_objects - scene_polyhedron_selection_item - scene_surface_mesh_selection_item - scene_polyhedron_item_decorator - scene_surface_mesh_item_decorator - scene_polyhedron_and_sm_item_k_ring_selection - scene_poly_item_k_ring_selection - scene_sm_item_k_ring_selection + scene_selection_item + scene_item_decorator + scene_k_ring_selection NAMESPACE Polyhedron_ APPEND FILE polyhedron_demo_targets.cmake) diff --git a/Polyhedron/demo/Polyhedron/LightingDialog.ui b/Polyhedron/demo/Polyhedron/LightingDialog.ui new file mode 100644 index 00000000000..87f3dfb0969 --- /dev/null +++ b/Polyhedron/demo/Polyhedron/LightingDialog.ui @@ -0,0 +1,209 @@ + + + LightingDialog + + + + 0 + 0 + 412 + 191 + + + + Dialog + + + + + + + + ambient: + + + + + + + diffuse: + + + + + + + specular: + + + + + + + + + + false + + + + + + + position: + + + + + + + + + + false + + + + + + + + + + false + + + + + + + + + + + + + 32767 + + + true + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + + + + specular power: + + + + + + + + + 1 + + + + + + + 1 + + + 250 + + + true + + + Qt::Horizontal + + + QSlider::NoTicks + + + + + + + 250 + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok|QDialogButtonBox::RestoreDefaults + + + false + + + + + + + + + buttonBox + accepted() + LightingDialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + LightingDialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/Polyhedron/demo/Polyhedron/MainWindow.cpp b/Polyhedron/demo/Polyhedron/MainWindow.cpp index 5cb9e90a6b8..c7bffa69bd3 100644 --- a/Polyhedron/demo/Polyhedron/MainWindow.cpp +++ b/Polyhedron/demo/Polyhedron/MainWindow.cpp @@ -17,7 +17,6 @@ #include #include #include -#include #include #include #include @@ -38,7 +37,10 @@ #include #include #include +#include #include +#include +#include #ifdef QT_SCRIPT_LIB # include # ifdef QT_SCRIPTTOOLS_LIB @@ -125,6 +127,7 @@ QScriptValue myPrintFunction(QScriptContext *context, QScriptEngine *engine) MainWindow::~MainWindow() { + searchAction->deleteLater(); delete ui; delete statistics_ui; } @@ -134,6 +137,7 @@ MainWindow::MainWindow(bool verbose, QWidget* parent) ui = new Ui::MainWindow; ui->setupUi(this); menuBar()->setNativeMenuBar(false); + searchAction = new QWidgetAction(0); CGAL::Three::Three::s_mainwindow = this; menu_map[ui->menuOperations->title()] = ui->menuOperations; this->verbose = verbose; @@ -153,7 +157,6 @@ MainWindow::MainWindow(bool verbose, QWidget* parent) viewer->setScene(scene); CGAL::Three::Three::s_scene = scene; CGAL::Three::Three::s_connectable_scene = scene; - ui->actionMaxTextItemsDisplayed->setText(QString("Set Maximum Text Items Displayed : %1").arg(viewer->textRenderer()->getMax_textItems())); { QShortcut* shortcut = new QShortcut(QKeySequence(Qt::ALT+Qt::Key_Q), this); connect(shortcut, SIGNAL(activated()), @@ -161,6 +164,9 @@ MainWindow::MainWindow(bool verbose, QWidget* parent) shortcut = new QShortcut(QKeySequence(Qt::Key_F5), this); connect(shortcut, SIGNAL(activated()), this, SLOT(reloadItem())); + shortcut = new QShortcut(QKeySequence(Qt::Key_F11), this); + connect(shortcut, SIGNAL(activated()), + this, SLOT(toggleFullScreen())); } proxyModel = new QSortFilterProxyModel(this); @@ -193,8 +199,6 @@ MainWindow::MainWindow(bool verbose, QWidget* parent) connect(viewer, &Viewer::needNewContext, [this](){create();}); - connect(ui->actionSet_Transparency_Pass_Number, SIGNAL(triggered()), - viewer, SLOT(setTotalPass_clicked())); connect(scene, SIGNAL(updated()), this, SLOT(selectionChanged())); @@ -261,16 +265,11 @@ MainWindow::MainWindow(bool verbose, QWidget* parent) // this, SLOT(showSceneContextMenu(const QPoint &))); connect(ui->actionRecenterScene, SIGNAL(triggered()), viewer, SLOT(update())); - connect(ui->actionAntiAliasing, SIGNAL(toggled(bool)), - viewer, SLOT(setAntiAliasing(bool))); - connect(ui->actionDrawTwoSides, SIGNAL(toggled(bool)), viewer, SLOT(setTwoSides(bool))); - connect(ui->actionQuickCameraMode, SIGNAL(toggled(bool)), - viewer, SLOT(setFastDrawing(bool))); connect(ui->actionSwitchProjection, SIGNAL(toggled(bool)), viewer, SLOT(SetOrthoProjection(bool))); - + // add the "About CGAL..." and "About demo..." entries this->addAboutCGAL(); this->addAboutDemo(":/cgal/Polyhedron_3/about.html"); @@ -351,6 +350,10 @@ MainWindow::MainWindow(bool verbose, QWidget* parent) readSettings(); // Among other things, the column widths are stored. // Load plugins, and re-enable actions that need it. + operationSearchBar.setPlaceholderText("Research..."); + searchAction->setDefaultWidget(&operationSearchBar); + connect(&operationSearchBar, &QLineEdit::textChanged, + this, &MainWindow::filterOperations); loadPlugins(); // Setup the submenu of the View menu that can toggle the dockwidgets @@ -408,9 +411,11 @@ void filterMenuOperations(QMenu* menu) void MainWindow::filterOperations() { + QString filter=operationSearchBar.text(); Q_FOREACH(const PluginNamePair& p, plugins) { Q_FOREACH(QAction* action, p.first->actions()) { - action->setVisible( p.first->applicable(action) ); + action->setVisible( p.first->applicable(action) + && action->text().contains(filter, Qt::CaseInsensitive)); } } // do a pass over all menus in Operations and their sub-menus(etc.) and hide them when they are empty @@ -679,7 +684,9 @@ void MainWindow::updateMenus() as = ui->menuOperations->actions(); qSort(as.begin(), as.end(), actionsByName); ui->menuOperations->clear(); + ui->menuOperations->addAction(searchAction); ui->menuOperations->addActions(as); + operationSearchBar.setFocus(); } bool MainWindow::hasPlugin(const QString& pluginName) const @@ -1050,7 +1057,6 @@ void MainWindow::open(QString filename) default: load_pair = File_loader_dialog::getItem(fileinfo.fileName(), selected_items, &ok); } - viewer->makeCurrent(); if(!ok || load_pair.first.isEmpty()) { return; } @@ -1063,14 +1069,13 @@ void MainWindow::open(QString filename) } - QSettings settings; settings.setValue("OFF open directory", fileinfo.absoluteDir().absolutePath()); CGAL::Three::Scene_item* scene_item = loadItem(fileinfo, findLoader(load_pair.first)); + if(!scene_item) return; this->addToRecentFiles(fileinfo.absoluteFilePath()); - selectSceneItem(scene->addItem(scene_item)); CGAL::Three::Scene_group_item* group = @@ -1466,12 +1471,18 @@ void MainWindow::updateDisplayInfo() { void MainWindow::readSettings() { QSettings settings; - // enable anti-aliasing - ui->actionAntiAliasing->setChecked(settings.value("antialiasing", false).toBool()); + viewer->setAntiAliasing(settings.value("antialiasing", false).toBool()); + viewer->setFastDrawing(settings.value("quick_camera_mode", true).toBool()); + viewer->textRenderer()->setMax(settings.value("max_text_items", 10000).toInt()); + viewer->setTotalPass(settings.value("transparency_pass_number", 4).toInt()); + CGAL::Three::Three::s_defaultSMRM = CGAL::Three::Three::modeFromName( + settings.value("default_sm_rm", "flat+edges").toString()); + CGAL::Three::Three::s_defaultPSRM = CGAL::Three::Three::modeFromName( + settings.value("default_ps_rm", "points").toString()); // read plugin blacklist QStringList blacklist=settings.value("plugin_blacklist",QStringList()).toStringList(); Q_FOREACH(QString name,blacklist){ plugin_blacklist.insert(name); } - set_facegraph_mode_adapter(settings.value("polyhedron_mode", true).toBool()); + def_save_dir = settings.value("default_saveas_dir", QDir::homePath()).toString(); } void MainWindow::writeSettings() @@ -1479,15 +1490,11 @@ void MainWindow::writeSettings() this->writeState("MainWindow"); { QSettings settings; - settings.setValue("antialiasing", - ui->actionAntiAliasing->isChecked()); //setting plugin blacklist QStringList blacklist; Q_FOREACH(QString name,plugin_blacklist){ blacklist << name; } if ( !blacklist.isEmpty() ) settings.setValue("plugin_blacklist",blacklist); else settings.remove("plugin_blacklist"); - //setting polyhedron mode - settings.setValue("polyhedron_mode", this->property("is_polyhedron_mode").toBool()); } std::cerr << "Write setting... done.\n"; } @@ -1556,7 +1563,8 @@ void MainWindow::on_actionLoadScript_triggered() tr("Select a script to run..."), ".", "QTScripts (*.js);;All Files (*)"); - + if(filename.isEmpty()) + return; loadScript(QFileInfo(filename)); #endif } @@ -1587,7 +1595,7 @@ void MainWindow::on_actionLoad_triggered() filters << filter; } } - QSettings settings; + QString directory = settings.value("OFF open directory", QDir::current().dirName()).toString(); @@ -1614,7 +1622,9 @@ void MainWindow::on_actionLoad_triggered() static_cast(nb_files), std::back_inserter(colors_)); std::size_t nb_item = -1; + Q_FOREACH(const QString& filename, dialog.selectedFiles()) { + CGAL::Three::Scene_item* item = NULL; if(selectedPlugin) { QFileInfo info(filename); @@ -1654,9 +1664,8 @@ void MainWindow::on_actionSaveAs_triggered() sf = plugin->saveNameFilters().split(";;").first(); } } - QString ext1, ext2; QRegExp extensions("\\(\\*\\..+\\)"); - QStringList filter_ext; + QStringList filter_exts; if(filters.empty()) { QMessageBox::warning(this, @@ -1671,7 +1680,7 @@ void MainWindow::on_actionSaveAs_triggered() Q_FOREACH(QString s, sl){ int pos = extensions.indexIn(s); if( pos >-1) - filter_ext.append(extensions.capturedTexts()); + filter_exts.append(extensions.capturedTexts()); } } filters << tr("All files (*)"); @@ -1684,10 +1693,15 @@ void MainWindow::on_actionSaveAs_triggered() } QString caption = tr("Save %1 to File...").arg(item->name()); QString dir = item->property("source filename").toString(); - if(dir.isEmpty()) - dir = QString("%1/%2").arg(last_saved_dir).arg(item->name()); - if(dir.isEmpty()) - dir = item->name(); + if(dir.isEmpty() && + !item->property("defaultSaveDir").toString().isEmpty()) + { + dir = item->property("defaultSaveDir").toString(); + } + else if(!last_saved_dir.isEmpty() && dir.isEmpty()) + dir = QString("%1/%2").arg(last_saved_dir).arg(item->defaultSaveName()); + else if(dir.isEmpty()) + dir = QString("%1/%2").arg(def_save_dir).arg(item->name()); QString filename = QFileDialog::getSaveFileName(this, caption, @@ -1695,24 +1709,25 @@ void MainWindow::on_actionSaveAs_triggered() filters.join(";;"), &sf); - last_saved_dir = QFileInfo(dir).absoluteDir().path(); - extensions.indexIn(sf.split(";;").first()); - ext1 = extensions.cap().split(" ").first();// in case of syntax like (*.a *.b) - - ext1.remove(")"); - ext1.remove("("); - //remove * - ext1=ext1.right(ext1.size()-1); if(filename.isEmpty()) continue; + last_saved_dir = QFileInfo(filename).absoluteDir().path(); + extensions.indexIn(sf.split(";;").first()); + QString filter_ext, filename_ext; + filter_ext = extensions.cap().split(" ").first();// in case of syntax like (*.a *.b) + + filter_ext.remove(")"); + filter_ext.remove("("); + //remove * + filter_ext=filter_ext.right(filter_ext.size()-1); QStringList filename_split = filename.split("."); filename_split.removeFirst(); - ext2 = filename_split.join("."); - ext2.push_front("."); + filename_ext = filename_split.join("."); + filename_ext.push_front("."); QStringList final_extensions; - Q_FOREACH(QString string, filter_ext) + Q_FOREACH(QString string, filter_exts) { Q_FOREACH(QString s, string.split(" ")){// in case of syntax like (*.a *.b) s.remove(")"); @@ -1722,9 +1737,29 @@ void MainWindow::on_actionSaveAs_triggered() final_extensions.append(s); } } - if(!final_extensions.contains(ext2)) + bool ok = false; + while(!ok) { - filename = filename.append(ext1); + if(final_extensions.contains(filename_ext)) + { + ok = true; + } + else{ + QStringList shatterd_filename_ext = filename_ext.split("."); + if(!shatterd_filename_ext.last().isEmpty()) + { + shatterd_filename_ext.removeFirst();//removes "" + shatterd_filename_ext.removeFirst(); + filename_ext = shatterd_filename_ext.join("."); + filename_ext.push_front("."); + } + else + break; + } + } + if(!ok) + { + filename = filename.append(filter_ext); } viewer->update(); save(filename, item); @@ -1802,20 +1837,56 @@ void MainWindow::on_actionSetPolyhedronB_triggered() int i = getSelectedSceneItemIndex(); scene->setItemB(i); } + void MainWindow::on_actionPreferences_triggered() { QDialog dialog(this); Ui::PreferencesDialog prefdiag; + QSettings settings; prefdiag.setupUi(&dialog); - if(this->property("is_polyhedron_mode").toBool()) - prefdiag.polyRadioButton->setChecked(true); - else - prefdiag.smRadioButton->setChecked(true); - connect(prefdiag.polyRadioButton, &QRadioButton::toggled, - this, &MainWindow::set_facegraph_mode_adapter); - - //QStandardItemModel* iStandardModel = new QStandardItemModel(this); - + + prefdiag.antialiasingCheckBox->setChecked(settings.value("antialiasing", false).toBool()); + connect(prefdiag.antialiasingCheckBox, SIGNAL(toggled(bool)), + viewer, SLOT(setAntiAliasing(bool))); + + prefdiag.quick_cameraCheckBox->setChecked( + settings.value("quick_camera_mode", true).toBool()); + connect(prefdiag.quick_cameraCheckBox, SIGNAL(toggled(bool)), + viewer, SLOT(setFastDrawing(bool))); + prefdiag.max_itemsSpinBox->setValue(viewer->textRenderer()->getMax_textItems()); + + connect(prefdiag.max_itemsSpinBox,static_cast(&QSpinBox::valueChanged), + this, [this](int i){ + setMaxTextItemsDisplayed(i); + }); + prefdiag.transpSpinBox->setValue(viewer->total_pass()); + connect(prefdiag.transpSpinBox, static_cast(&QSpinBox::valueChanged), + this, [this](int i) + { + setTransparencyPasses(i); + }); + connect(prefdiag.background_colorPushButton, &QPushButton::clicked, + this, &MainWindow::setBackgroundColor); + + connect(prefdiag.default_save_asPushButton, &QPushButton::clicked, + this, &MainWindow::setDefaultSaveDir); + + connect(prefdiag.lightingPushButton, &QPushButton::clicked, + this, &MainWindow::setLighting_triggered); + + prefdiag.surface_meshComboBox->setCurrentText(CGAL::Three::Three::modeName( + CGAL::Three::Three::s_defaultSMRM)); + connect(prefdiag.surface_meshComboBox, &QComboBox::currentTextChanged, + this, [this](const QString& text){ + this->s_defaultSMRM = CGAL::Three::Three::modeFromName(text); + }); + + prefdiag.point_setComboBox->setCurrentText(CGAL::Three::Three::modeName( + CGAL::Three::Three::s_defaultPSRM)); + connect(prefdiag.point_setComboBox, &QComboBox::currentTextChanged, + this, [this](const QString& text){ + this->s_defaultPSRM = CGAL::Three::Three::modeFromName(text); + }); std::vector items; QBrush successBrush(Qt::green), errorBrush(Qt::red), @@ -1865,10 +1936,27 @@ void MainWindow::on_actionPreferences_triggered() if (item->checkState(0)==Qt::Checked) plugin_blacklist.insert(item->text(1)); } + + //write settings + settings.setValue("antialiasing", + prefdiag.antialiasingCheckBox->isChecked()); + settings.setValue("quick_camera_mode", + prefdiag.quick_cameraCheckBox->isChecked()); + settings.setValue("transparency_pass_number", + viewer->total_pass()); + settings.setValue("max_text_items", + viewer->textRenderer()->getMax_textItems()); + settings.setValue("background_color",viewer->backgroundColor().name()); + settings.setValue("default_sm_rm", CGAL::Three::Three::modeName( + CGAL::Three::Three::defaultSurfaceMeshRenderingMode())); + settings.setValue("default_ps_rm", CGAL::Three::Three::modeName( + CGAL::Three::Three::defaultPointSetRenderingMode())); + + } } -void MainWindow::on_actionSetBackgroundColor_triggered() +void MainWindow::setBackgroundColor() { QColor c = QColorDialog::getColor(); if(c.isValid()) { @@ -1877,6 +1965,11 @@ void MainWindow::on_actionSetBackgroundColor_triggered() } } +void MainWindow::setLighting_triggered() +{ + viewer->setLighting(); +} + void MainWindow::on_actionLookAt_triggered() { Show_point_dialog dialog(this); @@ -2143,18 +2236,9 @@ void MainWindow::setExpanded(QModelIndex index) } -void MainWindow::on_actionMaxTextItemsDisplayed_triggered() +void MainWindow::setMaxTextItemsDisplayed(int val) { - bool ok; - bool valid; - QString text = QInputDialog::getText(this, tr("Maximum Number of Text Items"), - tr("Maximum Text Items Diplayed:"), QLineEdit::Normal, - QString("%1").arg(viewer->textRenderer()->getMax_textItems()), &ok); - text.toInt(&valid); - if (ok && valid){ - viewer->textRenderer()->setMax(text.toInt()); - ui->actionMaxTextItemsDisplayed->setText(QString("Set Maximum Text Items Displayed : %1").arg(text.toInt())); - } + viewer->textRenderer()->setMax(val); } void MainWindow::resetHeader() @@ -2215,20 +2299,7 @@ void MainWindow::colorItems() } viewer->update(); } -// Only used to make the doc clearer. Only the adapter is actueally used in the code, -// for signal/slots reasons. -void MainWindow::set_face_graph_default_type(Face_graph_mode m) -{ - this->setProperty("is_polyhedron_mode", m); -} -void MainWindow::set_facegraph_mode_adapter(bool is_polyhedron) -{ - if(is_polyhedron) - set_face_graph_default_type(POLYHEDRON); - else - set_face_graph_default_type(SURFACE_MESH); -} void MainWindow::exportStatistics() { @@ -2298,3 +2369,41 @@ void MainWindow::propagate_action() } } } +void MainWindow::setTransparencyPasses(int val) +{ + viewer->setTotalPass(val); + viewer->update(); +} + +void MainWindow::toggleFullScreen() +{ + QList dockWidgets = findChildren(); + if(visibleDockWidgets.isEmpty()) + { + Q_FOREACH(QDockWidget * dock, dockWidgets) + { + if(dock->isVisible()) + { + visibleDockWidgets.append(dock); + dock->hide(); + } + } + } + else + { + Q_FOREACH(QDockWidget * dock, visibleDockWidgets){ + dock->show(); + } + visibleDockWidgets.clear(); + + } +} + +void MainWindow::setDefaultSaveDir() +{ + QString dirpath = QFileDialog::getExistingDirectory(this, "Set Default Save as Directory", def_save_dir); + if(!dirpath.isEmpty()) + def_save_dir = dirpath; + QSettings settings; + settings.setValue("default_saveas_dir", def_save_dir); +} diff --git a/Polyhedron/demo/Polyhedron/MainWindow.h b/Polyhedron/demo/Polyhedron/MainWindow.h index c1eb1079623..cc543525563 100644 --- a/Polyhedron/demo/Polyhedron/MainWindow.h +++ b/Polyhedron/demo/Polyhedron/MainWindow.h @@ -17,10 +17,13 @@ #include #include #include +#include + class Scene; class Viewer; class QTreeView; class QMenu; +class QWidgetAction; namespace CGAL { namespace Three{ class Polyhedron_demo_io_plugin_interface; @@ -36,8 +39,6 @@ namespace Ui { class Statistics_on_item_dialog; } -#include "Polyhedron_type_fwd.h" - #include "Messages_interface.h" /*! @@ -238,11 +239,6 @@ public Q_SLOTS: /// This slot is used to test exception handling in Qt Scripts. void throw_exception(); - /*! - * set_face_graph_default_type sets the global state of the application to `Polyhedron mode` or `Surface_mesh mode`. - */ - void set_face_graph_default_type(MainWindow::Face_graph_mode m); - /*! * Writes the statistics dialog content in a text file. */ @@ -314,7 +310,8 @@ protected Q_SLOTS: //!Swap the visibility of the selected item(s). void on_actionShowHide_triggered(); //!Pops a dialog to change the max TextItems - void on_actionMaxTextItemsDisplayed_triggered(); + void setMaxTextItemsDisplayed(int val); + void setTransparencyPasses(int val); // Select A/B //!Sets the selected item as item_A. void on_actionSetPolyhedronA_triggered(); @@ -332,7 +329,9 @@ protected Q_SLOTS: //!Calls the function saveSnapShot of the viewer. void on_actionSaveSnapshot_triggered(); //!Opens a Dialog to choose a color and make it the background color. - void on_actionSetBackgroundColor_triggered(); + void setBackgroundColor(); + //!Opens a Dialog to change the lighting settings + void setLighting_triggered(); /*! Opens a Dialog to enter coordinates of the new center point and sets it * with viewerShow. *@see viewerShow(float, float, float, float, float, float) @@ -434,8 +433,14 @@ public: void evaluate_script_quiet(QString script, const QString & fileName = QString()); #endif -private Q_SLOTS: - void set_facegraph_mode_adapter(bool is_polyhedron); +public Q_SLOTS: + void toggleFullScreen(); + void setDefaultSaveDir(); +private: + QList visibleDockWidgets; + QLineEdit operationSearchBar; + QWidgetAction* searchAction; + QString def_save_dir; }; #endif // ifndef MAINWINDOW_H diff --git a/Polyhedron/demo/Polyhedron/MainWindow.ui b/Polyhedron/demo/Polyhedron/MainWindow.ui index 4d0b6d572e8..38eaa51b87a 100644 --- a/Polyhedron/demo/Polyhedron/MainWindow.ui +++ b/Polyhedron/demo/Polyhedron/MainWindow.ui @@ -93,16 +93,11 @@ - - - - - @@ -384,14 +379,6 @@ Ctrl+D - - - true - - - &Antialiasing - - n/a @@ -417,12 +404,12 @@ - Set Polyhedron A + Set Facegraph A - Set Polyhedron B + Set Facegraph B @@ -444,11 +431,6 @@ Ctrl+R - - - Change &Background Color... - - &Look at... @@ -497,22 +479,6 @@ Load Plugin - - - true - - - true - - - Quick Camera Mode - - - - - Set Maximum Text Items Displayed : - - true @@ -526,25 +492,6 @@ Set Different Colors for Selected Items - - - true - - - true - - - Polyhedron Mode - - - In Polyhedron Mode, the default type for facegraphs is Polyhedron, by opposition to Surface_mesh. - - - - - Set Transparency &Pass Number - - diff --git a/Polyhedron/demo/Polyhedron/One_ring_iterators.h b/Polyhedron/demo/Polyhedron/One_ring_iterators.h index 680c2fdf9e3..fbbfe7a23d5 100644 --- a/Polyhedron/demo/Polyhedron/One_ring_iterators.h +++ b/Polyhedron/demo/Polyhedron/One_ring_iterators.h @@ -1,6 +1,6 @@ #ifndef ONE_RING_ITERATORS_H #define ONE_RING_ITERATORS_H -#include "Polyhedron_type.h" + /***************************************************************/ /* For iterating on one ring neighbor, sample usage: Halfedge_handle h; //or Vertex_handle or Facet_handle diff --git a/Polyhedron/demo/Polyhedron/Plugins/AABB_tree/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/AABB_tree/CMakeLists.txt index 367251c51fe..bff0df4c9a1 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/AABB_tree/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/AABB_tree/CMakeLists.txt @@ -1,7 +1,10 @@ include( polyhedron_demo_macros ) +polyhedron_demo_plugin(do_trees_intersect_plugin Do_trees_intersect_plugin) +target_link_libraries(do_trees_intersect_plugin PUBLIC scene_surface_mesh_item scene_movable_sm_item) + polyhedron_demo_plugin(cut_plugin Cut_plugin ) -target_link_libraries(cut_plugin PUBLIC scene_polyhedron_item scene_surface_mesh_item scene_basic_objects scene_color_ramp) +target_link_libraries(cut_plugin PUBLIC scene_surface_mesh_item scene_basic_objects scene_color_ramp) if(TBB_FOUND) CGAL_target_use_TBB(cut_plugin) endif() diff --git a/Polyhedron/demo/Polyhedron/Plugins/AABB_tree/Cut_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/AABB_tree/Cut_plugin.cpp index 984ba185be3..71dd2874115 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/AABB_tree/Cut_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/AABB_tree/Cut_plugin.cpp @@ -7,7 +7,6 @@ #include "Color_ramp.h" #include "Messages_interface.h" #include "Scene_plane_item.h" -#include "Scene_polyhedron_item.h" #include "Scene_surface_mesh_item.h" #include #include @@ -24,8 +23,6 @@ #include -#include "Polyhedron_type.h" - #include #include @@ -74,23 +71,22 @@ Simple_kernel::Vector_3 random_vector() //functor for tbb parallelization -template +template class FillGridSize { std::size_t grid_size; Point_distance (&distance_function)[100][100]; FT diag; FT& max_distance_function; - std::vector&trees; std::vector&sm_trees; bool is_signed; CGAL::qglviewer::ManipulatedFrame* frame; public: FillGridSize(std::size_t grid_size, FT diag, Point_distance (&distance_function)[100][100], - FT& max_distance_function, std::vector& trees, std::vector& sm_trees, + FT& max_distance_function, std::vector& sm_trees, bool is_signed, CGAL::qglviewer::ManipulatedFrame* frame) : grid_size(grid_size), distance_function (distance_function), diag(diag), max_distance_function(max_distance_function), - trees(trees), sm_trees(sm_trees), is_signed(is_signed), frame(frame) + sm_trees(sm_trees), is_signed(is_signed), frame(frame) { } template @@ -104,7 +100,6 @@ public: const FT dy = 2*diag; const FT z (0); const FT fd = FT(1); - Tree *min_tree = NULL ; SM_Tree *min_sm_tree = NULL; for( std::size_t t = r.begin(); t != r.end(); ++t) { @@ -116,24 +111,12 @@ public: Simple_kernel::Vector_3 offset(v_offset.x, v_offset.y, v_offset.z); Point query = transfo( Point(x,y,z))-offset; FT min = DBL_MAX; - bool is_min_sm = false; - Q_FOREACH(Tree *tree, trees) - { - FT dist = CGAL::sqrt( tree->squared_distance(query) ); - if(dist < min) - { - min = dist; - if(is_signed) - min_tree = tree; - } - } Q_FOREACH(SM_Tree *tree, sm_trees) { FT dist = CGAL::sqrt( tree->squared_distance(query) ); if(dist < min) { min = dist; - is_min_sm = true; if(is_signed) min_sm_tree = tree; } @@ -144,13 +127,13 @@ public: if(is_signed) { - if(!min_tree && !min_sm_tree) + if(!min_sm_tree) { distance_function[i][j] = Point_distance(query,DBL_MAX); max_distance_function = DBL_MAX;//(std::max)(min, max_distance_function); continue; } - typedef typename Tree::size_type size_type; + typedef typename SM_Tree::size_type size_type; Simple_kernel::Vector_3 random_vec = random_vector(); const Simple_kernel::Point_3& p = distance_function[i][j].first; @@ -158,8 +141,7 @@ public: // get sign through ray casting (random vector) Simple_kernel::Ray_3 ray(p, random_vec); - size_type nbi = (is_min_sm) ? min_sm_tree->number_of_intersected_primitives(ray) - : min_tree->number_of_intersected_primitives(ray); + size_type nbi = min_sm_tree->number_of_intersected_primitives(ray); FT sign ( (nbi&1) == 0 ? 1 : -1); distance_function[i][j].second = sign * unsigned_distance; @@ -226,18 +208,6 @@ struct PPMAP } }; -typedef CGAL::AABB_face_graph_triangle_primitive > Facet_primitive; -typedef CGAL::AABB_traits Facet_traits; -typedef CGAL::AABB_tree Facet_tree; - -typedef CGAL::AABB_halfedge_graph_segment_primitive > Edge_primitive; -typedef CGAL::AABB_traits Edge_traits; -typedef CGAL::AABB_tree Edge_tree; - - -typedef QMap Facet_trees; -typedef QMap Edge_trees; - typedef CGAL::AABB_face_graph_triangle_primitive > Facet_sm_primitive; typedef CGAL::AABB_traits Facet_sm_traits; typedef CGAL::AABB_tree Facet_sm_tree; @@ -254,31 +224,6 @@ class Q_DECL_EXPORT Scene_aabb_item : public CGAL::Three::Scene_item { Q_OBJECT public: - Scene_aabb_item(const Facet_tree& tree) : CGAL::Three::Scene_item(1,1) - { - const CGAL::qglviewer::Vec offset = static_cast(CGAL::QGLViewer::QGLViewerPool().first())->offset(); - positions_lines.clear(); - - CGAL::AABB_drawing_traits > traits; - traits.v_edges = &positions_lines; - for(int i=0; i<3; ++i) - traits.offset[i] = offset[i]; - - tree.traversal(0, traits); - const CGAL::Bbox_3 bbox = tree.bbox(); - _bbox = Bbox(bbox.xmin(), - bbox.ymin(), - bbox.zmin(), - bbox.xmax(), - bbox.ymax(), - bbox.zmax()); - qDebug()<name()<<" at creation: "<(CGAL::QGLViewer::QGLViewerPool().first())->offset(); @@ -664,16 +609,6 @@ public: texture = new Texture(m_grid_size,m_grid_size); } - void set_facet_trees(Facet_trees *facet_trees) - { - this->facet_trees = facet_trees; - } - - void set_edge_trees(Edge_trees *edge_trees) - { - this->edge_trees = edge_trees; - } - void set_facet_sm_trees(Facet_sm_trees *facet_trees) { this->facet_sm_trees = facet_trees; @@ -755,8 +690,6 @@ public: void setCutPlaneType(Cut_planes_types type){ m_cut_plane = type;} Cut_planes_types cutPlaneType()const {return m_cut_plane;} private: - Edge_trees* edge_trees; - Facet_trees* facet_trees; Edge_sm_trees* edge_sm_trees; Facet_sm_trees* facet_sm_trees; enum VAOs{ @@ -779,7 +712,7 @@ private: mutable Point_distance m_distance_function[100][100]; mutable GLuint textureId; mutable Texture *texture; - // An aabb_tree indexing polyhedron facets/segments + // An aabb_tree indexing surface_mesh facets/segments mutable Color_ramp m_red_ramp; mutable Color_ramp m_blue_ramp; mutable Color_ramp m_thermal_ramp; @@ -787,29 +720,23 @@ private: mutable std::vector tex_map; mutable Cut_planes_types m_cut_plane; mutable std::vector buffers; - template - - - void compute_distance_function(QMap *trees, QMap *sm_trees, bool is_signed = false)const + template + void compute_distance_function(QMap *sm_trees, bool is_signed = false)const { m_max_distance_function = FT(0); FT diag = scene_diag(); - std::vector closed_trees; std::vector closed_sm_trees; - Q_FOREACH(Tree *tree, trees->values()) - if(!(is_signed && !qobject_cast(trees->key(tree))->polyhedron()->is_closed())) - closed_trees.push_back(tree); Q_FOREACH(SM_Tree *sm_tree, sm_trees->values()) - if(!(is_signed && !CGAL::is_closed(*qobject_cast(sm_trees->key(sm_tree))->polyhedron()))) - closed_sm_trees.push_back(sm_tree); + if(!(is_signed && !CGAL::is_closed(*qobject_cast(sm_trees->key(sm_tree))->polyhedron()))) + closed_sm_trees.push_back(sm_tree); #ifndef CGAL_LINKED_WITH_TBB - FillGridSize f(m_grid_size, diag, m_distance_function, m_max_distance_function, closed_trees, closed_sm_trees, is_signed, frame); + FillGridSize f(m_grid_size, diag, m_distance_function, m_max_distance_function, closed_sm_trees, is_signed, frame); HackRange range(0, static_cast(m_grid_size*m_grid_size)); f(range); #else - FillGridSize f(m_grid_size, diag, m_distance_function, m_max_distance_function, closed_trees, closed_sm_trees, is_signed, frame); + FillGridSize f(m_grid_size, diag, m_distance_function, m_max_distance_function, closed_sm_trees, is_signed, frame); tbb::parallel_for(tbb::blocked_range(0, m_grid_size*m_grid_size), f); #endif } @@ -857,17 +784,17 @@ private: switch(m_cut_plane) { case UNSIGNED_FACETS: - if ( facet_trees->empty() && facet_sm_trees->empty() ) { return; } - compute_distance_function(facet_trees, facet_sm_trees); + if ( facet_sm_trees->empty() ) { return; } + compute_distance_function(facet_sm_trees); break; case SIGNED_FACETS: - if ( facet_trees->empty() && facet_sm_trees->empty() ) { return; } - compute_distance_function(facet_trees, facet_sm_trees, true); + if (facet_sm_trees->empty() ) { return; } + compute_distance_function( facet_sm_trees, true); break; case UNSIGNED_EDGES: - if ( edge_trees->empty() && edge_sm_trees->empty()) { return; } - compute_distance_function(edge_trees, edge_sm_trees); + if ( edge_sm_trees->empty()) { return; } + compute_distance_function( edge_sm_trees); break; default: break; @@ -1014,11 +941,10 @@ public: virtual ~Polyhedron_demo_cut_plugin(); bool applicable(QAction*) const { - // returns true if one polyhedron is in the entries + // returns true if one surface_mesh is in the entries for (int i=0; i< scene->numberOfEntries(); ++i) { - if ( qobject_cast(scene->item(i)) - || qobject_cast(scene->item(i)) ) + if ( qobject_cast(scene->item(i)) ) return true; } return false; @@ -1139,59 +1065,30 @@ public Q_SLOTS: } void deleteTrees(CGAL::Three::Scene_item* sender) { - Scene_polyhedron_item* item = qobject_cast(sender); - if(item) + Scene_surface_mesh_item* sm_item = qobject_cast(sender); + if(!sm_item) + return; + if(facet_sm_trees.keys().contains(sm_item)) { - if(facet_trees.keys().contains(item)) - { - delete facet_trees[item]; - facet_trees.remove(item); - } - if(edge_trees.keys().contains(item)) - { - delete edge_trees[item]; - edge_trees.remove(item); - } - if(facet_trees.empty()) - { - if(plane_item) - scene->erase(scene->item_id(plane_item)); - if(edges_item) - scene->erase(scene->item_id(edges_item)); - } - else - { - ready_to_cut = true; - cut(); - } + delete facet_sm_trees[sm_item]; + facet_sm_trees.remove(sm_item); + } + if(edge_sm_trees.keys().contains(sm_item)) + { + delete edge_sm_trees[sm_item]; + edge_sm_trees.remove(sm_item); + } + if(facet_sm_trees.empty()) + { + if(plane_item) + scene->erase(scene->item_id(plane_item)); + if(edges_item) + scene->erase(scene->item_id(edges_item)); } else { - Scene_surface_mesh_item* sm_item = qobject_cast(sender); - if(!sm_item) - return; - if(facet_sm_trees.keys().contains(sm_item)) - { - delete facet_sm_trees[sm_item]; - facet_sm_trees.remove(sm_item); - } - if(edge_sm_trees.keys().contains(sm_item)) - { - delete edge_sm_trees[sm_item]; - edge_sm_trees.remove(sm_item); - } - if(facet_sm_trees.empty()) - { - if(plane_item) - scene->erase(scene->item_id(plane_item)); - if(edges_item) - scene->erase(scene->item_id(edges_item)); - } - else - { - ready_to_cut = true; - cut(); - } + ready_to_cut = true; + cut(); } } void updateTrees(int id); @@ -1208,8 +1105,6 @@ private: QAction* actionUnsignedEdges; bool ready_to_cut; - Facet_trees facet_trees; - Edge_trees edge_trees; Facet_sm_trees facet_sm_trees; Edge_sm_trees edge_sm_trees; @@ -1220,11 +1115,11 @@ private: Polyhedron_demo_cut_plugin::~Polyhedron_demo_cut_plugin() { - Q_FOREACH(Facet_tree *tree, facet_trees.values()) + Q_FOREACH(Facet_sm_tree *tree, facet_sm_trees.values()) { delete tree; } - Q_FOREACH(Edge_tree *tree, edge_trees.values()) + Q_FOREACH(Edge_sm_tree *tree, edge_sm_trees.values()) { delete tree; } @@ -1288,8 +1183,7 @@ QList Polyhedron_demo_cut_plugin::actions() const { void Polyhedron_demo_cut_plugin::updateTrees(int id) { if(plane_item && - (qobject_cast(scene->item(id)) - || qobject_cast(scene->item(id)))) + qobject_cast(scene->item(id))) createCutPlane(); } @@ -1379,13 +1273,10 @@ void Polyhedron_demo_cut_plugin::createCutPlane() { } else scene->addItem(plane_item); - // Hide polyhedrons and call cut() (avoid that nothing shows up until user + // Hide surface_meshes and call cut() (avoid that nothing shows up until user // decides to move the plane item) for(int i = 0, end = scene->numberOfEntries(); i < end; ++i) { CGAL::Three::Scene_item* item = scene->item(i); - Scene_polyhedron_item* poly_item = qobject_cast(item); - if ( NULL != poly_item ) - poly_item->setVisible(false); Scene_surface_mesh_item* sm_item = qobject_cast(item); if ( NULL != sm_item ) @@ -1394,22 +1285,13 @@ void Polyhedron_demo_cut_plugin::createCutPlane() { //fills the tree maps for(int i = 0, end = scene->numberOfEntries(); i < end; ++i) { CGAL::Three::Scene_item* item = scene->item(i); - Scene_polyhedron_item* poly_item = qobject_cast(item); Scene_surface_mesh_item* sm_item = qobject_cast(item); - if(!poly_item) + if(sm_item) { - if(sm_item) - { - apply(sm_item,facet_sm_trees, edge_sm_trees); - } + apply(sm_item,facet_sm_trees, edge_sm_trees); } - else - apply(poly_item, facet_trees, edge_trees); } - plane_item->set_facet_trees(&facet_trees); - plane_item->set_edge_trees(&edge_trees); - plane_item->set_facet_sm_trees(&facet_sm_trees); plane_item->set_edge_sm_trees(&edge_sm_trees); @@ -1491,24 +1373,6 @@ void Polyhedron_demo_cut_plugin::computeIntersection() QTime time; time.start(); bool does_intersect = false; - for(Facet_trees::iterator it = facet_trees.begin(); it != facet_trees.end(); ++it) - { - if(!CGAL::do_intersect(plane, it.value()->bbox())) - continue; - does_intersect = true; - std::vector intersections; - it.value()->all_intersections(plane, std::back_inserter(intersections)); - - for ( std::vector::iterator it = intersections.begin(), - end = intersections.end() ; it != end ; ++it ) - { - const Simple_kernel::Segment_3* inter_seg = - CGAL::object_cast(&(it->first)); - - if ( NULL != inter_seg ) - edges_item->edges.push_back(*inter_seg); - } - } for(Facet_sm_trees::iterator it = facet_sm_trees.begin(); it != facet_sm_trees.end(); ++it) { if(!CGAL::do_intersect(plane, it.value()->bbox())) diff --git a/Polyhedron/demo/Polyhedron/Plugins/AABB_tree/Do_trees_intersect_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/AABB_tree/Do_trees_intersect_plugin.cpp new file mode 100644 index 00000000000..91cef460b95 --- /dev/null +++ b/Polyhedron/demo/Polyhedron/Plugins/AABB_tree/Do_trees_intersect_plugin.cpp @@ -0,0 +1,348 @@ +#include +#include +#include +#include +#include +#include +#include +#include "Messages_interface.h" +#include +#include "Scene_surface_mesh_item.h" +#include "Scene_movable_sm_item.h" +#include +#include +#include +#include +#include +#include "Scene.h" + +class DoTreesIntersectplugin: + public QObject, + public CGAL::Three::Polyhedron_demo_plugin_interface +{ + Q_OBJECT + Q_INTERFACES(CGAL::Three::Polyhedron_demo_plugin_interface) + Q_PLUGIN_METADATA(IID "com.geometryfactory.PolyhedronDemo.PluginInterface/1.0") +public: + + bool eventFilter(QObject *, QEvent *event) Q_DECL_OVERRIDE + { + if(event->type() != QEvent::KeyPress) + return false; + QKeyEvent * e = static_cast(event); + if (e->key()==Qt::Key_W){ + do_transparency = !do_transparency; + change_display(); + return true; + } + return false; + } + + bool applicable(QAction*) const Q_DECL_OVERRIDE + { + if(scene->selectionIndices().size() <2) + return false; + Q_FOREACH(Scene::Item_id i, scene->selectionIndices()) + { + if(! qobject_cast(scene->item(i))) + return false; + } + return (! group_item); + } + + QList actions() const Q_DECL_OVERRIDE + { + return _actions; + } + + + void init(QMainWindow* mw, CGAL::Three::Scene_interface* sc, Messages_interface* mi) Q_DECL_OVERRIDE + { + this->messageInterface = mi; + this->scene = sc; + this->mw = mw; + QAction *actionCreateTrees= new QAction(QString("Collision Detection"), mw); + actionCreateTrees->setProperty("subMenuName", "Polygon Mesh Processing"); + actionCreateTrees->setProperty("submenuName", "AABB_tree"); + if(actionCreateTrees) { + connect(actionCreateTrees, SIGNAL(triggered()), + this, SLOT(start())); + _actions << actionCreateTrees; + } + do_transparency = false; + group_item = nullptr; + } +private Q_SLOTS: + void start() + { + QApplication::setOverrideCursor(Qt::WaitCursor); + Q_FOREACH(Scene::Item_id i, scene->selectionIndices()) + { + Scene_surface_mesh_item* item=qobject_cast(scene->item(i)); + if (!CGAL::is_triangle_mesh(*item->face_graph())) + { + QApplication::restoreOverrideCursor(); + QMessageBox::warning(mw, "Error", QString("%1 is not pure triangle. Aborting.").arg(item->name())); + return; + } + } + group_item = new Scene_group_item("Test Items"); + connect(group_item, &Scene_group_item::aboutToBeDestroyed, + this, [this](){ + items.clear(); + if(col_det) + delete col_det; + col_det = nullptr; + group_item = nullptr;}); + group_item->setScene(scene); + + scene->addItem(group_item); + Q_FOREACH(Scene::Item_id i, scene->selectionIndices()) + { + Scene_surface_mesh_item* item=qobject_cast(scene->item(i)); + connect(item, &Scene_surface_mesh_item::aboutToBeDestroyed, + this, &DoTreesIntersectplugin::cleanup); + + CGAL::qglviewer::Vec pos((item->bbox().min(0) + item->bbox().max(0))/2.0, + (item->bbox().min(1) + item->bbox().max(1))/2.0, + (item->bbox().min(2) + item->bbox().max(2))/2.0); + + Scene_movable_sm_item* mov_item = new Scene_movable_sm_item(pos,item->face_graph(),""); + connect(mov_item->manipulatedFrame(), &CGAL::qglviewer::ManipulatedFrame::modified, + this, &DoTreesIntersectplugin::update_trees); + mov_item->setName(item->name()); + if(do_transparency) + { + mov_item->setRenderingMode(Flat); + mov_item->setAlpha(120); + } + else + { + mov_item->setRenderingMode(Wireframe); + } + item->setVisible(false); + items.push_back(mov_item); + scene->addItem(mov_item); + scene->changeGroup(mov_item, group_item); + group_item->lockChild(mov_item); + mov_item->redraw(); + } + scene->setSelectedItem(group_item->getChildren().last()); + connect(static_cast(scene), &Scene::itemIndexSelected, + this, &DoTreesIntersectplugin::update_trees); + col_det = new CGAL::Rigid_triangle_mesh_collision_detection(); + col_det->reserve(items.size()); + Q_FOREACH(Scene_movable_sm_item* item, items) + { + col_det->add_mesh(*item->getFaceGraph()); + } + init_trees(); + static_cast( + CGAL::QGLViewer::QGLViewerPool().first())->installEventFilter(this); + QApplication::restoreOverrideCursor(); + messageInterface->information("Press `W` to switch between Wireframe and Transparency mode."); + } + +public Q_SLOTS: + void init_trees() + { + if(items.empty()) + return; + Q_FOREACH(Scene_movable_sm_item* item, items) + item->setColor(QColor(Qt::green)); + + CGAL::Three::Viewer_interface* viewer = static_cast( + CGAL::QGLViewer::QGLViewerPool().first()); + Scene_movable_sm_item* sel_item = qobject_cast(scene->item(scene->mainSelectionIndex())); + if(!sel_item) + return; + + std::size_t mesh_id = 0; + std::size_t sel_id = 0; + Q_FOREACH(Scene_movable_sm_item* item, items) + { + if(item == sel_item) + { + sel_id = mesh_id; + break; + } + ++mesh_id; + } + mesh_id = 0; + Q_FOREACH(Scene_movable_sm_item* item, items) + { + if(mesh_id == sel_id) + { + ++mesh_id; + item->setColor(QColor(255,184,61)); + prev_ids.push_back(sel_id); + continue; + } + const double* matrix = item->manipulatedFrame()->matrix(); + item->setFMatrix(matrix); + EPICK::Aff_transformation_3 translation(CGAL::TRANSLATION, -EPICK::Vector_3(item->center().x, + item->center().y, + item->center().z)); + EPICK::Aff_transformation_3 rota( + matrix[0], matrix[4], matrix[8],matrix[12], + matrix[1], matrix[5], matrix[9],matrix[13], + matrix[2], matrix[6], matrix[10],matrix[14]); + EPICK::Aff_transformation_3 transfo = + rota*translation; + + col_det->set_transformation(mesh_id++, transfo); + + if(do_transparency) + { + item->setRenderingMode(Flat); + item->setAlpha(120); + } + else + { + item->setRenderingMode(Wireframe); + } + item->itemChanged(); + } + const double* matrix = sel_item->manipulatedFrame()->matrix(); + sel_item->setFMatrix(matrix); + EPICK::Aff_transformation_3 translation(CGAL::TRANSLATION, -EPICK::Vector_3(sel_item->center().x, + sel_item->center().y, + sel_item->center().z)); + EPICK::Aff_transformation_3 rota( + matrix[0], matrix[4], matrix[8],matrix[12], + matrix[1], matrix[5], matrix[9],matrix[13], + matrix[2], matrix[6], matrix[10],matrix[14]); + EPICK::Aff_transformation_3 transfo = + rota*translation; + col_det->set_transformation(sel_id, transfo); + std::vector > inter_and_incl + = col_det->get_all_intersections_and_inclusions(sel_id); + for(std::size_t i=0; isetColor(QColor(Qt::blue)); + else + items[id]->setColor(QColor(Qt::red)); + prev_ids.push_back(id); + } + if(do_transparency) + { + sel_item->setRenderingMode(Flat); + sel_item->setAlpha(120); + } + else + { + sel_item->setRenderingMode(Wireframe); + } + sel_item->itemChanged(); + viewer->update(); + } + + void update_trees() + { + if(items.empty()) + return; + CGAL::Three::Viewer_interface* viewer = static_cast( + CGAL::QGLViewer::QGLViewerPool().first()); + Scene_movable_sm_item* sel_item = qobject_cast(scene->item(scene->mainSelectionIndex())); + if(!sel_item) + return; + + std::size_t mesh_id = 0; + std::size_t sel_id = 0; + Q_FOREACH(Scene_movable_sm_item* item, items) + { + if(item == sel_item) + { + sel_id = mesh_id; + ++mesh_id; + item->setColor(QColor(255,184,61)); + break; + } + ++mesh_id; + } + for(std::size_t i = 0; i< prev_ids.size(); ++i) + { + std::size_t id = prev_ids[i]; + if(id == sel_id) + { + continue; + } + Scene_movable_sm_item* item = items[id]; + item->setColor(QColor(Qt::green)); + item->itemChanged(); + } + prev_ids.clear(); + const double* matrix = sel_item->manipulatedFrame()->matrix(); + sel_item->setFMatrix(matrix); + + EPICK::Aff_transformation_3 translation(CGAL::TRANSLATION, -EPICK::Vector_3(sel_item->center().x, + sel_item->center().y, + sel_item->center().z)); + EPICK::Aff_transformation_3 rota( + matrix[0], matrix[4], matrix[8],matrix[12], + matrix[1], matrix[5], matrix[9],matrix[13], + matrix[2], matrix[6], matrix[10],matrix[14]); + EPICK::Aff_transformation_3 transfo = + rota*translation; + col_det->set_transformation(sel_id, transfo); + std::vector > inter_and_incl + = col_det->get_all_intersections_and_inclusions(sel_id); + for(std::size_t i=0; isetColor(QColor(Qt::blue)); + else + items[id]->setColor(QColor(Qt::red)); + prev_ids.push_back(id); + } + prev_ids.push_back(sel_id); + sel_item->itemChanged(); + viewer->update(); + } + + void cleanup() + { + if(!group_item) + return; + scene->erase(scene->item_id(group_item)); + group_item = nullptr; + items.clear(); + prev_ids.clear(); + delete col_det; + col_det = nullptr; + } + + //switch transparent/wireframe. + void change_display() + { + for(Scene_movable_sm_item* item : items) + { + if(do_transparency) + { + item->setRenderingMode(Flat); + item->setAlpha(120); + } + else + { + item->setRenderingMode(Wireframe); + } + } + } + +private: + QList _actions; + Messages_interface* messageInterface; + CGAL::Three::Scene_interface* scene; + QMainWindow* mw; + CGAL::Rigid_triangle_mesh_collision_detection *col_det; + std::vector items; + std::vector prev_ids; + Scene_group_item* group_item; + bool do_transparency; +}; +#include "Do_trees_intersect_plugin.moc" diff --git a/Polyhedron/demo/Polyhedron/Plugins/AABB_tree/Scene_movable_sm_item.cpp b/Polyhedron/demo/Polyhedron/Plugins/AABB_tree/Scene_movable_sm_item.cpp new file mode 100644 index 00000000000..794f09f8304 --- /dev/null +++ b/Polyhedron/demo/Polyhedron/Plugins/AABB_tree/Scene_movable_sm_item.cpp @@ -0,0 +1,215 @@ +#include +#include "Scene_movable_sm_item.h" +#include +#include +#include +#include +#include +typedef CGAL::Three::Triangle_container Tri; +typedef CGAL::Three::Viewer_interface VI; +struct Scene_movable_sm_item_priv +{ + Scene_movable_sm_item_priv(const CGAL::qglviewer::Vec& pos,SMesh* sm, + const QString name, Scene_movable_sm_item *parent) + : frame(new CGAL::Three::Scene_item::ManipulatedFrame()), + facegraph(sm), + center_(pos), + item_name(name) + { + item = parent; + const CGAL::qglviewer::Vec offset = static_cast(CGAL::QGLViewer::QGLViewerPool().first())->offset(); + frame->setPosition(pos+offset); + item->setTriangleContainer(0, new Triangle_container(VI::PROGRAM_WITH_LIGHT, + false)); + item->setEdgeContainer(0, new Edge_container(VI::PROGRAM_NO_SELECTION, + false)); + } + ~Scene_movable_sm_item_priv() + { + delete frame; + } + void initialize_buffers(Viewer_interface *viewer) const; + void compute_elements() const; + enum VAOs { + Edges=0, + NbOfVaos + }; + enum VBOs { + Vertices = 0, + NbOfVbos + }; + + CGAL::qglviewer::ManipulatedFrame* frame; + SMesh* facegraph; + CGAL::qglviewer::Vec center_; + Scene_movable_sm_item *item; + QMatrix4x4 f_matrix; + const QString item_name; + + mutable QOpenGLShaderProgram *program; + mutable std::vector flat_normals; + mutable std::vector flat_vertices; + mutable std::vector edges_vertices; + +}; + +Scene_movable_sm_item::Scene_movable_sm_item(const CGAL::qglviewer::Vec& pos, SMesh* sm, + const QString name) +{ + d = new Scene_movable_sm_item_priv(pos,sm, name, this); +} + + +void Scene_movable_sm_item_priv::initialize_buffers(CGAL::Three::Viewer_interface *viewer = nullptr) const +{ + item->getTriangleContainer(0)->initializeBuffers(viewer); + item->getTriangleContainer(0)->setFlatDataSize(flat_vertices.size()); + item->getEdgeContainer(0)->initializeBuffers(viewer); + item->getEdgeContainer(0)->setFlatDataSize(edges_vertices.size()); + flat_vertices.resize(0); + flat_normals .resize(0); + edges_vertices.resize(0); + flat_vertices.shrink_to_fit(); + flat_normals.shrink_to_fit(); + edges_vertices.shrink_to_fit(); + + item->are_buffers_filled = true; +} + + +void Scene_movable_sm_item_priv::compute_elements() const +{ + typedef EPICK::Point_3 Point; + QApplication::setOverrideCursor(Qt::WaitCursor); + + SMesh::Property_map fnormals = + facegraph->add_property_map("f:normal").first; + CGAL::Polygon_mesh_processing::compute_face_normals(*facegraph,fnormals); + const CGAL::qglviewer::Vec o = static_cast(CGAL::QGLViewer::QGLViewerPool().first())->offset(); + EPICK::Vector_3 offset(o.x, o.y, o.z); + SMesh::Property_map positions = + facegraph->points(); + typedef boost::graph_traits::face_descriptor face_descriptor; + typedef boost::graph_traits::halfedge_descriptor halfedge_descriptor; + typedef boost::graph_traits::edge_descriptor edge_descriptor; + typedef CGAL::Buffer_for_vao CPF; + flat_vertices.clear(); + flat_normals.clear(); + edges_vertices.clear(); + //faces + BOOST_FOREACH(face_descriptor fd, faces(*facegraph)) + { + BOOST_FOREACH(halfedge_descriptor hd, halfedges_around_face(halfedge(fd, *facegraph),*facegraph)) + { + Point p = positions[source(hd, *facegraph)] + offset; + EPICK::Point_3 pc(p.x() - center_.x, + p.y() - center_.y, + p.z() - center_.z); + CPF::add_point_in_buffer(pc, flat_vertices); + EPICK::Vector_3 n = fnormals[fd]; + CPF::add_normal_in_buffer(n, flat_normals); + } + } + //edges + BOOST_FOREACH(edge_descriptor ed, edges(*facegraph)) + { + Point p = positions[source(ed, *facegraph)] + offset; + EPICK::Point_3 pc(p.x() - center_.x, + p.y() - center_.y, + p.z() - center_.z); + CPF::add_point_in_buffer(pc, edges_vertices); + p = positions[target(ed, *facegraph)] + offset; + pc=EPICK::Point_3(p.x() - center_.x, + p.y() - center_.y, + p.z() - center_.z); + CPF::add_point_in_buffer(pc, edges_vertices); + } + + + + item->getTriangleContainer(0)->allocate(Tri::Flat_vertices, flat_vertices.data(), + static_cast(flat_vertices.size()*sizeof(float))); + item->getTriangleContainer(0)->allocate(Tri::Flat_normals, flat_normals.data(), + static_cast(flat_normals.size()*sizeof(float))); + item->getEdgeContainer(0)->allocate(Tri::Flat_vertices, edges_vertices.data(), + static_cast(edges_vertices.size()*sizeof(float))); + QApplication::restoreOverrideCursor(); +} + +void Scene_movable_sm_item::computeElements() const +{ + d->compute_elements(); + compute_bbox(); +} +void Scene_movable_sm_item::draw(CGAL::Three::Viewer_interface* viewer) const +{ + if(!isInit() && viewer->context()->isValid()) + initGL(); + if(!are_buffers_filled) + d->initialize_buffers(viewer); + getTriangleContainer(0)->setColor(color()); + getTriangleContainer(0)->setAlpha(alpha()); + getTriangleContainer(0)->setFrameMatrix(d->f_matrix); + + getTriangleContainer(0)->draw(viewer, true); +} + +void Scene_movable_sm_item::drawEdges(CGAL::Three::Viewer_interface* viewer) const +{ + if(!isInit() && viewer->context()->isValid()) + initGL(); + if(!are_buffers_filled) + d->initialize_buffers(viewer); + getEdgeContainer(0)->setColor(color()); + getEdgeContainer(0)->setFrameMatrix(d->f_matrix); + + getEdgeContainer(0)->draw(viewer, true); +} + +QString Scene_movable_sm_item::toolTip() const { + return QObject::tr("

    Manipulatable representation of %1

    " + "

    Keep Ctrl pressed and use the arcball to define an affine transformation.
    ") + .arg(d->item_name); +} + +void +Scene_movable_sm_item::compute_bbox() const { + SMesh::Property_map pprop = d->facegraph->points(); + CGAL::Bbox_3 bbox ; + + BOOST_FOREACH(vertex_descriptor vd,vertices(*d->facegraph)) + { + bbox = bbox + pprop[vd].bbox(); + } + _bbox = Bbox(bbox.xmin(),bbox.ymin(),bbox.zmin(), + bbox.xmax(),bbox.ymax(),bbox.zmax()); + is_bbox_computed = true; +} + +Scene_item::Bbox Scene_movable_sm_item::bbox() const { + if(!is_bbox_computed) + compute_bbox(); + is_bbox_computed = true; + return _bbox; +} + + +void Scene_movable_sm_item::invalidateOpenGLBuffers() +{ + d->compute_elements(); + is_bbox_computed = false; + are_buffers_filled = false; +} +CGAL::Three::Scene_item::ManipulatedFrame* Scene_movable_sm_item::manipulatedFrame() { return d->frame; } +const CGAL::qglviewer::Vec& Scene_movable_sm_item::center() const { return d->center_; } +Scene_movable_sm_item::~Scene_movable_sm_item() { delete d; Q_EMIT killed(); } +void Scene_movable_sm_item::setFMatrix(const GLdouble matrix[]) +{ + for (int i=0; i<16; ++i) + d->f_matrix.data()[i] = (float)matrix[i]; +} + +SMesh *Scene_movable_sm_item::getFaceGraph() +{ + return d->facegraph; +} diff --git a/Polyhedron/demo/Polyhedron/Plugins/AABB_tree/Scene_movable_sm_item.h b/Polyhedron/demo/Polyhedron/Plugins/AABB_tree/Scene_movable_sm_item.h new file mode 100644 index 00000000000..1d89eaa5a46 --- /dev/null +++ b/Polyhedron/demo/Polyhedron/Plugins/AABB_tree/Scene_movable_sm_item.h @@ -0,0 +1,60 @@ +#ifndef Scene_movable_sm_item_H +#define Scene_movable_sm_item_H + +#include "SMesh_type.h" + +#include +#include +#include +#include +#include +#include +#include + +#include + + +#if defined( scene_movable_sm_item_EXPORTS) +# define SCENE_MOVABLE_SM_ITEM_EXPORT Q_DECL_EXPORT +#else +# define SCENE_MOVABLE_SM_ITEM_EXPORT Q_DECL_IMPORT +#endif + +using namespace CGAL::Three; +struct Scene_movable_sm_item_priv; +// This class represents a polyhedron in the OpenGL scene +class SCENE_MOVABLE_SM_ITEM_EXPORT Scene_movable_sm_item + : public CGAL::Three::Scene_item_rendering_helper +{ + Q_OBJECT + +public: + Scene_movable_sm_item(const CGAL::qglviewer::Vec& pos, SMesh *sm, + const QString name); + Scene_item* clone() const{return nullptr;} + QString toolTip() const; + void draw(CGAL::Three::Viewer_interface *) const; + void drawEdges(CGAL::Three::Viewer_interface *) const; + void compute_bbox() const; + Scene_item::Bbox bbox() const ; + ~Scene_movable_sm_item(); + bool manipulatable() const { return true;} + ManipulatedFrame* manipulatedFrame(); + const CGAL::qglviewer::Vec& center() const; + virtual bool supportsRenderingMode(RenderingMode m) const { return m==Flat + || m==Wireframe; } + virtual void invalidateOpenGLBuffers(); + void setFMatrix(const GLdouble matrix[16]); + void computeElements() const; + bool isEmpty() const {return false;} + SMesh *getFaceGraph(); +protected: + friend struct Scene_movable_sm_item_priv; + Scene_movable_sm_item_priv* d; + +Q_SIGNALS: + void stop(); + void killed(); +}; // end class Scene_movable_sm_item + +#endif // Scene_movable_sm_item_H diff --git a/Polyhedron/demo/Polyhedron/Plugins/Classification/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/Classification/CMakeLists.txt index 864e77be256..48ce9e655d1 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Classification/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/Classification/CMakeLists.txt @@ -39,7 +39,7 @@ if(EIGEN3_FOUND) endif() target_link_libraries(classification_plugin PUBLIC scene_points_with_normal_item - scene_polylines_item scene_polygon_soup_item scene_surface_mesh_item scene_surface_mesh_selection_item scene_color_ramp ${classification_linked_libraries}) + scene_polylines_item scene_polygon_soup_item scene_surface_mesh_item scene_selection_item scene_color_ramp ${classification_linked_libraries}) target_compile_definitions(classification_plugin PUBLIC ${classification_compile_definitions}) else() message(STATUS "NOTICE: Boost Serialization or IO Streams or ZLIB not found. Classification plugin won't be available.") diff --git a/Polyhedron/demo/Polyhedron/Plugins/Classification/Cluster_classification.cpp b/Polyhedron/demo/Polyhedron/Plugins/Classification/Cluster_classification.cpp index 659e4a6c671..d8e20fd778f 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Classification/Cluster_classification.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Classification/Cluster_classification.cpp @@ -541,8 +541,13 @@ void Cluster_classification::compute_features (std::size_t nb_scales) std::cerr << "Computing pointwise features with " << nb_scales << " scale(s)" << std::endl; m_features.clear(); + Point_set::Vector_map normal_map; bool normals = m_points->point_set()->has_normal_map(); + if (normals) + normal_map = m_points->point_set()->normal_map(); + bool colors = (m_color != Point_set::Property_map()); + Point_set::Property_map echo_map; bool echo; boost::tie (echo_map, echo) = m_points->point_set()->template property_map("echo"); @@ -562,18 +567,18 @@ void Cluster_classification::compute_features (std::size_t nb_scales) generator.generate_point_based_features(pointwise_features); if (normals) - generator.generate_normal_based_features (pointwise_features, m_points->point_set()->normal_map()); + generator.generate_normal_based_features (pointwise_features, normal_map); if (colors) generator.generate_color_based_features (pointwise_features, m_color); if (echo) generator.generate_echo_based_features (pointwise_features, echo_map); - add_remaining_point_set_properties_as_features(pointwise_features); - #ifdef CGAL_LINKED_WITH_TBB pointwise_features.end_parallel_additions(); #endif + add_remaining_point_set_properties_as_features(pointwise_features); + t.stop(); std::cerr << pointwise_features.size() << " feature(s) computed in " << t.time() << " second(s)" << std::endl; t.reset(); diff --git a/Polyhedron/demo/Polyhedron/Plugins/Classification/Cluster_classification.h b/Polyhedron/demo/Polyhedron/Plugins/Classification/Cluster_classification.h index 85af4bd84b5..190692f07c4 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Classification/Cluster_classification.h +++ b/Polyhedron/demo/Polyhedron/Plugins/Classification/Cluster_classification.h @@ -8,7 +8,6 @@ #include "Scene_points_with_normal_item.h" #include "Item_classification_base.h" -#include "Polyhedron_type_fwd.h" #include "Kernel_type.h" #include "Point_set_3.h" diff --git a/Polyhedron/demo/Polyhedron/Plugins/Classification/Point_set_item_classification.cpp b/Polyhedron/demo/Polyhedron/Plugins/Classification/Point_set_item_classification.cpp index 1fc97d53d65..1096fe5d067 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Classification/Point_set_item_classification.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Classification/Point_set_item_classification.cpp @@ -442,8 +442,13 @@ void Point_set_item_classification::compute_features (std::size_t nb_scales) std::cerr << "Computing features with " << nb_scales << " scale(s)" << std::endl; m_features.clear(); + Point_set::Vector_map normal_map; bool normals = m_points->point_set()->has_normal_map(); + if (normals) + normal_map = m_points->point_set()->normal_map(); + bool colors = (m_color != Point_set::Property_map()); + Point_set::Property_map echo_map; bool echo; boost::tie (echo_map, echo) = m_points->point_set()->template property_map("echo"); @@ -461,18 +466,18 @@ void Point_set_item_classification::compute_features (std::size_t nb_scales) m_generator->generate_point_based_features(m_features); if (normals) - m_generator->generate_normal_based_features (m_features, m_points->point_set()->normal_map()); + m_generator->generate_normal_based_features (m_features, normal_map); if (colors) m_generator->generate_color_based_features (m_features, m_color); if (echo) m_generator->generate_echo_based_features (m_features, echo_map); - add_remaining_point_set_properties_as_features(); - #ifdef CGAL_LINKED_WITH_TBB m_features.end_parallel_additions(); #endif + add_remaining_point_set_properties_as_features(); + delete m_sowf; m_sowf = new Sum_of_weighted_features (m_labels, m_features); delete m_ethz; diff --git a/Polyhedron/demo/Polyhedron/Plugins/Classification/Point_set_item_classification.h b/Polyhedron/demo/Polyhedron/Plugins/Classification/Point_set_item_classification.h index d9b18212282..7390bd3a8e3 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Classification/Point_set_item_classification.h +++ b/Polyhedron/demo/Polyhedron/Plugins/Classification/Point_set_item_classification.h @@ -8,7 +8,6 @@ #include "Scene_points_with_normal_item.h" #include "Item_classification_base.h" -#include "Polyhedron_type_fwd.h" #include "Kernel_type.h" #include "Point_set_3.h" diff --git a/Polyhedron/demo/Polyhedron/Plugins/Convex_decomposition/Nef_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Convex_decomposition/Nef_plugin.cpp index ed9d0dff936..2d932bed12c 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Convex_decomposition/Nef_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Convex_decomposition/Nef_plugin.cpp @@ -1,4 +1,3 @@ -#include "Scene_polyhedron_item.h" #include "Scene_surface_mesh_item.h" #include "Scene_nef_polyhedron_item.h" @@ -66,8 +65,7 @@ bool applicable(QAction* action) const { const int indexB = scene->selectionBindex(); if( action == actionToNef) - return qobject_cast(scene->item(scene->mainSelectionIndex())) - || qobject_cast(scene->item(scene->mainSelectionIndex())); + return qobject_cast(scene->item(scene->mainSelectionIndex())); else if( action == actionToPoly) return qobject_cast(scene->item(scene->mainSelectionIndex())); @@ -109,11 +107,9 @@ Polyhedron_demo_nef_plugin::on_actionToNef_triggered() { const CGAL::Three::Scene_interface::Item_id index = scene->mainSelectionIndex(); - Scene_polyhedron_item* item = - qobject_cast(scene->item(index)); Scene_surface_mesh_item* sm_item = qobject_cast(scene->item(index)); - if(!item && !sm_item) + if(!sm_item) { return; } @@ -124,20 +120,10 @@ Polyhedron_demo_nef_plugin::on_actionToNef_triggered() std::cerr << "Convert facegraph to nef polyhedron..."; Scene_nef_polyhedron_item* new_nef_item; - if(item) - { - new_nef_item = Scene_nef_polyhedron_item::from_polygon_mesh(item); - new_nef_item->setName(tr("%1 (Nef_polyhedron_3)").arg(item->name())); - new_nef_item->setRenderingMode(item->renderingMode()); - item->setVisible(false); - } - else - { - new_nef_item = Scene_nef_polyhedron_item::from_polygon_mesh(sm_item); - new_nef_item->setName(tr("%1 (Nef_polyhedron_3)").arg(sm_item->name())); - new_nef_item->setRenderingMode(sm_item->renderingMode()); - sm_item->setVisible(false); - } + new_nef_item = Scene_nef_polyhedron_item::from_polygon_mesh(sm_item); + new_nef_item->setName(tr("%1 (Nef_polyhedron_3)").arg(sm_item->name())); + new_nef_item->setRenderingMode(sm_item->renderingMode()); + sm_item->setVisible(false); scene->itemChanged(index); new_nef_item->invalidateOpenGLBuffers(); scene->addItem(new_nef_item); @@ -152,11 +138,11 @@ Polyhedron_demo_nef_plugin::on_actionConvexDecomposition_triggered() QApplication::setOverrideCursor(Qt::WaitCursor); const CGAL::Three::Scene_interface::Item_id index = scene->mainSelectionIndex(); - Scene_polyhedron_item* pitem = - qobject_cast(scene->item(index)); + Scene_surface_mesh_item* smitem = + qobject_cast(scene->item(index)); Scene_nef_polyhedron_item* item = - (pitem)? Scene_nef_polyhedron_item::from_polygon_mesh(pitem) + (smitem)? Scene_nef_polyhedron_item::from_polygon_mesh(smitem) : qobject_cast(scene->item(index)); QApplication::restoreOverrideCursor(); if(item) { @@ -166,10 +152,10 @@ Polyhedron_demo_nef_plugin::on_actionConvexDecomposition_triggered() QApplication::setOverrideCursor(Qt::WaitCursor); - std::list convex_parts; + std::list convex_parts; item->convex_decomposition(convex_parts); int i = 0; - for(std::list::iterator it = convex_parts.begin(); + for(std::list::iterator it = convex_parts.begin(); it != convex_parts.end(); ++it){ (*it)->setName(tr("part %1 of %2").arg(i++).arg(item->name())); @@ -177,9 +163,9 @@ Polyhedron_demo_nef_plugin::on_actionConvexDecomposition_triggered() scene->addItem(*it); } - if(pitem){ + if(smitem){ delete item; - pitem->setVisible(false); + smitem->setVisible(false); } else { item->setVisible(false); } @@ -216,26 +202,14 @@ Polyhedron_demo_nef_plugin::on_actionToPoly_triggered() QApplication::restoreOverrideCursor(); return; } - if(this->mw->property("is_polyhedron_mode").toBool()) - { - Scene_polyhedron_item* new_item = item->convert_to_polyhedron(); - new_item->setName(tr("%1 (from nef)").arg(item->name())); - new_item->setRenderingMode(item->renderingMode()); - item->setVisible(false); - scene->itemChanged(index); - scene->addItem(new_item); - } - else - { Scene_surface_mesh_item* new_item = item->convert_to_surface_mesh(); new_item->setName(tr("%1 (from nef)").arg(item->name())); new_item->setRenderingMode(item->renderingMode()); item->setVisible(false); scene->itemChanged(index); scene->addItem(new_item); - } - std::cerr << "ok (" << time.elapsed() << " ms)" << std::endl; - QApplication::restoreOverrideCursor(); + std::cerr << "ok (" << time.elapsed() << " ms)" << std::endl; + QApplication::restoreOverrideCursor(); } } @@ -276,8 +250,8 @@ void Polyhedron_demo_nef_plugin::boolean_operation(const Boolean_operation opera if(indexA < 0 || indexB < 0) return; if(indexA == indexB) return; - if(qobject_cast(scene->item(indexA)) || - qobject_cast(scene->item(indexB))) { + if(qobject_cast(scene->item(indexA)) || + qobject_cast(scene->item(indexB))) { QMenu* menu = mw->findChild("menu_Boolean_operations"); if(!menu) qWarning("Do not find object named \"menu_Boolean_operations\"!"); QMessageBox::warning(mw, diff --git a/Polyhedron/demo/Polyhedron/Plugins/Convex_hull/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/Convex_hull/CMakeLists.txt index a0f11636ede..900441b871b 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Convex_hull/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/Convex_hull/CMakeLists.txt @@ -1,7 +1,7 @@ include( polyhedron_demo_macros ) polyhedron_demo_plugin(convex_hull_plugin Convex_hull_plugin) -target_link_libraries(convex_hull_plugin PUBLIC scene_polyhedron_item scene_points_with_normal_item scene_polylines_item scene_polyhedron_selection_item scene_surface_mesh_item) +target_link_libraries(convex_hull_plugin PUBLIC scene_points_with_normal_item scene_polylines_item scene_selection_item scene_surface_mesh_item) polyhedron_demo_plugin(kernel_plugin Kernel_plugin) -target_link_libraries(kernel_plugin PUBLIC scene_polyhedron_item scene_surface_mesh_item) +target_link_libraries(kernel_plugin PUBLIC scene_surface_mesh_item) diff --git a/Polyhedron/demo/Polyhedron/Plugins/Convex_hull/Convex_hull_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Convex_hull/Convex_hull_plugin.cpp index acce07a6755..860b88e4461 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Convex_hull/Convex_hull_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Convex_hull/Convex_hull_plugin.cpp @@ -3,14 +3,11 @@ #include #include #include - - -#include "Scene_polyhedron_item.h" #include "Scene_surface_mesh_item.h" #include "Scene_points_with_normal_item.h" #include "Scene_polylines_item.h" #include "Scene_polyhedron_selection_item.h" -#include "Polyhedron_type.h" +#include "SMesh_type.h" #include @@ -42,7 +39,6 @@ public: bool applicable(QAction*) const { return - qobject_cast(scene->item(scene->mainSelectionIndex())) || qobject_cast(scene->item(scene->mainSelectionIndex())) || qobject_cast(scene->item(scene->mainSelectionIndex())) || qobject_cast(scene->item(scene->mainSelectionIndex())) || @@ -57,21 +53,11 @@ private: QMainWindow* mw; }; // end Polyhedron_demo_convex_hull_plugin -// for transform iterator -struct Get_point { - typedef const Polyhedron::Point_3& result_type; - result_type operator()(const Polyhedron::Vertex_handle v) const - { return v->point(); } -}; void Polyhedron_demo_convex_hull_plugin::on_actionConvexHull_triggered() { const CGAL::Three::Scene_interface::Item_id index = scene->mainSelectionIndex(); - - Scene_polyhedron_item* poly_item = - qobject_cast(scene->item(index)); - - Scene_points_with_normal_item* pts_item = + Scene_points_with_normal_item* pts_item = qobject_cast(scene->item(index)); Scene_polylines_item* lines_item = @@ -83,7 +69,7 @@ void Polyhedron_demo_convex_hull_plugin::on_actionConvexHull_triggered() Scene_surface_mesh_item* sm_item = qobject_cast(scene->item(index)); - if(poly_item || pts_item || lines_item || selection_item || sm_item) + if( pts_item || lines_item || selection_item || sm_item) { // wait cursor QApplication::setOverrideCursor(Qt::WaitCursor); @@ -94,21 +80,20 @@ void Polyhedron_demo_convex_hull_plugin::on_actionConvexHull_triggered() // add convex hull as new polyhedron SMesh *pConvex_hull = new SMesh; + typedef boost::property_map::type Vpmap; + typedef CGAL::Property_map_to_unary_function Vpmap_fct; if(selection_item) { + SMesh* pMesh = selection_item->polyhedron(); + Vpmap vpm = get(CGAL::vertex_point,*pMesh); + + Vpmap_fct v2p(vpm); CGAL::convex_hull_3( - boost::make_transform_iterator(selection_item->selected_vertices.begin(), Get_point()), - boost::make_transform_iterator(selection_item->selected_vertices.end(), Get_point()), + boost::make_transform_iterator(selection_item->selected_vertices.begin(), v2p), + boost::make_transform_iterator(selection_item->selected_vertices.end(), v2p), *pConvex_hull); } - else if ( poly_item ){ - Polyhedron* pMesh = poly_item->polyhedron(); - CGAL::convex_hull_3(pMesh->points_begin(),pMesh->points_end(),*pConvex_hull); - } else if ( sm_item ){ SMesh* pMesh = sm_item->polyhedron(); - typedef boost::property_map::type Vpmap; - - typedef CGAL::Property_map_to_unary_function Vpmap_fct; Vpmap vpm = get(CGAL::vertex_point,*pMesh); Vpmap_fct v2p(vpm); @@ -143,23 +128,11 @@ void Polyhedron_demo_convex_hull_plugin::on_actionConvexHull_triggered() } std::cout << "ok (" << time.elapsed() << " ms)" << std::endl; - if(mw->property("is_polyhedron_mode").toBool()){ - Polyhedron *poly = new Polyhedron; - CGAL::copy_face_graph(*pConvex_hull,*poly); - delete pConvex_hull; - - Scene_polyhedron_item* new_item = new Scene_polyhedron_item(poly); - new_item->setName(tr("%1 (convex hull)").arg(scene->item(index)->name())); - new_item->setColor(Qt::magenta); - new_item->setRenderingMode(FlatPlusEdges); - scene->addItem(new_item); - } else { - Scene_surface_mesh_item* new_item = new Scene_surface_mesh_item(pConvex_hull); - new_item->setName(tr("%1 (convex hull)").arg(scene->item(index)->name())); - new_item->setColor(Qt::magenta); - new_item->setRenderingMode(FlatPlusEdges); - scene->addItem(new_item); - } + Scene_surface_mesh_item* new_item = new Scene_surface_mesh_item(pConvex_hull); + new_item->setName(tr("%1 (convex hull)").arg(scene->item(index)->name())); + new_item->setColor(Qt::magenta); + new_item->setRenderingMode(FlatPlusEdges); + scene->addItem(new_item); // default cursor QApplication::restoreOverrideCursor(); diff --git a/Polyhedron/demo/Polyhedron/Plugins/Convex_hull/Kernel_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Convex_hull/Kernel_plugin.cpp index 28383306d81..9caa7476684 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Convex_hull/Kernel_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Convex_hull/Kernel_plugin.cpp @@ -5,9 +5,8 @@ #include #include -#include "Scene_polyhedron_item.h" #include "Scene_surface_mesh_item.h" -#include "Polyhedron_type.h" +#include "SMesh_type.h" #include #include @@ -39,8 +38,7 @@ public: } bool applicable(QAction*) const { - return qobject_cast(scene->item(scene->mainSelectionIndex())) || - qobject_cast(scene->item(scene->mainSelectionIndex())); + return qobject_cast(scene->item(scene->mainSelectionIndex())); } void init(QMainWindow* mainWindow, CGAL::Three::Scene_interface* scene_interface, Messages_interface*) @@ -65,29 +63,22 @@ private: void Polyhedron_demo_kernel_plugin::on_actionKernel_triggered() { const CGAL::Three::Scene_interface::Item_id index = scene->mainSelectionIndex(); - - Scene_polyhedron_item* item = - qobject_cast(scene->item(index)); Scene_surface_mesh_item* sm_item = qobject_cast(scene->item(index)); - if(item || sm_item) + if(sm_item) { QApplication::setOverrideCursor(Qt::WaitCursor); - Polyhedron* pMesh = (item)?item->polyhedron():NULL; - SMesh* sMesh = (sm_item)?sm_item->polyhedron():NULL; + SMesh* sMesh = sm_item->polyhedron(); typedef CGAL::Exact_rational ET; typedef Polyhedron_kernel Polyhedron_kernel; // get triangles from polyhedron std::list triangles; - if(pMesh){ - get_triangles(*pMesh,std::back_inserter(triangles)); - } else { - get_triangles(*sMesh,std::back_inserter(triangles)); - } + get_triangles(*sMesh,std::back_inserter(triangles)); + // solve LP std::cout << "Solve linear program..." << triangles.size(); Polyhedron_kernel kernel; @@ -97,7 +88,7 @@ void Polyhedron_demo_kernel_plugin::on_actionKernel_triggered() std::cout << "done (empty kernel)" << std::endl; QMessageBox::information(mw, tr("Empty Kernel"), tr("The kernel of the polyhedron \"%1\" is empty."). - arg((item)?item->name():sm_item->name())); + arg(sm_item->name())); return; } std::cout << "done" << std::endl; @@ -130,72 +121,50 @@ void Polyhedron_demo_kernel_plugin::on_actionKernel_triggered() // compute convex hull in dual space std::cout << "convex hull in dual space..."; - Polyhedron convex_hull; + SMesh convex_hull; CGAL::convex_hull_3(dual_points.begin(),dual_points.end(),convex_hull); std::cout << "ok" << std::endl; - - if(pMesh){ - // add kernel as new polyhedron - Polyhedron *pKernel = new Polyhedron; - - // dualize and translate back to get final kernel - Dualizer dualizer; - dualizer.run(convex_hull,*pKernel); - ::translate(*pKernel,translate); - pKernel->inside_out(); - - Scene_polyhedron_item* new_item = new Scene_polyhedron_item(pKernel); - new_item->setName(tr("%1 (kernel)").arg(item->name())); - new_item->setColor(Qt::magenta); - new_item->setRenderingMode(item->renderingMode()); - item->setRenderingMode(Wireframe); - - scene->addItem(new_item); - scene->itemChanged(item); - } else { // sMesh - // add kernel as new polyhedron - typedef SMesh SMesh; - SMesh* pKernel = new SMesh; - - typedef CGAL::Dual Dual; - typedef boost::graph_traits::vertex_descriptor dual_vertex_descriptor; - - std::ofstream out("primal.off"); - out << convex_hull << std::endl; - out.close(); - Dual dual(convex_hull); - - std::map vpm; - BOOST_FOREACH(boost::graph_traits::face_descriptor fd, faces(convex_hull)){ - Point points[3]; - int i = 0; - BOOST_FOREACH(boost::graph_traits::vertex_descriptor vd, - vertices_around_face(halfedge(fd,convex_hull),convex_hull)){ - points[i++] = get(CGAL::vertex_point,convex_hull,vd); - } - Plane plane(points[0],points[1],points[2]); - FT sqd = CGAL::squared_distance(Point(CGAL::ORIGIN),plane); - FT distance_to_origin = std::sqrt(sqd); - Vector normal = plane.orthogonal_vector(); - normal = normal / std::sqrt(normal * normal); - vpm[fd] = CGAL::ORIGIN + normal / distance_to_origin + translate; - } - CGAL::copy_face_graph(dual, *pKernel, - CGAL::parameters::vertex_point_map( - boost::make_assoc_property_map(vpm))); - + // sMesh + // add kernel as new polyhedron + typedef SMesh SMesh; + SMesh* pKernel = new SMesh; - // pKernel->inside_out(); - - Scene_surface_mesh_item* new_item = new Scene_surface_mesh_item(pKernel); - new_item->setName(tr("%1 (kernel)").arg(sm_item->name())); - new_item->setColor(Qt::magenta); - new_item->setRenderingMode(sm_item->renderingMode()); - sm_item->setRenderingMode(Wireframe); - - scene->addItem(new_item); - scene->itemChanged(sm_item); + typedef CGAL::Dual Dual; + typedef boost::graph_traits::vertex_descriptor dual_vertex_descriptor; + + std::ofstream out("primal.off"); + out << convex_hull << std::endl; + out.close(); + Dual dual(convex_hull); + + std::map vpm; + BOOST_FOREACH(boost::graph_traits::face_descriptor fd, faces(convex_hull)){ + std::vector points(3, Point(CGAL::ORIGIN)); + int i = 0; + BOOST_FOREACH(boost::graph_traits::vertex_descriptor vd, + vertices_around_face(halfedge(fd,convex_hull),convex_hull)){ + points[i++] = get(CGAL::vertex_point,convex_hull,vd); + } + Plane plane(points[0],points[1],points[2]); + FT sqd = CGAL::squared_distance(Point(CGAL::ORIGIN),plane); + FT distance_to_origin = std::sqrt(sqd); + Vector normal = plane.orthogonal_vector(); + normal = normal / std::sqrt(normal * normal); + vpm[fd] = CGAL::ORIGIN + normal / distance_to_origin + translate; } + CGAL::copy_face_graph(dual, *pKernel, + CGAL::parameters::vertex_point_map( + boost::make_assoc_property_map(vpm))); + + Scene_surface_mesh_item* new_item = new Scene_surface_mesh_item(pKernel); + new_item->setName(tr("%1 (kernel)").arg(sm_item->name())); + new_item->setColor(Qt::magenta); + new_item->setRenderingMode(sm_item->renderingMode()); + sm_item->setRenderingMode(Wireframe); + + scene->addItem(new_item); + scene->itemChanged(sm_item); + QApplication::restoreOverrideCursor(); } } diff --git a/Polyhedron/demo/Polyhedron/Plugins/Display/Display_property.ui b/Polyhedron/demo/Polyhedron/Plugins/Display/Display_property.ui index e8d8a8ee521..5d3db16b4a0 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Display/Display_property.ui +++ b/Polyhedron/demo/Polyhedron/Plugins/Display/Display_property.ui @@ -6,28 +6,15 @@ 0 0 - 292 - 456 + 269 + 434 Property Displaying - - - - - Qt::Vertical - - - - 20 - 40 - - - - + @@ -55,6 +42,59 @@ + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Compute Ramp Extremas + + + Reset + + + false + + + + + + + + + + + + Ramp Colors + + + + + + Color Min... + + + + + + + Color Max... + + + @@ -81,13 +121,6 @@ - - - - - - - @@ -95,37 +128,14 @@ - - - - Ramp Colors + + + + - - - - - Color Min... - - - - - - - Color Max... - - - - - - - Replace Ramp - - - - Colorize @@ -137,7 +147,20 @@ - + + + + + Qt::Horizontal + + + + 40 + 20 + + + + @@ -154,6 +177,19 @@ + + + + Qt::Vertical + + + + 20 + 40 + + + + diff --git a/Polyhedron/demo/Polyhedron/Plugins/Display/Display_property_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Display/Display_property_plugin.cpp index 1760befbfea..93112e11f06 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Display/Display_property_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Display/Display_property_plugin.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include "Messages_interface.h" #include "Scene_surface_mesh_item.h" #include "Color_ramp.h" @@ -96,9 +97,6 @@ public: connect(dock_widget->colorizeButton, SIGNAL(clicked(bool)), this, SLOT(colorize())); - connect(dock_widget->rampButton, SIGNAL(clicked(bool)), - this, SLOT(replaceRamp())); - connect(dock_widget->propertyBox, SIGNAL(currentIndexChanged(int)), this, SLOT(on_propertyBox_currentIndexChanged(int))); connect(dock_widget->zoomToMinButton, &QPushButton::pressed, @@ -109,11 +107,15 @@ public: this, [this]() { QColor minColor = QColorDialog::getColor(); + if (!minColor.isValid()) + { + return; + } + rm = minColor.redF(); gm = minColor.greenF(); bm = minColor.blueF(); QPalette palette(minColor); - dock_widget->minColorButton->setAutoFillBackground(true); dock_widget->minColorButton->setPalette(palette); dock_widget->minColorButton->update(); }); @@ -121,15 +123,18 @@ public: this, [this]() { QColor maxColor = QColorDialog::getColor(); + if(!maxColor.isValid()) + return; QPalette palette(maxColor); rM = maxColor.redF(); gM = maxColor.greenF(); bM = maxColor.blueF(); - dock_widget->maxColorButton->setAutoFillBackground(true); dock_widget->maxColorButton->setPalette(palette); dock_widget->maxColorButton->update(); }); + connect(dock_widget->resetButton, &QPushButton::pressed, + this, &DisplayPropertyPlugin::resetRampExtremas); dock_widget->zoomToMaxButton->setEnabled(false); dock_widget->zoomToMinButton->setEnabled(false); Scene* scene_obj =static_cast(scene); @@ -142,9 +147,35 @@ private Q_SLOTS: void openDialog() { if(dock_widget->isVisible()) { dock_widget->hide(); } - else { replaceRamp(); dock_widget->show(); } + else{ + replaceRamp(); + dock_widget->show(); + dock_widget->raise(); } } + void resetRampExtremas() + { + Scene_surface_mesh_item* item = + qobject_cast(scene->item(scene->mainSelectionIndex())); + if(!item) + return; + QApplication::setOverrideCursor(Qt::WaitCursor); + item->face_graph()->collect_garbage(); + bool ok; + switch(dock_widget->propertyBox->currentIndex()) + { + case 0: + ok = resetAngles(item); + break; + default: + ok = resetScaledJacobian(item); + break; + } + QApplication::restoreOverrideCursor(); + if(!ok) + QMessageBox::warning(mw, "Error", "You must first run colorize once to initialize the values."); + } + void colorize() { Scene_surface_mesh_item* item = @@ -152,6 +183,7 @@ private Q_SLOTS: if(!item) return; QApplication::setOverrideCursor(Qt::WaitCursor); + replaceRamp(); item->face_graph()->collect_garbage(); switch(dock_widget->propertyBox->currentIndex()) { @@ -162,6 +194,19 @@ private Q_SLOTS: displayScaledJacobian(item); break; } + connect(item, &Scene_surface_mesh_item::itemChanged, + this, [item](){ + bool does_exist; + SMesh::Property_map pmap; + boost::tie(pmap, does_exist) = + item->face_graph()->property_map("f:jacobian"); + if(does_exist) + item->face_graph()->remove_property_map(pmap); + boost::tie(pmap, does_exist) = + item->face_graph()->property_map("f:angle"); + if(does_exist) + item->face_graph()->remove_property_map(pmap); + }); QApplication::restoreOverrideCursor(); item->invalidateOpenGLBuffers(); item->redraw(); @@ -275,10 +320,20 @@ private Q_SLOTS: 255*color_ramp.b(f)); fcolors[*fit] = color; } - dock_widget->minBox->setValue(jacobian_min[item].first-0.01); - dock_widget->maxBox->setValue(jacobian_max[item].first); } + bool resetScaledJacobian(Scene_surface_mesh_item* item) + { + SMesh& smesh = *item->face_graph(); + if(!smesh.property_map("f:jacobian").second) + { + return false; + } + dock_widget->minBox->setValue(jacobian_min[item].first-0.01); + dock_widget->maxBox->setValue(jacobian_max[item].first); + return true; + } + void displayAngles(Scene_surface_mesh_item* item) { SMesh& smesh = *item->face_graph(); @@ -404,10 +459,19 @@ private Q_SLOTS: 255*color_ramp.b(f)); fcolors[*fit] = color; } - dock_widget->minBox->setValue(angles_min[item].first); - dock_widget->maxBox->setValue(angles_max[item].first); } + bool resetAngles(Scene_surface_mesh_item* item) + { + SMesh& smesh = *item->face_graph(); + if(!smesh.property_map("f:angle").second) + { + return false; + } + dock_widget->minBox->setValue(angles_min[item].first); + dock_widget->maxBox->setValue(angles_max[item].first); + return true; + } void replaceRamp() { color_ramp = Color_ramp(rm, rM, gm, gM, bm, bM); diff --git a/Polyhedron/demo/Polyhedron/Plugins/IO/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/IO/CMakeLists.txt index d3c8a046946..45ecd036a1c 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/IO/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/IO/CMakeLists.txt @@ -1,7 +1,7 @@ include( polyhedron_demo_macros ) polyhedron_demo_plugin(gocad_plugin GOCAD_io_plugin) -target_link_libraries(gocad_plugin PUBLIC scene_polyhedron_item scene_surface_mesh_item) +target_link_libraries(gocad_plugin PUBLIC scene_surface_mesh_item) qt5_wrap_ui( funcUI_FILES Function_dialog.ui ) polyhedron_demo_plugin(io_implicit_function_plugin Implicit_function_io_plugin ${funcUI_FILES}) @@ -11,7 +11,7 @@ polyhedron_demo_plugin(nef_io_plugin Nef_io_plugin) target_link_libraries(nef_io_plugin PUBLIC scene_nef_polyhedron_item) polyhedron_demo_plugin(off_plugin OFF_io_plugin) -target_link_libraries(off_plugin PUBLIC scene_polyhedron_item scene_polygon_soup_item scene_points_with_normal_item) +target_link_libraries(off_plugin PUBLIC scene_polygon_soup_item scene_points_with_normal_item scene_surface_mesh_item) polyhedron_demo_plugin(off_to_nef_plugin OFF_to_nef_io_plugin) target_link_libraries(off_to_nef_plugin PUBLIC scene_nef_polyhedron_item) @@ -20,19 +20,14 @@ polyhedron_demo_plugin(polylines_io_plugin Polylines_io_plugin) target_link_libraries(polylines_io_plugin PUBLIC scene_polylines_item) polyhedron_demo_plugin(selection_io_plugin Selection_io_plugin) -target_link_libraries(selection_io_plugin PUBLIC scene_polyhedron_selection_item selection_plugin) - -polyhedron_demo_plugin(selection_io_sm_plugin Selection_io_plugin) -target_link_libraries(selection_io_sm_plugin PUBLIC scene_surface_mesh_selection_item selection_sm_plugin) +target_link_libraries(selection_io_plugin PUBLIC scene_selection_item selection_plugin) polyhedron_demo_plugin(stl_plugin STL_io_plugin) -target_link_libraries(stl_plugin PUBLIC scene_polyhedron_item scene_surface_mesh_item scene_polygon_soup_item) +target_link_libraries(stl_plugin PUBLIC scene_surface_mesh_item scene_polygon_soup_item) -polyhedron_demo_plugin(surface_mesh_io_plugin Surface_mesh_io_plugin) -target_link_libraries(surface_mesh_io_plugin PUBLIC scene_surface_mesh_item scene_polygon_soup_item) polyhedron_demo_plugin(surf_io_plugin Surf_io_plugin) -target_link_libraries(surf_io_plugin PUBLIC scene_polyhedron_item scene_surface_mesh_item) +target_link_libraries(surf_io_plugin PUBLIC scene_surface_mesh_item) @@ -43,16 +38,10 @@ if (VTK_FOUND) if ("${VTK_VERSION_MAJOR}" GREATER "5") if(VTK_LIBRARIES) polyhedron_demo_plugin(vtk_plugin VTK_io_plugin) - target_link_libraries(vtk_plugin PUBLIC scene_polyhedron_item scene_polylines_item scene_c3t3_item + target_link_libraries(vtk_plugin PUBLIC scene_surface_mesh_item scene_polylines_item scene_c3t3_item vtkCommonCore vtkIOCore vtkIOLegacy vtkIOXML vtkFiltersCore vtkFiltersSources) - polyhedron_demo_plugin(vtk_sm_plugin VTK_io_plugin) - target_link_libraries(vtk_sm_plugin PUBLIC scene_surface_mesh_item scene_polylines_item scene_c3t3_item - vtkCommonCore vtkIOCore vtkIOLegacy vtkIOXML - vtkFiltersCore vtkFiltersSources) - target_compile_definitions(vtk_sm_plugin PUBLIC "-DUSE_SURFACE_MESH" ) - else() message(STATUS "NOTICE : the vtk IO plugin needs VTK libraries and will not be compiled.") endif() diff --git a/Polyhedron/demo/Polyhedron/Plugins/IO/GOCAD_io_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/IO/GOCAD_io_plugin.cpp index 4b526e26a07..243f3f947a7 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/IO/GOCAD_io_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/IO/GOCAD_io_plugin.cpp @@ -1,9 +1,8 @@ -#include "Scene_polyhedron_item.h" #include "Scene_polygon_soup_item.h" #include "Scene_surface_mesh_item.h" #include "Kernel_type.h" #include "Scene.h" -#include "Polyhedron_type.h" +#include "SMesh_type.h" #include #include #include @@ -69,99 +68,54 @@ Polyhedron_demo_gocad_plugin::load(QFileInfo fileinfo) { CGAL::Timer t; t.start(); - if(this->mw->property("is_polyhedron_mode").toBool()) - { - // Try to read GOCAD file in a polyhedron - - Scene_polyhedron_item* item = new Scene_polyhedron_item(Polyhedron()); - Polyhedron& P = * const_cast(item->polyhedron()); - - std::string name, color; - if(! read_gocad(P, in, name, color)){ - std::cerr << "Error: Invalid polyhedron" << std::endl; - delete item; - return 0; - } - - t.stop(); - std::cerr << "Reading took " << t.time() << " sec." << std::endl; - if(name.size() == 0){ - item->setName(fileinfo.baseName()); - } else { - item->setName(name.c_str()); - } - QColor qcolor(color.c_str()); - if(qcolor.isValid()) - { - item->setColor(qcolor); - item->invalidateOpenGLBuffers(); - } - return item; + // Try to read GOCAD file in a surface_mesh + Scene_surface_mesh_item* item = new Scene_surface_mesh_item(new SMesh()); + SMesh& P = * const_cast(item->polyhedron()); + + std::string name, color; + if(! read_gocad(P, in, name, color)){ + std::cerr << "Error: Invalid polyhedron" << std::endl; + delete item; + return 0; } - else - { - - // Try to read GOCAD file in a surface_mesh - Scene_surface_mesh_item* item = new Scene_surface_mesh_item(new SMesh()); - SMesh& P = * const_cast(item->polyhedron()); - - std::string name, color; - if(! read_gocad(P, in, name, color)){ - std::cerr << "Error: Invalid polyhedron" << std::endl; - delete item; - return 0; - } - - t.stop(); - std::cerr << "Reading took " << t.time() << " sec." << std::endl; - if(name.size() == 0){ - item->setName(fileinfo.baseName()); - } else { - item->setName(name.c_str()); - } - QColor qcolor(color.c_str()); - if(qcolor.isValid()) - { - item->setColor(qcolor); - item->invalidateOpenGLBuffers(); - } - return item; + + t.stop(); + std::cerr << "Reading took " << t.time() << " sec." << std::endl; + if(name.size() == 0){ + item->setName(fileinfo.baseName()); + } else { + item->setName(name.c_str()); } + QColor qcolor(color.c_str()); + if(qcolor.isValid()) + { + item->setColor(qcolor); + item->invalidateOpenGLBuffers(); + } + return item; + return NULL; } bool Polyhedron_demo_gocad_plugin::canSave(const CGAL::Three::Scene_item* item) { // This plugin supports polyhedrons - return qobject_cast(item) - || qobject_cast(item); + return qobject_cast(item); } bool Polyhedron_demo_gocad_plugin::save(const CGAL::Three::Scene_item* item, QFileInfo fileinfo) { // This plugin supports polyhedrons - const Scene_polyhedron_item* poly_item = - qobject_cast(item); const Scene_surface_mesh_item* sm_item = - qobject_cast(item); - - if(!poly_item && !sm_item) + qobject_cast(item); + + if(!sm_item) return false; - + std::ofstream out(fileinfo.filePath().toUtf8()); out.precision (std::numeric_limits::digits10 + 2); - if(poly_item) - { - Polyhedron* poly = const_cast(poly_item->polyhedron()); - write_gocad(*poly, out, qPrintable(fileinfo.baseName())); - } - else - { - SMesh* poly = const_cast(sm_item->polyhedron()); - write_gocad(*poly, out, qPrintable(fileinfo.baseName())); - } - - + SMesh* poly = const_cast(sm_item->polyhedron()); + write_gocad(*poly, out, qPrintable(fileinfo.baseName())); return true; } diff --git a/Polyhedron/demo/Polyhedron/Plugins/IO/Implicit_function_io_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/IO/Implicit_function_io_plugin.cpp index a6b66d40ac2..d6502c608d4 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/IO/Implicit_function_io_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/IO/Implicit_function_io_plugin.cpp @@ -96,39 +96,22 @@ init(QMainWindow* mainWindow, CGAL::Three::Scene_interface* scene_interface, Mes this->scene = scene_interface; this->mw = mainWindow; - QAction* actionLoadFunction = new QAction("Load &Implicit Function", mw); + QAction* actionLoadFunction = new QAction("Generate &Implicit Function", mw); if( NULL != actionLoadFunction ) { connect(actionLoadFunction, SIGNAL(triggered()), this, SLOT(load_function())); } QMenu* menuFile = mw->findChild("menuFile"); - if ( NULL != menuFile ) - { - QList menuFileActions = menuFile->actions(); - - // Look for action just after "Load..." action - QAction* actionAfterLoad = NULL; - for ( QList::iterator it_action = menuFileActions.begin(), - end = menuFileActions.end() ; it_action != end ; ++ it_action ) //Q_FOREACH( QAction* action, menuFileActions) - { - if ( NULL != *it_action && (*it_action)->text().contains("Load") ) - { - ++it_action; - if ( it_action != end && NULL != *it_action ) - { - actionAfterLoad = *it_action; - } - } - } - - // Insert "Load implicit function" action - if ( NULL != actionAfterLoad ) - { - menuFile->insertAction(actionAfterLoad,actionLoadFunction); - } - + QMenu* menu = menuFile->findChild("menuGenerateObject"); + if(!menu){ + QAction* actionLoad = mw->findChild("actionLoadPlugin"); + menu = new QMenu(tr("Generate &Objet"), menuFile); + menu->setObjectName("menuGenerateObject"); + menuFile->insertMenu(actionLoad, menu); } + // Insert "Generate Implicit Function" action + menu->addAction(actionLoadFunction); } diff --git a/Polyhedron/demo/Polyhedron/Plugins/IO/OFF_io_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/IO/OFF_io_plugin.cpp index cfe9f558948..aa064d2952f 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/IO/OFF_io_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/IO/OFF_io_plugin.cpp @@ -1,7 +1,8 @@ -#include "Scene_polyhedron_item.h" +#include "Scene_surface_mesh_item.h" #include "Scene_polygon_soup_item.h" #include "Scene_points_with_normal_item.h" -#include "Polyhedron_type.h" +#include + #include @@ -25,7 +26,7 @@ class Polyhedron_demo_off_plugin : public: bool isDefaultLoader(const Scene_item *item) const { - if(qobject_cast(item) + if(qobject_cast(item) || qobject_cast(item)) return true; return false; @@ -65,68 +66,78 @@ Polyhedron_demo_off_plugin::load_off(QFileInfo fileinfo) { std::cerr << "Error! Cannot open file " << (const char*)fileinfo.filePath().toUtf8() << std::endl; return NULL; } - - + + CGAL::File_scanner_OFF scanner( in, false); - + // Try to read .off in a point set if (scanner.size_of_facets() == 0) - { - in.seekg(0); - Scene_points_with_normal_item* item = new Scene_points_with_normal_item(); - item->setName(fileinfo.completeBaseName()); - if (scanner.size_of_vertices()==0) return item; - if(!item->read_off_point_set(in)) - { - delete item; - return 0; - } - - return item; - } - - // to detect isolated vertices - std::size_t total_nb_of_vertices = scanner.size_of_vertices(); - in.seekg(0); - - // Try to read .off in a polyhedron - Scene_polyhedron_item* item = new Scene_polyhedron_item(); - item->setName(fileinfo.completeBaseName()); - if(!item->load(in)) { - delete item; - - // Try to read .off in a polygon soup - Scene_polygon_soup_item* soup_item = new Scene_polygon_soup_item; - soup_item->setName(fileinfo.completeBaseName()); + in.seekg(0); + Scene_points_with_normal_item* item = new Scene_points_with_normal_item(); + item->setName(fileinfo.completeBaseName()); + if (scanner.size_of_vertices()==0) return item; + if(!item->read_off_point_set(in)) + { + delete item; + return 0; + } + + return item; + } + + in.seekg(0); + // Try to read .off in a surface_mesh + SMesh *surface_mesh = new SMesh(); + try{ + in >> *surface_mesh; + } catch(...) + { + surface_mesh->clear(); + } + if(!in || surface_mesh->is_empty()) + { + delete surface_mesh; in.close(); + // Try to read .off in a polygon soup + Scene_polygon_soup_item* soup_item = new Scene_polygon_soup_item(); + soup_item->setName(fileinfo.completeBaseName()); std::ifstream in2(fileinfo.filePath().toUtf8()); if(!soup_item->load(in2)) { + QMessageBox::warning( + CGAL::Three::Three::mainWindow(), + "Cannot Open File", + QString("Cannot open file %1").arg((const char*)fileinfo.filePath().toUtf8())); delete soup_item; return 0; } + QApplication::restoreOverrideCursor(); + QMessageBox::information( + CGAL::Three::Three::mainWindow(), + "Cannot Open File", + "The facets don't seem to be oriented. Loading a Soup of polygons instead." + "To convert it to a Surface_mesh, use Polygon Mesh Processing -> Orient polygon soup"); return soup_item; } - else - if( total_nb_of_vertices!= item->polyhedron()->size_of_vertices()) - { - item->setNbIsolatedvertices(total_nb_of_vertices - item->polyhedron()->size_of_vertices()); - //needs two restore, it's not a typo - QApplication::restoreOverrideCursor(); - QMessageBox::warning((QWidget*)NULL, - tr("Isolated vertices found"), - tr("%1 isolated vertices ignored") - .arg(item->getNbIsolatedvertices())); - } - - //if file > 100 MB, assume it is a very big file and disable flat shading to gain memory. - if(fileinfo.size() > 100000000)//100 MB + Scene_surface_mesh_item* item = new Scene_surface_mesh_item(surface_mesh); + item->setName(fileinfo.completeBaseName()); + std::size_t isolated_v = 0; + BOOST_FOREACH(vertex_descriptor v, vertices(*surface_mesh)) { - item->set_flat_disabled(true); + if(surface_mesh->is_isolated(v)) + { + ++isolated_v; + } + } + if(isolated_v >0) + { + item->setNbIsolatedvertices(isolated_v); + //needs two restore, it's not a typo QApplication::restoreOverrideCursor(); QMessageBox::warning((QWidget*)NULL, - tr("The file seems to be very big."), - tr("Flat shading has been disabled to gain memory. You can force it in the context menu of the item.")); + tr("Isolated vertices"), + tr("%1 isolated vertices found") + .arg(item->getNbIsolatedvertices())); } return item; } @@ -139,62 +150,44 @@ Polyhedron_demo_off_plugin::load_obj(QFileInfo fileinfo) { std::cerr << "Error! Cannot open file " << (const char*)fileinfo.filePath().toUtf8() << std::endl; return NULL; } - typedef Polyhedron::Vertex::Point Point; - std::vector points; - std::vector > faces; - if(!CGAL::read_OBJ(in,points,faces)) return 0; - - Scene_item* item = 0; - - namespace pmp = CGAL::Polygon_mesh_processing; - if(pmp::is_polygon_soup_a_polygon_mesh(faces)) { - Scene_polyhedron_item* poly_item = new Scene_polyhedron_item(); - pmp::polygon_soup_to_polygon_mesh(std::move(points), - std::move(faces), - *(poly_item->polyhedron())); - item = poly_item; - item->invalidateOpenGLBuffers(); - } else { - Scene_polygon_soup_item* polygon_soup_item = new Scene_polygon_soup_item(); - polygon_soup_item->load(std::move(points), std::move(faces)); - item = polygon_soup_item; - } - // Try to read .obj in a polyhedron - item->setName(fileinfo.completeBaseName()); - return item; + Scene_surface_mesh_item* item = new Scene_surface_mesh_item(); + item->setName(fileinfo.baseName()); + if(item->load_obj(in)) + return item; + return 0; } bool Polyhedron_demo_off_plugin::canSave(const CGAL::Three::Scene_item* item) { - // This plugin supports polyhedrons and polygon soups - return qobject_cast(item) || + // This plugin supports surface_meshes and polygon soups + return qobject_cast(item) || qobject_cast(item) || qobject_cast(item); } bool Polyhedron_demo_off_plugin::save(const CGAL::Three::Scene_item* item, QFileInfo fileinfo) { - // This plugin supports point sets, polyhedrons and polygon soups + // This plugin supports point sets, surface_meshes and polygon soups const Scene_points_with_normal_item* points_item = qobject_cast(item); - const Scene_polyhedron_item* poly_item = - qobject_cast(item); + const Scene_surface_mesh_item* sm_item = + qobject_cast(item); const Scene_polygon_soup_item* soup_item = qobject_cast(item); - if(!poly_item && !soup_item && !points_item) + if(!sm_item && !soup_item && !points_item) return false; std::ofstream out(fileinfo.filePath().toUtf8()); out.precision (std::numeric_limits::digits10 + 2); if(fileinfo.suffix().toLower() == "off"){ - return (poly_item && poly_item->save(out)) || + return (sm_item && sm_item->save(out)) || (soup_item && soup_item->save(out)) || (points_item && points_item->write_off_point_set(out)); } if(fileinfo.suffix().toLower() == "obj"){ - return (poly_item && poly_item->save_obj(out)); + return (sm_item && sm_item->save_obj(out)); } return false; } diff --git a/Polyhedron/demo/Polyhedron/Plugins/IO/PLY_io_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/IO/PLY_io_plugin.cpp index 19f788c1bb8..ed37933d0e4 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/IO/PLY_io_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/IO/PLY_io_plugin.cpp @@ -1,9 +1,9 @@ #include "Scene_polygon_soup_item.h" #include "Scene_surface_mesh_item.h" -#include "Scene_polyhedron_item.h" #include "Scene_points_with_normal_item.h" #include +#include #include #include #include @@ -155,7 +155,8 @@ Polyhedron_demo_ply_plugin::load(QFileInfo fileinfo) { QApplication::restoreOverrideCursor(); return NULL; } - + if(item->has_normals()) + item->setRenderingMode(CGAL::Three::Three::defaultPointSetRenderingMode()); item->setName(fileinfo.completeBaseName()); QApplication::restoreOverrideCursor(); return item; @@ -169,8 +170,7 @@ bool Polyhedron_demo_ply_plugin::canSave(const CGAL::Three::Scene_item* item) // This plugin supports point sets and any type of surface return (qobject_cast(item) || qobject_cast(item) - || qobject_cast(item) - || qobject_cast(item)); + || qobject_cast(item)); } bool Polyhedron_demo_ply_plugin::save(const CGAL::Three::Scene_item* item, QFileInfo fileinfo) @@ -210,13 +210,6 @@ bool Polyhedron_demo_ply_plugin::save(const CGAL::Three::Scene_item* item, QFile qobject_cast(item); if (sm_item) return CGAL::write_PLY (out, *(sm_item->polyhedron())); - - // This plugin supports polyhedrons - const Scene_polyhedron_item* poly_item = - qobject_cast(item); - if (poly_item) - return CGAL::write_PLY (out, *(poly_item->polyhedron())); - return false; } diff --git a/Polyhedron/demo/Polyhedron/Plugins/IO/STL_io_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/IO/STL_io_plugin.cpp index 9eada718ae9..0bcfbaba51a 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/IO/STL_io_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/IO/STL_io_plugin.cpp @@ -1,9 +1,8 @@ #include "Scene_surface_mesh_item.h" -#include "Scene_polyhedron_item.h" #include "Scene_polygon_soup_item.h" #include "Kernel_type.h" #include "Scene.h" -#include "Polyhedron_type.h" +#include "SMesh_type.h" #include #include @@ -82,36 +81,17 @@ Polyhedron_demo_stl_plugin::load(QFileInfo fileinfo) { } try{ - if(this->mw->property("is_polyhedron_mode").toBool()) - { - // Try building a polyhedron - Polyhedron P; - if (CGAL::Polygon_mesh_processing::is_polygon_soup_a_polygon_mesh(triangles)) - CGAL::Polygon_mesh_processing::polygon_soup_to_polygon_mesh(points, triangles, P); - - if(! P.is_valid() || P.empty()){ - std::cerr << "Error: Invalid facegraph" << std::endl; - } - else{ - Scene_polyhedron_item* item = new Scene_polyhedron_item(P); - item->setName(fileinfo.completeBaseName()); - return item; - } + // Try building a surface_mesh + SMesh* SM = new SMesh(); + if (CGAL::Polygon_mesh_processing::is_polygon_soup_a_polygon_mesh(triangles)) + CGAL::Polygon_mesh_processing::polygon_soup_to_polygon_mesh(points, triangles, *SM); + if(!SM->is_valid() || SM->is_empty()){ + std::cerr << "Error: Invalid facegraph" << std::endl; } - else - { - // Try building a surface_mesh - SMesh* SM = new SMesh(); - if (CGAL::Polygon_mesh_processing::is_polygon_soup_a_polygon_mesh(triangles)) - CGAL::Polygon_mesh_processing::polygon_soup_to_polygon_mesh(points, triangles, *SM); - if(!SM->is_valid() || SM->is_empty()){ - std::cerr << "Error: Invalid facegraph" << std::endl; - } - else{ - Scene_surface_mesh_item* item = new Scene_surface_mesh_item(SM); - item->setName(fileinfo.completeBaseName()); - return item; - } + else{ + Scene_surface_mesh_item* item = new Scene_surface_mesh_item(SM); + item->setName(fileinfo.completeBaseName()); + return item; } } catch(...){} @@ -124,18 +104,15 @@ Polyhedron_demo_stl_plugin::load(QFileInfo fileinfo) { bool Polyhedron_demo_stl_plugin::canSave(const CGAL::Three::Scene_item* item) { - return qobject_cast(item) || - qobject_cast(item); + return qobject_cast(item); } bool Polyhedron_demo_stl_plugin::save(const CGAL::Three::Scene_item* item, QFileInfo fileinfo) { - const Scene_polyhedron_item* poly_item = - qobject_cast(item); const Scene_surface_mesh_item* sm_item = qobject_cast(item); - if(!poly_item && !sm_item) + if(!sm_item) return false; QStringList list; @@ -162,11 +139,6 @@ bool Polyhedron_demo_stl_plugin::save(const CGAL::Three::Scene_item* item, QFile CGAL::write_STL(*sm_item->face_graph(), out); return true; } - if (poly_item) - { - CGAL::write_STL(*poly_item->polyhedron(), out); - return true; - } return false; } diff --git a/Polyhedron/demo/Polyhedron/Plugins/IO/Selection_io_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/IO/Selection_io_plugin.cpp index 9405afa1e03..bbbfe24bf58 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/IO/Selection_io_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/IO/Selection_io_plugin.cpp @@ -11,15 +11,10 @@ class Polyhedron_demo_selection_io_plugin : Q_INTERFACES(CGAL::Three::Polyhedron_demo_io_plugin_interface) Q_PLUGIN_METADATA(IID "com.geometryfactory.PolyhedronDemo.PluginInterface/1.0") public: -#ifdef USE_SURFACE_MESH + QString name() const { return "selection_io_sm_plugin"; } - QString nameFilters() const { return "Surface_mesh selection files(*.selection.txt)"; } -#else - QString name() const { return "selection_io_plugin"; } - QString nameFilters() const { return "Polyhedron selection files (*.selection.txt)"; } -#endif - - + QString nameFilters() const { return "Selection files(*.selection.txt)"; } + bool canLoad() const { Scene_facegraph_item* sel_item = qobject_cast(CGAL::Three::Three::scene()->item( CGAL::Three::Three::scene()->mainSelectionIndex())); @@ -36,6 +31,7 @@ public: delete item; return NULL; } + item->setName(fileinfo.baseName()); return item; } diff --git a/Polyhedron/demo/Polyhedron/Plugins/IO/Surf_io_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/IO/Surf_io_plugin.cpp index 43f44a90613..becb78272b1 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/IO/Surf_io_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/IO/Surf_io_plugin.cpp @@ -1,5 +1,3 @@ -#include "Scene_polyhedron_item.h" -#include "Polyhedron_type.h" #include "Scene_surface_mesh_item.h" #include @@ -55,10 +53,7 @@ public: CGAL::Three::Scene_item* Surf_io_plugin::load(QFileInfo fileinfo) { - if(mw->property("is_polyhedron_mode").toBool()) - return actual_load(fileinfo); - else - return actual_load(fileinfo); + return actual_load(fileinfo); } template< class FaceGraphItem> CGAL::Three::Scene_item* Surf_io_plugin::actual_load(QFileInfo fileinfo) @@ -95,6 +90,7 @@ CGAL::Three::Scene_item* Surf_io_plugin::actual_load(QFileInfo fileinfo) compute_color_map(QColor(100, 100, 255), static_cast(patches.size()), std::back_inserter(colors_)); Scene_group_item* group = new Scene_group_item(fileinfo.completeBaseName()); + group->setScene(scene); for(std::size_t i=0; i -#include -#include - -#include -#include -#include -#include -#include -#include -#include "Scene_surface_mesh_item.h" -#include "Scene_polygon_soup_item.h" -#include "Messages_interface.h" - - -class SurfaceMeshIoPlugin : - public QObject, - public CGAL::Three::Polyhedron_demo_plugin_interface, - public CGAL::Three::Polyhedron_demo_io_plugin_interface -{ - Q_OBJECT - Q_INTERFACES( - CGAL::Three::Polyhedron_demo_plugin_interface - CGAL::Three::Polyhedron_demo_io_plugin_interface -) - Q_PLUGIN_METADATA(IID "com.geometryfactory.PolyhedronDemo.PluginInterface/1.0") - Q_PLUGIN_METADATA(IID "com.geometryfactory.PolyhedronDemo.IOPluginInterface/1.0") -public: - bool isDefaultLoader(const CGAL::Three::Scene_item *item) const - { - if(qobject_cast(item)) - return true; - return false; - } - - void init(QMainWindow*, CGAL::Three::Scene_interface*, Messages_interface* m) - { - this->message = m; - } - bool applicable(QAction*) const - { - return false; - } - QList actions() const - { - return QList(); - } - QString name() const { return "surface_mesh_io_plugin"; } - QString loadNameFilters() const { return "OFF files to Surface_mesh (*.off);;Wavefront Surface_mesh OBJ (*.obj)"; } - QString saveNameFilters() const { return "OFF files (*.off);;Wavefront OBJ (*.obj)"; } - QString nameFilters() const { return QString(); } - bool canLoad() const { return true; } - CGAL::Three::Scene_item* load(QFileInfo fileinfo) { - if(fileinfo.suffix().toLower() == "off") - { - // Open file - std::ifstream in(fileinfo.filePath().toUtf8()); - if(!in) { - message->error(QString("Cannot open file %1").arg((const char*)fileinfo.filePath().toUtf8())); - return NULL; - } - - SMesh *surface_mesh = new SMesh(); - in >> *surface_mesh; - if(!in || surface_mesh->is_empty()) - { - delete surface_mesh; - in.close(); - // Try to read .off in a polygon soup - Scene_polygon_soup_item* soup_item = new Scene_polygon_soup_item(); - soup_item->setName(fileinfo.completeBaseName()); - std::ifstream in2(fileinfo.filePath().toUtf8()); - if(!soup_item->load(in2)) { - message->error(QString("Cannot open file %1").arg((const char*)fileinfo.filePath().toUtf8())); - delete soup_item; - return 0; - } - message->information("The facets don't seem to be oriented. Loading a Soup of polygons instead." - "To convert it to a Surface_mesh or a Polyhedron, use Polygon Mesh Processing -> Orient polygon soup"); - return soup_item; - } - Scene_surface_mesh_item* item = new Scene_surface_mesh_item(surface_mesh); - item->setName(fileinfo.completeBaseName()); - std::size_t isolated_v = 0; - BOOST_FOREACH(vertex_descriptor v, vertices(*surface_mesh)) - { - if(surface_mesh->is_isolated(v)) - { - ++isolated_v; - } - } - if(isolated_v >0) - { - item->setNbIsolatedvertices(isolated_v); - //needs two restore, it's not a typo - QApplication::restoreOverrideCursor(); - QMessageBox::warning((QWidget*)NULL, - tr("Isolated vertices"), - tr("%1 isolated vertices found") - .arg(item->getNbIsolatedvertices())); - } - return item; - } - else if(fileinfo.suffix().toLower() == "obj") - { - // Open file - std::ifstream in(fileinfo.filePath().toUtf8()); - if(!in) { - std::cerr << "Error! Cannot open file " << (const char*)fileinfo.filePath().toUtf8() << std::endl; - return NULL; - } - Scene_surface_mesh_item* item = new Scene_surface_mesh_item(); - if(item->load_obj(in)) - return item; - } - - return 0; - - } - bool canSave(const CGAL::Three::Scene_item* item) { - return qobject_cast(item) != 0; - } - - bool save(const CGAL::Three::Scene_item* item, QFileInfo fileinfo) { - - const Scene_surface_mesh_item* sm_item = - qobject_cast(item); - - if(!sm_item) - return false; - - std::ofstream out(fileinfo.filePath().toUtf8()); - out.precision (std::numeric_limits::digits10 + 2); - - if(fileinfo.suffix().toLower() == "off"){ - return (sm_item && sm_item->save(out)); - } - if(fileinfo.suffix().toLower() == "obj"){ - return (sm_item && sm_item->save_obj(out)); - } - return false; - } - -private: - QList _actions; - //The reference to the main window - Messages_interface* message; -}; -#include "Surface_mesh_io_plugin.moc" diff --git a/Polyhedron/demo/Polyhedron/Plugins/IO/VTK_io_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/IO/VTK_io_plugin.cpp index a73e7b3f62e..29d0217948b 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/IO/VTK_io_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/IO/VTK_io_plugin.cpp @@ -23,13 +23,7 @@ #include "Scene_c3t3_item.h" #include -#ifdef USE_SURFACE_MESH #include "Scene_surface_mesh_item.h" -#else -#include "Polyhedron_type.h" -#include "Scene_polyhedron_item.h" -#include -#endif #include "Scene_polylines_item.h" #include @@ -76,11 +70,8 @@ #include #include -#ifdef USE_SURFACE_MESH + typedef Scene_surface_mesh_item Scene_facegraph_item; -#else -typedef Scene_polyhedron_item Scene_facegraph_item; -#endif typedef Scene_facegraph_item::Face_graph FaceGraph; typedef boost::property_traits::type>::value_type Point; namespace CGAL{ @@ -286,15 +277,10 @@ public: typedef boost::graph_traits::vertex_descriptor vertex_descriptor; typedef boost::graph_traits::face_descriptor face_descriptor; -#ifdef USE_SURFACE_MESH + QString nameFilters() const { - return "VTK PolyData files Surface_mesh (*.vtk);; VTK XML PolyData Surface_mesh (*.vtp);; VTK XML UnstructuredGrid Surface_mesh(*.vtu)"; } + return "VTK PolyData files (*.vtk);; VTK XML PolyData (*.vtp);; VTK XML UnstructuredGrid (*.vtu)"; } QString name() const { return "vtk_sm_plugin"; } -#else - QString nameFilters() const { - return "VTK PolyData files Polyhedron (*.vtk);; VTK XML PolyData Polyhedron (*.vtp);; VTK XML UnstructuredGrid Polyhedron(*.vtu)"; } - QString name() const { return "vtk_plugin"; } -#endif bool canSave(const CGAL::Three::Scene_item* item) { return (qobject_cast(item) diff --git a/Polyhedron/demo/Polyhedron/Plugins/IO/XYZ_io_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/IO/XYZ_io_plugin.cpp index 9f95025a27f..3228bf27d90 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/IO/XYZ_io_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/IO/XYZ_io_plugin.cpp @@ -3,6 +3,7 @@ #include #include +#include #include #include #include @@ -49,6 +50,9 @@ Polyhedron_demo_xyz_plugin::load(QFileInfo fileinfo) delete point_set_item; return NULL; } + if(point_set_item->has_normals()) + point_set_item->setRenderingMode(CGAL::Three::Three::defaultPointSetRenderingMode()); + return point_set_item; } diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_2/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/Mesh_2/CMakeLists.txt index 4efa4d8d677..7c0b0bd6cbe 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_2/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_2/CMakeLists.txt @@ -4,7 +4,6 @@ qt5_wrap_ui( mesh_2UI_FILES mesh_2_dialog.ui) polyhedron_demo_plugin(mesh_2_plugin Mesh_2_plugin ${mesh_2UI_FILES}) #if the plugin uses external libraries like scene_items target_link_libraries(mesh_2_plugin PUBLIC - scene_polyhedron_item scene_surface_mesh_item scene_polylines_item scene_points_with_normal_item) diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_2/Mesh_2_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Mesh_2/Mesh_2_plugin.cpp index acbfab9cdd5..b00669c131a 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_2/Mesh_2_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_2/Mesh_2_plugin.cpp @@ -15,11 +15,10 @@ #include #include -#include "Scene_polyhedron_item.h" + #include "Scene_surface_mesh_item.h" #include "Scene_polylines_item.h" #include "Scene_points_with_normal_item.h" -#include "Polyhedron_type.h" #include @@ -334,33 +333,22 @@ private: std::cout << " done (" << ltime.elapsed() << " ms)" << std::endl; } - // export result as a polyhedron item + // export result as a surface_mesh item QString iname = polylines_items.size()==1? polylines_items.front()->name()+QString("_meshed_"): QString("2dmesh_"); iname+=QString::number(target_length); if (runLloyd) iname+=QString("_Lloyd_")+QString::number(nb_iter); + Scene_surface_mesh_item* poly_item = new Scene_surface_mesh_item(); + poly_item->setName(iname); + cdt2_to_face_graph(cdt, + *poly_item->polyhedron(), + constant_coordinate_index, + constant_coordinate); + scene->addItem(poly_item); + poly_item->invalidateOpenGLBuffers(); - if(mw->property("is_polyhedron_mode").toBool()){ - Scene_polyhedron_item* poly_item = new Scene_polyhedron_item(); - poly_item->setName(iname); - cdt2_to_face_graph(cdt, - *poly_item->polyhedron(), - constant_coordinate_index, - constant_coordinate); - scene->addItem(poly_item); - poly_item->invalidateOpenGLBuffers(); - }else{ - Scene_surface_mesh_item* poly_item = new Scene_surface_mesh_item(); - poly_item->setName(iname); - cdt2_to_face_graph(cdt, - *poly_item->polyhedron(), - constant_coordinate_index, - constant_coordinate); - scene->addItem(poly_item); - poly_item->invalidateOpenGLBuffers(); - } std::cout << "ok (" << time.elapsed() << " ms)" << std::endl; // default cursor QApplication::restoreOverrideCursor(); diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/C3t3_io_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/C3t3_io_plugin.cpp index 0108e4c4398..f71a15aff64 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/C3t3_io_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/C3t3_io_plugin.cpp @@ -239,7 +239,7 @@ typedef CGAL::Mesh_complex_3_in_triangulation_3< Fake_mesh_domain::Corner_index, Fake_mesh_domain::Curve_index> Fake_c3t3; -template > +template > struct Fake_CDT_3_vertex_base : public Vb { typedef Vb Base; @@ -291,7 +291,7 @@ operator>>( std::istream& is, Fake_CDT_3_vertex_base& v) return is; } -template > +template > struct Fake_CDT_3_cell_base : public Cb { typedef Cb Base; @@ -352,7 +352,7 @@ operator>>( std::istream& is, Fake_CDT_3_cell_base& c) { } typedef CGAL::Triangulation_data_structure_3, Fake_CDT_3_cell_base<> > Fake_CDT_3_TDS; -typedef CGAL::Triangulation_3 Fake_CDT_3; +typedef CGAL::Triangulation_3 Fake_CDT_3; typedef Fake_mesh_domain::Surface_patch_index Fake_patch_id; diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/C3t3_rib_exporter_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/C3t3_rib_exporter_plugin.cpp index 0b188d3cd98..35c1bfd2529 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/C3t3_rib_exporter_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/C3t3_rib_exporter_plugin.cpp @@ -704,7 +704,7 @@ void C3t3_rib_exporter_plugin:: write_facets(const C3t3& c3t3, const Plane& plane, std::ofstream& out) { - typedef Kernel::Oriented_side Side; + typedef EPICK::Oriented_side Side; Geom_traits::Construct_point_3 wp2p = c3t3.triangulation().geom_traits().construct_point_3_object(); @@ -869,7 +869,7 @@ void C3t3_rib_exporter_plugin:: write_cells_intersecting_a_plane(const C3t3& c3t3, const Plane& plane, std::ofstream& out) { - typedef Kernel::Oriented_side Side; + typedef EPICK::Oriented_side Side; Geom_traits::Construct_point_3 wp2p = c3t3.triangulation().geom_traits().construct_point_3_object(); @@ -917,7 +917,7 @@ void C3t3_rib_exporter_plugin:: write_cells_on_the_positive_side_of_a_plane(const C3t3& c3t3, const Plane& plane, std::ofstream& out) { - typedef Kernel::Oriented_side Side; + typedef EPICK::Oriented_side Side; Geom_traits::Construct_point_3 wp2p = c3t3.triangulation().geom_traits().construct_point_3_object(); diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/CMakeLists.txt index 193ee13fec7..7b420f5c6a3 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/CMakeLists.txt @@ -9,7 +9,7 @@ if ( Boost_VERSION GREATER 103400 ) polyhedron_demo_plugin(mesh_3_plugin Mesh_3_plugin Mesh_3_plugin_cgal_code.cpp Meshing_thread.cpp split_polylines.cpp ${meshingUI_FILES}) - target_link_libraries(mesh_3_plugin PUBLIC scene_polyhedron_item scene_polygon_soup_item scene_polylines_item scene_implicit_function_item scene_image_item + target_link_libraries(mesh_3_plugin PUBLIC scene_polygon_soup_item scene_polylines_item scene_implicit_function_item scene_image_item scene_surface_mesh_item scene_c3t3_item ${OPENGL_gl_LIBRARY} ) set(VTK_LIBS "") @@ -41,7 +41,7 @@ if ( Boost_VERSION GREATER 103400 ) polyhedron_demo_plugin(mesh_3_optimization_plugin Optimization_plugin Optimization_plugin_cgal_code.cpp Optimizer_thread.cpp ${meshingUI_FILES}) - target_link_libraries(mesh_3_optimization_plugin PUBLIC scene_c3t3_item scene_polyhedron_item scene_surface_mesh_item scene_image_item scene_implicit_function_item ) + target_link_libraries(mesh_3_optimization_plugin PUBLIC scene_c3t3_item scene_surface_mesh_item scene_image_item scene_implicit_function_item ) diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Io_image_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Io_image_plugin.cpp index e1d81dee10d..1e363259796 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Io_image_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Io_image_plugin.cpp @@ -69,10 +69,16 @@ // 0..1 and min_max is the range it came from. struct IntConverter { std::pair min_max; - + int operator()(float f) { float s = f * float((min_max.second - min_max.first)); - return s + float(min_max.first); + //approximate instead of just floor. + if (s - floor(s) >= 0.5){ + return int(s)+1 + min_max.first; + } + else{ + return s + float(min_max.first); + } } }; @@ -215,7 +221,7 @@ public: z_control = NULL; current_control = NULL; planeSwitch = new QAction("Add Volume Planes", mw); - QAction *actionLoadDCM = new QAction("Open directory", mw); + QAction *actionLoadDCM = new QAction("Open Directory (for DCM files)", mw); connect(actionLoadDCM, SIGNAL(triggered()), this, SLOT(on_actionLoadDCM_triggered())); if(planeSwitch) { planeSwitch->setProperty("subMenuName", "3D Mesh Generation"); @@ -546,6 +552,7 @@ private: } else { layout = controlDockWidget->findChild("vpSliderLayout"); controlDockWidget->show(); + controlDockWidget->raise(); } return layout; diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_3_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_3_plugin.cpp index 83e6ad3f671..f249bb1455b 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_3_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_3_plugin.cpp @@ -18,7 +18,6 @@ #include #include -#include "Scene_polyhedron_item.h" #include "Scene_polylines_item.h" #ifdef CGAL_MESH_3_DEMO_ACTIVATE_IMPLICIT_FUNCTIONS @@ -103,19 +102,12 @@ public: } #endif Q_FOREACH(int ind, scene->selectionIndices()){ - Scene_polyhedron_item* poly_item - = qobject_cast(scene->item(ind)); Scene_surface_mesh_item* sm_item = qobject_cast(scene->item(ind)); - if (NULL == poly_item) - { - if(NULL == sm_item) - continue; - } + if(NULL == sm_item) + continue; if (a == actionMesh_3) { - if(poly_item) - return poly_item->polyhedron()->is_closed(); if(sm_item) return is_closed(*sm_item->polyhedron()); } @@ -189,8 +181,6 @@ void Mesh_3_plugin::mesh_3_volume() void Mesh_3_plugin::mesh_3(const bool surface_only, const bool use_defaults) { - Scene_polyhedron_item* poly_item = NULL; - Scene_polyhedron_item* bounding_poly_item = NULL; Scene_surface_mesh_item* sm_item = NULL; Scene_surface_mesh_item* bounding_sm_item = NULL; Scene_implicit_function_item* function_item = NULL; @@ -198,29 +188,6 @@ void Mesh_3_plugin::mesh_3(const bool surface_only, const bool use_defaults) Scene_polylines_item* polylines_item = NULL; Q_FOREACH(int ind, scene->selectionIndices()) { - - if(poly_item == NULL) - { - poly_item = qobject_cast(scene->item(ind)); - if (poly_item != NULL - && scene->selectionIndices().size() == 2 - && bounding_poly_item == NULL) - { - bounding_poly_item = qobject_cast( - scene->item(scene->selectionIndices().back())); - if (bounding_poly_item != NULL) - { - //if poly is bounding, and bounding_poly is a non-closed surface - if (is_closed(*poly_item->polyhedron()) - && !is_closed(*bounding_poly_item->polyhedron())) - { - //todo : check poly_item is inside bounding_poly_item - std::swap(poly_item, bounding_poly_item); - //now bounding_poly_item is the bounding one - } - } - } - } if(sm_item == NULL) { sm_item = qobject_cast(scene->item(ind)); @@ -258,24 +225,6 @@ void Mesh_3_plugin::mesh_3(const bool surface_only, const bool use_defaults) } Scene_item* item = NULL; bool features_protection_available = false; - if(NULL != poly_item) - { - if (!poly_item->polyhedron()->is_pure_triangle()) - { - QMessageBox::warning(mw, tr(""), - tr("Selected Scene_polyhedron_item is not triangulated.")); - return; - } - if (NULL != bounding_poly_item - && !bounding_poly_item->polyhedron()->is_pure_triangle()) - { - QMessageBox::warning(mw, tr(""), - tr("Selected Scene_polyhedron_item is not triangulated.")); - return; - } - item = poly_item; - features_protection_available = true; - } if(NULL != sm_item) { if (!is_triangle_mesh(*sm_item->polyhedron())) @@ -424,13 +373,11 @@ void Mesh_3_plugin::mesh_3(const bool surface_only, const bool use_defaults) ui.facegraphCheckBox->setVisible(surface_only); ui.initializationGroup->setVisible(image_item != NULL && !image_item->isGray()); ui.grayImgGroup->setVisible(image_item != NULL && image_item->isGray()); - if (poly_item != NULL) - ui.volumeGroup->setVisible(!surface_only && poly_item->polyhedron()->is_closed()); - else if (sm_item != NULL) + if (sm_item != NULL) ui.volumeGroup->setVisible(!surface_only && is_closed(*sm_item->polyhedron())); else ui.volumeGroup->setVisible(!surface_only); - if ((poly_item == NULL && sm_item == NULL)|| polylines_item != NULL) { + if ((sm_item == NULL)|| polylines_item != NULL) { ui.sharpEdgesAngleLabel->setVisible(false); ui.sharpEdgesAngle->setVisible(false); @@ -446,7 +393,7 @@ void Mesh_3_plugin::mesh_3(const bool surface_only, const bool use_defaults) if (features_protection_available) { - if (NULL != poly_item || NULL != sm_item) + if (NULL != sm_item) { if (surface_only) { @@ -500,45 +447,21 @@ void Mesh_3_plugin::mesh_3(const bool surface_only, const bool use_defaults) QApplication::setOverrideCursor(Qt::WaitCursor); Meshing_thread* thread = NULL; - - // Polyhedron - if ( NULL != poly_item ) - { - Polyhedron* pMesh = poly_item->polyhedron(); - if (NULL == pMesh) - { - QMessageBox::critical(mw, tr(""), tr("ERROR: no data in selected item")); - return; - } - - Scene_polylines_item::Polylines_container plc; - - thread = cgal_code_mesh_3(pMesh, - (polylines_item == NULL)?plc:polylines_item->polylines, - (bounding_poly_item == NULL)?NULL:bounding_poly_item->polyhedron(), - item->name(), - angle, - facet_sizing, - approx, - tet_sizing, - edge_size, - radius_edge, - protect_features, - protect_borders,//available only for poly_item and sm_item - sharp_edges_angle, - manifold, - surface_only, - scene); - } - // Surface_mesh if ( NULL != sm_item ) { SMesh* pMesh = sm_item->polyhedron(); if (NULL == pMesh) { + QApplication::restoreOverrideCursor(); QMessageBox::critical(mw, tr(""), tr("ERROR: no data in selected item")); return; } + if(sm_item->getNbIsolatedvertices() != 0) + { + QApplication::restoreOverrideCursor(); + QMessageBox::critical(mw, tr(""), tr("ERROR: there are isolated vertices in this mesh.")); + return; + } Scene_polylines_item::Polylines_container plc; SMesh *pBMesh = (bounding_sm_item == NULL) ? NULL : bounding_sm_item->polyhedron(); @@ -744,38 +667,18 @@ treat_result(Scene_item& source_item, } else { - if(mw->property("is_polyhedron_mode").toBool()) - { - Scene_polyhedron_item* new_item = new Scene_polyhedron_item; - CGAL::facets_in_complex_3_to_triangle_mesh(result_item->c3t3(), *new_item->face_graph()); - new_item->setName(tr("%1 [Remeshed as Polyhedron_3]").arg(source_item.name())); - Q_FOREACH(int ind, scene->selectionIndices()) { - scene->item(ind)->setVisible(false); - } - const Scene_interface::Item_id index = scene->mainSelectionIndex(); - scene->itemChanged(index); - scene->setSelectedItem(-1); - Scene_interface::Item_id new_item_id = scene->addItem(new_item); - scene->setSelectedItem(new_item_id); - delete result_item; - } - else - { - { - Scene_surface_mesh_item* new_item = new Scene_surface_mesh_item; - CGAL::facets_in_complex_3_to_triangle_mesh(result_item->c3t3(), *new_item->face_graph()); - new_item->setName(tr("%1 [Remeshed as Surface_mesh]").arg(source_item.name())); - Q_FOREACH(int ind, scene->selectionIndices()) { - scene->item(ind)->setVisible(false); - } - const Scene_interface::Item_id index = scene->mainSelectionIndex(); - scene->itemChanged(index); - scene->setSelectedItem(-1); - Scene_interface::Item_id new_item_id = scene->addItem(new_item); - scene->setSelectedItem(new_item_id); - delete result_item; - } + Scene_surface_mesh_item* new_item = new Scene_surface_mesh_item; + CGAL::facets_in_complex_3_to_triangle_mesh(result_item->c3t3(), *new_item->face_graph()); + new_item->setName(tr("%1 [Remeshed as Surface_mesh]").arg(source_item.name())); + Q_FOREACH(int ind, scene->selectionIndices()) { + scene->item(ind)->setVisible(false); } + const Scene_interface::Item_id index = scene->mainSelectionIndex(); + scene->itemChanged(index); + scene->setSelectedItem(-1); + Scene_interface::Item_id new_item_id = scene->addItem(new_item); + scene->setSelectedItem(new_item_id); + delete result_item; } } diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_3_plugin_cgal_code.cpp b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_3_plugin_cgal_code.cpp index 7ab4e4e2e16..4d6cbfc8f52 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_3_plugin_cgal_code.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_3_plugin_cgal_code.cpp @@ -5,7 +5,6 @@ #include #include #include -#include #include @@ -37,12 +36,6 @@ struct Polyhedral_mesh_domain_selector { typedef Polyhedral_mesh_domain type; }; - -template<> -struct Polyhedral_mesh_domain_selector -{ - typedef Polyhedral_mesh_domain_sm type; -}; template Meshing_thread* cgal_code_mesh_3_templated(const Mesh* pMesh, const Polylines_container& polylines, @@ -104,7 +97,7 @@ Meshing_thread* cgal_code_mesh_3_templated(const Mesh* pMesh, std::cerr << " done (" << timer.time() * 1000 << " ms)" << std::endl; - Scene_c3t3_item* p_new_item = new Scene_c3t3_item; + Scene_c3t3_item* p_new_item = new Scene_c3t3_item(surface_only); p_new_item->setScene(scene); QString tooltip = QString("

    From \"") + filename + @@ -143,40 +136,6 @@ Meshing_thread* cgal_code_mesh_3_templated(const Mesh* pMesh, } -Meshing_thread* cgal_code_mesh_3(const Polyhedron* pMesh, - const Polylines_container& polylines, - const Polyhedron* pBoundingMesh, - QString filename, - const double facet_angle, - const double facet_sizing, - const double facet_approx, - const double tet_sizing, - const double edge_size, - const double tet_shape, - bool protect_features, - bool protect_borders, - const double sharp_edges_angle, - const int manifold, - const bool surface_only, - CGAL::Three::Scene_interface* scene) -{ - return cgal_code_mesh_3_templated(pMesh, - polylines, - pBoundingMesh, - filename, - facet_angle, - facet_sizing, - facet_approx, - tet_sizing, - edge_size, - tet_shape, - protect_features, - protect_borders, - sharp_edges_angle, - manifold, - surface_only, - scene); -} Meshing_thread* cgal_code_mesh_3(const SMesh* pMesh, const Polylines_container& polylines, diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_3_plugin_cgal_code.h b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_3_plugin_cgal_code.h index 8e6f6fe619c..ca90415d036 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_3_plugin_cgal_code.h +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_3_plugin_cgal_code.h @@ -1,4 +1,3 @@ -#include "Polyhedron_type_fwd.h" #ifdef CGAL_MESH_3_DEMO_ACTIVATE_SEGMENTED_IMAGES # include "Image_type_fwd.h" #endif @@ -20,23 +19,6 @@ namespace CGAL { namespace Three { typedef std::list > Polylines_container; -Meshing_thread* cgal_code_mesh_3(const Polyhedron* pMesh, - const Polylines_container& polylines, - const Polyhedron* pBoundingMesh, - QString filename, - const double facet_angle, - const double facet_sizing, - const double facet_approx, - const double tet_sizing, - const double edge_size, - const double tet_shape, - bool protect_features, - bool protect_borders, - const double sharp_edges_angle, - const int manifold, - const bool surface_only, - CGAL::Three::Scene_interface* scene); - Meshing_thread* cgal_code_mesh_3(const SMesh* pMesh, const Polylines_container& polylines, const SMesh* pBoundingMesh, diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_function.h b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_function.h index df6f55a7694..0408113e335 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_function.h +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_function.h @@ -57,8 +57,8 @@ struct Get_facet_patch_id_selector { }; //specialization for surface_mesh template<> -struct Get_facet_patch_id_selector { - typedef CGAL::Mesh_3::Get_facet_patch_id_sm type; +struct Get_facet_patch_id_selector { + typedef CGAL::Mesh_3::Get_facet_patch_id_sm type; }; }//end internal struct Mesh_parameters diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Optimization_plugin_cgal_code.cpp b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Optimization_plugin_cgal_code.cpp index eb618fe9410..ea98ff61bfd 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Optimization_plugin_cgal_code.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Optimization_plugin_cgal_code.cpp @@ -3,7 +3,6 @@ #include "C3t3_type.h" #include "Scene_c3t3_item.h" #include "Scene_surface_mesh_item.h" -#include "Scene_polyhedron_item.h" #ifdef CGAL_MESH_3_DEMO_ACTIVATE_SEGMENTED_IMAGES #include "Scene_image_item.h" @@ -126,44 +125,24 @@ Optimizer_thread* cgal_code_optimization(Scene_c3t3_item& c3t3_item, return new Optimizer_thread(p_opt_function, p_result_item); } #endif - - // Polyhedron - const Scene_polyhedron_item* poly_item = - qobject_cast(c3t3_item.data_item()); - - if ( NULL != poly_item ) - { - // Build domain - const Polyhedron* p_poly = poly_item->polyhedron(); - if ( NULL == p_poly ) - { - return NULL; - } - - Polyhedral_mesh_domain* p_domain = new Polyhedral_mesh_domain(*p_poly); - - // Create thread - typedef Optimization_function Opt_function; - Opt_function* p_opt_function = new Opt_function(p_result_item->c3t3(), p_domain, param); - return new Optimizer_thread(p_opt_function, p_result_item); - } - + // Surface mesh const Scene_surface_mesh_item* sm_item = qobject_cast(c3t3_item.data_item()); if ( NULL != sm_item ) { + const_cast(sm_item)->setItemIsMulticolor(true); // Build domain const SMesh* smesh = sm_item->face_graph(); if ( NULL == smesh ) { return NULL; } - Polyhedral_mesh_domain_sm* sm_domain = new Polyhedral_mesh_domain_sm(*smesh); + Polyhedral_mesh_domain* sm_domain = new Polyhedral_mesh_domain(*smesh); // Create thread - typedef Optimization_function Opt_function; + typedef Optimization_function Opt_function; Opt_function* p_opt_function = new Opt_function(p_result_item->c3t3(), sm_domain, param); return new Optimizer_thread(p_opt_function, p_result_item); } diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Rib_dialog.ui b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Rib_dialog.ui index cc30c3975dd..03a4514d7b6 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Rib_dialog.ui +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Rib_dialog.ui @@ -7,7 +7,7 @@ 0 0 423 - 436 + 443 @@ -217,6 +217,19 @@ + + + + Qt::Vertical + + + + 20 + 40 + + + + diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/raw_image.ui b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/raw_image.ui index caca26af981..b00fef0ba1a 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/raw_image.ui +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/raw_image.ui @@ -7,7 +7,7 @@ 0 0 585 - 342 + 326 @@ -278,6 +278,19 @@ + + + + Qt::Vertical + + + + 20 + 40 + + + + diff --git a/Polyhedron/demo/Polyhedron/Plugins/Operations_on_polyhedra/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/Operations_on_polyhedra/CMakeLists.txt index 25e86475537..d17154f831a 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Operations_on_polyhedra/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/Operations_on_polyhedra/CMakeLists.txt @@ -1,21 +1,15 @@ include( polyhedron_demo_macros ) qt5_wrap_ui( clip_polyhedronUI_FILES Clip_polyhedron_plugin.ui ) polyhedron_demo_plugin(clip_polyhedron_plugin Clip_polyhedron_plugin ${clip_polyhedronUI_FILES}) - target_link_libraries(clip_polyhedron_plugin PUBLIC scene_surface_mesh_item scene_polyhedron_item scene_basic_objects) + target_link_libraries(clip_polyhedron_plugin PUBLIC scene_surface_mesh_item scene_basic_objects) polyhedron_demo_plugin(point_set_from_vertices_plugin Point_set_from_vertices_plugin) - target_link_libraries(point_set_from_vertices_plugin PUBLIC scene_polyhedron_item scene_surface_mesh_item scene_polygon_soup_item scene_points_with_normal_item) - - polyhedron_demo_plugin(surface_mesh_to_polyhedron_plugin Surface_mesh_to_polyhedron_plugin) - target_link_libraries(surface_mesh_to_polyhedron_plugin PUBLIC scene_polyhedron_item scene_surface_mesh_item) + target_link_libraries(point_set_from_vertices_plugin PUBLIC scene_surface_mesh_item scene_polygon_soup_item scene_points_with_normal_item) if( METIS_FOUND ) qt5_wrap_ui( partitionUI_FILES PartitionDialog.ui ) - polyhedron_demo_plugin(partition_poly_plugin Partition_graph_plugin ${partitionUI_FILES}) - target_link_libraries(partition_poly_plugin PUBLIC scene_polyhedron_item ${METIS_LIBRARIES} ) - polyhedron_demo_plugin(partition_sm_plugin Partition_graph_plugin ${partitionUI_FILES}) - target_link_libraries(partition_sm_plugin PUBLIC scene_surface_mesh_item ${METIS_LIBRARIES} ) - target_compile_definitions(partition_sm_plugin PUBLIC "-DCGAL_USE_SURFACE_MESH" ) + polyhedron_demo_plugin(partition_plugin Partition_graph_plugin ${partitionUI_FILES}) + target_link_libraries(partition_plugin PUBLIC scene_surface_mesh_item ${METIS_LIBRARIES} ) else() message("NOTICE : the Partition plugin needs METIS libraries and will not be compiled.") endif() diff --git a/Polyhedron/demo/Polyhedron/Plugins/Operations_on_polyhedra/Clip_polyhedron_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Operations_on_polyhedra/Clip_polyhedron_plugin.cpp index 3cfa72e2748..ea133fe6bdf 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Operations_on_polyhedra/Clip_polyhedron_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Operations_on_polyhedra/Clip_polyhedron_plugin.cpp @@ -4,7 +4,6 @@ #include #include #include "Scene_surface_mesh_item.h" -#include "Scene_polyhedron_item.h" #include "Scene_plane_item.h" #include #include @@ -122,8 +121,7 @@ public : { Q_FOREACH(int id, scene->selectionIndices()) { - if(qobject_cast(scene->item(id)) - || qobject_cast(scene->item(id))) + if(qobject_cast(scene->item(id))) return true; } return false; @@ -182,7 +180,7 @@ public Q_SLOTS: void pop_widget() { if(dock_widget->isVisible()) { dock_widget->hide(); } - else { dock_widget->show(); } + else { dock_widget->show(); dock_widget->raise();} //creates a new cutting_plane; if(!plane) @@ -224,20 +222,11 @@ public Q_SLOTS: { polyhedra << sm_item; } - else - { - Scene_polyhedron_item *poly_item = qobject_cast(scene->item(id)); - if(poly_item && CGAL::is_triangle_mesh(*poly_item->polyhedron())) - { - polyhedra << poly_item; - } - } } //apply the clipping function Q_FOREACH(Scene_item* item, polyhedra) { Scene_surface_mesh_item *sm_item = qobject_cast(item); - Scene_polyhedron_item* poly_item = qobject_cast(item); if (ui_widget.clip_radioButton->isChecked()) { @@ -250,15 +239,6 @@ public Q_SLOTS: ui_widget.close_checkBox->isChecked()). throw_on_self_intersection(true)); } - else - { - CGAL::Polygon_mesh_processing::clip(*(poly_item->face_graph()), - plane->plane(), - CGAL::Polygon_mesh_processing::parameters::clip_volume( - ui_widget.close_checkBox->isChecked()). - throw_on_self_intersection(true)); - - } } catch(CGAL::Polygon_mesh_processing::Corefinement::Self_intersection_exception) { @@ -274,10 +254,6 @@ public Q_SLOTS: { apply(sm_item); } - else - { - apply(poly_item); - } } } viewer->update(); diff --git a/Polyhedron/demo/Polyhedron/Plugins/Operations_on_polyhedra/Partition_graph_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Operations_on_polyhedra/Partition_graph_plugin.cpp index 2049f9b75bd..8a252edf612 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Operations_on_polyhedra/Partition_graph_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Operations_on_polyhedra/Partition_graph_plugin.cpp @@ -4,12 +4,7 @@ #include "ui_PartitionDialog.h" #include "Color_map.h" -#ifdef CGAL_USE_SURFACE_MESH #include "Scene_surface_mesh_item.h" -#else -#include "Polyhedron_type.h" -#include "Scene_polyhedron_item.h" -#endif #include #include @@ -18,16 +13,11 @@ #include #include #include -#include #include #include #include -#ifdef CGAL_USE_SURFACE_MESH typedef Scene_surface_mesh_item Scene_facegraph_item; -#else -typedef Scene_polyhedron_item Scene_facegraph_item; -#endif typedef Scene_facegraph_item::Face_graph FaceGraph; class PartitionDialog : @@ -68,22 +58,14 @@ public: actionNodalPartition = new QAction( - #ifdef CGAL_USE_SURFACE_MESH - tr("Create a Nodal Graph Based Partition for a Surface Mesh") - #else - tr("Create a Nodal Graph Based Partition for a Polyhedron") - #endif + tr("Create a Nodal Graph Based Partition") , mw); if(actionNodalPartition) { connect(actionNodalPartition, SIGNAL(triggered()),this, SLOT(create_nodal_partition())); } actionDualPartition = new QAction( - #ifdef CGAL_USE_SURFACE_MESH - tr("Create a Dual Graph Based Partition for a Surface Mesh") - #else - tr("Create a Dual Graph Based Partition for a Polyhedron") - #endif + tr("Create a Dual Graph Based Partition") , mw); if(actionDualPartition) { connect(actionDualPartition, SIGNAL(triggered()),this, SLOT(create_dual_partition())); @@ -113,11 +95,9 @@ private: return; int nparts = dialog->nparts_spinBox->value(); QApplication::setOverrideCursor(Qt::WaitCursor); -#ifdef CGAL_USE_SURFACE_MESH item->face_graph()->collect_garbage(); item->color_vector().clear(); -#endif - if(!item->isItemMulticolor()) + if(!item->hasPatchIds()) item->setItemIsMulticolor(true); typedef boost::property_map >::type PatchIDMap; FaceGraph* fg =item->face_graph(); diff --git a/Polyhedron/demo/Polyhedron/Plugins/Operations_on_polyhedra/Point_set_from_vertices_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Operations_on_polyhedra/Point_set_from_vertices_plugin.cpp index 04873429129..5da488fe4e8 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Operations_on_polyhedra/Point_set_from_vertices_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Operations_on_polyhedra/Point_set_from_vertices_plugin.cpp @@ -7,7 +7,6 @@ #include "Scene_points_with_normal_item.h" #include "Scene_surface_mesh_item.h" -#include "Scene_polyhedron_item.h" #include "Scene_polygon_soup_item.h" #include @@ -30,8 +29,7 @@ public: const CGAL::Three::Scene_interface::Item_id index = scene->mainSelectionIndex(); return qobject_cast(scene->item(index)) - || qobject_cast(scene->item(index)) - || qobject_cast(scene->item(index)); + || qobject_cast(scene->item(index)); } QList actions() const; @@ -88,14 +86,7 @@ void Polyhedron_demo_point_set_from_vertices_plugin::createPointSet() { apply(sm_item); } - Scene_polyhedron_item* poly_item = - qobject_cast(scene->item(index)); - - if (poly_item) - { - apply(poly_item); - } - + Scene_polygon_soup_item* soup_item = qobject_cast(scene->item(index)); diff --git a/Polyhedron/demo/Polyhedron/Plugins/Operations_on_polyhedra/Surface_mesh_to_polyhedron_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Operations_on_polyhedra/Surface_mesh_to_polyhedron_plugin.cpp deleted file mode 100644 index 68dbcdfaff6..00000000000 --- a/Polyhedron/demo/Polyhedron/Plugins/Operations_on_polyhedra/Surface_mesh_to_polyhedron_plugin.cpp +++ /dev/null @@ -1,90 +0,0 @@ -#include "Scene_polyhedron_item.h" -#include "Scene_surface_mesh_item.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -using namespace CGAL::Three; -class Surface_mesh_to_polyhedron_plugin : - public QObject, - public Polyhedron_demo_plugin_interface -{ - Q_OBJECT - Q_INTERFACES(CGAL::Three::Polyhedron_demo_plugin_interface) - Q_PLUGIN_METADATA(IID "com.geometryfactory.PolyhedronDemo.PluginInterface/1.0") - -public: - - void init(QMainWindow* mw, - Scene_interface* scene_interface, - Messages_interface* ) - { - scene = scene_interface; - this->mw = mw; - QAction *actionToPoly = new QAction("Convert to Polyhedron", mw); - QAction *actionToSM = new QAction("Convert to Surface_mesh", mw); - actionToPoly->setProperty("subMenuName", - "BGL"); - actionToSM->setProperty("subMenuName", - "BGL"); - - connect(actionToPoly, SIGNAL(triggered()), this, SLOT(on_actionToPoly_triggered())); - connect(actionToSM, SIGNAL(triggered()), this, SLOT(on_actionToSM_triggered())); - _actions<< actionToPoly - << actionToSM; - - } - - bool applicable(QAction* action) const { - if(action == _actions.first()) - return qobject_cast(scene->item(scene->mainSelectionIndex())); - else - return qobject_cast(scene->item(scene->mainSelectionIndex())); - } - - QList actions() const { - return _actions; - } - -private: - Scene_interface* scene; - QList _actions; - QMainWindow* mw; - -public Q_SLOTS: - void on_actionToPoly_triggered() - { - Scene_surface_mesh_item* sm_item = qobject_cast(scene->item(scene->mainSelectionIndex())); - if(!sm_item) - return; - Polyhedron* polyhedron = new Polyhedron(); - CGAL::copy_face_graph(*sm_item->polyhedron(), *polyhedron); - Scene_polyhedron_item* poly_item = new Scene_polyhedron_item(polyhedron); - poly_item->setColor(sm_item->color()); - poly_item->setName(sm_item->name()); - sm_item->setVisible(false); - scene->addItem(poly_item); - } - - void on_actionToSM_triggered() - { - Scene_polyhedron_item* poly_item = qobject_cast(scene->item(scene->mainSelectionIndex())); - if(!poly_item) - return; - SMesh* sm = new SMesh(); - CGAL::copy_face_graph(*poly_item->polyhedron(), *sm); - Scene_surface_mesh_item* sm_item = new Scene_surface_mesh_item(sm); - sm_item->setColor(poly_item->color()); - sm_item->setName(poly_item->name()); - poly_item->setVisible(false); - scene->addItem(sm_item); - } -}; // end class Surface_mesh_to_polyhedron_plugin - -#include "Surface_mesh_to_polyhedron_plugin.moc" diff --git a/Polyhedron/demo/Polyhedron/Plugins/PCA/Affine_transform_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PCA/Affine_transform_plugin.cpp index 0d7445f7796..2f7e9f7b8e1 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PCA/Affine_transform_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PCA/Affine_transform_plugin.cpp @@ -3,12 +3,8 @@ #include #include #include -#ifdef CGAL_USE_SURFACE_MESH +#include #include "Scene_surface_mesh_item.h" -#else -#include "Polyhedron_type.h" -#include "Scene_polyhedron_item.h" -#endif #include "Scene_facegraph_transform_item.h" #include "Scene_points_with_normal_item.h" @@ -19,16 +15,14 @@ #include #include #include +#include #include #include #include #include "ui_Transformation_widget.h" -#ifdef CGAL_USE_SURFACE_MESH +#include "ui_MeshOnGrid_dialog.h" typedef Scene_surface_mesh_item Facegraph_item; -#else -typedef Scene_polyhedron_item Facegraph_item; -#endif class Scene_transform_point_set_item : public Scene_item @@ -173,17 +167,22 @@ public: Polyhedron_demo_affine_transform_plugin():started(false){} QList actions() const { - return QList() << actionTransformPolyhedron; + return QList() << actionTransformPolyhedron + << actionMeshOnGrid; } - bool applicable(QAction*) const { - return qobject_cast(scene->item(scene->mainSelectionIndex())) - || qobject_cast(scene->item(scene->mainSelectionIndex())) - #ifdef CGAL_USE_SURFACE_MESH - || qobject_cast(scene->item(scene->mainSelectionIndex())) - || qobject_cast(scene->item(scene->mainSelectionIndex())) - #endif - ; + + + bool applicable(QAction* a) const { + if(a == actionMeshOnGrid) + { + return qobject_cast(scene->item(scene->mainSelectionIndex())); + } + else + return qobject_cast(scene->item(scene->mainSelectionIndex())) + || qobject_cast(scene->item(scene->mainSelectionIndex())) + || qobject_cast(scene->item(scene->mainSelectionIndex())) + || qobject_cast(scene->item(scene->mainSelectionIndex())); } void init(QMainWindow* _mw, CGAL::Three::Scene_interface* scene_interface, Messages_interface*) { @@ -196,13 +195,15 @@ public: mw = _mw; this->scene = scene_interface; + actionMeshOnGrid = new QAction( + tr("Create a Grid of Surface Meshes") + , mw); + if(actionMeshOnGrid) { + connect(actionMeshOnGrid, SIGNAL(triggered()),this, SLOT(grid())); + } actionTransformPolyhedron = new QAction( - #ifdef CGAL_USE_SURFACE_MESH - tr("Affine Transformation for Surface Mesh") - #else - tr("Affine Transformation for Polyhedron") - #endif + tr("Affine Transformation") , mw); if(actionTransformPolyhedron) { connect(actionTransformPolyhedron, SIGNAL(triggered()),this, SLOT(go())); @@ -211,19 +212,11 @@ public: transform_points_item = NULL; dock_widget = new QDockWidget( - #ifdef CGAL_USE_SURFACE_MESH - tr("Affine Transformation for Surface Mesh") - #else - tr("Affine Transformation for Polyhedron") - #endif + tr("Affine Transformation") , mw); ui.setupUi(dock_widget); dock_widget->setWindowTitle(tr( - #ifdef CGAL_USE_SURFACE_MESH - "Affine Transformation for Surface Mesh" - #else - "Affine Transformation for Polyhedron" - #endif + "Affine Transformation" )); addDockWidget(dock_widget); dock_widget->hide(); @@ -249,9 +242,7 @@ public: } void start(FaceGraph *facegraph, const QString name, const Scene_item::Bbox&); -#ifdef CGAL_USE_SURFACE_MESH void start(Scene_points_with_normal_item*); -#endif void end(); void closure() { @@ -259,10 +250,10 @@ public: } private: - QDockWidget* dock_widget; Ui::TransformationWidget ui; QAction* actionTransformPolyhedron; + QAction* actionMeshOnGrid; Scene_facegraph_transform_item* transform_item; Scene_transform_point_set_item* transform_points_item; CGAL::Three::Scene_interface::Item_id tr_item_index; @@ -306,6 +297,7 @@ private: template void normalize(Item*); public Q_SLOTS: + void grid(); void go(); void transformed_killed(); @@ -388,32 +380,96 @@ public Q_SLOTS: }; // end class Polyhedron_demo_affine_transform_plugin +class GridDialog : + public QDialog, + public Ui::GridDialog +{ + Q_OBJECT +public: + GridDialog(QWidget* =0) + { + setupUi(this); + } +}; + +void Polyhedron_demo_affine_transform_plugin::grid() +{ + Facegraph_item* item = + qobject_cast(scene->item(scene->mainSelectionIndex())); + if(!item) + return; + + + FaceGraph m = *item->face_graph(); + + Scene_item::Bbox b = item->bbox(); + + + double x_t(CGAL::sqrt(CGAL::squared_distance(Kernel::Point_3(b.min(0), b.min(1), b.min(2)), + Kernel::Point_3(b.max(0), b.min(1), b.min(2))))), + y_t(CGAL::sqrt(CGAL::squared_distance(Kernel::Point_3(b.min(0), b.min(1), b.min(2)), + Kernel::Point_3(b.min(0), b.max(1), b.min(2))))), + z_t(CGAL::sqrt(CGAL::squared_distance(Kernel::Point_3(b.min(0), b.min(1), b.min(2)), + Kernel::Point_3(b.min(0), b.min(1), b.max(2))))); + + GridDialog dialog(mw); + dialog.x_space_doubleSpinBox->setValue(x_t); + dialog.y_space_doubleSpinBox->setValue(y_t); + dialog.z_space_doubleSpinBox->setValue(z_t); + if(!dialog.exec()) + return; + QApplication::setOverrideCursor(Qt::WaitCursor); + int i_max=dialog.x_spinBox->value(), + j_max=dialog.y_spinBox->value(), + k_max=dialog.z_spinBox->value(); + x_t = dialog.x_space_doubleSpinBox->value(); + y_t = dialog.y_space_doubleSpinBox->value(); + z_t = dialog.z_space_doubleSpinBox->value(); + + for(int i = 0; i < i_max; ++i) + { + for(int j = 0; j< j_max; ++j) + { + for(int k = 0; k< k_max; ++k) + { + FaceGraph e; + CGAL::copy_face_graph(m,e); + + Kernel::Aff_transformation_3 trans(CGAL::TRANSLATION, Kernel::Vector_3(i*x_t,j*y_t,k*z_t)); + CGAL::Polygon_mesh_processing::transform(trans, e); + Facegraph_item* t_item = new Facegraph_item(e); + t_item->setName(tr("%1 %2%3%4") + .arg(item->name()) + .arg(i) + .arg(j) + .arg(k)); + scene->addItem(t_item); + } + } + } + QApplication::restoreOverrideCursor(); +} void Polyhedron_demo_affine_transform_plugin::go(){ if (!started){ Scene_item* item = scene->item(scene->mainSelectionIndex()); -#ifdef CGAL_USE_SURFACE_MESH Scene_points_with_normal_item* points_item = NULL; -#endif Facegraph_item* poly_item = qobject_cast(item); if(!poly_item) { -#ifdef CGAL_USE_SURFACE_MESH points_item = qobject_cast(item); if(!points_item) -#endif return; } dock_widget->show(); + dock_widget->raise(); started=true; actionTransformPolyhedron->setText("Apply affine transformation"); if(poly_item) { start(poly_item->polyhedron(), poly_item->name(), poly_item->bbox()); } -#ifdef CGAL_USE_SURFACE_MESH else if(points_item) start(points_item); -#endif } else end(); @@ -454,7 +510,7 @@ void Polyhedron_demo_affine_transform_plugin::start(FaceGraph *facegraph, const scene->setSelectedItem(tr_item_index); resetTransformMatrix(); } -#ifdef CGAL_USE_SURFACE_MESH + void Polyhedron_demo_affine_transform_plugin::start(Scene_points_with_normal_item* points_item){ QApplication::setOverrideCursor(Qt::PointingHandCursor); @@ -482,7 +538,7 @@ void Polyhedron_demo_affine_transform_plugin::start(Scene_points_with_normal_ite scene->setSelectedItem(tr_item_index); resetTransformMatrix(); } -#endif + void Polyhedron_demo_affine_transform_plugin::end(){ QApplication::restoreOverrideCursor(); @@ -519,7 +575,6 @@ void Polyhedron_demo_affine_transform_plugin::end(){ delete transform_item; transform_item = NULL; } -#ifdef CGAL_USE_SURFACE_MESH else if(transform_points_item) { const Point_set *base_ps = transform_points_item->getBase()->point_set(); @@ -544,7 +599,6 @@ void Polyhedron_demo_affine_transform_plugin::end(){ delete transform_points_item; transform_points_item = NULL; } -#endif dock_widget->hide(); } diff --git a/Polyhedron/demo/Polyhedron/Plugins/PCA/Basic_generator_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PCA/Basic_generator_plugin.cpp index c3b3f4f15ef..e5242bd41bf 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PCA/Basic_generator_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PCA/Basic_generator_plugin.cpp @@ -10,7 +10,6 @@ #include #include #include -#include "Scene_polyhedron_item.h" #include "Scene_surface_mesh_item.h" #include "Scene_points_with_normal_item.h" #include "Scene_polylines_item.h" @@ -49,13 +48,19 @@ public : { this->scene = scene_interface; this->mw = mainWindow; - for(int i=0; ifindChild("menuFile"); - QMenu* menu = new QMenu(tr("&Objet Generator Widget"), menuFile); - QAction* actionLoad = mw->findChild("actionLoadPlugin"); + + QMenu* menu = menuFile->findChild("menuGenerateObject"); + if(!menu){ + QAction* actionLoad = mw->findChild("actionLoadPlugin"); + menu = new QMenu(tr("Generate &Objet"), menuFile); + menu->setObjectName("menuGenerateObject"); + menuFile->insertMenu(actionLoad, menu); + } QAction* actionPrism = new QAction("P&rism", mw); @@ -102,12 +107,10 @@ public : this, SLOT(on_actionPolyline_triggered())); _actions << actionPolyline; - menu->clear(); Q_FOREACH(QAction* action, _actions) { menu->addAction(action); } - menuFile->insertMenu(actionLoad, menu); dock_widget = new GeneratorWidget("Basic Objets", mw); dock_widget->setVisible(false); // do not show at the beginning addDockWidget(dock_widget); @@ -179,42 +182,42 @@ private: //show the widget void Basic_generator_plugin::on_actionPrism_triggered() { - dock_widget->show(); + dock_widget->show(); dock_widget->raise(); dock_widget->selector_tabWidget->tabBar()->setCurrentIndex(PRISM); } void Basic_generator_plugin::on_actionSphere_triggered() { - dock_widget->show(); + dock_widget->show(); dock_widget->raise(); dock_widget->selector_tabWidget->tabBar()->setCurrentIndex(SPHERE); } void Basic_generator_plugin::on_actionPyramid_triggered() { - dock_widget->show(); + dock_widget->show(); dock_widget->raise(); dock_widget->selector_tabWidget->tabBar()->setCurrentIndex(PYRAMID); } void Basic_generator_plugin::on_actionHexahedron_triggered() { - dock_widget->show(); + dock_widget->show(); dock_widget->raise(); dock_widget->selector_tabWidget->tabBar()->setCurrentIndex(HEXAHEDRON); } void Basic_generator_plugin::on_actionTetrahedron_triggered() { - dock_widget->show(); + dock_widget->show(); dock_widget->raise(); dock_widget->selector_tabWidget->tabBar()->setCurrentIndex(TETRAHEDRON); } void Basic_generator_plugin::on_actionGrid_triggered() { - dock_widget->show(); + dock_widget->show(); dock_widget->raise(); dock_widget->selector_tabWidget->tabBar()->setCurrentIndex(GRID); } void Basic_generator_plugin::on_actionPointSet_triggered() { - dock_widget->show(); + dock_widget->show(); dock_widget->raise(); dock_widget->selector_tabWidget->tabBar()->setCurrentIndex(POINT_SET); } void Basic_generator_plugin::on_actionPolyline_triggered() { - dock_widget->show(); + dock_widget->show(); dock_widget->raise(); dock_widget->selector_tabWidget->tabBar()->setCurrentIndex(POLYLINE); } void Basic_generator_plugin::on_tab_changed() @@ -285,53 +288,34 @@ void Basic_generator_plugin::on_tab_changed() //generate void Basic_generator_plugin::on_generate_clicked() { - bool is_polyhedron = mw->property("is_polyhedron_mode").toBool(); switch(dock_widget->selector_tabWidget->currentIndex()) { case PRISM: - if(is_polyhedron) - generatePrism(); - else - generatePrism(); + generatePrism(); ++nbs[PRISM]; break; case SPHERE: - if(is_polyhedron) - generateSphere(); - else - generateSphere(); + generateSphere(); ++nbs[SPHERE]; break; case PYRAMID: - if(is_polyhedron) - generatePyramid(); - else - generatePyramid(); + generatePyramid(); ++nbs[PYRAMID]; break; case HEXAHEDRON: - if(is_polyhedron) - generateCube(); - else - generateCube(); + generateCube(); ++nbs[HEXAHEDRON]; break; case TETRAHEDRON: - if(is_polyhedron) - generateTetrahedron(); - else - generateTetrahedron(); + generateTetrahedron(); ++nbs[TETRAHEDRON]; break; case GRID: - if(is_polyhedron) - generateGrid(); - else - generateGrid(); + generateGrid(); ++nbs[GRID]; break; case POINT_SET: @@ -569,7 +553,7 @@ void Basic_generator_plugin::generateSphere() //emplace the points back on the sphere BOOST_FOREACH(typename boost::graph_traits::vertex_descriptor vd, vertices(sphere)) { - Kernel::Vector_3 vec(get(vpmap, vd), center); + Kernel::Vector_3 vec(center, get(vpmap, vd)); vec = radius*vec/CGAL::sqrt(vec.squared_length()); put(vpmap, vd, Kernel::Point_3(center.x() + vec.x(), center.y() + vec.y(), @@ -758,11 +742,11 @@ struct Point_generator const Point& ur) :w(w), h(h), bl(bl), ur(ur) {} - Point operator()(std::size_t i, std::size_t j, std::size_t k) const + Point operator()(std::size_t i, std::size_t j) const { return Point(bl.x() + i*(ur.x()-bl.x())/(w-1), bl.y() + j*(ur.y()-bl.y())/(h-1), - k); + 0); } }; template diff --git a/Polyhedron/demo/Polyhedron/Plugins/PCA/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/PCA/CMakeLists.txt index 978cbfa2c0b..0f2692d32b9 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PCA/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/PCA/CMakeLists.txt @@ -1,25 +1,22 @@ include( polyhedron_demo_macros ) polyhedron_demo_plugin(pca_plugin Pca_plugin) -target_link_libraries(pca_plugin PUBLIC scene_polyhedron_item scene_surface_mesh_item scene_points_with_normal_item scene_basic_objects) +target_link_libraries(pca_plugin PUBLIC scene_surface_mesh_item scene_points_with_normal_item scene_basic_objects) -qt5_wrap_ui( transformUI_FILES Transformation_widget.ui ) +qt5_wrap_ui( transformUI_FILES Transformation_widget.ui MeshOnGrid_dialog.ui) polyhedron_demo_plugin(affine_transform_plugin Affine_transform_plugin ${transformUI_FILES}) -target_link_libraries(affine_transform_plugin PUBLIC scene_polyhedron_item scene_polyhedron_transform_item scene_points_with_normal_item) -polyhedron_demo_plugin(affine_transform_sm_plugin Affine_transform_plugin ${transformUI_FILES}) -target_link_libraries(affine_transform_sm_plugin PUBLIC scene_surface_mesh_item scene_sm_transform_item scene_points_with_normal_item) -target_compile_definitions(affine_transform_sm_plugin PUBLIC "-DCGAL_USE_SURFACE_MESH" ) +target_link_libraries(affine_transform_plugin PUBLIC scene_surface_mesh_item scene_transform_item scene_points_with_normal_item) polyhedron_demo_plugin(edit_box_plugin Edit_box_plugin) -target_link_libraries(edit_box_plugin PUBLIC scene_edit_box_item scene_surface_mesh_item scene_polyhedron_item) +target_link_libraries(edit_box_plugin PUBLIC scene_edit_box_item scene_surface_mesh_item ) qt5_wrap_ui( clipUI_FILES Clipping_box_widget.ui ) polyhedron_demo_plugin(clipping_box_plugin Clipping_box_plugin ${clipUI_FILES}) -target_link_libraries(clipping_box_plugin PUBLIC scene_edit_box_item ) +target_link_libraries(clipping_box_plugin PUBLIC scene_edit_box_item scene_basic_objects) polyhedron_demo_plugin(create_bbox_mesh_plugin Create_bbox_mesh_plugin) -target_link_libraries(create_bbox_mesh_plugin PUBLIC scene_surface_mesh_item scene_polyhedron_item) +target_link_libraries(create_bbox_mesh_plugin PUBLIC scene_surface_mesh_item) qt5_wrap_ui( volumesUI_FILES Basic_generator_widget.ui) polyhedron_demo_plugin(basic_generator_plugin Basic_generator_plugin ${volumesUI_FILES}) -target_link_libraries(basic_generator_plugin PUBLIC scene_surface_mesh_item scene_polyhedron_item scene_points_with_normal_item scene_polylines_item) +target_link_libraries(basic_generator_plugin PUBLIC scene_surface_mesh_item scene_points_with_normal_item scene_polylines_item) diff --git a/Polyhedron/demo/Polyhedron/Plugins/PCA/Clipping_box_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PCA/Clipping_box_plugin.cpp index 4dde5cd50e2..500e94cf320 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PCA/Clipping_box_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PCA/Clipping_box_plugin.cpp @@ -4,6 +4,7 @@ #include #include "Scene_edit_box_item.h" #include +#include #include #include #include @@ -13,6 +14,8 @@ #include #include #include +#include "Selection_visualizer.h" +#include "Scene_plane_item.h" class ClipWidget : public QDockWidget, @@ -52,10 +55,14 @@ public Q_SLOTS: void enableAction(); void clipbox(); void clip(bool); + void tab_change(); private: + bool eventFilter(QObject *, QEvent *); QAction* actionClipbox; ClipWidget* dock_widget; Scene_edit_box_item* item; + bool shift_pressing; + Selection_visualizer* visualizer; }; // end Clipping_box_plugin void Clipping_box_plugin::init(QMainWindow* mainWindow, CGAL::Three::Scene_interface* scene_interface, Messages_interface*) @@ -71,7 +78,12 @@ void Clipping_box_plugin::init(QMainWindow* mainWindow, CGAL::Three::Scene_inter addDockWidget(dock_widget); connect(dock_widget->pushButton, SIGNAL(toggled(bool)), this, SLOT(clip(bool))); + + CGAL::QGLViewer* viewer = *CGAL::QGLViewer::QGLViewerPool().begin(); + viewer->installEventFilter(this); item = NULL; + visualizer = NULL; + shift_pressing = false; } void Clipping_box_plugin::clipbox() @@ -83,7 +95,8 @@ void Clipping_box_plugin::clipbox() return; } QApplication::setOverrideCursor(Qt::WaitCursor); -dock_widget->show(); + dock_widget->show(); + dock_widget->raise(); if(!item) item = new Scene_edit_box_item(scene); connect(item, SIGNAL(destroyed()), @@ -94,6 +107,16 @@ dock_widget->show(); clip(false); dock_widget->pushButton->setChecked(false); }); + connect(dock_widget->unclipButton, &QPushButton::clicked, + this, [this](){ + dock_widget->unclipButton->setDisabled(true); + CGAL::Three::Viewer_interface* viewer = static_cast( + *CGAL::QGLViewer::QGLViewerPool().begin()); + viewer->disableClippingBox(); + viewer->update(); + }); + connect(dock_widget->tabWidget, &QTabWidget::currentChanged, + this, &Clipping_box_plugin::tab_change); item->setName("Clipping box"); item->setRenderingMode(FlatPlusEdges); CGAL::QGLViewer* viewer = *CGAL::QGLViewer::QGLViewerPool().begin(); @@ -162,4 +185,151 @@ void Clipping_box_plugin::clip(bool b) viewer->update(); } +void Clipping_box_plugin::tab_change() +{ + CGAL::Three::Viewer_interface* viewer = static_cast( + *CGAL::QGLViewer::QGLViewerPool().begin()); + if(dock_widget->tabWidget->currentIndex() == 1) + { + if(item) + { + scene->erase(scene->item_id(item)); + item = NULL; + } + viewer->SetOrthoProjection(true); + } + else + { + viewer->SetOrthoProjection(false); + clipbox(); + } + +} + +bool Clipping_box_plugin::eventFilter(QObject *, QEvent *event) { + static QImage background; + if (dock_widget->isHidden() || !(dock_widget->isActiveWindow()) || dock_widget->tabWidget->currentIndex() != 1) + return false; + + if(event->type() == QEvent::KeyPress || event->type() == QEvent::KeyRelease) + { + QKeyEvent *keyEvent = static_cast(event); + Qt::KeyboardModifiers modifiers = keyEvent->modifiers(); + + shift_pressing = modifiers.testFlag(Qt::ShiftModifier); + } + CGAL::Three::Viewer_interface* viewer = static_cast( + *CGAL::QGLViewer::QGLViewerPool().begin()); + // mouse events + if(shift_pressing && event->type() == QEvent::MouseButtonPress) + { + background = static_cast(viewer)->grabFramebuffer(); + + QMouseEvent *mouseEvent = static_cast(event); + // Start selection + if (mouseEvent->button() == Qt::LeftButton) + { + // Start standard selection + if (!visualizer) + { + QApplication::setOverrideCursor(Qt::CrossCursor); + if (viewer->camera()->frame()->isSpinning()) + viewer->camera()->frame()->stopSpinning(); + + visualizer = new Selection_visualizer(true, + scene->bbox()); + + visualizer->sample_mouse_path(background); + return true; + } + } + // Cancel selection + else if (mouseEvent->button() == Qt::RightButton && visualizer) + { + visualizer = NULL; + QApplication::restoreOverrideCursor(); + return true; + } + } + // End selection + else if (event->type() == QEvent::MouseButtonRelease && visualizer) + { + visualizer->apply_path(); + //clip here + typedef CGAL::Epick Kernel; + typedef Kernel::Point_2 Point_2; + typedef Kernel::Point_3 Point_3; + QVector4D planes[6]; + GLdouble coefs[6][4]; + viewer->camera()->getFrustumPlanesCoefficients(coefs); + + Kernel::Plane_3 plane(coefs[2][0], coefs[2][1], coefs[2][2], -coefs[2][3]); + planes[0] = QVector4D(plane.a(), plane.b(), plane.c(), plane.d()); + plane = Kernel::Plane_3(coefs[3][0], coefs[3][1], coefs[3][2],- coefs[3][3]); + planes[1] = QVector4D(plane.a(), plane.b(), plane.c(), plane.d()); + + Kernel::Vector_3 right_vector(viewer->camera()->rightVector().x, + viewer->camera()->rightVector().y, + viewer->camera()->rightVector().z); + + Kernel::Vector_3 front_vector(viewer->camera()->viewDirection().x, + viewer->camera()->viewDirection().y, + viewer->camera()->viewDirection().z); + + Kernel::Vector_3 up_vector = CGAL::cross_product(right_vector, front_vector); + + Point_2 left_point(visualizer->domain_rectangle.xmin(), + visualizer->domain_rectangle.ymin()); + Point_2 right_point(visualizer->domain_rectangle.xmax(), + visualizer->domain_rectangle.ymax()); + + CGAL::qglviewer::Vec left_vec = viewer->camera()->unprojectedCoordinatesOf(CGAL::qglviewer::Vec( + left_point.x(), + left_point.y(), + 0)); + CGAL::qglviewer::Vec right_vec = viewer->camera()->unprojectedCoordinatesOf(CGAL::qglviewer::Vec( + right_point.x(), + right_point.y(), + 0)); + plane = Kernel::Plane_3(Point_3(left_vec.x, left_vec.y, left_vec.z), + -right_vector); + planes[2] = QVector4D(plane.a(), + plane.b(), + plane.c(), + plane.d()); + plane = Kernel::Plane_3(Point_3(left_vec.x, left_vec.y, left_vec.z), + up_vector); + planes[3] = QVector4D(plane.a(), + plane.b(), + plane.c(), + plane.d()); + plane = Kernel::Plane_3(Point_3(right_vec.x, right_vec.y, right_vec.z), + right_vector); + planes[4] = QVector4D(plane.a(), + plane.b(), + plane.c(), + plane.d()); + plane = Kernel::Plane_3(Point_3(right_vec.x, right_vec.y, right_vec.z), + -up_vector); + planes[5] = QVector4D(plane.a(), + plane.b(), + plane.c(), + plane.d()); + + viewer->enableClippingBox(planes); + dock_widget->unclipButton->setEnabled(true); + visualizer = NULL; + QApplication::restoreOverrideCursor(); + static_cast(viewer)->set2DSelectionMode(false); + viewer->update(); + return true; + } + // Update selection + else if (event->type() == QEvent::MouseMove && visualizer) + { + visualizer->sample_mouse_path(background); + return true; + } + return false; +} #include "Clipping_box_plugin.moc" diff --git a/Polyhedron/demo/Polyhedron/Plugins/PCA/Clipping_box_widget.ui b/Polyhedron/demo/Polyhedron/Plugins/PCA/Clipping_box_widget.ui index 352a677c63d..24524649170 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PCA/Clipping_box_widget.ui +++ b/Polyhedron/demo/Polyhedron/Plugins/PCA/Clipping_box_widget.ui @@ -6,51 +6,142 @@ 0 0 - 219 - 62 + 282 + 171 Clipping Box - + - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Clip - - - true + + + 0 + + + Box + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Clip + + + true + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + Orthographic + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + false + + + Unclip + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + - - - - Qt::Horizontal - - - - 40 - 20 - - - - diff --git a/Polyhedron/demo/Polyhedron/Plugins/PCA/Create_bbox_mesh_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PCA/Create_bbox_mesh_plugin.cpp index 3aba3fbb967..0abe7a5a031 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PCA/Create_bbox_mesh_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PCA/Create_bbox_mesh_plugin.cpp @@ -5,11 +5,10 @@ #include #include +#include #include -#include "Scene_polyhedron_item.h" #include "Scene_surface_mesh_item.h" -#include "Polyhedron_type.h" #include @@ -33,18 +32,28 @@ public: return false;} protected: - void bbox(bool extended = false); + bool bbox(bool extended = false); public Q_SLOTS: void createBbox() { QApplication::setOverrideCursor(Qt::WaitCursor); - bbox(); - QApplication::restoreOverrideCursor(); + if(!bbox()) + { + QApplication::restoreOverrideCursor(); + QMessageBox::warning(mw, "Error", "Bbox couldn't be computed, so there is no mesh created."); + } + else + QApplication::restoreOverrideCursor(); } void createExtendedBbox() { QApplication::setOverrideCursor(Qt::WaitCursor); - bbox(true); - QApplication::restoreOverrideCursor(); + if(!bbox(true)) + { + QApplication::restoreOverrideCursor(); + QMessageBox::warning(mw, "Error", "Bbox couldn't be computed, so there is no mesh created."); + } + else + QApplication::restoreOverrideCursor(); } private: @@ -73,11 +82,11 @@ QList Create_bbox_mesh_plugin::actions() const { return QList() << actionBbox << actionExtendedBbox; } -void Create_bbox_mesh_plugin::bbox(bool extended) +bool Create_bbox_mesh_plugin::bbox(bool extended) { Scene_interface::Bbox bbox; bool initialized = false; - + Q_FOREACH(int index, scene->selectionIndices()) { Scene_item* item = scene->item(index); if(item->isFinite() && ! item->isEmpty()) { @@ -93,36 +102,36 @@ void Create_bbox_mesh_plugin::bbox(bool extended) << "\n " << bbox.ymax() - bbox.ymin() << "\n " << bbox.zmax() - bbox.zmin() << std::endl; - + if(extended) { const double delta_x = ( bbox.xmax() - bbox.xmin() ) / 20.; const double delta_y = ( bbox.ymax() - bbox.ymin() ) / 20.; const double delta_z = ( bbox.zmax() - bbox.zmin() ) / 20.; -bbox = Scene_interface::Bbox( - bbox.xmin() - delta_x, - bbox.ymin() - delta_y, - bbox.zmin() - delta_z, - bbox.xmax() + delta_x, - bbox.ymax() + delta_y, - bbox.zmax() + delta_z); + bbox = Scene_interface::Bbox( + bbox.xmin() - delta_x, + bbox.ymin() - delta_y, + bbox.zmin() - delta_z, + bbox.xmax() + delta_x, + bbox.ymax() + delta_y, + bbox.zmax() + delta_z); } - Scene_item* item; - Kernel::Iso_cuboid_3 ic(bbox); - if(mw->property("is_polyhedorn_mode").toBool()){ - Polyhedron* p = new Polyhedron; - CGAL::make_hexahedron(ic[0], ic[1], ic[2], ic[3], ic[4], ic[5], ic[6], ic[7],*p); - item = new Scene_polyhedron_item(p); - } else { - SMesh* p = new SMesh; - CGAL::make_hexahedron(ic[0], ic[1], ic[2], ic[3], ic[4], ic[5], ic[6], ic[7],*p); - - item = new Scene_surface_mesh_item(p); + if(bbox.min(0) > bbox.max(0) || + bbox.min(1) > bbox.max(1) || + bbox.min(2) > bbox.max(2)) + { + return false; } - + Scene_item* item; + EPICK::Iso_cuboid_3 ic(bbox); + SMesh* p = new SMesh; + CGAL::make_hexahedron(ic[0], ic[1], ic[2], ic[3], ic[4], ic[5], ic[6], ic[7],*p); + + item = new Scene_surface_mesh_item(p); item->setName("Scene bbox mesh"); item->setRenderingMode(Wireframe); scene->addItem(item); + return true; } #include "Create_bbox_mesh_plugin.moc" diff --git a/Polyhedron/demo/Polyhedron/Plugins/PCA/Edit_box_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PCA/Edit_box_plugin.cpp index bee21b495b2..86aab788cc9 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PCA/Edit_box_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PCA/Edit_box_plugin.cpp @@ -3,7 +3,6 @@ #include #include #include "Scene_edit_box_item.h" -#include "Scene_polyhedron_item.h" #include "Scene_surface_mesh_item.h" #include #include @@ -102,7 +101,7 @@ void Edit_box_plugin::exportToPoly() { int id =0; const CGAL::qglviewer::Vec v_offset = static_cast(CGAL::QGLViewer::QGLViewerPool().first())->offset(); - Kernel::Vector_3 offset(v_offset.x, v_offset.y, v_offset.z); + EPICK::Vector_3 offset(v_offset.x, v_offset.y, v_offset.z); Scene_edit_box_item* item = NULL; for(int i = 0, end = scene->numberOfEntries(); i < end; ++i) @@ -115,30 +114,12 @@ void Edit_box_plugin::exportToPoly() } } - Polyhedron::Point_3 points[8]; + EPICK::Point_3 points[8]; for(int i=0; i<8; ++i) { - points[i] = Polyhedron::Point_3(item->point(i,0),item->point(i,1), item->point(i,2))-offset; + points[i] = EPICK::Point_3(item->point(i,0),item->point(i,1), item->point(i,2))-offset; } - if(mw->property("is_polyhedron_mode").toBool()){ - Scene_polyhedron_item* poly_item = new Scene_polyhedron_item(); - CGAL::make_hexahedron(points[0], - points[3], - points[2], - points[1], - points[5], - points[4], - points[7], - points[6], - *poly_item->polyhedron()); - CGAL::Polygon_mesh_processing::triangulate_faces(*poly_item->polyhedron()); - item->setName("Edit box"); - item->setRenderingMode(FlatPlusEdges); - scene->replaceItem(id, poly_item, true); - item->deleteLater(); - actionBbox->setEnabled(true); - }else{ Scene_surface_mesh_item* poly_item = new Scene_surface_mesh_item(); CGAL::make_hexahedron(points[0], points[3], @@ -155,6 +136,5 @@ void Edit_box_plugin::exportToPoly() scene->replaceItem(id, poly_item, true); item->deleteLater(); actionBbox->setEnabled(true); - } } #include "Edit_box_plugin.moc" diff --git a/Polyhedron/demo/Polyhedron/Plugins/PCA/MeshOnGrid_dialog.ui b/Polyhedron/demo/Polyhedron/Plugins/PCA/MeshOnGrid_dialog.ui new file mode 100644 index 00000000000..f4ae9f081f0 --- /dev/null +++ b/Polyhedron/demo/Polyhedron/Plugins/PCA/MeshOnGrid_dialog.ui @@ -0,0 +1,203 @@ + + + GridDialog + + + + 0 + 0 + 330 + 394 + + + + + 0 + 0 + + + + Dialog + + + + + + Along X + + + + + + 99999999999999999475366575191804932315794610450682175621941694731908308538307845136842752.000000000000000 + + + + + + + Spacing: + + + + + + + Number of items : + + + + + + + 999 + + + 2 + + + + + + + + + + Along Y + + + + + + 99999999999999999475366575191804932315794610450682175621941694731908308538307845136842752.000000000000000 + + + + + + + Spacing: + + + + + + + 999 + + + 2 + + + + + + + Number of items : + + + + + + + + + + Along Z + + + + + + 99999999999999999475366575191804932315794610450682175621941694731908308538307845136842752.000000000000000 + + + + + + + Number of items : + + + + + + + Spacing: + + + + + + + 999 + + + 2 + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + buttonBox + accepted() + GridDialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + GridDialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/Polyhedron/demo/Polyhedron/Plugins/PCA/Pca_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PCA/Pca_plugin.cpp index 38e42cd3df2..e56af0979ad 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PCA/Pca_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PCA/Pca_plugin.cpp @@ -1,11 +1,9 @@ #include #include #include -#include "Scene_polyhedron_item.h" #include "Scene_surface_mesh_item.h" #include "Scene_points_with_normal_item.h" #include "Scene_plane_item.h" -#include "Polyhedron_type.h" #include @@ -80,8 +78,7 @@ public: bool applicable(QAction*) const { - return qobject_cast(scene->item(scene->mainSelectionIndex())) || - qobject_cast(scene->item(scene->mainSelectionIndex())) || + return qobject_cast(scene->item(scene->mainSelectionIndex())) || qobject_cast(scene->item(scene->mainSelectionIndex())); } @@ -99,24 +96,18 @@ void Polyhedron_demo_pca_plugin::on_actionFitPlane_triggered() { const CGAL::Three::Scene_interface::Item_id index = scene->mainSelectionIndex(); - Scene_polyhedron_item* item = - qobject_cast(scene->item(index)); - - Scene_surface_mesh_item* sm_item = + Scene_surface_mesh_item* sm_item = qobject_cast(scene->item(index)); QApplication::setOverrideCursor(Qt::WaitCursor); - std::list triangles; - if(item){ - Polyhedron* pMesh = item->polyhedron(); - ::triangles(*pMesh,std::back_inserter(triangles)); - } else if(sm_item){ - SMesh* pMesh = sm_item->polyhedron(); - ::triangles(*pMesh,std::back_inserter(triangles)); - } + std::list triangles; + + SMesh* pMesh = sm_item->polyhedron(); + ::triangles(*pMesh,std::back_inserter(triangles)); + if(! triangles.empty()){ - QString item_name = (item)?item->name():sm_item->name(); + QString item_name = sm_item->name(); // fit plane to triangles Plane plane; std::cout << "Fit plane..."; @@ -133,7 +124,7 @@ void Polyhedron_demo_pca_plugin::on_actionFitPlane_triggered() new_item->setNormal(normal.x(), normal.y(), normal.z()); new_item->setName(tr("%1 (plane fit)").arg(item_name)); new_item->setColor(Qt::magenta); - new_item->setRenderingMode((item)?item->renderingMode():sm_item->renderingMode()); + new_item->setRenderingMode(sm_item->renderingMode()); scene->addItem(new_item); } @@ -176,27 +167,19 @@ void Polyhedron_demo_pca_plugin::on_actionFitLine_triggered() { const CGAL::Three::Scene_interface::Item_id index = scene->mainSelectionIndex(); - Scene_polyhedron_item* item = - qobject_cast(scene->item(index)); - Scene_surface_mesh_item* sm_item = qobject_cast(scene->item(index)); QApplication::setOverrideCursor(Qt::WaitCursor); CGAL::Bbox_3 bb; - - std::list triangles; - if(item){ - Polyhedron* pMesh = item->polyhedron(); - bb = ::triangles(*pMesh,std::back_inserter(triangles)); - } else if(sm_item){ - SMesh* pMesh = sm_item->polyhedron(); - bb = ::triangles(*pMesh,std::back_inserter(triangles)); - } + + std::list triangles; + SMesh* pMesh = sm_item->polyhedron(); + bb = ::triangles(*pMesh,std::back_inserter(triangles)); if(! triangles.empty()){ - QString item_name = (item)?item->name():sm_item->name(); + QString item_name = sm_item->name(); // fit line to triangles Line line; std::cout << "Fit line..."; @@ -256,7 +239,7 @@ void Polyhedron_demo_pca_plugin::on_actionFitLine_triggered() Scene_surface_mesh_item* new_item = new Scene_surface_mesh_item(pFit); new_item->setName(tr("%1 (line fit)").arg(item_name)); new_item->setColor(Qt::magenta); - new_item->setRenderingMode((item)?item->renderingMode(): sm_item->renderingMode()); + new_item->setRenderingMode( sm_item->renderingMode()); scene->addItem(new_item); } else diff --git a/Polyhedron/demo/Polyhedron/Plugins/PCA/Scene_edit_box_item.cpp b/Polyhedron/demo/Polyhedron/Plugins/PCA/Scene_edit_box_item.cpp index 10a3b163673..baffa4ebf55 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PCA/Scene_edit_box_item.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PCA/Scene_edit_box_item.cpp @@ -517,6 +517,7 @@ void Scene_edit_box_item::drawEdges(Viewer_interface* viewer) const d->program->bind(); QVector2D vp(viewer->width(), viewer->height()); d->program->setUniformValue("viewport", vp); + d->program->setUniformValue("is_clipbox_on", false); d->program->setUniformValue("near",(GLfloat)viewer->camera()->zNear()); d->program->setUniformValue("far",(GLfloat)viewer->camera()->zFar()); d->program->setUniformValue("width", 6.0f); diff --git a/Polyhedron/demo/Polyhedron/Plugins/PCA/Scene_facegraph_transform_item.cpp b/Polyhedron/demo/Polyhedron/Plugins/PCA/Scene_facegraph_transform_item.cpp index cc0759ff61c..63030b390ee 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PCA/Scene_facegraph_transform_item.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PCA/Scene_facegraph_transform_item.cpp @@ -1,6 +1,5 @@ #include #include "Scene_facegraph_transform_item.h" -#include "Polyhedron_type.h" #include struct Scene_facegraph_transform_item_priv diff --git a/Polyhedron/demo/Polyhedron/Plugins/PCA/Scene_facegraph_transform_item.h b/Polyhedron/demo/Polyhedron/Plugins/PCA/Scene_facegraph_transform_item.h index 5bf5f8de84e..f2fa1fba7bf 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PCA/Scene_facegraph_transform_item.h +++ b/Polyhedron/demo/Polyhedron/Plugins/PCA/Scene_facegraph_transform_item.h @@ -4,14 +4,10 @@ #include "Scene_facegraph_transform_item_config.h" #include "Kernel_type.h" -#ifdef CGAL_USE_SURFACE_MESH #include #include #include #include -#else -#include "Scene_polyhedron_item.h" -#endif #include #include @@ -22,11 +18,7 @@ using namespace CGAL::Three; struct Scene_facegraph_transform_item_priv; -#ifdef CGAL_USE_SURFACE_MESH typedef CGAL::Surface_mesh FaceGraph; -#else -typedef Polyhedron FaceGraph; -#endif // This class represents a polyhedron in the OpenGL scene class SCENE_FACEGRAPH_TRANSFORM_ITEM_EXPORT Scene_facegraph_transform_item : public Scene_item { diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/PMP/CMakeLists.txt index a626bc567d9..9be832c313a 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/CMakeLists.txt @@ -2,7 +2,7 @@ include( polyhedron_demo_macros ) if(EIGEN3_FOUND) polyhedron_demo_plugin(jet_fitting_plugin Jet_fitting_plugin) - target_link_libraries(jet_fitting_plugin PUBLIC scene_polyhedron_item scene_surface_mesh_item scene_polylines_item) + target_link_libraries(jet_fitting_plugin PUBLIC scene_surface_mesh_item scene_polylines_item) else(EIGEN3_FOUND) message(STATUS "NOTICE: Eigen 3.1 (or greater) was not found. Jet fitting plugin will not be available.") @@ -13,43 +13,24 @@ if(EIGEN3_FOUND) qt5_wrap_ui( hole_fillingUI_FILES Hole_filling_widget.ui) polyhedron_demo_plugin(hole_filling_plugin Hole_filling_plugin ${hole_fillingUI_FILES}) - target_link_libraries(hole_filling_plugin PUBLIC scene_polyhedron_item scene_polylines_item scene_polyhedron_selection_item) - - qt5_wrap_ui( hole_fillingUI_FILES Hole_filling_widget.ui) - polyhedron_demo_plugin(hole_filling_sm_plugin Hole_filling_plugin ${hole_fillingUI_FILES}) - target_link_libraries(hole_filling_sm_plugin PUBLIC scene_surface_mesh_item scene_polylines_item scene_surface_mesh_selection_item) - target_compile_definitions(hole_filling_sm_plugin PUBLIC "-DUSE_SURFACE_MESH" ) + target_link_libraries(hole_filling_plugin PUBLIC scene_surface_mesh_item scene_polylines_item scene_selection_item) qt5_wrap_ui( fairingUI_FILES Fairing_widget.ui) polyhedron_demo_plugin(fairing_plugin Fairing_plugin ${fairingUI_FILES}) - target_link_libraries(fairing_plugin PUBLIC scene_polyhedron_selection_item) - - polyhedron_demo_plugin(fairing_sm_plugin Fairing_plugin ${fairingUI_FILES}) - target_link_libraries(fairing_sm_plugin PUBLIC scene_surface_mesh_selection_item) - target_compile_definitions(fairing_sm_plugin PUBLIC "-DUSE_SURFACE_MESH" ) + target_link_libraries(fairing_plugin PUBLIC scene_selection_item) polyhedron_demo_plugin(hole_filling_polyline_plugin Hole_filling_polyline_plugin) - target_link_libraries(hole_filling_polyline_plugin PUBLIC scene_surface_mesh_item scene_polyhedron_item scene_polylines_item) + target_link_libraries(hole_filling_polyline_plugin PUBLIC scene_surface_mesh_item scene_polylines_item) qt5_wrap_ui( Mean_curvature_flow_skeleton_pluginUI_FILES Mean_curvature_flow_skeleton_plugin.ui) polyhedron_demo_plugin(mean_curvature_flow_skeleton_plugin Mean_curvature_flow_skeleton_plugin ${Mean_curvature_flow_skeleton_pluginUI_FILES}) - target_link_libraries(mean_curvature_flow_skeleton_plugin PUBLIC - scene_polyhedron_item - scene_points_with_normal_item - scene_polylines_item - scene_mcf_poly_item - demo_framework) - - qt5_wrap_ui( Mean_curvature_flow_skeleton_pluginUI_FILES Mean_curvature_flow_skeleton_plugin.ui) - polyhedron_demo_plugin(mean_curvature_flow_skeleton_sm_plugin Mean_curvature_flow_skeleton_plugin ${Mean_curvature_flow_skeleton_pluginUI_FILES}) - target_link_libraries(mean_curvature_flow_skeleton_sm_plugin + target_link_libraries(mean_curvature_flow_skeleton_plugin PUBLIC scene_surface_mesh_item scene_points_with_normal_item scene_polylines_item - scene_mcf_sm_item + scene_mcf_item demo_framework) - target_compile_definitions(mean_curvature_flow_skeleton_sm_plugin PUBLIC "-DUSE_SURFACE_MESH" ) else() message(STATUS "NOTICE: The hole filling and fairing plugins require Eigen 3.2 (or higher) and will not be available.") endif() @@ -59,114 +40,75 @@ endif() polyhedron_demo_plugin(orient_soup_plugin Orient_soup_plugin) -target_link_libraries(orient_soup_plugin PUBLIC scene_polygon_soup_item scene_polyhedron_item scene_surface_mesh_item scene_polylines_item scene_points_with_normal_item) +target_link_libraries(orient_soup_plugin PUBLIC scene_polygon_soup_item scene_surface_mesh_item scene_polylines_item scene_points_with_normal_item) polyhedron_demo_plugin(inside_out_plugin Inside_out_plugin) -target_link_libraries(inside_out_plugin PUBLIC scene_polyhedron_item scene_surface_mesh_item scene_polygon_soup_item) +target_link_libraries(inside_out_plugin PUBLIC scene_surface_mesh_item scene_polygon_soup_item) -polyhedron_demo_plugin(join_and_split_polyhedra_plugin Join_and_split_polyhedra_plugin) -target_link_libraries(join_and_split_polyhedra_plugin PUBLIC scene_polyhedron_item scene_polyhedron_selection_item) - -polyhedron_demo_plugin(join_and_split_sm_plugin Join_and_split_polyhedra_plugin) -target_link_libraries(join_and_split_sm_plugin PUBLIC scene_surface_mesh_item scene_surface_mesh_selection_item) -target_compile_definitions(join_and_split_sm_plugin PUBLIC "-DUSE_SURFACE_MESH") +polyhedron_demo_plugin(join_and_split_plugin Join_and_split_polyhedra_plugin) +target_link_libraries(join_and_split_plugin PUBLIC scene_surface_mesh_item scene_selection_item) qt5_wrap_ui( point_inside_polyhedronUI_FILES Point_inside_polyhedron_widget.ui) polyhedron_demo_plugin(point_inside_polyhedron_plugin Point_inside_polyhedron_plugin ${point_inside_polyhedronUI_FILES}) -target_link_libraries(point_inside_polyhedron_plugin PUBLIC scene_polyhedron_item scene_surface_mesh_item scene_points_with_normal_item) +target_link_libraries(point_inside_polyhedron_plugin PUBLIC scene_surface_mesh_item scene_points_with_normal_item) qt5_wrap_ui( polyhedron_slicerUI_FILES Polyhedron_slicer_widget.ui) polyhedron_demo_plugin(polyhedron_slicer_plugin Polyhedron_slicer_plugin ${polyhedron_slicerUI_FILES}) -target_link_libraries(polyhedron_slicer_plugin PUBLIC scene_polyhedron_item scene_surface_mesh_item scene_basic_objects scene_polylines_item) +target_link_libraries(polyhedron_slicer_plugin PUBLIC scene_surface_mesh_item scene_basic_objects scene_polylines_item) polyhedron_demo_plugin(polyhedron_stitching_plugin Polyhedron_stitching_plugin) -target_link_libraries(polyhedron_stitching_plugin PUBLIC scene_polyhedron_item scene_surface_mesh_item scene_polylines_item) +target_link_libraries(polyhedron_stitching_plugin PUBLIC scene_surface_mesh_item scene_polylines_item) qt5_wrap_ui( selectionUI_FILES Selection_widget.ui) add_library(selection_plugin SHARED Selection_plugin.cpp ${selectionUI_FILES}) -#polyhedron_demo_plugin(selection_plugin Selection_plugin ${selectionUI_FILES}) -target_link_libraries(selection_plugin PUBLIC scene_polyhedron_selection_item scene_points_with_normal_item scene_polylines_item) - -qt5_wrap_ui( selectionUI_FILES Selection_widget.ui) -add_library(selection_sm_plugin SHARED Selection_plugin.cpp ${selectionUI_FILES}) -#polyhedron_demo_plugin(selection_sm_plugin Selection_plugin ${selectionUI_FILES}) -target_link_libraries(selection_sm_plugin PUBLIC scene_surface_mesh_selection_item scene_points_with_normal_item scene_polylines_item) -target_compile_definitions(selection_sm_plugin PUBLIC "-DUSE_SURFACE_MESH" ) +target_link_libraries(selection_plugin PUBLIC scene_selection_item scene_points_with_normal_item scene_polylines_item) polyhedron_demo_plugin(self_intersection_plugin Self_intersection_plugin) -target_link_libraries(self_intersection_plugin PUBLIC scene_polyhedron_item scene_polyhedron_selection_item ) - -polyhedron_demo_plugin(self_intersection_sm_plugin Self_intersection_plugin) -target_link_libraries(self_intersection_sm_plugin PUBLIC scene_surface_mesh_selection_item scene_surface_mesh_item) -target_compile_definitions(self_intersection_sm_plugin PUBLIC "-DUSE_SURFACE_MESH" ) +target_link_libraries(self_intersection_plugin PUBLIC scene_selection_item scene_surface_mesh_item) polyhedron_demo_plugin(triangulate_facets_plugin Triangulate_facets_plugin) -target_link_libraries(triangulate_facets_plugin PUBLIC scene_polyhedron_item scene_surface_mesh_item) +target_link_libraries(triangulate_facets_plugin PUBLIC scene_surface_mesh_item) polyhedron_demo_plugin(corefinement_plugin Corefinement_plugin) -target_link_libraries(corefinement_plugin PUBLIC scene_surface_mesh_item scene_polyhedron_item) +target_link_libraries(corefinement_plugin PUBLIC scene_surface_mesh_item) polyhedron_demo_plugin(surface_intersection_plugin Surface_intersection_plugin) -target_link_libraries(surface_intersection_plugin PUBLIC scene_polyhedron_item scene_polylines_item scene_points_with_normal_item) - -polyhedron_demo_plugin(surface_intersection_sm_plugin Surface_intersection_plugin) -target_link_libraries(surface_intersection_sm_plugin PUBLIC scene_surface_mesh_item scene_polylines_item scene_points_with_normal_item) -target_compile_definitions(surface_intersection_sm_plugin PUBLIC "-DUSE_SURFACE_MESH" ) +target_link_libraries(surface_intersection_plugin PUBLIC scene_surface_mesh_item scene_polylines_item scene_points_with_normal_item) polyhedron_demo_plugin(repair_polyhedron_plugin Repair_polyhedron_plugin) -target_link_libraries(repair_polyhedron_plugin PUBLIC scene_surface_mesh_item scene_polyhedron_item) +target_link_libraries(repair_polyhedron_plugin PUBLIC scene_surface_mesh_item) qt5_wrap_ui( isotropicRemeshingUI_FILES Isotropic_remeshing_dialog.ui) polyhedron_demo_plugin(isotropic_remeshing_plugin Isotropic_remeshing_plugin ${isotropicRemeshingUI_FILES}) -target_link_libraries(isotropic_remeshing_plugin PUBLIC scene_polyhedron_item scene_polyhedron_selection_item) - -polyhedron_demo_plugin(isotropic_remeshing_sm_plugin Isotropic_remeshing_plugin ${isotropicRemeshingUI_FILES}) -target_link_libraries(isotropic_remeshing_sm_plugin PUBLIC scene_surface_mesh_item scene_surface_mesh_selection_item) -target_compile_definitions(isotropic_remeshing_sm_plugin PUBLIC "-DUSE_SURFACE_MESH" ) +target_link_libraries(isotropic_remeshing_plugin PUBLIC scene_surface_mesh_item scene_selection_item) if(TBB_FOUND) - CGAL_target_use_TBB(isotropic_remeshing_sm_plugin) CGAL_target_use_TBB(isotropic_remeshing_plugin) endif() polyhedron_demo_plugin(distance_plugin Distance_plugin) -target_link_libraries(distance_plugin PUBLIC scene_polyhedron_item scene_color_ramp) - +target_link_libraries(distance_plugin PUBLIC scene_surface_mesh_item scene_color_ramp) if(TBB_FOUND) CGAL_target_use_TBB(distance_plugin) endif() polyhedron_demo_plugin(detect_sharp_edges_plugin Detect_sharp_edges_plugin) -target_link_libraries(detect_sharp_edges_plugin PUBLIC scene_polyhedron_item) +target_link_libraries(detect_sharp_edges_plugin PUBLIC scene_surface_mesh_item) -polyhedron_demo_plugin(detect_sharp_edges_sm_plugin Detect_sharp_edges_plugin) -target_link_libraries(detect_sharp_edges_sm_plugin PUBLIC scene_surface_mesh_item) -target_compile_definitions(detect_sharp_edges_sm_plugin PUBLIC "-DUSE_SURFACE_MESH" ) -polyhedron_demo_plugin(distance_sm_plugin Distance_plugin) -target_link_libraries(distance_sm_plugin PUBLIC scene_surface_mesh_item scene_color_ramp) -target_compile_definitions(distance_sm_plugin PUBLIC "-DUSE_SURFACE_MESH" ) qt5_wrap_ui( randomPerturbationUI_FILES Random_perturbation_dialog.ui) polyhedron_demo_plugin(random_perturbation_plugin Random_perturbation_plugin ${randomPerturbationUI_FILES}) -target_link_libraries(random_perturbation_plugin PUBLIC scene_polyhedron_item scene_polyhedron_selection_item) +target_link_libraries(random_perturbation_plugin PUBLIC scene_surface_mesh_item scene_selection_item) -polyhedron_demo_plugin(degenerated_faces_poly_plugin Degenerated_faces_plugin) -target_link_libraries(degenerated_faces_poly_plugin PUBLIC scene_polyhedron_item scene_polyhedron_selection_item) - -polyhedron_demo_plugin(degenerated_faces_sm_plugin Degenerated_faces_plugin) -target_link_libraries(degenerated_faces_sm_plugin PUBLIC scene_surface_mesh_item scene_surface_mesh_selection_item) -target_compile_definitions(degenerated_faces_sm_plugin PUBLIC "-DUSE_SURFACE_MESH" ) +polyhedron_demo_plugin(degenerated_faces_plugin Degenerated_faces_plugin) +target_link_libraries(degenerated_faces_plugin PUBLIC scene_surface_mesh_item scene_selection_item) -polyhedron_demo_plugin(extrude_poly_plugin Extrude_plugin) -target_link_libraries(extrude_poly_plugin PUBLIC scene_polyhedron_item scene_polyhedron_selection_item) - -polyhedron_demo_plugin(extrude_sm_plugin Extrude_plugin) -target_link_libraries(extrude_sm_plugin PUBLIC scene_surface_mesh_item scene_surface_mesh_selection_item) -target_compile_definitions(extrude_sm_plugin PUBLIC "-DUSE_SURFACE_MESH" ) +polyhedron_demo_plugin(extrude_plugin Extrude_plugin) +target_link_libraries(extrude_plugin PUBLIC scene_surface_mesh_item scene_selection_item) diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Corefinement_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Corefinement_plugin.cpp index 813adb803e6..ce83faa6f5b 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Corefinement_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Corefinement_plugin.cpp @@ -4,8 +4,6 @@ #include "Messages_interface.h" #include #include "Scene_surface_mesh_item.h" -#include "Scene_polyhedron_item.h" -#include "Polyhedron_type.h" #include @@ -77,11 +75,6 @@ public: if(!qobject_cast(item2)) return false; } - else if( qobject_cast(item1)) - { - if(!qobject_cast(item2)) - return false; - } else return false; return true; @@ -99,11 +92,6 @@ public Q_SLOTS: apply_corefine(qobject_cast(item1), qobject_cast(item2)); } - else - { - apply_corefine(qobject_cast(item1), - qobject_cast(item2)); - } } void corefine_and_bool_op(bool_op op) @@ -119,12 +107,6 @@ public Q_SLOTS: qobject_cast(item2), op); } - else - { - apply_corefine_and_bool_op(qobject_cast(item1), - qobject_cast(item2), - op); - } } void corefine_and_union() diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Degenerated_faces_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Degenerated_faces_plugin.cpp index 0b0d62482a1..3d55f6ceb6f 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Degenerated_faces_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Degenerated_faces_plugin.cpp @@ -4,12 +4,7 @@ #include #include "Kernel_type.h" -#include "Polyhedron_type.h" -#ifdef USE_SURFACE_MESH #include "Scene_surface_mesh_item.h" -#else -#include "Scene_polyhedron_item.h" -#endif #include "Scene_polyhedron_selection_item.h" #include @@ -19,11 +14,9 @@ #include #include #include -#ifdef USE_SURFACE_MESH +#include + typedef Scene_surface_mesh_item Scene_facegraph_item; -#else -typedef Scene_polyhedron_item Scene_facegraph_item; -#endif typedef Scene_facegraph_item::Face_graph Face_graph; using namespace CGAL::Three; class Degenerated_faces_plugin : @@ -80,14 +73,12 @@ template bool isDegen(Mesh* mesh, std::vector::face_descriptor> &out_faces) { typedef typename boost::graph_traits::face_descriptor FaceDescriptor; - typedef typename boost::property_map::type Vpm; - typedef typename boost::property_traits::value_type Point; - typedef typename CGAL::Kernel_traits::Kernel Kernel; + //filter non-triangle_faces BOOST_FOREACH(FaceDescriptor f, faces(*mesh)) { if(is_triangle(halfedge(f, *mesh), *mesh) - && is_degenerate_triangle_face(f, *mesh, get(boost::vertex_point, *mesh), Kernel()) ) + && CGAL::Polygon_mesh_processing::is_degenerate_triangle_face(f, *mesh) ) out_faces.push_back(f); } return !out_faces.empty(); @@ -117,6 +108,7 @@ void Degenerated_faces_plugin::on_actionDegenFaces_triggered() typedef boost::graph_traits::face_descriptor Face_descriptor; typedef boost::graph_traits::halfedge_descriptor halfedge_descriptor; + typedef boost::graph_traits::edge_descriptor edge_descriptor; QApplication::setOverrideCursor(Qt::WaitCursor); bool found = false; std::vector selected_polys; @@ -136,13 +128,28 @@ void Degenerated_faces_plugin::on_actionDegenFaces_triggered() // add intersecting triangles to a selection_item. if(isDegen(pMesh, facets)) { + std::vector edges; + isDegen(pMesh, edges); + std::vector is_degen(pMesh->number_of_edges()+pMesh->number_of_removed_edges(), false); + BOOST_FOREACH(edge_descriptor e, edges) + { + is_degen[(std::size_t)e] = true; + } Scene_polyhedron_selection_item* selection_item = new Scene_polyhedron_selection_item(poly_item, mw); for(std::vector::iterator fb = facets.begin(); fb != facets.end(); ++fb) { selection_item->selected_facets.insert(*fb); BOOST_FOREACH(halfedge_descriptor h, halfedges_around_face(halfedge(*fb, *pMesh), *pMesh)) { - selection_item->selected_edges.insert(edge(h, *selection_item->polyhedron())); + edge_descriptor e = edge(h, *selection_item->polyhedron()); + selection_item->selected_edges.insert(e); + if(is_degen[(std::size_t)e]) + { + selection_item->selected_vertices.insert(source( halfedge(e, *selection_item->polyhedron()), + *selection_item->polyhedron())); + selection_item->selected_vertices.insert(target( halfedge(e, *selection_item->polyhedron()), + *selection_item->polyhedron())); + } } } selection_item->invalidateOpenGLBuffers(); diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Detect_sharp_edges_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Detect_sharp_edges_plugin.cpp index 2ad95b8ca69..f7f559c373c 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Detect_sharp_edges_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Detect_sharp_edges_plugin.cpp @@ -7,22 +7,12 @@ #include -#ifdef USE_SURFACE_MESH #include "Scene_surface_mesh_item.h" -#else -#include "Scene_polyhedron_item.h" -#include "Polyhedron_type.h" -#endif - #include "Polyhedron_demo_detect_sharp_edges.h" -#ifdef USE_SURFACE_MESH typedef Scene_surface_mesh_item Scene_facegraph_item; typedef CGAL::Kernel_traits::Kernel Kernel; -#else -typedef Scene_polyhedron_item Scene_facegraph_item; -#endif typedef Scene_facegraph_item::Face_graph FaceGraph; typedef boost::graph_traits::halfedge_descriptor halfedge_descriptor; @@ -143,9 +133,6 @@ void Polyhedron_demo_detect_sharp_edges_plugin::detectSharpEdges(bool input_dial .vertex_incident_patches_map(vip)); //update item item->setItemIsMulticolor(true); -#ifndef USE_SURFACE_MESH - item->set_color_vector_read_only(false); -#endif item->invalidateOpenGLBuffers(); // update scene diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Distance_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Distance_plugin.cpp index 39d5e23a162..2765e8993d2 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Distance_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Distance_plugin.cpp @@ -8,13 +8,8 @@ #include #include #include "Messages_interface.h" -#ifdef USE_SURFACE_MESH #include "Kernel_type.h" #include "Scene_surface_mesh_item.h" -#else -#include "Scene_polyhedron_item.h" -#include "Polyhedron_type.h" -#endif #include "Color_ramp.h" #include "triangulate_primitive.h" #include @@ -25,16 +20,10 @@ #include #include #include - using namespace CGAL::Three; namespace PMP = CGAL::Polygon_mesh_processing; -#ifdef USE_SURFACE_MESH typedef Scene_surface_mesh_item Scene_face_graph_item; -#else -typedef Scene_polyhedron_item Scene_face_graph_item; -#endif - typedef Scene_face_graph_item::Face_graph Face_graph; #if defined(CGAL_LINKED_WITH_TBB) @@ -42,19 +31,16 @@ template struct Distance_computation{ const AABB_tree& tree; const std::vector& sample_points; - Point_3 initial_hint; - tbb::atomic* distance; + const Point_3 initial_hint; std::vector& output; Distance_computation(const AABB_tree& tree, const Point_3 p, const std::vector& sample_points, - tbb::atomic* d, std::vector& out ) : tree(tree) , sample_points(sample_points) , initial_hint(p) - , distance(d) , output(out) { } @@ -62,18 +48,13 @@ struct Distance_computation{ operator()(const tbb::blocked_range& range) const { Point_3 hint = initial_hint; - double hdist = 0; for( std::size_t i = range.begin(); i != range.end(); ++i) { hint = tree.closest_point(sample_points[i], hint); Kernel::FT dist = squared_distance(hint,sample_points[i]); double d = CGAL::sqrt(dist); output[i] = d; - if (d>hdist) hdist=d; } - - if (hdist > distance->load()) - distance->store(hdist); } }; #endif @@ -175,7 +156,7 @@ private: tree.accelerate_distance_queries(); tree.build(); boost::graph_traits::vertex_descriptor vd = *(vertices(m).first); - Traits::Point_3 hint = get(CGAL::vertex_point,*poly, vd); + Traits::Point_3 hint = get(CGAL::vertex_point,m, vd); #if !defined(CGAL_LINKED_WITH_TBB) double hdist = 0; @@ -189,10 +170,13 @@ private: } return hdist; #else - tbb::atomic distance; - distance.store(0); - Distance_computation f(tree, hint, sample_points, &distance, out); + double distance=0; + Distance_computation f(tree, hint, sample_points, out); tbb::parallel_for(tbb::blocked_range(0, sample_points.size()), f); + for(std::size_t i = 0; i< out.size(); ++i){ + if(out[i] > distance) + distance = out[i]; + } return distance; #endif } diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Extrude_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Extrude_plugin.cpp index 6f7bedf349f..8c968b5e323 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Extrude_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Extrude_plugin.cpp @@ -19,21 +19,11 @@ #include #include "Messages_interface.h" -#ifdef USE_SURFACE_MESH #include "Kernel_type.h" #include "Scene_surface_mesh_item.h" -#else -#include "Scene_polyhedron_item.h" -#include "Polyhedron_type.h" -#endif #include "Scene_polyhedron_selection_item.h" #include "Scene.h" -#ifdef USE_SURFACE_MESH typedef Scene_surface_mesh_item Scene_face_graph_item; -#else -typedef Scene_polyhedron_item Scene_face_graph_item; -#endif - typedef Scene_face_graph_item::Face_graph Face_graph; typedef CGAL::qglviewer::Vec Vec; using namespace CGAL::Three; @@ -357,7 +347,7 @@ public: this->mw = mainWindow; oliver_queen = NULL; target = NULL; - actionCreateItem = new QAction(QString("Extrude Item"), mw); + actionCreateItem = new QAction(QString("Extrude FaceGraph (or selection)"), mw); actionCreateItem->setProperty("submenuName", "Polygon Mesh Processing"); connect(actionCreateItem, SIGNAL(triggered()), this, SLOT(createItem())); diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Fairing_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Fairing_plugin.cpp index 1f4b212c807..98cf548d126 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Fairing_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Fairing_plugin.cpp @@ -6,16 +6,9 @@ #include "Scene_polyhedron_selection_item.h" #include "ui_Fairing_widget.h" -#ifdef USE_SURFACE_MESH #include "SMesh_type.h" typedef Scene_surface_mesh_item Scene_facegraph_item; -#else -#include "Polyhedron_type.h" -typedef Scene_polyhedron_item Scene_facegraph_item; -#endif - - #include #include #include @@ -58,35 +51,23 @@ public: scene = scene_interface; messages = m; actionFairing = new QAction(tr( - #ifdef USE_SURFACE_MESH - "Refinement and Fairing for Surface Mesh" - #else - "Refinement and Fairing for Polyhedron" - #endif + "Refinement and Fairing" ), mw); actionFairing->setProperty("subMenuName", "Polygon Mesh Processing"); connect(actionFairing, SIGNAL(triggered()), this, SLOT(fairing_action())); dock_widget = new QDockWidget( - #ifdef USE_SURFACE_MESH - "Refinement and Fairing for Surface Mesh" - #else - "Refinement and Fairing for Polyhedron" - #endif + "Refinement and Fairing" , mw); dock_widget->setVisible(false); ui_widget.setupUi(dock_widget); addDockWidget(dock_widget); dock_widget->setWindowTitle(tr( - #ifdef USE_SURFACE_MESH - "Fairing for Surface Mesh" - #else - "Fairing for Polyhedron" - #endif + "Fairing " )); - + connect(ui_widget.Fair_button, SIGNAL(clicked()), this, SLOT(on_Fair_button_clicked())); connect(ui_widget.Refine_button, SIGNAL(clicked()), this, SLOT(on_Refine_button_clicked())); } diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Hole_filling_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Hole_filling_plugin.cpp index 7c995e7244f..5199a7fe048 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Hole_filling_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Hole_filling_plugin.cpp @@ -3,7 +3,6 @@ #include #include "Messages_interface.h" -#include "Scene_polyhedron_item.h" #include "Scene_surface_mesh_item.h" #include "Scene_polylines_item.h" #include "Scene_polyhedron_selection_item.h" @@ -11,7 +10,6 @@ #include #include "ui_Hole_filling_widget.h" -#include "Polyhedron_type.h" #include #include @@ -42,22 +40,11 @@ #include #include -#ifdef USE_SURFACE_MESH typedef Scene_surface_mesh_item Scene_face_graph_item; void normalize_border(Scene_face_graph_item::Face_graph&) {} -#else -typedef Scene_polyhedron_item Scene_face_graph_item; - -void normalize_border(Scene_face_graph_item::Face_graph& polyhedron) -{ - polyhedron.normalize_border(); -} - -#endif - typedef Scene_face_graph_item::Face_graph Face_graph; typedef boost::graph_traits::vertex_descriptor fg_vertex_descriptor; @@ -436,21 +423,13 @@ void Polyhedron_demo_hole_filling_plugin::init(QMainWindow* mainWindow, messages = m; actionHoleFilling = new QAction(tr( - #ifdef USE_SURFACE_MESH - "Hole Filling for Surface Mesh" - #else - "Hole Filling for Polyhedron" - #endif + "Hole Filling" ), mw); actionHoleFilling->setProperty("subMenuName", "Polygon Mesh Processing"); connect(actionHoleFilling, SIGNAL(triggered()), this, SLOT(hole_filling_action())); dock_widget = new QDockWidget( - #ifdef USE_SURFACE_MESH - "Hole Filling for Surface Mesh" - #else - "Hole Filling for Polyhedron" - #endif + "Hole Filling" , mw); dock_widget->setVisible(false); dock_widget->installEventFilter(this); @@ -461,11 +440,7 @@ void Polyhedron_demo_hole_filling_plugin::init(QMainWindow* mainWindow, addDockWidget(dock_widget); dock_widget->setWindowTitle(tr( - #ifdef USE_SURFACE_MESH - "Hole Filling for Surface Mesh" - #else - "Hole Filling for Polyhedron" - #endif + "Hole Filling" )); connect(ui_widget.Fill_from_selection_button, SIGNAL(clicked()), this, SLOT(on_Fill_from_selection_button())); diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Hole_filling_polyline_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Hole_filling_polyline_plugin.cpp index 0b1c3a79f5f..605703178bc 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Hole_filling_polyline_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Hole_filling_polyline_plugin.cpp @@ -1,13 +1,11 @@ #include #include "Messages_interface.h" -#include "Scene_polyhedron_item.h" #include "Scene_surface_mesh_item.h" #include "Scene_polylines_item.h" #include #include -#include "Polyhedron_type.h" #include #include @@ -68,12 +66,6 @@ private: }; typedef boost::function_output_iterator Nop_out; - struct Get_handle { - typedef Polyhedron::Facet_handle result_type; - result_type operator()(Polyhedron::Facet& f) const - { return f.halfedge()->facet(); } - }; - public Q_SLOTS: void hole_filling_polyline_action() { Scene_polylines_item* polylines_item = qobject_cast(scene->item(scene->mainSelectionIndex())); @@ -123,47 +115,26 @@ public Q_SLOTS: continue; } } - - if(mw->property("is_polyhedron_mode").toBool()){ - Polyhedron* poly = new Polyhedron; - CGAL::Polygon_mesh_processing::polygon_soup_to_polygon_mesh(*it, - patch, - *poly); - - if(also_refine) { - timer.reset(); - CGAL::Polygon_mesh_processing::refine(*poly, faces(*poly), - Nop_out(), Nop_out(), - CGAL::Polygon_mesh_processing::parameters::density_control_factor(density_control_factor)); - print_message(QString("Refined in %1 sec.").arg(timer.time())); - } - - Scene_polyhedron_item* poly_item = new Scene_polyhedron_item(poly); - poly_item->setName(tr("%1-filled-%2").arg(polylines_item->name()).arg(counter)); - poly_item->setRenderingMode(FlatPlusEdges); - scene->setSelectedItem(scene->addItem(poly_item)); - } else { - SMesh* poly = new SMesh; - CGAL::Polygon_mesh_processing::polygon_soup_to_polygon_mesh(*it, - patch, - *poly); - - if(also_refine) { - timer.reset(); - CGAL::Polygon_mesh_processing::refine(*poly, faces(*poly), - Nop_out(), Nop_out(), - CGAL::Polygon_mesh_processing::parameters::density_control_factor(density_control_factor)); - print_message(QString("Refined in %1 sec.").arg(timer.time())); - } - - Scene_surface_mesh_item* poly_item = new Scene_surface_mesh_item(poly); - poly_item->setName(tr("%1-filled-%2").arg(polylines_item->name()).arg(counter)); - poly_item->setRenderingMode(FlatPlusEdges); - scene->setSelectedItem(scene->addItem(poly_item)); + SMesh* poly = new SMesh; + CGAL::Polygon_mesh_processing::polygon_soup_to_polygon_mesh(*it, + patch, + *poly); + + if(also_refine) { + timer.reset(); + CGAL::Polygon_mesh_processing::refine(*poly, faces(*poly), + Nop_out(), Nop_out(), + CGAL::Polygon_mesh_processing::parameters::density_control_factor(density_control_factor)); + print_message(QString("Refined in %1 sec.").arg(timer.time())); } + + Scene_surface_mesh_item* poly_item = new Scene_surface_mesh_item(poly); + poly_item->setName(tr("%1-filled-%2").arg(polylines_item->name()).arg(counter)); + poly_item->setRenderingMode(FlatPlusEdges); + scene->setSelectedItem(scene->addItem(poly_item)); } QApplication::restoreOverrideCursor(); - } + } private: QMainWindow* mw; diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Inside_out_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Inside_out_plugin.cpp index aac56db2864..b1941923dff 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Inside_out_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Inside_out_plugin.cpp @@ -3,10 +3,8 @@ #include #include #include -#include "Scene_polyhedron_item.h" #include "Scene_polygon_soup_item.h" #include "Scene_surface_mesh_item.h" -#include "Polyhedron_type.h" #include #include @@ -48,12 +46,10 @@ public: bool applicable(QAction* action) const { const CGAL::Three::Scene_interface::Item_id index = scene->mainSelectionIndex(); if(action == actionInsideOut) - return qobject_cast(scene->item(index)) - || qobject_cast(scene->item(index)) + return qobject_cast(scene->item(index)) || qobject_cast(scene->item(index)); else if(action == actionOrientCC) - return qobject_cast(scene->item(index)) - || qobject_cast(scene->item(index)); + return qobject_cast(scene->item(index)); return false; } @@ -73,27 +69,17 @@ void Polyhedron_demo_inside_out_plugin::on_actionInsideOut_triggered() { const CGAL::Three::Scene_interface::Item_id index = scene->mainSelectionIndex(); - Scene_polyhedron_item* poly_item = - qobject_cast(scene->item(index)); - Scene_polygon_soup_item* soup_item = qobject_cast(scene->item(index)); Scene_surface_mesh_item* sm_item = qobject_cast(scene->item(index)); - if(poly_item || soup_item || sm_item) + if(soup_item || sm_item) { QApplication::setOverrideCursor(Qt::WaitCursor); - if(poly_item) { - Polyhedron* pMesh = poly_item->polyhedron(); - if(pMesh){ - CGAL::Polygon_mesh_processing::reverse_face_orientations(*pMesh); - poly_item->invalidateOpenGLBuffers(); - } - } - else if(sm_item) { + if(sm_item) { SMesh* pMesh = sm_item->polyhedron(); if(pMesh){ CGAL::Polygon_mesh_processing::reverse_face_orientations(*pMesh); @@ -116,13 +102,10 @@ void Polyhedron_demo_inside_out_plugin::on_actionOrientCC_triggered() { const CGAL::Three::Scene_interface::Item_id index = scene->mainSelectionIndex(); - Scene_polyhedron_item* poly_item = - qobject_cast(scene->item(index)); - Scene_surface_mesh_item* sm_item = qobject_cast(scene->item(index)); - if(poly_item || sm_item) + if(sm_item) { QStringList items; items << tr("Outward") << tr("Inward"); @@ -133,17 +116,7 @@ void Polyhedron_demo_inside_out_plugin::on_actionOrientCC_triggered() if (!ok ) return; QApplication::setOverrideCursor(Qt::WaitCursor); - if(poly_item) { - Polyhedron* pMesh = poly_item->polyhedron(); - if(pMesh){ - if(is_closed(*pMesh)) - CGAL::Polygon_mesh_processing::orient_to_bound_a_volume(*pMesh, item==items.first()); - else - CGAL::Polygon_mesh_processing::orient(*pMesh, item==items.first()); - poly_item->invalidateOpenGLBuffers(); - } - } - else if(sm_item) { + if(sm_item) { SMesh* pMesh = sm_item->polyhedron(); if(pMesh){ if(is_closed(*pMesh)) diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Isotropic_remeshing_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Isotropic_remeshing_plugin.cpp index 45ce18f78fc..3fa8fcca4fe 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Isotropic_remeshing_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Isotropic_remeshing_plugin.cpp @@ -7,12 +7,8 @@ #include -#ifdef USE_SURFACE_MESH + #include "Scene_surface_mesh_item.h" -#else -#include "Scene_polyhedron_item.h" -#include "Polyhedron_type.h" -#endif #include "Scene_polyhedron_selection_item.h" @@ -50,31 +46,11 @@ #include "ui_Isotropic_remeshing_dialog.h" -#ifdef USE_SURFACE_MESH + typedef Scene_surface_mesh_item Scene_facegraph_item; -#else -typedef Scene_facegraph_item Scene_facegraph_item; -#endif typedef Scene_facegraph_item::Face_graph FaceGraph; typedef boost::graph_traits::face_descriptor face_descriptor; -template -#ifdef USE_SURFACE_MESH -void reset_face_ids(Mesh&) -{} -#else -void reset_face_ids(Mesh& mesh) -{ -typename boost::property_map::type fim - = get(CGAL::face_index, mesh); - -unsigned int id = 0; -BOOST_FOREACH(face_descriptor f, faces(mesh)) -{ - put(fim, f, id++); -} -} -#endif // give a halfedge and a target edge length, put in `out` points // which the edge equally spaced such that splitting the edge // using the sequence of points make the edges shorter than @@ -244,7 +220,7 @@ public: std::map& edges_to_protect, double target_length) { - typedef Polyhedron::Point_3 Point_3; + typedef EPICK::Point_3 Point_3; typedef std::pair Segment_3; typedef std::map< Segment_3, @@ -346,7 +322,6 @@ public Q_SLOTS: ? *poly_item->polyhedron() : *selection_item->polyhedron(); - reset_face_ids(pmesh); Patch_id_pmap fpmap = get(CGAL::face_patch_id_t(), pmesh); bool fpmap_valid = false; @@ -388,7 +363,7 @@ public Q_SLOTS: edges , target_length , *selection_item->polyhedron() - , PMP::parameters::geom_traits(Kernel()) + , PMP::parameters::geom_traits(EPICK()) .edge_is_constrained_map(selection_item->constrained_edges_pmap())); else std::cout << "No selected or boundary edges to be split" << std::endl; @@ -461,7 +436,7 @@ public Q_SLOTS: .vertex_is_constrained_map(selection_item->constrained_vertices_pmap())); } } -#ifdef USE_SURFACE_MESH + SMesh mesh_ = *selection_item->polyhedron(); std::vector are_edges_removed; are_edges_removed.resize(mesh_.number_of_edges()+mesh_.number_of_removed_edges()); @@ -473,11 +448,11 @@ public Q_SLOTS: if(!are_edges_removed[i]) are_edges_constrained[i] = get(selection_item->constrained_edges_pmap(), SMesh::Edge_index(static_cast(i))); } - - + + int i0, i1, nE(mesh_.number_of_edges()+mesh_.number_of_removed_edges()); - + //get constrained values in order. if (nE > 0) { @@ -488,7 +463,7 @@ public Q_SLOTS: while (!are_edges_removed[i0] && i0 < i1) ++i0; while ( are_edges_removed[i1] && i0 < i1) --i1; if (i0 >= i1) break; - + // swap std::swap(are_edges_constrained[i0], are_edges_constrained[i1]); std::swap(are_edges_removed[i0], are_edges_removed[i1]); @@ -507,7 +482,7 @@ public Q_SLOTS: pmap = selection_item->constrained_edges_pmap(); put(pmap, SMesh::Edge_index(i), are_edges_constrained[i]); } -#endif + selection_item->poly_item_changed(); selection_item->clear(); selection_item->changed_with_poly_item(); @@ -530,7 +505,7 @@ public Q_SLOTS: border_edges , target_length , *poly_item->polyhedron() - , PMP::parameters::geom_traits(Kernel())); + , PMP::parameters::geom_traits(EPICK())); else std::cout << "No border to be split" << std::endl; } @@ -544,7 +519,7 @@ public Q_SLOTS: if (preserve_duplicates) { detect_and_split_duplicates(poly_items, edges_to_protect_map, target_length); - reset_face_ids(pmesh); + } Scene_polyhedron_selection_item::Is_constrained_map ecm(&edges_to_protect); @@ -572,10 +547,8 @@ public Q_SLOTS: } //destroys the patch_id_map for the Surface_mesh_item to avoid assertions. -#ifdef USE_SURFACE_MESH poly_item->resetColors(); -#endif poly_item->invalidateOpenGLBuffers(); Q_EMIT poly_item->itemChanged(); @@ -687,10 +660,8 @@ public Q_SLOTS: BOOST_FOREACH(Scene_facegraph_item* poly_item, selection) { -#ifdef USE_SURFACE_MESH //destroys the patch_id_map for the Surface_mesh_item to avoid assertions. poly_item->resetColors(); -#endif poly_item->invalidateOpenGLBuffers(); Q_EMIT poly_item->itemChanged(); } @@ -719,7 +690,6 @@ private: Edge_set& edges_to_protect) const { //fill face_index property map - reset_face_ids(*poly_item->polyhedron()); if (edges_only_) { diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Jet_fitting_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Jet_fitting_plugin.cpp index 26d8b4031e8..edd95b3cfca 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Jet_fitting_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Jet_fitting_plugin.cpp @@ -1,6 +1,4 @@ #include -#include "Polyhedron_type.h" -#include "Scene_polyhedron_item.h" #include "Scene_surface_mesh_item.h" #include "Scene_polylines_item.h" @@ -40,8 +38,7 @@ public: } bool applicable(QAction*) const { - return qobject_cast(scene->item(scene->mainSelectionIndex())) || - qobject_cast(scene->item(scene->mainSelectionIndex())); + return qobject_cast(scene->item(scene->mainSelectionIndex())); } public Q_SLOTS: @@ -58,10 +55,10 @@ void compute(Poly* pMesh, Scene_polylines_item* max_curv) { - typedef CGAL::Monge_via_jet_fitting Fitting; + typedef CGAL::Monge_via_jet_fitting Fitting; typedef Fitting::Monge_form Monge_form; - typedef Kernel::Point_3 Point; + typedef EPICK::Point_3 Point; typename boost::property_map::type vpmap = get(CGAL::vertex_point, *pMesh); @@ -76,7 +73,7 @@ void compute(Poly* pMesh, // compute min edge len around central vertex // to scale the ribbons used to display the directions - typedef Kernel::FT FT; + typedef EPICK::FT FT; FT min_edge_len = std::numeric_limits::infinity(); BOOST_FOREACH(typename boost::graph_traits::halfedge_descriptor he, halfedges_around_target(v, *pMesh)) @@ -97,7 +94,7 @@ void compute(Poly* pMesh, // make monge form comply with vertex normal (to get correct // orientation) - typedef Kernel::Vector_3 Vector; + typedef EPICK::Vector_3 Vector; Vector n = CGAL::Polygon_mesh_processing::compute_vertex_normal(v, *pMesh); monge_form.comply_wrt_given_normal(n); @@ -125,11 +122,9 @@ void Polyhedron_demo_jet_fitting_plugin::on_actionEstimateCurvature_triggered() // get active polyhedron const CGAL::Three::Scene_interface::Item_id index = scene->mainSelectionIndex(); QString name = scene->item(index)->name(); - Scene_polyhedron_item* poly_item = - qobject_cast(scene->item(index)); Scene_surface_mesh_item* sm_item = qobject_cast(scene->item(index)); - if((!poly_item) && (! sm_item)){ + if(! sm_item){ return; } // wait cursor @@ -143,14 +138,9 @@ void Polyhedron_demo_jet_fitting_plugin::on_actionEstimateCurvature_triggered() min_curv->setColor(Qt::green); min_curv->setName(tr("%1 (min curvatures)").arg(name)); - if(poly_item){ - Polyhedron* pMesh = poly_item->polyhedron(); - compute(pMesh, min_curv, max_curv); - } else { - - SMesh* pMesh = sm_item->polyhedron(); - compute(pMesh, min_curv, max_curv); - } + SMesh* pMesh = sm_item->polyhedron(); + compute(pMesh, min_curv, max_curv); + scene->addItem(max_curv); scene->addItem(min_curv); max_curv->invalidateOpenGLBuffers(); diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Join_and_split_polyhedra_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Join_and_split_polyhedra_plugin.cpp index 50e5a095d88..7c91e1593f4 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Join_and_split_polyhedra_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Join_and_split_polyhedra_plugin.cpp @@ -2,12 +2,8 @@ #include #include #include "Kernel_type.h" -#ifdef USE_SURFACE_MESH + #include "Scene_surface_mesh_item.h" -#else -#include "Polyhedron_type.h" -#include "Scene_polyhedron_item.h" -#endif #include "Scene_polyhedron_selection_item.h" #include "Scene_polylines_item.h" #include "Messages_interface.h" @@ -29,11 +25,7 @@ #include #include "Color_map.h" -#ifdef USE_SURFACE_MESH typedef Scene_surface_mesh_item Scene_facegraph_item; -#else -typedef Scene_polyhedron_item Scene_facegraph_item; -#endif typedef Scene_facegraph_item::Face_graph FaceGraph; using namespace CGAL::Three; class Polyhedron_demo_join_and_split_polyhedra_plugin: @@ -254,9 +246,6 @@ void Polyhedron_demo_join_and_split_polyhedra_plugin::on_actionColorConnectedCom typedef boost::graph_traits::face_descriptor face_descriptor; selection_item->polyhedron_item()->setItemIsMulticolor(true); -#ifndef USE_SURFACE_MESH - selection_item->polyhedron_item()->set_color_vector_read_only(false); -#endif FaceGraph& pmesh = *(selection_item->polyhedron()); boost::property_map::type fim diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Mean_curvature_flow_skeleton_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Mean_curvature_flow_skeleton_plugin.cpp index f2a789506db..fb4ccf514bf 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Mean_curvature_flow_skeleton_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Mean_curvature_flow_skeleton_plugin.cpp @@ -2,14 +2,10 @@ #include #include #include "ui_Mean_curvature_flow_skeleton_plugin.h" -#ifdef USE_SURFACE_MESH + #include "Kernel_type.h" #include "Scene_surface_mesh_item.h" #include -#else -#include "Scene_polyhedron_item.h" -#include -#endif #include "Scene_mcf_item.h" #include "Scene_points_with_normal_item.h" @@ -41,7 +37,6 @@ namespace PMP = CGAL::Polygon_mesh_processing; -#ifdef USE_SURFACE_MESH typedef Scene_surface_mesh_item Scene_face_graph_item; namespace CGAL { @@ -51,10 +46,6 @@ void set_halfedgeds_items_id (Scene_face_graph_item::Face_graph&) } // namespace CGAL -#else -typedef Scene_polyhedron_item Scene_face_graph_item; -#endif - typedef Scene_face_graph_item::Face_graph Face_graph; typedef boost::graph_traits::vertex_descriptor vertex_descriptor; @@ -116,11 +107,7 @@ public: ui = NULL; actionMCFSkeleton = new QAction(tr( - #ifdef USE_SURFACE_MESH - "Mean Curvature Skeleton (Advanced) for Surface Mesh" - #else - "Mean Curvature Skeleton (Advanced) for Polyhedron" - #endif + "Mean Curvature Skeleton (Advanced)" ), mainWindow); actionMCFSkeleton->setProperty("subMenuName", "Triangulated Surface Mesh Skeletonization"); actionMCFSkeleton->setObjectName("actionMCFSkeleton"); @@ -130,11 +117,7 @@ public: actionConvert_to_medial_skeleton->setObjectName("actionConvert_to_medial_skeleton"); dockWidget = new QDockWidget(tr( - #ifdef USE_SURFACE_MESH - "Mean Curvature Skeleton for Surface Mesh" - #else - "Mean Curvature Skeleton for Polyhedron" - #endif + "Mean Curvature Skeleton" ),mw); dockWidget->setVisible(false); ui = new Ui::Mean_curvature_flow_skeleton_plugin(); @@ -143,11 +126,7 @@ public: | QDockWidget::DockWidgetFloatable | QDockWidget::DockWidgetClosable); dockWidget->setWindowTitle(tr( - #ifdef USE_SURFACE_MESH - "Mean Curvature Skeleton for Surface Mesh" - #else - "Mean Curvature Skeleton for Polyhedron" - #endif + "Mean Curvature Skeleton" )); addDockWidget(dockWidget); diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Mean_curvature_flow_skeleton_plugin.ui b/Polyhedron/demo/Polyhedron/Plugins/PMP/Mean_curvature_flow_skeleton_plugin.ui index 13b78bad89c..9bb3b0c53f1 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Mean_curvature_flow_skeleton_plugin.ui +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Mean_curvature_flow_skeleton_plugin.ui @@ -7,14 +7,14 @@ 0 0 483 - 408 + 279 DockWidget - + @@ -187,6 +187,19 @@ + + + + Qt::Vertical + + + + 20 + 40 + + + + diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Orient_soup_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Orient_soup_plugin.cpp index 1d3a0a8bf5a..d70f953d9a5 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Orient_soup_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Orient_soup_plugin.cpp @@ -7,7 +7,6 @@ #include #include "Scene_polygon_soup_item.h" -#include "Scene_polyhedron_item.h" #include "Scene_polylines_item.h" #include "Scene_surface_mesh_item.h" #include "Scene_points_with_normal_item.h" @@ -34,9 +33,8 @@ public: if(qobject_cast(scene->item(index))) return true; else - if (action==actionShuffle && - (qobject_cast(scene->item(index)) - ||qobject_cast(scene->item(index))) + if (action==actionShuffle && + qobject_cast(scene->item(index)) ) return true; } @@ -46,7 +44,6 @@ public: QList actions() const; public Q_SLOTS: - void orientPoly(); void orientSM(); void shuffle(); void displayNonManifoldEdges(); @@ -62,7 +59,6 @@ private: CGAL::Three::Scene_interface* scene; Messages_interface* messages; QMainWindow* mw; - QAction* actionOrientPoly; QAction* actionOrientSM; QAction* actionShuffle; QAction* actionNMToPolyline; @@ -77,11 +73,6 @@ void Polyhedron_demo_orient_soup_plugin::init(QMainWindow* mainWindow, scene = scene_interface; mw = mainWindow; messages = m; - actionOrientPoly = new QAction(tr("&Orient Polygon Soup (as a polyhedron)"), mainWindow); - actionOrientPoly->setObjectName("actionOrientPoly"); - actionOrientPoly->setProperty("subMenuName", "Polygon Mesh Processing"); - connect(actionOrientPoly, SIGNAL(triggered()), - this, SLOT(orientPoly())); actionOrientSM = new QAction(tr("&Orient Polygon Soup (as a surface_mesh)"), mainWindow); actionOrientSM->setObjectName("actionOrientSM"); actionOrientSM->setProperty("subMenuName", "Polygon Mesh Processing"); @@ -106,7 +97,6 @@ void Polyhedron_demo_orient_soup_plugin::init(QMainWindow* mainWindow, QList Polyhedron_demo_orient_soup_plugin::actions() const { return QList() - << actionOrientPoly << actionOrientSM << actionShuffle << actionNMToPolyline @@ -141,51 +131,6 @@ void set_fcolors(SMesh* smesh, std::vector colors) fcolors[fd] = colors[color_id++]; } -void Polyhedron_demo_orient_soup_plugin::orientPoly() -{ - Q_FOREACH(CGAL::Three::Scene_interface::Item_id index, scene->selectionIndices()) - { - Scene_polygon_soup_item* item = - qobject_cast(scene->item(index)); - - if(item) - { - int create_items = QMessageBox::question(mw, "Orient Mesh", "Do you wish to extract the eventual non manifold simplicies ?"); - if(create_items == QMessageBox::Yes) - { - createPointsAndPolyline(); - } - if(!item->orient()) { - QMessageBox::information(mw, tr("Not orientable without self-intersections"), - tr("The polygon soup \"%1\" is not directly orientable." - " Some vertices have been duplicated and some self-intersections" - " have been created.") - .arg(item->name())); - } - - - Scene_polyhedron_item* poly_item = new Scene_polyhedron_item(); - if(item->exportAsPolyhedron(poly_item->polyhedron())) { - poly_item->setName(item->name()); - poly_item->setColor(item->color()); - poly_item->setRenderingMode(item->renderingMode()); - poly_item->setVisible(item->visible()); - poly_item->invalidateOpenGLBuffers(); - poly_item->setProperty("source filename", item->property("source filename")); - poly_item->setProperty("loader_name", item->property("loader_name")); - scene->replaceItem(index, poly_item); - item->deleteLater(); - } else { - item->invalidateOpenGLBuffers(); - scene->itemChanged(item); - } - } - else{ - messages->warning(tr("This function is only applicable on polygon soups.")); - } - } -} - void Polyhedron_demo_orient_soup_plugin::orientSM() { Q_FOREACH(CGAL::Three::Scene_interface::Item_id index, scene->selectionIndices()) @@ -247,13 +192,6 @@ void Polyhedron_demo_orient_soup_plugin::shuffle() QApplication::restoreOverrideCursor(); continue; } - - Scene_polyhedron_item* poly_item = - qobject_cast(scene->item(index)); - if(poly_item) { - apply_shuffle(poly_item, index); - continue; - } Scene_surface_mesh_item* sm_item = qobject_cast(scene->item(index)); if(sm_item) { diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Point_inside_polyhedron_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Point_inside_polyhedron_plugin.cpp index 3af3b38fff6..9625fc02fc4 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Point_inside_polyhedron_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Point_inside_polyhedron_plugin.cpp @@ -2,13 +2,11 @@ #include "Messages_interface.h" -#include "Scene_polyhedron_item.h" #include "Scene_surface_mesh_item.h" #include "Scene_points_with_normal_item.h" #include #include -#include "Polyhedron_type.h" #include #include @@ -47,8 +45,7 @@ public: for(CGAL::Three::Scene_interface::Item_id i = 0, end = scene->numberOfEntries(); i < end; ++i) { - if(qobject_cast(scene->item(i)) != NULL - || qobject_cast(scene->item(i)) != NULL) + if( qobject_cast(scene->item(i)) != NULL) return true; } @@ -84,13 +81,6 @@ public: { dock_widget->hide(); } -private: - // for transform iterator - struct Get_ref { - typedef const Polyhedron& result_type; - result_type operator()(const Polyhedron* poly_ptr) const - { return *poly_ptr; } - }; public Q_SLOTS: @@ -111,22 +101,14 @@ public Q_SLOTS: } QApplication::setOverrideCursor(Qt::WaitCursor); // place all selected polyhedron and point items to vectors below - std::vector polys; std::vector smeshs; - typedef CGAL::Side_of_triangle_mesh Point_inside; typedef CGAL::Side_of_triangle_mesh Point_inside_smesh; - std::vector inside_testers;// to put all polyhedra to query object // it does not support copy-construction so let's use pointers std::vectorinside_smesh_testers; std::vector point_sets; Q_FOREACH(CGAL::Three::Scene_interface::Item_id id, scene->selectionIndices()) { - Scene_polyhedron_item* poly_item = qobject_cast(scene->item(id)); - if (poly_item){ - inside_testers.push_back(new Point_inside(*(poly_item->polyhedron()))); - polys.push_back(poly_item->polyhedron()); - } Scene_surface_mesh_item* sm_item = qobject_cast(scene->item(id)); if (sm_item){ inside_smesh_testers.push_back(new Point_inside_smesh(*(sm_item->polyhedron()))); @@ -139,14 +121,14 @@ public Q_SLOTS: // there should be at least one selected polyhedron and point item - if(inside_testers.empty() && inside_smesh_testers.empty()) { print_message("Error: there is no selected polyhedron item(s)."); } + if(inside_smesh_testers.empty()) { print_message("Error: there is no selected polyhedron item(s)."); } if(point_sets.empty()) { if(!generated_points.empty()) point_sets.push_back(generated_points.last()->point_set()); else print_message("Error: there is no selected point set item(s)."); } - if((inside_testers.empty()&& inside_smesh_testers.empty()) || point_sets.empty()) { QApplication::restoreOverrideCursor(); return; } + if((inside_smesh_testers.empty()) || point_sets.empty()) { QApplication::restoreOverrideCursor(); return; } // deselect all points for(std::vector::iterator point_set_it = point_sets.begin(); @@ -157,7 +139,7 @@ public Q_SLOTS: CGAL::Timer timer; timer.start(); print_message( - QString("Constructing with %1 items is done in %2 sec.").arg(inside_testers.size()).arg(timer.time())); + QString("Constructing with %1 items is done in %2 sec.").arg(inside_smesh_testers.size()).arg(timer.time())); timer.reset(); std::size_t nb_query = 0, nb_selected = 0;// for print message @@ -171,20 +153,6 @@ public Q_SLOTS: { bool selected = false; Point_set::iterator point_it = point_set->begin() + pt; - for (std::size_t i = 0; i < inside_testers.size(); ++i) - { - CGAL::Bounded_side res = (*inside_testers[i])(point_set->point(*point_it)); - - if( (inside && res == CGAL::ON_BOUNDED_SIDE) || - (on_boundary && res == CGAL::ON_BOUNDARY) || - (outside && res == CGAL::ON_UNBOUNDED_SIDE) ) - { - point_set->select(point_it); ++nb_selected; - -- pt; // Selection replaces current point with unselected one - selected = true; - break;//loop on i - } - } if(! selected){ // now the same for the smeshs point_it = point_set->begin() + pt; @@ -210,9 +178,6 @@ public Q_SLOTS: print_message(QString("%1 points are selected. All Done!").arg(nb_selected)); // delete testers - for (std::size_t i = 0; i < inside_testers.size(); ++i) - delete inside_testers[i]; - for (std::size_t i = 0; i < inside_smesh_testers.size(); ++i) delete inside_smesh_testers[i]; @@ -245,15 +210,6 @@ public Q_SLOTS: // -- Laurent Rineau, 2014/10/30 Q_FOREACH(CGAL::Three::Scene_interface::Item_id id, scene->selectionIndices()) { - Scene_polyhedron_item* poly_item = qobject_cast(scene->item(id)); - if(poly_item) { - if(!bbox) { - bbox = poly_item->bbox(); - } - else { - *bbox = *bbox + poly_item->bbox(); - } - } Scene_surface_mesh_item* sm_item = qobject_cast(scene->item(id)); if(sm_item) { if(!bbox) { diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Point_inside_polyhedron_widget.ui b/Polyhedron/demo/Polyhedron/Plugins/PMP/Point_inside_polyhedron_widget.ui index a648383b638..4e3bd7e9d36 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Point_inside_polyhedron_widget.ui +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Point_inside_polyhedron_widget.ui @@ -11,7 +11,7 @@ - Point Inside Polyhedron + Point Inside Facegraph @@ -78,7 +78,7 @@ - <html><head/><body><p>A selection is possible only if a point set item<br/>and a (closed) polyhedron item are selected</p></body></html> + <html><head/><body><p>A selection is possible only if a point set item<br/>and a (closed) surface mesh item are selected</p></body></html> diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Polyhedron_slicer_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Polyhedron_slicer_plugin.cpp index ec17a5cd5b9..8209f04fe71 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Polyhedron_slicer_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Polyhedron_slicer_plugin.cpp @@ -3,7 +3,7 @@ #include "Messages_interface.h" #include "Scene_plane_item.h" -#include "Scene_polyhedron_item.h" + #include "Scene_surface_mesh_item.h" #include "Scene_polylines_item.h" #include "Scene.h" @@ -15,8 +15,6 @@ #include #include -#include "Polyhedron_type.h" - #include #include #include @@ -39,8 +37,7 @@ class Polyhedron_demo_polyhedron_slicer_plugin : public: bool applicable(QAction*) const { - return qobject_cast(scene->item(scene->mainSelectionIndex())) || - qobject_cast(scene->item(scene->mainSelectionIndex())); + return qobject_cast(scene->item(scene->mainSelectionIndex())); } void print_message(QString message) { messages->information(message);} @@ -219,13 +216,12 @@ bool Polyhedron_demo_polyhedron_slicer_plugin::on_Update_plane_button_clicked() // generate multiple cuts, until any cut does not intersect with bbox void Polyhedron_demo_polyhedron_slicer_plugin::on_Generate_button_clicked() { - Scene_polyhedron_item* item = getSelectedItem(); Scene_surface_mesh_item* sm_item = getSelectedItem(); - if(!item && ! sm_item) { - print_message("Error: There is no selected Scene_polyhedron_item!"); + if(! sm_item) { + print_message("Error: There is no selected Scene_surface_mesh_item!"); return; } - QString item_name = (item)?item->name() : sm_item->name(); + QString item_name = sm_item->name(); if(!on_Update_plane_button_clicked()) { return; } const CGAL::qglviewer::Vec offset = static_cast(CGAL::QGLViewer::QGLViewerPool().first())->offset(); @@ -255,11 +251,10 @@ void Polyhedron_demo_polyhedron_slicer_plugin::on_Generate_button_clicked() } // construct a bbox for selected polyhedron - const CGAL::Three::Scene_interface::Bbox& bbox = (item)?item->bbox(): sm_item->bbox(); + const CGAL::Three::Scene_interface::Bbox& bbox = sm_item->bbox(); CGAL::Bbox_3 cgal_bbox(bbox.xmin(), bbox.ymin(), bbox.zmin(), bbox.xmax(), bbox.ymax(), bbox.zmax()); - Polyhedron* poly = (item)?item->polyhedron():NULL; - SMesh* smesh = (sm_item)?sm_item->polyhedron():NULL; + SMesh* smesh = sm_item->polyhedron(); // continue generating planes while inside bbox std::vector planes; @@ -293,11 +288,7 @@ void Polyhedron_demo_polyhedron_slicer_plugin::on_Generate_button_clicked() Scene_polylines_item* new_polylines_item = new Scene_polylines_item(); QTime time; time.start(); // call algorithm and fill polylines in polylines_item - if(item){ - intersection_of_plane_Polyhedra_3_using_AABB_wrapper(*poly, planes, plane_positions, new_polylines_item->polylines); - }else{ - intersection_of_plane_Polyhedra_3_using_AABB_wrapper(*smesh, planes, plane_positions, new_polylines_item->polylines); - } + intersection_of_plane_Polyhedra_3_using_AABB_wrapper(*smesh, planes, plane_positions, new_polylines_item->polylines); // set names etc and print timing print_message( QString("Done: processed %1 cuts - generated %2 polylines in %3 ms!"). arg(planes.size()).arg(new_polylines_item->polylines.size()).arg(time.elapsed()) ); @@ -312,7 +303,7 @@ void Polyhedron_demo_polyhedron_slicer_plugin::on_Generate_button_clicked() QTime time; time.start(); std::list > polylines; // call algorithm and fill polylines in polylines_item - intersection_of_plane_Polyhedra_3_using_AABB_wrapper(*poly, planes, plane_positions, polylines); + intersection_of_plane_Polyhedra_3_using_AABB_wrapper(*smesh, planes, plane_positions, polylines); // set names etc and print timing print_message( QString("Done: processed %1 cuts - generated %2 polylines in %3 ms!"). arg(planes.size()).arg(polylines.size()).arg(time.elapsed()) ); diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Polyhedron_stitching_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Polyhedron_stitching_plugin.cpp index 6ee8cf73da5..6be59b73e9e 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Polyhedron_stitching_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Polyhedron_stitching_plugin.cpp @@ -2,8 +2,6 @@ #include #include #include "Kernel_type.h" -#include "Polyhedron_type.h" -#include "Scene_polyhedron_item.h" #include "Scene_surface_mesh_item.h" #include "Scene_polylines_item.h" @@ -69,8 +67,7 @@ public: bool applicable(QAction*) const { Q_FOREACH(int index, scene->selectionIndices()) { - if ( qobject_cast(scene->item(index)) || - qobject_cast(scene->item(index)) ) + if ( qobject_cast(scene->item(index)) ) return true; } return false; @@ -159,7 +156,6 @@ void Polyhedron_demo_polyhedron_stitching_plugin::on_actionDetectBorders_trigger void Polyhedron_demo_polyhedron_stitching_plugin::on_actionDetectBorders_triggered() { Q_FOREACH(int index, scene->selectionIndices()){ - on_actionDetectBorders_triggered(index); on_actionDetectBorders_triggered(index); } } @@ -182,7 +178,6 @@ void Polyhedron_demo_polyhedron_stitching_plugin::on_actionStitchBorders_trigger void Polyhedron_demo_polyhedron_stitching_plugin::on_actionStitchBorders_triggered() { Q_FOREACH(int index, scene->selectionIndices()){ - on_actionStitchBorders_triggered(index); on_actionStitchBorders_triggered(index); } } @@ -205,7 +200,6 @@ void Polyhedron_demo_polyhedron_stitching_plugin::on_actionStitchByCC_triggered( void Polyhedron_demo_polyhedron_stitching_plugin::on_actionStitchByCC_triggered() { Q_FOREACH(int index, scene->selectionIndices()){ - on_actionStitchByCC_triggered(index); on_actionStitchByCC_triggered(index); } } diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Random_perturbation_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Random_perturbation_plugin.cpp index 92d59940bbc..7a12447e978 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Random_perturbation_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Random_perturbation_plugin.cpp @@ -3,9 +3,8 @@ #include -#include "Scene_polyhedron_item.h" +#include "Scene_surface_mesh_item.h" #include "Scene_polyhedron_selection_item.h" -#include "Polyhedron_type.h" #include #include @@ -60,7 +59,7 @@ public: bool applicable(QAction*) const { const Scene_interface::Item_id index = scene->mainSelectionIndex(); - if (qobject_cast(scene->item(index))) + if (qobject_cast(scene->item(index))) return true; else if (qobject_cast(scene->item(index))) return true; @@ -72,8 +71,8 @@ public Q_SLOTS: void random_perturb() { const Scene_interface::Item_id index = scene->mainSelectionIndex(); - Scene_polyhedron_item* poly_item = - qobject_cast(scene->item(index)); + Scene_surface_mesh_item* poly_item = + qobject_cast(scene->item(index)); Scene_polyhedron_selection_item* selection_item = qobject_cast(scene->item(index)); @@ -104,7 +103,7 @@ public Q_SLOTS: if (poly_item) { - Polyhedron& pmesh = *poly_item->polyhedron(); + SMesh& pmesh = *poly_item->face_graph(); if(ui.deterministic_checkbox->isChecked()) { unsigned int seed = static_cast(ui.seed_spinbox->value()); @@ -119,7 +118,7 @@ public Q_SLOTS: } poly_item->invalidateOpenGLBuffers(); - Q_EMIT poly_item->itemChanged(); + poly_item->itemChanged(); } else if (selection_item) { @@ -134,7 +133,7 @@ public Q_SLOTS: QApplication::restoreOverrideCursor(); return; } - Polyhedron& pmesh = *selection_item->polyhedron(); + SMesh& pmesh = *selection_item->polyhedron(); if (ui.deterministic_checkbox->isChecked()) { unsigned int seed = static_cast(ui.seed_spinbox->value()); @@ -172,7 +171,7 @@ public Q_SLOTS: Ui::Random_perturbation_dialog perturb_dialog(QDialog* dialog, - Scene_polyhedron_item* poly_item, + Scene_surface_mesh_item* poly_item, Scene_polyhedron_selection_item* selection_item) { Ui::Random_perturbation_dialog ui; diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Repair_polyhedron_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Repair_polyhedron_plugin.cpp index f2f7ddf66b7..548cc110464 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Repair_polyhedron_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Repair_polyhedron_plugin.cpp @@ -1,9 +1,7 @@ #include -#include "Scene_polyhedron_item.h" #include "Scene_surface_mesh_item.h" #include -#include "Polyhedron_type.h" #include #include #include "Messages_interface.h" @@ -58,7 +56,7 @@ public: actionStitchCloseBorderHalfedges->setProperty("subMenuName", "Polygon Mesh Processing/Repair/Experimental"); actionRemoveSelfIntersections->setProperty("subMenuName", "Polygon Mesh Processing/Repair/Experimental"); actionRemoveIsolatedVertices->setProperty("subMenuName", "Polygon Mesh Processing/Repair"); - actionDuplicateNMVertices->setProperty("subMenuName", "Polygon Mesh Processing/Repair/Experimental"); + actionDuplicateNMVertices->setProperty("subMenuName", "Polygon Mesh Processing/Repair"); actionAutorefine->setProperty("subMenuName", "Polygon Mesh Processing/Repair/Experimental"); actionAutorefineAndRMSelfIntersections->setProperty("subMenuName", "Polygon Mesh Processing/Repair/Experimental"); @@ -79,8 +77,7 @@ public: bool applicable(QAction*) const { int item_id = scene->mainSelectionIndex(); - return qobject_cast(scene->item(item_id)) || - qobject_cast(scene->item(item_id)); + return qobject_cast(scene->item(item_id)); } template void on_actionRemoveIsolatedVertices_triggered(Scene_interface::Item_id index); @@ -139,7 +136,6 @@ void Polyhedron_demo_repair_polyhedron_plugin::on_actionRemoveIsolatedVertices_t { QApplication::setOverrideCursor(Qt::WaitCursor); const Scene_interface::Item_id index = scene->mainSelectionIndex(); - on_actionRemoveIsolatedVertices_triggered(index); on_actionRemoveIsolatedVertices_triggered(index); QApplication::restoreOverrideCursor(); } @@ -165,7 +161,6 @@ void Polyhedron_demo_repair_polyhedron_plugin::on_actionRemoveDegenerateFaces_tr { QApplication::setOverrideCursor(Qt::WaitCursor); const Scene_interface::Item_id index = scene->mainSelectionIndex(); - on_actionRemoveDegenerateFaces_triggered(index); on_actionRemoveDegenerateFaces_triggered(index); QApplication::restoreOverrideCursor(); } @@ -191,7 +186,6 @@ void Polyhedron_demo_repair_polyhedron_plugin::on_actionRemoveSelfIntersections_ { QApplication::setOverrideCursor(Qt::WaitCursor); const Scene_interface::Item_id index = scene->mainSelectionIndex(); - on_actionRemoveSelfIntersections_triggered(index); on_actionRemoveSelfIntersections_triggered(index); QApplication::restoreOverrideCursor(); } @@ -219,7 +213,6 @@ void Polyhedron_demo_repair_polyhedron_plugin::on_actionAutorefine_triggered() { QApplication::setOverrideCursor(Qt::WaitCursor); const Scene_interface::Item_id index = scene->mainSelectionIndex(); - on_actionAutorefine_triggered(index); on_actionAutorefine_triggered(index); QApplication::restoreOverrideCursor(); } @@ -251,7 +244,6 @@ void Polyhedron_demo_repair_polyhedron_plugin::on_actionAutorefineAndRMSelfInter { QApplication::setOverrideCursor(Qt::WaitCursor); const Scene_interface::Item_id index = scene->mainSelectionIndex(); - on_actionAutorefineAndRMSelfIntersections_triggered(index); on_actionAutorefineAndRMSelfIntersections_triggered(index); QApplication::restoreOverrideCursor(); } @@ -286,7 +278,6 @@ void Polyhedron_demo_repair_polyhedron_plugin::on_actionStitchCloseBorderHalfedg { QApplication::setOverrideCursor(Qt::WaitCursor); const Scene_interface::Item_id index = scene->mainSelectionIndex(); - on_actionStitchCloseBorderHalfedges_triggered(index); on_actionStitchCloseBorderHalfedges_triggered(index); QApplication::restoreOverrideCursor(); } @@ -312,7 +303,6 @@ void Polyhedron_demo_repair_polyhedron_plugin::on_actionDuplicateNMVertices_trig { QApplication::setOverrideCursor(Qt::WaitCursor); const Scene_interface::Item_id index = scene->mainSelectionIndex(); - on_actionDuplicateNMVertices_triggered(index); on_actionDuplicateNMVertices_triggered(index); QApplication::restoreOverrideCursor(); } diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Scene_facegraph_item_k_ring_selection.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Scene_facegraph_item_k_ring_selection.cpp index ce1f9c9b01c..85a89974a55 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Scene_facegraph_item_k_ring_selection.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Scene_facegraph_item_k_ring_selection.cpp @@ -1 +1 @@ -#include "Scene_polyhedron_item_k_ring_selection.h" +#include "Scene_facegraph_item_k_ring_selection.h" diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Scene_facegraph_item_k_ring_selection.h b/Polyhedron/demo/Polyhedron/Plugins/PMP/Scene_facegraph_item_k_ring_selection.h index 72b65c0f3bb..318663f2e65 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Scene_facegraph_item_k_ring_selection.h +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Scene_facegraph_item_k_ring_selection.h @@ -1,13 +1,8 @@ #ifndef SCENE_FACEGRAPH_ITEM_K_RING_SELECTION_H #define SCENE_FACEGRAPH_ITEM_K_RING_SELECTION_H #include "Scene_facegraph_item_k_ring_selection_config.h" -#ifdef USE_SURFACE_MESH #include "Scene_surface_mesh_item.h" #include -#else -#include "Scene_polyhedron_item.h" -#include "Polyhedron_type.h" -#endif #include #include #include @@ -26,13 +21,8 @@ #include -#ifdef USE_SURFACE_MESH typedef Scene_surface_mesh_item Scene_facegraph_item; typedef EPICK FG_Traits; -#else -typedef Scene_polyhedron_item Scene_facegraph_item; -typedef Kernel FG_Traits; -#endif typedef Scene_facegraph_item::Face_graph FaceGraph; typedef boost::graph_traits::vertex_descriptor fg_vertex_descriptor; @@ -126,10 +116,6 @@ public: is_ready_to_paint_select = true; is_lasso_active = false; -#ifndef USE_SURFACE_MESH - poly_item->enable_facets_picking(true); - poly_item->set_color_vector_read_only(true); -#endif CGAL::QGLViewer* viewer = *CGAL::QGLViewer::QGLViewerPool().begin(); viewer->installEventFilter(this); mw->installEventFilter(this); @@ -151,13 +137,9 @@ public Q_SLOTS: is_active=true; if(active_handle_type == Active_handle::VERTEX || active_handle_type == Active_handle::PATH) { -#ifdef USE_SURFACE_MESH typedef boost::graph_traits::vertices_size_type size_type; size_type h = static_cast(reinterpret_cast(void_ptr)); process_selection( static_cast(h) ); -#else - process_selection( static_cast(void_ptr)->halfedge()->vertex() ); -#endif } updateIsTreated(); } @@ -167,13 +149,9 @@ public Q_SLOTS: if (active_handle_type == Active_handle::FACET || active_handle_type == Active_handle::CONNECTED_COMPONENT) { -#ifdef USE_SURFACE_MESH typedef boost::graph_traits::faces_size_type size_type; size_type h = static_cast(reinterpret_cast(void_ptr)); process_selection( static_cast(h) ); -#else - process_selection( static_cast(void_ptr)->halfedge()->facet() ); -#endif } updateIsTreated(); } @@ -182,17 +160,13 @@ public Q_SLOTS: is_active=true; if(active_handle_type == Active_handle::EDGE) { -#ifdef USE_SURFACE_MESH typedef boost::graph_traits::edges_size_type size_type; size_type h = static_cast(reinterpret_cast(void_ptr)); process_selection( static_cast(h) ); -#else - process_selection( edge(static_cast(void_ptr)->opposite()->opposite(), *poly_item->polyhedron()) ); -#endif } updateIsTreated(); } - + void paint_selection() { if(is_ready_to_paint_select) @@ -375,6 +349,7 @@ public Q_SLOTS: break; } contour_2d.clear(); + Q_EMIT endSelection(); qobject_cast(viewer)->set2DSelectionMode(false); } diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Scene_facegraph_item_k_ring_selection_config.h b/Polyhedron/demo/Polyhedron/Plugins/PMP/Scene_facegraph_item_k_ring_selection_config.h index ae6fca82005..9a0c42bcc64 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Scene_facegraph_item_k_ring_selection_config.h +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Scene_facegraph_item_k_ring_selection_config.h @@ -1,7 +1,7 @@ #ifndef SCENE_FACEGRAPH_ITEM_K_RING_SELECTION_CONFIG_H #define SCENE_FACEGRAPH_ITEM_K_RING_SELECTION_CONFIG_H -#if defined(scene_poly_item_k_ring_selection_EXPORTS) || (scene_sm_item_k_ring_selection_EXPORTS) +#if defined(scene_k_ring_selection_EXPORTS) # define SCENE_FACEGRAPH_ITEM_K_RING_SELECTION_EXPORT Q_DECL_EXPORT #else # define SCENE_FACEGRAPH_ITEM_K_RING_SELECTION_EXPORT Q_DECL_IMPORT diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Scene_mcf_item.h b/Polyhedron/demo/Polyhedron/Plugins/PMP/Scene_mcf_item.h index 732ad350a28..f664b467665 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Scene_mcf_item.h +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Scene_mcf_item.h @@ -3,7 +3,7 @@ -#if defined( scene_mcf_poly_item_EXPORTS ) || defined( scene_mcf_sm_item_EXPORTS ) +#if defined( scene_mcf_item_EXPORTS ) # define SCENE_MCF_ITEM_EXPORT Q_DECL_EXPORT #else # define SCENE_MCF_ITEM_EXPORT Q_DECL_IMPORT @@ -12,14 +12,8 @@ #include #include -#ifdef USE_SURFACE_MESH #include "SMesh_type.h" typedef SMesh Face_graph; -#else -#include "Polyhedron_type.h" -typedef Polyhedron Face_graph; -#endif - typedef CGAL::Mean_curvature_flow_skeletonization Mean_curvature_skeleton; typedef Mean_curvature_skeleton::Skeleton Skeleton; diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Selection_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Selection_plugin.cpp index b37cec3ecff..0ee77f6ac7f 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Selection_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Selection_plugin.cpp @@ -3,12 +3,8 @@ #include "Messages_interface.h" -#ifdef USE_SURFACE_MESH #include "Kernel_type.h" #include "Scene_surface_mesh_item.h" -#else -#include "Scene_polyhedron_item.h" -#endif #include "Scene_polyhedron_selection_item.h" #include "Scene_points_with_normal_item.h" #include "Scene_polylines_item.h" @@ -27,13 +23,9 @@ #include #include #include +#include #include - -#ifdef USE_SURFACE_MESH typedef Scene_surface_mesh_item Scene_face_graph_item; -#else -typedef Scene_polyhedron_item Scene_face_graph_item; -#endif typedef Scene_face_graph_item::Face_graph Face_graph; typedef boost::property_map::type VPmap; @@ -92,29 +84,17 @@ public: scene = scene_interface; messages = m; actionSelection = new QAction( -#ifdef USE_SURFACE_MESH QString("Surface Mesh Selection") -#else - tr("Polyhedron Selection") -#endif , mw); connect(actionSelection, SIGNAL(triggered()), this, SLOT(selection_action())); last_mode = 0; dock_widget = new QDockWidget( - #ifdef USE_SURFACE_MESH "Surface Mesh Selection" - #else - "Polyhedron Selection" - #endif , mw); dock_widget->setVisible(false); ui_widget.setupUi(dock_widget); dock_widget->setWindowTitle(tr( -#ifdef USE_SURFACE_MESH "Surface Mesh Selection" -#else - "Polyhedron Selection" -#endif )); addDockWidget(dock_widget); @@ -152,10 +132,10 @@ public: //Fill operations combo box. operations_strings = { - "Create Point Set Item from Selected Vertices" , - "Create Polyline Item from Selected Edges" , - "Create Polyhedron Item from Selected Facets" , - "Erase Selected Facets from Polyhedron Item" , + "Create Point Set from Selected Vertices" , + "Create Polyline from Selected Edges" , + "Create Facegraph from Selected Facets" , + "Erase Selected Facets" , "Keep Connected Components of Selected Facets" , "Expand Face Selection to Stay Manifold After Removal" , "Convert from Edge Selection to Facets Selection" , @@ -191,9 +171,9 @@ public Q_SLOTS: connect(new_item, SIGNAL(updateInstructions(QString)), this, SLOT(setInstructions(QString))); connect(this, SIGNAL(set_operation_mode(int)),new_item, SLOT(set_operation_mode(int))); int item_id = scene->addItem(new_item); - QObject* scene_ptr = dynamic_cast(scene); - if (scene_ptr) - connect(new_item,SIGNAL(simplicesSelected(CGAL::Three::Scene_item*)), scene_ptr, SLOT(setSelectedItem(CGAL::Three::Scene_item*))); + // QObject* scene_ptr = dynamic_cast(scene); + // if (scene_ptr) + // connect(new_item,SIGNAL(simplicesSelected(CGAL::Three::Scene_item*)), scene_ptr, SLOT(setSelectedItem(CGAL::Three::Scene_item*))); connect(new_item,SIGNAL(isCurrentlySelected(Scene_facegraph_item_k_ring_selection*)), this, SLOT(isCurrentlySelected(Scene_facegraph_item_k_ring_selection*))); connect(new_item,SIGNAL(simplicesSelected(CGAL::Three::Scene_item*)), this, SLOT(filter_operations())); scene->setSelectedItem(item_id); @@ -307,8 +287,14 @@ public Q_SLOTS: print_message("Error: there is no selected polyhedron selection item!"); return; } - - selection_item->clear(); + if(ui_widget.tabWidget->currentIndex() == 0) + selection_item->clear(); + else //case current tab is Components, then active simplices are edges. + { + selection_item->selected_edges.clear(); + selection_item->invalidateOpenGLBuffers(); + selection_item->itemChanged(); + } filter_operations(); } void on_Clear_all_button_clicked(){ @@ -364,19 +350,17 @@ public Q_SLOTS: } // Create selection item for selected polyhedron item void on_Create_selection_item_button_clicked() { + Scene_face_graph_item* poly_item = qobject_cast(scene->item(scene->mainSelectionIndex())); if(!poly_item) { print_message("Error: there is no selected " - #ifdef USE_SURFACE_MESH - "Surface_mesh " - #else - "Polyhedron " - #endif + "Surface_mesh " "item!"); return; } // all other arrangements (putting inside selection_item_map), setting names etc, // other params (e.g. k_ring) will be set inside new_item_created + from_plugin = true; Scene_polyhedron_selection_item* new_item = new Scene_polyhedron_selection_item(poly_item, mw); new_item->setName(QString("%1 (selection)").arg(poly_item->name())); ui_widget.selectionOrEuler->setCurrentIndex(last_mode); @@ -439,7 +423,9 @@ public Q_SLOTS: Q_EMIT set_operation_mode(-1); } } + filter_operations(); } + void on_Insertion_radio_button_toggled(bool toggle){ for(Selection_item_map::iterator it = selection_item_map.begin(); it != selection_item_map.end(); ++it) { it->second->set_is_insert(toggle); @@ -741,14 +727,10 @@ public Q_SLOTS: //Edition mode case 1: { - VPmap vpmap = get(CGAL::vertex_point, *selection_item->polyhedron()); bool is_valid = true; BOOST_FOREACH(boost::graph_traits::face_descriptor fd, faces(*selection_item->polyhedron())) { - if (CGAL::is_degenerate_triangle_face(fd, - *selection_item->polyhedron(), - vpmap, - CGAL::Kernel_traits< boost::property_traits::value_type >::Kernel())) + if (CGAL::Polygon_mesh_processing::is_degenerate_triangle_face(fd, *selection_item->polyhedron())) { is_valid = false; break; @@ -908,11 +890,17 @@ public Q_SLOTS: connect(selection_item, SIGNAL(updateInstructions(QString)), this, SLOT(setInstructions(QString))); connect(selection_item, SIGNAL(printMessage(QString)), this, SLOT(printMessage(QString))); connect(this, SIGNAL(set_operation_mode(int)),selection_item, SLOT(set_operation_mode(int))); - QObject* scene_ptr = dynamic_cast(scene); - if (scene_ptr) - connect(selection_item,SIGNAL(simplicesSelected(CGAL::Three::Scene_item*)), scene_ptr, SLOT(setSelectedItem(CGAL::Three::Scene_item*))); + //QObject* scene_ptr = dynamic_cast(scene); + //if (scene_ptr) + // connect(selection_item,SIGNAL(simplicesSelected(CGAL::Three::Scene_item*)), scene_ptr, SLOT(setSelectedItem(CGAL::Three::Scene_item*))); connect(selection_item,SIGNAL(isCurrentlySelected(Scene_facegraph_item_k_ring_selection*)), this, SLOT(isCurrentlySelected(Scene_facegraph_item_k_ring_selection*))); on_LassoCheckBox_changed(ui_widget.lassoCheckBox->isChecked()); + + if(!from_plugin){ + ui_widget.selectionOrEuler->setCurrentIndex(0); + } + else + from_plugin = false; on_SelectionOrEuler_changed(ui_widget.selectionOrEuler->currentIndex()); if(last_mode == 0) on_Selection_type_combo_box_changed(ui_widget.Selection_type_combo_box->currentIndex()); @@ -945,15 +933,22 @@ public Q_SLOTS: } void filter_operations() { - Scene_polyhedron_selection_item* selection_item = getSelectedItem(); + Scene_polyhedron_selection_item* selection_item = + qobject_cast(scene->item( + scene->mainSelectionIndex())); if (!selection_item) return; QString current_op = ui_widget.operationsBox->currentText(); ui_widget.operationsBox->clear(); - bool has_v(!selection_item->selected_vertices.empty()), - has_e(!selection_item->selected_edges.empty()), - has_f(!selection_item->selected_facets.empty()); + bool has_v(!selection_item->selected_vertices.empty() || + ui_widget.Selection_type_combo_box->currentIndex() == 0), + has_e(!selection_item->selected_edges.empty()|| + ui_widget.Selection_type_combo_box->currentIndex() == 2|| + ui_widget.Selection_type_combo_box->currentIndex() == 4), + has_f(!selection_item->selected_facets.empty()|| + ui_widget.Selection_type_combo_box->currentIndex() == 1|| + ui_widget.Selection_type_combo_box->currentIndex() == 3); if(has_v) { @@ -988,6 +983,7 @@ private: typedef std::multimap Selection_item_map; Selection_item_map selection_item_map; int last_mode; + bool from_plugin; }; // end Polyhedron_demo_selection_plugin //Q_EXPORT_PLUGIN2(Polyhedron_demo_selection_plugin, Polyhedron_demo_selection_plugin) diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Selection_widget.ui b/Polyhedron/demo/Polyhedron/Plugins/PMP/Selection_widget.ui index e46381727ba..6cb5504b0c3 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Selection_widget.ui +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Selection_widget.ui @@ -7,7 +7,7 @@ 0 0 613 - 342 + 336 @@ -26,7 +26,7 @@ - Create Selection Item + Create Selection @@ -36,25 +36,12 @@ - Clear Selection Item + Clear Selection - - - - Qt::Vertical - - - - 20 - 40 - - - - @@ -416,7 +403,7 @@ - &Clear + &Clear Current Type @@ -463,22 +450,22 @@ - Create Point Set Item from Selected Vertices + Create Point Set from Selected Vertices - Create Polyline Item from Selected Edges + Create Polyline from Selected Edges - Create Polyhedron Item from Selected Facets + Create Facegraph from Selected Facets - Erase Selected Facets from Polyhedron Item + Erase Selected Facets diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Self_intersection_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Self_intersection_plugin.cpp index 01fc58f71bf..9625bc07cc9 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Self_intersection_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Self_intersection_plugin.cpp @@ -14,13 +14,8 @@ #include "Kernel_type.h" #include "Scene_polyhedron_selection_item.h" -#ifdef USE_SURFACE_MESH #include "Scene_surface_mesh_item.h" typedef Scene_surface_mesh_item Scene_face_graph_item; -#else -#include "Scene_polyhedron_item.h" -typedef Scene_polyhedron_item Scene_face_graph_item; -#endif typedef Scene_face_graph_item::Face_graph Face_graph; typedef Kernel::Triangle_3 Triangle; diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Surface_intersection_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Surface_intersection_plugin.cpp index febe481e5ee..0bc18398d00 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Surface_intersection_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Surface_intersection_plugin.cpp @@ -1,13 +1,8 @@ #include #include -#ifdef USE_SURFACE_MESH #include "Kernel_type.h" #include "Scene_surface_mesh_item.h" -#else -#include "Scene_polyhedron_item.h" -#include "Polyhedron_type.h" -#endif #include #include "Scene_polylines_item.h" @@ -23,11 +18,7 @@ #include #include -#ifdef USE_SURFACE_MESH typedef Scene_surface_mesh_item Scene_face_graph_item; -#else -typedef Scene_polyhedron_item Scene_face_graph_item; -#endif typedef Scene_polylines_item::Polyline Polyline_3; typedef boost::graph_traits::face_descriptor face_descriptor; @@ -78,9 +69,7 @@ public: QList actions() const { return QList() << actionPolyhedronIntersection_3 << actionSurfacePolylineIntersection -#ifdef USE_SURFACE_MESH << actionPolylinesIntersection -#endif ; } diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Triangulate_facets_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Triangulate_facets_plugin.cpp index e63cf3bbb48..acf5bf53abe 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Triangulate_facets_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Triangulate_facets_plugin.cpp @@ -3,9 +3,7 @@ #include #include "Messages_interface.h" #include -#include "Scene_polyhedron_item.h" #include "Scene_surface_mesh_item.h" -#include "Polyhedron_type.h" #include using namespace CGAL::Three; @@ -39,8 +37,7 @@ public: bool applicable(QAction*) const { Q_FOREACH(CGAL::Three::Scene_interface::Item_id index, scene->selectionIndices()){ - if ( qobject_cast(scene->item(index)) || - qobject_cast(scene->item(index)) ) + if ( qobject_cast(scene->item(index)) ) return true; } return false; @@ -50,46 +47,21 @@ public Q_SLOTS: void triangulate() { QApplication::setOverrideCursor(Qt::WaitCursor); Q_FOREACH(CGAL::Three::Scene_interface::Item_id index, scene->selectionIndices()) { - - Scene_polyhedron_item* item = - qobject_cast(scene->item(index)); - - if(item) - { - Polyhedron* pMesh = item->polyhedron(); - if(!pMesh) continue; - if(pMesh->is_pure_triangle()) { - messages->warning(tr("The polyhedron \"%1\" is already triangulated.") - .arg(item->name())); - continue; - } - - - if(!CGAL::Polygon_mesh_processing::triangulate_faces(*pMesh)) - messages->warning(tr("Some facets could not be triangulated.")); - - CGAL_assertion_code(pMesh->normalize_border()); - CGAL_assertion(pMesh->is_valid(false, 3)); - - item->invalidateOpenGLBuffers(); - scene->itemChanged(item); - - } else { + Scene_surface_mesh_item* sm_item = - qobject_cast(scene->item(index)); + qobject_cast(scene->item(index)); SMesh* pMesh = sm_item->polyhedron(); if(!pMesh) continue; if(is_triangle_mesh(*pMesh)) { - messages->warning(tr("The polyhedron \"%1\" is already triangulated.") + messages->warning(tr("The polyhedron \"%1\" is already triangulated.") .arg(sm_item->name()) ); continue; } if(!CGAL::Polygon_mesh_processing::triangulate_faces(*pMesh)) messages->warning(tr("Some facets could not be triangulated.")); - + sm_item->invalidateOpenGLBuffers(); scene->itemChanged(sm_item); - } // end of if(item) } // end of the loop on the selected items // default cursor diff --git a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Alpha_shape_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Alpha_shape_plugin.cpp index b4e5ee35798..921ff997411 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Alpha_shape_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Alpha_shape_plugin.cpp @@ -180,6 +180,7 @@ public Q_SLOTS: if(dock_widget->isVisible()) { dock_widget->hide(); } else { dock_widget->show(); + dock_widget->raise(); Scene_points_with_normal_item* sel_item = qobject_cast(scene->item(scene->mainSelectionIndex())); if(sel_item) diff --git a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Alpha_shape_widget.ui b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Alpha_shape_widget.ui index 9acd6301056..d09258a9cee 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Alpha_shape_widget.ui +++ b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Alpha_shape_widget.ui @@ -7,7 +7,7 @@ 0 0 400 - 141 + 133 diff --git a/Polyhedron/demo/Polyhedron/Plugins/Point_set/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/Point_set/CMakeLists.txt index 3725e4b61f8..2c3571b54c1 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Point_set/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/Point_set/CMakeLists.txt @@ -2,7 +2,7 @@ include( polyhedron_demo_macros ) if(EIGEN3_FOUND) qt5_wrap_ui( surface_reconstructionUI_FILES Surface_reconstruction_plugin.ui) polyhedron_demo_plugin(surface_reconstruction_plugin Surface_reconstruction_plugin Surface_reconstruction_plugin_impl ${surface_reconstructionUI_FILES}) - target_link_libraries(surface_reconstruction_plugin PUBLIC scene_polygon_soup_item scene_polyhedron_item scene_surface_mesh_item scene_points_with_normal_item) + target_link_libraries(surface_reconstruction_plugin PUBLIC scene_polygon_soup_item scene_surface_mesh_item scene_points_with_normal_item) qt5_wrap_ui( point_set_normal_estimationUI_FILES Point_set_normal_estimation_plugin.ui) polyhedron_demo_plugin(point_set_normal_estimation_plugin Point_set_normal_estimation_plugin ${point_set_normal_estimationUI_FILES}) @@ -41,7 +41,7 @@ endif() qt5_wrap_ui(point_set_shape_detectionUI_FILES Point_set_shape_detection_plugin.ui) polyhedron_demo_plugin(point_set_shape_detection_plugin Point_set_shape_detection_plugin ${point_set_shape_detectionUI_FILES}) - target_link_libraries(point_set_shape_detection_plugin PUBLIC scene_surface_mesh_item scene_polyhedron_item scene_points_with_normal_item scene_polygon_soup_item scene_callback_signaler) + target_link_libraries(point_set_shape_detection_plugin PUBLIC scene_surface_mesh_item scene_points_with_normal_item scene_polygon_soup_item scene_callback_signaler) qt5_wrap_ui(point_set_simplificationUI_FILES Point_set_simplification_plugin.ui) polyhedron_demo_plugin(point_set_simplification_plugin Point_set_simplification_plugin ${point_set_simplificationUI_FILES}) @@ -67,7 +67,7 @@ endif() qt5_wrap_ui( distanceUI_FILES Point_set_to_mesh_distance_widget.ui ) polyhedron_demo_plugin(point_set_to_mesh_distance_plugin Point_set_to_mesh_distance_plugin ${distanceUI_FILES}) - target_link_libraries(point_set_to_mesh_distance_plugin PUBLIC scene_points_with_normal_item scene_surface_mesh_item scene_polyhedron_item scene_color_ramp) + target_link_libraries(point_set_to_mesh_distance_plugin PUBLIC scene_points_with_normal_item scene_surface_mesh_item scene_color_ramp) if(TBB_FOUND) foreach(plugin diff --git a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_normal_estimation_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_normal_estimation_plugin.cpp index 398f08f707d..ab53c6c887b 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_normal_estimation_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_normal_estimation_plugin.cpp @@ -275,8 +275,8 @@ void Polyhedron_demo_point_set_normal_estimation_plugin::on_actionNormalEstimati << (memory>>20) << " Mb allocated" << std::endl; } - - item->setRenderingMode(PointsPlusNormals); + item->resetMenu(); + item->setRenderingMode(ShadedPoints); //*************************************** // normal orientation diff --git a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_selection_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_selection_plugin.cpp index 1d8dd937ef2..9b9c5853770 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_selection_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_selection_plugin.cpp @@ -1,6 +1,5 @@ #include #include -#include #include #include #include @@ -36,7 +35,7 @@ #include #include #include - +#include "Selection_visualizer.h" //#undef CGAL_LINKED_WITH_TBB #ifdef CGAL_LINKED_WITH_TBB @@ -46,158 +45,7 @@ #include #endif // CGAL_LINKED_WITH_TBB -// Class for visualizing selection -// provides mouse selection functionality -class Q_DECL_EXPORT Scene_point_set_selection_visualizer -{ - private: - typedef CGAL::Exact_predicates_inexact_constructions_kernel K; - typedef K::Point_2 Point_2; - typedef K::Point_3 Point_3; - typedef CGAL::Polygon_2 Polygon_2; - typedef std::vector Polyline_2; - typedef std::vector Polylines; - typedef Scene_item::Bbox Bbox; - - bool rectangle; - std::vector contour_2d; - Polylines* polyline; - Scene_item::Bbox point_set_bbox; - CGAL::Bbox_2 domain_rectangle; - Polygon_2 domain_freeform; - -public: - - Scene_point_set_selection_visualizer(bool rectangle, const Bbox& point_set_bbox) - : rectangle (rectangle), point_set_bbox (point_set_bbox) - { - polyline = new Polylines(0); - polyline->push_back(Polyline_2()); - } - ~Scene_point_set_selection_visualizer() { - } - - void render(QImage& image) const { - - CGAL::Three::Viewer_interface* viewer = static_cast(*CGAL::QGLViewer::QGLViewerPool().begin()); - - QPen pen; - pen.setColor(QColor(Qt::green)); - pen.setWidth(5); - QImage temp(image); - - QPainter *painter = new QPainter(&temp); - painter->setPen(pen); - for(std::size_t i=0; isize(); ++i) - { - Polyline_2 poly = (*polyline)[i]; - if(!poly.empty()) - for(std::size_t j=0; jdrawLine(poly[j].x(), poly[j].y(), poly[j+1].x(), poly[j+1].y()); - } - } - painter->end(); - delete painter; - viewer->set2DSelectionMode(true); - viewer->setStaticImage(temp); - viewer->update(); - } - - Polyline_2& poly() const - { return polyline->front(); } - - bool update_polyline () const - { - if (contour_2d.size() < 2 || - (!(poly().empty()) && contour_2d.back () == poly().back())) - return false; - - if (rectangle) - { - poly().clear(); - - poly().push_back ( Point_2 (domain_rectangle.xmin(), - domain_rectangle.ymin())); - poly().push_back ( Point_2 (domain_rectangle.xmax(), - domain_rectangle.ymin())); - poly().push_back ( Point_2 (domain_rectangle.xmax(), - domain_rectangle.ymax())); - poly().push_back ( Point_2 (domain_rectangle.xmin(), - domain_rectangle.ymax())); - poly().push_back ( Point_2 (domain_rectangle.xmin(), - domain_rectangle.ymin())); - - } - else - { - if (!(poly().empty()) && contour_2d.back () == poly().back()) - return false; - - poly().clear(); - - for (unsigned int i = 0; i < contour_2d.size (); ++ i) - poly().push_back (contour_2d[i]); - } - return true; - } - - - void sample_mouse_path(QImage& image) - { - CGAL::QGLViewer* viewer = *CGAL::QGLViewer::QGLViewerPool().begin(); - const QPoint& p = viewer->mapFromGlobal(QCursor::pos()); - - if (rectangle && contour_2d.size () == 2) - { - contour_2d[1] = Point_2 (p.x (), p.y ()); - domain_rectangle = CGAL::bbox_2 (contour_2d.begin (), contour_2d.end ()); - } - else - contour_2d.push_back (Point_2 (p.x (), p.y ())); - - if (update_polyline ()) - { - - render(image); - } - } - - void apply_path() - { - update_polyline (); - domain_rectangle = CGAL::bbox_2 (contour_2d.begin (), contour_2d.end ()); - if (!rectangle) - domain_freeform = Polygon_2 (contour_2d.begin (), contour_2d.end ()); - } - - bool is_selected (CGAL::qglviewer::Vec& p) - { - if (domain_rectangle.xmin () < p.x && - p.x < domain_rectangle.xmax () && - domain_rectangle.ymin () < p.y && - p.y < domain_rectangle.ymax ()) - { - if (rectangle) - return true; -/* - * domain_freeform.has_on_bounded_side() requires the polygon to be simple, which is never the case. - * However, it works very well even if the polygon is not simple, so we use this instead to avoid - * the cgal_assertion on is_simple().*/ - - - if (CGAL::bounded_side_2(domain_freeform.container().begin(), - domain_freeform.container().end(), - Point_2(p.x, p.y), - domain_freeform.traits_member()) == CGAL::ON_BOUNDED_SIDE) - return true; - } - return false; - } - - -}; // end class Scene_point_set_selection_visualizer /////////////////////////////////////////////////////////////////////////////////////////////////// @@ -208,7 +56,7 @@ class Selection_test { CGAL::qglviewer::Camera* camera; const CGAL::qglviewer::Vec offset; Scene_edit_box_item* edit_box; - Scene_point_set_selection_visualizer* visualizer; + Selection_visualizer* visualizer; const Ui::PointSetSelection& ui_widget; @@ -219,7 +67,7 @@ public: CGAL::qglviewer::Camera* camera, const CGAL::qglviewer::Vec offset, Scene_edit_box_item* edit_box, - Scene_point_set_selection_visualizer* visualizer, + Selection_visualizer* visualizer, const Ui::PointSetSelection& ui_widget) : point_set (point_set) , selected (selected) @@ -652,12 +500,12 @@ protected: shift_pressing = modifiers.testFlag(Qt::ShiftModifier); ctrl_pressing = modifiers.testFlag(Qt::ControlModifier); - background = static_cast(*CGAL::QGLViewer::QGLViewerPool().begin())->grabFramebuffer(); } // mouse events if(shift_pressing && event->type() == QEvent::MouseButtonPress) { + background = static_cast(*CGAL::QGLViewer::QGLViewerPool().begin())->grabFramebuffer(); QMouseEvent *mouseEvent = static_cast(event); // Start selection if (mouseEvent->button() == Qt::LeftButton) @@ -697,7 +545,7 @@ protected: if (viewer->camera()->frame()->isSpinning()) viewer->camera()->frame()->stopSpinning(); - visualizer = new Scene_point_set_selection_visualizer(ui_widget.rectangle->isChecked(), + visualizer = new Selection_visualizer(ui_widget.rectangle->isChecked(), point_set_item->bbox()); visualizer->sample_mouse_path(background); @@ -1035,7 +883,7 @@ private: QAction* add_box; Ui::PointSetSelection ui_widget; - Scene_point_set_selection_visualizer* visualizer; + Selection_visualizer* visualizer; Neighborhood neighborhood; bool shift_pressing; bool ctrl_pressing; diff --git a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_shape_detection_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_shape_detection_plugin.cpp index eef452a345c..1f138064785 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_shape_detection_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_shape_detection_plugin.cpp @@ -1,7 +1,6 @@ #include "config.h" #include "Scene_points_with_normal_item.h" #include "Scene_polygon_soup_item.h" -#include "Scene_polyhedron_item.h" #include "Scene_surface_mesh_item.h" #include @@ -358,6 +357,7 @@ private: ++ nb_colored_pts; colored_item->point_set()->set_color(*it, r, g, b); } + colored_item->invalidateOpenGLBuffers(); } // Providing a useful name consisting of the order of detection, name of type and number of inliers @@ -402,34 +402,19 @@ private: if (dialog.generate_alpha ()) { // If plane, build alpha shape - Scene_polyhedron_item* poly_item = NULL; Scene_surface_mesh_item* sm_item = NULL; - if(mw->property("is_polyhedron_mode").toBool()){ - poly_item = new Scene_polyhedron_item; - } else { - sm_item = new Scene_surface_mesh_item; - } + sm_item = new Scene_surface_mesh_item; + build_alpha_shape (*(point_item->point_set()), pshape, - poly_item, sm_item, dialog.cluster_epsilon()); - - if(poly_item){ - poly_item->setColor(point_item->color ()); - poly_item->setName(QString("%1%2_alpha_shape").arg(QString::fromStdString(ss.str())) - .arg (QString::number (shape->indices_of_assigned_points().size()))); - poly_item->setRenderingMode (Flat); - - scene->addItem(poly_item); - if(scene->item_id(groups[0]) == -1) - scene->addItem(groups[0]); - scene->changeGroup(poly_item, groups[0]); - } + sm_item, dialog.cluster_epsilon()); if(sm_item){ sm_item->setColor(point_item->color ()); sm_item->setName(QString("%1%2_alpha_shape").arg(QString::fromStdString(ss.str())) .arg (QString::number (shape->indices_of_assigned_points().size()))); sm_item->setRenderingMode (Flat); + sm_item->invalidateOpenGLBuffers(); scene->addItem(sm_item); if(scene->item_id(groups[0]) == -1) scene->addItem(groups[0]); @@ -452,6 +437,7 @@ private: point_item->setRenderingMode(item->renderingMode()); if (dialog.generate_subset()){ + point_item->invalidateOpenGLBuffers(); scene->addItem(point_item); if (dynamic_cast *>(shape.get())) { @@ -469,6 +455,7 @@ private: if(scene->item_id(groups[0]) == -1) scene->addItem(groups[0]); + point_item->invalidateOpenGLBuffers(); scene->changeGroup(point_item, groups[0]); } else if (dynamic_cast *>(shape.get())) @@ -523,6 +510,7 @@ private: pts_full->setName(tr("%1 (structured)").arg(item->name())); pts_full->setRenderingMode(PointsPlusNormals); pts_full->setColor(Qt::blue); + pts_full->invalidateOpenGLBuffers(); scene->addItem (pts_full); } std::cerr << "done" << std::endl; @@ -554,7 +542,7 @@ private: } void build_alpha_shape (Point_set& points, boost::shared_ptr > plane, - Scene_polyhedron_item* item, Scene_surface_mesh_item* sm_item, double epsilon); + Scene_surface_mesh_item* sm_item, double epsilon); }; // end Polyhedron_demo_point_set_shape_detection_plugin @@ -619,8 +607,7 @@ void Polyhedron_demo_point_set_shape_detection_plugin::on_actionDetect_triggered } void Polyhedron_demo_point_set_shape_detection_plugin::build_alpha_shape -(Point_set& points, boost::shared_ptr > plane, - Scene_polyhedron_item* item, Scene_surface_mesh_item* sm_item, double epsilon) +(Point_set& points, boost::shared_ptr > plane, Scene_surface_mesh_item* sm_item, double epsilon) { typedef Kernel::Point_2 Point_2; typedef CGAL::Alpha_shape_vertex_base_2 Vb; @@ -666,9 +653,6 @@ void Polyhedron_demo_point_set_shape_detection_plugin::build_alpha_shape } soup_item->orient(); - if(item){ - soup_item->exportAsPolyhedron (item->polyhedron()); - } if(sm_item){ soup_item->exportAsSurfaceMesh (sm_item->polyhedron()); } diff --git a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_shape_detection_plugin.ui b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_shape_detection_plugin.ui index c9c3c76e2db..a98d02d7ff7 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_shape_detection_plugin.ui +++ b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_shape_detection_plugin.ui @@ -7,7 +7,7 @@ 0 0 495 - 551 + 552 @@ -117,19 +117,6 @@ - - - - Qt::Vertical - - - - 20 - 40 - - - - @@ -301,19 +288,6 @@ - - - - Qt::Vertical - - - - 20 - 40 - - - - diff --git a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_to_mesh_distance_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_to_mesh_distance_plugin.cpp index 4c444c43ab1..582335319fd 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_to_mesh_distance_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_to_mesh_distance_plugin.cpp @@ -5,7 +5,6 @@ #include #include #include -#include #include #include #include "Messages_interface.h" @@ -132,19 +131,16 @@ public: { if(scene->selectionIndices().size() != 2) return false; - Scene_polyhedron_item* poly = NULL; Scene_surface_mesh_item* sm = NULL; Scene_points_with_normal_item* pn = NULL; Q_FOREACH(Scene_interface::Item_id i,scene->selectionIndices()) { - if(!poly) - poly = qobject_cast(scene->item(i)); if(!sm) sm = qobject_cast(scene->item(i)); if(!pn) pn = qobject_cast(scene->item(i)); } - if((!poly && ! sm)|| !pn) + if(! sm|| !pn) return false; else return true; @@ -205,19 +201,16 @@ private Q_SLOTS: } void perform() { - Scene_polyhedron_item* poly = NULL; Scene_surface_mesh_item* sm = NULL; Scene_points_with_normal_item* pn = NULL; Q_FOREACH(Scene_interface::Item_id i,scene->selectionIndices()) { - if(!poly) - poly = qobject_cast(scene->item(i)); if(!sm) sm = qobject_cast(scene->item(i)); if(!pn) pn = qobject_cast(scene->item(i)); } - if((!poly && ! sm)|| !pn) + if(! sm|| !pn) return ; QApplication::setOverrideCursor(Qt::WaitCursor); Scene_points_with_normal_item* new_item = new Scene_points_with_normal_item(*pn); @@ -241,10 +234,7 @@ private Q_SLOTS: points->collect_garbage(); std::vector distances(points->size()); double hdist; - if(poly) - hdist = compute_distances(*poly->face_graph(), *points, distances); - else - hdist = compute_distances(*sm->face_graph(), *points, distances); + hdist = compute_distances(*sm->face_graph(), *points, distances); if(hdist == 0) hdist++; int id = 0; @@ -279,6 +269,7 @@ private Q_SLOTS: if(!dock_widget->isVisible()) { dock_widget->show(); + dock_widget->raise(); } perform(); } diff --git a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_wlop_plugin.ui b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_wlop_plugin.ui index 29f02784817..c38b18c5c2e 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_wlop_plugin.ui +++ b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_wlop_plugin.ui @@ -7,7 +7,7 @@ 0 0 539 - 480 + 108 diff --git a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Surface_reconstruction_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Surface_reconstruction_plugin.cpp index 8b62dbf4cc1..8836464f409 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Surface_reconstruction_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Surface_reconstruction_plugin.cpp @@ -8,10 +8,8 @@ #include #include "Scene_polygon_soup_item.h" -#include "Scene_polyhedron_item.h" #include "Scene_surface_mesh_item.h" #include "Scene_points_with_normal_item.h" -#include "Polyhedron_type.h" #include "SMesh_type.h" #include #include @@ -104,14 +102,6 @@ struct Construct{ // Poisson reconstruction method: -// Reconstructs a surface mesh from a point set and returns it as a polyhedron. -Polyhedron* poisson_reconstruct_polyhedron(Point_set& points, - Kernel::FT sm_angle, // Min triangle angle (degrees). - Kernel::FT sm_radius, // Max triangle size w.r.t. point set average spacing. - Kernel::FT sm_distance, // Approximation error w.r.t. point set average spacing. - const QString& solver_name, // solver name - bool use_two_passes, - bool do_not_fill_holes); // Reconstructs a surface mesh from a point set and returns it. SMesh* poisson_reconstruct_sm(Point_set& points, Kernel::FT sm_angle, // Min triangle angle (degrees). @@ -875,44 +865,23 @@ private: local_timer.start(); Priority_with_structure_coherence priority (structuring, 10. * op.cluster_epsilon); - - if(mw->property("is_polyhedron_mode").toBool()) - { - Scene_polyhedron_item* reco_item = new Scene_polyhedron_item(Polyhedron()); - Polyhedron& P = * const_cast(reco_item->polyhedron()); - Construct construct(P,structured->point_set()->points().begin(),structured->point_set()->points().end()); - CGAL::advancing_front_surface_reconstruction(structured->point_set()->points().begin(), - structured->point_set()->points().end(), - construct, - priority, - 5., - 0.52); - local_timer.stop(); - std::cerr << "done in " << local_timer.time() << " second(s)" << std::endl; - - reco_item->setName(tr("%1 (RANSAC-based reconstruction)").arg(scene->item(index)->name())); - reco_item->setColor(Qt::magenta); - reco_item->setRenderingMode(FlatPlusEdges); - scene->addItem(reco_item); - } - else - { - Scene_surface_mesh_item* reco_item = new Scene_surface_mesh_item(SMesh()); - SMesh& P = * const_cast(reco_item->polyhedron()); - Construct construct(P,structured->point_set()->points().begin(),structured->point_set()->points().end()); - CGAL::advancing_front_surface_reconstruction(structured->point_set()->points().begin(), - structured->point_set()->points().end(), - construct, - priority, - 5., - 0.52); - local_timer.stop(); - std::cerr << "done in " << local_timer.time() << " second(s)" << std::endl; - reco_item->setName(tr("%1 (RANSAC-based reconstruction)").arg(scene->item(index)->name())); - reco_item->setColor(Qt::magenta); - reco_item->setRenderingMode(FlatPlusEdges); - scene->addItem(reco_item); - } + Scene_surface_mesh_item* reco_item = new Scene_surface_mesh_item(SMesh()); + SMesh& P = * const_cast(reco_item->polyhedron()); + Construct construct(P,structured->point_set()->points().begin(),structured->point_set()->points().end()); + CGAL::advancing_front_surface_reconstruction(structured->point_set()->points().begin(), + structured->point_set()->points().end(), + construct, + priority, + 5., + 0.52); + local_timer.stop(); + std::cerr << "done in " << local_timer.time() << " second(s)" << std::endl; + reco_item->setName(tr("%1 (RANSAC-based reconstruction)").arg(scene->item(index)->name())); + reco_item->setColor(Qt::magenta); + reco_item->setRenderingMode(FlatPlusEdges); + reco_item->invalidateOpenGLBuffers(); + scene->addItem(reco_item); + if (dialog.generate_structured ()) { structured->setName(tr("%1 (structured)").arg(point_set_item->name())); @@ -1082,27 +1051,15 @@ void Polyhedron_demo_surface_reconstruction_plugin::automatic_reconstruction std::cerr << "Advancing front reconstruction... "; time.restart(); - if(mw->property("is_polyhedron_mode").toBool()) - { - Scene_polyhedron_item* reco_item = new Scene_polyhedron_item(Polyhedron()); - SurfaceReconstruction::advancing_front (*points, reco_item, 10. * (std::max)(noise_size, aniso_size)); - - reco_item->setName(tr("%1 (advancing front)").arg(scene->item(index)->name())); - reco_item->setColor(Qt::lightGray); - reco_item->setRenderingMode(FlatPlusEdges); - scene->addItem(reco_item); - } - else - { - Scene_surface_mesh_item* reco_item = new Scene_surface_mesh_item(SMesh()); - SurfaceReconstruction::advancing_front (*points, reco_item, 10. * (std::max)(noise_size, aniso_size)); - - reco_item->setName(tr("%1 (advancing front)").arg(scene->item(index)->name())); - reco_item->setColor(Qt::lightGray); - reco_item->setRenderingMode(FlatPlusEdges); - scene->addItem(reco_item); - } - std::cerr << "ok (" << time.elapsed() << " ms)" << std::endl; + Scene_surface_mesh_item* reco_item = new Scene_surface_mesh_item(SMesh()); + SurfaceReconstruction::advancing_front (*points, reco_item, 10. * (std::max)(noise_size, aniso_size)); + + reco_item->setName(tr("%1 (advancing front)").arg(scene->item(index)->name())); + reco_item->setColor(Qt::lightGray); + reco_item->setRenderingMode(FlatPlusEdges); + reco_item->invalidateOpenGLBuffers(); + scene->addItem(reco_item); + std::cerr << "ok (" << time.elapsed() << " ms)" << std::endl; } } @@ -1113,26 +1070,14 @@ void Polyhedron_demo_surface_reconstruction_plugin::automatic_reconstruction std::cerr << "Advancing front reconstruction... "; time.restart(); - if(mw->property("is_polyhedron_mode").toBool()) - { - Scene_polyhedron_item* reco_item = new Scene_polyhedron_item(Polyhedron()); - SurfaceReconstruction::advancing_front (*points, reco_item, 10. * (std::max)(noise_size, aniso_size)); - - reco_item->setName(tr("%1 (advancing front)").arg(scene->item(index)->name())); - reco_item->setColor(Qt::lightGray); - reco_item->setRenderingMode(FlatPlusEdges); - scene->addItem(reco_item); - } - else - { - Scene_surface_mesh_item* reco_item = new Scene_surface_mesh_item(SMesh()); - SurfaceReconstruction::advancing_front (*points, reco_item, 10. * (std::max)(noise_size, aniso_size)); - - reco_item->setName(tr("%1 (advancing front)").arg(scene->item(index)->name())); - reco_item->setColor(Qt::lightGray); - reco_item->setRenderingMode(FlatPlusEdges); - scene->addItem(reco_item); - } + Scene_surface_mesh_item* reco_item = new Scene_surface_mesh_item(SMesh()); + SurfaceReconstruction::advancing_front (*points, reco_item, 10. * (std::max)(noise_size, aniso_size)); + + reco_item->setName(tr("%1 (advancing front)").arg(scene->item(index)->name())); + reco_item->setColor(Qt::lightGray); + reco_item->setRenderingMode(FlatPlusEdges); + reco_item->invalidateOpenGLBuffers(); + scene->addItem(reco_item); std::cerr << "ok (" << time.elapsed() << " ms)" << std::endl; } @@ -1153,34 +1098,19 @@ void Polyhedron_demo_surface_reconstruction_plugin::automatic_reconstruction std::cerr << "Poisson reconstruction... "; time.restart(); - Polyhedron* pRemesh = NULL; SMesh* smRemesh = NULL; - if(mw->property("is_polyhedron_mode").toBool()) - pRemesh = poisson_reconstruct_polyhedron(*points, - 20, - 100 * (std::max)(noise_size, aniso_size), - (std::max)(noise_size, aniso_size), - QString ("Eigen - built-in CG"), false, false); - else - smRemesh = poisson_reconstruct_sm(*points, - 20, - 100 * (std::max)(noise_size, aniso_size), - (std::max)(noise_size, aniso_size), - QString ("Eigen - built-in CG"), false, false); - if(pRemesh) - { - // Add polyhedron to scene - Scene_polyhedron_item* reco_item = new Scene_polyhedron_item(pRemesh); - reco_item->setName(tr("%1 (poisson)").arg(pts_item->name())); - reco_item->setColor(Qt::lightGray); - scene->addItem(reco_item); - } - else if(smRemesh) + smRemesh = poisson_reconstruct_sm(*points, + 20, + 100 * (std::max)(noise_size, aniso_size), + (std::max)(noise_size, aniso_size), + QString ("Eigen - built-in CG"), false, false); + if(smRemesh) { // Add polyhedron to scene Scene_surface_mesh_item* reco_item = new Scene_surface_mesh_item(smRemesh); reco_item->setName(tr("%1 (poisson)").arg(pts_item->name())); reco_item->setColor(Qt::lightGray); + reco_item->invalidateOpenGLBuffers(); scene->addItem(reco_item); } @@ -1220,34 +1150,16 @@ void Polyhedron_demo_surface_reconstruction_plugin::advancing_front_reconstructi QApplication::setOverrideCursor(Qt::WaitCursor); std::cerr << "Advancing front reconstruction... "; - - if(mw->property("is_polyhedron_mode").toBool()) - { - Scene_polyhedron_item* reco_item = new Scene_polyhedron_item(Polyhedron()); - SurfaceReconstruction::advancing_front (*points, reco_item, - dialog.longest_edge (), - dialog.radius_ratio_bound (), - CGAL_PI * dialog.beta_angle () / 180.); - - reco_item->setName(tr("%1 (advancing front)").arg(scene->item(index)->name())); - reco_item->setColor(Qt::lightGray); - reco_item->setRenderingMode(FlatPlusEdges); - scene->addItem(reco_item); - } - else - { - Scene_surface_mesh_item* reco_item = new Scene_surface_mesh_item(SMesh()); - SurfaceReconstruction::advancing_front (*points, reco_item, - dialog.longest_edge (), - dialog.radius_ratio_bound (), - CGAL_PI * dialog.beta_angle () / 180.); - - reco_item->setName(tr("%1 (advancing front)").arg(scene->item(index)->name())); - reco_item->setColor(Qt::lightGray); - reco_item->setRenderingMode(FlatPlusEdges); - scene->addItem(reco_item); - } - + Scene_surface_mesh_item* reco_item = new Scene_surface_mesh_item(SMesh()); + SurfaceReconstruction::advancing_front (*points, reco_item, + dialog.longest_edge (), + dialog.radius_ratio_bound (), + CGAL_PI * dialog.beta_angle () / 180.); + + reco_item->setName(tr("%1 (advancing front)").arg(scene->item(index)->name())); + reco_item->setColor(Qt::lightGray); + reco_item->setRenderingMode(FlatPlusEdges); + reco_item->invalidateOpenGLBuffers(); QApplication::restoreOverrideCursor(); } } @@ -1364,32 +1276,10 @@ void Polyhedron_demo_surface_reconstruction_plugin::poisson_reconstruction // Reconstruct point set as a polyhedron - Polyhedron* pRemesh = NULL; SMesh* smRemesh= NULL; - if(mw->property("is_polyhedron_mode").toBool()) - pRemesh = poisson_reconstruct_polyhedron(*points, sm_angle, sm_radius, sm_distance, sm_solver, use_two_passes, - do_not_fill_holes); - else - smRemesh = poisson_reconstruct_sm(*points, sm_angle, sm_radius, sm_distance, sm_solver, use_two_passes, - do_not_fill_holes); - if(pRemesh) - { - // Add polyhedron to scene - Scene_polyhedron_item* new_item = new Scene_polyhedron_item(pRemesh); - new_item->setName(tr("%1 Poisson (%2 %3 %4)") - .arg(point_set_item->name()) - .arg(sm_angle) - .arg(sm_radius) - .arg(sm_distance)); - new_item->setColor(Qt::lightGray); - scene->addItem(new_item); - - - // Hide point set - point_set_item->setVisible(false); - scene->itemChanged(index); - } - else if(smRemesh) + smRemesh = poisson_reconstruct_sm(*points, sm_angle, sm_radius, sm_distance, sm_solver, use_two_passes, + do_not_fill_holes); + if(smRemesh) { // Add polyhedron to scene Scene_surface_mesh_item* new_item = new Scene_surface_mesh_item(smRemesh); diff --git a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Surface_reconstruction_plugin.ui b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Surface_reconstruction_plugin.ui index fe18f23a8dc..3cdd1a75902 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Surface_reconstruction_plugin.ui +++ b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Surface_reconstruction_plugin.ui @@ -7,7 +7,7 @@ 0 0 725 - 436 + 429 diff --git a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Surface_reconstruction_plugin_impl.cpp b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Surface_reconstruction_plugin_impl.cpp index 37ff02a5cc1..16e090f5b00 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Surface_reconstruction_plugin_impl.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Surface_reconstruction_plugin_impl.cpp @@ -23,7 +23,6 @@ #include #include "Kernel_type.h" -#include "Polyhedron_type.h" #include "SMesh_type.h" #include "Scene_points_with_normal_item.h" @@ -243,26 +242,6 @@ bool poisson_reconstruct(FaceGraph* graph, return true; } -Polyhedron* poisson_reconstruct_polyhedron(Point_set& points, - Kernel::FT sm_angle, // Min triangle angle (degrees). - Kernel::FT sm_radius, // Max triangle size w.r.t. point set average spacing. - Kernel::FT sm_distance, // Approximation error w.r.t. point set average spacing. - const QString& solver_name, // solver name - bool use_two_passes, - bool do_not_fill_holes) -{ - Polyhedron* res = new Polyhedron; - - if(poisson_reconstruct(res, points, sm_angle, sm_radius, sm_distance, - solver_name, use_two_passes, do_not_fill_holes)) - return res; - else - { - delete res; - return NULL; - } -} - SMesh* poisson_reconstruct_sm(Point_set& points, Kernel::FT sm_angle, // Min triangle angle (degrees). Kernel::FT sm_radius, // Max triangle size w.r.t. point set average spacing. diff --git a/Polyhedron/demo/Polyhedron/Plugins/Subdivision_methods/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/Subdivision_methods/CMakeLists.txt index bc42a9f5411..2c780cd68b3 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Subdivision_methods/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/Subdivision_methods/CMakeLists.txt @@ -2,4 +2,4 @@ include( polyhedron_demo_macros ) polyhedron_demo_plugin(subdivision_methods_plugin Subdivision_methods_plugin) -target_link_libraries(subdivision_methods_plugin PUBLIC scene_polyhedron_item scene_surface_mesh_item) +target_link_libraries(subdivision_methods_plugin PUBLIC scene_surface_mesh_item) diff --git a/Polyhedron/demo/Polyhedron/Plugins/Subdivision_methods/Subdivision_methods_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Subdivision_methods/Subdivision_methods_plugin.cpp index 999c6801dfe..c5c3067099e 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Subdivision_methods/Subdivision_methods_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Subdivision_methods/Subdivision_methods_plugin.cpp @@ -8,9 +8,7 @@ #include #include "Messages_interface.h" -#include "Scene_polyhedron_item.h" #include "Scene_surface_mesh_item.h" -#include "Polyhedron_type.h" #include "SMesh_type.h" #include using namespace CGAL::Three; @@ -53,8 +51,7 @@ public: } bool applicable(QAction*) const { - return qobject_cast(scene->item(scene->mainSelectionIndex())) - || qobject_cast(scene->item(scene->mainSelectionIndex())); + return qobject_cast(scene->item(scene->mainSelectionIndex())); } public Q_SLOTS: @@ -94,32 +91,17 @@ void Polyhedron_demo_subdivision_methods_plugin::apply_loop(FaceGraphItem* item, void Polyhedron_demo_subdivision_methods_plugin::on_actionLoop_triggered() { CGAL::Three::Scene_interface::Item_id index = scene->mainSelectionIndex(); - - Scene_polyhedron_item* item = - qobject_cast(scene->item(index)); - - if(!item) - { - Scene_surface_mesh_item* sm_item = - qobject_cast(scene->item(index)); - if(!sm_item) - return; - int nb_steps = QInputDialog::getInt(mw, - QString("Number of Iterations"), - QString("Choose number of iterations"), - 1, - 1); - apply_loop(sm_item, nb_steps); - } - else - { - int nb_steps = QInputDialog::getInt(mw, - QString("Number of Iterations"), - QString("Choose number of iterations"), - 1, - 1); - apply_loop(item, nb_steps); - } + + Scene_surface_mesh_item* sm_item = + qobject_cast(scene->item(index)); + if(!sm_item) + return; + int nb_steps = QInputDialog::getInt(mw, + QString("Number of Iterations"), + QString("Choose number of iterations"), + 1, + 1); + apply_loop(sm_item, nb_steps); } template @@ -140,32 +122,16 @@ void Polyhedron_demo_subdivision_methods_plugin::apply_catmullclark(FaceGraphIte void Polyhedron_demo_subdivision_methods_plugin::on_actionCatmullClark_triggered() { CGAL::Three::Scene_interface::Item_id index = scene->mainSelectionIndex(); - - Scene_polyhedron_item* item = - qobject_cast(scene->item(index)); - - if(!item) - { - Scene_surface_mesh_item* sm_item = - qobject_cast(scene->item(index)); - if(!sm_item) - return; - int nb_steps = QInputDialog::getInt(mw, - QString("Number of Iterations"), - QString("Choose number of iterations"), - 1, - 1); - apply_catmullclark(sm_item, nb_steps); - } - else{ - int nb_steps = QInputDialog::getInt(mw, - QString("Number of Iterations"), - QString("Choose number of iterations"), - 1, - 1); - apply_catmullclark(item, nb_steps); - } - + Scene_surface_mesh_item* sm_item = + qobject_cast(scene->item(index)); + if(!sm_item) + return; + int nb_steps = QInputDialog::getInt(mw, + QString("Number of Iterations"), + QString("Choose number of iterations"), + 1, + 1); + apply_catmullclark(sm_item, nb_steps); } template @@ -187,32 +153,17 @@ void Polyhedron_demo_subdivision_methods_plugin::apply_sqrt3(FaceGraphItem* item void Polyhedron_demo_subdivision_methods_plugin::on_actionSqrt3_triggered() { CGAL::Three::Scene_interface::Item_id index = scene->mainSelectionIndex(); - - Scene_polyhedron_item* item = - qobject_cast(scene->item(index)); - - if(!item) - { - Scene_surface_mesh_item* sm_item = - qobject_cast(scene->item(index)); - if(!sm_item) - return; - int nb_steps = QInputDialog::getInt(mw, - QString("Number of Iterations"), - QString("Choose number of iterations"), - 1, - 1); - apply_sqrt3(sm_item, nb_steps); - } - else{ - int nb_steps = QInputDialog::getInt(mw, - QString("Number of Iterations"), - QString("Choose number of iterations"), - 1, - 1); - apply_sqrt3(item, nb_steps); - } - + Scene_surface_mesh_item* sm_item = + qobject_cast(scene->item(index)); + if(!sm_item) + return; + int nb_steps = QInputDialog::getInt(mw, + QString("Number of Iterations"), + QString("Choose number of iterations"), + 1, + 1); + apply_sqrt3(sm_item, nb_steps); + } template @@ -235,30 +186,17 @@ void Polyhedron_demo_subdivision_methods_plugin::on_actionDooSabin_triggered() { CGAL::Three::Scene_interface::Item_id index = scene->mainSelectionIndex(); - Scene_polyhedron_item* item = - qobject_cast(scene->item(index)); - - if(!item) - { - Scene_surface_mesh_item* sm_item = - qobject_cast(scene->item(index)); - if(!sm_item) - return; - int nb_steps = QInputDialog::getInt(mw, - QString("Number of Iterations"), - QString("Choose number of iterations"), - 1, - 1); - apply_doosabin(sm_item, nb_steps); - } - else{ - int nb_steps = QInputDialog::getInt(mw, - QString("Number of Iterations"), - QString("Choose number of iterations"), - 1, - 1); - apply_doosabin(item, nb_steps); - } + Scene_surface_mesh_item* sm_item = + qobject_cast(scene->item(index)); + if(!sm_item) + return; + int nb_steps = QInputDialog::getInt(mw, + QString("Number of Iterations"), + QString("Choose number of iterations"), + 1, + 1); + apply_doosabin(sm_item, nb_steps); + } #include "Subdivision_methods_plugin.moc" diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/CMakeLists.txt index 04ae2ac748a..fae7ac22136 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/CMakeLists.txt @@ -2,39 +2,31 @@ include( polyhedron_demo_macros ) if(EIGEN3_FOUND) find_package(CGAL COMPONENTS Core) - + include(${CGAL_USE_FILE}) - + qt5_wrap_ui(parameterizationUI_FILES Parameterization_widget.ui OTE_dialog.ui) polyhedron_demo_plugin(parameterization_plugin Parameterization_plugin ${parameterizationUI_FILES}) - target_link_libraries(parameterization_plugin PUBLIC scene_polyhedron_item scene_textured_polyhedron_item scene_polyhedron_selection_item) - - polyhedron_demo_plugin(parameterization_sm_plugin Parameterization_plugin ${parameterizationUI_FILES}) - target_link_libraries(parameterization_sm_plugin PUBLIC scene_surface_mesh_item scene_textured_surface_mesh_item scene_surface_mesh_selection_item) - target_compile_definitions(parameterization_sm_plugin PUBLIC "-DUSE_SURFACE_MESH" ) + target_link_libraries(parameterization_plugin PUBLIC scene_surface_mesh_item scene_textured_item scene_selection_item) else(EIGEN3_FOUND) message(STATUS "NOTICE: Eigen 3.1 (or greater) was not found. The Parameterization plugin will not be available.") endif(EIGEN3_FOUND) qt5_wrap_ui( segmentationUI_FILES Mesh_segmentation_widget.ui) polyhedron_demo_plugin(mesh_segmentation_plugin Mesh_segmentation_plugin ${segmentationUI_FILES}) -target_link_libraries(mesh_segmentation_plugin PUBLIC scene_polyhedron_item scene_surface_mesh_item) +target_link_libraries(mesh_segmentation_plugin PUBLIC scene_surface_mesh_item) qt5_wrap_ui( mesh_plane_detectionUI_FILES Mesh_plane_detection_dialog.ui) polyhedron_demo_plugin(mesh_plane_detection_plugin Mesh_plane_detection_plugin ${mesh_plane_detectionUI_FILES}) -target_link_libraries(mesh_plane_detection_plugin PUBLIC scene_polyhedron_item) +target_link_libraries(mesh_plane_detection_plugin PUBLIC scene_surface_mesh_item) qt5_wrap_ui( mesh_simplificationUI_FILES Mesh_simplification_dialog.ui) polyhedron_demo_plugin(mesh_simplification_plugin Mesh_simplification_plugin ${mesh_simplificationUI_FILES}) -target_link_libraries(mesh_simplification_plugin PUBLIC scene_polyhedron_item scene_polyhedron_selection_item) - -polyhedron_demo_plugin(mesh_simplification_sm_plugin Mesh_simplification_plugin ${mesh_simplificationUI_FILES}) -target_link_libraries(mesh_simplification_sm_plugin PUBLIC scene_surface_mesh_item scene_surface_mesh_selection_item) -target_compile_definitions(mesh_simplification_sm_plugin PUBLIC "-DUSE_SURFACE_MESH" ) +target_link_libraries(mesh_simplification_plugin PUBLIC scene_surface_mesh_item scene_selection_item) qt5_wrap_ui( remeshingUI_FILES Remeshing_dialog.ui) polyhedron_demo_plugin(offset_meshing_plugin Offset_meshing_plugin ${remeshingUI_FILES}) -target_link_libraries(offset_meshing_plugin PUBLIC scene_polyhedron_item scene_surface_mesh_item scene_polygon_soup_item) +target_link_libraries(offset_meshing_plugin PUBLIC scene_surface_mesh_item scene_polygon_soup_item) if(TBB_FOUND) CGAL_target_use_TBB(offset_meshing_plugin) @@ -42,8 +34,4 @@ endif() qt5_wrap_ui( shortestPathUI_FILES Shortest_path_widget.ui ) polyhedron_demo_plugin(shortest_path_plugin Shortest_path_plugin ${shortestPathUI_FILES}) -target_link_libraries(shortest_path_plugin PUBLIC scene_polyhedron_item scene_polyhedron_shortest_path_item scene_basic_objects) - -polyhedron_demo_plugin(shortest_path_sm_plugin Shortest_path_plugin ${shortestPathUI_FILES}) -target_link_libraries(shortest_path_sm_plugin PUBLIC scene_surface_mesh_item scene_sm_shortest_path_item scene_basic_objects) -target_compile_definitions(shortest_path_sm_plugin PUBLIC "-DUSE_SURFACE_MESH" ) +target_link_libraries(shortest_path_plugin PUBLIC scene_surface_mesh_item scene_shortest_path_item scene_basic_objects) diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Mesh_plane_detection_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Mesh_plane_detection_plugin.cpp index b5c649bc824..4fb812dae88 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Mesh_plane_detection_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Mesh_plane_detection_plugin.cpp @@ -1,8 +1,7 @@ #include #include -#include "Scene_polyhedron_item.h" -#include "Polyhedron_type.h" +#include "Scene_surface_mesh_item.h" #include "Scene.h" #include "Color_map.h" @@ -14,7 +13,6 @@ #include #include #include -#include //#include #include #include @@ -44,7 +42,7 @@ class Polyhedron_demo_mesh_plane_detection_plugin : bool applicable(QAction*) const { return - qobject_cast(scene->item(scene->mainSelectionIndex())); + qobject_cast(scene->item(scene->mainSelectionIndex())); } void init(QMainWindow* mainWindow, CGAL::Three::Scene_interface* scene_interface, Messages_interface*) { @@ -66,9 +64,9 @@ class Polyhedron_demo_mesh_plane_detection_plugin : } template - void colorize_segmentation(Scene_polyhedron_item* item, SegmentPropertyMap& segment_ids, std::vector& color_vector); + void colorize_segmentation(Scene_surface_mesh_item* item, SegmentPropertyMap& segment_ids, std::vector& color_vector); - void check_and_set_ids(Polyhedron* polyhedron); + void check_and_set_ids(SMesh *sm); public Q_SLOTS: void on_actionPlaneDetection_triggered(); @@ -78,38 +76,37 @@ private: template - void detect_planes_in_mesh (Polyhedron& mesh, const double area_min, + void detect_planes_in_mesh (SMesh& mesh, const double area_min, const double angle_max, OutputIterator output) { + typedef SMesh::size_type size_type; + std::cerr << "Detecting planes with:" << std::endl << " * Area min = " << area_min << std::endl << " * Min cos angle = " << angle_max << std::endl; - std::vector label_region(mesh.size_of_facets(), 0); + std::vector label_region(mesh.number_of_faces(), 0); int class_index = 0; - std::vector facets (mesh.size_of_facets()); - for (typename Polyhedron::Facet_iterator f = mesh.facets_begin(); f != mesh.facets_end(); ++f) - facets[f->id()] = f; - for (typename Polyhedron::Facet_iterator f = mesh.facets_begin(); f != mesh.facets_end(); ++f) + for (typename SMesh::Face_iterator f = mesh.faces_begin(); f != mesh.faces_end(); ++f) { - if (label_region[f->id()] != 0) + if (label_region[*f] != 0) continue; class_index++; - label_region[f->id()] = class_index; - double area = PMP::face_area (f, mesh, PMP::parameters::geom_traits(Kernel())); + label_region[*f] = class_index; + double area = PMP::face_area (*f, mesh, PMP::parameters::geom_traits(EPICK())); //characteristics of the seed - Kernel::Vector_3 normal_seed = PMP::compute_face_normal (f, mesh, PMP::parameters::geom_traits(Kernel())); - Kernel::Point_3 pt_seed = f->halfedge()->vertex()->point(); - Kernel::Plane_3 optimal_plane(pt_seed, normal_seed); + EPICK::Vector_3 normal_seed = PMP::compute_face_normal (*f, mesh, PMP::parameters::geom_traits(EPICK())); + EPICK::Point_3 pt_seed = mesh.point(target(halfedge(*f, mesh), mesh)); + EPICK::Plane_3 optimal_plane(pt_seed, normal_seed); // Kernel::Plane_3 optimal_plane = f->plane(); //initialization containers - std::vector index_container (1, f->id()); - std::vector index_container_former_ring (1, f->id()); - std::list index_container_current_ring; + std::vector index_container (1,*f); + std::vector index_container_former_ring (1, *f); + std::list index_container_current_ring; //propagation bool propagation = true; @@ -117,30 +114,31 @@ private: propagation = false; - for (std::size_t k = 0; k < index_container_former_ring.size(); k++) + for (size_type k = 0; k < index_container_former_ring.size(); k++) { - typename Polyhedron::Halfedge_around_facet_circulator - circ = facets[index_container_former_ring[k]]->facet_begin(), start = circ; + typename SMesh::Halfedge_around_face_circulator + circ( mesh.halfedge(SMesh::Face_index(index_container_former_ring[k])), mesh) + , start = circ; do { - if (circ->is_border_edge()) + if (is_border(*circ, mesh)) continue; - typename Polyhedron::Facet_handle - neighbor = circ->opposite()->facet(); - std::size_t neighbor_index = neighbor->id(); + typename SMesh::Face_index + neighbor = mesh.face(opposite(*circ, mesh)); + size_type neighbor_index = neighbor; if (label_region[neighbor_index] == 0) { - Kernel::Vector_3 normal - = PMP::compute_face_normal (neighbor, mesh, PMP::parameters::geom_traits(Kernel())); + EPICK::Vector_3 normal + = PMP::compute_face_normal (neighbor, mesh, PMP::parameters::geom_traits(EPICK())); if (std::fabs(normal * optimal_plane.orthogonal_vector()) > angle_max) { label_region[neighbor_index] = class_index; propagation = true; index_container_current_ring.push_back(neighbor_index); - area += PMP::face_area (neighbor, mesh, PMP::parameters::geom_traits(Kernel())); + area += PMP::face_area (neighbor, mesh, PMP::parameters::geom_traits(EPICK())); } } } @@ -149,7 +147,7 @@ private: //update containers index_container_former_ring.clear(); - for (std::list::iterator it = index_container_current_ring.begin(); + for (std::list::iterator it = index_container_current_ring.begin(); it != index_container_current_ring.end(); ++it) { index_container_former_ring.push_back(*it); @@ -163,8 +161,8 @@ private: if (area < area_min) { class_index--; - label_region[f->id()] = 0; - for (std::size_t k = 0; k < index_container.size(); k++) + label_region[*f] = 0; + for (size_type k = 0; k < index_container.size(); k++) label_region[index_container[k]] = 0; } } @@ -183,12 +181,12 @@ void Polyhedron_demo_mesh_plane_detection_plugin::on_actionPlaneDetection_trigge { const CGAL::Three::Scene_interface::Item_id index = scene->mainSelectionIndex(); - Scene_polyhedron_item* poly_item = - qobject_cast(scene->item(index)); + Scene_surface_mesh_item* poly_item = + qobject_cast(scene->item(index)); if (poly_item) { - Polyhedron& pmesh =*poly_item->polyhedron(); + SMesh& pmesh =*poly_item->polyhedron(); QDialog dialog(mw); Ui::Mesh_plane_detection_dialog ui; @@ -204,18 +202,18 @@ void Polyhedron_demo_mesh_plane_detection_plugin::on_actionPlaneDetection_trigge QApplication::setOverrideCursor(Qt::WaitCursor); QApplication::processEvents(); - check_and_set_ids (&pmesh); + //check_and_set_ids (&pmesh); std::vector indices; detect_planes_in_mesh (pmesh, ui.minimumAreaDoubleSpinBox->value(), std::fabs(std::cos (CGAL_PI * ui.maximumDeviationFromNormalSpinBox->value() / 180.)), std::back_inserter (indices)); - poly_item->set_color_vector_read_only(true); + //poly_item->set_color_vector_read_only(true); colorize_segmentation (poly_item, indices, poly_item->color_vector()); std::cerr << "ok (" << time.elapsed() << " ms, " - << pmesh.size_of_halfedges() / 2 << " edges)" << std::endl; + << pmesh.number_of_halfedges() / 2 << " edges)" << std::endl; poly_item->invalidateOpenGLBuffers(); scene->itemChanged(index); @@ -224,30 +222,21 @@ void Polyhedron_demo_mesh_plane_detection_plugin::on_actionPlaneDetection_trigge } - -void Polyhedron_demo_mesh_plane_detection_plugin::check_and_set_ids(Polyhedron* polyhedron) -{ - std::size_t facet_id = 0; - for(Polyhedron::Facet_iterator facet_it = polyhedron->facets_begin(); - facet_it != polyhedron->facets_end(); ++facet_it, ++facet_id) - facet_it->id() = facet_id; -} - template void Polyhedron_demo_mesh_plane_detection_plugin::colorize_segmentation( - Scene_polyhedron_item* item, + Scene_surface_mesh_item* item, SegmentPropertyMap& segment_ids, std::vector& color_vector) { item->setItemIsMulticolor(true); - Polyhedron* polyhedron = item->polyhedron(); + SMesh* sm = item->face_graph(); color_vector.clear(); std::size_t max_segment = 0; - for(Polyhedron::Facet_iterator facet_it = polyhedron->facets_begin(); - facet_it != polyhedron->facets_end(); ++facet_it) + for(SMesh::Face_iterator facet_it = sm->faces_begin(); + facet_it != sm->faces_end(); ++facet_it) { - std::size_t segment_id = segment_ids[facet_it->id()]; - facet_it->set_patch_id(static_cast(segment_id)); + std::size_t segment_id = segment_ids[static_cast(*facet_it)]; + sm->property_map("f:patch_id").first[*facet_it] = static_cast(segment_id); max_segment = (std::max)(max_segment, segment_id); } color_vector.push_back(QColor(0, 0, 0)); diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Mesh_segmentation_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Mesh_segmentation_plugin.cpp index b6b5b983269..000dbb05def 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Mesh_segmentation_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Mesh_segmentation_plugin.cpp @@ -3,8 +3,6 @@ #include "ui_Mesh_segmentation_widget.h" #include "Scene_surface_mesh_item.h" -#include "Scene_polyhedron_item.h" -#include "Polyhedron_type.h" #include "Scene.h" #include "Color_map.h" @@ -17,17 +15,13 @@ #include #include #include +#include //#include #include #include #include #include -void set_color_read_only(Scene_polyhedron_item* poly) -{ poly->set_color_vector_read_only(true); } - -void set_color_read_only(Scene_surface_mesh_item* ) -{} template struct FaceGraph_with_id_to_vector_property_map @@ -68,7 +62,6 @@ class Polyhedron_demo_mesh_segmentation_plugin : Q_PLUGIN_METADATA(IID "com.geometryfactory.PolyhedronDemo.PluginInterface/1.0") private: - typedef std::map > Item_sdf_map; typedef std::map > SM_item_sdf_map; public: @@ -77,9 +70,7 @@ public: } bool applicable(QAction*) const { - return - qobject_cast(scene->item(scene->mainSelectionIndex())) - || qobject_cast(scene->item(scene->mainSelectionIndex())); + return qobject_cast(scene->item(scene->mainSelectionIndex())); } void init(QMainWindow* mainWindow, CGAL::Three::Scene_interface* scene_interface, Messages_interface*) { @@ -110,19 +101,6 @@ public: { dock_widget->hide(); } - - void check_and_set_ids(Polyhedron *face_graph) - { - Polyhedron::Facet_iterator a_facet = face_graph->facets_begin(); - Polyhedron::Facet_iterator another_facet = ++face_graph->facets_begin(); - if(a_facet->id() != another_facet->id()) { return; } // ids are OK - std::size_t facet_id = 0; - for(Polyhedron::Facet_iterator facet_it = face_graph->facets_begin(); - facet_it != face_graph->facets_end(); ++facet_it, ++facet_id) - { - facet_it->id() = facet_id; - } - } void check_and_set_ids(SMesh* face_graph) { face_graph->collect_garbage(); @@ -152,15 +130,8 @@ private: std::vector color_map_sdf; std::vector color_map_segmentation; - Item_sdf_map item_sdf_map; SM_item_sdf_map sm_item_sdf_map; - - Item_sdf_map& get_sdf_map(Scene_polyhedron_item*) - { - return item_sdf_map; - } - SM_item_sdf_map& get_sdf_map(Scene_surface_mesh_item*) { return sm_item_sdf_map; @@ -203,16 +174,13 @@ void Polyhedron_demo_mesh_segmentation_plugin::init_color_map_segmentation() void Polyhedron_demo_mesh_segmentation_plugin::itemAboutToBeDestroyed(CGAL::Three::Scene_item* scene_item) { - if(Scene_polyhedron_item* item = qobject_cast(scene_item)) { - item_sdf_map.erase(item); - } if(Scene_surface_mesh_item* sm_item = qobject_cast(scene_item)) { sm_item_sdf_map.erase(sm_item); } } void Polyhedron_demo_mesh_segmentation_plugin::on_actionSegmentation_triggered() -{ dock_widget->show(); } +{ dock_widget->show(); dock_widget->raise();} template void Polyhedron_demo_mesh_segmentation_plugin::apply_SDF_button_clicked(FacegraphItem* item) @@ -248,8 +216,6 @@ void Polyhedron_demo_mesh_segmentation_plugin::apply_SDF_button_clicked(Facegrap std::cout << "ok (" << time.elapsed() << " ms)" << std::endl; std::cout << "SDF computation is completed. Min-SDF : " << min_max_sdf.first << " " "Max-SDF : " << min_max_sdf.second << std::endl; - - set_color_read_only(pair->first); colorize_sdf(pair->first, sdf_pmap, pair->first->color_vector()); pair->first->setName(tr("(SDF-%1-%2)").arg(number_of_rays).arg(ui_widget.Cone_angle_spin_box->value())); @@ -271,13 +237,6 @@ void Polyhedron_demo_mesh_segmentation_plugin::apply_SDF_button_clicked(Facegrap void Polyhedron_demo_mesh_segmentation_plugin::on_SDF_button_clicked() { CGAL::Three::Scene_interface::Item_id index = scene->mainSelectionIndex(); - Scene_polyhedron_item* item = qobject_cast(scene->item(index)); - if(item) - { - apply_SDF_button_clicked(item); - return; - } - Scene_surface_mesh_item* sm_item = qobject_cast(scene->item(index)); if(sm_item) apply_SDF_button_clicked(sm_item); @@ -286,6 +245,7 @@ void Polyhedron_demo_mesh_segmentation_plugin::on_SDF_button_clicked() template void Polyhedron_demo_mesh_segmentation_plugin::apply_Partition_button_clicked(FacegraphItem* item) { + typedef typename FacegraphItem::Face_graph Facegraph; QApplication::setOverrideCursor(Qt::WaitCursor); @@ -315,7 +275,13 @@ void Polyhedron_demo_mesh_segmentation_plugin::apply_Partition_button_clicked(Fa get_sdf_map(item).insert(std::make_pair(item, std::vector()) ); pair = res.first; } - + bool isClosed = is_closed(*pair->first->face_graph()); + if(!isClosed) + { + QApplication::restoreOverrideCursor(); + QMessageBox::warning(mw, "Warning", "This mesh has boundaries, therefore the results may be unreliable or meaningless."); + QApplication::setOverrideCursor(Qt::WaitCursor); + } check_and_set_ids(pair->first->face_graph()); QTime time; time.start(); @@ -326,16 +292,37 @@ void Polyhedron_demo_mesh_segmentation_plugin::apply_Partition_button_clicked(Fa FaceGraph_with_id_to_vector_property_map sdf_pmap(&pair->second, fidmap); sdf_values(*(pair->first->face_graph()), sdf_pmap, cone_angle, number_of_rays); } - + + + std::vector internal_segment_map(num_faces(*pair->first->face_graph())); FaceGraph_with_id_to_vector_property_map segment_pmap(&internal_segment_map, fidmap); FaceGraph_with_id_to_vector_property_map sdf_pmap(&pair->second, fidmap); + if(!isClosed) + { + bool has_sdf_values = false; + BOOST_FOREACH(typename boost::graph_traits::face_descriptor f, + faces(*pair->first->face_graph())) + { + if(sdf_pmap[f] != -1 + && sdf_pmap[f] != std::numeric_limits::max()) + { + has_sdf_values = true; + break; + } + } + if(!has_sdf_values) + { + QApplication::restoreOverrideCursor(); + QMessageBox::warning(mw, "Error", "No SDF value could be computed, aborting..."); + return; + } + } std::size_t nb_segments = segmentation_from_sdf_values(*(pair->first->face_graph()) ,sdf_pmap, segment_pmap, number_of_clusters, smoothness, extract_segments); std::cout << "ok (" << time.elapsed() << " ms)" << std::endl; std::cout << "Segmentation is completed. Number of segments : " << nb_segments << std::endl; - set_color_read_only(pair->first); colorize_segmentation(pair->first, segment_pmap, pair->first->color_vector()); pair->first->setName(tr("(Segmentation-%1-%2)").arg(number_of_clusters).arg(smoothness)); @@ -358,11 +345,6 @@ void Polyhedron_demo_mesh_segmentation_plugin::apply_Partition_button_clicked(Fa void Polyhedron_demo_mesh_segmentation_plugin::on_Partition_button_clicked() { CGAL::Three::Scene_interface::Item_id index = scene->mainSelectionIndex(); - Scene_polyhedron_item* item = qobject_cast(scene->item(index)); - if(item) { - apply_Partition_button_clicked(item); - return; - } Scene_surface_mesh_item* sm_item = qobject_cast(scene->item(index)); if(sm_item) apply_Partition_button_clicked(sm_item); diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Mesh_simplification_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Mesh_simplification_plugin.cpp index e320a2198e0..1bff2f5dfc2 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Mesh_simplification_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Mesh_simplification_plugin.cpp @@ -1,12 +1,6 @@ #include -#ifdef USE_SURFACE_MESH #include "Scene_surface_mesh_item.h" -#else -#include "Scene_polyhedron_item.h" -#include "Polyhedron_type.h" -#endif - #include "Scene_polyhedron_selection_item.h" #include @@ -25,11 +19,7 @@ #include "ui_Mesh_simplification_dialog.h" -#ifdef USE_SURFACE_MESH typedef Scene_surface_mesh_item Scene_facegraph_item; -#else -typedef Scene_facegraph_item Scene_facegraph_item; -#endif typedef Scene_facegraph_item::Face_graph FaceGraph; class Custom_stop_predicate @@ -195,18 +185,14 @@ void Polyhedron_demo_mesh_simplification_plugin::on_actionSimplify_triggered() if (poly_item != NULL) { poly_item->invalidateOpenGLBuffers(); -#ifdef USE_SURFACE_MESH poly_item->polyhedron()->collect_garbage(); -#endif } else { -#ifdef USE_SURFACE_MESH selection_item->polyhedron_item()->polyhedron()->collect_garbage(); -#endif - selection_item->poly_item_changed(); - selection_item->changed_with_poly_item(); - selection_item->invalidateOpenGLBuffers(); + selection_item->poly_item_changed(); + selection_item->changed_with_poly_item(); + selection_item->invalidateOpenGLBuffers(); } scene->itemChanged(index); diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/OTE_dialog.ui b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/OTE_dialog.ui index f5ae423667a..d382cc7ef6c 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/OTE_dialog.ui +++ b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/OTE_dialog.ui @@ -7,7 +7,7 @@ 0 0 355 - 100 + 79 @@ -74,19 +74,6 @@ - - - - Qt::Vertical - - - - 20 - 40 - - - - diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Offset_meshing_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Offset_meshing_plugin.cpp index 1d544d5e912..4c196105039 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Offset_meshing_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Offset_meshing_plugin.cpp @@ -9,7 +9,6 @@ #include #include #include -#include "Scene_polyhedron_item.h" #include "Scene_surface_mesh_item.h" #include "Scene_polygon_soup_item.h" #include @@ -89,7 +88,7 @@ class Polygon_soup_offset_function { const Points* points_vector_ptr; public: typedef Polygon_iterator key_type; - typedef Kernel::Point_3 value_type; + typedef EPICK::Point_3 value_type; typedef value_type reference; typedef boost::readable_property_map_tag category; @@ -110,7 +109,7 @@ class Polygon_soup_offset_function { const Points* points_vector_ptr; public: typedef Polygon_iterator key_type; - typedef Kernel::Triangle_3 value_type; + typedef EPICK::Triangle_3 value_type; typedef value_type reference; typedef boost::readable_property_map_tag category; @@ -164,7 +163,7 @@ class Polygon_soup_offset_function { }; // end struct template AABB_primitive - typedef CGAL::AABB_traits AABB_traits; + typedef CGAL::AABB_traits AABB_traits; typedef CGAL::AABB_tree AABB_tree; std::shared_ptr m_tree_ptr; @@ -187,11 +186,11 @@ public: m_tree_ptr->accelerate_distance_queries(); } - double operator()(const Kernel::Point_3& p) const + double operator()(const EPICK::Point_3& p) const { using CGAL::sqrt; - Kernel::Point_3 closest_point = m_tree_ptr->closest_point(p); + EPICK::Point_3 closest_point = m_tree_ptr->closest_point(p); double distance = sqrt(squared_distance(p, closest_point)); return m_offset_distance - distance; @@ -202,26 +201,16 @@ public: } //end of CGAL namespace -Scene_polyhedron_item* make_item(Polyhedron* poly) -{ - return new Scene_polyhedron_item(poly); -} - Scene_surface_mesh_item* make_item(SMesh* sm) { return new Scene_surface_mesh_item(sm); } -CGAL::Offset_function +CGAL::Offset_function offset_function(SMesh* surface_mesh_ptr, double offset_value) { return { *surface_mesh_ptr, offset_value }; } -CGAL::Offset_function -offset_function(Polyhedron* polyhedron_ptr, double offset_value) { - return { *polyhedron_ptr, offset_value }; -} - CGAL::Polygon_soup_offset_function offset_function(Scene_polygon_soup_item* item, double offset_value) { return { item, offset_value }; @@ -256,7 +245,7 @@ CGAL::Three::Scene_item* cgal_off_meshing(QWidget*, const double approx, int tag) { - typedef Kernel GT; + typedef EPICK GT; typedef CGAL::Labeled_mesh_domain_3 Mesh_domain; typedef C3t3::Triangulation Tr; typedef CGAL::Mesh_criteria_3 Mesh_criteria; @@ -327,7 +316,7 @@ public: void init(QMainWindow* mainWindow, CGAL::Three::Scene_interface* scene_interface, Messages_interface*) { this->scene = scene_interface; this->mw = mainWindow; - actionOffsetMeshing = new QAction(tr("Offset meshing"), mw); + actionOffsetMeshing = new QAction(tr("Offset Meshing"), mw); actionOffsetMeshing->setProperty("subMenuName", "3D Surface Mesh Generation"); if(actionOffsetMeshing) { connect(actionOffsetMeshing, SIGNAL(triggered()), @@ -338,7 +327,6 @@ public: bool applicable(QAction*) const { Scene_item* item = scene->item(scene->mainSelectionIndex()); return - qobject_cast(item) || qobject_cast(item) || qobject_cast(item); } @@ -359,24 +347,13 @@ void Polyhedron_demo_offset_meshing_plugin::offset_meshing() { const CGAL::Three::Scene_interface::Item_id index = scene->mainSelectionIndex(); Scene_item* item = scene->item(index); - - Scene_polyhedron_item* poly_item = - qobject_cast(item); Scene_surface_mesh_item* sm_item = qobject_cast(item); Scene_polygon_soup_item* soup_item = qobject_cast(item); - Polyhedron* pMesh = NULL; SMesh* sMesh = NULL; - if(poly_item) - { - pMesh = poly_item->polyhedron(); - - if(!pMesh) - return; - } - else if(sm_item) +if(sm_item) { sMesh = sm_item->face_graph(); if(!sMesh) @@ -441,14 +418,6 @@ void Polyhedron_demo_offset_meshing_plugin::offset_meshing() sizing, approx, tag_index); - else if(pMesh) - new_item = cgal_off_meshing(mw, - pMesh, - offset_value, - angle, - sizing, - approx, - tag_index); else new_item = cgal_off_meshing(mw, sMesh, @@ -457,7 +426,6 @@ void Polyhedron_demo_offset_meshing_plugin::offset_meshing() sizing, approx, tag_index); - if(new_item) { new_item->setName(tr("%1 offset %5 (%2 %3 %4)") @@ -472,7 +440,7 @@ void Polyhedron_demo_offset_meshing_plugin::offset_meshing() item->setVisible(false); scene->itemChanged(index); } - + QApplication::restoreOverrideCursor(); } diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Parameterization_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Parameterization_plugin.cpp index d463915e332..06a7f88598b 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Parameterization_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Parameterization_plugin.cpp @@ -2,24 +2,11 @@ #include #include #include -#ifdef USE_SURFACE_MESH + #include "Scene_surface_mesh_item.h" #include "Scene_textured_surface_mesh_item.h" #include "Scene_polyhedron_selection_item.h" #include "SMesh_type.h" -#else -#include "Scene_polyhedron_item.h" -#include "Scene_textured_polyhedron_item.h" -#include "Scene_polyhedron_selection_item.h" -#include "Textured_polyhedron_type.h" -#include "Polyhedron_type.h" -#include -#include -#include -#include -#include -#include -#endif #include #include #include "Scene.h" @@ -66,7 +53,6 @@ #include "ui_Parameterization_widget.h" #include "ui_OTE_dialog.h" -#ifdef USE_SURFACE_MESH typedef Scene_surface_mesh_item Scene_facegraph_item; typedef Scene_textured_surface_mesh_item Scene_textured_facegraph_item; typedef SMesh Textured_face_graph; @@ -74,16 +60,6 @@ typedef SMesh Base_face_graph; typedef SMesh Face_graph; typedef EPICK Traits; -#else -typedef Scene_polyhedron_item Scene_facegraph_item; -typedef Scene_textured_polyhedron_item Scene_textured_facegraph_item; -typedef Textured_polyhedron Textured_face_graph; -typedef Textured_face_graph::Base Base_face_graph; -typedef Polyhedron Face_graph; -typedef Kernel Traits; - -#endif - namespace SMP = CGAL::Surface_mesh_parameterization; typedef boost::unordered_set::face_descriptor> Component; @@ -289,17 +265,15 @@ public : pen.setWidth(0); painter->setPen(pen); painter->setBrush(brush); -#ifdef USE_SURFACE_MESH SMesh::Property_map > uv; uv = graph->add_property_map >("h:uv",std::make_pair(0.0f,0.0f)).first; -#endif for( Component::iterator fi = components->at(m_current_component).begin(); fi != components->at(m_current_component).end(); ++fi) { boost::graph_traits::face_descriptor f(*fi); -#ifdef USE_SURFACE_MESH + QPointF points[3]; boost::graph_traits::halfedge_descriptor h = halfedge(f, *graph);; points[0] = QPointF(get(uv, h).first, get(uv, h).second); @@ -307,13 +281,6 @@ uv = graph->add_property_map >("h:uv points[1] = QPointF(get(uv, h).first, get(uv, h).second); h = next(next(halfedge(f, *graph), *graph), *graph); points[2] = QPointF(get(uv, h).first, get(uv, h).second); -#else - QPointF points[3]; - points[0] = QPointF(halfedge(f, *graph)->u(), f->halfedge()->v()); - points[1] = QPointF(halfedge(f, *graph)->next()->u(), f->halfedge()->next()->v()); - points[2] = QPointF(halfedge(f, *graph)->next()->next()->u(), f->halfedge()->next()->next()->v()); -#endif - painter->drawPolygon(points,3); } } @@ -384,26 +351,14 @@ public: autoConnectActions(); Q_FOREACH(QAction *action, _actions) action->setProperty("subMenuName", - #ifdef USE_SURFACE_MESH "Triangulated Surface Mesh Parameterization" - #else - "Triangulated Surface Mesh Parameterization for Polyhedron" - #endif ); dock_widget = new QDockWidget( - #ifdef USE_SURFACE_MESH - "UVMapping for Surface Mesh" - #else - "UVMapping for Polyhedron" - #endif + "UVMapping " , mw); ui_widget.setupUi(dock_widget); dock_widget->setWindowTitle(tr( - #ifdef USE_SURFACE_MESH - "UVMapping for Surface Mesh" - #else - "UVMapping for Polyhedron" - #endif + "UVMapping " )); graphics_scene = new QGraphicsScene(dock_widget); ui_widget.graphicsView->setScene(graphics_scene); @@ -595,9 +550,6 @@ void Polyhedron_demo_parameterization_plugin::parameterize(const Parameterizatio messages->error("Selected item has no valid polyhedron."); return; } -#ifndef USE_SURFACE_MESH - pMesh->normalize_border(); -#endif Scene_polyhedron_selection_item* sel_item = NULL; bool is_seamed = false; Q_FOREACH(CGAL::Three::Scene_interface::Item_id id, scene->selectionIndices()) @@ -640,72 +592,7 @@ void Polyhedron_demo_parameterization_plugin::parameterize(const Parameterizatio QTime time; time.start(); // add textured polyhedon to the scene - #ifndef USE_SURFACE_MESH - Textured_polyhedron *tpMesh = new Textured_polyhedron(); - Textured_polyhedron_builder builder; - builder.run(*pMesh,*tpMesh); - tpMesh->compute_normals(); - tpMesh->normalize_border(); - Base_face_graph tMesh = static_cast(*tpMesh); - - CGAL::set_halfedgeds_items_id(tMesh); - std::vector mark(tpMesh->size_of_halfedges()/2,false); - std::vector seam_edges; - if(is_seamed) - { - //create a textured_polyhedron edges selection from the ids of the corresponding vertices - BOOST_FOREACH(P_edge_descriptor ed, sel_item->selected_edges) - { - Polyhedron::Vertex_handle a(source(ed, *pMesh)), b(target(ed, *pMesh)); - - for(Textured_polyhedron::Edge_iterator it = - tMesh.edges_begin(); it != tMesh.edges_end(); - ++it) - { - Textured_polyhedron::Vertex_handle ta(source(it, tMesh)), tb(target(it, tMesh)); - if((ta->id() == a->id() && tb->id() == b->id()) - || - (ta->id() == b->id() && tb->id() == a->id())) - { - T_edge_descriptor ted(it); - seam_edges.push_back(ted); - break; - } - } - - } - qDebug() << sel_item->selected_edges.size() << ", " << seam_edges.size(); - //fill seam mesh pmaps - BOOST_FOREACH(T_edge_descriptor ed, seam_edges) - { - T_halfedge_descriptor hd = halfedge(ed, tMesh); - T_vertex_descriptor svd(source(hd, tMesh)), tvd(target(hd, tMesh)); - if(!is_border(ed, tMesh)) - { - put(seam_edge_pm, ed, true); - put(seam_vertex_pm, svd, true); - put(seam_vertex_pm, tvd, true); - mark[hd->id()/2] = true; - } - } - } - - // map the cones from the selection plugin to the textured polyhedron - boost::unordered_set unordered_cones; - if(method == PARAM_OTE) { - BOOST_FOREACH(P_vertex_descriptor vd, sel_item->selected_vertices) { - Polyhedron::Vertex_handle pvd(vd); - Textured_polyhedron::Vertex_iterator it = tMesh.vertices_begin(), - end = tMesh.vertices_end(); - for(; it!=end; ++it) { - Textured_polyhedron::Vertex_handle tvd(it); - if(it->id() == pvd->id()) { - unordered_cones.insert(tvd); - } - } - } - } -#else + // \todo for surface_mesh Base_face_graph tMesh = *pMesh; std::vector mark(num_halfedges(tMesh)/2,false); @@ -769,7 +656,6 @@ void Polyhedron_demo_parameterization_plugin::parameterize(const Parameterizatio } } } -#endif Seam_mesh sMesh(tMesh, seam_edge_pm, seam_vertex_pm); sMesh.set_seam_edges_number(static_cast(seam_edges.size())); @@ -1005,30 +891,7 @@ void Polyhedron_demo_parameterization_plugin::parameterize(const Parameterizatio QApplication::restoreOverrideCursor(); QPointF min(FLT_MAX, FLT_MAX), max(-FLT_MAX, -FLT_MAX); -#ifndef USE_SURFACE_MESH - Base_face_graph::Halfedge_iterator it1; - Textured_polyhedron::Halfedge_iterator it2; - for(it1 = tMesh.halfedges_begin(), - it2 = tpMesh->halfedges_begin(); - it1 != tMesh.halfedges_end()&& - it2 != tpMesh->halfedges_end(); - ++it1, ++it2) - { - Seam_mesh::halfedge_descriptor hd(it1); - FT u = uv_pm[target(hd, sMesh)].x(); - FT v = uv_pm[target(hd, sMesh)].y(); - it2->u() = u; - it2->v() = v; - if(umax.x()) - max.setX(u); - if(vmax.y()) - max.setY(v); - } -#else + SMesh::Property_map > uv; uv = tMesh.add_property_map >("h:uv",std::make_pair(0.0f,0.0f)).first; Base_face_graph::Halfedge_iterator it; @@ -1050,12 +913,10 @@ void Polyhedron_demo_parameterization_plugin::parameterize(const Parameterizatio max.setY(v); } -#endif - Components* components = new Components(0); components->resize(number_of_components); boost::graph_traits::face_iterator bfit; -#ifdef USE_SURFACE_MESH + for(bfit = faces(tMesh).begin(); bfit != faces(tMesh).end(); ++bfit) @@ -1066,19 +927,7 @@ void Polyhedron_demo_parameterization_plugin::parameterize(const Parameterizatio Scene_textured_facegraph_item* new_item = new Scene_textured_facegraph_item(tMesh); UVItem *projection = new UVItem(components,new_item->textured_face_graph(), uv_borders, QRectF(min, max)); projection->set_item_name(new_item_name); -#else - boost::graph_traits::face_iterator tfit; - for(bfit = faces(tMesh).begin(), tfit = faces(*tpMesh).begin(); - bfit != faces(tMesh).end() && tfit != faces(*tpMesh).end(); - ++bfit, ++tfit) - { - components->at(fccmap[*bfit]).insert(*tfit); - } - UVItem *projection = new UVItem(components,tpMesh, uv_borders, QRectF(min, max)); - projection->set_item_name(new_item_name); - Scene_textured_facegraph_item* new_item = new Scene_textured_facegraph_item(tpMesh); -#endif new_item->setName(new_item_name); new_item->setColor(Qt::white); new_item->setRenderingMode(poly_item->renderingMode()); @@ -1099,8 +948,10 @@ void Polyhedron_demo_parameterization_plugin::parameterize(const Parameterizatio current_uv_item = projection; qobject_cast(projections.key(current_uv_item))->add_border_edges(current_uv_item->concatenated_borders(), is_ogl_4_3); - if(dock_widget->isHidden()) + if(dock_widget->isHidden()){ dock_widget->setVisible(true); + dock_widget->raise(); + } dock_widget->setWindowTitle(tr("UVMapping for %1").arg(new_item->name())); ui_widget.component_numberLabel->setText(QString("Component : %1/%2").arg(current_uv_item->current_component()+1).arg(current_uv_item->number_of_components())); ui_widget.graphicsView->fitInView(projection->boundingRect(), Qt::KeepAspectRatio); diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Remeshing_dialog.ui b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Remeshing_dialog.ui index 3d5eaf74ba0..cfd2350787d 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Remeshing_dialog.ui +++ b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Remeshing_dialog.ui @@ -7,7 +7,7 @@ 0 0 344 - 168 + 169 @@ -112,16 +112,6 @@ - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - @@ -135,6 +125,16 @@ + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Scene_polyhedron_shortest_path_item.h b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Scene_polyhedron_shortest_path_item.h index 5766065b08e..c948289a9c6 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Scene_polyhedron_shortest_path_item.h +++ b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Scene_polyhedron_shortest_path_item.h @@ -6,7 +6,6 @@ #include #include "Messages_interface.h" -//#include "Polyhedron_type.h" #include "Kernel_type.h" diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Shortest_path_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Shortest_path_plugin.cpp index 8ecc9053a6b..b9995cba4f1 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Shortest_path_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Shortest_path_plugin.cpp @@ -2,15 +2,9 @@ #include #include -#ifdef USE_SURFACE_MESH #include "Scene_surface_mesh_item.h" -#else -#include "Scene_polyhedron_item.h" -#endif - #include "Scene_polyhedron_shortest_path_item.h" #include "Messages_interface.h" -#include "Polyhedron_type.h" #include "Scene.h" #include "ui_Shortest_path_widget.h" @@ -27,11 +21,7 @@ #include #include -#ifdef USE_SURFACE_MESH typedef Scene_surface_mesh_item Scene_facegraph_item; -#else -typedef Scene_polyhedron_item Scene_facegraph_item; -#endif typedef Scene_facegraph_item::Face_graph FaceGraph; using namespace CGAL::Three; @@ -90,22 +80,14 @@ public: this->m_messages = messages; dock_widget = new QDockWidget( - #ifdef USE_SURFACE_MESH - "Shortest Path for Surface Mesh" - #else - "Shortest Path for Polyhedron" - #endif + "Shortest Path" , mw); dock_widget->setVisible(false); ui_widget.setupUi(dock_widget); dock_widget->setWindowTitle(tr( - #ifdef USE_SURFACE_MESH - "Shortest Path for Surface Mesh" - #else - "Shortest Path for Polyhedron" - #endif + "Shortest Path " )); addDockWidget(dock_widget); @@ -113,11 +95,7 @@ public: connect(ui_widget.Primitives_type_combo_box, SIGNAL(currentIndexChanged(int)), this, SLOT(on_Primitives_type_combo_box_changed(int))); actionMakeShortestPaths = new QAction( - #ifdef USE_SURFACE_MESH - "Make Shortest Path for Surface Mesh" - #else - "Make Shortest Path for Polyhedron" - #endif + "Make Shortest Path" , this->mw); actionMakeShortestPaths->setProperty("subMenuName", "Triangulated Surface Mesh Shortest Paths"); actionMakeShortestPaths->setObjectName("actionMakeShortestPaths"); @@ -312,16 +290,7 @@ void Polyhedron_demo_shortest_path_plugin::check_and_set_ids(FaceGraph* polyhedr vertex_iterator testVertex2 = ++vertices(*polyhedron).begin(); if(get(vimap, *testVertex1) == get(vimap, *testVertex2)) { -#ifdef USE_SURFACE_MESH polyhedron->collect_garbage(); -#else - std::size_t vertexId = 0; - for(Polyhedron::Vertex_iterator currentVertex = polyhedron->vertices_begin(); - currentVertex != polyhedron->vertices_end(); ++currentVertex, ++vertexId) - { - currentVertex->id() = vertexId; - } -#endif } boost::property_map::type himap = get(boost::halfedge_index, *polyhedron); @@ -331,16 +300,7 @@ void Polyhedron_demo_shortest_path_plugin::check_and_set_ids(FaceGraph* polyhedr if (get(himap, *testHalfedge1) == get(himap, *testHalfedge2)) { -#ifdef USE_SURFACE_MESH polyhedron->collect_garbage(); -#else - std::size_t halfedgeId = 0; - for(Polyhedron::Halfedge_iterator currentHalfedge = polyhedron->halfedges_begin(); - currentHalfedge != polyhedron->halfedges_end(); ++currentHalfedge, ++halfedgeId) - { - currentHalfedge->id() = halfedgeId; - } -#endif } face_iterator testFacet1 = faces(*polyhedron).begin(); @@ -350,16 +310,7 @@ void Polyhedron_demo_shortest_path_plugin::check_and_set_ids(FaceGraph* polyhedr if (get(fimap, *testFacet1) == get(fimap, *testFacet2)) { -#ifdef USE_SURFACE_MESH polyhedron->collect_garbage(); -#else - std::size_t facetId = 0; - for(Polyhedron::Facet_iterator currentFacet = polyhedron->facets_begin(); - currentFacet != polyhedron->facets_end(); ++currentFacet, ++facetId) - { - currentFacet->id() = facetId; - } -#endif } } diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Shortest_path_widget.ui b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Shortest_path_widget.ui index 754cb69a3bc..39e3082a1a6 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Shortest_path_widget.ui +++ b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Shortest_path_widget.ui @@ -7,7 +7,7 @@ 0 0 441 - 257 + 108 @@ -71,7 +71,7 @@ - + Qt::Vertical diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/CMakeLists.txt index cb951c59918..c248bf69d7f 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/CMakeLists.txt @@ -1,10 +1,8 @@ include( polyhedron_demo_macros ) if ( EIGEN3_FOUND AND "${EIGEN3_VERSION}" VERSION_GREATER "3.1.90" ) - polyhedron_demo_plugin(edit_polyhedron_plugin Edit_polyhedron_plugin Deform_mesh.ui) - target_link_libraries(edit_polyhedron_plugin PUBLIC scene_polyhedron_item scene_edit_polyhedron_item scene_polyhedron_selection_item) - polyhedron_demo_plugin(edit_sm_plugin Edit_polyhedron_plugin Deform_mesh.ui) - target_link_libraries(edit_sm_plugin PUBLIC scene_surface_mesh_item scene_edit_polyhedron_item scene_surface_mesh_selection_item) - target_compile_definitions(edit_sm_plugin PUBLIC "-DUSE_SURFACE_MESH" ) + + polyhedron_demo_plugin(edit_plugin Edit_polyhedron_plugin Deform_mesh.ui) + target_link_libraries(edit_plugin PUBLIC scene_surface_mesh_item scene_edit_item scene_selection_item) else() message(STATUS "NOTICE: The polyhedron edit plugin require Eigen 3.2 (or higher) and will not be available.") endif() diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/Deform_mesh.ui b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/Deform_mesh.ui index f9027c53096..28d648d8c43 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/Deform_mesh.ui +++ b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/Deform_mesh.ui @@ -14,7 +14,7 @@ Surface Mesh Deformation - + diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/Edit_polyhedron_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/Edit_polyhedron_plugin.cpp index 730d6447313..f11c0c50f41 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/Edit_polyhedron_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/Edit_polyhedron_plugin.cpp @@ -1,14 +1,11 @@ #include #include -#ifdef USE_SURFACE_MESH #include "Scene_surface_mesh_item.h" -#else -#include "Scene_polyhedron_item.h" -#endif #include "Scene_edit_polyhedron_item.h" #include "Scene_polyhedron_selection_item.h" #include +#include #include #include #include @@ -17,11 +14,7 @@ #include "ui_Deform_mesh.h" -#ifdef USE_SURFACE_MESH typedef Scene_surface_mesh_item Scene_facegraph_item; -#else -typedef Scene_polyhedron_item Scene_facegraph_item; -#endif using namespace CGAL::Three; class Polyhedron_demo_edit_polyhedron_plugin : @@ -104,19 +97,9 @@ bool Polyhedron_demo_edit_polyhedron_plugin::applicable(QAction*) const { Scene_edit_polyhedron_item* edit_item = qobject_cast(scene->item(i)); if(!edit_item) return false; - if(edit_item->poly_item()) + if (qobject_cast(edit_item->sm_item())) { - if (qobject_cast(edit_item->poly_item())) - { - return true; - } - } - else - { - if (qobject_cast(edit_item->sm_item())) - { - return true; - } + return true; } } return false; @@ -127,11 +110,7 @@ void Polyhedron_demo_edit_polyhedron_plugin::init(QMainWindow* mainWindow, CGAL: mw = mainWindow; scene = scene_interface; actionDeformation = new QAction( - #ifdef USE_SURFACE_MESH "Surface Mesh Deformation" - #else - " Polyhedron Deformation" - #endif , mw); actionDeformation->setProperty("subMenuName", "Triangulated Surface Mesh Deformation"); actionDeformation->setObjectName("actionDeformation"); @@ -147,21 +126,13 @@ void Polyhedron_demo_edit_polyhedron_plugin::init(QMainWindow* mainWindow, CGAL: ////////////////// Construct widget ///////////////////////////// // First time, construct docking window dock_widget = new QDockWidget( - #ifdef USE_SURFACE_MESH "Surface Mesh Deformation" - #else - " Polyhedron Deformation" - #endif , mw); dock_widget->setVisible(false); // do not show at the beginning ui_widget.setupUi(dock_widget); dock_widget->setWindowTitle(tr( - #ifdef USE_SURFACE_MESH "Surface Mesh Deformation" - #else - " Polyhedron Deformation" - #endif )); mw->addDockWidget(Qt::LeftDockWidgetArea, dock_widget); @@ -197,7 +168,7 @@ void Polyhedron_demo_edit_polyhedron_plugin::on_actionDeformation_triggered() { // dock widget should be constructed in init() if(dock_widget->isVisible()) { dock_widget->hide(); } - else { dock_widget->show(); } + else { dock_widget->show(); dock_widget->raise();} } /////// Dock window signal handlers ////// @@ -227,6 +198,7 @@ void Polyhedron_demo_edit_polyhedron_plugin::on_NextCtrlVertPushButton_clicked() if(!edit_item) return; // the selected item is not of the right type edit_item->next_ctrl_vertices_group(); + edit_item->invalidateOpenGLBuffers(); scene->itemChanged(edit_item); // for repaint } void Polyhedron_demo_edit_polyhedron_plugin::on_SelectAllVerticesPushButton_clicked() @@ -421,10 +393,7 @@ void Polyhedron_demo_edit_polyhedron_plugin::dock_widget_visibility_changed(bool bool is_valid = true; BOOST_FOREACH(boost::graph_traits::face_descriptor fd, faces(*poly_item->face_graph())) { - if (CGAL::is_degenerate_triangle_face(fd, - *poly_item->face_graph(), - get(boost::vertex_point, - *poly_item->face_graph()), Kernel())) + if (CGAL::Polygon_mesh_processing::is_degenerate_triangle_face(fd, *poly_item->face_graph())) { is_valid = false; break; @@ -438,7 +407,6 @@ void Polyhedron_demo_edit_polyhedron_plugin::dock_widget_visibility_changed(bool break; } last_RM = poly_item->renderingMode(); - poly_item->update_halfedge_indices(); if(!selection_item) convert_to_edit_facegraph(i, poly_item); else @@ -515,11 +483,7 @@ Scene_facegraph_item* Polyhedron_demo_edit_polyhedron_plugin::convert_to_plain_facegraph(Item_id i, Scene_edit_polyhedron_item* edit_item) { -#ifdef USE_SURFACE_MESH Scene_facegraph_item* poly_item = edit_item->to_sm_item(); -#else - Scene_facegraph_item* poly_item = edit_item->to_polyhedron_item(); -#endif scene->replaceItem(i, poly_item); delete edit_item; return poly_item; diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/Scene_edit_polyhedron_item.cpp b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/Scene_edit_polyhedron_item.cpp index 24292ea4c53..f961417eca1 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/Scene_edit_polyhedron_item.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/Scene_edit_polyhedron_item.cpp @@ -16,30 +16,12 @@ struct Scene_edit_polyhedron_item_priv { - Scene_edit_polyhedron_item_priv(Scene_polyhedron_item* poly_item, Ui::DeformMesh* ui_widget, QMainWindow* mw, Scene_edit_polyhedron_item* parent) - : ui_widget(ui_widget), - poly_item(poly_item), - sm_item(NULL), - is_rot_free(true), - own_poly_item(true), - k_ring_selector(poly_item, mw, Scene_polyhedron_item_k_ring_selection::Active_handle::VERTEX, true) - { - item = parent; - nb_ROI = 0; - nb_control = 0; - nb_axis = 0; - nb_bbox = 0; - spheres = NULL; - spheres_ctrl = NULL; - need_change = false; - } Scene_edit_polyhedron_item_priv(Scene_surface_mesh_item* sm_item, Ui::DeformMesh* ui_widget, QMainWindow* mw, Scene_edit_polyhedron_item* parent) : ui_widget(ui_widget), - poly_item(NULL), sm_item(sm_item), is_rot_free(true), own_poly_item(true), - k_ring_selector(sm_item, mw, Scene_polyhedron_item_k_ring_selection::Active_handle::VERTEX, true) + k_ring_selector(sm_item, mw, Scene_facegraph_item_k_ring_selection::Active_handle::VERTEX, true) { item = parent; nb_ROI = 0; @@ -52,14 +34,10 @@ struct Scene_edit_polyhedron_item_priv } ~Scene_edit_polyhedron_item_priv() { - if(poly_item) - delete deform_mesh; if(sm_item) delete deform_sm_mesh; if (own_poly_item) { - if(poly_item) - delete poly_item; if(sm_item) delete sm_item; } @@ -115,7 +93,6 @@ struct Scene_edit_polyhedron_item_priv }; Ui::DeformMesh* ui_widget; - Scene_polyhedron_item* poly_item; Scene_surface_mesh_item* sm_item; bool need_change; // For drawing @@ -144,12 +121,8 @@ struct Scene_edit_polyhedron_item_priv mutable Scene_spheres_item* spheres_ctrl; mutable QOpenGLBuffer *in_bu; - Deform_mesh* deform_mesh; Deform_sm_mesh* deform_sm_mesh; - typedef std::list > Ctrl_vertices_poly_group_data_list; typedef std::list > Ctrl_vertices_sm_group_data_list; - Ctrl_vertices_poly_group_data_list::iterator poly_active_group; - Ctrl_vertices_poly_group_data_list poly_ctrl_vertex_frame_map; // keep list of group of control vertices with assoc data Ctrl_vertices_sm_group_data_list::iterator sm_active_group; Ctrl_vertices_sm_group_data_list sm_ctrl_vertex_frame_map; @@ -163,7 +136,7 @@ struct Scene_edit_polyhedron_item_priv bool is_rot_free; bool own_poly_item; //indicates if the poly_item should be deleted by the destructor - Scene_polyhedron_item_k_ring_selection k_ring_selector; + Scene_facegraph_item_k_ring_selection k_ring_selector; Scene_edit_polyhedron_item *item; }; //end Scene_edit_polyhedron_item_priv @@ -179,44 +152,22 @@ struct Facegraph_selector :d(d){} ////Deform_mesh///// - - Deform_mesh* get_deform_mesh(Polyhedron*) - { - return d->deform_mesh; - } - Deform_sm_mesh* get_deform_mesh(SMesh*) { return d->deform_sm_mesh; } - void set_deform_mesh(Polyhedron*, Deform_mesh *dm) - { - d->deform_mesh = dm; - } - void set_deform_mesh(SMesh*, Deform_sm_mesh *dm) { d->deform_sm_mesh = dm; } ////Items management///// - void invalidate_aabb_tree(Polyhedron*) - { - d->poly_item->invalidate_aabb_tree(); - } void invalidate_aabb_tree(SMesh*) { d->sm_item->invalidate_aabb_tree(); } - void update_ids(Polyhedron*, bool do_faces) - { - d->poly_item->update_vertex_indices(); - if(do_faces) - d->poly_item->update_facet_indices(); - d->poly_item->update_halfedge_indices(); - } void update_ids(SMesh*, bool ) { @@ -224,11 +175,7 @@ struct Facegraph_selector } ////ctrl_groups///// - Ctrl_vertices_poly_group_data_list::iterator& get_active_group(Polyhedron*) - { - return d->poly_active_group; - } - + Ctrl_vertices_sm_group_data_list::iterator& get_active_group(SMesh*) { return d->sm_active_group; @@ -236,11 +183,6 @@ struct Facegraph_selector - Ctrl_vertices_poly_group_data_list& get_ctrl_vertex_frame_map(Polyhedron*) - { - return d->poly_ctrl_vertex_frame_map; - } - Ctrl_vertices_sm_group_data_list& get_ctrl_vertex_frame_map(SMesh*) { return d->sm_ctrl_vertex_frame_map; @@ -250,36 +192,18 @@ struct Facegraph_selector //const functions - Ctrl_vertices_poly_group_data_list& get_ctrl_vertex_frame_map(Polyhedron*, Scene_edit_polyhedron_item_priv* d)const - { - return d->poly_ctrl_vertex_frame_map; - } Ctrl_vertices_sm_group_data_list& get_ctrl_vertex_frame_map(SMesh*, Scene_edit_polyhedron_item_priv* d)const { return d->sm_ctrl_vertex_frame_map; } - Ctrl_vertices_poly_group_data_list::iterator& get_active_group(Polyhedron*, Scene_edit_polyhedron_item_priv* d)const - { - return d->poly_active_group; - } - + Ctrl_vertices_sm_group_data_list::iterator& get_active_group(SMesh*, Scene_edit_polyhedron_item_priv* d)const { return d->sm_active_group; } - Deform_mesh* get_deform_mesh(Polyhedron*, Scene_edit_polyhedron_item_priv* d)const - { - return d->deform_mesh; - } - - Deform_mesh* get_deform_mesh(SMesh*, Scene_edit_polyhedron_item_priv* d)const - { - return d->deform_mesh; - } - }; void Scene_edit_polyhedron_item_priv::init_values() @@ -512,34 +436,6 @@ void Scene_edit_polyhedron_item_priv::init_values() ui_widget->remeshingEdgeLengthInput_checkBox->setChecked(false); } - -Scene_edit_polyhedron_item::Scene_edit_polyhedron_item -(Scene_polyhedron_item* poly_item, - Ui::DeformMesh* ui_widget, - QMainWindow* mw) - : Scene_group_item("unnamed",Scene_edit_polyhedron_item_priv::NumberOfBuffers,Scene_edit_polyhedron_item_priv::NumberOfVaos) - -{ - mw->installEventFilter(this); - d = new Scene_edit_polyhedron_item_priv(poly_item, ui_widget, mw, this); - // bind vertex picking - connect(&d->k_ring_selector, SIGNAL(selected(const std::set::vertex_descriptor>&)), this, - SLOT(selected(const std::set::vertex_descriptor>&))); - - d->poly_item->set_color_vector_read_only(true); // to prevent recomputation of color vector in invalidateOpenGLBuffers() - d->poly_item->update_vertex_indices(); - id_setter = new Id_setter(d->poly_item->polyhedron()); - d->deform_mesh = new Deform_mesh(*(poly_item->polyhedron()), - Deform_mesh::Vertex_index_map(), - Deform_mesh::Hedge_index_map(), - Array_based_vertex_point_map(&d->positions, polyhedron(), id_setter)); - d->init_values(); - connect(ui_widget->remeshingEdgeLengthInput_checkBox, SIGNAL(toggled(bool)), - ui_widget->remeshing_edge_length_spinbox, SLOT(setEnabled(bool))); - invalidateOpenGLBuffers(); -} - - Scene_edit_polyhedron_item::Scene_edit_polyhedron_item (Scene_surface_mesh_item* sm_item, Ui::DeformMesh* ui_widget, @@ -550,8 +446,8 @@ Scene_edit_polyhedron_item::Scene_edit_polyhedron_item mw->installEventFilter(this); d = new Scene_edit_polyhedron_item_priv(sm_item, ui_widget, mw, this); // bind vertex picking - connect(&d->k_ring_selector, SIGNAL(selected(const std::set::vertex_descriptor>&)), this, - SLOT(selected(const std::set::vertex_descriptor>&))); + connect(&d->k_ring_selector, SIGNAL(selected(const std::set&)), this, + SLOT(selected(const std::set&))); id_setter = new Id_setter(d->sm_item->polyhedron()); d->deform_sm_mesh = new Deform_sm_mesh(*(sm_item->polyhedron()), Deform_sm_mesh::Vertex_index_map(), @@ -569,10 +465,7 @@ Scene_edit_polyhedron_item::~Scene_edit_polyhedron_item() { while(is_there_any_ctrl_vertices_group()) { - if(d->poly_item) - d->delete_ctrl_vertices_group(polyhedron(), false); - else - d->delete_ctrl_vertices_group(surface_mesh(), false); + d->delete_ctrl_vertices_group(surface_mesh(), false); } delete d; @@ -757,7 +650,7 @@ void Scene_edit_polyhedron_item_priv::apply_reset_drawing_data(Mesh* mesh, M_Def positions[counter * 3] = p.x(); positions[counter * 3 + 1] = p.y(); positions[counter * 3 + 2] = p.z(); - const Polyhedron::Traits::Vector_3& n = + const EPICK::Vector_3& n = CGAL::Polygon_mesh_processing::compute_vertex_normal(vb, m_deform_mesh->halfedge_graph()); normals[counter * 3] = n.x(); normals[counter * 3 + 1] = n.y(); @@ -793,8 +686,6 @@ void Scene_edit_polyhedron_item_priv::reset_drawing_data() _edges.clear(); if(sm_item) apply_reset_drawing_data(sm_item->polyhedron(), deform_sm_mesh); - else - apply_reset_drawing_data(poly_item->polyhedron(), deform_mesh); } template @@ -816,7 +707,7 @@ void Scene_edit_polyhedron_item_priv::compute_normals_and_vertices(Mesh* mesh) { if(!fs.get_deform_mesh(mesh)->is_control_vertex(vd)) { - Kernel::Point_3 p = get(pmap, vd); + EPICK::Point_3 p = get(pmap, vd); ROI_points.push_back(p.x()+offset.x); ROI_points.push_back(p.y()+offset.y); ROI_points.push_back(p.z()+offset.z); @@ -824,8 +715,8 @@ void Scene_edit_polyhedron_item_priv::compute_normals_and_vertices(Mesh* mesh) if(spheres) { CGAL::Color c(0,255,0); - Kernel::Point_3 point(p.x()+offset.x, p.y()+offset.y, p.z()+offset.z); - spheres->add_sphere(Kernel::Sphere_3(point, length_of_axis/15.0*length_of_axis/15.0), c); + EPICK::Point_3 point(p.x()+offset.x, p.y()+offset.y, p.z()+offset.z); + spheres->add_sphere(EPICK::Sphere_3(point, length_of_axis/15.0*length_of_axis/15.0), c); } } @@ -852,7 +743,7 @@ void Scene_edit_polyhedron_item_priv::compute_normals_and_vertices(Mesh* mesh) for(typename std::vector::const_iterator hb = hgb_data->ctrl_vertices_group.begin(); hb != hgb_data->ctrl_vertices_group.end(); ++hb) { - Kernel::Point_3 p = get(pmap, (*hb)); + EPICK::Point_3 p = get(pmap, (*hb)); control_points.push_back(p.x()+offset.x); control_points.push_back(p.y()+offset.y); control_points.push_back(p.z()+offset.z); @@ -864,10 +755,10 @@ void Scene_edit_polyhedron_item_priv::compute_normals_and_vertices(Mesh* mesh) { CGAL::Color c(255*r,0,255*b); - Kernel::Point_3 center(p.x()+offset.x, + EPICK::Point_3 center(p.x()+offset.x, p.y()+offset.y, p.z()+offset.z); - spheres_ctrl->add_sphere(Kernel::Sphere_3(center, length_of_axis/15.0*length_of_axis/15.0), c); + spheres_ctrl->add_sphere(EPICK::Sphere_3(center, length_of_axis/15.0*length_of_axis/15.0), c); } } } @@ -896,10 +787,7 @@ void Scene_edit_polyhedron_item_priv::compute_normals_and_vertices(Mesh* mesh) if(ui_widget->ActivateFixedPlaneCheckBox->isChecked()) { - if(poly_item) - item->draw_frame_plane(viewer, poly_item->polyhedron()); - else - item->draw_frame_plane(viewer, sm_item->polyhedron()); + item->draw_frame_plane(viewer, sm_item->polyhedron()); } QApplication::restoreOverrideCursor(); } @@ -910,47 +798,15 @@ void Scene_edit_polyhedron_item::deform() { if(!is_there_any_ctrl_vertices()) { return; } - - if(d->poly_item) - { - d->deform(d->poly_item->polyhedron()); - d->poly_item->invalidate_aabb_tree(); - } - else - { - d->deform(d->sm_item->polyhedron()); - d->sm_item->invalidate_aabb_tree(); - } + + d->deform(d->sm_item->polyhedron()); + d->sm_item->invalidate_aabb_tree(); Q_EMIT itemChanged(); } template struct ROI_faces_pmap; -template<> -struct ROI_faces_pmap -{ - typedef boost::graph_traits::face_descriptor key_type; - typedef std::size_t value_type; - typedef std::size_t& reference; - typedef boost::read_write_property_map_tag category; - std::map* patch_map; - ROI_faces_pmap(std::map* patch_map, Polyhedron*) - :patch_map(patch_map){} - - friend value_type get(const ROI_faces_pmap&pmap, const key_type& f) - { - /*magic number 12345*/ - if((*pmap.patch_map)[f] == 12345) return 1; - else return 0; - } - friend void put(ROI_faces_pmap&pmap, const key_type& f, const value_type b) - { - if(b != 0) (*pmap.patch_map)[f] = 12345; - else (*pmap.patch_map)[f] = 0; - } -}; - template<> struct ROI_faces_pmap { @@ -1029,50 +885,12 @@ struct halfedge2edge void Scene_edit_polyhedron_item::remesh() { - if(d->poly_item) - d->remesh(d->poly_item->polyhedron()); - else - { - d->remesh(d->sm_item->polyhedron()); - } + d->remesh(d->sm_item->polyhedron()); } template struct Is_constrained_map; -template<> -struct Is_constrained_map -{ - typedef boost::graph_traits::vertex_descriptor mesh_vd; - typedef mesh_vd key_type; - typedef bool value_type; - typedef bool reference; - typedef boost::read_write_property_map_tag category; - std::map *icmap; //not light but the might won't be copied so it is ok - - Is_constrained_map() - {} - Is_constrained_map( std::vector* vec, Polyhedron* mesh) - { - icmap = new std::map(); - BOOST_FOREACH(mesh_vd v, vertices(*mesh)) - { - (*icmap)[v] = (*vec)[v->id()]; - } - } - void clean(){ delete icmap;} - - friend bool get(const Is_constrained_map& map, const key_type& k) - { - std::map::const_iterator it = map.icmap->find(k); - if(it != map.icmap->end()) - return it->second != -1; - return false; - } - friend void put(Is_constrained_map&, const key_type&, const value_type)//no need - {} -}; - template<> struct Is_constrained_map { @@ -1105,14 +923,6 @@ struct Is_constrained_map {} }; -int get_control_number(poly_vertex_descriptor v, const Is_constrained_map& map) -{ - std::map::const_iterator it = map.icmap->find(v); - if(it != map.icmap->end()) - return it->second; - return -1; -} - int get_control_number(sm_vertex_descriptor v, const Is_constrained_map& map) { return get(map.icmap, v); @@ -1239,10 +1049,7 @@ void Scene_edit_polyhedron_item_priv::remesh(Mesh* mesh) //reset ROI from its outside border roi_border item->clear_roi(); do{ - if(poly_item) - delete_ctrl_vertices_group(poly_item->polyhedron(), false); - else - delete_ctrl_vertices_group(sm_item->polyhedron(), false); + delete_ctrl_vertices_group(sm_item->polyhedron(), false); } while(!fs.get_ctrl_vertex_frame_map(mesh).empty()); @@ -1422,10 +1229,7 @@ void Scene_edit_polyhedron_item_priv::expand_or_reduce(int steps, Mesh* mesh) } if(fs.get_active_group(mesh)->ctrl_vertices_group.empty() && fs.get_ctrl_vertex_frame_map(mesh).size()>1) { - if(poly_item) - delete_ctrl_vertices_group(poly_item->polyhedron(), false); - else - delete_ctrl_vertices_group(sm_item->polyhedron(), false); + delete_ctrl_vertices_group(sm_item->polyhedron(), false); } if( (!ctrl_active && fs.get_deform_mesh(mesh)->roi_vertices().size() != original_size) @@ -1454,10 +1258,7 @@ bool Scene_edit_polyhedron_item::eventFilter(QObject* /*target*/, QEvent *event) { QWheelEvent *w_event = static_cast(event); int steps = w_event->delta() / 120; - if(d->poly_item) - d->expand_or_reduce(steps, d->poly_item->polyhedron()); - else - d->expand_or_reduce(steps, d->sm_item->polyhedron()); + d->expand_or_reduce(steps, d->sm_item->polyhedron()); } if(event->type() == QEvent::MouseButtonPress || event->type() == QEvent::MouseButtonRelease) { @@ -1471,8 +1272,7 @@ bool Scene_edit_polyhedron_item::eventFilter(QObject* /*target*/, QEvent *event) } ////////////////// //////////////// ///////////////////// - if((d->poly_item && !d->poly_item->visible()) - || (d->sm_item && !d->sm_item->visible())){ return false; } // if not visible just update event state but don't do any action + if((d->sm_item && !d->sm_item->visible())){ return false; } // if not visible just update event state but don't do any action // check state changes between old and current state bool ctrl_pressed_now = d->state.ctrl_pressing && !old_state.ctrl_pressing; @@ -1483,10 +1283,7 @@ bool Scene_edit_polyhedron_item::eventFilter(QObject* /*target*/, QEvent *event) const QPoint& p = viewer->mapFromGlobal(QCursor::pos()); bool need_repaint; - if(d->poly_item) - need_repaint = activate_closest_manipulated_frame(p.x(), p.y(), polyhedron()); - else - need_repaint = activate_closest_manipulated_frame(p.x(), p.y(), surface_mesh()); + need_repaint = activate_closest_manipulated_frame(p.x(), p.y(), surface_mesh()); if (!d->ui_widget->ActivatePivotingCheckBox->isChecked() && ctrl_released_now && d->ui_widget->RemeshingCheckBox->isChecked()) @@ -1507,10 +1304,7 @@ bool Scene_edit_polyhedron_item::eventFilter(QObject* /*target*/, QEvent *event) void Scene_edit_polyhedron_item::drawEdges(CGAL::Three::Viewer_interface* viewer) const { if(!are_buffers_filled) { - if(d->poly_item) - d->compute_normals_and_vertices(d->poly_item->polyhedron()); - else - d->compute_normals_and_vertices(d->sm_item->polyhedron()); + d->compute_normals_and_vertices(d->sm_item->polyhedron()); d->initializeBuffers(viewer); } vaos[Scene_edit_polyhedron_item_priv::Edges]->bind(); @@ -1530,10 +1324,7 @@ void Scene_edit_polyhedron_item::drawEdges(CGAL::Three::Viewer_interface* viewer void Scene_edit_polyhedron_item::draw(CGAL::Three::Viewer_interface* viewer) const { if(!are_buffers_filled) { - if(d->poly_item) - d->compute_normals_and_vertices(d->poly_item->polyhedron()); - else - d->compute_normals_and_vertices(d->sm_item->polyhedron()); + d->compute_normals_and_vertices(d->sm_item->polyhedron()); d->initializeBuffers(viewer); } vaos[Scene_edit_polyhedron_item_priv::Facets]->bind(); @@ -1717,22 +1508,10 @@ void Scene_edit_polyhedron_item::draw_ROI_and_control_vertices(CGAL::Three::View d->program->release(); vaos[Scene_edit_polyhedron_item_priv::Control_points]->release(); } - - if(d->poly_item) + for(Ctrl_vertices_sm_group_data_list::const_iterator hgb_data = d->sm_ctrl_vertex_frame_map.begin(); + hgb_data != d->sm_ctrl_vertex_frame_map.end(); ++hgb_data) { - for(Ctrl_vertices_poly_group_data_list::const_iterator hgb_data = d->poly_ctrl_vertex_frame_map.begin(); - hgb_data != d->poly_ctrl_vertex_frame_map.end(); ++hgb_data) - { - d->draw_ROI_and_control_vertices(viewer, hgb_data->frame, hgb_data->frame_initial_center); - } - } - else - { - for(Ctrl_vertices_sm_group_data_list::const_iterator hgb_data = d->sm_ctrl_vertex_frame_map.begin(); - hgb_data != d->sm_ctrl_vertex_frame_map.end(); ++hgb_data) - { - d->draw_ROI_and_control_vertices(viewer, hgb_data->frame, hgb_data->frame_initial_center); - } + d->draw_ROI_and_control_vertices(viewer, hgb_data->frame, hgb_data->frame_initial_center); } viewer->setGlPointSize(1); @@ -1789,14 +1568,6 @@ void Scene_edit_polyhedron_item::invalidateOpenGLBuffers() d->spheres_ctrl->invalidateOpenGLBuffers(); } -Scene_polyhedron_item* Scene_edit_polyhedron_item::to_polyhedron_item() { - Scene_polyhedron_item* poly_item_tmp = d->poly_item; - d->poly_item->set_color_vector_read_only(false); - d->own_poly_item=false; - poly_item_tmp->invalidateOpenGLBuffers(); - return poly_item_tmp; -} - Scene_surface_mesh_item* Scene_edit_polyhedron_item::to_sm_item() { Scene_surface_mesh_item* sm_item_tmp = d->sm_item; d->own_poly_item=false; @@ -1804,11 +1575,6 @@ Scene_surface_mesh_item* Scene_edit_polyhedron_item::to_sm_item() { return sm_item_tmp; } -Polyhedron* Scene_edit_polyhedron_item::polyhedron() -{ return d->poly_item->polyhedron(); } -const Polyhedron* Scene_edit_polyhedron_item::polyhedron() const -{ return d->poly_item->polyhedron(); } - SMesh* Scene_edit_polyhedron_item::surface_mesh() { return d->sm_item->polyhedron(); } const SMesh* Scene_edit_polyhedron_item::surface_mesh() const @@ -1817,82 +1583,46 @@ const SMesh* Scene_edit_polyhedron_item::surface_mesh() const QString Scene_edit_polyhedron_item::toolTip() const { - if(d->poly_item) - { - if(!d->poly_item->polyhedron()) - return QString(); - - return QObject::tr("

    Polyhedron %1 (mode: %5, color: %6)

    " - "

    Number of vertices: %2
    " - "Number of edges: %3
    " - "Number of facets: %4

    ") - .arg(this->name()) - .arg(d->poly_item->polyhedron()->size_of_vertices()) - .arg(d->poly_item->polyhedron()->size_of_halfedges()/2) - .arg(d->poly_item->polyhedron()->size_of_facets()) - .arg(this->renderingModeName()) - .arg(this->color().name()); - } - else - { - if(!d->sm_item->polyhedron()) - return QString(); - - return QObject::tr("

    Surface Mesh %1 (mode: %5, color: %6)

    " - "

    Number of vertices: %2
    " - "Number of edges: %3
    " - "Number of facets: %4

    ") - .arg(this->name()) - .arg(num_vertices(*d->sm_item->polyhedron())) - .arg(num_halfedges(*d->sm_item->polyhedron())/2) - .arg(num_faces(*d->sm_item->polyhedron())) - .arg(this->renderingModeName()) - .arg(this->color().name()); - } + if(!d->sm_item->polyhedron()) + return QString(); + + return QObject::tr("

    Surface Mesh %1 (mode: %5, color: %6)

    " + "

    Number of vertices: %2
    " + "Number of edges: %3
    " + "Number of facets: %4

    ") + .arg(this->name()) + .arg(num_vertices(*d->sm_item->polyhedron())) + .arg(num_halfedges(*d->sm_item->polyhedron())/2) + .arg(num_faces(*d->sm_item->polyhedron())) + .arg(this->renderingModeName()) + .arg(this->color().name()); } + bool Scene_edit_polyhedron_item::isEmpty() const { - if(d->poly_item) - return d->poly_item->isEmpty(); - else - return d->sm_item->isEmpty(); + return d->sm_item->isEmpty(); } void Scene_edit_polyhedron_item::compute_bbox() const { - if(d->poly_item) - _bbox = d->poly_item->bbox(); - else - _bbox = d->sm_item->bbox(); + _bbox = d->sm_item->bbox(); } void Scene_edit_polyhedron_item::setVisible(bool b) { - if(d->poly_item) - d->poly_item->setVisible(b); - else - d->sm_item->setVisible(b); + d->sm_item->setVisible(b); Scene_item::setVisible(b); if(!b) { (*CGAL::QGLViewer::QGLViewerPool().begin())->setManipulatedFrame(NULL); } } void Scene_edit_polyhedron_item::setColor(QColor c) { - if(d->poly_item) - d->poly_item->setColor(c); - else - d->sm_item->setColor(c); + d->sm_item->setColor(c); Scene_item::setColor(c); } void Scene_edit_polyhedron_item::setName(QString n) { Scene_item::setName(n); n.replace(" (edit)", ""); - if(d->poly_item) - d->poly_item->setName(n); - else - d->sm_item->setName(n); + d->sm_item->setName(n); } void Scene_edit_polyhedron_item::setRenderingMode(RenderingMode m) { - if(d->poly_item) - d->poly_item->setRenderingMode(m); - else - d->sm_item->setRenderingMode(m); + d->sm_item->setRenderingMode(m); Scene_item::setRenderingMode(m); } Scene_edit_polyhedron_item* Scene_edit_polyhedron_item::clone() const { @@ -1912,20 +1642,12 @@ void Scene_edit_polyhedron_item::select( dir_x, dir_y, dir_z); - if(d->poly_item) - d->poly_item->select(orig_x, - orig_y, - orig_z, - dir_x, - dir_y, - dir_z); - else - d->sm_item->select(orig_x, - orig_y, - orig_z, - dir_x, - dir_y, - dir_z); + d->sm_item->select(orig_x, + orig_y, + orig_z, + dir_x, + dir_y, + dir_z); } @@ -1947,18 +1669,12 @@ bool Scene_edit_polyhedron_item::keyPressEvent(QKeyEvent* e) void Scene_edit_polyhedron_item::update_frame_plane() { - if(d->poly_item) - for(Ctrl_vertices_poly_group_data_list::iterator hgb_data = d->poly_ctrl_vertex_frame_map.begin(); - hgb_data != d->poly_ctrl_vertex_frame_map.end(); ++hgb_data) - { - hgb_data->refresh(polyhedron()); - } - else - for(Ctrl_vertices_sm_group_data_list::iterator hgb_data = d->sm_ctrl_vertex_frame_map.begin(); - hgb_data != d->sm_ctrl_vertex_frame_map.end(); ++hgb_data) - { - hgb_data->refresh(surface_mesh()); - } + + for(Ctrl_vertices_sm_group_data_list::iterator hgb_data = d->sm_ctrl_vertex_frame_map.begin(); + hgb_data != d->sm_ctrl_vertex_frame_map.end(); ++hgb_data) + { + hgb_data->refresh(surface_mesh()); + } } @@ -2015,12 +1731,6 @@ void Scene_edit_polyhedron_item::ShowAsSphere(bool b) } } -bool Scene_edit_polyhedron_item::is_there_any_ctrl_vertices_group(Ctrl_vertices_poly_group_data_list::iterator& hgb, - Ctrl_vertices_poly_group_data_list::iterator& hge) -{ - hgb = d->poly_ctrl_vertex_frame_map.begin(); hge = d->poly_ctrl_vertex_frame_map.end(); - return hgb != hge; -} bool Scene_edit_polyhedron_item::is_there_any_ctrl_vertices_group(Ctrl_vertices_sm_group_data_list::iterator& hgb, Ctrl_vertices_sm_group_data_list::iterator& hge) { @@ -2035,29 +1745,11 @@ void Scene_edit_polyhedron_item::reset_spheres() d->spheres = NULL; } -void Scene_edit_polyhedron_item::selected(const std::set& m) + +void Scene_edit_polyhedron_item::selected(const std::set& m) { bool any_changes = false; - for(std::set::const_iterator it = m.begin(); it != m.end(); ++it) - { - poly_vertex_descriptor vh = *it; - bool changed = false; - if(d->ui_widget->ROIRadioButton->isChecked()) { - if(d->ui_widget->InsertRadioButton->isChecked()) { changed = insert_roi_vertex(vh, polyhedron());} - else { changed = erase_roi_vertex(vh, polyhedron()); } - } - else { - if(d->ui_widget->InsertRadioButton->isChecked()) { changed = insert_control_vertex(vh, polyhedron()); } - else { changed = erase_control_vertex(vh, polyhedron()); } - } - any_changes |= changed; - } - if(any_changes) { invalidateOpenGLBuffers(); Q_EMIT itemChanged(); } -} -void Scene_edit_polyhedron_item::selected(const std::set& m) -{ - bool any_changes = false; - for(std::set::const_iterator it = m.begin(); it != m.end(); ++it) + for(std::set::const_iterator it = m.begin(); it != m.end(); ++it) { sm_vertex_descriptor vh = *it; bool changed = false; @@ -2120,46 +1812,22 @@ bool Scene_edit_polyhedron_item::erase_roi_vertex(typename boost::graph_traitspoly_item) + for(Ctrl_vertices_sm_group_data_list::iterator it = d->sm_ctrl_vertex_frame_map.begin(); it != d->sm_ctrl_vertex_frame_map.end(); ++it) { - for(Ctrl_vertices_poly_group_data_list::iterator it = d->poly_ctrl_vertex_frame_map.begin(); it != d->poly_ctrl_vertex_frame_map.end(); ++it) - { - delete it->frame; - } - d->poly_ctrl_vertex_frame_map.clear(); - d->deform_mesh->clear_roi_vertices(); - } - else - { - for(Ctrl_vertices_sm_group_data_list::iterator it = d->sm_ctrl_vertex_frame_map.begin(); it != d->sm_ctrl_vertex_frame_map.end(); ++it) - { - delete it->frame; - } - d->sm_ctrl_vertex_frame_map.clear(); - d->deform_sm_mesh->clear_roi_vertices(); + delete it->frame; } + d->sm_ctrl_vertex_frame_map.clear(); + d->deform_sm_mesh->clear_roi_vertices(); create_ctrl_vertices_group(); // create one new group of control vertices } void Scene_edit_polyhedron_item::create_ctrl_vertices_group() { - if(d->poly_item) - { - for(Ctrl_vertices_poly_group_data_list::iterator it = d->poly_ctrl_vertex_frame_map.begin(); it != d->poly_ctrl_vertex_frame_map.end(); ++it) { - if(it->ctrl_vertices_group.empty()) { - d->poly_active_group = it; - return; - } - } - } - else - { - for(Ctrl_vertices_sm_group_data_list::iterator it = d->sm_ctrl_vertex_frame_map.begin(); it != d->sm_ctrl_vertex_frame_map.end(); ++it) { - if(it->ctrl_vertices_group.empty()) { - d->sm_active_group = it; - return; - } + for(Ctrl_vertices_sm_group_data_list::iterator it = d->sm_ctrl_vertex_frame_map.begin(); it != d->sm_ctrl_vertex_frame_map.end(); ++it) { + if(it->ctrl_vertices_group.empty()) { + d->sm_active_group = it; + return; } } // No empty group of control vertices @@ -2168,23 +1836,11 @@ void Scene_edit_polyhedron_item::create_ctrl_vertices_group() new_frame->setPosition(offset); new_frame->setRotationSensitivity(2.0f); connect(new_frame, SIGNAL(manipulated()), this, SLOT(change())); - - if(d->poly_item) - { - Control_vertices_data hgd(d->deform_mesh, new_frame); - d->poly_ctrl_vertex_frame_map.push_back(hgd); - hgd.refresh(polyhedron()); - - d->poly_active_group = --d->poly_ctrl_vertex_frame_map.end(); - } - else - { - Control_vertices_data hgd(d->deform_sm_mesh, new_frame); - d->sm_ctrl_vertex_frame_map.push_back(hgd); - hgd.refresh(surface_mesh()); - - d->sm_active_group = --d->sm_ctrl_vertex_frame_map.end(); - } + Control_vertices_data hgd(d->deform_sm_mesh, new_frame); + d->sm_ctrl_vertex_frame_map.push_back(hgd); + hgd.refresh(surface_mesh()); + + d->sm_active_group = --d->sm_ctrl_vertex_frame_map.end(); invalidateOpenGLBuffers(); Q_EMIT itemChanged(); @@ -2229,70 +1885,36 @@ void Scene_edit_polyhedron_item_priv::delete_ctrl_vertices_group(Mesh* mesh, boo void Scene_edit_polyhedron_item::prev_ctrl_vertices_group() { - if(d->poly_item) - { - Ctrl_vertices_poly_group_data_list::iterator hgb, hge; - if( !is_there_any_ctrl_vertices_group(hgb, hge) ) { - print_message("There is no group of control vertices to iterate on!"); - return; - } - // shift - if(hgb == d->poly_active_group) { d->poly_active_group = --hge; } - else {--d->poly_active_group; } - } - else - { - Ctrl_vertices_sm_group_data_list::iterator hgb, hge; - if( !is_there_any_ctrl_vertices_group(hgb, hge) ) { - print_message("There is no group of control vertices to iterate on!"); - return; - } - // shift - if(hgb == d->sm_active_group) { d->sm_active_group = --hge; } - else {--d->sm_active_group; } + Ctrl_vertices_sm_group_data_list::iterator hgb, hge; + if( !is_there_any_ctrl_vertices_group(hgb, hge) ) { + print_message("There is no group of control vertices to iterate on!"); + return; } + // shift + if(hgb == d->sm_active_group) { d->sm_active_group = --hge; } + else {--d->sm_active_group; } } void Scene_edit_polyhedron_item::next_ctrl_vertices_group() { - if(d->poly_item) - { - Ctrl_vertices_poly_group_data_list::iterator hgb, hge; - if( !is_there_any_ctrl_vertices_group(hgb, hge) ) { - print_message("There is no group of control vertices to iterate on!"); - return; - } - // shift - if(--hge == d->poly_active_group) { d->poly_active_group = hgb; } - else {++d->poly_active_group; } - } - else - { - Ctrl_vertices_sm_group_data_list::iterator hgb, hge; - if( !is_there_any_ctrl_vertices_group(hgb, hge) ) { - print_message("There is no group of control vertices to iterate on!"); - return; - } - // shift - if(--hge == d->sm_active_group) { d->sm_active_group = hgb; } - else {++d->sm_active_group; } + Ctrl_vertices_sm_group_data_list::iterator hgb, hge; + if( !is_there_any_ctrl_vertices_group(hgb, hge) ) { + print_message("There is no group of control vertices to iterate on!"); + return; } + // shift + if(--hge == d->sm_active_group) { d->sm_active_group = hgb; } + else {++d->sm_active_group; } } void Scene_edit_polyhedron_item::pivoting_begin() { - if(d->poly_item) - d->pivoting_begin(polyhedron()); - else - d->pivoting_begin(surface_mesh()); + d->pivoting_begin(surface_mesh()); } void Scene_edit_polyhedron_item::pivoting_end() { - if(d->poly_item) - d->pivoting_end(polyhedron()); - else - d->pivoting_end(surface_mesh()); + d->pivoting_end(surface_mesh()); } template @@ -2334,51 +1956,23 @@ void Scene_edit_polyhedron_item::save_roi(const char* file_name) const { std::ofstream out(file_name); // save roi - if(d->poly_item) + Id_setter id_getter(d->sm_item->polyhedron()); + out << d->deform_sm_mesh->roi_vertices().size() << std::endl; + BOOST_FOREACH(sm_vertex_descriptor vd, d->deform_sm_mesh->roi_vertices()) { - out << d->deform_mesh->roi_vertices().size() << std::endl; - BOOST_FOREACH(poly_vertex_descriptor vd, d->deform_mesh->roi_vertices()) - { - out << vd->id() << " "; - } - } - else - { - Id_setter id_getter(d->sm_item->polyhedron()); - out << d->deform_sm_mesh->roi_vertices().size() << std::endl; - BOOST_FOREACH(sm_vertex_descriptor vd, d->deform_sm_mesh->roi_vertices()) - { - out << id_getter.get_id(vd) << " "; - } + out << id_getter.get_id(vd) << " "; } out << std::endl; // save control vertices - if(d->poly_item) - { - out << d->poly_ctrl_vertex_frame_map.size() << std::endl; // control vertices count - for(Ctrl_vertices_poly_group_data_list::const_iterator hgb = d->poly_ctrl_vertex_frame_map.begin(); hgb != d->poly_ctrl_vertex_frame_map.end(); ++hgb) { - - out << hgb->ctrl_vertices_group.size() << std::endl; - for(std::vector::const_iterator hb = hgb->ctrl_vertices_group.begin(); hb != hgb->ctrl_vertices_group.end(); ++hb) - { - out << (*hb)->id() << " "; - } - out << std::endl; - } - } - else - { - Id_setter id_getter(d->sm_item->polyhedron()); - out << d->sm_ctrl_vertex_frame_map.size() << std::endl; // control vertices count - for(Ctrl_vertices_sm_group_data_list::const_iterator hgb = d->sm_ctrl_vertex_frame_map.begin(); hgb != d->sm_ctrl_vertex_frame_map.end(); ++hgb) { - - out << hgb->ctrl_vertices_group.size() << std::endl; - for(std::vector::const_iterator hb = hgb->ctrl_vertices_group.begin(); hb != hgb->ctrl_vertices_group.end(); ++hb) - { - out << id_getter.get_id(*hb) << " "; - } - out << std::endl; + out << d->sm_ctrl_vertex_frame_map.size() << std::endl; // control vertices count + for(Ctrl_vertices_sm_group_data_list::const_iterator hgb = d->sm_ctrl_vertex_frame_map.begin(); hgb != d->sm_ctrl_vertex_frame_map.end(); ++hgb) { + + out << hgb->ctrl_vertices_group.size() << std::endl; + for(std::vector::const_iterator hb = hgb->ctrl_vertices_group.begin(); hb != hgb->ctrl_vertices_group.end(); ++hb) + { + out << id_getter.get_id(*hb) << " "; } + out << std::endl; } } @@ -2427,67 +2021,32 @@ void Scene_edit_polyhedron_item_priv::read_roi(const char* file_name, Mesh* mesh void Scene_edit_polyhedron_item::read_roi(const char* file_name) { - if(d->poly_item) - d->read_roi(file_name, polyhedron()); - else - d->read_roi(file_name, surface_mesh()); + d->read_roi(file_name, surface_mesh()); } void Scene_edit_polyhedron_item::overwrite_deform_object() { - if(d->poly_item) - d->deform_mesh->overwrite_initial_geometry(); - else - d->deform_sm_mesh->overwrite_initial_geometry(); + d->deform_sm_mesh->overwrite_initial_geometry(); refresh_all_group_centers(); } void Scene_edit_polyhedron_item::reset_deform_object() { - if(d->poly_item) - d->deform_mesh->reset(); - else - d->deform_sm_mesh->reset(); + d->deform_sm_mesh->reset(); refresh_all_group_centers(); } boost::optional Scene_edit_polyhedron_item::get_minimum_isolated_component() { - if(d->poly_item) - { - Travel_isolated_components::Minimum_visitor visitor; - Travel_isolated_components(*polyhedron()).travel - (vertices(*polyhedron()).first, vertices(*polyhedron()).second, - polyhedron()->size_of_vertices(), Is_selected(d->deform_mesh), visitor); - return visitor.minimum; - } - else - { - Travel_isolated_components::Minimum_visitor visitor; - Travel_isolated_components(*surface_mesh()).travel - (vertices(*surface_mesh()).first, vertices(*surface_mesh()).second, - num_vertices(*surface_mesh()), Is_selected(d->deform_sm_mesh), visitor); - return visitor.minimum; - } + Travel_isolated_components::Minimum_visitor visitor; + Travel_isolated_components(*surface_mesh()).travel + (vertices(*surface_mesh()).first, vertices(*surface_mesh()).second, + num_vertices(*surface_mesh()), Is_selected(d->deform_sm_mesh), visitor); + return visitor.minimum; } boost::optional Scene_edit_polyhedron_item::select_isolated_components(std::size_t threshold) { - if(d->poly_item) - { - typedef boost::function_output_iterator > Output_iterator; - Output_iterator out(d->deform_mesh); - - Travel_isolated_components::Selection_visitor visitor(threshold, out); - Travel_isolated_components(*polyhedron()).travel - (vertices(*polyhedron()).first, vertices(*polyhedron()).second, - polyhedron()->size_of_vertices(), Is_selected(d->deform_mesh), visitor); - - if(visitor.any_inserted) { invalidateOpenGLBuffers(); Q_EMIT itemChanged(); } - return visitor.minimum_visitor.minimum; - } - else - { typedef boost::function_output_iterator > Output_iterator; Output_iterator out(d->deform_sm_mesh); @@ -2498,16 +2057,10 @@ boost::optional Scene_edit_polyhedron_item::select_isolated_compone if(visitor.any_inserted) { invalidateOpenGLBuffers(); Q_EMIT itemChanged(); } return visitor.minimum_visitor.minimum; - } } bool Scene_edit_polyhedron_item::is_there_any_ctrl_vertices_group() { - if(d->poly_item) - { - Ctrl_vertices_poly_group_data_list::iterator hgb, hge; - return is_there_any_ctrl_vertices_group(hgb, hge); - } if(d->sm_item) { Ctrl_vertices_sm_group_data_list::iterator hgb, hge; @@ -2518,37 +2071,20 @@ bool Scene_edit_polyhedron_item::is_there_any_ctrl_vertices_group() bool Scene_edit_polyhedron_item::is_there_any_ctrl_vertices() { - if(d->poly_item) + Ctrl_vertices_sm_group_data_list::iterator hgb, hge; + if(!is_there_any_ctrl_vertices_group(hgb, hge)) { return false; } // there isn't any group of control vertices + + for(; hgb != hge; ++hgb) // check inside groups of control vertices { - Ctrl_vertices_poly_group_data_list::iterator hgb, hge; - if(!is_there_any_ctrl_vertices_group(hgb, hge)) { return false; } // there isn't any group of control vertices - - for(; hgb != hge; ++hgb) // check inside groups of control vertices - { - if(!hgb->ctrl_vertices_group.empty()) { return true; } - } - } - else - { - Ctrl_vertices_sm_group_data_list::iterator hgb, hge; - if(!is_there_any_ctrl_vertices_group(hgb, hge)) { return false; } // there isn't any group of control vertices - - for(; hgb != hge; ++hgb) // check inside groups of control vertices - { - if(!hgb->ctrl_vertices_group.empty()) { return true; } - } + if(!hgb->ctrl_vertices_group.empty()) { return true; } } return false; } void Scene_edit_polyhedron_item::refresh_all_group_centers() { - if(d->poly_item) - for(Ctrl_vertices_poly_group_data_list::iterator it = d->poly_ctrl_vertex_frame_map.begin(); it != d->poly_ctrl_vertex_frame_map.end(); ++it) - { it->refresh(polyhedron()); } - else - for(Ctrl_vertices_sm_group_data_list::iterator it = d->sm_ctrl_vertex_frame_map.begin(); it != d->sm_ctrl_vertex_frame_map.end(); ++it) - { it->refresh(surface_mesh()); } + for(Ctrl_vertices_sm_group_data_list::iterator it = d->sm_ctrl_vertex_frame_map.begin(); it != d->sm_ctrl_vertex_frame_map.end(); ++it) + { it->refresh(surface_mesh()); } } template @@ -2617,89 +2153,40 @@ bool Scene_edit_polyhedron_item::activate_closest_manipulated_frame(int x, int y } void Scene_edit_polyhedron_item::update_normals() { - if(d->poly_item) + BOOST_FOREACH(sm_vertex_descriptor vd, d->deform_sm_mesh->roi_vertices()) { - BOOST_FOREACH(poly_vertex_descriptor vd, d->deform_mesh->roi_vertices()) - { - std::size_t id = vd->id(); - const Polyhedron::Traits::Vector_3& n = - CGAL::Polygon_mesh_processing::compute_vertex_normal(vd, d->deform_mesh->halfedge_graph()); - d->normals[id*3] = n.x(); - d->normals[id*3+1] = n.y(); - d->normals[id*3+2] = n.z(); - - } + std::size_t id = id_setter->get_id(vd); + const EPICK::Vector_3& n = + CGAL::Polygon_mesh_processing::compute_vertex_normal(vd, d->deform_sm_mesh->halfedge_graph()); + d->normals[id*3] = n.x(); + d->normals[id*3+1] = n.y(); + d->normals[id*3+2] = n.z(); + } - else - { - BOOST_FOREACH(sm_vertex_descriptor vd, d->deform_sm_mesh->roi_vertices()) - { - std::size_t id = id_setter->get_id(vd); - const Polyhedron::Traits::Vector_3& n = - CGAL::Polygon_mesh_processing::compute_vertex_normal(vd, d->deform_sm_mesh->halfedge_graph()); - d->normals[id*3] = n.x(); - d->normals[id*3+1] = n.y(); - d->normals[id*3+2] = n.z(); - - } - } -} - -bool Scene_edit_polyhedron_item::hasPolyhedronItem()const -{ - if(d->poly_item) - return true; - return false; - } void Scene_edit_polyhedron_item::set_all_vertices_as_roi() { - if(d->poly_item) + boost::graph_traits::vertex_iterator vb, ve; + for(boost::tie(vb, ve) = vertices(*surface_mesh()); vb != ve; ++vb) { - poly_vertex_iterator vb, ve; - for(boost::tie(vb, ve) = vertices(*polyhedron()); vb != ve; ++vb) - { - insert_roi_vertex(*vb, polyhedron()); - } - } - else - { - boost::graph_traits::vertex_iterator vb, ve; - for(boost::tie(vb, ve) = vertices(*surface_mesh()); vb != ve; ++vb) - { - insert_roi_vertex(*vb, surface_mesh()); - } + insert_roi_vertex(*vb, surface_mesh()); } } void Scene_edit_polyhedron_item::delete_ctrl_vertices_group(bool create_new) { - if(d->poly_item) - d->delete_ctrl_vertices_group(polyhedron(), create_new); - else - d->delete_ctrl_vertices_group(surface_mesh(), create_new); + d->delete_ctrl_vertices_group(surface_mesh(), create_new); } -bool Scene_edit_polyhedron_item::insert_roi_vertex(poly_vertex_descriptor vh) -{ - - return insert_roi_vertex(vh, polyhedron()); -} - bool Scene_edit_polyhedron_item::insert_roi_vertex(sm_vertex_descriptor vh) { return insert_roi_vertex(vh, surface_mesh()); } -Scene_polyhedron_item* Scene_edit_polyhedron_item::poly_item()const -{ - return d->poly_item; -} - Scene_surface_mesh_item* Scene_edit_polyhedron_item::sm_item()const { return d->sm_item; diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/Scene_edit_polyhedron_item.h b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/Scene_edit_polyhedron_item.h index a5eaf6a28d5..1ab9c53a729 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/Scene_edit_polyhedron_item.h +++ b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/Scene_edit_polyhedron_item.h @@ -2,14 +2,13 @@ #define SCENE_EDIT_POLYHEDRON_ITEM_H //#define CGAL_PROFILE #include "Scene_edit_polyhedron_item_config.h" -#include "Scene_polyhedron_item.h" #include "Scene_surface_mesh_item.h" #include #include -#include "Scene_polyhedron_item_k_ring_selection.h" +#include "Plugins/PMP/Scene_facegraph_item_k_ring_selection.h" #include "Travel_isolated_components.h" #include @@ -41,48 +40,24 @@ typedef boost::graph_traits::halfedge_descriptor sm_halfedge_descriptor; //sets/gets the ID of a Mesh vertex descriptor in a different manner if Mesh is a Polyhedron or a SMesh struct Id_setter{ typedef boost::graph_traits::vertex_descriptor sm_vd; - typedef boost::graph_traits::vertex_descriptor p_vd; typedef boost::graph_traits::face_descriptor sm_fd; - typedef boost::graph_traits::face_descriptor p_fd; - - Polyhedron* poly; SMesh* sm; boost::property_map< SMesh, boost::vertex_index_t >::type im; - - Id_setter(Polyhedron* poly) - :poly(poly), sm(NULL){} - Id_setter(SMesh* sm) - :poly(NULL), sm(sm) + :sm(sm) { im = get(boost::vertex_index, *sm); } - std::size_t get_id(p_vd vd) - { - return vd->id(); - } std::size_t get_id(sm_vd vd) { return static_cast(im[vd]); } - - void set_id(p_vd vd, std::size_t id) - { - vd->id() = id; - } //update the visu map void set_id(sm_vd, std::size_t) { } - - void set_id(p_fd fd, std::size_t id) - { - boost::property_map::type fim - = get(CGAL::face_index, *poly); - put(fim, fd, id); - } //cannot set a surface_mesh id, but it is only use din case the id = -1 which cannot happen so it's ok void set_id(sm_fd, std::size_t) { @@ -91,11 +66,6 @@ struct Id_setter{ }; - - -typedef boost::graph_traits::vertex_descriptor poly_vertex_descriptor; -typedef boost::graph_traits::vertex_iterator poly_vertex_iterator; - class Scene_spheres_item; namespace PMP = CGAL::Polygon_mesh_processing; template @@ -103,7 +73,7 @@ struct Array_based_vertex_point_map { public: typedef typename boost::graph_traits::vertex_descriptor key_type; - typedef Kernel::Point_3 value_type; + typedef EPICK::Point_3 value_type; typedef const value_type& reference; typedef boost::read_write_property_map_tag category; std::vector* positions; @@ -153,11 +123,6 @@ put(Array_based_vertex_point_map map, } } } - -typedef CGAL::Surface_mesh_deformation > Deform_mesh; - typedef CGAL::Surface_mesh_deformation > Deform_sm_mesh; @@ -275,8 +240,6 @@ struct Mouse_keyboard_state_deformation : ctrl_pressing(false), shift_pressing(false), left_button_pressing(false), right_button_pressing(false) { } }; - -typedef std::list > Ctrl_vertices_poly_group_data_list; typedef std::list > Ctrl_vertices_sm_group_data_list; struct Scene_edit_polyhedron_item_priv; // This class represents a polyhedron in the OpenGL scene @@ -289,10 +252,9 @@ class SCENE_EDIT_POLYHEDRON_ITEM_EXPORT Scene_edit_polyhedron_item Q_OBJECT public: Scene_edit_polyhedron_item(){} //needed by the transparent interface - /// Create an Scene_edit_polyhedron_item from a Scene_polyhedron_item. + /// Create an Scene_edit_polyhedron_item from a Scene_surface-mesh_item. /// The ownership of the polyhedron is moved to the new edit_polyhedron /// item. - Scene_edit_polyhedron_item(Scene_polyhedron_item* poly_item, Ui::DeformMesh* ui_widget, QMainWindow* mw); Scene_edit_polyhedron_item(Scene_surface_mesh_item* sm_item, Ui::DeformMesh* ui_widget, QMainWindow* mw); ~Scene_edit_polyhedron_item(); @@ -321,20 +283,11 @@ public: void draw_ROI_and_control_vertices(CGAL::Three::Viewer_interface *viewer) const; template void draw_frame_plane(CGAL::QGLViewer *, Mesh *mesh) const; - - // Get wrapped polyhedron - Polyhedron* polyhedron(); - const Polyhedron* polyhedron() const; - Scene_polyhedron_item* poly_item() const; // Get wrapped Surface_mesh SMesh* surface_mesh(); const SMesh* surface_mesh() const; Scene_surface_mesh_item* sm_item() const; - /// Returns a Scene_polyhedron_item from the edit polyhedron item, and - /// transfer the ownership of the polyhedron to it. - /// The item 'this' must be destroy just after a call to this function. - Scene_polyhedron_item* to_polyhedron_item(); Scene_surface_mesh_item* to_sm_item(); // Get dimensions @@ -351,7 +304,6 @@ public: bool eventFilter(QObject *target, QEvent *event); void update_frame_plane(); void ShowAsSphere(bool b); - bool hasPolyhedronItem()const; public Q_SLOTS: void reset_spheres(); @@ -359,8 +311,7 @@ public Q_SLOTS: void change(); void invalidateOpenGLBuffers(); - void selected(const std::set::vertex_descriptor>&); - void selected(const std::set::vertex_descriptor>& ); + void selected(const std::set&); void select(double orig_x, double orig_y, @@ -386,7 +337,6 @@ public: bool insert_roi_vertex(typename boost::graph_traits::vertex_descriptor v, Mesh* mesh); //for calls from the plugin - bool insert_roi_vertex(poly_vertex_descriptor vh); bool insert_roi_vertex(sm_vertex_descriptor vh); template @@ -422,10 +372,6 @@ public: M_Deform_mesh* dm; Is_selected(M_Deform_mesh* dm) : dm(dm) {} - bool count(poly_vertex_descriptor vh) const { - return dm->is_roi_vertex(vh); - } - bool count(sm_vertex_descriptor vh) const { return dm->is_roi_vertex(vh); } @@ -439,9 +385,6 @@ public: Array_based_vertex_point_map > M_Deform_mesh; Select_roi_output(M_Deform_mesh* dm) : dm(dm) { } - void operator()(poly_vertex_descriptor vh) { - dm->insert_roi_vertex(vh); - } void operator()(sm_vertex_descriptor vd) { dm->insert_roi_vertex(vd); } @@ -457,9 +400,6 @@ protected: // std::cout << message.toStdString() << std::endl; } - bool is_there_any_ctrl_vertices_group(Ctrl_vertices_poly_group_data_list::iterator& hgb, - Ctrl_vertices_poly_group_data_list::iterator& hge); - bool is_there_any_ctrl_vertices_group(Ctrl_vertices_sm_group_data_list::iterator& hgb, Ctrl_vertices_sm_group_data_list::iterator& hge); diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/Scene_edit_polyhedron_item_config.h b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/Scene_edit_polyhedron_item_config.h index a1fde07abcf..15fbaedbbe0 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/Scene_edit_polyhedron_item_config.h +++ b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/Scene_edit_polyhedron_item_config.h @@ -1,7 +1,7 @@ #ifndef SCENE_EDIT_POLYHEDRON_ITEM_CONFIG_H #define SCENE_EDIT_POLYHEDRON_ITEM_CONFIG_H -#ifdef scene_edit_polyhedron_item_EXPORTS +#ifdef scene_edit_item_EXPORTS # define SCENE_EDIT_POLYHEDRON_ITEM_EXPORT Q_DECL_EXPORT #else # define SCENE_EDIT_POLYHEDRON_ITEM_EXPORT Q_DECL_IMPORT diff --git a/Polyhedron/demo/Polyhedron/Polyhedron_type.h b/Polyhedron/demo/Polyhedron/Polyhedron_type.h deleted file mode 100644 index b3c843c8294..00000000000 --- a/Polyhedron/demo/Polyhedron/Polyhedron_type.h +++ /dev/null @@ -1,241 +0,0 @@ -#ifndef POLYHEDRON_TYPE_H -#define POLYHEDRON_TYPE_H - -// CGAL -// kernel -#include "Kernel_type.h" -#include "properties.h" - -// surface mesh -#include -#include - -#include -#include - -#include - -#include - -template -class Polyhedron_demo_vertex : - public CGAL::HalfedgeDS_vertex_base -{ -public: - typedef std::set Set_of_indices; - -private: - typedef CGAL::HalfedgeDS_vertex_base Pdv_base; - - Set_of_indices indices; - std::size_t mID; - std::size_t time_stamp_; - -public: - int nb_of_feature_edges; - - bool is_corner() const { - return nb_of_feature_edges > 2; - } - - bool is_feature_vertex() const { - return nb_of_feature_edges != 0; - } - - void clear_incident_patches() - { - indices.clear(); - } - - void add_incident_patch(const Patch_id& i) { - indices.insert(i); - } - - /// For the determinism of Compact_container iterators - ///@{ - 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; - } - ///}@ - - const Set_of_indices& - incident_patches_ids_set() const { - return indices; - } - - Set_of_indices& - incident_patches_ids_set() { - return indices; - } - - std::size_t& id() { return mID; } - std::size_t id() const { return mID; } - - Polyhedron_demo_vertex() : Pdv_base(), mID(-1), time_stamp_(-1), nb_of_feature_edges(0) {} - Polyhedron_demo_vertex(const Point& p) : Pdv_base(p), mID(-1), time_stamp_(-1), nb_of_feature_edges(0) {} -}; - -template -class Polyhedron_demo_halfedge : - public CGAL::HalfedgeDS_halfedge_base -{ -private: - bool feature_edge; - std::size_t mID; - std::size_t time_stamp_; - -public: - - Polyhedron_demo_halfedge() - : feature_edge(false), mID(-1) {}; - - bool is_feature_edge() const { - return feature_edge; - } - - void set_feature_edge(const bool b) { - feature_edge = b; - this->opposite()->feature_edge = b; - } - - std::size_t& id() { return mID; } - std::size_t id() const { return mID; } - - /// For the determinism of Compact_container iterators - ///@{ - 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 -inline std::pair -patch_id_default_value(std::pair) -{ - return std::pair(1, 0); -} - -template -inline Integral patch_id_default_value(Integral) -{ - return Integral(1); -} - -template -class Polyhedron_demo_face : - public CGAL::HalfedgeDS_face_base -{ -private: - Patch_id_ patch_id_; - std::size_t mID; - std::size_t time_stamp_; - -public: - typedef Patch_id_ Patch_id; - - Polyhedron_demo_face() - : patch_id_(patch_id_default_value(Patch_id())), mID(-1) {} - - const Patch_id& patch_id() const { - return patch_id_; - } - - void set_patch_id(const Patch_id& i) { - patch_id_ = i; - } - - std::size_t& id() { return mID; } - std::size_t id() const { return mID; } - - /// For the determinism of Compact_container iterators - ///@{ - 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 Polyhedron_demo_items : public CGAL::Polyhedron_items_3 { -public: - // wrap vertex - template struct Vertex_wrapper - { - typedef typename Traits::Point_3 Point; - typedef Polyhedron_demo_vertex Vertex; - }; - - // wrap face - template struct Face_wrapper - { - typedef Polyhedron_demo_face Face; - }; - - // wrap halfedge - template struct Halfedge_wrapper - { - typedef Polyhedron_demo_halfedge Halfedge; - }; -}; - -#include "Polyhedron_type_fwd.h" - -inline -boost::property_map::type -get(CGAL::vertex_selection_t, const Polyhedron& p) -{ - return get(boost::vertex_index,p); -} -inline -boost::property_map::type -get(CGAL::face_selection_t, const Polyhedron& p) -{ - return get(boost::face_index,p); -} - -namespace boost -{ -template <> -struct property_map -{ - typedef boost::property_map::type type; - typedef boost::property_map::const_type const_type; -}; -template <> -struct property_map -{ - typedef boost::property_map::type type; - typedef boost::property_map::const_type const_type; -}; -}//boost - -// surface mesh -typedef Polyhedron_demo_items Polyhedron_items; -typedef CGAL::Polyhedron_3 Polyhedron; - -#endif // POLYHEDRON_TYPE_H diff --git a/Polyhedron/demo/Polyhedron/Polyhedron_type_fwd.h b/Polyhedron/demo/Polyhedron/Polyhedron_type_fwd.h deleted file mode 100644 index 016ec3b6247..00000000000 --- a/Polyhedron/demo/Polyhedron/Polyhedron_type_fwd.h +++ /dev/null @@ -1,64 +0,0 @@ -#ifndef POLYHEDRON_TYPE_FWD_H -#define POLYHEDRON_TYPE_FWD_H - -#include -#include - -#ifdef USE_FORWARD_DECL - -#include - -template -class Polyhedron_demo_items; - -namespace CGAL { - - namespace Mesh_3 { - template - struct Robust_intersection_traits_3; - } - - template < typename FT_ > - struct Simple_cartesian; - - class Epick; - - class Polyhedron_items_3; - - template < class T, class I, class A> - class HalfedgeDS_default; - - template < class PolyhedronTraits_3, - class PolyhedronItems_3, - template < class T, class I, class A> - class T_HDS, - class Alloc - > - class Polyhedron_3; - - class Epick; -} // end namespace CGAL - -// kernel -namespace polyhedron_type_fwd_h { -// changed since CGAL-3.8-Ic-8 - typedef CGAL::Epick K1; - typedef CGAL::Mesh_3::Robust_intersection_traits_3 Kernel; -} - -#else // USE_FORWARD_DECL - -#include "Polyhedron_type.h" - -#endif // USE_FORWARD_DECL - -// surface mesh -typedef int Patch_id; - -typedef CGAL::Polyhedron_3, - // CGAL::Polyhedron_items_3, - CGAL::HalfedgeDS_default, - std::allocator > Polyhedron; - -#endif // POLYHEDRON_TYPE_FWD_H diff --git a/Polyhedron/demo/Polyhedron/Preferences.ui b/Polyhedron/demo/Polyhedron/Preferences.ui index 9ee87e2be7a..0435444e306 100644 --- a/Polyhedron/demo/Polyhedron/Preferences.ui +++ b/Polyhedron/demo/Polyhedron/Preferences.ui @@ -6,81 +6,272 @@ 0 0 - 377 - 503 + 631 + 631
    + + + 0 + 0 + + Preferences - + - - - Face_graph Mode - - - - - - <html><head/><body><p align="justify">The default FaceGraph item is the Scene_polyhedron_item.</p><p align="justify"><br/></p><p align="justify">Plugins generating FaceGraph items from another type of item will create a Scene_polyhedron_item. This mode might be more stable and a few plugins only exist for it.</p></body></html> - - - Polyhedron - - - true - - - - - - - <html><head/><body><p>The default FaceGraph item is the Scene_surface_mesh_item.</p><p align="justify"><br/></p><p align="justify">Plugins generating FaceGraph items from another type of item will create a Scene_surface_mesh_item. This mode is globally more efficient in terms of memory and performance, but a few plugins have not been implemented for it yet.</p></body></html> - - - Surface_mesh - - - - - - - - - - Tick plugins you don't want to load at start up - - - - - - - false - - - QAbstractItemView::NoSelection - - - true - - - 2 - - - false - - - - 1 - - - - - 2 - - - + + + + + + 0 + 0 + + + + Settings + + + + + + + 0 + 0 + + + + Qt::ScrollBarAsNeeded + + + Qt::ScrollBarAlwaysOff + + + QAbstractScrollArea::AdjustIgnored + + + true + + + + + 0 + 0 + 278 + 537 + + + + + + + &Antialiasing + + + + + + + &Quick Camera Mode + + + + + + + + 0 + 0 + + + + Max Text Items Displayed: + + + 1 + + + 999999999 + + + 100000 + + + + + + + + 0 + 0 + + + + Transparency Pass Number: + + + 4 + + + + + + + Surface Mesh Default RenderingMode + + + + + + 1 + + + + Gouraud + + + + + flat+edges + + + + + flat + + + + + wire + + + + + points + + + + + + + + + + + Point Set Default RenderingMode + + + + + + + points + + + + + shaded points + + + + + pts+normals + + + + + + + + + + + Change &Background Color... + + + + + + + Change Lighting &Settings... + + + + + + + Change Default Saveas Dir... + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + + + + Plugins Management + + + + + + Tick plugins you don't want to load at start up + + + + + + + false + + + QAbstractItemView::NoSelection + + + true + + + 2 + + + false + + + + 1 + + + + + 2 + + + + + + + + diff --git a/Polyhedron/demo/Polyhedron/Scene.cpp b/Polyhedron/demo/Polyhedron/Scene.cpp index 5aa6c13dda9..7e4e0fcf240 100644 --- a/Polyhedron/demo/Polyhedron/Scene.cpp +++ b/Polyhedron/demo/Polyhedron/Scene.cpp @@ -534,17 +534,17 @@ void Scene::renderScene(const QList &items, viewer->glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); } item.draw(viewer); - } - - if(with_names) { - - // read depth buffer at pick location; - float depth = 1.0; - viewer->glReadPixels(picked_pixel.x(),viewer->camera()->screenHeight()-1-picked_pixel.y(),1,1,GL_DEPTH_COMPONENT, GL_FLOAT, &depth); - if (depth != 1.0) - { - //add object to list of picked objects; - picked_item_IDs[depth] = index; + + if(with_names) { + + // read depth buffer at pick location; + float depth = 1.0; + viewer->glReadPixels(picked_pixel.x(),viewer->camera()->screenHeight()-1-picked_pixel.y(),1,1,GL_DEPTH_COMPONENT, GL_FLOAT, &depth); + if (depth != 1.0) + { + //add object to list of picked objects; + picked_item_IDs[depth] = index; + } } } if(group) @@ -1151,15 +1151,19 @@ int Scene::selectionBindex() const { QItemSelection Scene::createSelection(int i) { - return QItemSelection(index_map.keys(i).at(0), index_map.keys(i).at(4)); } QItemSelection Scene::createSelectionAll() { - return QItemSelection(index(0, 0,index_map.key(0).parent()), - index(m_entries.size()-1, 4, index_map.key(0).parent())); + //it is not possible to directly create a selection with items that have different parents, so + //we do it iteratively. + QItemSelection sel; + for(int i=0; i< m_entries.size(); ++i) + sel.select(index_map.keys(i).at(0), + index_map.keys(i).at(4)); + return sel; } void Scene::itemChanged() diff --git a/Polyhedron/demo/Polyhedron/Scene_c3t3_item.cpp b/Polyhedron/demo/Polyhedron/Scene_c3t3_item.cpp index dc72c883f6c..c2842b84760 100644 --- a/Polyhedron/demo/Polyhedron/Scene_c3t3_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_c3t3_item.cpp @@ -1,6 +1,7 @@ #include "config.h" #include "Scene_spheres_item.h" #include "Scene_c3t3_item.h" +#include "Scene_surface_mesh_item.h" #include #include @@ -31,11 +32,10 @@ #include #include "Scene_polygon_soup_item.h" -#include "Scene_polyhedron_item.h" -typedef CGAL::AABB_triangulation_3_triangle_primitive Primitive; -typedef CGAL::AABB_traits Traits; +typedef CGAL::AABB_triangulation_3_triangle_primitive Primitive; +typedef CGAL::AABB_traits Traits; typedef CGAL::AABB_tree Tree; typedef Tree::Point_and_primitive_id Point_and_primitive_id; @@ -151,7 +151,7 @@ public : alphaSlider->setValue(255); } QOpenGLFramebufferObject* fbo = viewer->depthPeelingFbo(); - const Kernel::Plane_3& plane = qobject_cast(this->parent())->plane(); + const EPICK::Plane_3& plane = qobject_cast(this->parent())->plane(); vaos[Facets]->bind(); program = getShaderProgram(PROGRAM_C3T3); attribBuffers(viewer, PROGRAM_C3T3); @@ -184,7 +184,7 @@ public : program = getShaderProgram(PROGRAM_C3T3_EDGES); attribBuffers(viewer, PROGRAM_C3T3_EDGES); program->bind(); - const Kernel::Plane_3& plane = qobject_cast(this->parent())->plane(); + const EPICK::Plane_3& plane = qobject_cast(this->parent())->plane(); QVector4D cp(-plane.a(), -plane.b(), -plane.c(), -plane.d()); program->setUniformValue("cutplane", cp); program->setAttributeValue("colors", QColor(Qt::black)); @@ -388,10 +388,8 @@ struct Scene_c3t3_item_priv { intersection = NULL; spheres_are_shown = false; cnc_are_shown = false; - show_tetrahedra = true; is_aabb_tree_built = false; are_intersection_buffers_filled = false; - is_grid_shown = true; alphaSlider = NULL; } void computeIntersection(const Primitive& facet); @@ -573,6 +571,7 @@ struct Scene_c3t3_item_priv { bool is_aabb_tree_built; bool cnc_are_shown; bool is_valid; + bool is_surface; }; struct Set_show_tetrahedra { @@ -584,7 +583,7 @@ struct Set_show_tetrahedra { } }; -Scene_c3t3_item::Scene_c3t3_item() +Scene_c3t3_item::Scene_c3t3_item(bool is_surface) : Scene_group_item("unnamed", Scene_c3t3_item_priv::NumberOfBuffers, Scene_c3t3_item_priv::NumberOfVaos) , d(new Scene_c3t3_item_priv(this)) @@ -595,9 +594,12 @@ Scene_c3t3_item::Scene_c3t3_item() c3t3_changed(); setRenderingMode(FlatPlusEdges); create_flat_and_wire_sphere(1.0f,d->s_vertex,d->s_normals, d->ws_vertex); + d->is_surface = is_surface; + d->is_grid_shown = !is_surface; + d->show_tetrahedra = !is_surface; } -Scene_c3t3_item::Scene_c3t3_item(const C3t3& c3t3) +Scene_c3t3_item::Scene_c3t3_item(const C3t3& c3t3, bool is_surface) : Scene_group_item("unnamed", Scene_c3t3_item_priv::NumberOfBuffers, Scene_c3t3_item_priv::NumberOfVaos) , d(new Scene_c3t3_item_priv(c3t3, this)) { @@ -605,6 +607,9 @@ Scene_c3t3_item::Scene_c3t3_item(const C3t3& c3t3) compute_bbox(); connect(d->frame, SIGNAL(modified()), this, SLOT(changed())); d->reset_cut_plane(); + d->is_surface = is_surface; + d->is_grid_shown = !is_surface; + d->show_tetrahedra = !is_surface; c3t3_changed(); setRenderingMode(FlatPlusEdges); create_flat_and_wire_sphere(1.0f,d->s_vertex,d->s_normals, d->ws_vertex); @@ -995,6 +1000,7 @@ void Scene_c3t3_item::draw(CGAL::Three::Viewer_interface* viewer) const { d->program->setUniformValue("far", (float)viewer->camera()->zFar()); d->program->setUniformValue("writing", viewer->isDepthWriting()); d->program->setUniformValue("alpha", alpha()); + d->program->setUniformValue("is_surface", d->is_surface); if( fbo) viewer->glBindTexture(GL_TEXTURE_2D, fbo->texture()); viewer->glDrawArrays(GL_TRIANGLES, 0, static_cast(d->positions_poly_size / 3)); @@ -1080,6 +1086,7 @@ void Scene_c3t3_item::drawEdges(CGAL::Three::Viewer_interface* viewer) const { d->program->bind(); QVector4D cp(this->plane().a(),this->plane().b(),this->plane().c(),this->plane().d()); d->program->setUniformValue("cutplane", cp); + d->program->setUniformValue("is_surface", d->is_surface); d->program->setAttributeValue("colors", QColor(Qt::black)); viewer->glDrawArrays(GL_LINES, 0, static_cast(d->positions_lines_size / 3)); d->program->release(); @@ -1133,6 +1140,7 @@ void Scene_c3t3_item::drawPoints(CGAL::Three::Viewer_interface * viewer) const d->program->bind(); QVector4D cp(this->plane().a(),this->plane().b(),this->plane().c(),this->plane().d()); d->program->setUniformValue("cutplane", cp); + d->program->setUniformValue("is_surface", d->is_surface); d->program->setAttributeValue("colors", this->color()); viewer->glDrawArrays(GL_POINTS, 0, static_cast(d->positions_lines.size() / 3)); vaos[Scene_c3t3_item_priv::Edges]->release(); @@ -1273,12 +1281,11 @@ double Scene_c3t3_item_priv::complex_diag() const { void Scene_c3t3_item::export_facets_in_complex() { - Polyhedron outmesh; + SMesh outmesh; CGAL::facets_in_complex_3_to_triangle_mesh(c3t3(), outmesh); - Scene_polyhedron_item* item = new Scene_polyhedron_item(std::move(outmesh)); + Scene_surface_mesh_item* item = new Scene_surface_mesh_item(std::move(outmesh)); item->setName(QString("%1_%2").arg(this->name()).arg("facets")); scene->addItem(item); - this->setVisible(false); } diff --git a/Polyhedron/demo/Polyhedron/Scene_c3t3_item.h b/Polyhedron/demo/Polyhedron/Scene_c3t3_item.h index b197070b85f..5a6e41eb2cd 100644 --- a/Polyhedron/demo/Polyhedron/Scene_c3t3_item.h +++ b/Polyhedron/demo/Polyhedron/Scene_c3t3_item.h @@ -19,6 +19,7 @@ #include #include +#include #include #include @@ -33,8 +34,8 @@ using namespace CGAL::Three; public: typedef CGAL::qglviewer::ManipulatedFrame ManipulatedFrame; - Scene_c3t3_item(); - Scene_c3t3_item(const C3t3& c3t3); + Scene_c3t3_item(bool is_surface = false); + Scene_c3t3_item(const C3t3& c3t3, bool is_surface = false); ~Scene_c3t3_item(); bool has_stats()const Q_DECL_OVERRIDE {return true;} diff --git a/Polyhedron/demo/Polyhedron/Scene_facegraph_transform_item_config.h b/Polyhedron/demo/Polyhedron/Scene_facegraph_transform_item_config.h index 7235cbfffd8..50a8908de4b 100644 --- a/Polyhedron/demo/Polyhedron/Scene_facegraph_transform_item_config.h +++ b/Polyhedron/demo/Polyhedron/Scene_facegraph_transform_item_config.h @@ -1,7 +1,7 @@ #ifndef SCENE_FACEGRAPH_TRANSFORM_ITEM_CONFIG_H #define SCENE_FACEGRAPH_TRANSFORM_ITEM_CONFIG_H -#if defined( scene_polyhedron_transform_item_EXPORTS) || defined(scene_sm_transform_item_EXPORTS) +#if defined( scene_transform_item_EXPORTS) # define SCENE_FACEGRAPH_TRANSFORM_ITEM_EXPORT Q_DECL_EXPORT #else # define SCENE_FACEGRAPH_TRANSFORM_ITEM_EXPORT Q_DECL_IMPORT diff --git a/Polyhedron/demo/Polyhedron/Scene_group_item.cpp b/Polyhedron/demo/Polyhedron/Scene_group_item.cpp index 0a3c31f6653..ce41b1615b4 100644 --- a/Polyhedron/demo/Polyhedron/Scene_group_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_group_item.cpp @@ -31,7 +31,21 @@ bool Scene_group_item::isEmpty() const { Scene_group_item::Bbox Scene_group_item::bbox() const { - return Bbox(0, 0, 0, 0, 0,0); + Scene_item* first_non_empty = nullptr; + Q_FOREACH(Scene_interface::Item_id id, children) + if(!getChild(id)->isEmpty()) + { + first_non_empty = getChild(id); + } + + if(first_non_empty) + { + Bbox b =first_non_empty->bbox(); + Q_FOREACH(Scene_interface::Item_id id, children) + b+=getChild(id)->bbox(); + return b; + } + return Bbox(0,0,0,0,0,0); } diff --git a/Polyhedron/demo/Polyhedron/Scene_item.cpp b/Polyhedron/demo/Polyhedron/Scene_item.cpp index fb69699861a..7093872e5e3 100644 --- a/Polyhedron/demo/Polyhedron/Scene_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_item.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include #include #include @@ -61,30 +62,6 @@ void CGAL::Three::Scene_item::itemAboutToBeDestroyed(CGAL::Three::Scene_item* it } } - -QString modeName(RenderingMode mode) { - switch(mode) - { - case Points: - return QObject::tr("points"); - case ShadedPoints: - return QObject::tr("shaded points"); - case Wireframe: - return QObject::tr("wire"); - case Flat: - return QObject::tr("flat"); - case FlatPlusEdges: - return QObject::tr("flat+edges"); - case Gouraud: - return QObject::tr("Gouraud"); - case PointsPlusNormals: - return QObject::tr("pts+normals"); - default: - Q_ASSERT(false); - return QObject::tr("unknown"); - } -} - const char* slotName(RenderingMode mode) { switch(mode) { @@ -111,7 +88,7 @@ const char* slotName(RenderingMode mode) { // Rendering mode as a human readable string QString CGAL::Three::Scene_item::renderingModeName() const { - return modeName(renderingMode()); + return CGAL::Three::Three::modeName(renderingMode()); } QMenu* CGAL::Three::Scene_item::contextMenu() { @@ -125,7 +102,7 @@ QMenu* CGAL::Three::Scene_item::contextMenu() ++mode) { if(!supportsRenderingMode(RenderingMode(mode))) continue; - QString mName = modeName(RenderingMode(mode)); + QString mName = CGAL::Three::Three::modeName(RenderingMode(mode)); defaultContextMenu->addAction(tr("Set %1 Mode") .arg(mName), this, @@ -135,6 +112,11 @@ QMenu* CGAL::Three::Scene_item::contextMenu() return defaultContextMenu; } +void CGAL::Three::Scene_item::resetMenu() +{ + delete defaultContextMenu; + defaultContextMenu = nullptr; +} CGAL::Three::Scene_group_item* CGAL::Three::Scene_item::parentGroup() const { return parent_group; } diff --git a/Polyhedron/demo/Polyhedron/Scene_item_rendering_helper.cpp b/Polyhedron/demo/Polyhedron/Scene_item_rendering_helper.cpp index c4b6e12b0e3..78ef1ecbf7b 100644 --- a/Polyhedron/demo/Polyhedron/Scene_item_rendering_helper.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_item_rendering_helper.cpp @@ -134,7 +134,6 @@ void Scene_item_rendering_helper::initGL() const void Scene_item_rendering_helper::processData(Gl_data_names )const { computeElements(); - //redraw(); } diff --git a/Polyhedron/demo/Polyhedron/Scene_nef_polyhedron_item.cpp b/Polyhedron/demo/Polyhedron/Scene_nef_polyhedron_item.cpp index f1a534cd6fd..73323d7ea95 100644 --- a/Polyhedron/demo/Polyhedron/Scene_nef_polyhedron_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_nef_polyhedron_item.cpp @@ -1,9 +1,8 @@ #include "Scene_nef_polyhedron_item.h" #include -#include "Scene_polyhedron_item.h" #include "Scene_surface_mesh_item.h" #include "Nef_type.h" -#include "Polyhedron_type.h" +#include "SMesh_type.h" #include #include #include @@ -603,78 +602,20 @@ Scene_nef_polyhedron_item::compute_bbox() const { bbox.xmax(),bbox.ymax(),bbox.zmax()); } -// quick hacks to convert polyhedra from exact to inexact and vice-versa -template -struct Copy_polyhedron_to - : public CGAL::Modifier_base -{ - Copy_polyhedron_to(const Polyhedron_input& in_poly) - : in_poly(in_poly) {} - - void operator()(typename Polyhedron_output::HalfedgeDS& out_hds) - { - typedef typename Polyhedron_output::HalfedgeDS Output_HDS; - - CGAL::Polyhedron_incremental_builder_3 builder(out_hds); - - typedef typename Polyhedron_input::Vertex_const_iterator Vertex_const_iterator; - typedef typename Polyhedron_input::Facet_const_iterator Facet_const_iterator; - typedef typename Polyhedron_input::Halfedge_around_facet_const_circulator HFCC; - - builder.begin_surface(in_poly.size_of_vertices(), - in_poly.size_of_facets(), - in_poly.size_of_halfedges()); - - for(Vertex_const_iterator - vi = in_poly.vertices_begin(), end = in_poly.vertices_end(); - vi != end ; ++vi) - { - typename Polyhedron_output::Point_3 p(::CGAL::to_double( vi->point().x()), - ::CGAL::to_double( vi->point().y()), - ::CGAL::to_double( vi->point().z())); - builder.add_vertex(p); - } - - typedef CGAL::Inverse_index Index; - Index index( in_poly.vertices_begin(), in_poly.vertices_end()); - - for(Facet_const_iterator - fi = in_poly.facets_begin(), end = in_poly.facets_end(); - fi != end; ++fi) - { - HFCC hc = fi->facet_begin(); - HFCC hc_end = hc; - // std::size_t n = circulator_size( hc); - // CGAL_assertion( n >= 3); - builder.begin_facet (); - do { - builder.add_vertex_to_facet(index[hc->vertex()]); - ++hc; - } while( hc != hc_end); - builder.end_facet(); - } - builder.end_surface(); - } // end operator()(..) -private: - const Polyhedron_input& in_poly; -}; // end Copy_polyhedron_to<> - template void copy_to(const Poly_A& poly_a, Poly_B& poly_b) { - Copy_polyhedron_to modifier(poly_a); - poly_b.delegate(modifier); + CGAL::copy_face_graph(poly_a, poly_b); } void from_exact(Exact_polyhedron& in, - Polyhedron& out) + SMesh& out) { copy_to(in, out); CGAL_assertion(out.is_valid()); } -void to_exact(Polyhedron& in, +void to_exact(SMesh& in, Exact_polyhedron& out) { copy_to(in, out); @@ -697,19 +638,6 @@ struct Face_index_pmap }; // [static] -Scene_nef_polyhedron_item* -Scene_nef_polyhedron_item::from_polygon_mesh(Scene_polyhedron_item *item) -{ - //return from_templated_polygon_mesh(item); - Polyhedron* poly = item->polyhedron(); - if(!poly) return 0; - CGAL::Polyhedron_3 exact_poly; - CGAL::copy_face_graph(*poly, exact_poly); - Nef_polyhedron* nef_poly = new Nef_polyhedron(exact_poly); - - return new Scene_nef_polyhedron_item(nef_poly); -} - Scene_nef_polyhedron_item* Scene_nef_polyhedron_item::from_polygon_mesh(Scene_surface_mesh_item* item) { @@ -721,13 +649,7 @@ Scene_nef_polyhedron_item::from_polygon_mesh(Scene_surface_mesh_item* item) return new Scene_nef_polyhedron_item(nef_poly); } -Scene_polyhedron_item* Scene_nef_polyhedron_item::convert_to_polyhedron() const -{ - Polyhedron* poly = new Polyhedron(); - CGAL::convert_nef_polyhedron_to_polygon_mesh(*this->nef_polyhedron(), *poly); - CGAL::Polygon_mesh_processing::triangulate_faces(*poly); - return new Scene_polyhedron_item(poly); -} + Scene_surface_mesh_item* Scene_nef_polyhedron_item::convert_to_surface_mesh() const { SMesh* poly = new SMesh(); @@ -771,7 +693,7 @@ sum(const Scene_nef_polyhedron_item& a, void Scene_nef_polyhedron_item:: -convex_decomposition(std::list< Scene_polyhedron_item*>& convex_parts) +convex_decomposition(std::list< Scene_surface_mesh_item*>& convex_parts) { // copy the Nef polyhedron, as markers are added Nef_polyhedron N(*d->nef_poly); @@ -784,9 +706,9 @@ convex_decomposition(std::list< Scene_polyhedron_item*>& convex_parts) if(ci->mark()) { Exact_polyhedron P; N.convert_inner_shell_to_polyhedron(ci->shells_begin(), P); - Polyhedron* poly = new Polyhedron; + SMesh* poly = new SMesh; from_exact(P, *poly); - Scene_polyhedron_item *spoly = new Scene_polyhedron_item(poly); + Scene_surface_mesh_item *spoly = new Scene_surface_mesh_item(poly); convex_parts.push_back(spoly); spoly->invalidateOpenGLBuffers(); } diff --git a/Polyhedron/demo/Polyhedron/Scene_nef_polyhedron_item.h b/Polyhedron/demo/Polyhedron/Scene_nef_polyhedron_item.h index 2c5f8d1a2a1..728fb7054bb 100644 --- a/Polyhedron/demo/Polyhedron/Scene_nef_polyhedron_item.h +++ b/Polyhedron/demo/Polyhedron/Scene_nef_polyhedron_item.h @@ -5,7 +5,6 @@ #include "Nef_type_fwd.h" #include #include -class Scene_polyhedron_item; class Scene_surface_mesh_item; struct Scene_nef_polyhedron_item_priv; class SCENE_NEF_POLYHEDRON_ITEM_EXPORT Scene_nef_polyhedron_item @@ -50,11 +49,8 @@ public: bool is_simple() const; bool is_Triangle; // conversion operations - static Scene_nef_polyhedron_item* from_polygon_mesh(Scene_polyhedron_item *); static Scene_nef_polyhedron_item* from_polygon_mesh(Scene_surface_mesh_item*); - - Scene_polyhedron_item* convert_to_polyhedron() const; Scene_surface_mesh_item* convert_to_surface_mesh() const; // Nef boolean operations @@ -71,7 +67,7 @@ public: sum(const Scene_nef_polyhedron_item&, const Scene_nef_polyhedron_item&); - void convex_decomposition(std::list< Scene_polyhedron_item*>&); + void convex_decomposition(std::list< Scene_surface_mesh_item*>&); protected: friend struct Scene_nef_polyhedron_item_priv; Scene_nef_polyhedron_item_priv* d; diff --git a/Polyhedron/demo/Polyhedron/Scene_points_with_normal_item.cpp b/Polyhedron/demo/Polyhedron/Scene_points_with_normal_item.cpp index cf53bbbb9eb..fd6fae2feb2 100644 --- a/Polyhedron/demo/Polyhedron/Scene_points_with_normal_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_points_with_normal_item.cpp @@ -8,6 +8,7 @@ #include #include +#include #include #include #include @@ -27,7 +28,6 @@ #include #include -#include "Polyhedron_type.h" #ifdef CGAL_LINKED_WITH_TBB #include @@ -81,22 +81,6 @@ struct Scene_points_with_normal_item_priv } } - Scene_points_with_normal_item_priv(const Polyhedron& input_mesh, Scene_points_with_normal_item* parent) - : m_points(new Point_set) - { - init_values(parent); - Polyhedron::Vertex_iterator v; - m_points->add_normal_map(); - for (v = const_cast(input_mesh).vertices_begin(); - v != const_cast(input_mesh).vertices_end(); v++) - { - const Kernel::Point_3& p = v->point(); - Kernel::Vector_3 n = - CGAL::Polygon_mesh_processing::compute_vertex_normal(v, input_mesh); - m_points->insert(p,n); - } - } - ~Scene_points_with_normal_item_priv() { if(m_points) @@ -229,16 +213,17 @@ Scene_points_with_normal_item::Scene_points_with_normal_item(const Scene_points_ { d = new Scene_points_with_normal_item_priv(toCopy, this); - if (has_normals()) - { - setRenderingMode(PointsPlusNormals); - is_selected = true; - } - else - { - setRenderingMode(Points); - is_selected = true; - } + + if (!has_normals()) + { + setRenderingMode(Points); + is_selected = true; + } + else{ + setRenderingMode(CGAL::Three::Three::defaultPointSetRenderingMode()); + is_selected = true; + } + if(d->m_points->number_of_points() < 30 ) d->point_Slider->setValue(5); else @@ -254,22 +239,7 @@ Scene_points_with_normal_item::Scene_points_with_normal_item(const SMesh& input_ // Converts Polyhedron vertices to point set. // Computes vertices normal from connectivity. d = new Scene_points_with_normal_item_priv(input_mesh, this); - setRenderingMode(PointsPlusNormals); - is_selected = true; - if(d->m_points->number_of_points() < 30 ) - d->point_Slider->setValue(5); - else - d->point_Slider->setValue(2); - invalidateOpenGLBuffers(); -} - -Scene_points_with_normal_item::Scene_points_with_normal_item(const Polyhedron& input_mesh) - : Scene_item(Scene_points_with_normal_item_priv::NbOfVbos,Scene_points_with_normal_item_priv::NbOfVaos) -{ - // Converts Polyhedron vertices to point set. - // Computes vertices normal from connectivity. - d = new Scene_points_with_normal_item_priv(input_mesh, this); - setRenderingMode(PointsPlusNormals); + setRenderingMode(CGAL::Three::Three::defaultPointSetRenderingMode()); is_selected = true; if(d->m_points->number_of_points() < 30 ) d->point_Slider->setValue(5); @@ -615,8 +585,13 @@ bool Scene_points_with_normal_item::read_las_point_set(std::istream& stream) std::cerr << d->m_points->info(); - if (d->m_points->has_normal_map()) - setRenderingMode(PointsPlusNormals); + if (!d->m_points->has_normal_map()) + { + setRenderingMode(Points); + } + else{ + setRenderingMode(CGAL::Three::Three::defaultPointSetRenderingMode()); + } if (d->m_points->check_colors()) std::cerr << "-> Point set has colors" << std::endl; @@ -653,8 +628,13 @@ bool Scene_points_with_normal_item::read_ply_point_set(std::istream& stream) d->point_Slider->setValue(2); std::cerr << d->m_points->info(); - if (d->m_points->has_normal_map()) - setRenderingMode(PointsPlusNormals); + if (!d->m_points->has_normal_map()) + { + setRenderingMode(Points); + } + else{ + setRenderingMode(CGAL::Three::Three::defaultPointSetRenderingMode()); + } if (d->m_points->check_colors()) std::cerr << "-> Point set has colors" << std::endl; diff --git a/Polyhedron/demo/Polyhedron/Scene_points_with_normal_item.h b/Polyhedron/demo/Polyhedron/Scene_points_with_normal_item.h index 7d4afa3aa48..cb19829832b 100644 --- a/Polyhedron/demo/Polyhedron/Scene_points_with_normal_item.h +++ b/Polyhedron/demo/Polyhedron/Scene_points_with_normal_item.h @@ -5,7 +5,6 @@ #include #include "Scene_points_with_normal_item_config.h" #include -#include "Polyhedron_type_fwd.h" #include "Kernel_type.h" #include "Point_set_3.h" #include @@ -34,7 +33,6 @@ public: Scene_points_with_normal_item(const Scene_points_with_normal_item& toCopy); Scene_points_with_normal_item(const SMesh& input_mesh); - Scene_points_with_normal_item(const Polyhedron& input_mesh); ~Scene_points_with_normal_item(); Scene_points_with_normal_item* clone() const Q_DECL_OVERRIDE; diff --git a/Polyhedron/demo/Polyhedron/Scene_polygon_soup_item.cpp b/Polyhedron/demo/Polyhedron/Scene_polygon_soup_item.cpp index cd8b6c6fb1f..dd0fadf86e0 100644 --- a/Polyhedron/demo/Polyhedron/Scene_polygon_soup_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_polygon_soup_item.cpp @@ -2,11 +2,8 @@ #include #include "Scene_polygon_soup_item.h" -#include "Scene_polyhedron_item.h" #include "Scene_surface_mesh_item.h" #include -#include -#include #include #include @@ -26,6 +23,8 @@ #include #include +#include + #include #include "triangulate_primitive.h" #include @@ -34,7 +33,7 @@ struct Scene_polygon_soup_item_priv{ typedef Polygon_soup::Polygons::const_iterator Polygons_iterator; - typedef Kernel::Point_3 Point_3; + typedef EPICK::Point_3 Point_3; Scene_polygon_soup_item_priv(Scene_polygon_soup_item* parent) : soup(0), @@ -91,49 +90,6 @@ struct Scene_polygon_soup_item_priv{ }; -struct Polyhedron_to_polygon_soup_writer { - typedef Kernel::Point_3 Point_3; - - Polygon_soup* soup; - Polygon_soup::Polygon_3 polygon; - - Polyhedron_to_polygon_soup_writer(Polygon_soup* soup) : soup(soup), polygon() { - } - - void write_header( std::ostream&, - std::size_t /* vertices */, - std::size_t /* halfedges */, - std::size_t /* facets */, - bool /* normals */ = false ) { - soup->clear(); - } - - void write_footer() { - } - - void write_vertex( const double& x, const double& y, const double& z) { - soup->points.push_back(Point_3(x, y, z)); - } - - void write_normal( const double& /* x */, const double& /* y */, const double& /* z */) { - } - - void write_facet_header() { - } - - void write_facet_begin( std::size_t no) { - polygon.clear(); - polygon.reserve(no); - } - void write_facet_vertex_index( std::size_t index) { - polygon.push_back(index); - } - void write_facet_end() { - soup->polygons.push_back(polygon); - polygon.clear(); - } -}; // end struct Polyhedron_to_soup_writer - void Scene_polygon_soup_item_priv::initializeBuffers(CGAL::Three::Viewer_interface* viewer) const { @@ -242,7 +198,7 @@ Scene_polygon_soup_item_priv::initializeBuffers(CGAL::Three::Viewer_interface* v item->are_buffers_filled = true; } -typedef Polyhedron::Traits Traits; +typedef EPICK Traits; typedef Polygon_soup::Polygon_3 Facet; void @@ -256,11 +212,12 @@ Scene_polygon_soup_item_priv::triangulate_polygon(Polygons_iterator pit, int pol // The three first vertices may be aligned, we need to test other // combinations + Point_3 pa, pb, pc; for (std::size_t i = 0; i < pit->size() - 2; ++ i) { - const Point_3& pa = soup->points[pit->at(i)]; - const Point_3& pb = soup->points[pit->at(i+1)]; - const Point_3& pc = soup->points[pit->at(i+2)]; + pa = soup->points[pit->at(i)]; + pb = soup->points[pit->at(i+1)]; + pc = soup->points[pit->at(i+2)]; if (!CGAL::collinear (pa, pb, pc)) { normal = CGAL::cross_product(pb-pa, pc -pa); @@ -271,7 +228,24 @@ Scene_polygon_soup_item_priv::triangulate_polygon(Polygons_iterator pit, int pol if (normal == CGAL::NULL_VECTOR) // No normal could be computed, return return; - typedef FacetTriangulator FT; + normal = normal / std::sqrt (normal * normal); + + // If the 3 points used to estimate the normal form a concavity, + // then the normal is wrongly oriented. To address this, we + // compute the resulting projected 2D polygon and check if it + // correctly oriented (counterclockwise). If it's not, we invert + // the normal. + { + EPICK::Plane_3 plane (pa, normal); + CGAL::Polygon_2 poly; + for (std::size_t i = 0; i < pit->size(); ++ i) + poly.push_back (plane.to_2d(soup->points[pit->at(i)])); + + if (poly.is_simple() && poly.is_clockwise_oriented()) + normal = -normal; + } + + typedef FacetTriangulator FT; double diagonal; if(item->diagonalBbox() != std::numeric_limits::infinity()) @@ -329,21 +303,14 @@ Scene_polygon_soup_item_priv::triangulate_polygon(Polygons_iterator pit, int pol positions_poly.push_back(ffit->vertex(2)->point().z()); positions_poly.push_back(1.0); - - const Point_3& pa = soup->points[pit->at(0)]; - const Point_3& pb = soup->points[pit->at(1)]; - const Point_3& pc = soup->points[pit->at(2)]; - - Kernel::Vector_3 n = CGAL::cross_product(pb-pa, pc -pa); - n = n / std::sqrt(n * n); CGAL::Color color; if(!soup->fcolors.empty()) color = soup->fcolors[polygon_id]; for(int i=0; i<3; i++) { - normals.push_back(n.x()); - normals.push_back(n.y()); - normals.push_back(n.z()); + normals.push_back(normal.x()); + normals.push_back(normal.y()); + normals.push_back(normal.z()); if(!soup->fcolors.empty()) { f_colors.push_back((float)color.red()/255); @@ -388,7 +355,7 @@ Scene_polygon_soup_item_priv::compute_normals_and_vertices() const{ const Point_3& pb = soup->points[it->at(1)]; const Point_3& pc = soup->points[it->at(2)]; - Kernel::Vector_3 n = CGAL::cross_product(pb-pa, pc -pa); + EPICK::Vector_3 n = CGAL::cross_product(pb-pa, pc -pa); n = n / std::sqrt(n * n); normals.push_back(n.x()); @@ -514,8 +481,6 @@ void Scene_polygon_soup_item::init_polygon_soup(std::size_t nb_pts, std::size_t } - -//#include #include template void polygon_mesh_to_soup(PolygonMesh& mesh, Polygon_soup& soup) @@ -548,15 +513,6 @@ void polygon_mesh_to_soup(PolygonMesh& mesh, Polygon_soup& soup) } -void Scene_polygon_soup_item::load(Scene_polyhedron_item* poly_item) { - if(!poly_item) return; - if(!poly_item->polyhedron()) return; - - if(!d->soup) - d->soup = new Polygon_soup; - polygon_mesh_to_soup(*poly_item->polyhedron(), *d->soup); - invalidateOpenGLBuffers(); -} void Scene_polygon_soup_item::load(Scene_surface_mesh_item* sm_item) { if(!sm_item) return; @@ -671,28 +627,6 @@ Scene_polygon_soup_item::save(std::ostream& out) const return (bool) out; } -bool -Scene_polygon_soup_item::exportAsPolyhedron(Polyhedron* out_polyhedron) -{ - if (!orient()) - return false; - - CGAL::Polygon_mesh_processing::polygon_soup_to_polygon_mesh( - d->soup->points, d->soup->polygons, *out_polyhedron); - std::size_t rv = CGAL::Polygon_mesh_processing::remove_isolated_vertices(*out_polyhedron); - if(rv > 0) - std::cerr << "Ignore isolated vertices: " << rv << std::endl; - if(out_polyhedron->size_of_vertices() > 0) { - // Also check whether the consistent orientation is fine - if(out_polyhedron->is_closed() && - !CGAL::Polygon_mesh_processing::is_outward_oriented(*out_polyhedron)) { - out_polyhedron->inside_out(); - } - return true; - } - return false; -} - bool Scene_polygon_soup_item::exportAsSurfaceMesh(SMesh *out_surface_mesh) { diff --git a/Polyhedron/demo/Polyhedron/Scene_polygon_soup_item.h b/Polyhedron/demo/Polyhedron/Scene_polygon_soup_item.h index 656d50cab01..f2deb9fadf7 100644 --- a/Polyhedron/demo/Polyhedron/Scene_polygon_soup_item.h +++ b/Polyhedron/demo/Polyhedron/Scene_polygon_soup_item.h @@ -2,7 +2,6 @@ #define SCENE_POLYGON_SOUP_ITEM_H #include "Scene_polygon_soup_item_config.h" #include -#include "Polyhedron_type.h" #include "SMesh_type.h" #include @@ -13,7 +12,7 @@ struct Scene_polygon_soup_item_priv; struct Polygon_soup { - typedef Kernel::Point_3 Point_3; + typedef EPICK::Point_3 Point_3; typedef std::vector Points; //vector containing 3 indices of points in Points typedef std::vector Polygon_3; @@ -97,7 +96,6 @@ struct Polygon_soup }; -class Scene_polyhedron_item; class Scene_surface_mesh_item; class SCENE_POLYGON_SOUP_ITEM_EXPORT Scene_polygon_soup_item @@ -105,7 +103,7 @@ class SCENE_POLYGON_SOUP_ITEM_EXPORT Scene_polygon_soup_item { Q_OBJECT public: - typedef Kernel::Point_3 Point_3; + typedef EPICK::Point_3 Point_3; typedef Polygon_soup::Points Points; typedef Polygon_soup::Polygons Polygons; typedef Polygon_soup::Edges Edges; @@ -125,7 +123,6 @@ public: const std::vector& vcolors); bool load(std::istream& in); - void load(Scene_polyhedron_item*); void load(Scene_surface_mesh_item*); bool isDataColored(); @@ -158,7 +155,6 @@ public: public Q_SLOTS: void shuffle_orientations(); bool orient(); - bool exportAsPolyhedron(Polyhedron*); bool exportAsSurfaceMesh(SMesh*); void inside_out(); diff --git a/Polyhedron/demo/Polyhedron/Scene_polyhedron_item.cpp b/Polyhedron/demo/Polyhedron/Scene_polyhedron_item.cpp deleted file mode 100644 index 8295558388e..00000000000 --- a/Polyhedron/demo/Polyhedron/Scene_polyhedron_item.cpp +++ /dev/null @@ -1,2284 +0,0 @@ -#include "Scene_polyhedron_item.h" -#include - -#ifndef Q_MOC_RUN -#include -#include "Kernel_type.h" -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#endif // Q_MOC_RUN - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifndef Q_MOC_RUN -#include -#include "triangulate_primitive.h" -#include "Color_map.h" -#include "id_printing.h" -#endif // Q_MOC_RUN - -namespace PMP = CGAL::Polygon_mesh_processing; -typedef Polyhedron::Traits Traits; -typedef Polyhedron::Facet Facet; -typedef Polyhedron::Traits Kernel; -typedef Kernel::Point_3 Point; -typedef Kernel::Vector_3 Vector; -typedef Polyhedron::Halfedge_around_facet_circulator HF_circulator; -typedef boost::graph_traits::face_descriptor face_descriptor; -//Used to triangulate the AABB_Tree -class Primitive -{ -public: - // types - typedef Polyhedron::Facet_iterator Id; // Id type - typedef Kernel::Point_3 Point; // point type - typedef Kernel::Triangle_3 Datum; // datum type - -private: - // member data - Id m_it; // iterator - Datum m_datum; // 3D triangle - - // constructor -public: - Primitive() {} - Primitive(Datum triangle, Id it) - : m_it(it), m_datum(triangle) - { - } -public: - Id& id() { return m_it; } - const Id& id() const { return m_it; } - Datum& datum() { return m_datum; } - const Datum& datum() const { return m_datum; } - - /// Returns a point on the primitive - Point reference_point() const { return m_datum.vertex(0); } -}; -typedef CGAL::AABB_traits AABB_traits; -typedef CGAL::AABB_tree Input_facets_AABB_tree; - -struct Scene_polyhedron_item_priv{ - typedef Polyhedron::Facet_iterator Facet_iterator; - typedef std::vector Color_vector; - Scene_polyhedron_item_priv(Scene_polyhedron_item* item) - : item(item), poly(new Polyhedron) - { - init_default_values(); - } - Scene_polyhedron_item_priv(const Polyhedron& poly_, Scene_polyhedron_item* item) - : item(item), poly(new Polyhedron(poly_)) - { - init_default_values(); - } - - Scene_polyhedron_item_priv(Polyhedron* const poly_, Scene_polyhedron_item* item) - : item(item), poly(poly_) - { - init_default_values(); - } - ~Scene_polyhedron_item_priv() - { - delete poly; - BOOST_FOREACH(TextItem* it, targeted_id) - delete it; - } - - void init_default_values() { - program = NULL; - show_only_feature_edges_m = false; - show_feature_edges_m = false; - facet_picking_m = false; - erase_next_picked_facet_m = false; - plugin_has_set_color_vector_m = false; - nb_facets = 0; - nb_lines = 0; - nb_f_lines = 0; - is_multicolor = false; - no_flat = false; - vertices_displayed = false; - edges_displayed = false; - faces_displayed = false; - face_idx_buffer = QOpenGLBuffer(QOpenGLBuffer::IndexBuffer); - face_idx_buffer.create(); - edge_idx_buffer = QOpenGLBuffer(QOpenGLBuffer::IndexBuffer); - edge_idx_buffer.create(); - f_edge_idx_buffer = QOpenGLBuffer(QOpenGLBuffer::IndexBuffer); - f_edge_idx_buffer.create(); - invalidate_stats(); - CGAL::set_halfedgeds_items_id(*poly); - } - - - void compute_normals_and_vertices(const bool is_recent, - const bool colors_only = false, - const bool draw_two_sides = false) const; - - bool isFacetConvex(Facet_iterator, const Polyhedron::Traits::Vector_3&)const; - - void triangulate_convex_facet(Facet_iterator, - const bool, const bool, const bool is_recent)const; - - void triangulate_facet(Scene_polyhedron_item::Facet_iterator, - const Traits::Vector_3& normal, - const bool colors_only, - const bool draw_two_sides, - const bool is_recent) const; - void init(); - void invalidate_stats(); - void* get_aabb_tree(); - QList triangulate_primitive(Polyhedron::Facet_iterator fit, - Traits::Vector_3 normal); - Color_vector colors_; - bool show_only_feature_edges_m; - bool show_feature_edges_m; - bool facet_picking_m; - bool erase_next_picked_facet_m; - bool no_flat; - //the following variable is used to indicate if the color vector must not be automatically updated. - // If this boolean is true, the item's color will be independant of the color's wheel, if it is false - // changing the color in the wheel will change the color of the item, even if it is multicolor. - bool plugin_has_set_color_vector_m; - bool is_multicolor; - void killIds(); - void fillTargetedIds(const Polyhedron::Facet_handle& selected_fh, - const Kernel::Point_3 &point_under, - CGAL::Three::Viewer_interface *viewer, - const CGAL::qglviewer::Vec &offset); - Scene_polyhedron_item* item; - Polyhedron *poly; - double volume, area; - QVector colors; - mutable std::vector positions_lines; - mutable std::vector idx_lines; - mutable std::vector idx_feature_lines; - mutable std::vector idx_faces; - mutable std::vector positions_facets; - mutable std::vector normals_gouraud; - mutable std::vector normals_flat; - mutable std::vector color_facets; - mutable std::size_t nb_facets; - mutable std::size_t nb_lines; - mutable std::size_t nb_f_lines; - mutable QOpenGLShaderProgram *program; - mutable QOpenGLBuffer face_idx_buffer; - mutable QOpenGLBuffer edge_idx_buffer; - mutable QOpenGLBuffer f_edge_idx_buffer; - - unsigned int number_of_null_length_edges; - unsigned int number_of_degenerated_faces; - int genus; - bool self_intersect; - int m_min_patch_id; // the min value of the patch ids initialized in init() - mutable bool vertices_displayed; - mutable bool edges_displayed; - mutable bool faces_displayed; - mutable QList text_ids; - mutable std::vector targeted_id; - void initialize_buffers(CGAL::Three::Viewer_interface *viewer = 0) const; - enum VAOs { - Facets=0, - Edges, - Feature_edges, - Gouraud_Facets, - NbOfVaos - }; - enum VBOs { - Facets_vertices = 0, - Facets_color, - Edges_vertices, - Feature_edges_vertices, - Edges_color, - Facets_normals_gouraud, - Facets_normals_flat, - NbOfVbos - }; - TextListItem* textVItems; - TextListItem* textEItems; - TextListItem* textFItems; - // Initialization -}; - - - -const char* aabb_property_name = "Scene_polyhedron_item aabb tree"; - - -QList Scene_polyhedron_item_priv::triangulate_primitive(Polyhedron::Facet_iterator fit, - Traits::Vector_3 normal) -{ - typedef FacetTriangulator::vertex_descriptor> FT; - //The output list - QList res; - //check if normal contains NaN values - if (normal.x() != normal.x() || normal.y() != normal.y() || normal.z() != normal.z()) - { - qDebug()<<"Warning in triangulation of the selection item: normal contains NaN values and is not valid."; - return QList(); - } - double diagonal; - if(item->diagonalBbox() != std::numeric_limits::infinity()) - diagonal = item->diagonalBbox(); - else - diagonal = 0.0; - FT triangulation(fit,normal,poly,diagonal); - //iterates on the internal faces to add the vertices to the positions - //and the normals to the appropriate vectors - for( FT::CDT::Finite_faces_iterator - ffit = triangulation.cdt->finite_faces_begin(), - end = triangulation.cdt->finite_faces_end(); - ffit != end; ++ffit) - { - if(ffit->info().is_external) - continue; - - - res << Kernel::Triangle_3(ffit->vertex(0)->point(), - ffit->vertex(1)->point(), - ffit->vertex(2)->point()); - - } - return res; -} - - - -void* Scene_polyhedron_item_priv::get_aabb_tree() -{ - QVariant aabb_tree_property = item->property(aabb_property_name); - if(aabb_tree_property.isValid()) { - void* ptr = aabb_tree_property.value(); - return static_cast(ptr); - } - else { - QApplication::setOverrideCursor(Qt::WaitCursor); - Polyhedron* poly = item->polyhedron(); - if(poly) { - - Input_facets_AABB_tree* tree = - new Input_facets_AABB_tree(); - typedef Polyhedron::Traits Kernel; - int index =0; - BOOST_FOREACH( Polyhedron::Facet_iterator f, faces(*poly)) - { - if (CGAL::is_degenerate_triangle_face(f, *poly, get(CGAL::vertex_point, *poly), Kernel())) - continue; - if(!f->is_triangle()) - { - Traits::Vector_3 normal = f->plane().orthogonal_vector(); //initialized in compute_normals_and_vertices - index +=3; - Q_FOREACH(Kernel::Triangle_3 triangle, triangulate_primitive(f,normal)) - { - Primitive primitive(triangle, f); - tree->insert(primitive); - } - } - else - { - Kernel::Triangle_3 triangle( - f->halfedge()->vertex()->point(), - f->halfedge()->next()->vertex()->point(), - f->halfedge()->next()->next()->vertex()->point() - ); - Primitive primitive(triangle, f); - tree->insert(primitive); - } - } - item->setProperty(aabb_property_name, - QVariant::fromValue(tree)); - QApplication::restoreOverrideCursor(); - return tree; - } - else return 0; - } -} - -void delete_aabb_tree(Scene_polyhedron_item* item) -{ - QVariant aabb_tree_property = item->property(aabb_property_name); - if(aabb_tree_property.isValid()) { - void* ptr = aabb_tree_property.value(); - Input_facets_AABB_tree* tree = static_cast(ptr); - if(tree) { - delete tree; - tree = 0; - } - item->setProperty(aabb_property_name, QVariant()); - } -} - -template -void push_back_xyz(const TypeWithXYZ& t, - ContainerWithPushBack& vector) -{ - vector.push_back(t.x()); - vector.push_back(t.y()); - vector.push_back(t.z()); -} - - -template -void push_back_rgb(const TypeWithRGB& t, - ContainerWithPushBack& vector) -{ - vector.push_back(t.redF()); - vector.push_back(t.greenF()); - vector.push_back(t.blueF()); -} - -bool Scene_polyhedron_item_priv::isFacetConvex(Facet_iterator f, const Polyhedron::Traits::Vector_3& N) const -{ - typedef Polyhedron::Traits::Vector_3 Vector; - typedef Polyhedron::Traits::Orientation Orientation; - Orientation orientation; - Vector normal = N; - Facet::Halfedge_around_facet_circulator - he = f->facet_begin(), - he_end(he); - bool normal_is_ok; - do{ - normal_is_ok = true; - - //Initializes the facet orientation - - Polyhedron::Traits::Point_3 S,T; - S = source(he, *poly)->point(); - T = target(he, *poly)->point(); - Vector V1 = Vector((T-S).x(), (T-S).y(), (T-S).z()); - S = source(he->next(), *poly)->point(); - T = target(he->next(), *poly)->point(); - Vector V2 = Vector((T-S).x(), (T-S).y(), (T-S).z()); - - if(normal == Vector(0,0,0)) - normal_is_ok = false; - if(normal_is_ok) - { - orientation = Polyhedron::Traits::Orientation_3()(V1, V2, normal); - if( orientation == CGAL::COPLANAR ) - normal_is_ok = false; - } - //Checks if the normal is good : if the normal is null - // or if it is coplanar to the facet, we need another one. - if(!normal_is_ok) - { - normal = CGAL::cross_product(V1,V2); - } - - }while( ++he != he_end && !normal_is_ok); - //if no good normal can be found, stop here. - if (!normal_is_ok) - return false; - - //computes convexness - - //re-initializes he_end; - he = f->facet_begin(), - he_end = he; - do - { - Polyhedron::Traits::Point_3 S,T; - S = source(he, *poly)->point(); - T = target(he, *poly)->point(); - Vector V1 = Vector((T-S).x(), (T-S).y(), (T-S).z()); - S = source(he->next(), *poly)->point(); - T = target(he->next(), *poly)->point(); - Vector V2 = Vector((T-S).x(), (T-S).y(), (T-S).z()); - Orientation res = Polyhedron::Traits::Orientation_3()(V1, V2, normal) ; - - if(res!= orientation && res != CGAL::ZERO) - return false; - }while( ++he != he_end); - return true; -} - -void Scene_polyhedron_item_priv::triangulate_convex_facet(Facet_iterator f, - const bool colors_only, - const bool draw_two_sides, - const bool is_recent)const -{ - const CGAL::qglviewer::Vec v_offset = static_cast(CGAL::QGLViewer::QGLViewerPool().first())->offset(); - Vector offset = Vector(v_offset.x, v_offset.y, v_offset.z); - Polyhedron::Traits::Point_3 p0,p1,p2; - Facet::Halfedge_around_facet_circulator - he = f->facet_begin(), - he_end(he); - const int this_patch_id = f->patch_id(); - while( next(he, *poly) != prev(he_end, *poly)) - { - ++he; - if (is_multicolor) - { - for (int i = 0; i<3; ++i) - { - color_facets.push_back(colors_[this_patch_id-m_min_patch_id].redF()); - color_facets.push_back(colors_[this_patch_id-m_min_patch_id].greenF()); - color_facets.push_back(colors_[this_patch_id-m_min_patch_id].blueF()); - - color_facets.push_back(colors_[this_patch_id-m_min_patch_id].redF()); - color_facets.push_back(colors_[this_patch_id-m_min_patch_id].greenF()); - color_facets.push_back(colors_[this_patch_id-m_min_patch_id].blueF()); - } - } - if (colors_only) - continue; - - - p0 = he_end->vertex()->point(); - p1 = he->vertex()->point(); - p2 = next(he, *poly)->vertex()->point(); - - idx_faces.push_back(static_cast(he_end->vertex()->id())); - idx_faces.push_back(static_cast(he->vertex()->id())); - idx_faces.push_back(static_cast(next(he, *poly)->vertex()->id())); - - if(is_multicolor || !no_flat || !is_recent ) - { - push_back_xyz(p0+offset, positions_facets); - push_back_xyz(p1+offset, positions_facets); - push_back_xyz(p2+offset, positions_facets); - } - if(!draw_two_sides) - { - push_back_xyz(f->plane().orthogonal_vector(), normals_flat); - push_back_xyz(f->plane().orthogonal_vector(), normals_flat); - push_back_xyz(f->plane().orthogonal_vector(), normals_flat); - } - } - - -} -//Make sure all the facets are triangles -void -Scene_polyhedron_item_priv::triangulate_facet(Scene_polyhedron_item::Facet_iterator fit, - const Traits::Vector_3& normal, - const bool colors_only, - const bool draw_two_sides, - const bool is_recent) const - - -{ - typedef FacetTriangulator::vertex_descriptor> FT; - const CGAL::qglviewer::Vec v_offset = static_cast(CGAL::QGLViewer::QGLViewerPool().first())->offset(); - Vector offset = Vector(v_offset.x, v_offset.y, v_offset.z); - double diagonal; - if(item->diagonalBbox() != std::numeric_limits::infinity()) - diagonal = item->diagonalBbox(); - else - diagonal = 0.0; - FT triangulation(fit,normal,poly,diagonal,offset); - - if(triangulation.cdt->dimension() != 2 ) - { - qDebug()<<"Warning : cdt not right. Facet not displayed"; - return; - } - - //iterates on the internal faces to add the vertices to the positions - //and the normals to the appropriate vectors - const int this_patch_id = fit->patch_id(); - for(FT::CDT::Finite_faces_iterator - ffit = triangulation.cdt->finite_faces_begin(), - end = triangulation.cdt->finite_faces_end(); - ffit != end; ++ffit) - { - if(ffit->info().is_external) - continue; - - if (is_multicolor) - { - for (int i = 0; i<3; ++i) - { - push_back_rgb(colors_[this_patch_id-m_min_patch_id], color_facets); - } - } - if (colors_only) - continue; - - idx_faces.push_back(static_cast(triangulation.v2v[ffit->vertex(0)]->id())); - idx_faces.push_back(static_cast(triangulation.v2v[ffit->vertex(1)]->id())); - idx_faces.push_back(static_cast(triangulation.v2v[ffit->vertex(2)]->id())); - - if(is_multicolor || !no_flat || !is_recent) - { - push_back_xyz(ffit->vertex(0)->point(), positions_facets); - push_back_xyz(ffit->vertex(1)->point(), positions_facets); - push_back_xyz(ffit->vertex(2)->point(), positions_facets); - if(!draw_two_sides) - { - push_back_xyz(normal, normals_flat); - push_back_xyz(normal, normals_flat); - push_back_xyz(normal, normals_flat); - } - } - } -} - - - -void -Scene_polyhedron_item_priv::initialize_buffers(CGAL::Three::Viewer_interface* viewer) const -{ - //vao containing the data for the facets - if((!viewer->isOpenGL_4_3() && !no_flat )|| is_multicolor) - { - //flat - if(viewer->property("draw_two_sides").toBool()) - { - program = item->getShaderProgram(Scene_polyhedron_item::PROGRAM_OLD_FLAT, viewer); - } - else - { - program = item->getShaderProgram(Scene_polyhedron_item::PROGRAM_WITH_LIGHT, viewer); - } - } - program = item->getShaderProgram(Scene_polyhedron_item::PROGRAM_WITH_LIGHT, viewer); - program->bind(); - //gouraud - item->vaos[Gouraud_Facets]->bind(); - item->buffers[Edges_vertices].bind(); - item->buffers[Edges_vertices].allocate(positions_lines.data(), - static_cast(positions_lines.size()*sizeof(float))); - program->enableAttributeArray("vertex"); - program->setAttributeBuffer("vertex",GL_FLOAT,0,3); - item->buffers[Edges_vertices].release(); - face_idx_buffer.bind(); - face_idx_buffer.allocate(idx_faces.data(), - static_cast(idx_faces.size()*sizeof(unsigned int))); - face_idx_buffer.release(); - - - item->buffers[Facets_normals_gouraud].bind(); - item->buffers[Facets_normals_gouraud].allocate(normals_gouraud.data(), - static_cast(normals_gouraud.size()*sizeof(float))); - program->enableAttributeArray("normals"); - program->setAttributeBuffer("normals",GL_FLOAT,0,3); - item->buffers[Facets_normals_gouraud].release(); - if(is_multicolor) - { - item->buffers[Facets_color].bind(); - item->buffers[Facets_color].allocate(color_facets.data(), - static_cast(color_facets.size()*sizeof(float))); - program->enableAttributeArray("colors"); - program->setAttributeBuffer("colors",GL_FLOAT,0,3); - item->buffers[Facets_color].release(); - } - else - { - program->disableAttributeArray("colors"); - } - item->vaos[Gouraud_Facets]->release(); - program->release(); - if(viewer->isOpenGL_4_3() && !is_multicolor) - { - //modern flat - program = item->getShaderProgram(Scene_polyhedron_item::PROGRAM_FLAT, viewer); - program->bind(); - item->vaos[Gouraud_Facets]->bind(); - item->buffers[Edges_vertices].bind(); - program->enableAttributeArray("vertex"); - program->setAttributeBuffer("vertex",GL_FLOAT,0,3); - item->buffers[Edges_vertices].release(); - if(is_multicolor) - { - item->buffers[Facets_color].bind(); - program->enableAttributeArray("colors"); - program->setAttributeBuffer("colors",GL_FLOAT,0,3); - item->buffers[Facets_color].release(); - } - else - { - program->disableAttributeArray("colors"); - } - item->vaos[Gouraud_Facets]->release(); - program->release(); - } - //vao containing the data for the lines - { - program = item->getShaderProgram(Scene_polyhedron_item::PROGRAM_WITHOUT_LIGHT, viewer); - program->bind(); - item->vaos[Edges]->bind(); - - item->buffers[Edges_vertices].bind(); - program->enableAttributeArray("vertex"); - program->setAttributeBuffer("vertex",GL_FLOAT,0,3); - item->buffers[Edges_vertices].release(); - edge_idx_buffer.bind(); - edge_idx_buffer.allocate(idx_lines.data(), - static_cast(idx_lines.size()*sizeof(unsigned int))); - edge_idx_buffer.release(); - - program->disableAttributeArray("colors"); - program->release(); - - item->vaos[Edges]->release(); - - } - //vao containing the data for the feature_edges - { - program = item->getShaderProgram(Scene_polyhedron_item::PROGRAM_NO_SELECTION, viewer); - program->bind(); - item->vaos[Feature_edges]->bind(); - - item->buffers[Edges_vertices].bind(); - program->enableAttributeArray("vertex"); - program->setAttributeBuffer("vertex",GL_FLOAT,0,3); - item->buffers[Edges_vertices].release(); - - f_edge_idx_buffer.bind(); - f_edge_idx_buffer.allocate(idx_feature_lines.data(), - static_cast(idx_feature_lines.size()*sizeof(unsigned int))); - f_edge_idx_buffer.release(); - program->disableAttributeArray("colors"); - program->release(); - - item->vaos[Feature_edges]->release(); - - } - nb_lines = positions_lines.size(); - positions_lines.resize(0); - positions_lines.shrink_to_fit(); - nb_facets = positions_facets.size(); - positions_facets.resize(0); - positions_facets.shrink_to_fit(); - - color_facets.resize(0); - color_facets.shrink_to_fit(); - normals_gouraud.resize(0); - normals_gouraud.shrink_to_fit(); - normals_flat.resize(0); - normals_flat.shrink_to_fit(); - - - if (viewer->hasText()) - viewer->updateIds(item); - item->are_buffers_filled = true; -} - -void -Scene_polyhedron_item_priv::compute_normals_and_vertices(const bool is_recent, - const bool colors_only, - const bool draw_two_sides) const -{ - bool add_flat_data = is_multicolor || (!is_recent || !no_flat); - const CGAL::qglviewer::Vec v_offset = static_cast(CGAL::QGLViewer::QGLViewerPool().first())->offset(); - - QApplication::setOverrideCursor(Qt::WaitCursor); - positions_facets.resize(0); - positions_lines.resize(0); - normals_gouraud.resize(0); - normals_flat.resize(0); - color_facets.resize(0); - idx_faces.resize(0); - idx_lines.resize(0); - idx_feature_lines.resize(0); - - //Facets - typedef Polyhedron::Traits Kernel; - typedef Kernel::Point_3 Point; - typedef Kernel::Vector_3 Vector; - typedef Polyhedron::Facet_iterator Facet_iterator; - typedef Polyhedron::Halfedge_around_facet_circulator HF_circulator; - typedef boost::graph_traits::face_descriptor face_descriptor; - typedef boost::graph_traits::vertex_descriptor vertex_descriptor; - Vector offset = Vector(v_offset.x, v_offset.y, v_offset.z); - - CGAL::Unique_hash_map face_normals_map; - boost::associative_property_map > - nf_pmap(face_normals_map); - CGAL::Unique_hash_map vertex_normals_map; - boost::associative_property_map< CGAL::Unique_hash_map > - nv_pmap(vertex_normals_map); - - PMP::compute_normals(*poly, nv_pmap, nf_pmap); - - Facet_iterator f = poly->facets_begin(); - for(f = poly->facets_begin(); - f != poly->facets_end(); - f++) - { - if (f == boost::graph_traits::null_face()) - continue; - Vector nf = get(nf_pmap, f); - f->plane() = Kernel::Plane_3(f->halfedge()->vertex()->point(), nf); - if(is_triangle(f->halfedge(),*poly)) - { - const int this_patch_id = f->patch_id(); - HF_circulator he = f->facet_begin(); - HF_circulator end = he; - CGAL_For_all(he,end) - { - if (add_flat_data && item->isItemMulticolor()) - { - color_facets.push_back(colors_[this_patch_id-m_min_patch_id].redF()); - color_facets.push_back(colors_[this_patch_id-m_min_patch_id].greenF()); - color_facets.push_back(colors_[this_patch_id-m_min_patch_id].blueF()); - } - if (colors_only) - continue; - - const Point& p = he->vertex()->point(); - - // If Flat shading:1 normal per polygon added once per vertex - if(add_flat_data) - { - push_back_xyz(p+offset, positions_facets); - if(!draw_two_sides) - push_back_xyz(nf, normals_flat); - } - - idx_faces.push_back(static_cast(he->vertex()->id())); - } - } - else if (is_quad(f->halfedge(), *poly)) - { - if (item->isItemMulticolor()) - { - const int this_patch_id = f->patch_id(); - for (unsigned int i = 0; i < 6; ++i) - { //6 "halfedges" for the quad, because it is 2 triangles - color_facets.push_back(colors_[this_patch_id-m_min_patch_id].redF()); - color_facets.push_back(colors_[this_patch_id-m_min_patch_id].greenF()); - color_facets.push_back(colors_[this_patch_id-m_min_patch_id].blueF()); - } - } - if (colors_only) - continue; - - //1st half-quad - - idx_faces.push_back(static_cast(f->halfedge()->vertex()->id())); - idx_faces.push_back(static_cast(f->halfedge()->next()->vertex()->id())); - idx_faces.push_back(static_cast(f->halfedge()->next()->next()->vertex()->id())); - if(add_flat_data) - { - Point p0 = f->halfedge()->vertex()->point(); - Point p1 = f->halfedge()->next()->vertex()->point(); - Point p2 = f->halfedge()->next()->next()->vertex()->point(); - push_back_xyz(p0+offset, positions_facets); - push_back_xyz(p1+offset, positions_facets); - push_back_xyz(p2+offset, positions_facets); - if(!draw_two_sides) - { - push_back_xyz(nf, normals_flat); - push_back_xyz(nf, normals_flat); - push_back_xyz(nf, normals_flat); - } - } - //2nd half-quad - idx_faces.push_back(static_cast(f->halfedge()->next()->next()->vertex()->id())); - idx_faces.push_back(static_cast(f->halfedge()->prev()->vertex()->id())); - idx_faces.push_back(static_cast(f->halfedge()->vertex()->id())); - - if(add_flat_data) - { - Point p0 = f->halfedge()->next()->next()->vertex()->point(); - Point p1 = f->halfedge()->prev()->vertex()->point(); - Point p2 = f->halfedge()->vertex()->point(); - - push_back_xyz(p0+offset, positions_facets); - push_back_xyz(p1+offset, positions_facets); - push_back_xyz(p2+offset, positions_facets); - if(!draw_two_sides) - { - push_back_xyz(nf, normals_flat); - push_back_xyz(nf, normals_flat); - push_back_xyz(nf, normals_flat); - } - } - } - else - { - if(isFacetConvex(f, nf)) - { - triangulate_convex_facet(f, colors_only, draw_two_sides, is_recent); - } - else - { - this->triangulate_facet(f, nf, colors_only, draw_two_sides, is_recent); - } - } - - } - //Lines - typedef Kernel::Point_3 Point; - typedef Polyhedron::Vertex_iterator Vertex_iterator; - for(Vertex_iterator vit = poly->vertices_begin(); - vit != poly->vertices_end(); - vit++) - { - Point p = vit->point(); - push_back_xyz(p+offset, positions_lines); - //// If Gouraud shading: 1 normal per vertex - Vector nv = get(nv_pmap, vit); - push_back_xyz(nv, normals_gouraud); - } - - typedef Polyhedron::Edge_iterator Edge_iterator; - Edge_iterator he; - - for(he = poly->edges_begin(); - he != poly->edges_end(); - he++) - { - if ( he->is_feature_edge()) - { - if (colors_only) - continue; - - idx_feature_lines.push_back(static_cast(he->vertex()->id())); - idx_feature_lines.push_back(static_cast(he->opposite()->vertex()->id())); - } - else - { - if (colors_only) - continue; - - idx_lines.push_back(static_cast(he->vertex()->id())); - idx_lines.push_back(static_cast(he->opposite()->vertex()->id())); - } - } - QApplication::restoreOverrideCursor(); -} - -Scene_polyhedron_item::Scene_polyhedron_item() - : Scene_item(Scene_polyhedron_item_priv::NbOfVbos,Scene_polyhedron_item_priv::NbOfVaos), - d(new Scene_polyhedron_item_priv(this)) -{ - cur_shading=FlatPlusEdges; - is_selected = true; - d->textVItems = new TextListItem(this); - d->textEItems = new TextListItem(this); - d->textFItems = new TextListItem(this); - -} - -Scene_polyhedron_item::Scene_polyhedron_item(Polyhedron* const p) - : Scene_item(Scene_polyhedron_item_priv::NbOfVbos,Scene_polyhedron_item_priv::NbOfVaos), - d(new Scene_polyhedron_item_priv(p,this)) -{ - cur_shading=FlatPlusEdges; - is_selected = true; - d->textVItems = new TextListItem(this); - d->textEItems = new TextListItem(this); - d->textFItems = new TextListItem(this); -} - -Scene_polyhedron_item::Scene_polyhedron_item(const Polyhedron& p) - : Scene_item(Scene_polyhedron_item_priv::NbOfVbos,Scene_polyhedron_item_priv::NbOfVaos), - d(new Scene_polyhedron_item_priv(p,this)) -{ - cur_shading=FlatPlusEdges; - is_selected=true; - d->textVItems = new TextListItem(this); - d->textEItems = new TextListItem(this); - d->textFItems = new TextListItem(this); -} - -Scene_polyhedron_item::~Scene_polyhedron_item() -{ - delete_aabb_tree(this); - CGAL::QGLViewer* viewer = *CGAL::QGLViewer::QGLViewerPool().begin(); - if(viewer) - { - CGAL::Three::Viewer_interface* v = qobject_cast(viewer); - - //Clears the targeted Id - if(d) - { - BOOST_FOREACH(TextItem* item, d->targeted_id) - v->textRenderer()->removeText(item); - } - //Remove vertices textitems - if(d->textVItems) - { - v->textRenderer()->removeTextList(d->textVItems); - delete d->textVItems; - d->textVItems=NULL; - } - //Remove edges textitems - if(d->textEItems) - { - v->textRenderer()->removeTextList(d->textEItems); - delete d->textEItems; - d->textEItems=NULL; - } - //Remove faces textitems - if(d->textFItems) - { - v->textRenderer()->removeTextList(d->textFItems); - delete d->textFItems; - d->textFItems=NULL; - } - } - if(d) - { - delete d; - d=NULL; - } -} - - -void -Scene_polyhedron_item_priv:: -init() -{ - typedef Polyhedron::Facet_iterator Facet_iterator; - - if ( !plugin_has_set_color_vector_m ) - { - // Fill indices map and get max subdomain value - int max = 0; - int min = (std::numeric_limits::max)(); - for(Facet_iterator fit = poly->facets_begin(), end = poly->facets_end() ; - fit != end; ++fit) - { - max = (std::max)(max, fit->patch_id()); - min = (std::min)(min, fit->patch_id()); - } - - colors_.clear(); - compute_color_map(item->color(), (std::max)(0, max + 1 - min), - std::back_inserter(colors_)); - m_min_patch_id=min; - } - else - m_min_patch_id=0; - invalidate_stats(); -} - -void -Scene_polyhedron_item_priv:: -invalidate_stats() -{ - number_of_degenerated_faces = (unsigned int)(-1); - number_of_null_length_edges = (unsigned int)(-1); - volume = -std::numeric_limits::infinity(); - area = -std::numeric_limits::infinity(); - self_intersect = false; - genus = -1; -} - -//vertex_index is the storage for selection -Scene_polyhedron_item::Vertex_selection_map -Scene_polyhedron_item::vertex_selection_map() -{ - return get(boost::vertex_index,*d->poly); -} -//face_index is the storage for selection -Scene_polyhedron_item::Face_selection_map -Scene_polyhedron_item::face_selection_map() -{ - return get(boost::face_index,*d->poly); -} - -Scene_polyhedron_item* -Scene_polyhedron_item::clone() const { - return new Scene_polyhedron_item(*(d->poly));} - -// Load polyhedron from .OFF file -bool -Scene_polyhedron_item::load(std::istream& in) -{ - - - in >> *(d->poly); - - if ( in && !isEmpty() ) - { - invalidateOpenGLBuffers(); - return true; - } - return false; -} -// Load polyhedron from .obj file -bool -Scene_polyhedron_item::load_obj(std::istream& in) -{ - typedef Polyhedron::Vertex::Point Point; - std::vector points; - std::vector > faces; - bool failed = !CGAL::read_OBJ(in,points,faces); - - CGAL::Polygon_mesh_processing::orient_polygon_soup(points,faces); - CGAL::Polygon_mesh_processing::polygon_soup_to_polygon_mesh( points,faces,*(d->poly)); - if ( (! failed) && !isEmpty() ) - { - invalidateOpenGLBuffers(); - return true; - } - return false; -} - -// Write polyhedron to .OFF file -bool -Scene_polyhedron_item::save(std::ostream& out) const -{ - QApplication::setOverrideCursor(Qt::WaitCursor); - out.precision(17); - out << *(d->poly); - QApplication::restoreOverrideCursor(); - return (bool) out; -} - -bool -Scene_polyhedron_item::save_obj(std::ostream& out) const -{ - CGAL::File_writer_wavefront writer; - CGAL::generic_print_polyhedron(out, *(d->poly), writer); - return out.good(); -} - - -QString -Scene_polyhedron_item::toolTip() const -{ - if(!d->poly) - return QString(); - - QString str = - QObject::tr("

    Polyhedron_3 %1 (mode: %5, color: %6)

    " - "

    Number of vertices: %2
    " - "Number of edges: %3
    " - "Number of faces: %4") - .arg(this->name()) - .arg(d->poly->size_of_vertices()) - .arg(d->poly->size_of_halfedges()/2) - .arg(d->poly->size_of_facets()) - .arg(this->renderingModeName()) - .arg(this->color().name()); - str += QString("
    Number of isolated vertices: %1
    ").arg(getNbIsolatedvertices()); - return str; -} - -QMenu* Scene_polyhedron_item::contextMenu() -{ - const char* prop_name = "Menu modified by Scene_polyhedron_item."; - - QMenu* menu = Scene_item::contextMenu(); - - QAction* actionResetColor= - menu->findChild(tr("actionResetColor")); - - if(isItemMulticolor()) - { - if(!actionResetColor) - { - actionResetColor = menu->addAction(tr("Reset Colors")); - actionResetColor->setObjectName("actionResetColor"); - } - connect(actionResetColor, SIGNAL(triggered()), - this, SLOT(resetColors())); - } - else if(actionResetColor) - { - menu->removeAction(actionResetColor); - actionResetColor->deleteLater(); - } - - - // Use dynamic properties: - // http://doc.qt.io/qt-5/qobject.html#property - bool menuChanged = menu->property(prop_name).toBool(); - - if(!menuChanged) { - menu->addSeparator(); - QAction* actionPrintVertices= - menu->addAction(tr("Display Vertices Ids")); - actionPrintVertices->setCheckable(true); - actionPrintVertices->setObjectName("actionPrintVertices"); - connect(actionPrintVertices, SIGNAL(triggered(bool)), - this, SLOT(showVertices(bool))); - - QAction* actionPrintEdges= - menu->addAction(tr("Display Edges Ids")); - actionPrintEdges->setCheckable(true); - actionPrintEdges->setObjectName("actionPrintEdges"); - connect(actionPrintEdges, SIGNAL(triggered(bool)), - this, SLOT(showEdges(bool))); - - QAction* actionPrintFaces= - menu->addAction(tr("Display Faces Ids")); - actionPrintFaces->setCheckable(true); - actionPrintFaces->setObjectName("actionPrintFaces"); - connect(actionPrintFaces, SIGNAL(triggered(bool)), - this, SLOT(showFaces(bool))); - - QAction* actionZoomToId= - menu->addAction(tr("Zoom to Index")); - actionZoomToId->setObjectName("actionZoomToId"); - connect(actionZoomToId, &QAction::triggered, - this, &Scene_polyhedron_item::zoomToId); - - menu->addSeparator(); - - QAction* actionShowOnlyFeatureEdges = - menu->addAction(tr("Show Only &Feature Edges")); - actionShowOnlyFeatureEdges->setCheckable(true); - actionShowOnlyFeatureEdges->setChecked(d->show_only_feature_edges_m); - actionShowOnlyFeatureEdges->setObjectName("actionShowOnlyFeatureEdges"); - connect(actionShowOnlyFeatureEdges, SIGNAL(toggled(bool)), - this, SLOT(show_only_feature_edges(bool))); - - QAction* actionShowFeatureEdges = - menu->addAction(tr("Show Feature Edges")); - actionShowFeatureEdges->setCheckable(true); - actionShowFeatureEdges->setChecked(d->show_feature_edges_m); - actionShowFeatureEdges->setObjectName("actionShowFeatureEdges"); - connect(actionShowFeatureEdges, SIGNAL(toggled(bool)), - this, SLOT(show_feature_edges(bool))); - - QAction* actionPickFacets = - menu->addAction(tr("Facets Picking")); - actionPickFacets->setCheckable(true); - actionPickFacets->setObjectName("actionPickFacets"); - connect(actionPickFacets, SIGNAL(toggled(bool)), - this, SLOT(enable_facets_picking(bool))); - - QAction* actionEraseNextFacet = - menu->addAction(tr("Erase Next Picked Facet")); - actionEraseNextFacet->setCheckable(true); - actionEraseNextFacet->setObjectName("actionEraseNextFacet"); - connect(actionEraseNextFacet, SIGNAL(toggled(bool)), - this, SLOT(set_erase_next_picked_facet(bool))); - if(! static_cast(CGAL::QGLViewer::QGLViewerPool().first())->isOpenGL_4_3()) - { - QAction* actionDisableFlatShading= - menu->addAction(tr("Disable Flat Shading")); - actionDisableFlatShading->setCheckable(true); - actionDisableFlatShading->setObjectName("actionDisableFlatShading"); - connect(actionDisableFlatShading, SIGNAL(toggled(bool)), - this, SLOT(set_flat_disabled(bool))); - } - menu->setProperty(prop_name, true); - } - - QAction* action = menu->findChild("actionShowOnlyFeatureEdges"); - if(action) action->setChecked(d->show_only_feature_edges_m); - action = menu->findChild("actionShowFeatureEdges"); - if(action) action->setChecked(d->show_feature_edges_m); - action = menu->findChild("actionPickFacets"); - if(action) action->setChecked(d->facet_picking_m); - action = menu->findChild("actionEraseNextFacet"); - if(action) action->setChecked(d->erase_next_picked_facet_m); - action = menu->findChild("actionPrintVertices"); - if(action) action->setChecked(d->vertices_displayed); - action = menu->findChild("actionPrintEdges"); - if(action) action->setChecked(d->edges_displayed); - action = menu->findChild("actionPrintFaces"); - if(action) action->setChecked(d->faces_displayed); - - return menu; -} -void Scene_polyhedron_item::show_only_feature_edges(bool b) -{ - d->show_only_feature_edges_m = b; - invalidateOpenGLBuffers(); - Q_EMIT itemChanged(); -} - -void Scene_polyhedron_item::show_feature_edges(bool b) -{ - d->show_feature_edges_m = b; - invalidateOpenGLBuffers(); - Q_EMIT itemChanged(); -} - -void Scene_polyhedron_item::enable_facets_picking(bool b) -{ - d->facet_picking_m = b; -} - -void Scene_polyhedron_item::set_erase_next_picked_facet(bool b) -{ - if(b) { d->facet_picking_m = true; } // automatically activate facet_picking - d->erase_next_picked_facet_m = b; -} - -void Scene_polyhedron_item::draw(CGAL::Three::Viewer_interface* viewer) const { - if(!are_buffers_filled) - { - d->compute_normals_and_vertices(viewer->isOpenGL_4_3(), - false, - viewer->property("draw_two_sides").toBool()); - d->initialize_buffers(viewer); - compute_bbox(); - } - - if(!d->is_multicolor && viewer->isOpenGL_4_3() && - (renderingMode() == Flat || renderingMode() == FlatPlusEdges)) - { - vaos[Scene_polyhedron_item_priv::Gouraud_Facets]->bind(); - attribBuffers(viewer, PROGRAM_FLAT); - d->program = getShaderProgram(PROGRAM_FLAT); - d->program->bind(); - if(!d->is_multicolor) - { - d->program->setAttributeValue("colors", this->color()); - } - if(is_selected) - d->program->setUniformValue("is_selected", true); - else - d->program->setUniformValue("is_selected", false); - d->face_idx_buffer.bind(); - viewer->glDrawElements(GL_TRIANGLES, static_cast(d->idx_faces.size()), - GL_UNSIGNED_INT, 0); - d->face_idx_buffer.release(); - d->program->release(); - vaos[Scene_polyhedron_item_priv::Gouraud_Facets]->release(); - } - else if((d->is_multicolor || !viewer->isOpenGL_4_3()) && - (renderingMode() == Flat || renderingMode() == FlatPlusEdges)) - { - vaos[Scene_polyhedron_item_priv::Facets]->bind(); - if(viewer->property("draw_two_sides").toBool()) - { - attribBuffers(viewer, PROGRAM_OLD_FLAT); - d->program = getShaderProgram(PROGRAM_OLD_FLAT); - } - else - { - attribBuffers(viewer, PROGRAM_WITH_LIGHT); - d->program = getShaderProgram(PROGRAM_WITH_LIGHT); - } - d->program->bind(); - if(!d->is_multicolor) - { - d->program->setAttributeValue("colors", this->color()); - } - if(is_selected) - d->program->setUniformValue("is_selected", true); - else - d->program->setUniformValue("is_selected", false); - viewer->glDrawArrays(GL_TRIANGLES, 0, static_cast(d->nb_facets/3)); - d->program->release(); - vaos[Scene_polyhedron_item_priv::Facets]->release(); - } - else - { - vaos[Scene_polyhedron_item_priv::Gouraud_Facets]->bind(); - attribBuffers(viewer, PROGRAM_WITH_LIGHT); - d->program = getShaderProgram(PROGRAM_WITH_LIGHT); - d->program->bind(); - if(!d->is_multicolor) - { - d->program->setAttributeValue("colors", this->color()); - } - if(is_selected) - d->program->setUniformValue("is_selected", true); - else - d->program->setUniformValue("is_selected", false); - d->face_idx_buffer.bind(); - viewer->glDrawElements(GL_TRIANGLES, static_cast(d->idx_faces.size()), - GL_UNSIGNED_INT, 0); - d->face_idx_buffer.release(); - d->program->release(); - vaos[Scene_polyhedron_item_priv::Gouraud_Facets]->release(); - } -} - -// Points/Wireframe/Flat/Gouraud OpenGL drawing in a display list -void Scene_polyhedron_item::drawEdges(CGAL::Three::Viewer_interface* viewer) const -{ - if (!are_buffers_filled) - { - d->compute_normals_and_vertices(viewer->isOpenGL_4_3(), false, - viewer->property("draw_two_sides").toBool()); - d->initialize_buffers(viewer); - compute_bbox(); - } - - if(!d->show_only_feature_edges_m) - { - vaos[Scene_polyhedron_item_priv::Edges]->bind(); - - attribBuffers(viewer, PROGRAM_WITHOUT_LIGHT); - d->program = getShaderProgram(PROGRAM_WITHOUT_LIGHT); - d->program->bind(); - //draw the edges - d->program->setAttributeValue("colors", this->color().lighter(50)); - if(is_selected) - d->program->setUniformValue("is_selected", true); - else - d->program->setUniformValue("is_selected", false); - d->edge_idx_buffer.bind(); - viewer->glDrawElements(GL_LINES, static_cast(d->idx_lines.size()), - GL_UNSIGNED_INT, 0); - d->edge_idx_buffer.release(); - d->program->release(); - vaos[Scene_polyhedron_item_priv::Edges]->release(); - } - - //draw the feature edges - vaos[Scene_polyhedron_item_priv::Feature_edges]->bind(); - attribBuffers(viewer, PROGRAM_NO_SELECTION); - d->program = getShaderProgram(PROGRAM_NO_SELECTION); - d->program->bind(); - if(d->show_feature_edges_m || d->show_only_feature_edges_m) - d->program->setAttributeValue("colors", Qt::red); - else - { - if(!is_selected) - d->program->setAttributeValue("colors", this->color().lighter(50)); - else - d->program->setAttributeValue("colors",QColor(0,0,0)); - } - d->f_edge_idx_buffer.bind(); - viewer->glDrawElements(GL_LINES, static_cast(d->idx_feature_lines.size()), - GL_UNSIGNED_INT, d->idx_feature_lines.data()); - d->f_edge_idx_buffer.release(); - d->program->release(); - vaos[Scene_polyhedron_item_priv::Feature_edges]->release(); - } - -void -Scene_polyhedron_item::drawPoints(CGAL::Three::Viewer_interface* viewer) const { - if(!are_buffers_filled) - { - d->compute_normals_and_vertices(viewer->isOpenGL_4_3(), false, viewer->property("draw_two_sides").toBool()); - d->initialize_buffers(viewer); - compute_bbox(); - } - - vaos[Scene_polyhedron_item_priv::Edges]->bind(); - attribBuffers(viewer, PROGRAM_WITHOUT_LIGHT); - d->program = getShaderProgram(PROGRAM_WITHOUT_LIGHT); - d->program->bind(); - //draw the points - d->program->setAttributeValue("colors", this->color()); - viewer->glDrawArrays(GL_POINTS, 0, static_cast(d->nb_lines/3)); - // Clean-up - d->program->release(); - vaos[Scene_polyhedron_item_priv::Edges]->release(); -} - -Polyhedron* -Scene_polyhedron_item::polyhedron() { return d->poly; } -const Polyhedron* -Scene_polyhedron_item::polyhedron() const { return d->poly; } - -bool -Scene_polyhedron_item::isEmpty() const { - return (d->poly == 0) || d->poly->empty(); -} - -void Scene_polyhedron_item::compute_bbox() const { - const Kernel::Point_3& p = *(d->poly->points_begin()); - CGAL::Bbox_3 bbox(p.x(), p.y(), p.z(), p.x(), p.y(), p.z()); - for(Polyhedron::Point_iterator it = d->poly->points_begin(); - it != d->poly->points_end(); - ++it) { - bbox = bbox + it->bbox(); - } - _bbox = Bbox(bbox.xmin(),bbox.ymin(),bbox.zmin(), - bbox.xmax(),bbox.ymax(),bbox.zmax()); -} - - -void -Scene_polyhedron_item:: -invalidateOpenGLBuffers() -{ - CGAL::set_halfedgeds_items_id(*(d->poly)); - Q_EMIT item_is_about_to_be_changed(); - delete_aabb_tree(this); - d->init(); - Base::invalidateOpenGLBuffers(); - are_buffers_filled = false; - is_bbox_computed = false; - d->invalidate_stats(); - d->killIds(); -} - -void -Scene_polyhedron_item::selection_changed(bool p_is_selected) -{ - if(p_is_selected != is_selected) - { - is_selected = p_is_selected; - } -} - -void -Scene_polyhedron_item::setColor(QColor c) -{ - // reset patch ids - if (d->colors_.size()>2 || d->plugin_has_set_color_vector_m) - { - d->colors_.clear(); - d->is_multicolor = false; - } - Scene_item::setColor(c); - if(d->is_multicolor) - invalidateOpenGLBuffers(); -} - -void -Scene_polyhedron_item::select(double orig_x, - double orig_y, - double orig_z, - double dir_x, - double dir_y, - double dir_z) -{ - - void* vertex_to_emit = 0; - if(d->facet_picking_m) - { - typedef Input_facets_AABB_tree Tree; - typedef Tree::Object_and_primitive_id Object_and_primitive_id; - - Tree* aabb_tree = static_cast(d->get_aabb_tree()); - if(aabb_tree) - { - const Kernel::Point_3 ray_origin(orig_x, orig_y, orig_z); - const Kernel::Vector_3 ray_dir(dir_x, dir_y, dir_z); - const Kernel::Ray_3 ray(ray_origin, ray_dir); - typedef std::list Intersections; - Intersections intersections; - aabb_tree->all_intersections(ray, std::back_inserter(intersections)); - Intersections::iterator closest = intersections.begin(); - if(closest != intersections.end()) - { - const Kernel::Point_3* closest_point = - CGAL::object_cast(&closest->first); - for(Intersections::iterator - it = boost::next(intersections.begin()), - end = intersections.end(); - it != end; ++it) - { - if(! closest_point) { - closest = it; - } - else { - const Kernel::Point_3* it_point = - CGAL::object_cast(&it->first); - if(it_point && - (ray_dir * (*it_point - *closest_point)) < 0) - { - closest = it; - closest_point = it_point; - } - } - } - if(closest_point) { - Polyhedron::Facet_handle selected_fh = closest->second; - - // The computation of the nearest vertex may be costly. Only - // do it if some objects are connected to the signal - // 'selected_vertex'. - if(QObject::receivers(SIGNAL(selected_vertex(void*))) > 0) - { - Polyhedron::Halfedge_around_facet_circulator - he_it = selected_fh->facet_begin(), - around_end = he_it; - - Polyhedron::Vertex_handle v = he_it->vertex(), nearest_v = v; - - Kernel::FT sq_dist = CGAL::squared_distance(*closest_point, - v->point()); - while(++he_it != around_end) { - v = he_it->vertex(); - Kernel::FT new_sq_dist = CGAL::squared_distance(*closest_point, - v->point()); - if(new_sq_dist < sq_dist) { - sq_dist = new_sq_dist; - nearest_v = v; - } - } - //bottleneck - vertex_to_emit = (void*)(&*nearest_v); - } - - if(QObject::receivers(SIGNAL(selected_edge(void*))) > 0 - || QObject::receivers(SIGNAL(selected_halfedge(void*))) > 0) - { - Polyhedron::Halfedge_around_facet_circulator - he_it = selected_fh->facet_begin(), - around_end = he_it; - - Polyhedron::Halfedge_handle nearest_h = he_it; - Kernel::FT sq_dist = - CGAL::squared_distance(*closest_point, - Kernel::Segment_3(he_it->vertex()->point(), - he_it->opposite()-> - vertex()-> - point())); - - while(++he_it != around_end) - { - Kernel::FT new_sq_dist = - CGAL::squared_distance(*closest_point, - Kernel::Segment_3(he_it->vertex()->point(), - he_it->opposite()-> - vertex()-> - point())); - if(new_sq_dist < sq_dist) { - sq_dist = new_sq_dist; - nearest_h = he_it; - } - } - - Q_EMIT selected_halfedge((void*)(&*nearest_h)); - Q_EMIT selected_edge((void*)(std::min)(&*nearest_h, &*nearest_h->opposite())); - } - Q_EMIT selected_vertex(vertex_to_emit); - Q_EMIT selected_facet((void*)(&*selected_fh)); - if(d->erase_next_picked_facet_m) { - polyhedron()->erase_facet(selected_fh->halfedge()); - polyhedron()->normalize_border(); - //set_erase_next_picked_facet(false); - invalidateOpenGLBuffers(); - - Q_EMIT itemChanged(); - } - } - } - } - } - Base::select(orig_x, orig_y, orig_z, dir_x, dir_y, dir_z); - Q_EMIT selection_done(); -} - -void Scene_polyhedron_item::update_vertex_indices() -{ - std::size_t id=0; - for (Polyhedron::Vertex_iterator vit = polyhedron()->vertices_begin(), - vit_end = polyhedron()->vertices_end(); vit != vit_end; ++vit) - { - vit->id()=id++; - } -} -void Scene_polyhedron_item::update_facet_indices() -{ - std::size_t id=0; - for (Polyhedron::Facet_iterator fit = polyhedron()->facets_begin(), - fit_end = polyhedron()->facets_end(); fit != fit_end; ++fit) - { - fit->id()=id++; - } -} -void Scene_polyhedron_item::update_halfedge_indices() -{ - std::size_t id=0; - for (Polyhedron::Halfedge_iterator hit = polyhedron()->halfedges_begin(), - hit_end = polyhedron()->halfedges_end(); hit != hit_end; ++hit) - { - hit->id()=id++; - } -} -void Scene_polyhedron_item::invalidate_aabb_tree() -{ - delete_aabb_tree(this); -} -QString Scene_polyhedron_item::computeStats(int type) -{ - double minl, maxl, meanl, midl; - switch (type) - { - case MIN_LENGTH: - case MAX_LENGTH: - case MID_LENGTH: - case MEAN_LENGTH: - case NB_NULL_LENGTH: - d->poly->normalize_border(); - edges_length(d->poly, minl, maxl, meanl, midl, d->number_of_null_length_edges); - } - - double mini, maxi, ave; - switch (type) - { - case MIN_ANGLE: - case MAX_ANGLE: - case MEAN_ANGLE: - angles(d->poly, mini, maxi, ave); - } - double min_area, max_area, med_area, mean_area; - switch (type) - { - case MIN_AREA: - case MAX_AREA: - case MEAN_AREA: - case MED_AREA: - if(!d->poly->is_pure_triangle()) - { - return QString("n/a"); - } - faces_area(d->poly, min_area, max_area, mean_area, med_area); - } - double min_altitude, min_ar, max_ar, mean_ar; - switch (type) - { - case MIN_ALTITUDE: - case MIN_ASPECT_RATIO: - case MAX_ASPECT_RATIO: - case MEAN_ASPECT_RATIO: - if(!d->poly->is_pure_triangle()) - { - return QString("n/a"); - } - faces_aspect_ratio(d->poly, min_altitude, min_ar, max_ar, mean_ar); - } - - switch(type) - { - case NB_VERTICES: - return QString::number(d->poly->size_of_vertices()); - - case NB_FACETS: - return QString::number(d->poly->size_of_facets()); - - case NB_CONNECTED_COMPOS: - { - typedef boost::graph_traits::face_descriptor face_descriptor; - int i = 0; - BOOST_FOREACH(face_descriptor f, faces(*(d->poly))){ - f->id() = i++; - } - boost::vector_property_map::type> - fccmap(get(boost::face_index, *(d->poly))); - return QString::number(PMP::connected_components(*(d->poly), fccmap)); - } - case NB_BORDER_EDGES: - d->poly->normalize_border(); - return QString::number(d->poly->size_of_border_halfedges()); - - case NB_EDGES: - return QString::number(d->poly->size_of_halfedges() / 2); - - case NB_DEGENERATED_FACES: - { - if (d->poly->is_pure_triangle()) - { - if (d->number_of_degenerated_faces == (unsigned int)(-1)) - d->number_of_degenerated_faces = nb_degenerate_faces(d->poly, get(CGAL::vertex_point, *(d->poly))); - return QString::number(d->number_of_degenerated_faces); - } - else - return QString("n/a"); - } - case AREA: - { - if (d->poly->is_pure_triangle()) - { - if(d->area == -std::numeric_limits::infinity()) - d->area = CGAL::Polygon_mesh_processing::area(*(d->poly)); - return QString::number(d->area); - } - else - return QString("n/a"); - } - case VOLUME: - { - if (d->poly->is_pure_triangle() && d->poly->is_closed()) - { - if (d->volume == -std::numeric_limits::infinity()) - d->volume = CGAL::Polygon_mesh_processing::volume(*(d->poly)); - return QString::number(d->volume); - } - else - return QString("n/a"); - } - case SELFINTER: - { - //todo : add a test about cache validity - if (d->poly->is_pure_triangle()) - d->self_intersect = CGAL::Polygon_mesh_processing::does_self_intersect(*(d->poly)); - if (d->self_intersect) - return QString("Yes"); - else if (d->poly->is_pure_triangle()) - return QString("No"); - else - return QString("n/a"); - } - case GENUS: - { - if(!d->poly->is_closed()) - { - return QString("n/a"); - } - else if(d->genus == -1) - { - std::ptrdiff_t s(d->poly->size_of_vertices()), - a(d->poly->size_of_halfedges()/2), - f(d->poly->size_of_facets()); - d->genus = 1.0 - double(s-a+f)/2.0; - } - if(d->genus < 0) - { - return QString("n/a"); - } - else - { - return QString::number(d->genus); - } - - } - case MIN_LENGTH: - return QString::number(minl); - case MAX_LENGTH: - return QString::number(maxl); - case MID_LENGTH: - return QString::number(midl); - case MEAN_LENGTH: - return QString::number(meanl); - case NB_NULL_LENGTH: - return QString::number(d->number_of_null_length_edges); - - case MIN_ANGLE: - return QString::number(mini); - case MAX_ANGLE: - return QString::number(maxi); - case MEAN_ANGLE: - return QString::number(ave); - case HOLES: - return QString::number(nb_holes(d->poly)); - - case MIN_AREA: - return QString::number(min_area); - case MAX_AREA: - return QString::number(max_area); - case MED_AREA: - return QString::number(med_area); - case MEAN_AREA: - return QString::number(mean_area); - case MIN_ALTITUDE: - return QString::number(min_altitude); - case MIN_ASPECT_RATIO: - return QString::number(min_ar); - case MAX_ASPECT_RATIO: - return QString::number(max_ar); - case MEAN_ASPECT_RATIO: - return QString::number(mean_ar); - case IS_PURE_TRIANGLE: - if(d->poly->is_pure_triangle()) - return QString("yes"); - else - return QString("no"); - case IS_PURE_QUAD: - if (d->poly->is_pure_quad()) - return QString("yes"); - else - return QString("no"); - } - return QString(); -} - -CGAL::Three::Scene_item::Header_data Scene_polyhedron_item::header() const -{ - CGAL::Three::Scene_item::Header_data data; - //categories - - data.categories.append(std::pair(QString("Properties"),9)); - data.categories.append(std::pair(QString("Faces"),10)); - data.categories.append(std::pair(QString("Edges"),6)); - data.categories.append(std::pair(QString("Angles"),3)); - - - //titles - data.titles.append(QString("#Vertices")); - data.titles.append(QString("#Connected Components")); - data.titles.append(QString("#Border Edges")); - data.titles.append(QString("Pure Triangle")); - data.titles.append(QString("Pure Quad")); - data.titles.append(QString("#Degenerated Faces")); - data.titles.append(QString("Connected Components of the Boundary")); - data.titles.append(QString("Area")); - data.titles.append(QString("Volume")); - data.titles.append(QString("Self-Intersecting")); - data.titles.append(QString("#Faces")); - data.titles.append(QString("Min Area")); - data.titles.append(QString("Max Area")); - data.titles.append(QString("Median Area")); - data.titles.append(QString("Mean Area")); - data.titles.append(QString("Min Altitude")); - data.titles.append(QString("Min Aspect-Ratio")); - data.titles.append(QString("Max Aspect-Ratio")); - data.titles.append(QString("Mean Aspect-Ratio")); - data.titles.append(QString("Genus")); - data.titles.append(QString("#Edges")); - data.titles.append(QString("Minimum Length")); - data.titles.append(QString("Maximum Length")); - data.titles.append(QString("Median Length")); - data.titles.append(QString("Mean Length")); - data.titles.append(QString("#Null Length")); - data.titles.append(QString("Minimum")); - data.titles.append(QString("Maximum")); - data.titles.append(QString("Average")); - return data; -} - -void Scene_polyhedron_item::printPrimitiveId(QPoint point, CGAL::Three::Viewer_interface *viewer) -{ - typedef Input_facets_AABB_tree Tree; - Tree* aabb_tree = static_cast(d->get_aabb_tree()); - if(!aabb_tree) - return; - Polyhedron::Facet_handle selected_fh; - Kernel::Point_3 pt_under; - const CGAL::qglviewer::Vec offset = static_cast(CGAL::QGLViewer::QGLViewerPool().first())->offset(); - if(find_primitive_id(point, aabb_tree, viewer, selected_fh, pt_under)) - d->fillTargetedIds(selected_fh, pt_under, viewer, offset); - -} -void Scene_polyhedron_item_priv::fillTargetedIds(const Polyhedron::Facet_handle& selected_fh, - const Kernel::Point_3& pt_under, - CGAL::Three::Viewer_interface *viewer, - const CGAL::qglviewer::Vec& offset) -{ - compute_displayed_ids(*poly, - viewer, - selected_fh, - pt_under, - offset, - textVItems, - textEItems, - textFItems, - &targeted_id); - - - if(vertices_displayed - && !textVItems->isEmpty()) - item->showVertices(true); - if(edges_displayed - && !textEItems->isEmpty()) - item->showEdges(true); - if(faces_displayed - && !textFItems->isEmpty()) - item->showFaces(true); - -} - -bool Scene_polyhedron_item::printVertexIds(CGAL::Three::Viewer_interface *viewer) const -{ - if(d->vertices_displayed) - { - return ::printVertexIds(*d->poly, - d->textVItems, - viewer); - } - return true; -} - -bool Scene_polyhedron_item::printEdgeIds(CGAL::Three::Viewer_interface *viewer) const -{ - if(d->edges_displayed) - { - return ::printEdgeIds(*d->poly, - d->textEItems, - viewer); - } - return true; -} - -bool Scene_polyhedron_item::printFaceIds(CGAL::Three::Viewer_interface *viewer) const -{ - if(d->faces_displayed) - { - return ::printFaceIds(*d->poly, - d->textFItems, - viewer); - } - return true; -} - -void Scene_polyhedron_item_priv::killIds() -{ - CGAL::Three::Viewer_interface* viewer = - qobject_cast(CGAL::QGLViewer::QGLViewerPool().first()); - deleteIds(viewer, - textVItems, - textEItems, - textFItems, - &targeted_id); -} - -void Scene_polyhedron_item::printAllIds(CGAL::Three::Viewer_interface *viewer) -{ - static bool all_ids_displayed = false; - - all_ids_displayed = !all_ids_displayed; - if(all_ids_displayed ) - { - bool s1(printVertexIds(viewer)), - s2(printEdgeIds(viewer)), - s3(printFaceIds(viewer)); - if((s1 && s2 && s3)) - { - viewer->update(); - } - return; - } - d->killIds(); -} - -bool Scene_polyhedron_item::testDisplayId(double x, double y, double z, CGAL::Three::Viewer_interface* viewer)const -{ - const CGAL::qglviewer::Vec offset = static_cast(CGAL::QGLViewer::QGLViewerPool().first())->offset(); - Kernel::Point_3 src(x - offset.x, - y - offset.y, - z - offset.z); - Kernel::Point_3 dest(viewer->camera()->position().x - offset.x, - viewer->camera()->position().y - offset.y, - viewer->camera()->position().z - offset.z); - Kernel::Vector_3 v(src,dest); - v = 0.01*v; - Kernel::Point_3 point = src; - point = point + v; - Kernel::Segment_3 query(point, dest); - return !static_cast(d->get_aabb_tree())->do_intersect(query); -} - - -std::vector& Scene_polyhedron_item::color_vector() {return d->colors_;} -void Scene_polyhedron_item::set_color_vector_read_only(bool on_off) {d->plugin_has_set_color_vector_m=on_off;} -bool Scene_polyhedron_item::is_color_vector_read_only() { return d->plugin_has_set_color_vector_m;} -int Scene_polyhedron_item::getNumberOfNullLengthEdges(){return d->number_of_null_length_edges;} -int Scene_polyhedron_item::getNumberOfDegeneratedFaces(){return d->number_of_degenerated_faces;} -bool Scene_polyhedron_item::triangulated(){return d->poly->is_pure_triangle();} -bool Scene_polyhedron_item::self_intersected(){return !(d->self_intersect);} -void Scene_polyhedron_item::setItemIsMulticolor(bool b){ - d->is_multicolor = b; - this->setProperty("NbPatchIds", 0);//for the joinandsplit_plugin -} -bool Scene_polyhedron_item::isItemMulticolor(){ return d->is_multicolor;} -bool Scene_polyhedron_item::intersect_face(double orig_x, - double orig_y, - double orig_z, - double dir_x, - double dir_y, - double dir_z, - Polyhedron::Facet_handle f) -{ - typedef Input_facets_AABB_tree Tree; - typedef Tree::Object_and_primitive_id Object_and_primitive_id; - - Tree* aabb_tree = static_cast(d->get_aabb_tree()); - if(aabb_tree) - { - const Kernel::Point_3 ray_origin(orig_x, orig_y, orig_z); - const Kernel::Vector_3 ray_dir(dir_x, dir_y, dir_z); - const Kernel::Ray_3 ray(ray_origin, ray_dir); - typedef std::list Intersections; - Intersections intersections; - aabb_tree->all_intersections(ray, std::back_inserter(intersections)); - Intersections::iterator closest = intersections.begin(); - if(closest != intersections.end()) - { - const Kernel::Point_3* closest_point = - CGAL::object_cast(&closest->first); - for(Intersections::iterator - it = boost::next(intersections.begin()), - end = intersections.end(); - it != end; ++it) - { - if(! closest_point) { - closest = it; - } - else { - const Kernel::Point_3* it_point = - CGAL::object_cast(&it->first); - if(it_point && - (ray_dir * (*it_point - *closest_point)) < 0) - { - closest = it; - closest_point = it_point; - } - } - } - if(closest_point) - { - Polyhedron::Facet_handle intersected_face = closest->second; - return intersected_face == f; - } - } - } - return false; - -} - -bool Scene_polyhedron_item::supportsRenderingMode(RenderingMode m) const -{ - return ( - m!=PointsPlusNormals && - m!=ShadedPoints && - !(m==Flat && d->no_flat) - ); -} - -void Scene_polyhedron_item::set_flat_disabled(bool b) -{ - d->no_flat = b; - invalidateOpenGLBuffers(); - itemChanged(); -} - -void Scene_polyhedron_item::itemAboutToBeDestroyed(Scene_item *item) -{ - Scene_item::itemAboutToBeDestroyed(item); - if(d && item == this) - { - delete d; - d=NULL; - } -} - -void Scene_polyhedron_item::zoomToPosition(const QPoint &point, CGAL::Three::Viewer_interface *viewer) const -{ - typedef Input_facets_AABB_tree Tree; - typedef Tree::Intersection_and_primitive_id::Type Intersection_and_primitive_id; - - Tree* aabb_tree = static_cast(d->get_aabb_tree()); - if(aabb_tree) { - - const CGAL::qglviewer::Vec offset = - static_cast(CGAL::QGLViewer::QGLViewerPool().first())->offset(); - //find clicked facet - bool found = false; - const Kernel::Point_3 ray_origin(viewer->camera()->position().x - offset.x, - viewer->camera()->position().y - offset.y, - viewer->camera()->position().z - offset.z); - CGAL::qglviewer::Vec point_under = viewer->camera()->pointUnderPixel(point,found); - CGAL::qglviewer::Vec dir = point_under - viewer->camera()->position(); - const Kernel::Vector_3 ray_dir(dir.x, dir.y, dir.z); - const Kernel::Ray_3 ray(ray_origin, ray_dir); - typedef std::list Intersections; - Intersections intersections; - aabb_tree->all_intersections(ray, std::back_inserter(intersections)); - - if(!intersections.empty()) { - Intersections::iterator closest = intersections.begin(); - const Kernel::Point_3* closest_point = - boost::get(&closest->first); - for(Intersections::iterator - it = boost::next(intersections.begin()), - end = intersections.end(); - it != end; ++it) - { - if(! closest_point) { - closest = it; - } - else { - const Kernel::Point_3* it_point = - boost::get(&it->first); - if(it_point && - (ray_dir * (*it_point - *closest_point)) < 0) - { - closest = it; - closest_point = it_point; - } - } - } - if(closest_point) { - Polyhedron::Facet_handle selected_fh = closest->second; - //compute new position and orientation - Kernel::Vector_3 face_normal = CGAL::Polygon_mesh_processing:: - compute_face_normal(selected_fh, - *d->poly, - CGAL::Polygon_mesh_processing::parameters::all_default()); - - - double x(0), y(0), z(0), - xmin(std::numeric_limits::infinity()), ymin(std::numeric_limits::infinity()), zmin(std::numeric_limits::infinity()), - xmax(-std::numeric_limits::infinity()), ymax(-std::numeric_limits::infinity()), zmax(-std::numeric_limits::infinity()); - int total(0); - BOOST_FOREACH(Polyhedron::Vertex_handle vh, vertices_around_face(selected_fh->halfedge(), *d->poly)) - { - x+=vh->point().x(); - y+=vh->point().y(); - z+=vh->point().z(); - - if(vh->point().x() < xmin) - xmin = vh->point().x(); - if(vh->point().y() < ymin) - ymin = vh->point().y(); - if(vh->point().z() < zmin) - zmin = vh->point().z(); - - if(vh->point().x() > xmax) - xmax = vh->point().x(); - if(vh->point().y() > ymax) - ymax = vh->point().y(); - if(vh->point().z() > zmax) - zmax = vh->point().z(); - - ++total; - } - Kernel::Point_3 centroid(x/total + offset.x, - y/total + offset.y, - z/total + offset.z); - - CGAL::qglviewer::Quaternion new_orientation(CGAL::qglviewer::Vec(0,0,-1), - CGAL::qglviewer::Vec(-face_normal.x(), -face_normal.y(), -face_normal.z())); - double max_side = (std::max)((std::max)(xmax-xmin, ymax-ymin), - zmax-zmin); - //put the camera in way we are sure the longest side is entirely visible on the screen - //See openGL's frustum definition - double factor = CGAL::abs(max_side/(tan(viewer->camera()->aspectRatio()/ - (viewer->camera()->fieldOfView()/2)))); - - Kernel::Point_3 new_pos = centroid + factor*face_normal ; - viewer->camera()->setSceneCenter(CGAL::qglviewer::Vec(centroid.x(), - centroid.y(), - centroid.z())); - viewer->moveCameraToCoordinates(QString("%1 %2 %3 %4 %5 %6 %7").arg(new_pos.x()) - .arg(new_pos.y()) - .arg(new_pos.z()) - .arg(new_orientation[0]) - .arg(new_orientation[1]) - .arg(new_orientation[2]) - .arg(new_orientation[3])); - } - } - } - -} - -void Scene_polyhedron_item::resetColors() -{ - setItemIsMulticolor(false); - invalidateOpenGLBuffers(); - itemChanged(); -} - -void Scene_polyhedron_item::showVertices(bool b) -{ - CGAL::Three::Viewer_interface* viewer = - qobject_cast(CGAL::QGLViewer::QGLViewerPool().first()); - TextRenderer *renderer = viewer->textRenderer(); - if(b) - if(d->textVItems->isEmpty()) - { - d->vertices_displayed = b; - printVertexIds(viewer); - } - else - renderer->addTextList(d->textVItems); - else - renderer->removeTextList(d->textVItems); - viewer->update(); - d->vertices_displayed = b; -} - -void Scene_polyhedron_item::showEdges(bool b) -{ - CGAL::Three::Viewer_interface* viewer = - qobject_cast(CGAL::QGLViewer::QGLViewerPool().first()); - TextRenderer *renderer = viewer->textRenderer(); - if(b) - if(d->textEItems->isEmpty()) - { - d->edges_displayed = b; - printEdgeIds(viewer); - } - else - renderer->addTextList(d->textEItems); - else - renderer->removeTextList(d->textEItems); - viewer->update(); - d->edges_displayed = b; -} - -void Scene_polyhedron_item::showFaces(bool b) -{ - CGAL::Three::Viewer_interface* viewer = - qobject_cast(CGAL::QGLViewer::QGLViewerPool().first()); - TextRenderer *renderer = viewer->textRenderer(); - if(b) - { - if(d->textFItems->isEmpty()) - { - d->faces_displayed = b; - printFaceIds(viewer); - } - else - renderer->addTextList(d->textFItems); - } - else - renderer->removeTextList(d->textFItems); - viewer->update(); - d->faces_displayed = b; -} - -void Scene_polyhedron_item::showPrimitives(bool) -{ - CGAL::Three::Viewer_interface* viewer = - qobject_cast(CGAL::QGLViewer::QGLViewerPool().first()); - printAllIds(viewer); -} -void Scene_polyhedron_item::zoomToId() -{ - Polyhedron::Facet_handle selected_fh; - bool ok; - QString text = QInputDialog::getText(QApplication::activeWindow(), tr("Zoom to Index"), - tr("Simplex"), QLineEdit::Normal, - tr("v0"), &ok); - if(!ok) - return; - - CGAL::Three::Viewer_interface* viewer = - qobject_cast(CGAL::QGLViewer::QGLViewerPool().first()); - Point p; - QString id = text.right(text.length()-1); - int return_value = ::zoomToId(*d->poly, text, viewer, selected_fh, p); - switch(return_value) - { - case 1: - QMessageBox::warning(QApplication::activeWindow(), - "ERROR", - tr("Input must be of the form [v/e/f][int]") - ); - return; - case 2: - QMessageBox::warning(QApplication::activeWindow(), - "ERROR", - tr("No vertex with id %1").arg(id) - ); - return; - case 3: - QMessageBox::warning(QApplication::activeWindow(), - "ERROR", - tr("No edge with id %1").arg(id) - ); - return; - case 4: - QMessageBox::warning(QApplication::activeWindow(), - "ERROR", - tr("No face with id %1").arg(id) - ); - return; - default: //case 0 - d->fillTargetedIds(selected_fh, p, viewer, viewer->offset()); - break; - } -} -bool Scene_polyhedron_item::shouldDisplayIds(CGAL::Three::Scene_item *current_item) const -{ - return this == current_item; -} diff --git a/Polyhedron/demo/Polyhedron/Scene_polyhedron_item.h b/Polyhedron/demo/Polyhedron/Scene_polyhedron_item.h deleted file mode 100644 index 2ac82e69c75..00000000000 --- a/Polyhedron/demo/Polyhedron/Scene_polyhedron_item.h +++ /dev/null @@ -1,202 +0,0 @@ -#ifndef SCENE_POLYHEDRON_ITEM_H -#define SCENE_POLYHEDRON_ITEM_H - -#include "Scene_polyhedron_item_config.h" -#include -#include -#include -#include "Polyhedron_type_fwd.h" - -#ifndef Q_MOC_RUN -#include "Polyhedron_type.h" -#include -#endif - -#include -#include -#include -#include -#include -#include - -#include -#include - -class QMenu; -struct Scene_polyhedron_item_priv; - -// This class represents a polyhedron in the OpenGL scene -class SCENE_POLYHEDRON_ITEM_EXPORT Scene_polyhedron_item - : public CGAL::Three::Scene_item, - public CGAL::Three::Scene_zoomable_item_interface, - public CGAL::Three::Scene_print_item_interface{ - Q_INTERFACES(CGAL::Three::Scene_print_item_interface) - Q_PLUGIN_METADATA(IID "com.geometryfactory.PolyhedronDemo.PrintInterface/1.0") - Q_OBJECT - Q_INTERFACES(CGAL::Three::Scene_zoomable_item_interface) - Q_PLUGIN_METADATA(IID "com.geometryfactory.PolyhedronDemo.ZoomInterface/1.0") -public: - typedef Polyhedron Face_graph; - typedef boost::property_map::type Vertex_selection_map; - typedef boost::property_map::type Face_selection_map; - - enum STATS { - NB_VERTICES = 0, - NB_CONNECTED_COMPOS, - NB_BORDER_EDGES, - IS_PURE_TRIANGLE, - IS_PURE_QUAD, - NB_DEGENERATED_FACES, - HOLES, - AREA, - VOLUME, - SELFINTER, - NB_FACETS, - MIN_AREA, - MAX_AREA, - MED_AREA, - MEAN_AREA, - MIN_ALTITUDE, - MIN_ASPECT_RATIO, - MAX_ASPECT_RATIO, - MEAN_ASPECT_RATIO, - GENUS, - NB_EDGES, - MIN_LENGTH, - MAX_LENGTH, - MID_LENGTH, - MEAN_LENGTH, - NB_NULL_LENGTH, - MIN_ANGLE, - MAX_ANGLE, - MEAN_ANGLE - }; - - bool has_stats()const Q_DECL_OVERRIDE{return true;} - QString computeStats(int type)Q_DECL_OVERRIDE; - CGAL::Three::Scene_item::Header_data header() const Q_DECL_OVERRIDE; - Scene_polyhedron_item(); - // Scene_polyhedron_item(const Scene_polyhedron_item&); - Scene_polyhedron_item(const Polyhedron& p); - Scene_polyhedron_item(Polyhedron* const p); - ~Scene_polyhedron_item(); - - Scene_polyhedron_item* clone() const Q_DECL_OVERRIDE; - - // IO - bool load(std::istream& in); - bool load_obj(std::istream& in); - bool save(std::ostream& out) const; - bool save_obj(std::ostream& out) const; - - // Function for displaying meta-data of the item - virtual QString toolTip() const Q_DECL_OVERRIDE; - - // Function to override the context menu - QMenu* contextMenu() Q_DECL_OVERRIDE; - - // Indicate if rendering mode is supported - virtual bool supportsRenderingMode(RenderingMode m) const Q_DECL_OVERRIDE; - // Points/Wireframe/Flat/Gouraud OpenGL drawing in a display list - void draw() const Q_DECL_OVERRIDE{} - virtual void draw(CGAL::Three::Viewer_interface*) const Q_DECL_OVERRIDE; - virtual void drawEdges() const Q_DECL_OVERRIDE{} - virtual void drawEdges(CGAL::Three::Viewer_interface* viewer) const Q_DECL_OVERRIDE; - virtual void drawPoints(CGAL::Three::Viewer_interface*) const Q_DECL_OVERRIDE; - - // Get wrapped polyhedron - Polyhedron* polyhedron(); - const Polyhedron* polyhedron() const; - - Face_graph* face_graph() { return polyhedron(); } - const Face_graph* face_graph() const { return polyhedron(); } - - // Get dimensions - bool isFinite() const Q_DECL_OVERRIDE { return true; } - bool isEmpty() const Q_DECL_OVERRIDE; - void compute_bbox() const Q_DECL_OVERRIDE; - - Vertex_selection_map vertex_selection_map(); - Face_selection_map face_selection_map(); - - std::vector& color_vector(); - void set_color_vector_read_only(bool on_off); - bool is_color_vector_read_only(); - - int getNumberOfNullLengthEdges(); - int getNumberOfDegeneratedFaces(); - bool triangulated(); - bool self_intersected(); - //! If b is true, the item will use buffers to render the color. - //! If b is false, it will use a uniform value. For example, when - //! using the mesh segmentation plugin, the item must be multicolor. - void setItemIsMulticolor(bool b); - //! @returns `true` if the item has multiple colors at the same time. - bool isItemMulticolor(); - - void printPrimitiveId(QPoint point, CGAL::Three::Viewer_interface*viewer)Q_DECL_OVERRIDE; - bool printVertexIds(CGAL::Three::Viewer_interface*)const Q_DECL_OVERRIDE; - bool printEdgeIds(CGAL::Three::Viewer_interface*)const Q_DECL_OVERRIDE; - bool printFaceIds(CGAL::Three::Viewer_interface*)const Q_DECL_OVERRIDE; - void printAllIds(CGAL::Three::Viewer_interface*) Q_DECL_OVERRIDE; - bool shouldDisplayIds(CGAL::Three::Scene_item *current_item) const Q_DECL_OVERRIDE; - bool testDisplayId(double x, double y, double z, CGAL::Three::Viewer_interface*)const Q_DECL_OVERRIDE; - - - //! @returns `true` if `f` is the first facet intersected by a raytracing - bool intersect_face(double orig_x, - double orig_y, - double orig_z, - double dir_x, - double dir_y, - double dir_z, - Polyhedron::Facet_handle f); - -public Q_SLOTS: - virtual void invalidateOpenGLBuffers() Q_DECL_OVERRIDE; - virtual void selection_changed(bool) Q_DECL_OVERRIDE; - virtual void setColor(QColor c) Q_DECL_OVERRIDE; - virtual void show_feature_edges(bool); - void show_only_feature_edges(bool); - void enable_facets_picking(bool); - void set_erase_next_picked_facet(bool); - void set_flat_disabled(bool b); - - void select(double orig_x, - double orig_y, - double orig_z, - double dir_x, - double dir_y, - double dir_z) Q_DECL_OVERRIDE; - void update_vertex_indices(); - void update_facet_indices(); - void update_halfedge_indices(); - void invalidate_aabb_tree(); - void itemAboutToBeDestroyed(Scene_item *) Q_DECL_OVERRIDE; - void resetColors(); - void showVertices(bool); - void showEdges(bool); - void showFaces(bool); - void showPrimitives(bool); - void zoomToId(); - -Q_SIGNALS: - void selection_done(); - void selected_vertex(void*); - void selected_facet(void*); - void selected_edge(void*); - void selected_halfedge(void*); - void item_is_about_to_be_changed(); // emitted in invalidateOpenGLBuffers() -public: - typedef Scene_item Base; - typedef Polyhedron::Facet_iterator Facet_iterator; -protected: - friend struct Scene_polyhedron_item_priv; - Scene_polyhedron_item_priv* d; - - public: - void zoomToPosition(const QPoint &point, CGAL::Three::Viewer_interface *)const Q_DECL_OVERRIDE; - -}; // end class Scene_polyhedron_item - -#endif // SCENE_POLYHEDRON_ITEM_H diff --git a/Polyhedron/demo/Polyhedron/Scene_polyhedron_item_config.h b/Polyhedron/demo/Polyhedron/Scene_polyhedron_item_config.h deleted file mode 100644 index 72f8a208f77..00000000000 --- a/Polyhedron/demo/Polyhedron/Scene_polyhedron_item_config.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef SCENE_POLYHEDRON_ITEM_CONFIG_H -#define SCENE_POLYHEDRON_ITEM_CONFIG_H - -#ifdef scene_polyhedron_item_EXPORTS -# define SCENE_POLYHEDRON_ITEM_EXPORT Q_DECL_EXPORT -#else -# define SCENE_POLYHEDRON_ITEM_EXPORT Q_DECL_IMPORT -#endif - -#endif // SCENE_POLYHEDRON_ITEM_CONFIG_H diff --git a/Polyhedron/demo/Polyhedron/Scene_polyhedron_item_decorator.h b/Polyhedron/demo/Polyhedron/Scene_polyhedron_item_decorator.h index d198fb00b6f..4ab1c375a3d 100644 --- a/Polyhedron/demo/Polyhedron/Scene_polyhedron_item_decorator.h +++ b/Polyhedron/demo/Polyhedron/Scene_polyhedron_item_decorator.h @@ -2,17 +2,12 @@ #define SCENE_POLYHEDRON_ITEM_DECORATOR_H #include "Scene_polyhedron_item_decorator_config.h" -#ifdef USE_SURFACE_MESH #include "Scene_surface_mesh_item.h" typedef Scene_surface_mesh_item Scene_face_graph_item; -#else -#include "Scene_polyhedron_item.h" -typedef Scene_polyhedron_item Scene_face_graph_item; -#endif typedef Scene_face_graph_item::Face_graph Face_graph; -// This class is a decorator for Scene_polyhedron_item yet it does not inherit it but Scene_item +// This class is a decorator for Scene_surface_mesh_item yet it does not inherit it but Scene_item class SCENE_POLYHEDRON_ITEM_DECORATOR_EXPORT Scene_polyhedron_item_decorator : public CGAL::Three::Scene_item { Q_OBJECT diff --git a/Polyhedron/demo/Polyhedron/Scene_polyhedron_item_decorator_config.h b/Polyhedron/demo/Polyhedron/Scene_polyhedron_item_decorator_config.h index a6a31a21505..5d1921b7471 100644 --- a/Polyhedron/demo/Polyhedron/Scene_polyhedron_item_decorator_config.h +++ b/Polyhedron/demo/Polyhedron/Scene_polyhedron_item_decorator_config.h @@ -2,7 +2,7 @@ #define SCENE_POLYHEDRON_ITEM_DECORATOR_CONFIG_H -#if defined(scene_polyhedron_item_decorator_EXPORTS) || defined(scene_surface_mesh_item_decorator_EXPORTS) +#if defined(scene_item_decorator_EXPORTS) # define SCENE_POLYHEDRON_ITEM_DECORATOR_EXPORT Q_DECL_EXPORT #else # define SCENE_POLYHEDRON_ITEM_DECORATOR_EXPORT Q_DECL_IMPORT diff --git a/Polyhedron/demo/Polyhedron/Scene_polyhedron_item_k_ring_selection.cpp b/Polyhedron/demo/Polyhedron/Scene_polyhedron_item_k_ring_selection.cpp deleted file mode 100644 index ce1f9c9b01c..00000000000 --- a/Polyhedron/demo/Polyhedron/Scene_polyhedron_item_k_ring_selection.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "Scene_polyhedron_item_k_ring_selection.h" diff --git a/Polyhedron/demo/Polyhedron/Scene_polyhedron_item_k_ring_selection.h b/Polyhedron/demo/Polyhedron/Scene_polyhedron_item_k_ring_selection.h deleted file mode 100644 index 9db47fbe5a8..00000000000 --- a/Polyhedron/demo/Polyhedron/Scene_polyhedron_item_k_ring_selection.h +++ /dev/null @@ -1,753 +0,0 @@ -#ifndef SCENE_POLYHEDRON_ITEM_K_RING_SELECTION_H -#define SCENE_POLYHEDRON_ITEM_K_RING_SELECTION_H -#include "Scene_polyhedron_item_k_ring_selection_config.h" -#include "Polyhedron_type.h" -#include "Scene_polyhedron_item.h" -#include "Scene_surface_mesh_item.h" - -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include - -#include - -struct Is_selected_edge_property_map{ - typedef boost::graph_traits::edge_descriptor poly_edge_descriptor; - std::vector* is_selected_ptr; - Is_selected_edge_property_map() - : is_selected_ptr(NULL) {} - Is_selected_edge_property_map(std::vector& is_selected) - : is_selected_ptr( &is_selected) {} - - std::size_t id(poly_edge_descriptor ed) { return ed.halfedge()->id()/2; } - - friend bool get(Is_selected_edge_property_map map, poly_edge_descriptor ed) - { - CGAL_assertion(map.is_selected_ptr!=NULL); - return (*map.is_selected_ptr)[map.id(ed)]; - } - - friend void put(Is_selected_edge_property_map map, poly_edge_descriptor ed, bool b) - { - CGAL_assertion(map.is_selected_ptr!=NULL); - (*map.is_selected_ptr)[map.id(ed)]=b; - } -}; - -class SCENE_POLYHEDRON_ITEM_K_RING_SELECTION_EXPORT Scene_polyhedron_item_k_ring_selection - : public QObject -{ - Q_OBJECT -public: - - typedef boost::graph_traits::halfedge_descriptor poly_halfedge_descriptor; - typedef boost::graph_traits::edge_descriptor poly_edge_descriptor; - typedef boost::graph_traits::face_descriptor poly_face_descriptor; - typedef boost::graph_traits::vertex_descriptor poly_vertex_descriptor; - typedef boost::graph_traits::vertex_descriptor sm_vertex_descriptor; - typedef boost::graph_traits::face_descriptor sm_face_descriptor; - typedef boost::graph_traits::edge_descriptor sm_edge_descriptor; - - struct Active_handle { - enum Type{ VERTEX = 0, FACET = 1, EDGE = 2 , CONNECTED_COMPONENT = 3, PATH = 4}; - }; - - typedef CGAL::Polygon_2 Polygon_2; - typedef std::vector Polyline_2; - typedef std::vector Polylines; - - // Hold mouse keyboard state together - struct Mouse_keyboard_state - { - Mouse_keyboard_state() : shift_pressing(false), left_button_pressing(false) { } - bool shift_pressing, left_button_pressing; - }; - - Mouse_keyboard_state state; - QMainWindow* mainwindow; - Active_handle::Type active_handle_type; - int k_ring; - Scene_polyhedron_item* poly_item; - Scene_surface_mesh_item* sm_item; - bool is_active; - bool is_current_selection; - bool is_highlighting; - - Scene_polyhedron_item_k_ring_selection() {} - - Scene_polyhedron_item_k_ring_selection - (Scene_polyhedron_item* poly_item, QMainWindow* mw, Active_handle::Type aht, int k_ring) - :is_active(false),is_current_selection(true), is_edit_mode(false) - { - init(poly_item, NULL, mw, aht, k_ring); - } - - Scene_polyhedron_item_k_ring_selection - (Scene_surface_mesh_item* sm_item, QMainWindow* mw, Active_handle::Type aht, int k_ring) - :is_active(false),is_current_selection(true), is_edit_mode(false) - { - init(NULL, sm_item, mw, aht, k_ring); - } - - void setEditMode(bool b) - { - is_edit_mode = b; - CGAL::QGLViewer* viewer = *CGAL::QGLViewer::QGLViewerPool().begin(); - //for highlighting - viewer->setMouseTracking(b); - } - - void init(Scene_polyhedron_item* poly_item, Scene_surface_mesh_item* sm_item, QMainWindow* mw, Active_handle::Type aht, int k_ring) { - this->poly_item = poly_item; - this->sm_item = sm_item; - this->active_handle_type = aht; - this->k_ring = k_ring; - polyline = new Polylines(0); - polyline->push_back(Polyline_2()); - mainwindow = mw; - is_highlighting = false; - is_ready_to_highlight = true; - is_ready_to_paint_select = true; - is_lasso_active = false; - if(poly_item) - { - poly_item->enable_facets_picking(true); - poly_item->set_color_vector_read_only(true); - } - CGAL::QGLViewer* viewer = *CGAL::QGLViewer::QGLViewerPool().begin(); - viewer->installEventFilter(this); - mw->installEventFilter(this); - viewer->setMouseBindingDescription(Qt::Key_D, Qt::ShiftModifier, Qt::LeftButton, "(When in selection plugin) Removes the clicked primitive from the selection. "); - if(poly_item) - { - connect(poly_item, SIGNAL(selected_vertex(void*)), this, SLOT(vertex_has_been_selected(void*))); - connect(poly_item, SIGNAL(selected_facet(void*)), this, SLOT(facet_has_been_selected(void*))); - connect(poly_item, SIGNAL(selected_edge(void*)), this, SLOT(edge_has_been_selected(void*))); - } - if(sm_item) - { - connect(sm_item, SIGNAL(selected_vertex(void*)), this, SLOT(sm_vertex_has_been_selected(void*))); - connect(sm_item, SIGNAL(selected_facet(void*)), this, SLOT(sm_facet_has_been_selected(void*))); - connect(sm_item, SIGNAL(selected_edge(void*)), this, SLOT(sm_edge_has_been_selected(void*))); - } - } - - - void init(Scene_polyhedron_item* poly_item, QMainWindow* mw, Active_handle::Type aht, int k_ring) - { - init(poly_item, NULL, mw, aht, k_ring); - } - - void init(Scene_surface_mesh_item* poly_item, QMainWindow* mw, Active_handle::Type aht, int k_ring) - { - init(NULL, poly_item, mw, aht, k_ring); - } - - - void setCurrentlySelected(bool b) - { - is_current_selection = b; - } - void set_lasso_mode(bool b) { is_lasso_active = b; } - -public Q_SLOTS: - // slots are called by signals of polyhedron_item - void vertex_has_been_selected(void* void_ptr) - { - is_active=true; - if(active_handle_type == Active_handle::VERTEX || active_handle_type == Active_handle::PATH) - process_selection( static_cast(void_ptr)->halfedge()->vertex() ); - updateIsTreated(); - } - void facet_has_been_selected(void* void_ptr) - { - is_active=true; - if (active_handle_type == Active_handle::FACET - || active_handle_type == Active_handle::CONNECTED_COMPONENT) - process_selection(static_cast(void_ptr)->halfedge()->facet()); - updateIsTreated(); - } - void edge_has_been_selected(void* void_ptr) - { - is_active=true; - if(active_handle_type == Active_handle::EDGE) - process_selection( edge(static_cast(void_ptr)->opposite()->opposite(), *poly_item->polyhedron()) ); - updateIsTreated(); - } - - // slots are called by signals of surface_mesh_item - void sm_vertex_has_been_selected(void* v) - { - typedef boost::graph_traits::vertices_size_type size_type; - size_type h = static_cast(reinterpret_cast(v)); - is_active=true; - if(active_handle_type == Active_handle::VERTEX || active_handle_type == Active_handle::PATH) - process_selection( sm_vertex_descriptor(h) ); - updateIsTreated(); - } - void sm_facet_has_been_selected(void* v) - { - typedef boost::graph_traits::vertices_size_type size_type; - size_type h = static_cast(reinterpret_cast(v)); - is_active=true; - if (active_handle_type == Active_handle::FACET - || active_handle_type == Active_handle::CONNECTED_COMPONENT) - process_selection(sm_face_descriptor(h) ); - updateIsTreated(); - } - void sm_edge_has_been_selected(void* v) - { - typedef boost::graph_traits::edges_size_type size_type; - size_type h = static_cast(reinterpret_cast(v)); - is_active=true; - if(active_handle_type == Active_handle::EDGE) - process_selection(sm_edge_descriptor(h) ); - updateIsTreated(); - } - - void paint_selection() - { - if(is_ready_to_paint_select) - { - const CGAL::qglviewer::Vec offset = static_cast(CGAL::QGLViewer::QGLViewerPool().first())->offset(); - // paint with mouse move event - CGAL::QGLViewer* viewer = *CGAL::QGLViewer::QGLViewerPool().begin(); - CGAL::qglviewer::Camera* camera = viewer->camera(); - viewer->makeCurrent(); - - bool found = false; - const CGAL::qglviewer::Vec& point = camera->pointUnderPixel(paint_pos, found) - offset; - if(found) - { - const CGAL::qglviewer::Vec& orig = camera->position() - offset; - const CGAL::qglviewer::Vec& dir = point - orig; - if(poly_item) - poly_item->select(orig.x, orig.y, orig.z, dir.x, dir.y, dir.z); - else - sm_item->select(orig.x, orig.y, orig.z, dir.x, dir.y, dir.z); - } - is_ready_to_paint_select = false; - } - } - - void lasso_selection() - { - if(!poly_item) - return; - CGAL::QGLViewer* viewer = *CGAL::QGLViewer::QGLViewerPool().begin(); - const CGAL::qglviewer::Vec offset = static_cast(viewer)->offset(); - - CGAL::qglviewer::Camera* camera = viewer->camera(); - const Polyhedron& poly = *poly_item->polyhedron(); - - std::set face_sel; - //select all faces if their screen projection is inside the lasso - BOOST_FOREACH(poly_face_descriptor f, faces(poly)) - { - BOOST_FOREACH(poly_vertex_descriptor v, CGAL::vertices_around_face(f->halfedge(), poly)) - { - CGAL::qglviewer::Vec vp(v->point().x(), v->point().y(), v->point().z()); - CGAL::qglviewer::Vec vsp = camera->projectedCoordinatesOf(vp+offset); - if(is_vertex_selected(vsp)) - { - face_sel.insert(f); - break; - } - } - } - if(face_sel.empty()) - { - contour_2d.clear(); - return; - } - //get border edges of the selected patches - std::vector boundary_edges; - CGAL::Polygon_mesh_processing::border_halfedges(face_sel, poly, std::back_inserter(boundary_edges)); - std::vector mark(edges(poly).size(), false); - Is_selected_edge_property_map spmap(mark); - BOOST_FOREACH(poly_halfedge_descriptor h, boundary_edges) - put(spmap, edge(h, poly), true); - - boost::property_map::type fim - = get(boost::face_external_index, poly); - boost::vector_property_map::type> - fccmap(fim); - - //get connected componant from the picked face - std::set final_sel; - //std::vector cc; - std::size_t nb_cc = CGAL::Polygon_mesh_processing::connected_components(poly - , fccmap - , CGAL::Polygon_mesh_processing::parameters::edge_is_constrained_map(spmap) - .face_index_map(fim)); - std::vector is_cc_done(nb_cc, false); - - BOOST_FOREACH(poly_face_descriptor f, face_sel) - { - - int cc_id = get(fccmap, f); - if(is_cc_done[cc_id]) - { - continue; - } - double x(0), y(0), z(0); - int total(0); - BOOST_FOREACH(poly_halfedge_descriptor hafc, halfedges_around_face(halfedge(f,poly), poly)) - { - poly_vertex_descriptor vd = target(hafc,poly); - x+=vd->point().x(); y+=vd->point().y(); z+=vd->point().z(); - total++; - } - if(total == 0) - continue; - CGAL::qglviewer::Vec center(x/(double)total, y/(double)total, z/(double)total); - const CGAL::qglviewer::Vec& orig = camera->position() - offset; - CGAL::qglviewer::Vec direction = center - orig; - if(poly_item->intersect_face(orig.x, - orig.y, - orig.z, - direction.x, - direction.y, - direction.z, - f)) - { - is_cc_done[cc_id] = true; - } - } - BOOST_FOREACH(poly_face_descriptor f, faces(poly)) - { - if(is_cc_done[get(fccmap, f)]) - final_sel.insert(f); - } - switch(active_handle_type) - { - case Active_handle::FACET: - selected(final_sel); - break; - case Active_handle::EDGE: - { - std::set e_sel; - BOOST_FOREACH(poly_face_descriptor f, final_sel) - { - BOOST_FOREACH(poly_halfedge_descriptor h, CGAL::halfedges_around_face(halfedge(f,poly), poly)) - { - poly_vertex_descriptor vd = target(h,poly); - CGAL::qglviewer::Vec vp1(vd->point().x(), vd->point().y(), vd->point().z()); - CGAL::qglviewer::Vec vsp1 = camera->projectedCoordinatesOf(vp1+offset); - vd = source(h,poly); - CGAL::qglviewer::Vec vp2(vd->point().x(), vd->point().y(), vd->point().z()); - CGAL::qglviewer::Vec vsp2 = camera->projectedCoordinatesOf(vp2+offset); - if(is_vertex_selected(vsp1) || is_vertex_selected(vsp2)) - e_sel.insert(edge(h, poly)); - } - } - selected(e_sel); - break; - } - case Active_handle::VERTEX: - { - std::set v_sel; - BOOST_FOREACH(poly_face_descriptor f, final_sel) - { - BOOST_FOREACH(poly_vertex_descriptor v, CGAL::vertices_around_face(f->halfedge(), poly)) - { - CGAL::qglviewer::Vec vp(v->point().x(), v->point().y(), v->point().z()); - CGAL::qglviewer::Vec vsp = camera->projectedCoordinatesOf(vp+offset); - if(is_vertex_selected(vsp)) - v_sel.insert(v); - } - } - selected(v_sel); - break; - } - default: - break; - } - contour_2d.clear(); - } - - void highlight() - { - if(!poly_item && !sm_item) - return; - const CGAL::qglviewer::Vec offset = static_cast(CGAL::QGLViewer::QGLViewerPool().first())->offset(); - if(is_ready_to_highlight) - { - // highlight with mouse move event - CGAL::QGLViewer* viewer = *CGAL::QGLViewer::QGLViewerPool().begin(); - CGAL::qglviewer::Camera* camera = viewer->camera(); - bool found = false; - const CGAL::qglviewer::Vec& point = camera->pointUnderPixel(hl_pos, found) - offset; - if(found) - { - const CGAL::qglviewer::Vec& orig = camera->position() - offset; - const CGAL::qglviewer::Vec& dir = point - orig; - is_highlighting = true; - if(poly_item) - poly_item->select(orig.x, orig.y, orig.z, dir.x, dir.y, dir.z); - else - sm_item->select(orig.x, orig.y, orig.z, dir.x, dir.y, dir.z); - is_highlighting = false; - } - else - { - Q_EMIT clearHL(); - } - is_ready_to_highlight = false; - } - } - -Q_SIGNALS: - void selected(const std::set::vertex_descriptor>&); - void selected(const std::set::face_descriptor>&); - void selected(const std::set::edge_descriptor>&); - void selected_HL(const std::set::vertex_descriptor>&); - void selected_HL(const std::set::face_descriptor>&); - void selected_HL(const std::set::edge_descriptor>&); - - void selected(const std::set::vertex_descriptor>&); - void selected(const std::set::face_descriptor>&); - void selected(const std::set::edge_descriptor>&); - void selected_HL(const std::set::vertex_descriptor>&); - void selected_HL(const std::set::face_descriptor>&); - void selected_HL(const std::set::edge_descriptor>&); - - void toogle_insert(const bool); - void endSelection(); - void resetIsTreated(); - void isCurrentlySelected(Scene_polyhedron_item_k_ring_selection*); - void clearHL(); - -protected: - - void updateIsTreated() - { - static ushort i = 0; - i++; - if(i==3) - { - i = 0; - Q_EMIT resetIsTreated(); - } - } - template - void process_selection(HandleType clicked) { - //keeps the highlighting on track if the brush_size is not 0 - int current_ring = 0; - if(active_handle_type != Active_handle::PATH && !is_edit_mode) - current_ring = k_ring; - const std::set& selection = extract_k_ring(clicked, current_ring); - if(is_highlighting) - { - Q_EMIT selected_HL(selection); - } - else - Q_EMIT selected(selection); - } - - template - struct Is_selected_from_set{ - std::set& selection; - Is_selected_from_set(std::set& selection) - :selection(selection) {} - friend bool get(Is_selected_from_set map, Handle k) - { - return map.selection.count(k); - } - friend void put(Is_selected_from_set map, Handle k, bool b) - { - if (b) - map.selection.insert(k); - else - map.selection.erase(k); - } - }; - - //Polyhedron sets - - std::set - extract_k_ring(poly_vertex_descriptor clicked, unsigned int k) - { - std::set selection; - selection.insert(clicked); - if (k>0) - CGAL::expand_vertex_selection(CGAL::make_array(clicked), - *poly_item->polyhedron(), - k, - Is_selected_from_set(selection), - CGAL::Emptyset_iterator()); - - return selection; - } - - std::set - extract_k_ring(poly_face_descriptor clicked, unsigned int k) - { - std::set selection; - selection.insert(clicked); - if (k>0) - CGAL::expand_face_selection(CGAL::make_array(clicked), - *poly_item->polyhedron(), - k, - Is_selected_from_set(selection), - CGAL::Emptyset_iterator()); - - return selection; - } - - std::set - extract_k_ring(poly_edge_descriptor clicked, unsigned int k) - { - std::set selection; - selection.insert(clicked); - - if (k>0) - CGAL::expand_edge_selection(CGAL::make_array(clicked), - *poly_item->polyhedron(), - k, - Is_selected_from_set(selection), - CGAL::Emptyset_iterator()); - return selection; - } - - //Surface_mesh sets - std::set - extract_k_ring(sm_vertex_descriptor clicked, unsigned int k) - { - std::set selection; - selection.insert(clicked); - if (k>0) - CGAL::expand_vertex_selection(CGAL::make_array(clicked), - *(sm_item->polyhedron()), - k, - Is_selected_from_set(selection), - CGAL::Emptyset_iterator()); - - return selection; - } - - std::set - extract_k_ring(sm_face_descriptor clicked, unsigned int k) - { - std::set selection; - selection.insert(clicked); - if (k>0) - CGAL::expand_face_selection(CGAL::make_array(clicked), - *sm_item->polyhedron(), - k, - Is_selected_from_set(selection), - CGAL::Emptyset_iterator()); - - return selection; - } - - std::set - extract_k_ring(sm_edge_descriptor clicked, unsigned int k) - { - std::set selection; - selection.insert(clicked); - - if (k>0) - CGAL::expand_edge_selection(CGAL::make_array(clicked), - *sm_item->polyhedron(), - k, - Is_selected_from_set(selection), - CGAL::Emptyset_iterator()); - return selection; - } - - bool eventFilter(QObject* target, QEvent *event) - { - // This filter is both filtering events from 'viewer' and 'main window' - - // key events - if(event->type() == QEvent::KeyPress || event->type() == QEvent::KeyRelease) { - QKeyEvent *keyEvent = static_cast(event); - Qt::KeyboardModifiers modifiers = keyEvent->modifiers(); - - state.shift_pressing = modifiers.testFlag(Qt::ShiftModifier); - } - - if(event->type() == QEvent::KeyPress - && state.shift_pressing - && static_cast(event)->key()==Qt::Key_D) - { - Q_EMIT toogle_insert(false); - } - else if(event->type() == QEvent::KeyRelease - && static_cast(event)->key()==Qt::Key_D) - { - Q_EMIT toogle_insert(true); - } - // mouse events - if(event->type() == QEvent::MouseButtonPress || event->type() == QEvent::MouseButtonRelease) { - QMouseEvent* mouse_event = static_cast(event); - if(mouse_event->button() == Qt::LeftButton) { - state.left_button_pressing = event->type() == QEvent::MouseButtonPress; - if(is_edit_mode) - Q_EMIT clearHL(); - if (!state.left_button_pressing) - { - if (is_active) - { - Q_EMIT endSelection(); - is_active=false; - } - apply_path(); - lasso_selection(); - } - } - //to avoid the contextual menu to mess up the states. - else if(mouse_event->button() == Qt::RightButton) { - state.left_button_pressing = false; - state.shift_pressing = false; - } - } - // use mouse move event for paint-like selection - if( (event->type() == QEvent::MouseMove - || (event->type() == QEvent::MouseButtonPress - && static_cast(event)->button() == Qt::LeftButton)) - && (state.shift_pressing && state.left_button_pressing) ) - { - Q_EMIT isCurrentlySelected(this); - if(!is_current_selection) - return false; - if(target == mainwindow) - { - CGAL::QGLViewer* viewer = *CGAL::QGLViewer::QGLViewerPool().begin(); - viewer->setFocus(); - return false; - } - if(!is_lasso_active) - { - is_ready_to_paint_select = true; - QMouseEvent* mouse_event = static_cast(event); - paint_pos = mouse_event->pos(); - if(!is_edit_mode || event->type() == QEvent::MouseButtonPress) - QTimer::singleShot(0,this,SLOT(paint_selection())); - } - else - { - sample_mouse_path(); - } - } - //if in edit_mode and the mouse is moving without left button pressed : - // highlight the primitive under cursor - else if(is_edit_mode && event->type() == QEvent::MouseMove && !state.left_button_pressing) - { - if(target == mainwindow) - { - CGAL::QGLViewer* viewer = *CGAL::QGLViewer::QGLViewerPool().begin(); - viewer->setFocus(); - return false; - } - - is_ready_to_highlight = true; - QMouseEvent* mouse_event = static_cast(event); - hl_pos = mouse_event->pos(); - QTimer::singleShot(0, this, SLOT(highlight())); - }//end MouseMove - return false; - } - bool is_edit_mode; - bool is_ready_to_highlight; - bool is_ready_to_paint_select; - bool is_lasso_active; - QPoint hl_pos; - QPoint paint_pos; - Polyline_2 contour_2d; - Polylines* polyline; - Polyline_2& poly() const { return polyline->front(); } - Polygon_2 lasso; - CGAL::Bbox_2 domain_rectangle; - bool update_polyline () const - { - if (contour_2d.size() < 2 || - (!(poly().empty()) && contour_2d.back () == poly().back())) - return false; - - - if (!(poly().empty()) && contour_2d.back () == poly().back()) - return false; - - poly().clear(); - - for (unsigned int i = 0; i < contour_2d.size (); ++ i) - poly().push_back (contour_2d[i]); - - return true; - } - - void sample_mouse_path() - { - - CGAL::Three::Viewer_interface* viewer = static_cast(*CGAL::QGLViewer::QGLViewerPool().begin()); - viewer->makeCurrent(); - const QPoint& p = viewer->mapFromGlobal(QCursor::pos()); - contour_2d.push_back (Kernel::Point_2 (p.x(), p.y())); - - if (update_polyline ()) - { - //update draw - QPainter *painter = viewer->getPainter(); - QPen pen; - pen.setColor(QColor(Qt::green)); - pen.setWidth(3); - //Create a QImage of the screen and paint the lasso on top of it - QImage image = viewer->grabFramebuffer(); - painter->begin(viewer); - painter->drawImage(QPoint(0,0), image); - painter->setPen(pen); - for(std::size_t i=0; isize(); ++i) - { - Polyline_2 poly = (*polyline)[i]; - if(!poly.empty()) - for(std::size_t j=0; jdrawLine(poly[j].x(), poly[j].y(), poly[j+1].x(), poly[j+1].y()); - } - } - painter->end(); - } - } - void apply_path() - { - update_polyline (); - domain_rectangle = CGAL::bbox_2 (contour_2d.begin (), contour_2d.end ()); - lasso = Polygon_2 (contour_2d.begin (), contour_2d.end ()); - } - - bool is_vertex_selected (CGAL::qglviewer::Vec& p) - { - if (domain_rectangle.xmin () < p.x && - p.x < domain_rectangle.xmax () && - domain_rectangle.ymin () < p.y && - p.y < domain_rectangle.ymax ()) - { -/* - * domain_freeform.has_on_bounded_side() requires the polygon to be simple, which is never the case. - * However, it works very well even if the polygon is not simple, so we use this instead to avoid - * the cgal_assertion on is_simple().*/ - - - if (CGAL::bounded_side_2(lasso.container().begin(), - lasso.container().end(), - Kernel::Point_2(p.x, p.y), - lasso.traits_member()) == CGAL::ON_BOUNDED_SIDE) - return true; - } - return false; - } -}; - -#endif diff --git a/Polyhedron/demo/Polyhedron/Scene_polyhedron_item_k_ring_selection_config.h b/Polyhedron/demo/Polyhedron/Scene_polyhedron_item_k_ring_selection_config.h deleted file mode 100644 index 6e6b107eb8b..00000000000 --- a/Polyhedron/demo/Polyhedron/Scene_polyhedron_item_k_ring_selection_config.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef SCENE_POLYHEDRON_ITEM_K_RING_SELECTION_CONFIG_H -#define SCENE_POLYHEDRON_ITEM_K_RING_SELECTION_CONFIG_H - -#ifdef scene_polyhedron_and_sm_item_k_ring_selection_EXPORTS -# define SCENE_POLYHEDRON_ITEM_K_RING_SELECTION_EXPORT Q_DECL_EXPORT -#else -# define SCENE_POLYHEDRON_ITEM_K_RING_SELECTION_EXPORT Q_DECL_IMPORT -#endif - -#endif // SCENE_POLYHEDRON_ITEM_K_RING_SELECTION_CONFIG_H diff --git a/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.cpp b/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.cpp index f1241d3644a..775b3daf1eb 100644 --- a/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.cpp @@ -2,6 +2,7 @@ #include "Scene_polyhedron_selection_item.h" #include #include +#include #include #include #include @@ -21,11 +22,7 @@ #include "triangulate_primitive.h" -#ifdef USE_SURFACE_MESH typedef Scene_surface_mesh_item Scene_face_graph_item; -#else -typedef Scene_polyhedron_item Scene_face_graph_item; -#endif typedef Scene_face_graph_item::Face_graph Face_graph; typedef boost::property_map::type VPmap; @@ -53,6 +50,7 @@ struct Scene_polyhedron_selection_item_priv{ Scene_polyhedron_selection_item_priv(Scene_polyhedron_selection_item* parent): item(parent) { + } void initializeBuffers(CGAL::Three::Viewer_interface *viewer) const; @@ -63,7 +61,7 @@ struct Scene_polyhedron_selection_item_priv{ const Selection_set_vertex& p_sel_vertex, const Selection_set_facet &p_sel_facet, const Selection_set_edge &p_sel_edges) const; void compute_temp_elements() const; void compute_HL_elements() const; - void triangulate_facet(fg_face_descriptor, Kernel::Vector_3 normal, + void triangulate_facet(fg_face_descriptor, EPICK::Vector_3 normal, std::vector &p_facets,std::vector &p_normals) const; void tempInstructions(QString s1, QString s2); @@ -117,11 +115,11 @@ struct Scene_polyhedron_selection_item_priv{ Active_handle::Type original_sel_mode; //Only needed for the triangulation Face_graph* poly; - CGAL::Unique_hash_map face_normals_map; - CGAL::Unique_hash_map vertex_normals_map; - boost::associative_property_map< CGAL::Unique_hash_map > + CGAL::Unique_hash_map face_normals_map; + CGAL::Unique_hash_map vertex_normals_map; + boost::associative_property_map< CGAL::Unique_hash_map > nf_pmap; - boost::associative_property_map< CGAL::Unique_hash_map > + boost::associative_property_map< CGAL::Unique_hash_map > nv_pmap; Scene_face_graph_item::ManipulatedFrame *manipulated_frame; bool ready_to_move; @@ -420,7 +418,7 @@ void push_back_xyz(const TypeWithXYZ& t, vector.push_back(t.z()); } -typedef Kernel Traits; +typedef EPICK Traits; //Make sure all the facets are triangles typedef Traits::Point_3 Point_3; @@ -432,9 +430,9 @@ Scene_polyhedron_selection_item_priv::triangulate_facet(fg_face_descriptor fit,c std::vector &p_facets,std::vector &p_normals ) const { const CGAL::qglviewer::Vec off = static_cast(CGAL::QGLViewer::QGLViewerPool().first())->offset(); - Kernel::Vector_3 offset(off.x,off.y,off.z); + EPICK::Vector_3 offset(off.x,off.y,off.z); - typedef FacetTriangulator FT; + typedef FacetTriangulator FT; double diagonal; if(item->poly_item->diagonalBbox() != std::numeric_limits::infinity()) diagonal = item->poly_item->diagonalBbox(); @@ -510,7 +508,7 @@ void Scene_polyhedron_selection_item_priv::compute_any_elements(std::vectorcomputeElements(); d->initializeBuffers(viewer); } - viewer->makeCurrent(); vaos[Scene_polyhedron_selection_item_priv::Facets]->bind(); attribBuffers(viewer,PROGRAM_WITH_LIGHT); @@ -763,7 +760,6 @@ void Scene_polyhedron_selection_item::drawEdges(CGAL::Three::Viewer_interface* v d->computeElements(); d->initializeBuffers(viewer); } - viewer->makeCurrent(); vaos[Scene_polyhedron_selection_item_priv::Edges]->bind(); if(!viewer->isOpenGL_4_3()) { @@ -833,7 +829,6 @@ void Scene_polyhedron_selection_item::drawPoints(CGAL::Three::Viewer_interface* d->computeElements(); d->initializeBuffers(viewer); } - viewer->makeCurrent(); vaos[Scene_polyhedron_selection_item_priv::Points]->bind(); d->program = getShaderProgram(PROGRAM_NO_SELECTION); attribBuffers(viewer,PROGRAM_NO_SELECTION); @@ -1897,6 +1892,7 @@ Scene_polyhedron_selection_item::Scene_polyhedron_selection_item() d->are_temp_buffers_filled = false; d->poly = NULL; d->ready_to_move = false; + setProperty("no_picking", true); } Scene_polyhedron_selection_item::Scene_polyhedron_selection_item(Scene_face_graph_item* poly_item, QMainWindow* mw) @@ -1908,7 +1904,12 @@ Scene_polyhedron_selection_item::Scene_polyhedron_selection_item(Scene_face_grap d->nb_facets = 0; d->nb_points = 0; d->nb_lines = 0; - + QString sf = poly_item->property("source filename").toString(); + QRegExp rx("\\.(ts$|off$|obj$|ply$|stl$|surf$|vtk$|vtp$|vtu)"); + sf.remove(rx); + if(!sf.isEmpty()) + setProperty("defaultSaveDir", sf); + qDebug()<is_treated = false; d->poly_need_update = false; d->ready_to_move = false; + setProperty("no_picking", true); } @@ -1994,8 +1996,8 @@ void Scene_polyhedron_selection_item::compute_normal_maps() d->face_normals_map.clear(); d->vertex_normals_map.clear(); - d->nf_pmap = boost::associative_property_map< CGAL::Unique_hash_map >(d->face_normals_map); - d->nv_pmap = boost::associative_property_map< CGAL::Unique_hash_map >(d->vertex_normals_map); + d->nf_pmap = boost::associative_property_map< CGAL::Unique_hash_map >(d->face_normals_map); + d->nv_pmap = boost::associative_property_map< CGAL::Unique_hash_map >(d->vertex_normals_map); PMP::compute_normals(*d->poly, d->nv_pmap, d->nf_pmap); } @@ -2030,6 +2032,7 @@ void Scene_polyhedron_selection_item::validateMoveVertex() k_ring_selector.setEditMode(true); viewer->setManipulatedFrame(NULL); invalidateOpenGLBuffers(); + poly_item->itemChanged(); Q_EMIT updateInstructions("Select a vertex. (1/2)"); } @@ -2076,8 +2079,9 @@ bool Scene_polyhedron_selection_item_priv::canAddFace(fg_halfedge_descriptor hc, found = true; fg_halfedge_descriptor res = CGAL::Euler::add_face_to_border(t,hc, *item->polyhedron()); + fg_face_descriptor resf = face(res, *item->polyhedron()); - if(CGAL::is_degenerate_triangle_face(res, *item->polyhedron(), get(CGAL::vertex_point, *item->polyhedron()), Kernel())) + if(CGAL::Polygon_mesh_processing::is_degenerate_triangle_face(resf, *item->polyhedron())) { CGAL::Euler::remove_face(res, *item->polyhedron()); tempInstructions("Edge not selected : resulting facet is degenerated.", diff --git a/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.h b/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.h index 245296f27c6..341d73672de 100644 --- a/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.h +++ b/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.h @@ -5,11 +5,7 @@ #include "Plugins/PMP/Scene_facegraph_item_k_ring_selection.h" #include "Travel_isolated_components.h" -#ifdef USE_SURFACE_MESH #include "Scene_surface_mesh_item.h" -#else -#include "Polyhedron_type.h" -#endif #include "Scene_polyhedron_item_decorator.h" #include #include @@ -37,11 +33,7 @@ namespace PMP = CGAL::Polygon_mesh_processing; -#ifdef USE_SURFACE_MESH typedef Scene_surface_mesh_item Scene_face_graph_item; -#else -typedef Scene_polyhedron_item Scene_face_graph_item; -#endif typedef Scene_face_graph_item::Face_graph Face_graph; typedef boost::property_map::type VPmap; @@ -74,7 +66,6 @@ struct Selection_traitspolyhedron()).first; } Iterator iterator_end() { return vertices(*item->polyhedron()).second; } std::size_t size() { return num_vertices(*item->polyhedron()); } - void update_indices() { item->polyhedron_item()->update_vertex_indices(); } std::size_t id(typename SelectionItem::fg_vertex_descriptor vh) { return get(get(boost::vertex_index, *item->polyhedron()), vh); @@ -119,7 +110,6 @@ struct Selection_traitspolyhedron()).first; } Iterator iterator_end() { return faces(*item->polyhedron()).second; } std::size_t size() { return num_faces(*item->polyhedron()); } - void update_indices() { item->polyhedron_item()->update_facet_indices(); } std::size_t id(typename SelectionItem::fg_face_descriptor fh) { return get(get(boost::face_index, *item->polyhedron()), fh); @@ -164,7 +154,6 @@ struct Selection_traitspolyhedron()).first; } Iterator iterator_end() { return edges(*item->polyhedron()).second; } std::size_t size() { return num_edges(*item->polyhedron()); } - void update_indices() { item->polyhedron_item()->update_halfedge_indices(); } std::size_t id(boost::graph_traits::edge_descriptor ed) { return get(boost::halfedge_index, *item->polyhedron(), halfedge(ed,*item->polyhedron()))/2; @@ -231,6 +220,12 @@ public: void printAllIds(CGAL::Three::Viewer_interface*); bool testDisplayId(double, double, double, CGAL::Three::Viewer_interface*)const; bool shouldDisplayIds(CGAL::Three::Scene_item *current_item) const; + QString defaultSaveName() const + { + QString res = name(); + res.remove(" (selection)"); + return res; + } protected: void init(Scene_face_graph_item* poly_item, QMainWindow* mw); @@ -329,10 +324,10 @@ public: bool save(const std::string& file_name) const { // update id fields before using - if(selected_vertices.size() > 0) { poly_item->update_vertex_indices(); } - if(selected_facets.size() > 0) { poly_item->update_facet_indices(); } - if( (selected_edges.size() > 0) && - selected_vertices.empty() ) { poly_item->update_vertex_indices(); } + if(selected_vertices.size() > 0 + ||selected_facets.size() > 0 + || (selected_edges.size() > 0 && + selected_vertices.empty() )) { poly_item->face_graph()->collect_garbage(); } std::ofstream out(file_name.c_str()); if(!out) { return false; } @@ -495,7 +490,6 @@ public: template // use fg_vertex_descriptor, fg_face_descriptor, fg_edge_descriptor boost::optional get_minimum_isolated_component() { Selection_traits tr(this); - tr.update_indices(); Travel_isolated_components::Minimum_visitor visitor; Travel_isolated_components(*polyhedron()).travel (tr.iterator_begin(), tr.iterator_end(), tr.size(), tr.container(), visitor); @@ -516,7 +510,6 @@ public: boost::optional select_isolated_components(std::size_t threshold) { typedef Selection_traits Tr; Tr tr(this); - tr.update_indices(); typedef std::insert_iterator Output_iterator; Output_iterator out(tr.container(), tr.container().begin()); @@ -643,7 +636,6 @@ public: typedef Selection_traits Tr; Tr tr(this); - tr.update_indices(); std::vector mark(tr.size(),false); BOOST_FOREACH(Handle h,tr.container()) @@ -676,7 +668,6 @@ public: typedef Selection_traits Tr; Tr tr(this); - tr.update_indices(); std::vector mark(tr.size(),false); BOOST_FOREACH(Handle h,tr.container()) @@ -737,9 +728,7 @@ public: if (selected_facets.empty()) { return; } Selection_traits trf(this); - trf.update_indices(); Selection_traits trv(this); - trv.update_indices(); PMP::keep_connected_components(*polyhedron(), trf.container()); changed_with_poly_item(); @@ -754,7 +743,7 @@ public: } } // construct point vector - std::vector points; + std::vector points; points.reserve(selected_facets.size()); VPmap vpm = get(CGAL::vertex_point, *polyhedron()); unsigned int counter = 1; @@ -843,6 +832,7 @@ public Q_SLOTS: remove_erased_handles(); remove_erased_handles(); remove_erased_handles(); + compute_normal_maps(); } void endSelection(){ Q_EMIT simplicesSelected(this); @@ -934,7 +924,6 @@ template { Selection_traits tr(this); - tr.update_indices(); std::vector mark(tr.size(), false); BOOST_FOREACH(fg_edge_descriptor e, selected_edges) mark[tr.id(e)] = true; @@ -962,7 +951,6 @@ public: { Selection_traits tr(this); - tr.update_indices(); for (unsigned int i = 0; i < mark.size(); ++i) mark[i] = false; diff --git a/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item_config.h b/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item_config.h index 08ca8c18401..159ed7b1a6e 100644 --- a/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item_config.h +++ b/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item_config.h @@ -1,7 +1,7 @@ #ifndef SCENE_POLYHEDRON_SELECTION_ITEM_CONFIG_H #define SCENE_POLYHEDRON_SELECTION_ITEM_CONFIG_H -#if defined( scene_polyhedron_selection_item_EXPORTS ) || defined( scene_surface_mesh_selection_item_EXPORTS ) +#if defined(scene_selection_item_EXPORTS ) # define SCENE_POLYHEDRON_SELECTION_ITEM_EXPORT Q_DECL_EXPORT #else # define SCENE_POLYHEDRON_SELECTION_ITEM_EXPORT Q_DECL_IMPORT diff --git a/Polyhedron/demo/Polyhedron/Scene_polyhedron_shortest_path_item_config.h b/Polyhedron/demo/Polyhedron/Scene_polyhedron_shortest_path_item_config.h index cf2954d6f69..62b92d0bc4f 100644 --- a/Polyhedron/demo/Polyhedron/Scene_polyhedron_shortest_path_item_config.h +++ b/Polyhedron/demo/Polyhedron/Scene_polyhedron_shortest_path_item_config.h @@ -1,7 +1,7 @@ #ifndef SCENE_POLYHEDRON_SHORTEST_PATH_ITEM_CONFIG_H #define SCENE_POLYHEDRON_SHORTEST_PATH_ITEM_CONFIG_H -#if defined(scene_polyhedron_shortest_path_item_EXPORTS)||defined(scene_sm_shortest_path_item_EXPORTS) +#if defined(scene_shortest_path_item_EXPORTS) # define SCENE_POLYHEDRON_SHORTEST_PATH_ITEM_EXPORT Q_DECL_EXPORT #else # define SCENE_POLYHEDRON_SHORTEST_PATH_ITEM_EXPORT Q_DECL_IMPORT diff --git a/Polyhedron/demo/Polyhedron/Scene_surface_mesh_item.cpp b/Polyhedron/demo/Polyhedron/Scene_surface_mesh_item.cpp index aa90f792450..825e855497b 100644 --- a/Polyhedron/demo/Polyhedron/Scene_surface_mesh_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_surface_mesh_item.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include "triangulate_primitive.h" @@ -42,6 +43,7 @@ #include #include #include +#include #include #include @@ -233,6 +235,7 @@ struct Scene_surface_mesh_item_priv{ Scene_surface_mesh_item *item; mutable SMesh::Property_map fpatch_id_map; + mutable int min_patch_id; mutable SMesh::Property_map v_selection_map; mutable SMesh::Property_map f_selection_map; mutable SMesh::Property_map::edge_descriptor, bool> e_is_feature_map; @@ -251,20 +254,21 @@ Scene_surface_mesh_item::Scene_surface_mesh_item() { d = new Scene_surface_mesh_item_priv(new SMesh(), this); d->floated = false; - + setRenderingMode(CGAL::Three::Three::defaultSurfaceMeshRenderingMode()); d->checkFloat(); d->textVItems = new TextListItem(this); d->textEItems = new TextListItem(this); d->textFItems = new TextListItem(this); are_buffers_filled = false; + invalidate(ALL); } Scene_surface_mesh_item::Scene_surface_mesh_item(const Scene_surface_mesh_item& other) { d = new Scene_surface_mesh_item_priv(other, this); + setRenderingMode(CGAL::Three::Three::defaultSurfaceMeshRenderingMode()); d->floated = false; - d->checkFloat(); d->textVItems = new TextListItem(this); d->textEItems = new TextListItem(this); @@ -278,13 +282,14 @@ void Scene_surface_mesh_item::standard_constructor(SMesh* sm) { d = new Scene_surface_mesh_item_priv(sm, this); d->floated = false; - + setRenderingMode(CGAL::Three::Three::defaultSurfaceMeshRenderingMode()); d->checkFloat(); d->textVItems = new TextListItem(this); d->textEItems = new TextListItem(this); d->textFItems = new TextListItem(this); are_buffers_filled = false; + invalidate(ALL); } Scene_surface_mesh_item::Scene_surface_mesh_item(SMesh* sm) { @@ -472,8 +477,7 @@ void Scene_surface_mesh_item_priv::compute_elements(Scene_item_rendering_helper: } if(name.testFlag(Scene_item_rendering_helper::COLORS) && - has_fpatch_id && - colors_.empty()){ + has_fpatch_id){ initialize_colors(); } @@ -504,8 +508,10 @@ void Scene_surface_mesh_item_priv::compute_elements(Scene_item_rendering_helper: { if(has_fpatch_id) { - QColor c = item->color_vector()[fpatch_id_map[fd]]; - CGAL::Color color(c.red(), c.green(), c.blue()); + //The sharp features detection produces patch ids >=1, this + //is meant to insure the wanted id is in the range [min,max] + QColor c = item->color_vector()[fpatch_id_map[fd] - min_patch_id]; + CGAL::Color color(c.red(),c.green(),c.blue()); CPF::add_color_in_buffer(color, f_colors); } else if(has_fcolors) @@ -663,14 +669,14 @@ void Scene_surface_mesh_item_priv::initialize_colors() const { // Fill indices map and get max subdomain value int max = 0; - int min = (std::numeric_limits::max)(); + min_patch_id = (std::numeric_limits::max)(); BOOST_FOREACH(face_descriptor fd, faces(*smesh_)){ max = (std::max)(max, fpatch_id_map[fd]); - min = (std::min)(min, fpatch_id_map[fd]); + min_patch_id = (std::min)(min_patch_id, fpatch_id_map[fd]); } colors_.clear(); - compute_color_map(item->color(), (std::max)(0, max + 1 - min), + compute_color_map(item->color(), (std::max)(1, max + 1 - min_patch_id), std::back_inserter(colors_)); } @@ -831,9 +837,6 @@ void Scene_surface_mesh_item_priv::triangulate_convex_facet(face_descriptor fd, Scene_item_rendering_helper::Gl_data_names name, bool index) const { - const CGAL::qglviewer::Vec v_offset = static_cast(CGAL::QGLViewer::QGLViewerPool().first())->offset(); - EPICK::Vector_3 offset = EPICK::Vector_3(v_offset.x, v_offset.y, v_offset.z); - Point p0,p1,p2; SMesh::Halfedge_around_face_circulator he(halfedge(fd, *smesh_), *smesh_); SMesh::Halfedge_around_face_circulator he_end = he; @@ -844,9 +847,9 @@ void Scene_surface_mesh_item_priv::triangulate_convex_facet(face_descriptor fd, vertex_descriptor v0(target(*he_end, *smesh_)), v1(target(*he, *smesh_)), v2(target(next(*he, *smesh_), *smesh_)); - p0 = smesh_->point(v0) + offset; - p1 = smesh_->point(v1) + offset; - p2 = smesh_->point(v2) + offset; + p0 = smesh_->point(v0); + p1 = smesh_->point(v1); + p2 = smesh_->point(v2); if(!index) { CGAL::Color* color; @@ -884,9 +887,33 @@ Scene_surface_mesh_item_priv::triangulate_facet(face_descriptor fd, Scene_item_rendering_helper::Gl_data_names name, bool index) const { + //Computes the normal of the facet EPICK::Vector_3 normal = get(*fnormals, fd); - + if(normal == CGAL::NULL_VECTOR) + { + boost::graph_traits::halfedge_descriptor start = prev(halfedge(fd, *smesh_), *smesh_); + boost::graph_traits::halfedge_descriptor next_; + do + { + boost::graph_traits::halfedge_descriptor hd = halfedge(fd, *smesh_); + next_ =next(hd, *smesh_); + const Point_3& pa = smesh_->point(target(hd, *smesh_)); + const Point_3& pb = smesh_->point(target(next_, *smesh_)); + const Point_3& pc = smesh_->point(target(prev(hd, *smesh_), *smesh_)); + if (!CGAL::collinear (pa, pb, pc)) + { + normal = CGAL::cross_product(pb-pa, pc -pa); + break; + } + }while(next_ != start); + + if (normal == CGAL::NULL_VECTOR) // No normal could be computed, return + { + qDebug()<<"Warning : normal is not valid. Facet not displayed"; + return; + } + } //check if normal contains NaN values if (normal.x() != normal.x() || normal.y() != normal.y() || normal.z() != normal.z()) { @@ -1045,7 +1072,7 @@ void* Scene_surface_mesh_item_priv::get_aabb_tree() BOOST_FOREACH( face_descriptor f, faces(*sm)) { //if face is degenerate, skip it - if (CGAL::is_degenerate_triangle_face(f, *sm, get(CGAL::vertex_point, *sm), EPICK())) + if (CGAL::Polygon_mesh_processing::is_degenerate_triangle_face(f, *sm)) continue; //if face not triangle, triangulate corresponding primitive before adding it to the tree if(!CGAL::is_triangle(halfedge(f, *sm), *sm)) @@ -1401,6 +1428,12 @@ bool Scene_surface_mesh_item::isItemMulticolor() return d->has_fcolors; } +bool Scene_surface_mesh_item::hasPatchIds() +{ + return d->has_fpatch_id; +} + + bool Scene_surface_mesh_item::save(std::ostream& out) const { @@ -1531,7 +1564,7 @@ QString Scene_surface_mesh_item::computeStats(int type) if(is_triangle_mesh(*d->smesh_)) { if (d->number_of_degenerated_faces == (unsigned int)(-1)) - d->number_of_degenerated_faces = nb_degenerate_faces(d->smesh_, get(CGAL::vertex_point, *(d->smesh_))); + d->number_of_degenerated_faces = nb_degenerate_faces(d->smesh_); return QString::number(d->number_of_degenerated_faces); } else @@ -1651,8 +1684,8 @@ CGAL::Three::Scene_item::Header_data Scene_surface_mesh_item::header() const data.categories.append(std::pair(QString("Properties"),9)); data.categories.append(std::pair(QString("Faces"),10)); - data.categories.append(std::pair(QString("Edges"),6)); - data.categories.append(std::pair(QString("Angles"),3)); + data.categories.append(std::pair(QString("Edges"),7)); + data.categories.append(std::pair(QString("Angles"),2)); //titles @@ -1815,6 +1848,12 @@ void Scene_surface_mesh_item::zoomToPosition(const QPoint &point, CGAL::Three::V void Scene_surface_mesh_item::resetColors() { setItemIsMulticolor(false); + if(d->has_feature_edges){ + BOOST_FOREACH(boost::graph_traits::edge_descriptor e, edges(*d->smesh_)){ + put(d->e_is_feature_map, e, false); + } + d->has_feature_edges = false; + } invalidate(COLORS); itemChanged(); } @@ -1826,7 +1865,7 @@ QMenu* Scene_surface_mesh_item::contextMenu() QAction* actionResetColor= menu->findChild(tr("actionResetColor")); - if(isItemMulticolor()) + if(isItemMulticolor() || d->has_fpatch_id) { if(!actionResetColor) { diff --git a/Polyhedron/demo/Polyhedron/Scene_surface_mesh_item.h b/Polyhedron/demo/Polyhedron/Scene_surface_mesh_item.h index 8fbc7116f2c..9daecd0e565 100644 --- a/Polyhedron/demo/Polyhedron/Scene_surface_mesh_item.h +++ b/Polyhedron/demo/Polyhedron/Scene_surface_mesh_item.h @@ -65,12 +65,9 @@ public: QMenu* contextMenu() Q_DECL_OVERRIDE; - // Only needed for Scene_polyhedron_item void setItemIsMulticolor(bool); - void update_vertex_indices(){} - void update_halfedge_indices(){} - void update_facet_indices(){} bool isItemMulticolor(); + bool hasPatchIds(); Vertex_selection_map vertex_selection_map(); Face_selection_map face_selection_map(); diff --git a/Polyhedron/demo/Polyhedron/Scene_textured_polyhedron_item.h b/Polyhedron/demo/Polyhedron/Scene_textured_polyhedron_item.h deleted file mode 100644 index ae966f44c99..00000000000 --- a/Polyhedron/demo/Polyhedron/Scene_textured_polyhedron_item.h +++ /dev/null @@ -1,60 +0,0 @@ -#ifndef SCENE_TEXTURED_POLYHEDRON_ITEM_H -#define SCENE_TEXTURED_POLYHEDRON_ITEM_H -#include "Scene_textured_polyhedron_item_config.h" -#include -#include -#include "Textured_polyhedron_type_fwd.h" -#include -#include "texture.h" - -struct Scene_textured_polyhedron_item_priv; -// This class represents a textured polyhedron in the OpenGL scene -class SCENE_TEXTURED_POLYHEDRON_ITEM_EXPORT Scene_textured_polyhedron_item - : public CGAL::Three::Scene_item { - Q_OBJECT -public: - Scene_textured_polyhedron_item(); -// Scene_textured_polyhedron_item(const Scene_textured_polyhedron_item&); - Scene_textured_polyhedron_item(const Textured_polyhedron& p); - Scene_textured_polyhedron_item(Textured_polyhedron* const p); - ~Scene_textured_polyhedron_item(); - - Scene_textured_polyhedron_item* clone() const; - - // IO - bool load(std::istream& in); - bool save(std::ostream& out) const; - - // Function for displaying meta-data of the item - virtual QString toolTip() const; - - // Indicate if rendering mode is supported - virtual bool supportsRenderingMode(RenderingMode m) const { return (m != PointsPlusNormals && m != Points && m != Gouraud && m != ShadedPoints); } - // Points/Wireframe/Flat/Gouraud OpenGL drawing in a display list - void draw() const {} - virtual void draw(CGAL::Three::Viewer_interface*) const; - virtual void drawEdges() const {} - virtual void drawEdges(CGAL::Three::Viewer_interface* viewer) const; - - // Get wrapped textured_polyhedron - Textured_polyhedron* textured_polyhedron(); - const Textured_polyhedron* textured_polyhedron() const; - - // Get dimensions - bool isFinite() const { return true; } - bool isEmpty() const; - void compute_bbox() const; - virtual void invalidateOpenGLBuffers(); - virtual void selection_changed(bool); - void add_border_edges(std::vector border_edges, bool is_opengl_4_3); - -Q_SIGNALS: - void selectionChanged(); - -protected: - friend struct Scene_textured_polyhedron_item_priv; - Scene_textured_polyhedron_item_priv* d; - -}; // end class Scene_textured_polyhedron_item - -#endif // SCENE_TEXTURED_POLYHEDRON_ITEM_H diff --git a/Polyhedron/demo/Polyhedron/Scene_textured_polyhedron_item_config.h b/Polyhedron/demo/Polyhedron/Scene_textured_polyhedron_item_config.h deleted file mode 100644 index d3480a929c3..00000000000 --- a/Polyhedron/demo/Polyhedron/Scene_textured_polyhedron_item_config.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef SCENE_TEXTURED_POLYHEDRON_ITEM_CONFIG_H -#define SCENE_TEXTURED_POLYHEDRON_ITEM_CONFIG_H - -#ifdef scene_textured_polyhedron_item_EXPORTS -# define SCENE_TEXTURED_POLYHEDRON_ITEM_EXPORT Q_DECL_EXPORT -#else -# define SCENE_TEXTURED_POLYHEDRON_ITEM_EXPORT Q_DECL_IMPORT -#endif - -#endif // SCENE_TEXTURED_POLYHEDRON_ITEM_CONFIG_H diff --git a/Polyhedron/demo/Polyhedron/Scene_textured_surface_mesh_item.h b/Polyhedron/demo/Polyhedron/Scene_textured_surface_mesh_item.h index 341616f383e..3ec60197a91 100644 --- a/Polyhedron/demo/Polyhedron/Scene_textured_surface_mesh_item.h +++ b/Polyhedron/demo/Polyhedron/Scene_textured_surface_mesh_item.h @@ -6,7 +6,7 @@ #include #include "texture.h" -#ifdef scene_textured_surface_mesh_item_EXPORTS +#ifdef scene_textured_item_EXPORTS # define SCENE_TEXTURED_SURFACE_MESH_ITEM_EXPORT Q_DECL_EXPORT #else # define SCENE_TEXTURED_SURFACE_MESH_ITEM_EXPORT Q_DECL_IMPORT diff --git a/Polyhedron/demo/Polyhedron/Selection_visualizer.h b/Polyhedron/demo/Polyhedron/Selection_visualizer.h new file mode 100644 index 00000000000..998c49de8de --- /dev/null +++ b/Polyhedron/demo/Polyhedron/Selection_visualizer.h @@ -0,0 +1,162 @@ +#ifndef SELECTION_VISUALIZER_H +#define SELECTION_VISUALIZER_H + +#include +#include +#include +#include +#include + +// Class for visualizing selection +// provides mouse selection functionality +class Q_DECL_EXPORT Selection_visualizer +{ + + private: + typedef CGAL::Exact_predicates_inexact_constructions_kernel K; + typedef K::Point_2 Point_2; + typedef K::Point_3 Point_3; + typedef CGAL::Polygon_2 Polygon_2; + typedef std::vector Polyline_2; + typedef std::vector Polylines; + typedef CGAL::Three::Scene_item::Bbox Bbox; + + bool rectangle; + std::vector contour_2d; + Polylines* polyline; + Bbox point_set_bbox; + Polygon_2 domain_freeform; + +public: + CGAL::Bbox_2 domain_rectangle; + + Selection_visualizer(bool rectangle, const Bbox& point_set_bbox) + : rectangle (rectangle), point_set_bbox (point_set_bbox) + { + polyline = new Polylines(0); + polyline->push_back(Polyline_2()); + } + ~Selection_visualizer() { + } + + void render(QImage& image) const { + + CGAL::Three::Viewer_interface* viewer = static_cast(*CGAL::QGLViewer::QGLViewerPool().begin()); + + QPen pen; + pen.setColor(QColor(Qt::green)); + pen.setWidth(5); + QImage temp(image); + + QPainter *painter = new QPainter(&temp); + painter->setPen(pen); + for(std::size_t i=0; isize(); ++i) + { + Polyline_2 poly = (*polyline)[i]; + if(!poly.empty()) + for(std::size_t j=0; jdrawLine(poly[j].x(), poly[j].y(), poly[j+1].x(), poly[j+1].y()); + } + } + painter->end(); + delete painter; + viewer->set2DSelectionMode(true); + viewer->setStaticImage(temp); + viewer->update(); + } + + Polyline_2& poly() const + { return polyline->front(); } + + bool update_polyline () const + { + if (contour_2d.size() < 2 || + (!(poly().empty()) && contour_2d.back () == poly().back())) + return false; + + if (rectangle) + { + poly().clear(); + + poly().push_back ( Point_2 (domain_rectangle.xmin(), + domain_rectangle.ymin())); + poly().push_back ( Point_2 (domain_rectangle.xmax(), + domain_rectangle.ymin())); + poly().push_back ( Point_2 (domain_rectangle.xmax(), + domain_rectangle.ymax())); + poly().push_back ( Point_2 (domain_rectangle.xmin(), + domain_rectangle.ymax())); + poly().push_back ( Point_2 (domain_rectangle.xmin(), + domain_rectangle.ymin())); + + } + else + { + if (!(poly().empty()) && contour_2d.back () == poly().back()) + return false; + + poly().clear(); + + for (unsigned int i = 0; i < contour_2d.size (); ++ i) + poly().push_back (contour_2d[i]); + } + return true; + } + + + void sample_mouse_path(QImage& image) + { + CGAL::QGLViewer* viewer = *CGAL::QGLViewer::QGLViewerPool().begin(); + const QPoint& p = viewer->mapFromGlobal(QCursor::pos()); + + if (rectangle && contour_2d.size () == 2) + { + contour_2d[1] = Point_2 (p.x (), p.y ()); + domain_rectangle = CGAL::bbox_2 (contour_2d.begin (), contour_2d.end ()); + } + else + contour_2d.push_back (Point_2 (p.x (), p.y ())); + + if (update_polyline ()) + { + + render(image); + } + } + + void apply_path() + { + update_polyline (); + domain_rectangle = CGAL::bbox_2 (contour_2d.begin (), contour_2d.end ()); + if (!rectangle) + domain_freeform = Polygon_2 (contour_2d.begin (), contour_2d.end ()); + } + + bool is_selected (CGAL::qglviewer::Vec& p) + { + if (domain_rectangle.xmin () < p.x && + p.x < domain_rectangle.xmax () && + domain_rectangle.ymin () < p.y && + p.y < domain_rectangle.ymax ()) + { + if (rectangle) + return true; +/* + * domain_freeform.has_on_bounded_side() requires the polygon to be simple, which is never the case. + * However, it works very well even if the polygon is not simple, so we use this instead to avoid + * the cgal_assertion on is_simple().*/ + + + if (CGAL::bounded_side_2(domain_freeform.container().begin(), + domain_freeform.container().end(), + Point_2(p.x, p.y), + domain_freeform.traits_member()) == CGAL::ON_BOUNDED_SIDE) + return true; + } + return false; + } + + +}; // end class Selection_visualizer +#endif // SELECTION_VISUALIZER_H diff --git a/Polyhedron/demo/Polyhedron/Show_point_dialog.ui b/Polyhedron/demo/Polyhedron/Show_point_dialog.ui index 1d94c9fd0b4..bbe92b716a9 100644 --- a/Polyhedron/demo/Polyhedron/Show_point_dialog.ui +++ b/Polyhedron/demo/Polyhedron/Show_point_dialog.ui @@ -7,7 +7,7 @@ 0 0 575 - 151 + 144 diff --git a/Polyhedron/demo/Polyhedron/Statistics_on_item_dialog.ui b/Polyhedron/demo/Polyhedron/Statistics_on_item_dialog.ui index 67c960ec259..4a07a90e174 100644 --- a/Polyhedron/demo/Polyhedron/Statistics_on_item_dialog.ui +++ b/Polyhedron/demo/Polyhedron/Statistics_on_item_dialog.ui @@ -10,7 +10,7 @@ 0 0 574 - 563 + 691 diff --git a/Polyhedron/demo/Polyhedron/TextRenderer.cpp b/Polyhedron/demo/Polyhedron/TextRenderer.cpp index 2821f4bfc7a..2e9ce45fefe 100644 --- a/Polyhedron/demo/Polyhedron/TextRenderer.cpp +++ b/Polyhedron/demo/Polyhedron/TextRenderer.cpp @@ -34,6 +34,11 @@ void TextRenderer::draw(CGAL::Three::Viewer_interface *viewer) int(item->height())); painter->setFont(item->font()); + QColor c = item->color().toHsv(); + c.setHsv((c.hsvHue()+180)%360, 255,255,100); + painter->setBrush(QBrush(c)); + painter->setPen(QPen(QColor(0,0,0,0))); + painter->drawRect(rect); painter->setPen(QPen(item->color())); painter->drawText(rect, item->text()); } @@ -62,6 +67,11 @@ void TextRenderer::draw(CGAL::Three::Viewer_interface *viewer) int(item->height())); } painter->setFont(item->font()); + QColor c = item->color().toHsv(); + c.setHsv((c.hsvHue()+180)%360, 255,255,100); + painter->setBrush(QBrush(c)); + painter->setPen(QPen(QColor(0,0,0,0))); + painter->drawRect(rect); painter->setPen(QPen(item->color())); painter->drawText(rect, item->text()); } diff --git a/Polyhedron/demo/Polyhedron/Textured_polyhedron_type.h b/Polyhedron/demo/Polyhedron/Textured_polyhedron_type.h deleted file mode 100644 index 9950ceb4a74..00000000000 --- a/Polyhedron/demo/Polyhedron/Textured_polyhedron_type.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef TEXTURED_POLYHEDRON_TYPE_H -#define TEXTURED_POLYHEDRON_TYPE_H - -#include -#include - -#include "Textured_polyhedron_type_fwd.h" - -struct EPIC_kernel : public CGAL::Exact_predicates_inexact_constructions_kernel {}; - -#endif // TEXTURED_POLYHEDRON_TYPE_H diff --git a/Polyhedron/demo/Polyhedron/Textured_polyhedron_type_fwd.h b/Polyhedron/demo/Polyhedron/Textured_polyhedron_type_fwd.h deleted file mode 100644 index ae75d4dcee7..00000000000 --- a/Polyhedron/demo/Polyhedron/Textured_polyhedron_type_fwd.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef TEXTURED_POLYHEDRON_TYPE_FWD_H -#define TEXTURED_POLYHEDRON_TYPE_FWD_H - -struct EPIC_kernel; -namespace CGAL { - struct Textured_items; - template class Textured_polyhedron; -} - -typedef CGAL::Textured_polyhedron< ::EPIC_kernel,CGAL::Textured_items> Textured_polyhedron; - -#endif // TEXTURED_POLYHEDRON_TYPE_FWD_H diff --git a/Polyhedron/demo/Polyhedron/Three.cpp b/Polyhedron/demo/Polyhedron/Three.cpp index ae5b0f0dc2e..5bedb74a671 100644 --- a/Polyhedron/demo/Polyhedron/Three.cpp +++ b/Polyhedron/demo/Polyhedron/Three.cpp @@ -9,6 +9,8 @@ QMainWindow* Three::s_mainwindow = NULL; Scene_interface* Three::s_scene = NULL; QObject* Three::s_connectable_scene = NULL; Three* Three::s_three = NULL; +RenderingMode Three::s_defaultSMRM; +RenderingMode Three::s_defaultPSRM; QMainWindow* Three::mainWindow() { @@ -130,3 +132,55 @@ void Three::autoConnectActions(Polyhedron_demo_plugin_interface *plugin) action->objectName().toUtf8().data()); } // end foreach action of actions() } + +RenderingMode Three::defaultSurfaceMeshRenderingMode() +{ + return s_defaultSMRM; +} +RenderingMode Three::defaultPointSetRenderingMode() +{ + return s_defaultPSRM; +} + +QString Three::modeName(RenderingMode mode) { + switch(mode) + { + case Points: + return QObject::tr("points"); + case ShadedPoints: + return QObject::tr("shaded points"); + case Wireframe: + return QObject::tr("wire"); + case Flat: + return QObject::tr("flat"); + case FlatPlusEdges: + return QObject::tr("flat+edges"); + case Gouraud: + return QObject::tr("Gouraud"); + case PointsPlusNormals: + return QObject::tr("pts+normals"); + default: + Q_ASSERT(false); + return QObject::tr("unknown"); + } +} + +RenderingMode Three::modeFromName(QString name) { + if(name == "points") + return Points; + if(name == "shaded points") + return ShadedPoints; + if(name == "wire") + return Wireframe; + if(name == "flat") + return Flat; + if(name == "flat+edges") + return FlatPlusEdges; + if(name == "Gouraud") + return Gouraud; + if(name == "pts+normals") + return PointsPlusNormals; + Q_ASSERT(false); + return Points; +} + diff --git a/Polyhedron/demo/Polyhedron/Triangle_container.cpp b/Polyhedron/demo/Polyhedron/Triangle_container.cpp index 2ea32046f2a..b7ce71308b1 100644 --- a/Polyhedron/demo/Polyhedron/Triangle_container.cpp +++ b/Polyhedron/demo/Polyhedron/Triangle_container.cpp @@ -16,6 +16,7 @@ struct Tri_d{ float shrink_factor; QVector4D plane; float alpha; + QMatrix4x4 f_matrix; }; Triangle_container::Triangle_container(int program, bool indexed) @@ -117,6 +118,8 @@ QOpenGLFramebufferObject* fbo = viewer->depthPeelingFbo(); getVao(viewer)->bind(); if(is_color_uniform) getVao(viewer)->program->setAttributeValue("colors", getColor()); + if(getVao(viewer)->program->property("hasFMatrix").toBool()) + getVao(viewer)->program->setUniformValue("f_matrix", getFrameMatrix()); getVbo(Vertex_indices)->bind(); if(getVao(viewer)->program->property("hasTransparency").toBool()) { @@ -142,6 +145,8 @@ QOpenGLFramebufferObject* fbo = viewer->depthPeelingFbo(); getVao(viewer)->program->setUniformValue("cutplane", d->plane); if(is_color_uniform) getVao(viewer)->program->setAttributeValue("colors", getColor()); + if(getVao(viewer)->program->property("hasFMatrix").toBool()) + getVao(viewer)->program->setUniformValue("f_matrix", getFrameMatrix()); if(getVao(viewer)->program->property("hasTransparency").toBool()) { getVao(viewer)->program->setUniformValue("comparing", viewer->currentPass() > 0); @@ -189,6 +194,8 @@ void Triangle_container::initializeBuffers(Viewer_interface *viewer) float Triangle_container::getShrinkFactor() { return d->shrink_factor ; } QVector4D Triangle_container::getPlane() { return d->plane; } float Triangle_container::getAlpha() { return d->alpha; } +QMatrix4x4 Triangle_container::getFrameMatrix() const { return d->f_matrix; } void Triangle_container::setShrinkFactor(const float& f) { d->shrink_factor = f; } void Triangle_container::setAlpha (const float& f) { d->alpha = f ; } +void Triangle_container::setFrameMatrix(const QMatrix4x4& m) { d->f_matrix = m; } diff --git a/Polyhedron/demo/Polyhedron/Viewer.cpp b/Polyhedron/demo/Polyhedron/Viewer.cpp index a6d270be0a9..9c47fef8fac 100644 --- a/Polyhedron/demo/Polyhedron/Viewer.cpp +++ b/Polyhedron/demo/Polyhedron/Viewer.cpp @@ -2,7 +2,9 @@ #include #include #include +#include #include +#include #include #include #include @@ -14,12 +16,15 @@ #include #include +#include "ui_LightingDialog.h" + #if defined(_WIN32) #include #include #include #endif + class Viewer_impl { public: CGAL::Three::Scene_draw_interface* scene; @@ -34,6 +39,14 @@ public: GLfloat gl_point_size; QVector4D clipbox[6]; QPainter *painter; + + // L i g h t i n g + QVector4D position; + QVector4D ambient; + QVector4D diffuse; + QVector4D specular; + float spec_power; + // M e s s a g e s QString message; bool _displayMessage; @@ -88,10 +101,147 @@ public: QMatrix4x4 projectionMatrix; void sendSnapshotToClipboard(Viewer*); }; + +class LightingDialog : + public QDialog, + public Ui::LightingDialog +{ + Q_OBJECT +public: + QColor ambient, diffuse, specular; + LightingDialog(Viewer_impl* d) + { + setupUi(this); + position_lineEdit->setText(QString("%1,%2,%3") + .arg(d->position.x()) + .arg(d->position.y()) + .arg(d->position.z())); + QPalette palette; + ambient=QColor(255*d->ambient.x(), + 255*d->ambient.y(), + 255*d->ambient.z()); + palette.setColor(QPalette::Button,ambient); + ambientButton->setPalette(palette); + + diffuse=QColor(255*d->diffuse.x(), + 255*d->diffuse.y(), + 255*d->diffuse.z()); + palette.setColor(QPalette::Button,diffuse); + diffuseButton->setPalette(palette); + + specular=QColor(255*d->specular.x(), + 255*d->specular.y(), + 255*d->specular.z()); + palette.setColor(QPalette::Button,specular); + specularButton->setPalette(palette); + spec_powrSlider->setValue(static_cast(d->spec_power)); + + connect(&ambient_dial, &QColorDialog::currentColorChanged, this, &LightingDialog::ambient_changed ); + connect(&diffuse_dial, &QColorDialog::currentColorChanged, this, &LightingDialog::diffuse_changed ); + connect(&spec_dial, &QColorDialog::currentColorChanged, this, &LightingDialog::specular_changed); + + connect(ambientButton, &QPushButton::clicked, + [this](){ + ambient_dial.setCurrentColor(ambient); + ambient_dial.exec(); + ambient = ambient_dial.selectedColor(); + QPalette palette; + palette.setColor(QPalette::Button, ambient); + ambientButton->setPalette(palette); + }); + connect(diffuseButton, &QPushButton::clicked, + [this](){ + diffuse_dial.setCurrentColor(diffuse); + diffuse_dial.exec(); + diffuse = diffuse_dial.selectedColor(); + QPalette palette; + palette.setColor(QPalette::Button, diffuse); + diffuseButton->setPalette(palette); + }); + connect(specularButton, &QPushButton::clicked, + [this](){ + spec_dial.setCurrentColor(specular); + spec_dial.exec(); + specular = spec_dial.selectedColor(); + QPalette palette; + palette.setColor(QPalette::Button, specular); + specularButton->setPalette(palette); + }); + + //D e f a u l t - S e t t i n g s + connect(buttonBox->button(QDialogButtonBox::StandardButton::RestoreDefaults), &QPushButton::clicked, + [this](){ + position_lineEdit->setText(QString("0,0,1")); + ambient=QColor(77,77,77); + diffuse=QColor(204,204,204); + specular=QColor(0,0,0); + spec_powrSlider->setValue(51); + QPalette palette; + palette.setColor(QPalette::Button, ambient); + ambientButton->setPalette(palette); + palette.setColor(QPalette::Button, diffuse); + diffuseButton->setPalette(palette); + palette.setColor(QPalette::Button, specular); + specularButton->setPalette(palette); + }); + } +private Q_SLOTS: + void diffuse_changed() + { + diffuse = diffuse_dial.currentColor(); + s_diffuse_changed(); + } + void ambient_changed() + { + ambient = ambient_dial.currentColor(); + s_ambient_changed(); + } + void specular_changed() + { + specular = spec_dial.currentColor(); + s_specular_changed(); + } +Q_SIGNALS: + void s_diffuse_changed(); + void s_ambient_changed(); + void s_specular_changed(); +private: + QColorDialog diffuse_dial; + QColorDialog ambient_dial; + QColorDialog spec_dial; +}; + Viewer::Viewer(QWidget* parent, bool antialiasing) : CGAL::Three::Viewer_interface(parent) { d = new Viewer_impl; + QSettings viewer_settings; + // enable anti-aliasing + QString cam_pos = viewer_settings.value("cam_pos", QString("0.0,0.0,1.0")).toString(); + d->position = QVector4D(cam_pos.split(",").at(0).toFloat(), + cam_pos.split(",").at(1).toFloat(), + cam_pos.split(",").at(2).toFloat(), + 1.0f); + + QString ambient = viewer_settings.value("ambient", QString("0.4,0.4,0.4")).toString(); + d->ambient = QVector4D(ambient.split(",").at(0).toFloat(), + ambient.split(",").at(1).toFloat(), + ambient.split(",").at(2).toFloat(), + 1.0f); + + QString diffuse = viewer_settings.value("diffuse", QString("1.0,1.0,1.0")).toString(); + d->diffuse = QVector4D(diffuse.split(",").at(0).toFloat(), + diffuse.split(",").at(1).toFloat(), + diffuse.split(",").at(2).toFloat(), + 1.0f); + + QString specular = viewer_settings.value("specular", QString("0.0,0.0,0.0")).toString(); + d->specular = QVector4D(specular.split(",").at(0).toFloat(), + specular.split(",").at(1).toFloat(), + specular.split(",").at(2).toFloat(), + 1.0f); + + d->spec_power = viewer_settings.value("spec_power", 51.8).toFloat(); d->scene = 0; d->projection_is_ortho = false; d->initialized = false; @@ -105,7 +255,6 @@ Viewer::Viewer(QWidget* parent, bool antialiasing) d->shader_programs.resize(NB_OF_PROGRAMS); d->textRenderer = new TextRenderer(); d->is_2d_selection_mode = false; - d->total_pass = 4; connect( d->textRenderer, SIGNAL(sendMessage(QString,int)), this, SLOT(printMessage(QString,int)) ); @@ -140,8 +289,12 @@ Viewer::Viewer(QWidget* parent, bool antialiasing) tr("Selects a point. When the second point is selected, " "displays the two points and the distance between them.")); setMouseBindingDescription(Qt::Key_O, Qt::NoModifier, Qt::LeftButton, - tr("Move the camera orthogonally to the picked facet of a Scene_polyhedron_item or " + tr("Move the camera orthogonally to the picked facet of a Scene_surface_mesh_item or " "to the current selection of a Scene_points_with_normal_item.")); + setKeyDescription(Qt::Key_F5, + tr("Reloads the selected item if possible.")); + setKeyDescription(Qt::Key_F11, + tr("Toggle the viewer's fullscreen mode.")); prev_radius = sceneRadius(); d->has_text = false; @@ -155,6 +308,29 @@ Viewer::Viewer(QWidget* parent, bool antialiasing) Viewer::~Viewer() { + QSettings viewer_settings; + viewer_settings.setValue("cam_pos", + QString("%1,%2,%3") + .arg(d->position.x()) + .arg(d->position.y()) + .arg(d->position.z())); + viewer_settings.setValue("ambient", + QString("%1,%2,%3") + .arg(d->ambient.x()) + .arg(d->ambient.y()) + .arg(d->ambient.z())); + viewer_settings.setValue("diffuse", + QString("%1,%2,%3") + .arg(d->diffuse.x()) + .arg(d->diffuse.y()) + .arg(d->diffuse.z())); + viewer_settings.setValue("specular", + QString("%1,%2,%3") + .arg(d->specular.x()) + .arg(d->specular.y()) + .arg(d->specular.z())); + viewer_settings.setValue("spec_power", + d->spec_power); delete d; } @@ -245,9 +421,10 @@ void Viewer::init() } else d->extension_is_found = true; - - - setBackgroundColor(::Qt::white); + QSettings settings; + QString colorname = settings.value("background_color", "#ffffff").toString(); + QColor bc(colorname); + setBackgroundColor(bc); d->vao.create(); d->buffer.create(); @@ -639,16 +816,13 @@ void Viewer::attribBuffers(int program_name) const { for (int i=0; i<16; ++i) mvp_mat.data()[i] = GLfloat(d_mat[i]); - QVector4D position(0.0f,0.0f,1.0f, 1.0f ); - QVector4D ambient(0.4f, 0.4f, 0.4f, 0.4f); - // Diffuse - QVector4D diffuse(1.0f, 1.0f, 1.0f, 1.0f); - // Specular - QVector4D specular(0.0f, 0.0f, 0.0f, 1.0f); QOpenGLShaderProgram* program = getShaderProgram(program_name); program->bind(); program->setUniformValue("point_size", getGlPointSize()); program->setUniformValue("mvp_matrix", mvp_mat); + QMatrix4x4 id_mat; + id_mat.setToIdentity(); + program->setUniformValue("f_matrix", id_mat); program->setUniformValue("is_clipbox_on", d->clipping); if(d->clipping) { @@ -662,6 +836,10 @@ void Viewer::attribBuffers(int program_name) const { program->setUniformValue("clipbox1", clipbox1); program->setUniformValue("clipbox2", clipbox2); } + QVector4D light_pos(d->position.x(), + d->position.y(), + d->position.z(), + 1.0f); switch(program_name) { case PROGRAM_WITH_LIGHT: @@ -670,6 +848,7 @@ void Viewer::attribBuffers(int program_name) const { program->setUniformValue("alpha", 1.0f); //overriden in item draw() if necessary } + switch(program_name) { case PROGRAM_WITH_LIGHT: @@ -681,11 +860,11 @@ void Viewer::attribBuffers(int program_name) const { case PROGRAM_SPHERES: case PROGRAM_OLD_FLAT: case PROGRAM_FLAT: - program->setUniformValue("light_pos", position); - program->setUniformValue("light_diff",diffuse); - program->setUniformValue("light_spec", specular); - program->setUniformValue("light_amb", ambient); - program->setUniformValue("spec_power", 51.8f); + program->setUniformValue("light_pos", light_pos); + program->setUniformValue("light_diff",d->diffuse); + program->setUniformValue("light_spec", d->specular); + program->setUniformValue("light_amb", d->ambient); + program->setUniformValue("spec_power", d->spec_power); program->setUniformValue("is_two_side", d->twosides); break; } @@ -897,6 +1076,7 @@ QOpenGLShaderProgram* Viewer::getShaderProgram(int name) const program->setProperty("hasLight", true); program->setProperty("hasNormals", true); program->setProperty("hasTransparency", true); + program->setProperty("hasFMatrix", true); return program; } case PROGRAM_WITHOUT_LIGHT: @@ -1291,15 +1471,6 @@ void Viewer::setTotalPass(int p) update(); } -void Viewer::setTotalPass_clicked() -{ - bool ok; - int passes = QInputDialog::getInt(0, QString("Set Number of Passes"), QString("Number of Depth Peeling Passes: "), 4, 2,100, 1, &ok); - if(!ok) - return; - setTotalPass(passes); -} - void Viewer::messageLogged(QOpenGLDebugMessage msg) { QString error; @@ -1365,7 +1536,112 @@ void Viewer::messageLogged(QOpenGLDebugMessage msg) qDebug() << qPrintable(error) << "\n" << qPrintable(msg.message()) << "\n"; } +void Viewer::setLighting() +{ + + //save current settings; + float prev_spec = d->spec_power; + QVector4D prev_pos = d->position; + QVector4D prev_ambient = d->ambient; + QVector4D prev_diffuse = d->diffuse; + QVector4D prev_spec_color = d->specular; + //open dialog + LightingDialog* dialog = new LightingDialog(d); + //set specular + connect(dialog->spec_powrSlider, &QSlider::valueChanged, + [this, dialog]() + { + d->spec_power = dialog->spec_powrSlider->value(); + update(); + }); + //set position + connect(dialog->position_lineEdit, &QLineEdit::editingFinished, + [this, dialog]() + { + QStringList list = dialog->position_lineEdit->text().split(QRegExp(","), QString::SkipEmptyParts); + if (list.isEmpty()) return; + if (list.size()!=3){ + QMessageBox *msgBox = new QMessageBox; + msgBox->setWindowTitle("Error"); + msgBox->setText("ERROR : Input should consists of 3 floats."); + msgBox->exec(); + return; + } + double coords[3]; + for(int j=0; j<3; ++j) + { + bool ok; + coords[j] = list.at(j).toFloat(&ok); + if(!ok) + { + QMessageBox *msgBox = new QMessageBox; + msgBox->setWindowTitle("Error"); + msgBox->setText("ERROR : Coordinates are invalid."); + msgBox->exec(); + return; + } + } + d->position = QVector4D(coords[0], coords[1], coords[2], 1.0f); + update(); + }); + + + //set ambient + connect(dialog, &LightingDialog::s_ambient_changed, + [this, dialog](){ + d->ambient=QVector4D(dialog->ambient.redF(), + dialog->ambient.greenF(), + dialog->ambient.blueF(), + 1.0f); + update(); + }); + + //set diffuse + connect(dialog, &LightingDialog::s_diffuse_changed, + [this, dialog](){ + d->diffuse=QVector4D(dialog->diffuse.redF(), + dialog->diffuse.greenF(), + dialog->diffuse.blueF(), + 1.0f); + update(); + }); + //set specular + connect(dialog, &LightingDialog::s_specular_changed, + [this, dialog](){ + d->specular=QVector4D(dialog->specular.redF() , + dialog->specular.greenF(), + dialog->specular.blueF() , + 1.0f); + update(); + + }); + + //reset default + connect(dialog->buttonBox->button(QDialogButtonBox::StandardButton::RestoreDefaults), &QPushButton::clicked, + [this](){ + d->position = QVector4D(0,0,1,1); + d->ambient=QVector4D(77.0/255,77.0/255,77.0/255, 1.0); + d->diffuse=QVector4D(204.0/255,204.0/255,204.0/255,1.0); + d->specular=QVector4D(0,0,0,1.0); + d->spec_power = 51; + update(); + + }); + if(!dialog->exec()) + { + //restore previous settings + d->spec_power = prev_spec; + d->position = prev_pos; + d->ambient = prev_ambient; + d->diffuse = prev_diffuse; + d->specular = prev_spec_color; + return; + } +} + void Viewer::setGlPointSize(const GLfloat &p) { d->gl_point_size = p; } const GLfloat& Viewer::getGlPointSize() const { return d->gl_point_size; } +#include "Viewer.moc" + diff --git a/Polyhedron/demo/Polyhedron/Viewer.h b/Polyhedron/demo/Polyhedron/Viewer.h index 582983de04c..d86acdeb212 100644 --- a/Polyhedron/demo/Polyhedron/Viewer.h +++ b/Polyhedron/demo/Polyhedron/Viewer.h @@ -94,7 +94,7 @@ public Q_SLOTS: //! If b is true, facets will be ligted from both internal and external sides. //! If b is false, only the side that is exposed to the light source will be lighted. void setTwoSides(bool b) Q_DECL_OVERRIDE; - void SetOrthoProjection( bool b); + void SetOrthoProjection( bool b) Q_DECL_OVERRIDE; //! If b is true, some items are displayed in a simplified version when moving the camera. //! If b is false, items display is never altered, even when moving. void setFastDrawing(bool b) Q_DECL_OVERRIDE; @@ -114,12 +114,13 @@ public Q_SLOTS: { setMouseBinding(::Qt::ShiftModifier, ::Qt::LeftButton, CGAL::qglviewer::SELECT); } - //!Prompt a dialog to set the number of passes for the transparency. - void setTotalPass_clicked(); virtual void setNoBinding() Q_DECL_OVERRIDE { setMouseBinding(::Qt::ShiftModifier, ::Qt::LeftButton, CGAL::qglviewer::NO_CLICK_ACTION); } + + void setLighting(); + void messageLogged(QOpenGLDebugMessage); protected: diff --git a/Polyhedron/demo/Polyhedron/cgal_test_with_cmake b/Polyhedron/demo/Polyhedron/cgal_test_with_cmake index 740946b6ccc..0b7ad915e26 100755 --- a/Polyhedron/demo/Polyhedron/cgal_test_with_cmake +++ b/Polyhedron/demo/Polyhedron/cgal_test_with_cmake @@ -26,7 +26,7 @@ configure() { echo "Configuring... " - if eval 'cmake --no-warn-unused-cli "$CMAKE_GENERATOR" -DRUNNING_CGAL_AUTO_TEST=TRUE \ + if eval 'cmake --no-warn-unused-cli ${INIT_FILE:+"-C${INIT_FILE}"} "$CMAKE_GENERATOR" -DRUNNING_CGAL_AUTO_TEST=TRUE \ -DCGAL_DIR="$CGAL_DIR" \ .' ; then diff --git a/Polyhedron/demo/Polyhedron/implicit_functions/CMakeLists.txt b/Polyhedron/demo/Polyhedron/implicit_functions/CMakeLists.txt index 4b2382a5315..47dfb9ba3d3 100644 --- a/Polyhedron/demo/Polyhedron/implicit_functions/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/implicit_functions/CMakeLists.txt @@ -18,7 +18,6 @@ include_directories( BEFORE ${Mesh_3_implicit_functions_BINARY_DIR} ../include ) # Find CGAL and CGAL Qt5 find_package(CGAL COMPONENTS Qt5) -include( ${CGAL_USE_FILE} ) # Find Qt5 itself set( QT_USE_QTXML TRUE ) diff --git a/Polyhedron/demo/Polyhedron/include/CGAL/Dualizer.h b/Polyhedron/demo/Polyhedron/include/CGAL/Dualizer.h index 5b1eb889b01..d9814cc84eb 100644 --- a/Polyhedron/demo/Polyhedron/include/CGAL/Dualizer.h +++ b/Polyhedron/demo/Polyhedron/include/CGAL/Dualizer.h @@ -2,7 +2,7 @@ #define _DUALIZER_ #include - +#include template struct Facet_cmp { diff --git a/Polyhedron/demo/Polyhedron/include/CGAL/statistics_helpers.h b/Polyhedron/demo/Polyhedron/include/CGAL/statistics_helpers.h index e87c838848f..d0449e819b5 100644 --- a/Polyhedron/demo/Polyhedron/include/CGAL/statistics_helpers.h +++ b/Polyhedron/demo/Polyhedron/include/CGAL/statistics_helpers.h @@ -1,7 +1,8 @@ #ifndef POLYHEDRON_DEMO_STATISTICS_HELPERS_H #define POLYHEDRON_DEMO_STATISTICS_HELPERS_H -#include +#include +#include #include #include @@ -9,10 +10,13 @@ #include #include #include -#include -#include #include +#include +#include +#include +#include +#include template void angles(Mesh* poly, double& mini, double& maxi, double& ave) @@ -81,19 +85,15 @@ void edges_length(Mesh* poly, mid = extract_result< tag::median >(acc); } -template -unsigned int nb_degenerate_faces(Mesh* poly, VPmap vpmap) +template +unsigned int nb_degenerate_faces(Mesh* poly) { typedef typename boost::graph_traits::face_descriptor face_descriptor; - typedef typename CGAL::Kernel_traits< typename boost::property_traits::value_type >::Kernel Traits; - unsigned int nb = 0; - BOOST_FOREACH(face_descriptor f, faces(*poly)) - { - if (CGAL::is_degenerate_triangle_face(f, *poly, vpmap, Traits())) - ++nb; - } - return nb; + std::vector degenerate_faces; + CGAL::Polygon_mesh_processing::degenerate_faces(*poly, std::back_inserter(degenerate_faces)); + + return static_cast(degenerate_faces.size()); } template diff --git a/Polyhedron/demo/Polyhedron/include/id_printing.h b/Polyhedron/demo/Polyhedron/include/id_printing.h index f195eb97f53..60b47de964e 100644 --- a/Polyhedron/demo/Polyhedron/include/id_printing.h +++ b/Polyhedron/demo/Polyhedron/include/id_printing.h @@ -7,7 +7,7 @@ #include #include #include - +#define POINT_SIZE 11 template struct VKRingPMAP{ typedef typename boost::graph_traits::vertex_descriptor key_type; @@ -206,6 +206,7 @@ void compute_displayed_ids(Mesh& mesh, QFont font; font.setBold(true); + font.setPointSize(POINT_SIZE); std::vector displayed_vertices; std::vector displayed_edges; std::vector displayed_faces; @@ -414,6 +415,7 @@ bool printVertexIds(const Mesh& mesh, const CGAL::qglviewer::Vec offset = viewer->offset(); QFont font; font.setBold(true); + font.setPointSize(POINT_SIZE); //fills textItems BOOST_FOREACH(typename boost::graph_traits::vertex_descriptor vh, vertices(mesh)) @@ -449,7 +451,8 @@ bool printEdgeIds(const Mesh& mesh, const CGAL::qglviewer::Vec offset = viewer->offset(); QFont font; font.setBold(true); - + font.setPointSize(POINT_SIZE); + BOOST_FOREACH(typename boost::graph_traits::edge_descriptor e, edges(mesh)) { const Point& p1 = get(ppmap, source(e, mesh)); @@ -482,6 +485,7 @@ bool printFaceIds(const Mesh& mesh, const CGAL::qglviewer::Vec offset = viewer->offset(); QFont font; font.setBold(true); + font.setPointSize(POINT_SIZE); BOOST_FOREACH(typename boost::graph_traits::face_descriptor fh, faces(mesh)) { double x(0), y(0), z(0); @@ -623,10 +627,10 @@ int zoomToId(const Mesh& mesh, CGAL::qglviewer::Quaternion new_orientation(CGAL::qglviewer::Vec(0,0,-1), CGAL::qglviewer::Vec(-normal.x(), -normal.y(), -normal.z())); Point new_pos = p + - CGAL::qglviewer::Vec( - viewer->camera()->position().x - viewer->camera()->sceneCenter().x, - viewer->camera()->position().y - viewer->camera()->sceneCenter().y, - viewer->camera()->position().z - viewer->camera()->sceneCenter().z) + 0.25*CGAL::qglviewer::Vec( + viewer->camera()->position().x - viewer->camera()->pivotPoint().x, + viewer->camera()->position().y - viewer->camera()->pivotPoint().y, + viewer->camera()->position().z - viewer->camera()->pivotPoint().z) .norm() * normal ; viewer->camera()->setPivotPoint(CGAL::qglviewer::Vec(p.x(), diff --git a/Polyhedron/demo/Polyhedron/resources/shader_c3t3.f b/Polyhedron/demo/Polyhedron/resources/shader_c3t3.f index 76895e0b5e0..ee93e450002 100644 --- a/Polyhedron/demo/Polyhedron/resources/shader_c3t3.f +++ b/Polyhedron/demo/Polyhedron/resources/shader_c3t3.f @@ -17,6 +17,7 @@ uniform bool comparing; uniform bool writing; uniform sampler2D sampler; uniform float alpha; +uniform bool is_surface; out vec4 out_color; float depth(float z) @@ -33,7 +34,7 @@ void main(void) { out_color = vec4(d,d,d,1.0); else { - if(color.w<0) + if(color.w<0 || is_surface) { vec4 my_color = vec4(color.xyz, 1.); diff --git a/Polyhedron/demo/Polyhedron/resources/shader_c3t3_edges.f b/Polyhedron/demo/Polyhedron/resources/shader_c3t3_edges.f index 1ab482fd9d8..81366aefa9f 100644 --- a/Polyhedron/demo/Polyhedron/resources/shader_c3t3_edges.f +++ b/Polyhedron/demo/Polyhedron/resources/shader_c3t3_edges.f @@ -1,9 +1,10 @@ #version 150 in vec4 color; +uniform bool is_surface; out vec4 out_color; void main(void) { - if(color.w<0) + if(color.w<0 || is_surface) out_color = vec4(0,0,0,1.0); else discard; diff --git a/Polyhedron/demo/Polyhedron/resources/shader_with_light.v b/Polyhedron/demo/Polyhedron/resources/shader_with_light.v index 3ea1ce9c925..47a9c7666be 100644 --- a/Polyhedron/demo/Polyhedron/resources/shader_with_light.v +++ b/Polyhedron/demo/Polyhedron/resources/shader_with_light.v @@ -4,6 +4,7 @@ in vec3 normals; in vec4 colors; uniform mat4 mvp_matrix; uniform mat4 mv_matrix; +uniform mat4 f_matrix; out vec4 fP; out vec3 fN; out vec4 color; @@ -38,11 +39,11 @@ void main(void) // if(is_clipbox_on) compute_distances(); - fP = mv_matrix * vertex; + fP = mv_matrix * f_matrix * vertex; mat3 mv_matrix_3; mv_matrix_3[0] = mv_matrix[0].xyz; mv_matrix_3[1] = mv_matrix[1].xyz; mv_matrix_3[2] = mv_matrix[2].xyz; fN = mv_matrix_3* normals; - gl_Position = mvp_matrix * vertex; + gl_Position = mvp_matrix * f_matrix * vertex; } diff --git a/Polyhedron/demo/Polyhedron/resources/solid_wireframe_shader.f b/Polyhedron/demo/Polyhedron/resources/solid_wireframe_shader.f index 45e1ab1c534..9bc57a0ee5d 100644 --- a/Polyhedron/demo/Polyhedron/resources/solid_wireframe_shader.f +++ b/Polyhedron/demo/Polyhedron/resources/solid_wireframe_shader.f @@ -3,13 +3,30 @@ in GS_OUT { vec4 color; + float dist[6]; } fs_in; uniform float width; +uniform bool is_selected; +uniform bool is_clipbox_on; + out vec4 out_color; void main(void) { - out_color = fs_in.color; + if(is_clipbox_on) + { + if(fs_in.dist[0]>0.0 || + fs_in.dist[1]>0.0 || + fs_in.dist[2]>0.0 || + fs_in.dist[3]>0.0 || + fs_in.dist[4]>0.0 || + fs_in.dist[5]>0.0) + discard; + else + out_color = fs_in.color; + } + else + out_color = fs_in.color; } diff --git a/Polyhedron/demo/Polyhedron/resources/solid_wireframe_shader.g b/Polyhedron/demo/Polyhedron/resources/solid_wireframe_shader.g index 6a52bbc7245..69fa97d8062 100644 --- a/Polyhedron/demo/Polyhedron/resources/solid_wireframe_shader.g +++ b/Polyhedron/demo/Polyhedron/resources/solid_wireframe_shader.g @@ -6,6 +6,7 @@ layout (triangle_strip, max_vertices = 4) out; in VS_OUT { vec4 out_color; + float dist[6]; } gs_in[2]; uniform vec2 viewport; @@ -16,11 +17,13 @@ uniform float far; out GS_OUT { vec4 color; + float dist[6]; } gs_out; void main(void) { + ; //linearized arbitrary Z offset to keep the widelines in front of the edges as much as possible float z_offset = (2.0 * near) / (far + near - 0.01f * (far - near)) - (2.0 * near) / (far + near); vec3 ndc0 = gl_in[0].gl_Position.xyz / gl_in[0].gl_Position.w; @@ -33,21 +36,25 @@ void main(void) vec4 cpos = gl_in[0].gl_Position; gl_Position = vec4(cpos.xy + offset*cpos.w, cpos.z-z_offset, cpos.w); gs_out.color = gs_in[0].out_color; + gs_out.dist = gs_in[0].dist; EmitVertex(); cpos = gl_in[0].gl_Position; gl_Position = vec4(cpos.xy - offset*cpos.w, cpos.z-z_offset, cpos.w); gs_out.color = gs_in[0].out_color; + gs_out.dist = gs_in[0].dist; EmitVertex(); cpos = gl_in[1].gl_Position; gl_Position = vec4(cpos.xy + offset*cpos.w, cpos.z-z_offset, cpos.w); gs_out.color = gs_in[1].out_color; + gs_out.dist = gs_in[1].dist; EmitVertex(); cpos = gl_in[1].gl_Position; gl_Position = vec4(cpos.xy - offset*cpos.w, cpos.z-z_offset, cpos.w); gs_out.color = gs_in[1].out_color; + gs_out.dist = gs_in[1].dist; EmitVertex(); EndPrimitive(); diff --git a/Polyhedron/demo/Polyhedron/resources/solid_wireframe_shader.v b/Polyhedron/demo/Polyhedron/resources/solid_wireframe_shader.v index ca1e2205f40..29c9aa06791 100644 --- a/Polyhedron/demo/Polyhedron/resources/solid_wireframe_shader.v +++ b/Polyhedron/demo/Polyhedron/resources/solid_wireframe_shader.v @@ -5,14 +5,38 @@ in vec4 colors; uniform mat4 mvp_matrix; uniform mat4 f_matrix; +uniform bool is_clipbox_on; +uniform mat4 clipbox1; +uniform mat4 clipbox2; out VS_OUT { vec4 out_color; + float dist[6]; }vs_out; + +void compute_distances(void) +{ + for(int i=0; i<3; ++i) + { + vs_out.dist[i]= + clipbox1[i][0]*vertex.x+ + clipbox1[i][1]*vertex.y+ + clipbox1[i][2]*vertex.z + + clipbox1[i][3]; + vs_out.dist[i+3]= + clipbox2[i][0]*vertex.x+ + clipbox2[i][1]*vertex.y+ + clipbox2[i][2]*vertex.z + + clipbox2[i][3]; + } +} + void main(void) { + if(is_clipbox_on) + compute_distances(); gl_Position = mvp_matrix * f_matrix * vertex; vs_out.out_color = colors; } diff --git a/Polyhedron/demo/Polyhedron/triangulate_primitive.h b/Polyhedron/demo/Polyhedron/triangulate_primitive.h index 0d5e2c915eb..3aef6f90499 100644 --- a/Polyhedron/demo/Polyhedron/triangulate_primitive.h +++ b/Polyhedron/demo/Polyhedron/triangulate_primitive.h @@ -127,7 +127,8 @@ private: BOOST_FOREACH(PointAndId idPoint, idPoints) { - x += idPoint.point.x(); + + x += idPoint.point.x(); y += idPoint.point.y(); z += idPoint.point.z(); typename CDT::Vertex_handle vh; diff --git a/Polyhedron/doc/Polyhedron/CGAL/Polyhedron_3.h b/Polyhedron/doc/Polyhedron/CGAL/Polyhedron_3.h index 7d7b22d075f..47811036fd6 100644 --- a/Polyhedron/doc/Polyhedron/CGAL/Polyhedron_3.h +++ b/Polyhedron/doc/Polyhedron/CGAL/Polyhedron_3.h @@ -1,7 +1,7 @@ namespace CGAL { /*! - \ingroup PkgPolyhedron + \ingroup PkgPolyhedronRef A polyhedral surface `Polyhedron_3` consists of vertices `V`, edges `E`, facets `F` and an incidence relation on them. Each edge is @@ -114,7 +114,7 @@ class Polyhedron_3 { public: /*! - \ingroup PkgPolyhedron + \ingroup PkgPolyhedronRef A halfedge is an oriented edge between two vertices. It is always paired with a halfedge pointing in @@ -423,7 +423,7 @@ public: }; /* end Halfedge */ /*! - \ingroup PkgPolyhedron + \ingroup PkgPolyhedronRef A facet optionally stores a plane equation, and a reference to an incident halfedge that points to the facet. Type tags indicate whether @@ -600,7 +600,7 @@ public: }; /* end Facet */ /*! - \ingroup PkgPolyhedron + \ingroup PkgPolyhedronRef A vertex optionally stores a point and a reference to an incident halfedge that points to the vertex. Type tags indicate whether these diff --git a/Polyhedron/doc/Polyhedron/CGAL/Polyhedron_incremental_builder_3.h b/Polyhedron/doc/Polyhedron/CGAL/Polyhedron_incremental_builder_3.h index dc62a2a620f..8fbea2f7893 100644 --- a/Polyhedron/doc/Polyhedron/CGAL/Polyhedron_incremental_builder_3.h +++ b/Polyhedron/doc/Polyhedron/CGAL/Polyhedron_incremental_builder_3.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgPolyhedron +\ingroup PkgPolyhedronRef The auxiliary class `Polyhedron_incremental_builder_3` supports the incremental construction of polyhedral surfaces, which is for example convenient diff --git a/Polyhedron/doc/Polyhedron/CGAL/Polyhedron_items_3.h b/Polyhedron/doc/Polyhedron/CGAL/Polyhedron_items_3.h index a67ea634e7d..c4a2108545c 100644 --- a/Polyhedron/doc/Polyhedron/CGAL/Polyhedron_items_3.h +++ b/Polyhedron/doc/Polyhedron/CGAL/Polyhedron_items_3.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgPolyhedron +\ingroup PkgPolyhedronRef The class `Polyhedron_items_3` is a model of the `PolyhedronItems_3` concept. It provides definitions for vertices with points, halfedges, diff --git a/Polyhedron/doc/Polyhedron/CGAL/Polyhedron_min_items_3.h b/Polyhedron/doc/Polyhedron/CGAL/Polyhedron_min_items_3.h index 122d5d5ff96..441aaba4277 100644 --- a/Polyhedron/doc/Polyhedron/CGAL/Polyhedron_min_items_3.h +++ b/Polyhedron/doc/Polyhedron/CGAL/Polyhedron_min_items_3.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgPolyhedron +\ingroup PkgPolyhedronRef The class `Polyhedron_min_items_3` is a minimal model of the `PolyhedronItems_3` concept. It provides definitions for vertices diff --git a/Polyhedron/doc/Polyhedron/CGAL/Polyhedron_traits_3.h b/Polyhedron/doc/Polyhedron/CGAL/Polyhedron_traits_3.h index 68df4c08d0d..b112413c0b6 100644 --- a/Polyhedron/doc/Polyhedron/CGAL/Polyhedron_traits_3.h +++ b/Polyhedron/doc/Polyhedron/CGAL/Polyhedron_traits_3.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgPolyhedron +\ingroup PkgPolyhedronRef The class `Polyhedron_traits_3` is a model of the `PolyhedronTraits_3` concept. It defines the geometric types and primitive operations used diff --git a/Polyhedron/doc/Polyhedron/CGAL/Polyhedron_traits_with_normals_3.h b/Polyhedron/doc/Polyhedron/CGAL/Polyhedron_traits_with_normals_3.h index ab00f7f5e17..a99b689b63b 100644 --- a/Polyhedron/doc/Polyhedron/CGAL/Polyhedron_traits_with_normals_3.h +++ b/Polyhedron/doc/Polyhedron/CGAL/Polyhedron_traits_with_normals_3.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgPolyhedron +\ingroup PkgPolyhedronRef The class `Polyhedron_traits_with_normals_3` is a model of the `PolyhedronTraits_3` concept. It defines the geometric types and primitive operations used diff --git a/Polyhedron/doc/Polyhedron/PackageDescription.txt b/Polyhedron/doc/Polyhedron/PackageDescription.txt index 05972f40034..49bae0c3535 100644 --- a/Polyhedron/doc/Polyhedron/PackageDescription.txt +++ b/Polyhedron/doc/Polyhedron/PackageDescription.txt @@ -1,9 +1,9 @@ -/// \defgroup PkgPolyhedron 3D Polyhedral Surface Reference +/// \defgroup PkgPolyhedronRef 3D Polyhedral Surface Reference /// \defgroup PkgPolyhedronConcepts Concepts -/// \ingroup PkgPolyhedron +/// \ingroup PkgPolyhedronRef /// \defgroup PkgPolyhedronIOFunc I/O Functions -/// \ingroup PkgPolyhedron +/// \ingroup PkgPolyhedronRef /*! Draw. \code @@ -11,21 +11,21 @@ \endcode */ /// \defgroup PkgDrawPolyhedron Draw a Polyhedron 3 -/// \ingroup PkgPolyhedron +/// \ingroup PkgPolyhedronRef /*! -\addtogroup PkgPolyhedron +\addtogroup PkgPolyhedronRef \todo check generated documentation -\cgalPkgDescriptionBegin{3D Polyhedral Surface,PkgPolyhedronSummary} +\cgalPkgDescriptionBegin{3D Polyhedral Surface,PkgPolyhedron} \cgalPkgPicture{Polyhedron-teaser-small.png} \cgalPkgSummaryBegin \cgalPkgAuthor{Lutz Kettner} \cgalPkgDesc{Polyhedral surfaces in three dimensions are composed of vertices, edges, facets and an incidence relationship on them. The organization beneath is a halfedge data structure, which restricts the class of representable surfaces to orientable 2-manifolds - with and without boundary. If the surface is closed we call it a polyhedron.} -\cgalPkgManuals{Chapter_3D_Polyhedral_Surfaces,PkgPolyhedron} +\cgalPkgManuals{Chapter_3D_Polyhedral_Surfaces,PkgPolyhedronRef} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{1.0} -\cgalPkgDependsOn{\ref PkgHDSSummary} +\cgalPkgDependsOn{\ref PkgHalfedgeDS} \cgalPkgBib{cgal:k-ps} \cgalPkgLicense{\ref licensesGPL "GPL"} \cgalPkgDemo{Polyhedron demo,polyhedron_3.zip} diff --git a/Polyhedron/examples/Polyhedron/CMakeLists.txt b/Polyhedron/examples/Polyhedron/CMakeLists.txt index d191da8a473..c190c02a009 100644 --- a/Polyhedron/examples/Polyhedron/CMakeLists.txt +++ b/Polyhedron/examples/Polyhedron/CMakeLists.txt @@ -19,13 +19,6 @@ endif() if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Polyhedron/include/CGAL/draw_polyhedron.h b/Polyhedron/include/CGAL/draw_polyhedron.h index b8464757097..52dc930075d 100644 --- a/Polyhedron/include/CGAL/draw_polyhedron.h +++ b/Polyhedron/include/CGAL/draw_polyhedron.h @@ -148,41 +148,42 @@ protected: } protected: - typename Kernel::Vector_3 get_face_normal(Halfedge_const_handle he) + Local_vector get_face_normal(Halfedge_const_handle he) { - typename Kernel::Vector_3 normal=CGAL::NULL_VECTOR; + Local_vector normal=CGAL::NULL_VECTOR; Halfedge_const_handle end=he; unsigned int nb=0; do { - internal::newell_single_step_3(he->vertex()->point(), - he->next()->vertex()->point(), - normal); + internal::newell_single_step_3 + (internal::Geom_utils::get_local_point(he->vertex()->point()), + internal::Geom_utils::get_local_point(he->next()->vertex()->point()), + normal); ++nb; he=he->next(); } while (he!=end); assert(nb>0); - return (typename Kernel::Construct_scaled_vector_3()(normal, 1.0/nb)); + return (typename Local_kernel::Construct_scaled_vector_3()(normal, 1.0/nb)); } - typename Kernel::Vector_3 get_vertex_normal(Halfedge_const_handle he) + Local_vector get_vertex_normal(Halfedge_const_handle he) { - typename Kernel::Vector_3 normal=CGAL::NULL_VECTOR; + Local_vector normal=CGAL::NULL_VECTOR; Halfedge_const_handle end=he; do { if (!he->is_border()) { - typename Kernel::Vector_3 n=get_face_normal(he); - normal=typename Kernel::Construct_sum_of_vectors_3()(normal, n); + Local_vector n=get_face_normal(he); + normal=typename Local_kernel::Construct_sum_of_vectors_3()(normal, n); } he=he->next()->opposite(); } while (he!=end); - if (!typename Kernel::Equal_3()(normal, CGAL::NULL_VECTOR)) - { normal=(typename Kernel::Construct_scaled_vector_3() + if (!typename Local_kernel::Equal_3()(normal, CGAL::NULL_VECTOR)) + { normal=(typename Local_kernel::Construct_scaled_vector_3() (normal, 1.0/CGAL::sqrt(normal.squared_length()))); } return normal; diff --git a/Polyhedron/test/Polyhedron/CMakeLists.txt b/Polyhedron/test/Polyhedron/CMakeLists.txt index 8baa47b9112..31d0d094a97 100644 --- a/Polyhedron/test/Polyhedron/CMakeLists.txt +++ b/Polyhedron/test/Polyhedron/CMakeLists.txt @@ -4,18 +4,12 @@ project( Polyhedron_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Polyhedron_IO/demo/Polyhedron_IO/CMakeLists.txt b/Polyhedron_IO/demo/Polyhedron_IO/CMakeLists.txt index 416191162c8..c87775195e5 100644 --- a/Polyhedron_IO/demo/Polyhedron_IO/CMakeLists.txt +++ b/Polyhedron_IO/demo/Polyhedron_IO/CMakeLists.txt @@ -16,10 +16,6 @@ find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - create_single_source_cgal_program( "geomview_demo.cpp" ) create_single_source_cgal_program( "viewpoint2off.cpp" ) diff --git a/Polyhedron_IO/examples/Polyhedron_IO/CMakeLists.txt b/Polyhedron_IO/examples/Polyhedron_IO/CMakeLists.txt index 40574a8be20..d2f8d510146 100644 --- a/Polyhedron_IO/examples/Polyhedron_IO/CMakeLists.txt +++ b/Polyhedron_IO/examples/Polyhedron_IO/CMakeLists.txt @@ -4,18 +4,12 @@ project( Polyhedron_IO_Examples ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Polyhedron_IO/include/CGAL/IO/OFF_reader.h b/Polyhedron_IO/include/CGAL/IO/OFF_reader.h index 17741fe1933..d1d5ddf502c 100644 --- a/Polyhedron_IO/include/CGAL/IO/OFF_reader.h +++ b/Polyhedron_IO/include/CGAL/IO/OFF_reader.h @@ -21,6 +21,7 @@ #define CGAL_IO_OFF_READER_H #include +#include #include #include @@ -28,33 +29,7 @@ #include #include -namespace CGAL{ - - namespace read_OFF_internal{ - template - void fill_point(double x, double y, double z, Point_3& pt) - { - pt = Point_3(x, y, z); - } - - void fill_point(double x, double y, double z, CGAL::cpp11::array& p) - { - p = CGAL::make_array(x,y,z); - } - - template - void resize(Polygon_3& p, std::size_t size) - { - p.resize(size); - } - - template - void resize(CGAL::cpp11::array&, std::size_t size) - { - CGAL_USE(size); - CGAL_assertion( size>=N ); - } - } +namespace CGAL { template bool @@ -71,7 +46,7 @@ namespace CGAL{ double x, y, z, w; scanner.scan_vertex( x, y, z, w); CGAL_assertion(w!=0); - read_OFF_internal::fill_point( x/w, y/w, z/w, points[i] ); + IO::internal::fill_point( x/w, y/w, z/w, points[i] ); scanner.skip_to_next_vertex( i); } if(!in) @@ -81,7 +56,7 @@ namespace CGAL{ std::size_t no; scanner.scan_facet( no, i); - read_OFF_internal::resize(polygons[i], no); + IO::internal::resize(polygons[i], no); for(std::size_t j = 0; j < no; ++j) { std::size_t id; scanner.scan_facet_vertex_index(id, i); @@ -114,7 +89,7 @@ namespace CGAL{ double x, y, z, w; scanner.scan_vertex( x, y, z, w); CGAL_assertion(w!=0); - read_OFF_internal::fill_point( x/w, y/w, z/w, points[i] ); + IO::internal::fill_point( x/w, y/w, z/w, points[i] ); if(scanner.has_colors()) { unsigned char r=0, g=0, b=0; @@ -131,7 +106,7 @@ namespace CGAL{ std::size_t no; scanner.scan_facet( no, i); - read_OFF_internal::resize(polygons[i], no); + IO::internal::resize(polygons[i], no); for(std::size_t j = 0; j < no; ++j) { std::size_t id; scanner.scan_facet_vertex_index(id, i); diff --git a/Polyhedron_IO/include/CGAL/IO/STL_reader.h b/Polyhedron_IO/include/CGAL/IO/STL_reader.h index 5bf8cde0059..34f0938af36 100644 --- a/Polyhedron_IO/include/CGAL/IO/STL_reader.h +++ b/Polyhedron_IO/include/CGAL/IO/STL_reader.h @@ -21,8 +21,8 @@ #ifndef CGAL_IO_STL_READER_H #define CGAL_IO_STL_READER_H -#include #include +#include #include @@ -34,11 +34,12 @@ namespace CGAL { +template bool read_ASCII_facet(std::istream& input, - std::vector >& points, - std::vector >& facets, + std::vector& points, + std::vector& facets, int& index, - std::map, int >& index_map, + std::map& index_map, bool verbose = false) { // Here, we have already read the word 'facet' and are looking to read till 'endfacet' @@ -48,8 +49,10 @@ bool read_ASCII_facet(std::istream& input, endfacet("endfacet"); int count = 0; - cpp11::array p; - cpp11::array ijk; + double x,y,z; + Point p; + Triangle ijk; + IO::internal::resize(ijk, 3); while(input >> s) { @@ -76,7 +79,7 @@ bool read_ASCII_facet(std::istream& input, return false; } - if(!(input >> iformat(p[0]) >> iformat(p[1]) >> iformat(p[2]))) + if(!(input >> iformat(x) >> iformat(y) >> iformat(z))) { if(verbose) std::cerr << "Error while reading point coordinates (premature end of file)" << std::endl; @@ -85,8 +88,8 @@ bool read_ASCII_facet(std::istream& input, } else { - std::map, int>::iterator iti= - index_map.insert(std::make_pair(p, -1)).first; + IO::internal::fill_point(x, y, z, p); + typename std::map::iterator iti = index_map.insert(std::make_pair(p, -1)).first; if(iti->second == -1) { @@ -110,9 +113,10 @@ bool read_ASCII_facet(std::istream& input, return false; } +template bool parse_ASCII_STL(std::istream& input, - std::vector >& points, - std::vector >& facets, + std::vector& points, + std::vector& facets, bool verbose = false) { if(verbose) @@ -124,11 +128,9 @@ bool parse_ASCII_STL(std::istream& input, // Here, we have already read the word 'solid' int index = 0; - std::map, int> index_map; + std::map index_map; - std::string s; - std::string facet("facet"), - endsolid("endsolid"); + std::string s, facet("facet"), endsolid("endsolid"); while(input >> s) { @@ -149,9 +151,10 @@ bool parse_ASCII_STL(std::istream& input, return false; } +template bool parse_binary_STL(std::istream& input, - std::vector >& points, - std::vector >& facets, + std::vector& points, + std::vector& facets, bool verbose = false) { if(verbose) @@ -190,7 +193,7 @@ bool parse_binary_STL(std::istream& input, return true; // empty file int index = 0; - std::map, int> index_map; + std::map index_map; boost::uint32_t N32; if(!(input.read(reinterpret_cast(&N32), sizeof(N32)))) @@ -218,7 +221,8 @@ bool parse_binary_STL(std::istream& input, return false; } - cpp11::array ijk; + Triangle ijk; + IO::internal::resize(ijk, 3); for(int j=0; j<3; ++j) { @@ -233,11 +237,10 @@ bool parse_binary_STL(std::istream& input, return false; } - cpp11::array p; - p[0] = x; p[1] = y; p[2] = z; + Point p; + IO::internal::fill_point(x, y, z, p); - std::map, int>::iterator iti = - index_map.insert(std::make_pair(p, -1)).first; + typename std::map::iterator iti = index_map.insert(std::make_pair(p, -1)).first; if(iti->second == -1) { @@ -268,9 +271,29 @@ bool parse_binary_STL(std::istream& input, return true; } +// +// Read a file with `.stl` format. +// +// \tparam Point must be a model of the concept `RandomAccessContainer` or a %CGAL point type +// \tparam Triangle must be a model of the concept `RandomAccessContainer` +// +// \param input the input stream +// \param points a container that will contain the points used in the .stl file +// \param polygons a container that will contain the triangles used in the .stl file +// \param verbose whether to enable or not a sanity log +// +// \returns `true` if the reading process went well, `false` otherwise +// +// \warning `points` and `facets` are not cleared: new points and triangles are added to the back +// of the containers. +// +// Although the STL file format uses triangles, it is convenient to be able to use vectors +// and other models of the `SequenceContainer` (instead of arrays) for the face type, +// to avoid having to convert the to apply polygon soup reparation algorithms. +template bool read_STL(std::istream& input, - std::vector >& points, - std::vector >& facets, + std::vector& points, + std::vector& facets, bool verbose = false) { int pos = 0; diff --git a/Polyhedron_IO/include/CGAL/IO/reader_helpers.h b/Polyhedron_IO/include/CGAL/IO/reader_helpers.h new file mode 100644 index 00000000000..7e6ebeb89ad --- /dev/null +++ b/Polyhedron_IO/include/CGAL/IO/reader_helpers.h @@ -0,0 +1,90 @@ +// Copyright (c) 2015 GeometryFactory +// +// This file is part of CGAL (www.cgal.org); you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// Author(s) : Mael Rouxel-Labbé + +#ifndef CGAL_IO_READER_HELPERS_H +#define CGAL_IO_READER_HELPERS_H + +#include +#include +#include + +#include +#include + +namespace CGAL{ + +namespace IO { + +namespace internal { + +CGAL_GENERATE_MEMBER_DETECTOR(size); +CGAL_GENERATE_MEMBER_DETECTOR(resize); + +// Typical container +template +void resize(Container& c, std::size_t size, + typename boost::enable_if_c::value>::type* = NULL) +{ + c.resize(size); +} + +// Container without a resize() function, but with a size() function (e.g. an array) +template +void resize(Container& CGAL_assertion_code(array), std::size_t CGAL_assertion_code(size), + typename boost::enable_if< + boost::mpl::and_< + boost::mpl::not_ >, + has_size > >::type* = NULL) +{ + CGAL_assertion(array.size() == size); +} + +// A class with neither resize() nor size(), can't enforce size (it better be correct!) +template +void resize(Container&, std::size_t, + typename boost::disable_if< + boost::mpl::or_, + has_size > >::type* = NULL) +{ +} + +// Ideally this should be a std::is_constructible(double, double, double) but boost::is_constructible +// is not safe to use without CXX11 +template +void fill_point(const double x, const double y, const double z, CGAL::Point_3& pt) +{ + pt = CGAL::Point_3(x, y, z); +} + +template +void fill_point(const double x, const double y, const double z, Point_3& pt) +{ + // just in case something weirder than arrays or CGAL points are used as points... + resize(pt, 3); + + pt[0] = x; pt[1] = y; pt[2] = z; +} + +} // end namespace internal + +} // end namespace IO + +} // namespace CGAL + +#endif // CGAL_IO_READER_HELPERS_H diff --git a/Polyhedron_IO/test/Polyhedron_IO/CMakeLists.txt b/Polyhedron_IO/test/Polyhedron_IO/CMakeLists.txt index 206b6968bbb..91a97ec855f 100644 --- a/Polyhedron_IO/test/Polyhedron_IO/CMakeLists.txt +++ b/Polyhedron_IO/test/Polyhedron_IO/CMakeLists.txt @@ -4,18 +4,12 @@ project( Polyhedron_IO_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Polyhedron_IO/test/Polyhedron_IO/stl2off.cpp b/Polyhedron_IO/test/Polyhedron_IO/stl2off.cpp index f12ad5fd6d6..79f1f55226e 100644 --- a/Polyhedron_IO/test/Polyhedron_IO/stl2off.cpp +++ b/Polyhedron_IO/test/Polyhedron_IO/stl2off.cpp @@ -1,53 +1,65 @@ -#include -#include -#include +#include +#include +#include + +#include #include #include #include +template void read(const char* fname, std::size_t v, std::size_t f) { std::cout << "Reading "<< fname << std::endl; std::ifstream input(fname, std::ios::in | std::ios::binary); - std::vector< CGAL::cpp11::array > points; - std::vector< CGAL::cpp11::array > faces; + std::cout << "Types: " << std::endl; + std::cout << typeid(Point_type).name() << std::endl; + std::cout << typeid(Polygon_type).name() << std::endl; - CGAL::read_STL( input, - points, - faces, - true); + std::cout << "Expecting " << v << " vertices and " << f << " triangles" << std::endl; - assert(points.size() == v); - assert(faces.size() == f); + std::vector points; + std::vector faces; + assert(CGAL::read_STL(input, points, faces, true)); std::cout << "OFF version of file " << fname << std::endl; - std::cout.precision(17); std::cout << "OFF\n" << points.size() << " " << faces.size() << " 0" << std::endl; - for(std::size_t i=0; i < points.size(); i++){ + for(std::size_t i=0; i < points.size(); i++) std::cout << points[i][0] << " " << points[i][1] << " " << points[i][2]<< std::endl; - } - for(std::size_t i=0; i < faces.size(); i++){ + for(std::size_t i=0; i < faces.size(); i++) std::cout << "3 " << faces[i][0] << " " << faces[i][1] << " " << faces[i][2] << std::endl; - } + + assert(points.size() == v); + assert(faces.size() == f); } - -int main() +int main(int, char**) { - read("data/cube.stl", 8, 12); - read("data/triangle.stl", 3, 1); + std::cout.precision(17); - read("data/ascii-tetrahedron.stl", 4, 4); - read("data/binary-tetrahedron-nice-header.stl", 4, 4); - read("data/binary-tetrahedron-non-standard-header-1.stl", 4, 4); - read("data/binary-tetrahedron-non-standard-header-2.stl", 4, 4); - read("data/binary-tetrahedron-non-standard-header-3.stl", 4, 4); - read("data/binary-tetrahedron-non-standard-header-4.stl", 4, 4); - read("data/binary-tetrahedron-non-standard-header-5.stl", 4, 4); + // bunch of types to test + typedef CGAL::cpp11::array Point_type_1; + typedef CGAL::Exact_predicates_exact_constructions_kernel::Point_3 Point_type_2; + typedef std::basic_string Point_type_3; - return 0; + typedef CGAL::cpp11::array Polygon_type_1; + typedef std::vector Polygon_type_2; + typedef std::basic_string Polygon_type_3; + + read("data/cube.stl", 8, 12); + read("data/triangle.stl", 3, 1); + + read("data/ascii-tetrahedron.stl", 4, 4); + read("data/binary-tetrahedron-nice-header.stl", 4, 4); + read("data/binary-tetrahedron-non-standard-header-1.stl", 4, 4); + read("data/binary-tetrahedron-non-standard-header-2.stl", 4, 4); + read("data/binary-tetrahedron-non-standard-header-3.stl", 4, 4); + read("data/binary-tetrahedron-non-standard-header-4.stl", 4, 4); + read("data/binary-tetrahedron-non-standard-header-5.stl", 4, 4); + + return EXIT_SUCCESS; } diff --git a/Polyline_simplification_2/demo/Polyline_simplification_2/CMakeLists.txt b/Polyline_simplification_2/demo/Polyline_simplification_2/CMakeLists.txt index 3b076bd0f77..5ff66f49e79 100644 --- a/Polyline_simplification_2/demo/Polyline_simplification_2/CMakeLists.txt +++ b/Polyline_simplification_2/demo/Polyline_simplification_2/CMakeLists.txt @@ -11,8 +11,6 @@ endif() find_package(CGAL COMPONENTS Qt5) -include(${CGAL_USE_FILE}) - find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Widgets Svg) include_directories (BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/include) diff --git a/Polyline_simplification_2/doc/Polyline_simplification_2/PackageDescription.txt b/Polyline_simplification_2/doc/Polyline_simplification_2/PackageDescription.txt index 7a4b2f38fe7..6f5d14070e0 100644 --- a/Polyline_simplification_2/doc/Polyline_simplification_2/PackageDescription.txt +++ b/Polyline_simplification_2/doc/Polyline_simplification_2/PackageDescription.txt @@ -1,28 +1,28 @@ -/// \defgroup PkgPolylineSimplification2 2D Polyline Simplification Reference +/// \defgroup PkgPolylineSimplification2Ref 2D Polyline Simplification Reference /// \defgroup PkgPolylineSimplification2Concepts Concepts -/// \ingroup PkgPolylineSimplification2 +/// \ingroup PkgPolylineSimplification2Ref /// \defgroup PkgPolylineSimplification2Classes Polyline Simplification Classes -/// \ingroup PkgPolylineSimplification2 +/// \ingroup PkgPolylineSimplification2Ref /// \defgroup PkgPolylineSimplification2Functions Global Functions -/// \ingroup PkgPolylineSimplification2 +/// \ingroup PkgPolylineSimplification2Ref /*! -\addtogroup PkgPolylineSimplification2 -\cgalPkgDescriptionBegin{2D Polyline Simplification,PkgPolylineSimplification2Summary} +\addtogroup PkgPolylineSimplification2Ref +\cgalPkgDescriptionBegin{2D Polyline Simplification,PkgPolylineSimplification2} \cgalPkgPicture{PolylineSimplification-small.png} \cgalPkgSummaryBegin \cgalPkgAuthor{Andreas Fabri} \cgalPkgDesc{This package enables to simplify polylines with the guarantee that the topology of the polylines does not change. This can be done for a single polyline as well as for a set of polyline constraints in a constrained triangulation. The simplification can be controlled with cost and stop functions.} -\cgalPkgManuals{Chapter_2D_Polyline_simplification,PkgPolylineSimplification2} +\cgalPkgManuals{Chapter_2D_Polyline_simplification,PkgPolylineSimplification2Ref} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{4.6} -\cgalPkgDependsOn{\ref PkgTriangulation2Summary} +\cgalPkgDependsOn{\ref PkgTriangulation2} \cgalPkgBib{cgal:f-ps2} \cgalPkgLicense{\ref licensesGPL "GPL"} \cgalPkgDemo{Polyline Simplification,polyline_simplification_2.zip} diff --git a/Polyline_simplification_2/doc/Polyline_simplification_2/Polyline_simplification_2.txt b/Polyline_simplification_2/doc/Polyline_simplification_2/Polyline_simplification_2.txt index 2774b0b0db9..04d89c86104 100644 --- a/Polyline_simplification_2/doc/Polyline_simplification_2/Polyline_simplification_2.txt +++ b/Polyline_simplification_2/doc/Polyline_simplification_2/Polyline_simplification_2.txt @@ -46,7 +46,7 @@ true, for instance, upon reaching a desired number of vertices or reaching a maximum simplification error. The polyline simplification algorithm operates on a triangulation -class from Chapter \ref PkgTriangulation2Summary, namely +class from Chapter \ref PkgTriangulation2, namely `Constrained_triangulation_plus_2`. This data structure allows to remove vertices of a polyline constraint, while keeping the points of the removed vertices of the polyline constraint. The fact that it is a diff --git a/Polyline_simplification_2/examples/Polyline_simplification_2/CMakeLists.txt b/Polyline_simplification_2/examples/Polyline_simplification_2/CMakeLists.txt index 631642f58f3..db749400699 100644 --- a/Polyline_simplification_2/examples/Polyline_simplification_2/CMakeLists.txt +++ b/Polyline_simplification_2/examples/Polyline_simplification_2/CMakeLists.txt @@ -4,18 +4,12 @@ project( Polyline_simplification_2_Examples ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Polyline_simplification_2/test/Polyline_simplification_2/CMakeLists.txt b/Polyline_simplification_2/test/Polyline_simplification_2/CMakeLists.txt index 597a51154c7..3430ed90e69 100644 --- a/Polyline_simplification_2/test/Polyline_simplification_2/CMakeLists.txt +++ b/Polyline_simplification_2/test/Polyline_simplification_2/CMakeLists.txt @@ -4,7 +4,7 @@ project( Polyline_simplification_2_Tests ) -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.1) @@ -18,10 +18,6 @@ if ( NOT CGAL_FOUND ) endif() -# include helper file -include( ${CGAL_USE_FILE} ) - - # Boost and its components find_package( Boost ) @@ -36,14 +32,10 @@ endif() # include for local directory # include for local package -include_directories( BEFORE ../../include ) - # Creating entries for all .cpp/.C files with "main" routine # ########################################################## -include( CGAL_CreateSingleSourceCGALProgram ) - create_single_source_cgal_program( "simplify_polygon_test.cpp" ) create_single_source_cgal_program( "simplify_polyline_with_duplicate_points.cpp" ) diff --git a/Polynomial/doc/Polynomial/PackageDescription.txt b/Polynomial/doc/Polynomial/PackageDescription.txt index e8ea1ffb953..79f708e98e6 100644 --- a/Polynomial/doc/Polynomial/PackageDescription.txt +++ b/Polynomial/doc/Polynomial/PackageDescription.txt @@ -1,21 +1,21 @@ -/// \defgroup PkgPolynomial Polynomial Reference +/// \defgroup PkgPolynomialRef Polynomial Reference /// \defgroup PkgPolynomialConcepts Concepts -/// \ingroup PkgPolynomial +/// \ingroup PkgPolynomialRef /// \defgroup PkgPolynomialClasses Classes -/// \ingroup PkgPolynomial +/// \ingroup PkgPolynomialRef /// \defgroup PkgPolynomialFunctions Functions -/// \ingroup PkgPolynomial +/// \ingroup PkgPolynomialRef /*! -\addtogroup PkgPolynomial +\addtogroup PkgPolynomialRef \todo check generated documentation -\cgalPkgDescriptionBegin{Polynomial,PkgPolynomialSummary} +\cgalPkgDescriptionBegin{Polynomial,PkgPolynomial} \cgalPkgPicture{Polynomial.png} \cgalPkgSummaryBegin \cgalPkgAuthor{Michael Hemmer} \cgalPkgDesc{This package introduces a concept for univariate and multivariate polynomials in \f$ d\f$ variables. Though the concept is written for an arbitrary number of variables, the number of variables is considered as fixed for a particular model of this concept.} -\cgalPkgManuals{Chapter_Polynomial,PkgPolynomial} +\cgalPkgManuals{Chapter_Polynomial,PkgPolynomialRef} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{3.3} diff --git a/Polynomial/examples/Polynomial/CMakeLists.txt b/Polynomial/examples/Polynomial/CMakeLists.txt index 9fdb5ec7c9c..b71a6c04a11 100644 --- a/Polynomial/examples/Polynomial/CMakeLists.txt +++ b/Polynomial/examples/Polynomial/CMakeLists.txt @@ -4,18 +4,12 @@ project( Polynomial_Examples ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Polynomial/test/Polynomial/CMakeLists.txt b/Polynomial/test/Polynomial/CMakeLists.txt index b01c7837460..e274a106b8d 100644 --- a/Polynomial/test/Polynomial/CMakeLists.txt +++ b/Polynomial/test/Polynomial/CMakeLists.txt @@ -4,19 +4,14 @@ project( Polynomial_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET COMPONENTS Core) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - include_directories (BEFORE "../../include") - - include_directories (BEFORE "include") + include(${CGAL_USE_FILE}) + include_directories (BEFORE "include") # create a target per cppfile file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) diff --git a/Polytope_distance_d/doc/Polytope_distance_d/CGAL/Polytope_distance_d.h b/Polytope_distance_d/doc/Polytope_distance_d/CGAL/Polytope_distance_d.h index d156904ed69..0e21463f651 100644 --- a/Polytope_distance_d/doc/Polytope_distance_d/CGAL/Polytope_distance_d.h +++ b/Polytope_distance_d/doc/Polytope_distance_d/CGAL/Polytope_distance_d.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgOptimalDistances +\ingroup PkgPolytopeDistanceDRef An object of the class `Polytope_distance_d` represents the (squared) distance between two convex polytopes, given as the convex hulls of two finite point diff --git a/Polytope_distance_d/doc/Polytope_distance_d/CGAL/Polytope_distance_d_traits_2.h b/Polytope_distance_d/doc/Polytope_distance_d/CGAL/Polytope_distance_d_traits_2.h index efe82888ec9..c8eeacb065f 100644 --- a/Polytope_distance_d/doc/Polytope_distance_d/CGAL/Polytope_distance_d_traits_2.h +++ b/Polytope_distance_d/doc/Polytope_distance_d/CGAL/Polytope_distance_d_traits_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgOptimalDistances +\ingroup PkgPolytopeDistanceDRef The class `Polytope_distance_d_traits_2` is a traits class for the \f$ d\f$-dimensional optimisation algorithms using the two-dimensional \cgal kernel. diff --git a/Polytope_distance_d/doc/Polytope_distance_d/CGAL/Polytope_distance_d_traits_3.h b/Polytope_distance_d/doc/Polytope_distance_d/CGAL/Polytope_distance_d_traits_3.h index fdd520bd1b8..6732fe1f70d 100644 --- a/Polytope_distance_d/doc/Polytope_distance_d/CGAL/Polytope_distance_d_traits_3.h +++ b/Polytope_distance_d/doc/Polytope_distance_d/CGAL/Polytope_distance_d_traits_3.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgOptimalDistances +\ingroup PkgPolytopeDistanceDRef The class `Polytope_distance_d_traits_3` is a traits class for the \f$ d\f$-dimensional optimisation algorithms using the three-dimensional \cgal kernel. diff --git a/Polytope_distance_d/doc/Polytope_distance_d/CGAL/Polytope_distance_d_traits_d.h b/Polytope_distance_d/doc/Polytope_distance_d/CGAL/Polytope_distance_d_traits_d.h index 9749da82e48..767104181e8 100644 --- a/Polytope_distance_d/doc/Polytope_distance_d/CGAL/Polytope_distance_d_traits_d.h +++ b/Polytope_distance_d/doc/Polytope_distance_d/CGAL/Polytope_distance_d_traits_d.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgOptimalDistances +\ingroup PkgPolytopeDistanceDRef The class `Polytope_distance_d_traits_d` is a traits class for the \f$ d\f$-dimensional optimisation algorithms using the \f$ d\f$-dimensional \cgal kernel. diff --git a/Polytope_distance_d/doc/Polytope_distance_d/CGAL/Width_3.h b/Polytope_distance_d/doc/Polytope_distance_d/CGAL/Width_3.h index faf013b2eb8..27e555bf299 100644 --- a/Polytope_distance_d/doc/Polytope_distance_d/CGAL/Width_3.h +++ b/Polytope_distance_d/doc/Polytope_distance_d/CGAL/Width_3.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgOptimalDistances +\ingroup PkgPolytopeDistanceDRef Given a set of points \f$ \mathcal{S}=\left\{p_1,\ldots , p_n\right\}\f$ in \f$ \mathbb{R}^3\f$. The width of \f$ \mathcal{S}\f$, denoted as \f$ \mathcal{W(S)}\f$, is defined diff --git a/Polytope_distance_d/doc/Polytope_distance_d/CGAL/Width_default_traits_3.h b/Polytope_distance_d/doc/Polytope_distance_d/CGAL/Width_default_traits_3.h index c37cae8e2da..81cb1292a61 100644 --- a/Polytope_distance_d/doc/Polytope_distance_d/CGAL/Width_default_traits_3.h +++ b/Polytope_distance_d/doc/Polytope_distance_d/CGAL/Width_default_traits_3.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgOptimalDistances +\ingroup PkgPolytopeDistanceDRef The class `Width_default_traits_3` is a traits class for `Width_3` using the three-dimensional \cgal kernel. diff --git a/Polytope_distance_d/doc/Polytope_distance_d/CGAL/all_furthest_neighbors_2.h b/Polytope_distance_d/doc/Polytope_distance_d/CGAL/all_furthest_neighbors_2.h index 4688aeb2dad..65093217392 100644 --- a/Polytope_distance_d/doc/Polytope_distance_d/CGAL/all_furthest_neighbors_2.h +++ b/Polytope_distance_d/doc/Polytope_distance_d/CGAL/all_furthest_neighbors_2.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgOptimalDistances +\ingroup PkgPolytopeDistanceDRef \brief computes all furthest neighbors for the vertices of the convex polygon described by the range [`points_begin`, `points_end`), writes diff --git a/Polytope_distance_d/doc/Polytope_distance_d/Concepts/AllFurthestNeighborsTraits_2.h b/Polytope_distance_d/doc/Polytope_distance_d/Concepts/AllFurthestNeighborsTraits_2.h index dc475299292..03b99934a58 100644 --- a/Polytope_distance_d/doc/Polytope_distance_d/Concepts/AllFurthestNeighborsTraits_2.h +++ b/Polytope_distance_d/doc/Polytope_distance_d/Concepts/AllFurthestNeighborsTraits_2.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgOptimalDistancesConcepts +\ingroup PkgPolytopeDistanceDConcepts \cgalConcept The concept `AllFurthestNeighborsTraits_2` defines types and operations diff --git a/Polytope_distance_d/doc/Polytope_distance_d/Concepts/PolytopeDistanceDTraits.h b/Polytope_distance_d/doc/Polytope_distance_d/Concepts/PolytopeDistanceDTraits.h index 372615e7657..029fcfb5ea9 100644 --- a/Polytope_distance_d/doc/Polytope_distance_d/Concepts/PolytopeDistanceDTraits.h +++ b/Polytope_distance_d/doc/Polytope_distance_d/Concepts/PolytopeDistanceDTraits.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgOptimalDistancesConcepts +\ingroup PkgPolytopeDistanceDConcepts \cgalConcept This concept defines the requirements for traits classes of \f$ d\f$-dimensional diff --git a/Polytope_distance_d/doc/Polytope_distance_d/Concepts/WidthTraits_3.h b/Polytope_distance_d/doc/Polytope_distance_d/Concepts/WidthTraits_3.h index c3a815f86d9..d6fde4edd79 100644 --- a/Polytope_distance_d/doc/Polytope_distance_d/Concepts/WidthTraits_3.h +++ b/Polytope_distance_d/doc/Polytope_distance_d/Concepts/WidthTraits_3.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgOptimalDistancesConcepts +\ingroup PkgPolytopeDistanceDConcepts \cgalConcept This concept defines the requirements for traits classes of diff --git a/Polytope_distance_d/doc/Polytope_distance_d/PackageDescription.txt b/Polytope_distance_d/doc/Polytope_distance_d/PackageDescription.txt index 21aa9b1fc34..cbece0a499e 100644 --- a/Polytope_distance_d/doc/Polytope_distance_d/PackageDescription.txt +++ b/Polytope_distance_d/doc/Polytope_distance_d/PackageDescription.txt @@ -1,16 +1,16 @@ -/// \defgroup PkgOptimalDistances Optimal Distances Reference -/// \defgroup PkgOptimalDistancesConcepts Concepts -/// \ingroup PkgOptimalDistances +/// \defgroup PkgPolytopeDistanceDRef Optimal Distances Reference +/// \defgroup PkgPolytopeDistanceDConcepts Concepts +/// \ingroup PkgPolytopeDistanceDRef /*! -\addtogroup PkgOptimalDistances +\addtogroup PkgPolytopeDistanceDRef \todo check generated documentation -\cgalPkgDescriptionBegin{Optimal Distances,PkgOptimalDistancesSummary} +\cgalPkgDescriptionBegin{Optimal Distances,PkgPolytopeDistanceD} \cgalPkgPicture{dist.png} \cgalPkgSummaryBegin \cgalPkgAuthors{Kaspar Fischer, Bernd Gärtner, Thomas Herrmann, Michael Hoffmann, and Sven Schönherr} \cgalPkgDesc{This package provides algorithms for computing the distance between the convex hulls of two point sets in d-dimensional space, without explicitely constructing the convex hulls. It further provides an algorithm to compute the width of a point set, and the furthest point for each vertex of a convex polygon. } -\cgalPkgManuals{Chapter_Optimal_Distances,PkgOptimalDistances} +\cgalPkgManuals{Chapter_Optimal_Distances,PkgPolytopeDistanceDRef} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{1.1} diff --git a/Polytope_distance_d/examples/Polytope_distance_d/CMakeLists.txt b/Polytope_distance_d/examples/Polytope_distance_d/CMakeLists.txt index f6b1ec0c3c4..1b63b201100 100644 --- a/Polytope_distance_d/examples/Polytope_distance_d/CMakeLists.txt +++ b/Polytope_distance_d/examples/Polytope_distance_d/CMakeLists.txt @@ -4,18 +4,12 @@ project( Polytope_distance_d_Examples ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Polytope_distance_d/test/Polytope_distance_d/CMakeLists.txt b/Polytope_distance_d/test/Polytope_distance_d/CMakeLists.txt index b7084a82430..4e015e31e20 100644 --- a/Polytope_distance_d/test/Polytope_distance_d/CMakeLists.txt +++ b/Polytope_distance_d/test/Polytope_distance_d/CMakeLists.txt @@ -4,18 +4,12 @@ project( Polytope_distance_d_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Principal_component_analysis/demo/Principal_component_analysis/CMakeLists.txt b/Principal_component_analysis/demo/Principal_component_analysis/CMakeLists.txt index 478cc49ca88..fc970ec50e6 100644 --- a/Principal_component_analysis/demo/Principal_component_analysis/CMakeLists.txt +++ b/Principal_component_analysis/demo/Principal_component_analysis/CMakeLists.txt @@ -8,7 +8,7 @@ if(NOT POLICY CMP0070 AND POLICY CMP0053) cmake_policy(SET CMP0053 OLD) endif() -foreach(INCDIR ../../include ../../../STL_Extension/include ../../../GraphicsView/include ../../../filtered_kernel/include ) +foreach(INCDIR ../../../STL_Extension/include ../../../GraphicsView/include ../../../filtered_kernel/include ) if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${INCDIR}") include_directories (BEFORE "${CMAKE_CURRENT_SOURCE_DIR}/${INCDIR}") endif() @@ -18,7 +18,6 @@ include_directories( ./ ) # Find CGAL and CGAL Qt5 find_package(CGAL COMPONENTS Qt5) -include( ${CGAL_USE_FILE} ) find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) if (EIGEN3_FOUND) @@ -33,6 +32,7 @@ find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL) if(CGAL_Qt5_FOUND AND Qt5_FOUND ) + set(CMAKE_INCLUDE_CURRENT_DIR ON) qt5_wrap_ui( UI_FILES MainWindow.ui ) include(AddFileDependencies) diff --git a/Principal_component_analysis/doc/Principal_component_analysis/PackageDescription.txt b/Principal_component_analysis/doc/Principal_component_analysis/PackageDescription.txt index 7ce6f967c15..684db4d74d3 100644 --- a/Principal_component_analysis/doc/Principal_component_analysis/PackageDescription.txt +++ b/Principal_component_analysis/doc/Principal_component_analysis/PackageDescription.txt @@ -1,33 +1,33 @@ -/// \defgroup PkgPrincipalComponentAnalysisD Principal Component Analysis Reference +/// \defgroup PkgPrincipalComponentAnalysisDRef Principal Component Analysis Reference /// \defgroup PkgPrincipalComponentAnalysisDBary CGAL::barycenter() -/// \ingroup PkgPrincipalComponentAnalysisD +/// \ingroup PkgPrincipalComponentAnalysisDRef /// \defgroup PkgPrincipalComponentAnalysisDbb CGAL::bounding_box() -/// \ingroup PkgPrincipalComponentAnalysisD +/// \ingroup PkgPrincipalComponentAnalysisDRef /// \defgroup PkgPrincipalComponentAnalysisDCentroid CGAL::centroid() -/// \ingroup PkgPrincipalComponentAnalysisD +/// \ingroup PkgPrincipalComponentAnalysisDRef /// \defgroup PkgPrincipalComponentAnalysisDLLSF2 CGAL::linear_least_square_fitting_2() -/// \ingroup PkgPrincipalComponentAnalysisD +/// \ingroup PkgPrincipalComponentAnalysisDRef /// \defgroup PkgPrincipalComponentAnalysisDLLSF3 CGAL::linear_least_square_fitting_3() -/// \ingroup PkgPrincipalComponentAnalysisD +/// \ingroup PkgPrincipalComponentAnalysisDRef /*! -\addtogroup PkgPrincipalComponentAnalysisD +\addtogroup PkgPrincipalComponentAnalysisDRef \todo check generated documentation -\cgalPkgDescriptionBegin{Principal Component Analysis,PkgPrincipalComponentAnalysisDSummary} +\cgalPkgDescriptionBegin{Principal Component Analysis,PkgPrincipalComponentAnalysisD} \cgalPkgPicture{teaserLeastSquaresFitting.png} \cgalPkgSummaryBegin \cgalPkgAuthors{Pierre Alliez, Sylvain Pion and Ankit Gupta} \cgalPkgDesc{This package provides functions to compute global information about the shape of a set of 2D or 3D objects. It provides the computation of axis-aligned bounding boxes for point sets, and barycenters of weighted point sets. In addition, it provides computation of centroids (center of mass) and linear least squares fitting for point sets as well as for sets of other bounded objects. More specifically, it is possible to fit 2D lines to 2D segments, circles, disks, iso rectangles and triangles, as well as to fit 3D lines or 3D planes to 3D segments, triangles, iso cuboids, tetrahedra, spheres and balls. The common interface to these functions takes an iterator range of objects.} -\cgalPkgManuals{Chapter_Principal_Component_Analysis,PkgPrincipalComponentAnalysisD} +\cgalPkgManuals{Chapter_Principal_Component_Analysis,PkgPrincipalComponentAnalysisDRef} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{3.2} -\cgalPkgDependsOn{\ref PkgSolverSummary} +\cgalPkgDependsOn{\ref PkgSolverInterface} \cgalPkgBib{cgal:ap-pcad} \cgalPkgLicense{\ref licensesGPL "GPL"} \cgalPkgDemo{Principal Component Analysis,pca.zip,Operations on Polygons,polygon.zip,Polyhedron demo,polyhedron_3.zip} diff --git a/Principal_component_analysis/examples/Principal_component_analysis/CMakeLists.txt b/Principal_component_analysis/examples/Principal_component_analysis/CMakeLists.txt index c70f5352aca..832207a6daa 100644 --- a/Principal_component_analysis/examples/Principal_component_analysis/CMakeLists.txt +++ b/Principal_component_analysis/examples/Principal_component_analysis/CMakeLists.txt @@ -4,18 +4,12 @@ project( Principal_component_analysis_Examples ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - include_directories (BEFORE "../../include") - # Use Eigen find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) if (EIGEN3_FOUND) diff --git a/Principal_component_analysis/test/Principal_component_analysis/CMakeLists.txt b/Principal_component_analysis/test/Principal_component_analysis/CMakeLists.txt index 6ec08db1ad3..b7695c9965b 100644 --- a/Principal_component_analysis/test/Principal_component_analysis/CMakeLists.txt +++ b/Principal_component_analysis/test/Principal_component_analysis/CMakeLists.txt @@ -4,18 +4,12 @@ project( Principal_component_analysis_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - include_directories (BEFORE "../../include") - # Use Eigen find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) if (EIGEN3_FOUND) diff --git a/Profiling_tools/examples/Profiling_tools/CMakeLists.txt b/Profiling_tools/examples/Profiling_tools/CMakeLists.txt index 5c19f6e5f87..f314d77d073 100644 --- a/Profiling_tools/examples/Profiling_tools/CMakeLists.txt +++ b/Profiling_tools/examples/Profiling_tools/CMakeLists.txt @@ -4,18 +4,12 @@ project( Profiling_tools_Examples ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Profiling_tools/test/Profiling_tools/CMakeLists.txt b/Profiling_tools/test/Profiling_tools/CMakeLists.txt index d667b4f4322..b087980e759 100644 --- a/Profiling_tools/test/Profiling_tools/CMakeLists.txt +++ b/Profiling_tools/test/Profiling_tools/CMakeLists.txt @@ -4,18 +4,12 @@ project( Profiling_tools_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Property_map/doc/Property_map/PackageDescription.txt b/Property_map/doc/Property_map/PackageDescription.txt index a768dfacd9b..0f52bd4e7b7 100644 --- a/Property_map/doc/Property_map/PackageDescription.txt +++ b/Property_map/doc/Property_map/PackageDescription.txt @@ -1,14 +1,14 @@ -/// \defgroup PkgProperty_map CGAL and Boost Property Maps Reference +/// \defgroup PkgPropertyMapRef CGAL and Boost Property Maps Reference /*! -\addtogroup PkgProperty_map +\addtogroup PkgPropertyMapRef -\cgalPkgDescriptionBegin{CGAL and Boost Property Maps,PkgProperty_mapSummary} +\cgalPkgDescriptionBegin{CGAL and Boost Property Maps,PkgPropertyMap} \cgalPkgPicture{property_map.png} \cgalPkgSummaryBegin \cgalPkgAuthors{Andreas Fabri and Laurent Saboret} \cgalPkgDesc{This package provides a framework for interfacing \cgal data structures with algorithms expecting Boost Property Maps.} -\cgalPkgManuals{Chapter_CGAL_and_Boost_Property_Maps,PkgProperty_map} +\cgalPkgManuals{Chapter_CGAL_and_Boost_Property_Maps,PkgPropertyMapRef} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{3.5} diff --git a/Property_map/examples/Property_map/CMakeLists.txt b/Property_map/examples/Property_map/CMakeLists.txt index d08de8fd049..82384c7e7fb 100644 --- a/Property_map/examples/Property_map/CMakeLists.txt +++ b/Property_map/examples/Property_map/CMakeLists.txt @@ -1,7 +1,7 @@ project( Property_map_Examples ) -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.1) # CGAL and its components find_package( CGAL QUIET COMPONENTS ) @@ -13,10 +13,6 @@ if ( NOT CGAL_FOUND ) endif() -# include helper file -include( ${CGAL_USE_FILE} ) - - # Boost and its components find_package( Boost REQUIRED ) @@ -34,8 +30,6 @@ endif() # Creating entries for all C++ files with "main" routine # ########################################################## -include( CGAL_CreateSingleSourceCGALProgram ) - create_single_source_cgal_program( "dynamic_properties.cpp" ) diff --git a/Property_map/include/CGAL/property_map.h b/Property_map/include/CGAL/property_map.h index f589496dcba..fc320cc7160 100644 --- a/Property_map/include/CGAL/property_map.h +++ b/Property_map/include/CGAL/property_map.h @@ -38,6 +38,7 @@ #include #include +#include namespace CGAL { @@ -169,7 +170,7 @@ struct Input_iterator_property_map{ get(Input_iterator_property_map,InputIterator it){ return *it; } }; -/// \ingroup PkgProperty_map +/// \ingroup PkgPropertyMapRef /// Property map that converts a `T*` pointer (or in general an iterator /// over `T` elements) to the `T` object. /// @@ -201,7 +202,7 @@ make_dereference_property_map(Iter) return Dereference_property_map::type>(); } -/// \ingroup PkgProperty_map +/// \ingroup PkgPropertyMapRef /// A `LvaluePropertyMap` property map mapping a key to itself (by reference). /// /// \cgalModels `LvaluePropertyMap` @@ -235,7 +236,7 @@ Identity_property_map } -/// \ingroup PkgProperty_map +/// \ingroup PkgPropertyMapRef /// Property map that accesses the first item of a `std::pair`. /// \tparam Pair Instance of `std::pair`. /// \cgalModels `LvaluePropertyMap` @@ -271,7 +272,7 @@ First_of_pair_property_map return First_of_pair_property_map(); } -/// \ingroup PkgProperty_map +/// \ingroup PkgPropertyMapRef /// /// Property map that accesses the second item of a `std::pair`. /// @@ -310,7 +311,7 @@ Second_of_pair_property_map return Second_of_pair_property_map(); } -/// \ingroup PkgProperty_map +/// \ingroup PkgPropertyMapRef /// /// Property map that accesses the Nth item of a `boost::tuple` or a `std::tuple`. /// @@ -370,7 +371,7 @@ Nth_of_tuple_property_map return Nth_of_tuple_property_map(); } -/// \ingroup PkgProperty_map +/// \ingroup PkgPropertyMapRef /// Struct that turns a property map into a unary functor with /// `operator()(key k)` calling the get function with `k` template @@ -391,7 +392,7 @@ struct Property_map_to_unary_function{ } }; -/// \ingroup PkgProperty_map +/// \ingroup PkgPropertyMapRef /// Utility class providing shortcuts to property maps based on raw pointers template struct Pointer_property_map{ @@ -405,7 +406,7 @@ struct Pointer_property_map{ const T&> const_type; ///< non-mutable `LvaluePropertyMap` }; -/// \ingroup PkgProperty_map +/// \ingroup PkgPropertyMapRef /// Starting from boost 1.55, the use of raw pointers as property maps has been deprecated. /// This function is a shortcut to the recommanded replacement: /// `boost::make_iterator_property_map(, boost::typed_identity_property_map())` @@ -418,7 +419,7 @@ make_property_map(T* pointer) return typename Pointer_property_map::type(pointer); } -/// \ingroup PkgProperty_map +/// \ingroup PkgPropertyMapRef /// equivalent to `make_property_map(&v[0])` /// Note that `v` must not be modified while using the property map created template @@ -432,7 +433,7 @@ make_property_map(std::vector& v) return make_property_map(&v[0]); } -/// \ingroup PkgProperty_map +/// \ingroup PkgPropertyMapRef /// Non-mutable version template inline @@ -442,7 +443,7 @@ make_property_map(const T* pointer) return typename Pointer_property_map::const_type(pointer); } -/// \ingroup PkgProperty_map +/// \ingroup PkgPropertyMapRef /// equivalent to `make_property_map(&v[0])` /// Note that `v` must not be modified while using the property map created template @@ -453,7 +454,7 @@ make_property_map(const std::vector& v) return make_property_map(&v[0]); } -/// \ingroup PkgProperty_map +/// \ingroup PkgPropertyMapRef /// Property map that returns a fixed value. /// Note that this value is chosen when the map is constructed and cannot /// be changed afterwards. Specifically, the free function `put()` does nothing. @@ -462,10 +463,11 @@ make_property_map(const std::vector& v) template struct Constant_property_map { - const ValueType default_value; + ValueType default_value; typedef KeyType key_type; typedef ValueType value_type; + typedef value_type& reference; typedef boost::read_write_property_map_tag category; Constant_property_map(const value_type& default_value = value_type()) : default_value (default_value) { } @@ -479,7 +481,7 @@ struct Constant_property_map put (const Constant_property_map&, const key_type&, const value_type&) { } }; -/// \ingroup PkgProperty_map +/// \ingroup PkgPropertyMapRef /// Read-write property map turning a set (such a `std::set`, /// `boost::unordered_set`, `std::unordered_set`) into a property map /// associating a Boolean to the value type of the set. The function `get` will @@ -517,7 +519,7 @@ struct Boolean_property_map } }; -/// \ingroup PkgProperty_map +/// \ingroup PkgPropertyMapRef /// returns `Boolean_property_map(set_)` template Boolean_property_map @@ -526,7 +528,7 @@ make_boolean_property_map(Set& set_) return Boolean_property_map(set_); } -/// \ingroup PkgProperty_map +/// \ingroup PkgPropertyMapRef /// Read-write property map doing on-the-fly conversions between two default constructible \cgal %Cartesian kernels. /// Its value type is `GeomObject` and its key type is the same as `Vpm`. /// `GeomObject` must be a geometric object from a \cgal kernel. @@ -561,7 +563,7 @@ struct Cartesian_converter_property_map } }; -/// \ingroup PkgProperty_map +/// \ingroup PkgPropertyMapRef /// returns `Cartesian_converter_property_map(vpm)` template Cartesian_converter_property_map diff --git a/Property_map/package_info/Property_map/dependencies b/Property_map/package_info/Property_map/dependencies index 76331fefe0d..daac83f2511 100644 --- a/Property_map/package_info/Property_map/dependencies +++ b/Property_map/package_info/Property_map/dependencies @@ -1,2 +1,5 @@ Installation STL_Extension +Kernel_23 +Profiling_tools + diff --git a/Property_map/test/Property_map/CMakeLists.txt b/Property_map/test/Property_map/CMakeLists.txt index cf2d22c7469..5208cf86184 100644 --- a/Property_map/test/Property_map/CMakeLists.txt +++ b/Property_map/test/Property_map/CMakeLists.txt @@ -2,7 +2,7 @@ project( Property_map_Tests ) -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.1) # CGAL and its components find_package( CGAL QUIET COMPONENTS ) @@ -14,10 +14,6 @@ if ( NOT CGAL_FOUND ) endif() -# include helper file -include( ${CGAL_USE_FILE} ) - - # Boost and its components find_package( Boost REQUIRED ) @@ -41,14 +37,10 @@ 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( "test_property_map.cpp" ) create_single_source_cgal_program( "dynamic_property_map.cpp" ) diff --git a/QP_solver/doc/QP_solver/PackageDescription.txt b/QP_solver/doc/QP_solver/PackageDescription.txt index 401a802f8c4..e1385de67d7 100644 --- a/QP_solver/doc/QP_solver/PackageDescription.txt +++ b/QP_solver/doc/QP_solver/PackageDescription.txt @@ -1,7 +1,7 @@ -/// \defgroup PkgQPSolver Linear and Quadratic Programming Solver Reference +/// \defgroup PkgQPSolverRef Linear and Quadratic Programming Solver Reference /*! \defgroup PkgQPSolverConcepts Concepts - \ingroup PkgQPSolver + \ingroup PkgQPSolverRef - `QuadraticProgram` (for quadratic programs with variable bounds \f$ l \leq x \leq u\f$) - `LinearProgram` (for linear programs with variable bounds \f$ l \leq x \leq u\f$) @@ -13,7 +13,7 @@ /*! \defgroup PkgQPSolverClasses Classes - \ingroup PkgQPSolver + \ingroup PkgQPSolverRef This module provides high and low level classes that allow to construct and represent linear and quadratic programs and their solution. @@ -39,7 +39,7 @@ Then there are specific models for any of the four program concepts above; these /*! \defgroup PkgQPSolverFunctions Functions - \ingroup PkgQPSolver + \ingroup PkgQPSolverRef This module provides makers to construct a program, as well as functions to solve and print programs. @@ -71,14 +71,14 @@ Programs can be written to an output stream in MPSFormat, using one of the follo */ /*! -\addtogroup PkgQPSolver +\addtogroup PkgQPSolverRef \todo check generated documentation -\cgalPkgDescriptionBegin{Linear and Quadratic Programming Solver,PkgQPSolverSummary} +\cgalPkgDescriptionBegin{Linear and Quadratic Programming Solver,PkgQPSolver} \cgalPkgPicture{qp.png} \cgalPkgSummaryBegin \cgalPkgAuthors{Kaspar Fischer, Bernd Gärtner, Sven Schönherr, and Frans Wessendorp} \cgalPkgDesc{This package contains algorithms for minimizing linear and convex quadratic functions over polyhedral domains, described by linear equations and inequalities. The algorithms are exact, i.e.\ the solution is computed in terms of multiprecision rational numbers. The resulting solution is certified: along with the claims that the problem under consideration has an optimal solution, is infeasible, or is unbounded, the algorithms also deliver proofs for these facts. These proofs can easily (and independently from the algorithms) be checked for correctness. The solution algorithms are based on a generalization of the simplex method to quadratic objective functions. } -\cgalPkgManuals{Chapter_Linear_and_Quadratic_Programming_Solver,PkgQPSolver} +\cgalPkgManuals{Chapter_Linear_and_Quadratic_Programming_Solver,PkgQPSolverRef} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{3.3} diff --git a/QP_solver/examples/QP_solver/CMakeLists.txt b/QP_solver/examples/QP_solver/CMakeLists.txt index d69739d9c45..208ed0358ac 100644 --- a/QP_solver/examples/QP_solver/CMakeLists.txt +++ b/QP_solver/examples/QP_solver/CMakeLists.txt @@ -4,18 +4,12 @@ project( QP_solver_Examples ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/QP_solver/test/QP_solver/CMakeLists.txt b/QP_solver/test/QP_solver/CMakeLists.txt index 1b9ac0c37c5..ec9ad49e801 100644 --- a/QP_solver/test/QP_solver/CMakeLists.txt +++ b/QP_solver/test/QP_solver/CMakeLists.txt @@ -4,18 +4,12 @@ project( QP_solver_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Random_numbers/test/Random_numbers/CMakeLists.txt b/Random_numbers/test/Random_numbers/CMakeLists.txt index 0c2d5c12c93..927421b6a3f 100644 --- a/Random_numbers/test/Random_numbers/CMakeLists.txt +++ b/Random_numbers/test/Random_numbers/CMakeLists.txt @@ -4,18 +4,12 @@ project( Random_numbers_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Ridges_3/doc/Ridges_3/CGAL/Ridges.h b/Ridges_3/doc/Ridges_3/CGAL/Ridges.h index 1c6cec82ad6..71374d8bd83 100644 --- a/Ridges_3/doc/Ridges_3/CGAL/Ridges.h +++ b/Ridges_3/doc/Ridges_3/CGAL/Ridges.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgRidges_3Enums +\ingroup PkgRidges3Enums The enum `Ridge_order` describes the order of differential quantities used to distinguish elliptic and hyperbolic ridges. Third or fourth order quantities may be used as explained in Section \ref Ridges_3Approximating @@ -12,7 +12,7 @@ of the User Manual. enum Ridge_order { Ridge_order_3 = 3, Ridge_order_4}; /*! -\ingroup PkgRidges_3Enums +\ingroup PkgRidges3Enums The enum `Ridge_type` describes the types for the class `Ridge_line`. \sa `Ridge_line` */ @@ -24,7 +24,7 @@ enum Ridge_type { /*! -\ingroup PkgRidges_3 +\ingroup PkgRidges3Ref The function `compute_crest_ridges()` is a shortcut to the method `Ridge_approximation::compute_crest_ridges()`. @@ -53,7 +53,7 @@ OutputIterator compute_crest_ridges(const TriangleMesh &tm, namespace CGAL { /*! -\ingroup PkgRidges_3 +\ingroup PkgRidges3Ref The function `compute_max_ridges()` is a shortcut to the method `Ridge_approximation::compute_max_ridges()`. @@ -80,7 +80,7 @@ OutputIterator compute_max_ridges(const TriangleMesh &tm, namespace CGAL { /*! -\ingroup PkgRidges_3 +\ingroup PkgRidges3Ref The function `compute_min_ridges()` is a shortcut to the method `Ridge_approximation::compute_min_ridges()`. @@ -110,7 +110,7 @@ OutputIterator compute_min_ridges(const TriangleMesh &tm, namespace CGAL { /*! -\ingroup PkgRidges_3 +\ingroup PkgRidges3Ref The class `Ridge_approximation` computes the approximation of ridges of a triangular polyhedral surface. @@ -194,7 +194,7 @@ template OutputIterator compute_crest_ridges(OutputIterat namespace CGAL { /*! -\ingroup PkgRidges_3 +\ingroup PkgRidges3Ref The class `Ridge_line` stores the description of a ridge line. The list of halfedges defines a connected sequence of edges (but not as diff --git a/Ridges_3/doc/Ridges_3/CGAL/Umbilics.h b/Ridges_3/doc/Ridges_3/CGAL/Umbilics.h index 2b791415ca2..337c0ad625e 100644 --- a/Ridges_3/doc/Ridges_3/CGAL/Umbilics.h +++ b/Ridges_3/doc/Ridges_3/CGAL/Umbilics.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgRidges_3Enums +\ingroup PkgRidges3Enums The enum `Umbilic_type` describes the types for the class `Umbilic`. \sa `Umbilic` */ @@ -9,7 +9,7 @@ enum Umbilic_type { NON_GENERIC_UMBILIC, ELLIPTIC_UMBILIC, HYPERBOLIC_UMBILIC }; /*! -\ingroup PkgRidges_3 +\ingroup PkgRidges3Ref The function `compute_umbilics()` is a shortcut to the method `Umbilic_approximation::compute()`. See `Umbilic_approximation::Umbilic_approximation()` for an explanation of the parameters. @@ -34,7 +34,7 @@ double size); namespace CGAL { /*! -\ingroup PkgRidges_3 +\ingroup PkgRidges3Ref The class `Umbilic_approximation` computes the approximation of umbilics on a triangular polyhedral surface. @@ -109,7 +109,7 @@ template OutputIterator compute(OutputIterator it, FT siz namespace CGAL { /*! -\ingroup PkgRidges_3 +\ingroup PkgRidges3Ref The class `Umbilic` stores the description of an umbilic. diff --git a/Ridges_3/doc/Ridges_3/PackageDescription.txt b/Ridges_3/doc/Ridges_3/PackageDescription.txt index 41da0e8439c..bc1e6ae1efe 100644 --- a/Ridges_3/doc/Ridges_3/PackageDescription.txt +++ b/Ridges_3/doc/Ridges_3/PackageDescription.txt @@ -1,21 +1,21 @@ -/// \defgroup PkgRidges_3 Approximation of Ridges and Umbilics on Triangulated Surface Meshes Reference +/// \defgroup PkgRidges3Ref Approximation of Ridges and Umbilics on Triangulated Surface Meshes Reference -/// \defgroup PkgRidges_3Enums Enums -/// \ingroup PkgRidges_3 +/// \defgroup PkgRidges3Enums Enums +/// \ingroup PkgRidges3Ref /*! -\addtogroup PkgRidges_3 +\addtogroup PkgRidges3Ref \todo check generated documentation -\cgalPkgDescriptionBegin{Approximation of Ridges and Umbilics on Triangulated Surface Meshes,PkgRidges_3Summary} +\cgalPkgDescriptionBegin{Approximation of Ridges and Umbilics on Triangulated Surface Meshes,PkgRidges3} \cgalPkgPicture{RidgesMechPartDetail.png} \cgalPkgSummaryBegin \cgalPkgAuthors{Marc Pouget and Frédéric Cazals} \cgalPkgDesc{Global features related to curvature extrema encode important informations used in segmentation, registration, matching and surface analysis. Given pointwise estimations of local differential quantities, this package allows the approximation of differential features on a triangulated surface mesh. Such curvature related features are curves: ridges or crests, and points: umbilics.} -\cgalPkgManuals{Chapter_Approximation_of_Ridges_and_Umbilics_on_Triangulated_Surface_Meshes,PkgRidges_3} +\cgalPkgManuals{Chapter_Approximation_of_Ridges_and_Umbilics_on_Triangulated_Surface_Meshes,PkgRidges3Ref} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{3.3} -\cgalPkgDependsOn{\ref PkgSolverSummary} +\cgalPkgDependsOn{\ref PkgSolverInterface} \cgalPkgBib{cgal:cp-arutsm} \cgalPkgLicense{\ref licensesGPL "GPL"} \cgalPkgShortInfoEnd diff --git a/Ridges_3/doc/Ridges_3/Ridges_3.txt b/Ridges_3/doc/Ridges_3/Ridges_3.txt index 4f94bc953aa..ab9993f0822 100644 --- a/Ridges_3/doc/Ridges_3/Ridges_3.txt +++ b/Ridges_3/doc/Ridges_3/Ridges_3.txt @@ -26,7 +26,7 @@ analysis. Based on the results of the article different parts of this singular ridge curve as well as umbilics on a surface given as a triangulated surface mesh. Differential quantities associated to the mesh vertices are assumed to be given for these -algorithms; such quantities may be computed by the package \ref PkgJet_fitting_3Summary. +algorithms; such quantities may be computed by the package \ref PkgJetFitting3. Note that this package needs the third party library \ref thirdpartyEigen for linear algebra operations. @@ -333,7 +333,7 @@ Property maps enables the user to store scalars and vectors associated to a vertex either internally in extended vertices or externally with a `std::map` combined with -a `boost::associative_property_map`. +a `boost::associative_property_map`. Output of ridges or umbilics are provided via output iterators. @@ -404,7 +404,7 @@ neighborhood. \subsection Ridges_3Exampleprogram Example Program The following program computes ridges and umbilics from an off -file.\cgalFootnote{Model data may be downloaded via ftp://ftp.mpi-sb.mpg.de/pub/outgoing/CGAL/Ridges_3_datafiles.tgz . The mechanical part model has been provided courtesy of Dassault System to produce \cgalFigureRef{figmechanical_crest_filteredintro}, due to copyright issues the available model is not the same, it is provided by the AIM\@SHAPE Shape Repository.} It uses the package \ref PkgJet_fitting_3Summary to estimate the differential +file.\cgalFootnote{Model data may be downloaded via ftp://ftp.mpi-sb.mpg.de/pub/outgoing/CGAL/Ridges_3_datafiles.tgz . The mechanical part model has been provided courtesy of Dassault System to produce \cgalFigureRef{figmechanical_crest_filteredintro}, due to copyright issues the available model is not the same, it is provided by the AIM\@SHAPE Shape Repository.} It uses the package \ref PkgJetFitting3 to estimate the differential quantities. The default output file gives rough data for visualization purpose, a verbose output file may also be asked for. Parameters are diff --git a/Ridges_3/examples/Ridges_3/CMakeLists.txt b/Ridges_3/examples/Ridges_3/CMakeLists.txt index a6cae8ec1ee..5f34b46eb30 100644 --- a/Ridges_3/examples/Ridges_3/CMakeLists.txt +++ b/Ridges_3/examples/Ridges_3/CMakeLists.txt @@ -1,16 +1,13 @@ # This is the CMake script for compiling a CGAL application. project( Ridges_3_Examples ) -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET ) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - include( CGAL_CreateSingleSourceCGALProgram ) - # use either Eigen or BLAS/LAPACK find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) if (NOT EIGEN3_FOUND) diff --git a/Ridges_3/test/Ridges_3/CMakeLists.txt b/Ridges_3/test/Ridges_3/CMakeLists.txt index d7a2c5739ec..6603c76db97 100644 --- a/Ridges_3/test/Ridges_3/CMakeLists.txt +++ b/Ridges_3/test/Ridges_3/CMakeLists.txt @@ -4,17 +4,13 @@ project( Ridges_3_Tests ) -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - # use either Eigen or BLAS/LAPACK find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) if (NOT EIGEN3_FOUND) diff --git a/STL_Extension/benchmark/copy_n_benchmark/CMakeLists.txt b/STL_Extension/benchmark/copy_n_benchmark/CMakeLists.txt index 66aaabf1bf9..51f7a18b9eb 100644 --- a/STL_Extension/benchmark/copy_n_benchmark/CMakeLists.txt +++ b/STL_Extension/benchmark/copy_n_benchmark/CMakeLists.txt @@ -4,24 +4,19 @@ project( copy_n_benchmark_example ) -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET COMPONENTS Core ) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - include_directories (BEFORE ../../include) + include(${CGAL_USE_FILE}) create_single_source_cgal_program( "copy_n_benchmark.cpp" ) create_single_source_cgal_program( "copy_n_use_case_benchmark.cpp" ) - else() message(STATUS "This program requires the CGAL library, and will not be compiled.") diff --git a/STL_Extension/doc/STL_Extension/CGAL/CC_safe_handle.h b/STL_Extension/doc/STL_Extension/CGAL/CC_safe_handle.h index 8b1f42a1eb8..5fe5d6c7530 100644 --- a/STL_Extension/doc/STL_Extension/CGAL/CC_safe_handle.h +++ b/STL_Extension/doc/STL_Extension/CGAL/CC_safe_handle.h @@ -1,7 +1,7 @@ namespace CGAL { -/// \ingroup PkgStlExtension +/// \ingroup PkgSTLExtensionRef /*! \ingroup CompactContainer diff --git a/STL_Extension/doc/STL_Extension/CGAL/Compact_container.h b/STL_Extension/doc/STL_Extension/CGAL/Compact_container.h index 66887daa22f..44f11c8d70f 100644 --- a/STL_Extension/doc/STL_Extension/CGAL/Compact_container.h +++ b/STL_Extension/doc/STL_Extension/CGAL/Compact_container.h @@ -2,7 +2,7 @@ namespace CGAL { /// \defgroup CompactContainer Compact Container -/// \ingroup PkgStlExtension +/// \ingroup PkgSTLExtensionRef /*! \ingroup CompactContainer diff --git a/STL_Extension/doc/STL_Extension/CGAL/Complexity_tags.h b/STL_Extension/doc/STL_Extension/CGAL/Complexity_tags.h index 655ceda5837..34a6a3ac664 100644 --- a/STL_Extension/doc/STL_Extension/CGAL/Complexity_tags.h +++ b/STL_Extension/doc/STL_Extension/CGAL/Complexity_tags.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgStlExtensionUtilities +\ingroup PkgSTLExtensionUtilities @@ -33,7 +33,7 @@ struct Compact { namespace CGAL { /*! -\ingroup PkgStlExtensionUtilities +\ingroup PkgSTLExtensionUtilities diff --git a/STL_Extension/doc/STL_Extension/CGAL/Concurrent_compact_container.h b/STL_Extension/doc/STL_Extension/CGAL/Concurrent_compact_container.h index e358e5788f6..74c2ce4d5d7 100644 --- a/STL_Extension/doc/STL_Extension/CGAL/Concurrent_compact_container.h +++ b/STL_Extension/doc/STL_Extension/CGAL/Concurrent_compact_container.h @@ -1,7 +1,7 @@ namespace CGAL { -/// \ingroup PkgStlExtension +/// \ingroup PkgSTLExtensionRef /*! \ingroup CompactContainer diff --git a/STL_Extension/doc/STL_Extension/CGAL/Default.h b/STL_Extension/doc/STL_Extension/CGAL/Default.h index ccd301b0c2e..554b39f1bd8 100644 --- a/STL_Extension/doc/STL_Extension/CGAL/Default.h +++ b/STL_Extension/doc/STL_Extension/CGAL/Default.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgStlExtension +\ingroup PkgSTLExtensionRef diff --git a/STL_Extension/doc/STL_Extension/CGAL/Fourtuple.h b/STL_Extension/doc/STL_Extension/CGAL/Fourtuple.h index 7c672f6a8d9..fc08799d06f 100644 --- a/STL_Extension/doc/STL_Extension/CGAL/Fourtuple.h +++ b/STL_Extension/doc/STL_Extension/CGAL/Fourtuple.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgStlExtensionUtilities +\ingroup PkgSTLExtensionUtilities The `Fourtuple` class stores a homogeneous (same type) diff --git a/STL_Extension/doc/STL_Extension/CGAL/In_place_list.h b/STL_Extension/doc/STL_Extension/CGAL/In_place_list.h index d0aa69ce56b..93dfe77e554 100644 --- a/STL_Extension/doc/STL_Extension/CGAL/In_place_list.h +++ b/STL_Extension/doc/STL_Extension/CGAL/In_place_list.h @@ -1,5 +1,5 @@ /// \defgroup inplacelist Doubly-Connected List Managing Items in Place -/// \ingroup PkgStlExtension +/// \ingroup PkgSTLExtensionRef namespace CGAL { diff --git a/STL_Extension/doc/STL_Extension/CGAL/Iterator_range.h b/STL_Extension/doc/STL_Extension/CGAL/Iterator_range.h index bd03571a6dc..f394834bc93 100644 --- a/STL_Extension/doc/STL_Extension/CGAL/Iterator_range.h +++ b/STL_Extension/doc/STL_Extension/CGAL/Iterator_range.h @@ -27,9 +27,9 @@ namespace CGAL { /*! - \ingroup PkgStlExtension + \ingroup PkgSTLExtensionRef `CGAL::Iterator_range` encapsulates two iterators so they fulfill the `ForwardRange` concept. - The class is essentially a clone of `boost::iterator_range`, + The class is essentially a clone of `boost::iterator_range`, and it additionally is derived from `std::pair`, so that one can apply `boost::tie`. */ template diff --git a/STL_Extension/doc/STL_Extension/CGAL/Location_policy.h b/STL_Extension/doc/STL_Extension/CGAL/Location_policy.h index a29c1cd786b..8544c66076c 100644 --- a/STL_Extension/doc/STL_Extension/CGAL/Location_policy.h +++ b/STL_Extension/doc/STL_Extension/CGAL/Location_policy.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgStlExtensionUtilities +\ingroup PkgSTLExtensionUtilities A typedef to `Location_policy`. @@ -18,7 +18,7 @@ A typedef to `Location_policy`. namespace CGAL { /*! -\ingroup PkgStlExtensionUtilities +\ingroup PkgSTLExtensionUtilities A typedef to `Location_policy`. @@ -35,7 +35,7 @@ A typedef to `Location_policy`. namespace CGAL { /*! -\ingroup PkgStlExtensionUtilities +\ingroup PkgSTLExtensionUtilities diff --git a/STL_Extension/doc/STL_Extension/CGAL/Multiset.h b/STL_Extension/doc/STL_Extension/CGAL/Multiset.h index 833c51dff9a..d32b73adb85 100644 --- a/STL_Extension/doc/STL_Extension/CGAL/Multiset.h +++ b/STL_Extension/doc/STL_Extension/CGAL/Multiset.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgStlExtension +\ingroup PkgSTLExtensionRef \anchor classcgal_multimap diff --git a/STL_Extension/doc/STL_Extension/CGAL/Object.h b/STL_Extension/doc/STL_Extension/CGAL/Object.h index 27f21b9212d..9728923b8d5 100644 --- a/STL_Extension/doc/STL_Extension/CGAL/Object.h +++ b/STL_Extension/doc/STL_Extension/CGAL/Object.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgStlExtension +\ingroup PkgSTLExtensionRef Some functions can return different types of objects. A typical \cpp solution to this problem is to derive all possible return diff --git a/STL_Extension/doc/STL_Extension/CGAL/Sixtuple.h b/STL_Extension/doc/STL_Extension/CGAL/Sixtuple.h index 2d8e19cd729..67fd1e99ca3 100644 --- a/STL_Extension/doc/STL_Extension/CGAL/Sixtuple.h +++ b/STL_Extension/doc/STL_Extension/CGAL/Sixtuple.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgStlExtensionUtilities +\ingroup PkgSTLExtensionUtilities The `Sixtuple` class stores a homogeneous (same type) sixtuple of objects of type `T`. A `Sixtuple` is much like a diff --git a/STL_Extension/doc/STL_Extension/CGAL/Spatial_lock_grid_3.h b/STL_Extension/doc/STL_Extension/CGAL/Spatial_lock_grid_3.h index c0e4b5edfa4..4c9b48ee8f8 100644 --- a/STL_Extension/doc/STL_Extension/CGAL/Spatial_lock_grid_3.h +++ b/STL_Extension/doc/STL_Extension/CGAL/Spatial_lock_grid_3.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgStlExtension +\ingroup PkgSTLExtensionRef The class `Spatial_lock_grid_3` allows to lock points with coordinates (x, y, z) in a 3D grid. diff --git a/STL_Extension/doc/STL_Extension/CGAL/Threetuple.h b/STL_Extension/doc/STL_Extension/CGAL/Threetuple.h index 6ee154b37d7..35feaac4078 100644 --- a/STL_Extension/doc/STL_Extension/CGAL/Threetuple.h +++ b/STL_Extension/doc/STL_Extension/CGAL/Threetuple.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgStlExtensionUtilities +\ingroup PkgSTLExtensionUtilities \deprecated This class is deprecated, and will be removed in some future \cgal release. diff --git a/STL_Extension/doc/STL_Extension/CGAL/Twotuple.h b/STL_Extension/doc/STL_Extension/CGAL/Twotuple.h index 18c5129c19a..fa706d367b3 100644 --- a/STL_Extension/doc/STL_Extension/CGAL/Twotuple.h +++ b/STL_Extension/doc/STL_Extension/CGAL/Twotuple.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgStlExtensionUtilities +\ingroup PkgSTLExtensionUtilities The `Twotuple` class stores a homogeneous (same type) pair of objects of type `T`. A `Twotuple` is much like a container, in that diff --git a/STL_Extension/doc/STL_Extension/CGAL/Uncertain.h b/STL_Extension/doc/STL_Extension/CGAL/Uncertain.h index ce6a3fe3c27..1a633d0dd39 100644 --- a/STL_Extension/doc/STL_Extension/CGAL/Uncertain.h +++ b/STL_Extension/doc/STL_Extension/CGAL/Uncertain.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgStlExtensionUtilities +\ingroup PkgSTLExtensionUtilities An object of the class `Uncertain` represents an uncertainty on the value of type `T`. This uncertainty is represented by a non-empty range of diff --git a/STL_Extension/doc/STL_Extension/CGAL/algorithm.h b/STL_Extension/doc/STL_Extension/CGAL/algorithm.h index af6a88c6815..c5a65a3ab01 100644 --- a/STL_Extension/doc/STL_Extension/CGAL/algorithm.h +++ b/STL_Extension/doc/STL_Extension/CGAL/algorithm.h @@ -1,5 +1,5 @@ /// \defgroup STLAlgos Generic Algorithms -/// \ingroup PkgStlExtension +/// \ingroup PkgSTLExtensionRef namespace CGAL { @@ -148,7 +148,7 @@ is used. -\sa boost::next +\sa boost::next \sa `CGAL::cpp11::prev()` */ diff --git a/STL_Extension/doc/STL_Extension/CGAL/array.h b/STL_Extension/doc/STL_Extension/CGAL/array.h index 15660adb630..11d9a84d3c5 100644 --- a/STL_Extension/doc/STL_Extension/CGAL/array.h +++ b/STL_Extension/doc/STL_Extension/CGAL/array.h @@ -2,7 +2,7 @@ namespace CGAL { namespace cpp11 { /*! -\ingroup PkgStlExtension +\ingroup PkgSTLExtensionRef An object of the class `cpp11::array` represents an array of elements of type `T`, the number of which is specified by the second template argument. diff --git a/STL_Extension/doc/STL_Extension/CGAL/assertions_behaviour.h b/STL_Extension/doc/STL_Extension/CGAL/assertions_behaviour.h index bd7be00408b..f014c455347 100644 --- a/STL_Extension/doc/STL_Extension/CGAL/assertions_behaviour.h +++ b/STL_Extension/doc/STL_Extension/CGAL/assertions_behaviour.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgStlExtensionAssertions +\ingroup PkgSTLExtensionAssertions */ diff --git a/STL_Extension/doc/STL_Extension/CGAL/function.h b/STL_Extension/doc/STL_Extension/CGAL/function.h index cf5433d971d..95dadbfa816 100644 --- a/STL_Extension/doc/STL_Extension/CGAL/function.h +++ b/STL_Extension/doc/STL_Extension/CGAL/function.h @@ -2,7 +2,7 @@ namespace CGAL { namespace cpp11 { /*! -\ingroup PkgStlExtension +\ingroup PkgSTLExtensionRef An object of the class `cpp11::function` is a general-purpose polymorphic function wrapper. diff --git a/STL_Extension/doc/STL_Extension/CGAL/function_objects.h b/STL_Extension/doc/STL_Extension/CGAL/function_objects.h index 997cf54dd4c..7a3ebbc4d5b 100644 --- a/STL_Extension/doc/STL_Extension/CGAL/function_objects.h +++ b/STL_Extension/doc/STL_Extension/CGAL/function_objects.h @@ -1,5 +1,5 @@ /// \defgroup projectionobjects Projection Function Objects -/// \ingroup PkgStlExtension +/// \ingroup PkgSTLExtensionRef namespace CGAL { @@ -138,7 +138,7 @@ compare_to_less(const F& f); /// \defgroup STLCreators Creator Function Objects -/// \ingroup PkgStlExtension +/// \ingroup PkgSTLExtensionRef namespace CGAL { diff --git a/STL_Extension/doc/STL_Extension/CGAL/iterator.h b/STL_Extension/doc/STL_Extension/CGAL/iterator.h index 6291a81be44..da44ffd14f2 100644 --- a/STL_Extension/doc/STL_Extension/CGAL/iterator.h +++ b/STL_Extension/doc/STL_Extension/CGAL/iterator.h @@ -1,5 +1,5 @@ /// \defgroup STLIterators Iterators and Iterator/Circulator Adaptors -/// \ingroup PkgStlExtension +/// \ingroup PkgSTLExtensionRef namespace CGAL { diff --git a/STL_Extension/doc/STL_Extension/CGAL/memory.h b/STL_Extension/doc/STL_Extension/CGAL/memory.h index 5a9f02b663a..0362b08ec54 100644 --- a/STL_Extension/doc/STL_Extension/CGAL/memory.h +++ b/STL_Extension/doc/STL_Extension/CGAL/memory.h @@ -1,7 +1,7 @@ #include /** - * \ingroup PkgStlExtension + * \ingroup PkgSTLExtensionRef * * A define for the allocator used by %CGAL. This is only defined if * there is no user defined version before `memory.h` is included diff --git a/STL_Extension/doc/STL_Extension/CGAL/result_of.h b/STL_Extension/doc/STL_Extension/CGAL/result_of.h index b39244044e2..1276da97597 100644 --- a/STL_Extension/doc/STL_Extension/CGAL/result_of.h +++ b/STL_Extension/doc/STL_Extension/CGAL/result_of.h @@ -2,7 +2,7 @@ namespace CGAL { namespace cpp11 { /*! - \ingroup PkgStlExtension + \ingroup PkgSTLExtensionRef Alias to the tr1 implementation from boost of the `result_of` mechanism. When all compilers supported by %CGAL will have a Standard compliant implemention of the the \cpp11 `decltype` feature, it will become an alias to std::result_of. diff --git a/STL_Extension/doc/STL_Extension/CGAL/tags.h b/STL_Extension/doc/STL_Extension/CGAL/tags.h index 2d1bc1455a5..5e102c1d8ca 100644 --- a/STL_Extension/doc/STL_Extension/CGAL/tags.h +++ b/STL_Extension/doc/STL_Extension/CGAL/tags.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgStlExtensionUtilities +\ingroup PkgSTLExtensionUtilities Depending on `bool value` the class `Boolean_tag` indicates that something is `true` or `false` respectively. @@ -29,7 +29,7 @@ static const bool value; namespace CGAL { /*! -\ingroup PkgStlExtensionUtilities +\ingroup PkgSTLExtensionUtilities The typedef `Tag_false` is `Boolean_tag`. It is used to indicate, for example, @@ -42,7 +42,7 @@ typedef CGAL::Boolean_tag Tag_false; /*! -\ingroup PkgStlExtensionUtilities +\ingroup PkgSTLExtensionUtilities The typedef `Tag_true` is `Boolean_tag`. It is used to indicate, for example, @@ -55,7 +55,7 @@ typedef CGAL::Boolean_tag Tag_true; /*! -\ingroup PkgStlExtensionUtilities +\ingroup PkgSTLExtensionUtilities Class indicating the absence of a functor. \cgalModels `DefaultConstructible` @@ -68,21 +68,21 @@ struct Null_functor { }; /*! -\ingroup PkgStlExtensionUtilities +\ingroup PkgSTLExtensionUtilities Tag used to enable/disable concurrency. For example, it may be used by a user to request the sequential version of an algorithm. */ struct Sequential_tag {}; /*! -\ingroup PkgStlExtensionUtilities +\ingroup PkgSTLExtensionUtilities Tag used to enable/disable concurrency. For example, it may be used by a user to request the parallel version of an algorithm. */ struct Parallel_tag {}; /*! -\ingroup PkgStlExtensionUtilities +\ingroup PkgSTLExtensionUtilities General tag indicating that non of any other possible tags is valid. diff --git a/STL_Extension/doc/STL_Extension/CGAL/tuple.h b/STL_Extension/doc/STL_Extension/CGAL/tuple.h index 4d7f15eea1d..0d15e43fc00 100644 --- a/STL_Extension/doc/STL_Extension/CGAL/tuple.h +++ b/STL_Extension/doc/STL_Extension/CGAL/tuple.h @@ -3,7 +3,7 @@ namespace CGAL { namespace cpp11 { /*! -\ingroup PkgStlExtension +\ingroup PkgSTLExtensionRef diff --git a/STL_Extension/doc/STL_Extension/CGAL/utility.h b/STL_Extension/doc/STL_Extension/CGAL/utility.h index b8e2d1c5b2a..47d0d80df0b 100644 --- a/STL_Extension/doc/STL_Extension/CGAL/utility.h +++ b/STL_Extension/doc/STL_Extension/CGAL/utility.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgStlExtensionUtilities +\ingroup PkgSTLExtensionUtilities The Quadruple class is an extension of @@ -225,7 +225,7 @@ y); namespace CGAL { /*! -\ingroup PkgStlExtensionUtilities +\ingroup PkgSTLExtensionUtilities @@ -428,7 +428,7 @@ Quadruple make_tuple(T1 x, T2 y, T3 z, T4 w); #ifndef DOXYGEN_RUNNING /*! -\ingroup PkgStlExtensionUtilities +\ingroup PkgSTLExtensionUtilities Creates a pair `(t1,t2)` if `comp(t1,t2)==true` and `(t2,t1)` otherwise. `comp` is a binary function taking two elements of type T that returns a value convertible to `bool`. diff --git a/STL_Extension/doc/STL_Extension/Concepts/Descriptor.h b/STL_Extension/doc/STL_Extension/Concepts/Descriptor.h index a1b334b9625..233d75b030c 100644 --- a/STL_Extension/doc/STL_Extension/Concepts/Descriptor.h +++ b/STL_Extension/doc/STL_Extension/Concepts/Descriptor.h @@ -1,5 +1,5 @@ /*! -\ingroup PkgStlExtensionConcepts +\ingroup PkgSTLExtensionConcepts \cgalConcept The concept `Descriptor` allows to describe a unique object in an abstract model. diff --git a/STL_Extension/doc/STL_Extension/Concepts/Hashable.h b/STL_Extension/doc/STL_Extension/Concepts/Hashable.h index 0c9d436c1f2..eb8c8e47c40 100644 --- a/STL_Extension/doc/STL_Extension/Concepts/Hashable.h +++ b/STL_Extension/doc/STL_Extension/Concepts/Hashable.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgStlExtensionConcepts +\ingroup PkgSTLExtensionConcepts \cgalConcept A type `Key` is a model of the concept `Hashable` if the diff --git a/STL_Extension/doc/STL_Extension/Concepts/Index.h b/STL_Extension/doc/STL_Extension/Concepts/Index.h index d30cd28b8b1..312ab61d888 100644 --- a/STL_Extension/doc/STL_Extension/Concepts/Index.h +++ b/STL_Extension/doc/STL_Extension/Concepts/Index.h @@ -1,5 +1,5 @@ /*! -\ingroup PkgStlExtensionConcepts +\ingroup PkgSTLExtensionConcepts \cgalConcept The concept `Index` is a refinement of `Descriptor` which must be convertible from and to `std::size_t`, and must be incrementable and decrementable. diff --git a/STL_Extension/doc/STL_Extension/Concepts/ObjectWithEraseCounter.h b/STL_Extension/doc/STL_Extension/Concepts/ObjectWithEraseCounter.h index 6e7798e09e6..d5fd7164f55 100644 --- a/STL_Extension/doc/STL_Extension/Concepts/ObjectWithEraseCounter.h +++ b/STL_Extension/doc/STL_Extension/Concepts/ObjectWithEraseCounter.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgStlExtensionConcepts +\ingroup PkgSTLExtensionConcepts \cgalConcept The concept `ObjectWithEraseCounter` describes the functionalities diff --git a/STL_Extension/doc/STL_Extension/Concepts/ProjectionObject.h b/STL_Extension/doc/STL_Extension/Concepts/ProjectionObject.h index b42bfb24aa5..6c5929f2b46 100644 --- a/STL_Extension/doc/STL_Extension/Concepts/ProjectionObject.h +++ b/STL_Extension/doc/STL_Extension/Concepts/ProjectionObject.h @@ -2,7 +2,7 @@ /*! -\ingroup PkgStlExtensionConcepts +\ingroup PkgSTLExtensionConcepts \cgalConcept \anchor sectionProjectionFunctionObjects diff --git a/STL_Extension/doc/STL_Extension/Concepts/SurjectiveLockDataStructure.h b/STL_Extension/doc/STL_Extension/Concepts/SurjectiveLockDataStructure.h index 7b6c6cb7de7..2d6364d172d 100644 --- a/STL_Extension/doc/STL_Extension/Concepts/SurjectiveLockDataStructure.h +++ b/STL_Extension/doc/STL_Extension/Concepts/SurjectiveLockDataStructure.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgStlExtensionConcepts +\ingroup PkgSTLExtensionConcepts \cgalConcept The concept `SurjectiveLockDataStructure` describes functionalities diff --git a/STL_Extension/doc/STL_Extension/PackageDescription.txt b/STL_Extension/doc/STL_Extension/PackageDescription.txt index 1c3c8a18f10..b2b4ecb7b78 100644 --- a/STL_Extension/doc/STL_Extension/PackageDescription.txt +++ b/STL_Extension/doc/STL_Extension/PackageDescription.txt @@ -1,23 +1,23 @@ -/// \defgroup PkgStlExtension STL Extensions for CGAL Reference +/// \defgroup PkgSTLExtensionRef STL Extensions for CGAL Reference -/// \defgroup PkgStlExtensionConcepts Concepts -/// \ingroup PkgStlExtension +/// \defgroup PkgSTLExtensionConcepts Concepts +/// \ingroup PkgSTLExtensionRef -/// \defgroup PkgStlExtensionUtilities Utilities -/// \ingroup PkgStlExtension +/// \defgroup PkgSTLExtensionUtilities Utilities +/// \ingroup PkgSTLExtensionRef -/// \defgroup PkgStlExtensionAssertions Assertions and Failure Behaviour -/// \ingroup PkgStlExtension +/// \defgroup PkgSTLExtensionAssertions Assertions and Failure Behaviour +/// \ingroup PkgSTLExtensionRef /*! -\addtogroup PkgStlExtension -\cgalPkgDescriptionBegin{STL Extensions for CGAL,PkgStlExtensionSummary} +\addtogroup PkgSTLExtensionRef +\cgalPkgDescriptionBegin{STL Extensions for CGAL,PkgSTLExtension} \cgalPkgPicture{plusplus.png} \cgalPkgSummaryBegin \cgalPkgAuthors{Michael Hoffmann, Lutz Kettner, Sylvain Pion, and Ron Wein} \cgalPkgDesc{\cgal is designed in the spirit of the generic programming paradigm to work together with the Standard Template Library (\stl). This package provides non-geometric \stl-like algorithms and datastructures that are not in the \stl standard, as well as functions to change the failure behaviour of assertions.} -\cgalPkgManuals{Chapter_STL_Extensions_for_CGAL,PkgStlExtension} +\cgalPkgManuals{Chapter_STL_Extensions_for_CGAL,PkgSTLExtensionRef} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{1.0} diff --git a/STL_Extension/examples/STL_Extension/CMakeLists.txt b/STL_Extension/examples/STL_Extension/CMakeLists.txt index 7c29ddcaed3..40753532e8a 100644 --- a/STL_Extension/examples/STL_Extension/CMakeLists.txt +++ b/STL_Extension/examples/STL_Extension/CMakeLists.txt @@ -4,18 +4,12 @@ project( STL_Extension_Examples ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/STL_Extension/include/CGAL/Compact_container.h b/STL_Extension/include/CGAL/Compact_container.h index b4960af00c4..2396e370e89 100644 --- a/STL_Extension/include/CGAL/Compact_container.h +++ b/STL_Extension/include/CGAL/Compact_container.h @@ -1027,6 +1027,10 @@ bool operator>=(const Compact_container +class Concurrent_compact_container; + namespace internal { template < class DSC, bool Const > @@ -1095,12 +1099,13 @@ namespace internal { void *vp; } m_ptr; - // Only Compact_container should access these constructors. - friend class Compact_container; + // Only Compact_container and Concurrent_compact_container should + // access these constructors. + template + friend class CGAL::Compact_container; + friend class CGAL::Concurrent_compact_container; // For begin() CC_iterator(pointer ptr, int, int) diff --git a/STL_Extension/include/CGAL/Concurrent_compact_container.h b/STL_Extension/include/CGAL/Concurrent_compact_container.h index 57aec68df0f..deb229b675d 100644 --- a/STL_Extension/include/CGAL/Concurrent_compact_container.h +++ b/STL_Extension/include/CGAL/Concurrent_compact_container.h @@ -33,9 +33,12 @@ #include #include +#include + #include #include #include +#include #include #include @@ -75,9 +78,6 @@ struct Concurrent_compact_container_traits { }; namespace CCC_internal { - template < class CCC, bool Const > - class CCC_iterator; - CGAL_GENERATE_MEMBER_DETECTOR(increment_erase_counter); // A basic "no erase counter" strategy @@ -176,6 +176,8 @@ class Concurrent_compact_container typedef Concurrent_compact_container_traits Traits; public: + typedef CGAL::Time_stamper_impl Time_stamper_impl; + typedef T value_type; typedef Allocator allocator_type; @@ -194,8 +196,8 @@ public: typedef typename Allocator::difference_type difference_type; #endif - typedef CCC_internal::CCC_iterator iterator; - typedef CCC_internal::CCC_iterator const_iterator; + typedef internal::CC_iterator iterator; + typedef internal::CC_iterator const_iterator; typedef std::reverse_iterator reverse_iterator; typedef std::reverse_iterator const_reverse_iterator; @@ -207,11 +209,12 @@ private: friend class Free_list; public: - friend class CCC_internal::CCC_iterator; - friend class CCC_internal::CCC_iterator; + friend class internal::CC_iterator; + friend class internal::CC_iterator; explicit Concurrent_compact_container(const Allocator &a = Allocator()) : m_alloc(a) + , m_time_stamper(new Time_stamper_impl()) { init (); } @@ -220,6 +223,7 @@ public: Concurrent_compact_container(InputIterator first, InputIterator last, const Allocator & a = Allocator()) : m_alloc(a) + , m_time_stamper(new Time_stamper_impl()) { init(); std::copy(first, last, CGAL::inserter(*this)); @@ -228,6 +232,7 @@ public: // The copy constructor and assignment operator preserve the iterator order Concurrent_compact_container(const Concurrent_compact_container &c) : m_alloc(c.get_allocator()) + , m_time_stamper(new Time_stamper_impl()) { init(); m_block_size = c.m_block_size; @@ -246,6 +251,7 @@ public: ~Concurrent_compact_container() { clear(); + delete m_time_stamper; } bool is_used(const_iterator ptr) const @@ -267,6 +273,7 @@ public: std::swap(m_last_item, c.m_last_item); std::swap(m_free_lists, c.m_free_lists); m_all_items.swap(c.m_all_items); + std::swap(m_time_stamper, c.m_time_stamper); } iterator begin() { return iterator(m_first_item, 0, 0); } @@ -601,6 +608,7 @@ private: CGAL_assertion(type(ret) == USED); fl->dec_size(); ++m_size; + m_time_stamper->set_time_stamp(ret); return iterator(ret, 0); } @@ -689,6 +697,7 @@ private: m_last_item = NULL; m_all_items = All_items(); m_size = 0; + m_time_stamper->reset(); } allocator_type m_alloc; @@ -704,6 +713,10 @@ private: #else CGAL::cpp11::atomic m_size; #endif + + // This is a pointer, so that the definition of Compact_container does + // not require a complete type `T`. + Time_stamper_impl* m_time_stamper; }; template < class T, class Allocator > @@ -812,6 +825,7 @@ void Concurrent_compact_container:: for (size_type i = old_block_size; i >= 1; --i) { EraseCounterStrategy::set_erase_counter(*(new_block + i), 0); + m_time_stamper->initialize_time_stamp(new_block + i); put_on_free_list(new_block + i, fl); } } @@ -866,243 +880,7 @@ bool operator>=(const Concurrent_compact_container &lhs, return ! (lhs < rhs); } -namespace CCC_internal { - - template < class CCC, bool Const > - class CCC_iterator - { - typedef typename CCC::iterator iterator; - typedef CCC_iterator Self; - public: - typedef typename CCC::value_type value_type; - typedef typename CCC::size_type size_type; - typedef typename CCC::difference_type difference_type; - typedef typename boost::mpl::if_c< Const, const value_type*, - value_type*>::type pointer; - typedef typename boost::mpl::if_c< Const, const value_type&, - value_type&>::type reference; - typedef std::bidirectional_iterator_tag iterator_category; - - // the initialization with NULL is required by our Handle concept. - CCC_iterator() - { - m_ptr.p = NULL; - } - - // Either a harmless copy-ctor, - // or a conversion from iterator to const_iterator. - CCC_iterator (const iterator &it) - { - m_ptr.p = &(*it); - } - - // Same for assignment operator (otherwise MipsPro warns) - CCC_iterator & operator= (const iterator &it) - { - m_ptr.p = &(*it); - return *this; - } - - // Construction from NULL - CCC_iterator (Nullptr_t CGAL_assertion_code(n)) - { - CGAL_assertion (n == NULL); - m_ptr.p = NULL; - } - - private: - - union { - pointer p; - void *vp; - } m_ptr; - - // Only Concurrent_compact_container should access these constructors. - friend class Concurrent_compact_container; - - // For begin() - CCC_iterator(pointer ptr, int, int) - { - m_ptr.p = ptr; - if (m_ptr.p == NULL) // empty container. - return; - - ++(m_ptr.p); // if not empty, p = start - if (CCC::type(m_ptr.p) == CCC::FREE) - increment(); - } - - // Construction from raw pointer and for end(). - CCC_iterator(pointer ptr, int) - { - m_ptr.p = ptr; - } - - // NB : in case empty container, begin == end == NULL. - void increment() - { - // It's either pointing to end(), or valid. - CGAL_assertion_msg(m_ptr.p != NULL, - "Incrementing a singular iterator or an empty container iterator ?"); - CGAL_assertion_msg(CCC::type(m_ptr.p) != CCC::START_END, - "Incrementing end() ?"); - - // If it's not end(), then it's valid, we can do ++. - do { - ++(m_ptr.p); - if (CCC::type(m_ptr.p) == CCC::USED || - CCC::type(m_ptr.p) == CCC::START_END) - return; - - if (CCC::type(m_ptr.p) == CCC::BLOCK_BOUNDARY) - m_ptr.p = CCC::clean_pointee(m_ptr.p); - } while (true); - } - - void decrement() - { - // It's either pointing to end(), or valid. - CGAL_assertion_msg(m_ptr.p != NULL, - "Decrementing a singular iterator or an empty container iterator ?"); - CGAL_assertion_msg(CCC::type(m_ptr.p - 1) != CCC::START_END, - "Decrementing begin() ?"); - - // If it's not begin(), then it's valid, we can do --. - do { - --m_ptr.p; - if (CCC::type(m_ptr.p) == CCC::USED || - CCC::type(m_ptr.p) == CCC::START_END) - return; - - if (CCC::type(m_ptr.p) == CCC::BLOCK_BOUNDARY) - m_ptr.p = CCC::clean_pointee(m_ptr.p); - } while (true); - } - - public: - - Self & operator++() - { - CGAL_assertion_msg(m_ptr.p != NULL, - "Incrementing a singular iterator or an empty container iterator ?"); - /* CGAL_assertion_msg(CCC::type(m_ptr.p) == CCC::USED, - "Incrementing an invalid iterator."); */ - increment(); - return *this; - } - - Self & operator--() - { - CGAL_assertion_msg(m_ptr.p != NULL, - "Decrementing a singular iterator or an empty container iterator ?"); - /* CGAL_assertion_msg(CCC::type(m_ptr.p) == CCC::USED - || CCC::type(m_ptr.p) == CCC::START_END, - "Decrementing an invalid iterator."); */ - decrement(); - return *this; - } - - Self operator++(int) { Self tmp(*this); ++(*this); return tmp; } - Self operator--(int) { Self tmp(*this); --(*this); return tmp; } - - reference operator*() const { return *(m_ptr.p); } - - pointer operator->() const { return (m_ptr.p); } - - // For std::less... - bool operator<(const CCC_iterator& other) const - { - return (m_ptr.p < other.m_ptr.p); - } - - bool operator>(const CCC_iterator& other) const - { - return (m_ptr.p > other.m_ptr.p); - } - - bool operator<=(const CCC_iterator& other) const - { - return (m_ptr.p <= other.m_ptr.p); - } - - bool operator>=(const CCC_iterator& other) const - { - return (m_ptr.p >= other.m_ptr.p); - } - - // Can itself be used for bit-squatting. - void * for_compact_container() const { return (m_ptr.vp); } - void * & for_compact_container() { return (m_ptr.vp); } - }; - - template < class CCC, bool Const1, bool Const2 > - inline - bool operator==(const CCC_iterator &rhs, - const CCC_iterator &lhs) - { - return rhs.operator->() == lhs.operator->(); - } - - template < class CCC, bool Const1, bool Const2 > - inline - bool operator!=(const CCC_iterator &rhs, - const CCC_iterator &lhs) - { - return rhs.operator->() != lhs.operator->(); - } - - // Comparisons with NULL are part of CGAL's Handle concept... - template < class CCC, bool Const > - inline - bool operator==(const CCC_iterator &rhs, - Nullptr_t CGAL_assertion_code(n)) - { - CGAL_assertion( n == NULL); - return rhs.operator->() == NULL; - } - - template < class CCC, bool Const > - inline - bool operator!=(const CCC_iterator &rhs, - Nullptr_t CGAL_assertion_code(n)) - { - CGAL_assertion( n == NULL); - return rhs.operator->() != NULL; - } - - template - std::size_t hash_value(const CCC_iterator& i) - { - return reinterpret_cast(&*i) / sizeof(typename CCC::value_type); - } -} // namespace CCC_internal - } //namespace CGAL -namespace std { - -#if defined(BOOST_MSVC) -# pragma warning(push) -# pragma warning(disable:4099) // For VC10 it is class hash -#endif - -#ifndef CGAL_CFG_NO_STD_HASH - - template < class CCC, bool Const > - struct hash > - : public CGAL::cpp98::unary_function, std::size_t> { - - std::size_t operator()(const CGAL::CCC_internal::CCC_iterator& i) const - { - return reinterpret_cast(&*i) / sizeof(typename CCC::value_type); - } - }; -#endif // CGAL_CFG_NO_STD_HASH - -#if defined(BOOST_MSVC) -# pragma warning(pop) -#endif - -} // namespace std #include diff --git a/STL_Extension/include/CGAL/Has_member.h b/STL_Extension/include/CGAL/Has_member.h new file mode 100644 index 00000000000..d35faad9448 --- /dev/null +++ b/STL_Extension/include/CGAL/Has_member.h @@ -0,0 +1,45 @@ +// Copyright (c) 2017 Inria (France) +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org); you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// Author(s) : Clement Jamin + +#ifndef CGAL_HAS_MEMBER_H +#define CGAL_HAS_MEMBER_H + +// Macro used to check if a type T has a member named `X` +// It generates a class has_X where has_X::value is a boolean +// See example in Concurrent_compact_container.h +#define CGAL_GENERATE_MEMBER_DETECTOR(X) \ +template class has_##X { \ + struct Fallback { int X; }; \ + struct Derived : T, Fallback { }; \ + \ + template struct Check; \ + \ + typedef char ArrayOfOne[1]; \ + typedef char ArrayOfTwo[2]; \ + \ + template static ArrayOfOne & func( \ + Check *); \ + template static ArrayOfTwo & func(...); \ + public: \ + typedef has_##X type; \ + enum { value = sizeof(func(0)) == 2 }; \ +} // semicolon is after the macro call + +#endif // CGAL_HAS_MEMBER_H diff --git a/STL_Extension/include/CGAL/Iterator_range.h b/STL_Extension/include/CGAL/Iterator_range.h index 677aa9c44d2..1d906900968 100644 --- a/STL_Extension/include/CGAL/Iterator_range.h +++ b/STL_Extension/include/CGAL/Iterator_range.h @@ -28,7 +28,7 @@ namespace CGAL { /*! -\ingroup PkgStlExtension +\ingroup PkgSTLExtensionRef /// `CGAL::Iterator_range` is a... */ template diff --git a/STL_Extension/include/CGAL/Time_stamper.h b/STL_Extension/include/CGAL/Time_stamper.h index 64ec445e92f..904c82b6c98 100644 --- a/STL_Extension/include/CGAL/Time_stamper.h +++ b/STL_Extension/include/CGAL/Time_stamper.h @@ -22,6 +22,7 @@ #define CGAL_TIME_STAMPER_H #include +#include namespace CGAL { @@ -29,24 +30,47 @@ template struct Time_stamper { Time_stamper() - : time_stamp_(0) {} + : time_stamp_() {} Time_stamper(const Time_stamper& ts) - : time_stamp_(ts.time_stamp_) {} + : time_stamp_() + { + time_stamp_ = std::size_t(ts.time_stamp_); + } + + Time_stamper& operator=(const Time_stamper& ts) + { + time_stamp_ = std::size_t(ts.time_stamp_); + return *this; + } static void initialize_time_stamp(T* pt) { pt->set_time_stamp(std::size_t(-1)); } void set_time_stamp(T* pt) { - if(pt->time_stamp() == std::size_t(-1)) - pt->set_time_stamp(time_stamp_++); + if(pt->time_stamp() == std::size_t(-1)) { + const std::size_t new_ts = time_stamp_++; + pt->set_time_stamp(new_ts); + } else { // else: the time stamp is re-used // Enforces that the time stamp is greater than the current value. - // That is used when a TDS_3 is copied. + // That is used when a TDS_3 is copied: in that case, the + // time stamps are copied from the old element to the new one, + // but the time stamper does not know. +#ifdef CGAL_NO_ATOMIC time_stamp_ = (std::max)(time_stamp_, pt->time_stamp() + 1); +#else + // How to atomically update a maximum value? + // https://stackoverflow.com/a/16190791/1728537 + const std::size_t new_value = pt->time_stamp() + 1; + std::size_t prev_value = time_stamp_; + while(prev_value < new_value && + !time_stamp_.compare_exchange_weak(prev_value, new_value)) + ; +#endif // atomic } } @@ -69,9 +93,8 @@ struct Time_stamper if(p_t1 == NULL) return (p_t2 != NULL); else if(p_t2 == NULL) return false; else { - CGAL_assertion((p_t1 == p_t2) == - (p_t1->time_stamp() == p_t2->time_stamp())); - return p_t1->time_stamp() < p_t2->time_stamp(); + CGAL_assertion((p_t1 == p_t2) == (time_stamp(p_t1) == time_stamp(p_t2))); + return time_stamp(p_t1) < time_stamp(p_t2); } } @@ -79,7 +102,11 @@ struct Time_stamper time_stamp_ = 0; } private: +#ifdef CGAL_NO_ATOMIC std::size_t time_stamp_; +#else + CGAL::cpp11::atomic time_stamp_; +#endif }; // end class template Time_stamper template diff --git a/STL_Extension/include/CGAL/value_type_traits.h b/STL_Extension/include/CGAL/value_type_traits.h index e50fc7de38b..bf656557c34 100644 --- a/STL_Extension/include/CGAL/value_type_traits.h +++ b/STL_Extension/include/CGAL/value_type_traits.h @@ -26,7 +26,7 @@ namespace CGAL { -/// \ingroup PkgStlExtension +/// \ingroup PkgSTLExtensionRef /// Class providing the value type of an iterator, and /// in the case of an output iterator, a type of objects that can be put in it. /// diff --git a/STL_Extension/test/STL_Extension/CMakeLists.txt b/STL_Extension/test/STL_Extension/CMakeLists.txt index 319ff1503fd..b7fb77d3d9d 100644 --- a/STL_Extension/test/STL_Extension/CMakeLists.txt +++ b/STL_Extension/test/STL_Extension/CMakeLists.txt @@ -4,21 +4,15 @@ project( STL_Extension_Tests ) -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - find_package( TBB QUIET ) - include( CGAL_CreateSingleSourceCGALProgram ) - - include_directories (BEFORE "../../include") - 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" ) diff --git a/STL_Extension/test/STL_Extension/test_Concurrent_compact_container.cpp b/STL_Extension/test/STL_Extension/test_Concurrent_compact_container.cpp index 1c12ab0507e..4d48b1f2889 100644 --- a/STL_Extension/test/STL_Extension/test_Concurrent_compact_container.cpp +++ b/STL_Extension/test/STL_Extension/test_Concurrent_compact_container.cpp @@ -24,6 +24,7 @@ int main() #include #include +# include # include # include @@ -32,9 +33,21 @@ int main() struct Node_1 : public CGAL::Compact_container_base { + Node_1() {} + Node_1(const Node_1& o) : time_stamp_(o.time_stamp_) {} bool operator==(const Node_1 &) const { return true; } bool operator!=(const Node_1 &) const { return false; } bool operator< (const Node_1 &) const { return false; } + + 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; + } + std::size_t time_stamp_; }; class Node_2 @@ -380,6 +393,22 @@ void test(const Cont &) } +template < class Cont > +void test_time_stamps() { + Cont c1; + for (std::size_t i = 0 ; i < 10 ; ++i) + c1.emplace(); + typename Cont::iterator it = c1.begin(); + for (std::size_t i = 0 ; i < 10 ; ++i) { + assert(i == it++->time_stamp()); + } + Cont c2(c1); + it = c2.begin(); + for (std::size_t i = 0 ; i < 10 ; ++i) { + assert(i == it++->time_stamp()); + } +} + int main() { CGAL::Concurrent_compact_container C1; @@ -435,6 +464,8 @@ int main() std::cout << "cc2: " << it->rnd << " / " << std::endl; }*/ + tbb::task_scheduler_init init(1); + test_time_stamps >(); return 0; } diff --git a/Scale_space_reconstruction_3/doc/Scale_space_reconstruction_3/PackageDescription.txt b/Scale_space_reconstruction_3/doc/Scale_space_reconstruction_3/PackageDescription.txt index a39837cd67e..f55f94c895f 100644 --- a/Scale_space_reconstruction_3/doc/Scale_space_reconstruction_3/PackageDescription.txt +++ b/Scale_space_reconstruction_3/doc/Scale_space_reconstruction_3/PackageDescription.txt @@ -1,26 +1,26 @@ -/// \defgroup PkgScaleSpaceReconstruction3 Scale-Space Surface Reconstruction Reference +/// \defgroup PkgScaleSpaceReconstruction3Ref Scale-Space Surface Reconstruction Reference /// \defgroup PkgScaleSpaceReconstruction3Concepts Concepts -/// \ingroup PkgScaleSpaceReconstruction3 +/// \ingroup PkgScaleSpaceReconstruction3Ref /// \defgroup PkgScaleSpaceReconstruction3Classes Classes -/// \ingroup PkgScaleSpaceReconstruction3 +/// \ingroup PkgScaleSpaceReconstruction3Ref /*! -\addtogroup PkgScaleSpaceReconstruction3 -\cgalPkgDescriptionBegin{Scale-Space Surface Reconstruction,PkgScaleSpaceReconstruction3Summary} +\addtogroup PkgScaleSpaceReconstruction3Ref +\cgalPkgDescriptionBegin{Scale-Space Surface Reconstruction,PkgScaleSpaceReconstruction3} \cgalPkgPicture{knot_thumb.png} \cgalPkgSummaryBegin \cgalPkgAuthors{Thijs van Lankveld} \cgalPkgDesc{This method allows to reconstruct a surface that interpolates a set of 3D points using either and alpha shape or the advancing front surface reconstruction method. The output interpolates the point set (as opposed to approximating the point set). How the surface connects the points depends on a scale variable, which can be estimated semi-automatically.} -\cgalPkgManuals{Chapter_Scale_space_reconstruction,PkgScaleSpaceReconstruction3} +\cgalPkgManuals{Chapter_Scale_space_reconstruction,PkgScaleSpaceReconstruction3Ref} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{4.6} \cgalPkgBib{cgal:ssr3} \cgalPkgLicense{\ref licensesGPL "GPL" } -\cgalPkgDependsOn{\ref PkgAlphaShapes3Summary, \ref PkgSpatialSearchingDSummary, \ref PkgSolverSummary} +\cgalPkgDependsOn{\ref PkgAlphaShapes3, \ref PkgSpatialSearchingD, \ref PkgSolverInterface} \cgalPkgShortInfoEnd \cgalPkgDescriptionEnd 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 8da2fc16bb8..bfa682995fa 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 @@ -1,11 +1,10 @@ project( Scale_space_reconstruction_3_Examples ) -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.1) find_package( CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) # Activate concurrency? option(ACTIVATE_CONCURRENCY @@ -19,8 +18,6 @@ if ( CGAL_FOUND ) endif() endif() - include( CGAL_CreateSingleSourceCGALProgram ) - find_package( Eigen3 3.1.0 ) if( EIGEN3_FOUND ) include( ${EIGEN3_USE_FILE} ) diff --git a/Scripts/developer_scripts/Bundle_polyhedron_demo_with_appimage.sh b/Scripts/developer_scripts/Bundle_polyhedron_demo_with_appimage.sh new file mode 100644 index 00000000000..e2911620838 --- /dev/null +++ b/Scripts/developer_scripts/Bundle_polyhedron_demo_with_appimage.sh @@ -0,0 +1,8 @@ +#!/bin/bash +if [ "$1" == '--help' ]; then + echo "Usage: $0 " + echo "Builds and packages the Polyhedron demo form the CGAL dir." + exit 0 +fi +docker run --rm -v "$2":/results:Z -v "$1":/cgal:ro docker.io/cgal/bundle-3d-demo "/scripts/build.sh -j$3 && /scripts/deploy.sh" + diff --git a/Scripts/developer_scripts/autotest_cgal b/Scripts/developer_scripts/autotest_cgal index 27ae791e4ce..848566200f7 100755 --- a/Scripts/developer_scripts/autotest_cgal +++ b/Scripts/developer_scripts/autotest_cgal @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # ---------------------------------------------------- # ---------------------------------------------------- # autotest_cgal: a script to automagically install and @@ -525,7 +525,7 @@ export MAKE_CMD; export CGAL_BINARY_DIR; export CGAL_REFERENCE_CACHE_DIR; cd '${CGAL_BINARY_DIR}'; -cmake '${CMAKE_GENERATOR}' -DRUNNING_CGAL_AUTO_TEST=TRUE \\ +cmake \${INIT_FILE:+"-C\${INIT_FILE}"} '${CMAKE_GENERATOR}' -DRUNNING_CGAL_AUTO_TEST=TRUE \\ -DCGAL_REFERENCE_CACHE_DIR="\$CGAL_REFERENCE_CACHE_DIR" \\ VERBOSE=1 \\ ../../..; diff --git a/Scripts/developer_scripts/cgal_create_package_dir.py b/Scripts/developer_scripts/cgal_create_package_dir.py index 3cbac394149..3dfb122266f 100755 --- a/Scripts/developer_scripts/cgal_create_package_dir.py +++ b/Scripts/developer_scripts/cgal_create_package_dir.py @@ -51,7 +51,7 @@ r"""// PRETTY PACKAGE NAME should equal the project title in Doxyfile.in \addtogroup PkgPACKAGE \todo check generated documentation -\cgalPkgDescriptionBegin{PACKAGE NAME,PkgPACKAGESummary} +\cgalPkgDescriptionBegin{PACKAGE NAME,PkgPACKAGE} \cgalPkgPicture{pkg-small.png} \cgalPkgSummaryBegin diff --git a/Scripts/developer_scripts/cgal_create_release_with_cmake.cmake b/Scripts/developer_scripts/cgal_create_release_with_cmake.cmake index db6119a6bf5..b9c40f0ebc6 100644 --- a/Scripts/developer_scripts/cgal_create_release_with_cmake.cmake +++ b/Scripts/developer_scripts/cgal_create_release_with_cmake.cmake @@ -1,4 +1,5 @@ #option : +# GIT_REPO the path to the Git repository, default is the current working directory # DESTINATION the path where the release is created, default is /tmp # PUBLIC=[ON/OFF] indicates if a public release should be built, default is OFF # VERBOSE=[ON/OFF] makes the script more verbose, default is OFF @@ -7,11 +8,15 @@ # CGAL_VERSION_NR=release string used to update version.h. Must be something like 1041200033 , or 104120090 # TESTSUITE=indicate if the release is meant to be used by the testsuite, default if OFF -if (NOT EXISTS ${CMAKE_BINARY_DIR}/Installation/include/CGAL/version.h) +if (NOT GIT_REPO) + set(GIT_REPO ${CMAKE_BINARY_DIR}) +endif() + +if (NOT EXISTS ${GIT_REPO}/Installation/include/CGAL/version.h) message(FATAL_ERROR "Cannot find Installation/include/CGAL/version.h. Make sure you are at the root of a CGAL branch") endif() -file(READ "${CMAKE_BINARY_DIR}/Installation/include/CGAL/version.h" version_file_content) +file(READ "${GIT_REPO}/Installation/include/CGAL/version.h" version_file_content) string(REGEX MATCH "define CGAL_VERSION (.*)\n#define CGAL_VERSION_NR" CGAL_VERSION_FOUND "${version_file_content}") if (CGAL_VERSION_FOUND) @@ -41,10 +46,10 @@ else() endif() file(MAKE_DIRECTORY "${release_dir}") -file(GLOB files RELATIVE ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/*) +file(GLOB files RELATIVE ${GIT_REPO} ${GIT_REPO}/*) foreach(pkg ${files}) - set(pkg_dir ${CMAKE_BINARY_DIR}/${pkg}) # use absolute path + set(pkg_dir ${GIT_REPO}/${pkg}) # use absolute path if(IS_DIRECTORY ${pkg_dir} AND (NOT "${pkg}" STREQUAL "Maintenance") AND (EXISTS ${pkg_dir}/package_info OR "${pkg}" STREQUAL "Documentation" @@ -73,9 +78,9 @@ foreach(pkg ${files}) if ("${fext}" STREQUAL ".h" OR "${fext}" STREQUAL ".hpp") file(READ "${pkg_dir}/${f}" file_content) string(REPLACE "$URL$" "$URL: ${GITHUB_PREFIX}/${pkg}/${f} $" file_content "${file_content}") - if(EXISTS ${CMAKE_BINARY_DIR}/.git) + if(EXISTS ${GIT_REPO}/.git) execute_process( - COMMAND git --git-dir=${CMAKE_BINARY_DIR}/.git --work-tree=${CMAKE_BINARY_DIR} log -n1 "--format=format:%h %aI %an" -- "${pkg}/${f}" + COMMAND git --git-dir=${GIT_REPO}/.git --work-tree=${GIT_REPO} log -n1 "--format=format:%h %aI %an" -- "${pkg}/${f}" RESULT_VARIABLE RESULT_VAR OUTPUT_VARIABLE OUT_VAR ) @@ -91,7 +96,7 @@ foreach(pkg ${files}) endforeach() if (EXISTS "${release_dir}/doc/${pkg}") #generate filelist.txt used by doxygen ran on a release - file(GLOB_RECURSE includes LIST_DIRECTORIES false RELATIVE "${CMAKE_BINARY_DIR}/${pkg}/include" "${CMAKE_BINARY_DIR}/${pkg}/include/CGAL/*.h") + file(GLOB_RECURSE includes LIST_DIRECTORIES false RELATIVE "${GIT_REPO}/${pkg}/include" "${GIT_REPO}/${pkg}/include/CGAL/*.h") foreach(f ${includes}) file(APPEND "${release_dir}/doc/${pkg}/filelist.txt" "${f}\n") endforeach() @@ -109,9 +114,9 @@ file(WRITE ${release_dir}/VERSION "${CGAL_VERSION}") #edit include/CGAL/version.h file(READ "${release_dir}/include/CGAL/version.h" file_content) # update CGAL_GIT_HASH -if(EXISTS ${CMAKE_BINARY_DIR}/.git) +if(EXISTS ${GIT_REPO}/.git) execute_process( - COMMAND git rev-parse HEAD + COMMAND git --git-dir=${GIT_REPO}/.git rev-parse HEAD RESULT_VARIABLE RESULT_VAR OUTPUT_VARIABLE OUT_VAR ) @@ -131,12 +136,29 @@ file(WRITE ${release_dir}/include/CGAL/version.h "${file_content}") # make an extra copy of examples and demos for the testsuite and generate # create_cgal_test_with_cmake for tests, demos, and examples if (TESTSUITE) + SET(FMT_ARG "format:SCM branch:%n%H %d%n%nShort log from master:%n") + execute_process( + COMMAND git --git-dir=${GIT_REPO}/.git --work-tree=${GIT_REPO} log -n1 --format=${FMT_ARG} + WORKING_DIRECTORY "${release_dir}" + OUTPUT_VARIABLE OUT_VAR + ) +#write result in .scm-branch + file(WRITE ${release_dir}/.scm-branch "${OUT_VAR}") + SET(FMT_ARG "%h %s%n parents: %p%n") + execute_process( + COMMAND git --git-dir=${GIT_REPO}/.git --work-tree=${GIT_REPO} log --first-parent --format=${FMT_ARG} cgal/master.. + WORKING_DIRECTORY "${release_dir}" + OUTPUT_VARIABLE OUT_VAR + ) +#append result in .scm-branch + file(APPEND ${release_dir}/.scm-branch "${OUT_VAR}") + file(GLOB tests RELATIVE "${release_dir}/test" "${release_dir}/test/*") foreach(d ${tests}) if(IS_DIRECTORY "${release_dir}/test/${d}") if(NOT EXISTS "${release_dir}/test/${d}/cgal_test_with_cmake") execute_process( - COMMAND ${CMAKE_BINARY_DIR}/Scripts/developer_scripts/create_cgal_test_with_cmake + COMMAND ${GIT_REPO}/Scripts/developer_scripts/create_cgal_test_with_cmake WORKING_DIRECTORY "${release_dir}/test/${d}" RESULT_VARIABLE RESULT_VAR OUTPUT_VARIABLE OUT_VAR @@ -162,7 +184,7 @@ if (TESTSUITE) file(RENAME "${release_dir}/tmp/${d}" "${release_dir}/test/${d}_Demo") if(NOT EXISTS "${release_dir}/test/${d}_Demo/cgal_test_with_cmake") execute_process( - COMMAND ${CMAKE_BINARY_DIR}/Scripts/developer_scripts/create_cgal_test_with_cmake --no-run + COMMAND ${GIT_REPO}/Scripts/developer_scripts/create_cgal_test_with_cmake --no-run WORKING_DIRECTORY "${release_dir}/test/${d}_Demo" RESULT_VARIABLE RESULT_VAR OUTPUT_VARIABLE OUT_VAR @@ -183,7 +205,7 @@ if (TESTSUITE) file(RENAME "${release_dir}/tmp/${d}" "${release_dir}/test/${d}_Examples") if(NOT EXISTS "${release_dir}/test/${d}_Examples/cgal_test_with_cmake") execute_process( - COMMAND ${CMAKE_BINARY_DIR}/Scripts/developer_scripts/create_cgal_test_with_cmake + COMMAND ${GIT_REPO}/Scripts/developer_scripts/create_cgal_test_with_cmake WORKING_DIRECTORY "${release_dir}/test/${d}_Examples" RESULT_VARIABLE RESULT_VAR OUTPUT_VARIABLE OUT_VAR @@ -195,7 +217,7 @@ if (TESTSUITE) endif() endforeach() file(REMOVE_RECURSE "${release_dir}/tmp") -endif() +endif() #TESTSUITE # removal of extra directories and files file(REMOVE_RECURSE ${release_dir}/benchmark) diff --git a/Scripts/developer_scripts/cgal_git_update_hooks_for_client b/Scripts/developer_scripts/cgal_git_update_hooks_for_client index 2e095c5a565..caac1420362 100755 --- a/Scripts/developer_scripts/cgal_git_update_hooks_for_client +++ b/Scripts/developer_scripts/cgal_git_update_hooks_for_client @@ -32,7 +32,7 @@ if [ ! -e .git ]; then git init fi -if git pull .. remotes/cgal-dev/hooks-for-clients; then +if git pull .. remotes/cgal-public-dev/hooks-for-clients; then echo "Hooks updated." fi cd ../.. diff --git a/Scripts/developer_scripts/create_cgal_test b/Scripts/developer_scripts/create_cgal_test index b65d4b9c3fc..48296e17658 100755 --- a/Scripts/developer_scripts/create_cgal_test +++ b/Scripts/developer_scripts/create_cgal_test @@ -74,20 +74,20 @@ cat << EOF EOF header "configure" -cat << EOF +cat << 'EOF' configure() { echo "Configuring... " - if eval 'cmake "\$CMAKE_GENERATOR" -DRUNNING_CGAL_AUTO_TEST=TRUE \\ - -DCGAL_DIR="\$CGAL_DIR" \\ - --no-warn-unused-cli \\ + if eval 'cmake ${INIT_FILE:+"-C${INIT_FILE}"} "$CMAKE_GENERATOR" -DRUNNING_CGAL_AUTO_TEST=TRUE \ + -DCGAL_DIR="$CGAL_DIR" \ + --no-warn-unused-cli \ .' ; then - echo " successful configuration" >> \$ERRORFILE + echo " successful configuration" >> $ERRORFILE else - echo " ERROR: configuration" >> \$ERRORFILE + echo " ERROR: configuration" >> $ERRORFILE fi } diff --git a/Scripts/developer_scripts/create_new_release b/Scripts/developer_scripts/create_new_release index 055ac8c41fa..9f4ddc266df 100755 --- a/Scripts/developer_scripts/create_new_release +++ b/Scripts/developer_scripts/create_new_release @@ -5,7 +5,6 @@ # Radu Ursu, Sylvain Pion, 2004-2006. # TODO : -# - Use svn revision instead of separate internal release number ? # - Cleanup the public/internal separation: # - have CGAL_VERSION_NR be not affected by the internal version # - have CGAL_REVISION be the revision (replacing the internal number) @@ -13,45 +12,44 @@ # [new] : create_internal_release should not know about internal/public mode. # - Merge [some parts] into ./create_internal_release ? -DO_RPM="" # Also build RPMs (no RPMs by default) DO_PUBLIC="" # Also build the public versions -DO_IT="" # Real mode (svn tag, copy to HTTP server), versus local testing -DO_NOT_TAG="" # If set, do not call svn tag -DO_TAG="" # If set, svn tag is called anyway +DO_IT="" # Real mode (copy to HTTP server), versus local testing +DO_NOT_TAG="" # If set, do not call tag +DO_TAG="" # If set, tag is called anyway NO_TESTUITE="" # If set, the LATEST file is not updated NO_SCM="" # If set, git pull is not called. -SOURCES_DIR="$PWD/trunk" # SVN working copy directory, default is "$PWD/trunk" +SOURCES_DIR="$PWD" # Directory containing the sources, default is "$PWD" VERBOSE="" # Verbose mode (displays log to standard err) BETA="" #If set, will change the release number and version number accordingly. -SCM=svn +DESTINATION="/tmp" +IS_MASTER="y" SOURCES_DIR_HAS_BEEN_SET= -CANDIDATES_DIR_HAS_BEEN_SET= printerr() { echo "$@" >&2; } usage() { - printerr "Usage : $0 [--help] [--rpm] [--public] [--do-it] [--beta ] []" + printerr "Usage : $0 [--help] [--public] [--do-it] [--beta ] " printerr printerr ' --help : prints this usage help' - printerr ' --rpm : also build the corresponding SRPMs' printerr ' --public : also build the corresponding public versions' printerr ' --do-it : the real thing (NOT for local tests! Only for the release' printerr ' master! Does write operations (updating the version_number,' - printerr ' svn tag, copying on the web server...)' + printerr ' tag, copying on the web server...)' printerr ' --do-not-tag : when used with --do-it, the tag is not created.' printerr ' --tag : when used without --do-it, the tag is created, but files' printerr ' are not published' - printerr ' --no-scm-update : do not "svn update" or "git pull"' + printerr ' --no-scm-update : do not "git pull"' printerr ' --no-testsuite : when used with --do-it, the tag is made, files are published,' printerr ' but the LATEST file is not updated.' printerr ' --verbose : print log to standard output, instead of the log file' printerr ' --beta : followed by a number. When used with --public, will modify the release number and the release version name to include beta' + printerr ' --dest : followed by the path to where the release should be created. Default is /tmp.' + printerr ' --is_master : replace the Ic in the name by I.' printerr ' : the directory containing the packages [default is trunk]' - printerr ' : the directory containing the candidate packages [no default]' } @@ -62,12 +60,8 @@ while [ $1 ]; do usage; exit; ;; - --rpm) - DO_RPM="y" - shift; continue - ;; --public) - DO_PUBLIC="y" + DO_PUBLIC="ON" shift; continue ;; --do-it) @@ -91,7 +85,7 @@ while [ $1 ]; do shift; continue ;; --verbose) - VERBOSE="y" + VERBOSE="ON" shift; continue ;; --beta) @@ -104,6 +98,15 @@ while [ $1 ]; do shift; continue ;; + --dest) + shift + DESTINATION=$1 + shift;continue + ;; + --is_master) + IS_MASTER="y" + shift;continue + ;; -*) printerr "Unrecognized option : $1" exit @@ -113,9 +116,9 @@ while [ $1 ]; do SOURCES_DIR="$1" SOURCES_DIR_HAS_BEEN_SET=y shift; continue - elif [ -z "$CANDIDATES_DIR_HAS_BEEN_SET" ]; then - CANDIDATES_DIR="$1" - CANDIDATES_DIR_HAS_BEEN_SET=y + elif [ -n "$IS_MASTER" ]; then + # Compatibility with the old syntax with candidates + IS_MASTER="" shift; continue else printerr "Unrecognized option : $1" @@ -132,8 +135,6 @@ VERSION_FILE="version_number" HTML_DIR="/u/agrion/geometrica/CGAL/Members/Releases" URL="http://cgal.inria.fr/CGAL/Members/Releases" -# SVN repository -SVNCGAL="svn+ssh://scm.gforge.inria.fr/svn/cgal" PATH=$PATH:/usr/local/bin:/usr/bin/gnu @@ -168,22 +169,15 @@ set -e cd ${TMPDIR} || return # Update the working copy -if [ -d "${SOURCES_DIR}/.git" ]; then +if [ -e "${SOURCES_DIR}/.git" ]; then pushd "${SOURCES_DIR}" [ -z "$NO_SCM" ] && git pull CGAL_GIT_HASH=`git rev-parse HEAD` - CGAL_SVN_REVISION=99999 popd - SCM=git else - [ -z "$NO_SCM" ] && svn update ${SOURCES_DIR} - CGAL_SVN_REVISION=`svn info ${SOURCES_DIR} | grep Revision | cut -d' ' -f2` - CGAL_GIT_HASH=n/a + echo "Not a git repository" + exit 1 fi -if [ "$SCM" = "svn" -a -n "${CANDIDATES_DIR_HAS_BEEN_SET}" ]; then - [ -z "$NO_SCM" ] && svn update ${CANDIDATES_DIR} -fi - # Set the major/minor/bugfix release numbers NUMBERS_DIR=${SOURCES_DIR}/Maintenance/release_building MAJOR_NUMBER=`cat ${NUMBERS_DIR}/MAJOR_NUMBER` # 2 digits max @@ -202,13 +196,13 @@ if [ -r $VERSION_FILE ]; then INTERNAL_NUMBER=$(( `cat $VERSION_FILE` + 1 )) [ -n "$DO_TAG" ] && printf "%d\n" "${INTERNAL_NUMBER}" > $VERSION_FILE else - INTERNAL_NUMBER=$((`svn ls $SVNCGAL/tags/internal-releases | awk "/${MAJOR_NUMBER}\\.${MINOR_NUMBER}${BUGFIX_STRING}/ "'{FS="-|/"; print $4}' | sort -n | tail -1` + 1 )) + echo "Need a \"version_number\" file." fi if [ -z "$INTERNAL_NUMBER" ]; then INTERNAL_NUMBER=1 fi -if [ -n "${CANDIDATES_DIR_HAS_BEEN_SET}" ]; then +if [ -z "${IS_MASTER}" ]; then INTERNAL_STRING="-Ic-${INTERNAL_NUMBER}" else INTERNAL_STRING="-I-${INTERNAL_NUMBER}" @@ -217,10 +211,11 @@ fi internal_nr=`printf "%4s" "${INTERNAL_NUMBER}" | sed "y/ /0/"` if [ -r "${NUMBERS_DIR}/release_name" ]; then - release_name=`cat "${NUMBERS_DIR}/release_name"`${INTERNAL_STRING} + release_version=`cat "${NUMBERS_DIR}/release_name"`${INTERNAL_STRING} else - release_name="CGAL-${MAJOR_NUMBER}.${MINOR_NUMBER}${BUGFIX_STRING}${INTERNAL_STRING}" + release_version="${MAJOR_NUMBER}.${MINOR_NUMBER}${BUGFIX_STRING}${INTERNAL_STRING}" fi +release_name="CGAL-${release_version}" echo "${release_name}" major_nr=`printf "%2s" "${MAJOR_NUMBER}" | sed "y/ /0/"` minor_nr=`printf "%2s" "${MINOR_NUMBER}" | sed "y/ /0/"` @@ -235,8 +230,15 @@ fi function cleanup() { # Remove local directory and tarball - rm -rf ./"${release_name}" - rm ${release_name}.tar.gz + if [ -d ${release_name} ]; then + rm -rf ./"${release_name}" + fi + if [ -d "${DESTINATION}/${release_name}" ]; then + rm -rf "${DESTINATION}/${release_name}" + fi + if [ -f ${release_name}.tar.gz ]; then + rm ${release_name}.tar.gz + fi if [ -n "$DO_PUBLIC" ]; then [ -d "${public_release_name}" ] && rm -rf ./"${public_release_name}" rm -rf doc @@ -249,14 +251,8 @@ function cleanup() { trap cleanup EXIT # Create the release -if [ -n "$CANDIDATES_DIR_HAS_BEEN_SET" ]; then - ${SOURCES_DIR}/Scripts/developer_scripts/create_internal_release -a ${SOURCES_DIR} -c ${CANDIDATES_DIR} -r ${release_name} -n ${release_number} -else - ${SOURCES_DIR}/Scripts/developer_scripts/create_internal_release -a ${SOURCES_DIR} -r ${release_name} -n ${release_number} -fi -# Add the SVN revision to version.h -cd "${release_name}" -sed -i -e "s/define CGAL_SVN_REVISION .*/define CGAL_SVN_REVISION $CGAL_SVN_REVISION/" include/CGAL/version.h +cmake -DGIT_REPO=${SOURCES_DIR} -DPUBLIC=NO -DTESTSUITE=ON -DDESTINATION="${DESTINATION}" -DCGAL_VERSION="${release_version}" -DCGAL_VERSION_NR="${release_number}" -DVERBOSE="${VERBOSE}" -P ${SOURCES_DIR}/Scripts/developer_scripts/cgal_create_release_with_cmake.cmake +pushd "${DESTINATION}/${release_name}" sed -i -e "s/define CGAL_GIT_HASH .*/define CGAL_GIT_HASH $CGAL_GIT_HASH/" include/CGAL/version.h cd .. # Make the release tarball @@ -269,6 +265,7 @@ ln -s "${release_name}.tar.gz" "$HTML_DIR/CGAL-last.tar.gz" if [ -z "${NO_TESTSUITE}" ]; then echo "${release_name}.tar.gz" > "${HTML_DIR}/LATEST" fi +popd # Tag if [ -n "$DO_TAG" ]; then @@ -284,20 +281,8 @@ if [ -n "$DO_TAG" ]; then if [ -n "$NO_TESTSUITE" ]; then TAG_MSG_EXTRA=" (no testsuite)" fi - [ "$SCM" = "svn" ] && svn cp -m "Internal release tag for $release_name$TAG_MSG_EXTRA (automated commit)" ${SOURCES_DIR} $SVNCGAL/tags/internal-releases/$release_name fi -# Build the SRPM -if [ "$DO_RPM" ]; then - echo "Making the SRPM file" - rm -rf rpm - cp -r ${SOURCES_DIR}/Maintenance/rpm . - cp ${release_name}.tar.gz rpm/SOURCES/ - make -C rpm CGAL.src CGAL_INTERNAL_RELEASE=${INTERNAL_NUMBER} - echo "`basename rpm/SRPMS/*.src.rpm`" > "${HTML_DIR}/LATEST_SRPM" - mv rpm/SRPMS/*.src.rpm "${HTML_DIR}" - rm -rf rpm -fi # Build public release version if [ -n "$DO_PUBLIC" ]; then @@ -309,19 +294,17 @@ if [ -n "$DO_PUBLIC" ]; then fi public_release_version="${MAJOR_NUMBER}.${MINOR_NUMBER}${BUGFIX_STRING}" if [ -n "$BETA" ]; then - public_release_name="CGAL-${public_release_version}-beta${BETA}" - elif [ -r "${NUMBERS_DIR}/public_release_name" ]; then + public_release_version="${public_release_version}-beta${BETA}" + fi + if [ -r "${NUMBERS_DIR}/public_release_name" ]; then public_release_name=`cat "${NUMBERS_DIR}/public_release_name"` + public_release_version=${public_release_name#CGAL-} else public_release_name="CGAL-${public_release_version}" fi - mv -T ${release_name} $public_release_name - cd ${public_release_name} - rm -rf bench* Bench* test package_info developer_scripts doc winutils include/CGAL/Test include/CGAL/Testsuite/ - rm -f examples/*/cgal_test* demo/*/cgal_test* - find . -name .scm-urls -exec rm '{}' '+' - rm -f .scm-branch + cmake -DGIT_REPO=${SOURCES_DIR} -DPUBLIC="ON" -DDESTINATION="${DESTINATION}" -DCGAL_VERSION="${public_release_version}" -DCGAL_VERSION_NR="${release_number}" -DVERBOSE="${VERBOSE}" -P ${SOURCES_DIR}/Scripts/developer_scripts/cgal_create_release_with_cmake.cmake + pushd "${DESTINATION}/${public_release_name}" # Modify the version numbers in sed -i -e "s/define CGAL_VERSION .*/define CGAL_VERSION $public_release_version/" -e "s/define CGAL_VERSION_NR .*/define CGAL_VERSION_NR $public_release_number/" include/CGAL/version.h @@ -343,28 +326,21 @@ if [ -n "$DO_PUBLIC" ]; then cp "${public_release_name}.zip" "${HTML_DIR}/${release_name}-public/" rm -f "$HTML_DIR/CGAL-last-public" ln -s "${release_name}-public" "$HTML_DIR/CGAL-last-public" -fi - -# Build the SRPM of the public version -if [ -n "$DO_RPM" -a -n "$DO_PUBLIC" ]; then - echo "Making the SRPM public file" - rm -rf rpm - cp -r ${SOURCES_DIR}/Maintenance/rpm . - cp ${public_release_name}.tar.gz rpm/SOURCES/ - make -C rpm CGAL.src - # echo "`basename rpm/SRPMS/*.src.rpm`" > "${HTML_DIR}/LATEST_SRPM" - mv rpm/SRPMS/*.src.rpm "${HTML_DIR}/${release_name}-public/" - rm -rf rpm + popd fi if [ -n "$DO_PUBLIC" ]; then - # Build the Windows installer - docker pull cgal/cgal-nsis-dockerfile - docker create -v `realpath ${public_release_name}`:/mnt/cgal_release:ro,z \ - -v ${SOURCES_DIR}:/mnt/cgal_sources:ro,z \ - cgal/cgal-nsis-dockerfile - container_id=`docker ps -q -l` - docker start -a ${container_id} - docker cp ${container_id}:/nsis_release/${public_release_name}-Setup.exe "${HTML_DIR}/${release_name}-public/" - docker rm ${container_id} + if docker version > /dev/null; then + # Build the Windows installer + docker pull cgal/cgal-nsis-dockerfile + docker create -v `realpath ${DESTINATION}/${public_release_name}`:/mnt/cgal_release:ro,z \ + -v ${SOURCES_DIR}:/mnt/cgal_sources:ro,z \ + cgal/cgal-nsis-dockerfile + container_id=`docker ps -q -l` + docker start -a ${container_id} + docker cp ${container_id}:/nsis_release/${public_release_name}-Setup.exe "${HTML_DIR}/${release_name}-public/" + docker rm ${container_id} + else + echo "Cannot use Docker, the Windows installer will not be created" >&2 + fi fi diff --git a/Scripts/developer_scripts/test_merge_of_branch b/Scripts/developer_scripts/test_merge_of_branch index 8915bc8b8af..fca78d160d2 100755 --- a/Scripts/developer_scripts/test_merge_of_branch +++ b/Scripts/developer_scripts/test_merge_of_branch @@ -85,7 +85,7 @@ fi #check cmake scripts of tests, examples are present echo '.. Checking if all CMakeLists.txt are present...' -for i in `ls -d ^build*/examples/*/ ^build*/test/*/`; do +for i in `ls -d ^build*/examples/*/ ^build*/test/*/ ^build*/demo/^(icons|resources)/`; do if ! [ -f $i/CMakeLists.txt ]; then echo "Error: $i/CMakeLists.txt does not exist!" exit 1 @@ -130,7 +130,7 @@ fi echo '.. Checking $Id$ tag presence in header files...' file_without_Id_tag=$(for pkg in `find */package_info -name 'license.txt' | awk -F "/" '{print $1}'`; do if [ -e ${pkg}/include ]; then find ${pkg}/include -type f \( -name '*.h' -o -name '*.hpp' \) | xargs -r grep -L '$Id\$'; fi; done) if [ -n "${file_without_Id_tag}" ]; then - echo 'The following files do not have a $URL$ tag:' + echo 'The following files do not have a $Id$ tag:' echo ${file_without_Id_tag} exit 1 fi diff --git a/Scripts/scripts/cgal_create_CMakeLists b/Scripts/scripts/cgal_create_CMakeLists index bcbf427b2d0..63453a6d5f8 100755 --- a/Scripts/scripts/cgal_create_CMakeLists +++ b/Scripts/scripts/cgal_create_CMakeLists @@ -184,9 +184,6 @@ if ( NOT CGAL_FOUND ) endif() -# include helper file -include( ${CGAL_USE_FILE} ) - EOF #--------------------------------------------------------------------------- @@ -240,9 +237,6 @@ EOF #--------------------------------------------------------------------------- # includes for local package - if [ -d ../../include ] ; then - echo 'include_directories( BEFORE ../../include )' - fi if [ -d ../include ] ; then echo 'include_directories( BEFORE ../include )' fi @@ -320,15 +314,6 @@ EOF #------------------------------------------------------------------------- - if [ "$qt4" = "y" ]; then - - echo "include( CGAL_CreateSingleSourceCGALProgramQt4 )" - - else - - echo "include( CGAL_CreateSingleSourceCGALProgram )" - - fi # add a new line echo diff --git a/Scripts/scripts/cgal_create_cmake_script b/Scripts/scripts/cgal_create_cmake_script index 456bfb2408b..1722483fd0b 100755 --- a/Scripts/scripts/cgal_create_cmake_script +++ b/Scripts/scripts/cgal_create_cmake_script @@ -56,19 +56,11 @@ find_package(CGAL QUIET COMPONENTS Core ) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - EOF if [ -d "${SOURCE_DIR}" ] ; then echo " set(CGAL_CURRENT_SOURCE_DIR \"${SOURCE_DIR}\")" echo fi - if [ -d "${SOURCE_DIR}../../include" ] ; then - echo " include_directories (BEFORE \"${SOURCE_DIR}../../include\")" - echo - fi if [ -d "${SOURCE_DIR}../include" ] ; then echo " include_directories (BEFORE \"${SOURCE_DIR}../include\")" echo diff --git a/SearchStructures/doc/SearchStructures/CGAL/Range_segment_tree_traits.h b/SearchStructures/doc/SearchStructures/CGAL/Range_segment_tree_traits.h index b7d677ad267..9f1e6414b86 100644 --- a/SearchStructures/doc/SearchStructures/CGAL/Range_segment_tree_traits.h +++ b/SearchStructures/doc/SearchStructures/CGAL/Range_segment_tree_traits.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgRangeSegmentTreesDTraitsClasses +\ingroup PkgSearchStructuresTraitsClasses The class `Range_segment_tree_traits_set_2` is a range and segment tree traits class for the 2-dimensional point class from the \cgal kernel. The class is @@ -34,7 +34,7 @@ std::pair Interval; namespace CGAL { /*! -\ingroup PkgRangeSegmentTreesDTraitsClasses +\ingroup PkgSearchStructuresTraitsClasses The class `Range_segment_tree_traits_set_3` is a range and segment tree traits class for the 3-dimensional point class from the \cgal kernel. @@ -66,7 +66,7 @@ std::pair Interval; namespace CGAL { /*! -\ingroup PkgRangeSegmentTreesDTraitsClasses +\ingroup PkgSearchStructuresTraitsClasses The class `Range_tree_traits_map_2` is a range tree traits class for the 2-dimensional point class from the \cgal kernel, where data of @@ -100,7 +100,7 @@ std::pair Interval; namespace CGAL { /*! -\ingroup PkgRangeSegmentTreesDTraitsClasses +\ingroup PkgSearchStructuresTraitsClasses The class `Range_tree_traits_map_3` is a range and segment tree traits class for the 3-dimensional point class from the \cgal kernel, where data of @@ -134,7 +134,7 @@ std::pair Interval; namespace CGAL { /*! -\ingroup PkgRangeSegmentTreesDTraitsClasses +\ingroup PkgSearchStructuresTraitsClasses The class `Segment_tree_traits_map_2` is a segment tree traits class for the 2-dimensional point class from the \cgal kernel, where data of @@ -168,7 +168,7 @@ std::pair,T> Interval; namespace CGAL { /*! -\ingroup PkgRangeSegmentTreesDTraitsClasses +\ingroup PkgSearchStructuresTraitsClasses The class `Segment_tree_traits_map_3` is a segment tree traits class for the 3-dimensional point class from the \cgal kernel, where data of diff --git a/SearchStructures/doc/SearchStructures/CGAL/Range_tree_d.h b/SearchStructures/doc/SearchStructures/CGAL/Range_tree_d.h index 15e8a9b87ca..0d74a2202be 100644 --- a/SearchStructures/doc/SearchStructures/CGAL/Range_tree_d.h +++ b/SearchStructures/doc/SearchStructures/CGAL/Range_tree_d.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgRangeSegmentTreesDSearchStructure +\ingroup PkgSearchStructuresSearchStructure \brief A \f$ d\f$-dimensional range tree stores points and can be used to determine all points that lie inside a given \f$ d\f$-dimensional interval. diff --git a/SearchStructures/doc/SearchStructures/CGAL/Range_tree_k.h b/SearchStructures/doc/SearchStructures/CGAL/Range_tree_k.h index 3bd397bb3bf..5fcce8ce587 100644 --- a/SearchStructures/doc/SearchStructures/CGAL/Range_tree_k.h +++ b/SearchStructures/doc/SearchStructures/CGAL/Range_tree_k.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgRangeSegmentTreesDSearchStructure +\ingroup PkgSearchStructuresSearchStructure An object of the class `Range_tree_k` is a \f$ k\f$-dimensional range tree that can store k-dimensional keys of type `Key`. diff --git a/SearchStructures/doc/SearchStructures/CGAL/Segment_tree_d.h b/SearchStructures/doc/SearchStructures/CGAL/Segment_tree_d.h index 0ac98512573..f9d47f49619 100644 --- a/SearchStructures/doc/SearchStructures/CGAL/Segment_tree_d.h +++ b/SearchStructures/doc/SearchStructures/CGAL/Segment_tree_d.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgRangeSegmentTreesDSearchStructure +\ingroup PkgSearchStructuresSearchStructure \brief A \f$ d\f$-dimensional segment tree stores \f$ d\f$-dimensional intervals and can be used to find all intervals that enclose, partially overlap, or contain a query interval, which may be a point. diff --git a/SearchStructures/doc/SearchStructures/CGAL/Segment_tree_k.h b/SearchStructures/doc/SearchStructures/CGAL/Segment_tree_k.h index 11c401e114a..5ec8550999b 100644 --- a/SearchStructures/doc/SearchStructures/CGAL/Segment_tree_k.h +++ b/SearchStructures/doc/SearchStructures/CGAL/Segment_tree_k.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgRangeSegmentTreesDSearchStructure +\ingroup PkgSearchStructuresSearchStructure An object of the class `Segment_tree_k` is a \f$ k\f$-dimensional segment tree that can store k-dimensional intervals of type `Interval`. diff --git a/SearchStructures/doc/SearchStructures/CGAL/Tree_base.h b/SearchStructures/doc/SearchStructures/CGAL/Tree_base.h index 6feffa1d1b4..7799dc653cb 100644 --- a/SearchStructures/doc/SearchStructures/CGAL/Tree_base.h +++ b/SearchStructures/doc/SearchStructures/CGAL/Tree_base.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgRangeSegmentTreesD +\ingroup PkgSearchStructuresRef `Tree_anchor` is also derived from `Tree_base`. Therefore, it provides the same methods as `Range_tree_d` and `Segment_tree_d`, but does diff --git a/SearchStructures/doc/SearchStructures/CGAL/Tree_traits.h b/SearchStructures/doc/SearchStructures/CGAL/Tree_traits.h index 695d77311ef..024efae1126 100644 --- a/SearchStructures/doc/SearchStructures/CGAL/Tree_traits.h +++ b/SearchStructures/doc/SearchStructures/CGAL/Tree_traits.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgRangeSegmentTreesDTraitsClasses +\ingroup PkgSearchStructuresTraitsClasses `tree_interval_traits` is a template class that provides an interface to data items. It is similar to @@ -142,7 +142,7 @@ static bool comp(Key& key1, Key& key2); namespace CGAL { /*! -\ingroup PkgRangeSegmentTreesDTraitsClasses +\ingroup PkgSearchStructuresTraitsClasses `tree_point_traits` is a template class that provides an interface to data items. diff --git a/SearchStructures/doc/SearchStructures/Concepts/RangeSegmentTreeTraits_k.h b/SearchStructures/doc/SearchStructures/Concepts/RangeSegmentTreeTraits_k.h index 0c68d484b35..3e172861b92 100644 --- a/SearchStructures/doc/SearchStructures/Concepts/RangeSegmentTreeTraits_k.h +++ b/SearchStructures/doc/SearchStructures/Concepts/RangeSegmentTreeTraits_k.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgRangeSegmentTreesDConcepts +\ingroup PkgSearchStructuresConcepts \cgalConcept A tree traits class gives the range tree and segment tree class the necessary diff --git a/SearchStructures/doc/SearchStructures/Concepts/Sublayer.h b/SearchStructures/doc/SearchStructures/Concepts/Sublayer.h index ffae6f67506..c3425e09c3b 100644 --- a/SearchStructures/doc/SearchStructures/Concepts/Sublayer.h +++ b/SearchStructures/doc/SearchStructures/Concepts/Sublayer.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgRangeSegmentTreesDConcepts +\ingroup PkgSearchStructuresConcepts \cgalConcept Defines the requirements that a diff --git a/SearchStructures/doc/SearchStructures/PackageDescription.txt b/SearchStructures/doc/SearchStructures/PackageDescription.txt index e6f3cd1a575..8cd20d12ed2 100644 --- a/SearchStructures/doc/SearchStructures/PackageDescription.txt +++ b/SearchStructures/doc/SearchStructures/PackageDescription.txt @@ -1,22 +1,22 @@ -/// \defgroup PkgRangeSegmentTreesD dD Range and Segment Trees Reference -/// \defgroup PkgRangeSegmentTreesDConcepts Concepts -/// \ingroup PkgRangeSegmentTreesD +/// \defgroup PkgSearchStructuresRef dD Range and Segment Trees Reference +/// \defgroup PkgSearchStructuresConcepts Concepts +/// \ingroup PkgSearchStructuresRef -/// \defgroup PkgRangeSegmentTreesDTraitsClasses Traits Classes -/// \ingroup PkgRangeSegmentTreesD +/// \defgroup PkgSearchStructuresTraitsClasses Traits Classes +/// \ingroup PkgSearchStructuresRef -/// \defgroup PkgRangeSegmentTreesDSearchStructure Search Structures -/// \ingroup PkgRangeSegmentTreesD +/// \defgroup PkgSearchStructuresSearchStructure Search Structures +/// \ingroup PkgSearchStructuresRef /*! -\addtogroup PkgRangeSegmentTreesD +\addtogroup PkgSearchStructuresRef \todo check generated documentation -\cgalPkgDescriptionBegin{dD Range and Segment Trees,PkgRangeSegmentTreesDSummary} +\cgalPkgDescriptionBegin{dD Range and Segment Trees,PkgSearchStructures} \cgalPkgPicture{segment_tree.png} \cgalPkgSummaryBegin \cgalPkgAuthor{Gabriele Neyer} \cgalPkgDesc{%Range and segment trees allow to perform window queries on point sets, and to enumerate all ranges enclosing a query point. The provided data structures are static and they are optimized for fast queries.} -\cgalPkgManuals{Chapter_dD_Range_and_Segment_Trees,PkgRangeSegmentTreesD} +\cgalPkgManuals{Chapter_dD_Range_and_Segment_Trees,PkgSearchStructuresRef} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{0.9} diff --git a/SearchStructures/examples/RangeSegmentTrees/CMakeLists.txt b/SearchStructures/examples/RangeSegmentTrees/CMakeLists.txt index efc7c664c6e..8f06d64b9d5 100644 --- a/SearchStructures/examples/RangeSegmentTrees/CMakeLists.txt +++ b/SearchStructures/examples/RangeSegmentTrees/CMakeLists.txt @@ -1,17 +1,11 @@ project( RangeSegmentTrees_Examples ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/SearchStructures/test/RangeSegmentTrees/CMakeLists.txt b/SearchStructures/test/RangeSegmentTrees/CMakeLists.txt index 4c4cd3077a4..6b83c29ab11 100644 --- a/SearchStructures/test/RangeSegmentTrees/CMakeLists.txt +++ b/SearchStructures/test/RangeSegmentTrees/CMakeLists.txt @@ -4,18 +4,12 @@ project( RangeSegmentTrees_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - include_directories (BEFORE "../../include") - create_single_source_cgal_program( "test_segment_tree_set_2.cpp" ) else() 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 08152286d2b..2ab90937fb8 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 @@ -4,18 +4,14 @@ project( Segment_Delaunay_graph_2_example ) -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET COMPONENTS Core ) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - include_directories (BEFORE ../../include) + include(${CGAL_USE_FILE}) create_single_source_cgal_program( "benchmark.cpp" ) create_single_source_cgal_program( "benchmark_nox.cpp" ) diff --git a/Segment_Delaunay_graph_2/doc/Segment_Delaunay_graph_2/CGAL/Segment_Delaunay_graph_2.h b/Segment_Delaunay_graph_2/doc/Segment_Delaunay_graph_2/CGAL/Segment_Delaunay_graph_2.h index b027e98202f..88f940e398f 100644 --- a/Segment_Delaunay_graph_2/doc/Segment_Delaunay_graph_2/CGAL/Segment_Delaunay_graph_2.h +++ b/Segment_Delaunay_graph_2/doc/Segment_Delaunay_graph_2/CGAL/Segment_Delaunay_graph_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgSegmentDelaunayGraph2 +\ingroup PkgSegmentDelaunayGraph2Ref The class `Segment_Delaunay_graph_2` represents the segment Delaunay graph (which is the dual graph of the 2D segment Voronoi diagram). diff --git a/Segment_Delaunay_graph_2/doc/Segment_Delaunay_graph_2/CGAL/Segment_Delaunay_graph_filtered_traits_2.h b/Segment_Delaunay_graph_2/doc/Segment_Delaunay_graph_2/CGAL/Segment_Delaunay_graph_filtered_traits_2.h index efe1816766d..eabca2b1001 100644 --- a/Segment_Delaunay_graph_2/doc/Segment_Delaunay_graph_2/CGAL/Segment_Delaunay_graph_filtered_traits_2.h +++ b/Segment_Delaunay_graph_2/doc/Segment_Delaunay_graph_2/CGAL/Segment_Delaunay_graph_filtered_traits_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgSegmentDelaunayGraph2 +\ingroup PkgSegmentDelaunayGraph2Ref The class `Segment_Delaunay_graph_filtered_traits_2` provides a model for the `SegmentDelaunayGraphTraits_2` concept. @@ -150,7 +150,7 @@ typedef unspecified_type Exact_traits; namespace CGAL { /*! -\ingroup PkgSegmentDelaunayGraph2 +\ingroup PkgSegmentDelaunayGraph2Ref The class `Segment_Delaunay_graph_filtered_traits_without_intersections_2` provides a model for the `SegmentDelaunayGraphTraits_2` concept. diff --git a/Segment_Delaunay_graph_2/doc/Segment_Delaunay_graph_2/CGAL/Segment_Delaunay_graph_hierarchy_2.h b/Segment_Delaunay_graph_2/doc/Segment_Delaunay_graph_2/CGAL/Segment_Delaunay_graph_hierarchy_2.h index fed2677c2ee..4e60298c8af 100644 --- a/Segment_Delaunay_graph_2/doc/Segment_Delaunay_graph_2/CGAL/Segment_Delaunay_graph_hierarchy_2.h +++ b/Segment_Delaunay_graph_2/doc/Segment_Delaunay_graph_2/CGAL/Segment_Delaunay_graph_hierarchy_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgSegmentDelaunayGraph2 +\ingroup PkgSegmentDelaunayGraph2Ref We provide an alternative to the class `Segment_Delaunay_graph_2` for the incremental diff --git a/Segment_Delaunay_graph_2/doc/Segment_Delaunay_graph_2/CGAL/Segment_Delaunay_graph_hierarchy_vertex_base_2.h b/Segment_Delaunay_graph_2/doc/Segment_Delaunay_graph_2/CGAL/Segment_Delaunay_graph_hierarchy_vertex_base_2.h index 14c07257944..91b29a16620 100644 --- a/Segment_Delaunay_graph_2/doc/Segment_Delaunay_graph_2/CGAL/Segment_Delaunay_graph_hierarchy_vertex_base_2.h +++ b/Segment_Delaunay_graph_2/doc/Segment_Delaunay_graph_2/CGAL/Segment_Delaunay_graph_hierarchy_vertex_base_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgSegmentDelaunayGraph2 +\ingroup PkgSegmentDelaunayGraph2Ref The class `Segment_Delaunay_graph_hierarchy_vertex_base_2` provides a model for the `SegmentDelaunayGraphHierarchyVertexBase_2` concept, which is the diff --git a/Segment_Delaunay_graph_2/doc/Segment_Delaunay_graph_2/CGAL/Segment_Delaunay_graph_site_2.h b/Segment_Delaunay_graph_2/doc/Segment_Delaunay_graph_2/CGAL/Segment_Delaunay_graph_site_2.h index 8453319b95e..5a9ac423e12 100644 --- a/Segment_Delaunay_graph_2/doc/Segment_Delaunay_graph_2/CGAL/Segment_Delaunay_graph_site_2.h +++ b/Segment_Delaunay_graph_2/doc/Segment_Delaunay_graph_2/CGAL/Segment_Delaunay_graph_site_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgSegmentDelaunayGraph2 +\ingroup PkgSegmentDelaunayGraph2Ref The class `Segment_Delaunay_graph_site_2` is a model for the concept `SegmentDelaunayGraphSite_2`. diff --git a/Segment_Delaunay_graph_2/doc/Segment_Delaunay_graph_2/CGAL/Segment_Delaunay_graph_storage_site_2.h b/Segment_Delaunay_graph_2/doc/Segment_Delaunay_graph_2/CGAL/Segment_Delaunay_graph_storage_site_2.h index 5b51c5e4360..0b76d67103f 100644 --- a/Segment_Delaunay_graph_2/doc/Segment_Delaunay_graph_2/CGAL/Segment_Delaunay_graph_storage_site_2.h +++ b/Segment_Delaunay_graph_2/doc/Segment_Delaunay_graph_2/CGAL/Segment_Delaunay_graph_storage_site_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgSegmentDelaunayGraph2 +\ingroup PkgSegmentDelaunayGraph2Ref The class `Segment_Delaunay_graph_storage_site_2` is a model for the concept `SegmentDelaunayGraphStorageSite_2`. diff --git a/Segment_Delaunay_graph_2/doc/Segment_Delaunay_graph_2/CGAL/Segment_Delaunay_graph_traits_2.h b/Segment_Delaunay_graph_2/doc/Segment_Delaunay_graph_2/CGAL/Segment_Delaunay_graph_traits_2.h index 5d915262170..ec45c0ff065 100644 --- a/Segment_Delaunay_graph_2/doc/Segment_Delaunay_graph_2/CGAL/Segment_Delaunay_graph_traits_2.h +++ b/Segment_Delaunay_graph_2/doc/Segment_Delaunay_graph_2/CGAL/Segment_Delaunay_graph_traits_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgSegmentDelaunayGraph2 +\ingroup PkgSegmentDelaunayGraph2Ref The class `Segment_Delaunay_graph_traits_2` provides a model for the `SegmentDelaunayGraphTraits_2` concept. @@ -74,7 +74,7 @@ typedef MTag Method_tag; namespace CGAL { /*! -\ingroup PkgSegmentDelaunayGraph2 +\ingroup PkgSegmentDelaunayGraph2Ref The class `Segment_Delaunay_graph_traits_without_intersections_2` provides a model for the `SegmentDelaunayGraphTraits_2` concept. diff --git a/Segment_Delaunay_graph_2/doc/Segment_Delaunay_graph_2/CGAL/Segment_Delaunay_graph_vertex_base_2.h b/Segment_Delaunay_graph_2/doc/Segment_Delaunay_graph_2/CGAL/Segment_Delaunay_graph_vertex_base_2.h index dfd1c5ef860..8b35879a460 100644 --- a/Segment_Delaunay_graph_2/doc/Segment_Delaunay_graph_2/CGAL/Segment_Delaunay_graph_vertex_base_2.h +++ b/Segment_Delaunay_graph_2/doc/Segment_Delaunay_graph_2/CGAL/Segment_Delaunay_graph_vertex_base_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgSegmentDelaunayGraph2 +\ingroup PkgSegmentDelaunayGraph2Ref The class `Segment_Delaunay_graph_vertex_base_2` provides a model for the `SegmentDelaunayGraphVertexBase_2` concept which is the vertex diff --git a/Segment_Delaunay_graph_2/doc/Segment_Delaunay_graph_2/PackageDescription.txt b/Segment_Delaunay_graph_2/doc/Segment_Delaunay_graph_2/PackageDescription.txt index ad569d97e61..7aa1920b67d 100644 --- a/Segment_Delaunay_graph_2/doc/Segment_Delaunay_graph_2/PackageDescription.txt +++ b/Segment_Delaunay_graph_2/doc/Segment_Delaunay_graph_2/PackageDescription.txt @@ -1,19 +1,19 @@ -/// \defgroup PkgSegmentDelaunayGraph2 2D Segment Delaunay Graphs Reference +/// \defgroup PkgSegmentDelaunayGraph2Ref 2D Segment Delaunay Graphs Reference /// \defgroup PkgSegmentDelaunayGraph2Concepts Concepts -/// \ingroup PkgSegmentDelaunayGraph2 +/// \ingroup PkgSegmentDelaunayGraph2Ref /*! -\addtogroup PkgSegmentDelaunayGraph2 +\addtogroup PkgSegmentDelaunayGraph2Ref \todo check generated documentation -\cgalPkgDescriptionBegin{2D Segment Delaunay Graphs,PkgSegmentDelaunayGraph2Summary} +\cgalPkgDescriptionBegin{2D Segment Delaunay Graphs,PkgSegmentDelaunayGraph2} \cgalPkgPicture{svd.png} \cgalPkgSummaryBegin \cgalPkgAuthor{Menelaos Karavelas} \cgalPkgDesc{An algorithm for computing the dual of a Voronoi diagram of a set of segments under the Euclidean metric. It is a generalization of the standard Voronoi diagram for points. The algorithms provided are dynamic.} -\cgalPkgManuals{Chapter_2D_Segment_Delaunay_Graphs,PkgSegmentDelaunayGraph2} +\cgalPkgManuals{Chapter_2D_Segment_Delaunay_Graphs,PkgSegmentDelaunayGraph2Ref} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{3.1} -\cgalPkgDependsOn{\ref PkgTDS2Summary} +\cgalPkgDependsOn{\ref PkgTDS2} \cgalPkgBib{cgal:k-sdg2} \cgalPkgLicense{\ref licensesGPL} \cgalPkgDemo{2D Segment Voronoi Diagram,segment_voronoi_diagram_2.zip} diff --git a/Segment_Delaunay_graph_2/examples/Segment_Delaunay_graph_2/CMakeLists.txt b/Segment_Delaunay_graph_2/examples/Segment_Delaunay_graph_2/CMakeLists.txt index ec807d81314..23695a3e08f 100644 --- a/Segment_Delaunay_graph_2/examples/Segment_Delaunay_graph_2/CMakeLists.txt +++ b/Segment_Delaunay_graph_2/examples/Segment_Delaunay_graph_2/CMakeLists.txt @@ -4,18 +4,12 @@ project( Segment_Delaunay_graph_2_Examples ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Segment_Delaunay_graph_2/test/Segment_Delaunay_graph_2/CMakeLists.txt b/Segment_Delaunay_graph_2/test/Segment_Delaunay_graph_2/CMakeLists.txt index bca8defb9ec..fd781f8a8cf 100644 --- a/Segment_Delaunay_graph_2/test/Segment_Delaunay_graph_2/CMakeLists.txt +++ b/Segment_Delaunay_graph_2/test/Segment_Delaunay_graph_2/CMakeLists.txt @@ -4,19 +4,14 @@ project( Segment_Delaunay_graph_2_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET COMPONENTS Core ) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - include_directories (BEFORE "../../include") - - include_directories (BEFORE "include") + include(${CGAL_USE_FILE}) + include_directories (BEFORE "include") # create a target per cppfile file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.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 21ffaa6736c..71ed0203b7f 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 @@ -4,18 +4,14 @@ project( Segment_Delaunay_graph_2_example ) -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET COMPONENTS Core ) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - include_directories (BEFORE ../../include) + include(${CGAL_USE_FILE}) create_single_source_cgal_program( "sdg-creation-time.cpp" ) create_single_source_cgal_program( "benchmark-gen.cpp" ) diff --git a/Segment_Delaunay_graph_Linf_2/doc/Segment_Delaunay_graph_Linf_2/CGAL/Segment_Delaunay_graph_Linf_2.h b/Segment_Delaunay_graph_Linf_2/doc/Segment_Delaunay_graph_Linf_2/CGAL/Segment_Delaunay_graph_Linf_2.h index e42b0215104..39ff240f8ac 100644 --- a/Segment_Delaunay_graph_Linf_2/doc/Segment_Delaunay_graph_Linf_2/CGAL/Segment_Delaunay_graph_Linf_2.h +++ b/Segment_Delaunay_graph_Linf_2/doc/Segment_Delaunay_graph_Linf_2/CGAL/Segment_Delaunay_graph_Linf_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgSDGLinf +\ingroup PkgSegmentDelaunayGraphLinf2Ref The class `Segment_Delaunay_graph_Linf_2` represents the segment Delaunay graph under the \f$ L_{\infty} \f$ metric (which is diff --git a/Segment_Delaunay_graph_Linf_2/doc/Segment_Delaunay_graph_Linf_2/CGAL/Segment_Delaunay_graph_Linf_filtered_traits_2.h b/Segment_Delaunay_graph_Linf_2/doc/Segment_Delaunay_graph_Linf_2/CGAL/Segment_Delaunay_graph_Linf_filtered_traits_2.h index 8ed68312025..a72aa365f48 100644 --- a/Segment_Delaunay_graph_Linf_2/doc/Segment_Delaunay_graph_Linf_2/CGAL/Segment_Delaunay_graph_Linf_filtered_traits_2.h +++ b/Segment_Delaunay_graph_Linf_2/doc/Segment_Delaunay_graph_Linf_2/CGAL/Segment_Delaunay_graph_Linf_filtered_traits_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgSDGLinf +\ingroup PkgSegmentDelaunayGraphLinf2Ref The class `Segment_Delaunay_graph_Linf_filtered_traits_2` provides a model for the `SegmentDelaunayGraphLinfTraits_2` concept. @@ -34,7 +34,7 @@ struct Segment_Delaunay_graph_Linf_filtered_traits_2 { namespace CGAL { /*! -\ingroup PkgSDGLinf +\ingroup PkgSegmentDelaunayGraphLinf2Ref The class `Segment_Delaunay_graph_Linf_filtered_traits_without_intersections_2` provides a model for the diff --git a/Segment_Delaunay_graph_Linf_2/doc/Segment_Delaunay_graph_Linf_2/CGAL/Segment_Delaunay_graph_Linf_hierarchy_2.h b/Segment_Delaunay_graph_Linf_2/doc/Segment_Delaunay_graph_Linf_2/CGAL/Segment_Delaunay_graph_Linf_hierarchy_2.h index 3242e220287..99f951a0643 100644 --- a/Segment_Delaunay_graph_Linf_2/doc/Segment_Delaunay_graph_Linf_2/CGAL/Segment_Delaunay_graph_Linf_hierarchy_2.h +++ b/Segment_Delaunay_graph_Linf_2/doc/Segment_Delaunay_graph_Linf_2/CGAL/Segment_Delaunay_graph_Linf_hierarchy_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgSDGLinf +\ingroup PkgSegmentDelaunayGraphLinf2Ref This class is equivalent to the `Segment_Delaunay_graph_hierarchy_2` class, but it uses `Segment_Delaunay_graph_Linf_2` diff --git a/Segment_Delaunay_graph_Linf_2/doc/Segment_Delaunay_graph_Linf_2/CGAL/Segment_Delaunay_graph_Linf_traits_2.h b/Segment_Delaunay_graph_Linf_2/doc/Segment_Delaunay_graph_Linf_2/CGAL/Segment_Delaunay_graph_Linf_traits_2.h index d5e21605e23..e5c0d0c526a 100644 --- a/Segment_Delaunay_graph_Linf_2/doc/Segment_Delaunay_graph_Linf_2/CGAL/Segment_Delaunay_graph_Linf_traits_2.h +++ b/Segment_Delaunay_graph_Linf_2/doc/Segment_Delaunay_graph_Linf_2/CGAL/Segment_Delaunay_graph_Linf_traits_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgSDGLinf +\ingroup PkgSegmentDelaunayGraphLinf2Ref The class `Segment_Delaunay_graph_Linf_traits_2` provides a model for the `SegmentDelaunayGraphLinfTraits_2` concept. @@ -36,7 +36,7 @@ struct Segment_Delaunay_graph_Linf_traits_2 { namespace CGAL { /*! -\ingroup PkgSDGLinf +\ingroup PkgSegmentDelaunayGraphLinf2Ref The class `Segment_Delaunay_graph_Linf_traits_without_intersections_2` provides a model for the diff --git a/Segment_Delaunay_graph_Linf_2/doc/Segment_Delaunay_graph_Linf_2/Concepts/SegmentDelaunayGraphLinfTraits_2.h b/Segment_Delaunay_graph_Linf_2/doc/Segment_Delaunay_graph_Linf_2/Concepts/SegmentDelaunayGraphLinfTraits_2.h index 91d05d48337..d654765e03c 100644 --- a/Segment_Delaunay_graph_Linf_2/doc/Segment_Delaunay_graph_Linf_2/Concepts/SegmentDelaunayGraphLinfTraits_2.h +++ b/Segment_Delaunay_graph_Linf_2/doc/Segment_Delaunay_graph_Linf_2/Concepts/SegmentDelaunayGraphLinfTraits_2.h @@ -1,5 +1,5 @@ /*! -\ingroup PkgSDGLinfConcepts +\ingroup PkgSegmentDelaunayGraphLinf2Concepts \cgalConcept The concept `SegmentDelaunayGraphLinfTraits_2` provides traits diff --git a/Segment_Delaunay_graph_Linf_2/doc/Segment_Delaunay_graph_Linf_2/PackageDescription.txt b/Segment_Delaunay_graph_Linf_2/doc/Segment_Delaunay_graph_Linf_2/PackageDescription.txt index 52b93543f4b..a0130582785 100644 --- a/Segment_Delaunay_graph_Linf_2/doc/Segment_Delaunay_graph_Linf_2/PackageDescription.txt +++ b/Segment_Delaunay_graph_Linf_2/doc/Segment_Delaunay_graph_Linf_2/PackageDescription.txt @@ -1,12 +1,12 @@ -/// \defgroup PkgSDGLinf L Infinity Segment Delaunay Graphs Reference -/// \defgroup PkgSDGLinfConcepts Concepts -/// \ingroup PkgSDGLinf +/// \defgroup PkgSegmentDelaunayGraphLinf2Ref L Infinity Segment Delaunay Graphs Reference +/// \defgroup PkgSegmentDelaunayGraphLinf2Concepts Concepts +/// \ingroup PkgSegmentDelaunayGraphLinf2Ref /*! -\addtogroup PkgSDGLinf +\addtogroup PkgSegmentDelaunayGraphLinf2Ref \todo check generated documentation -\cgalPkgDescriptionBegin{L Infinity Segment Delaunay Graphs,PkgSDGLinfSummary} +\cgalPkgDescriptionBegin{L Infinity Segment Delaunay Graphs,PkgSegmentDelaunayGraphLinf2} \cgalPkgPicture{sdglinf-small.png} \cgalPkgSummaryBegin @@ -14,12 +14,12 @@ \cgalPkgDesc{Algorithms and geometric traits for computing the dual of the Voronoi diagram of a set of points and segments under the \f$L_{\infty}\f$ metric.} -\cgalPkgManuals{Chapter_L_Infinity_Segment_Delaunay_Graphs,PkgSDGLinf} +\cgalPkgManuals{Chapter_L_Infinity_Segment_Delaunay_Graphs,PkgSegmentDelaunayGraphLinf2Ref} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{4.7} -\cgalPkgDependsOn{\ref PkgSegmentDelaunayGraph2Summary} +\cgalPkgDependsOn{\ref PkgSegmentDelaunayGraph2} \cgalPkgBib{cgal:cdp-sdglinf2} \cgalPkgLicense{\ref licensesGPL "GPL"} \cgalPkgShortInfoEnd diff --git a/Segment_Delaunay_graph_Linf_2/doc/Segment_Delaunay_graph_Linf_2/Segment_Delaunay_graph_Linf_2.txt b/Segment_Delaunay_graph_Linf_2/doc/Segment_Delaunay_graph_Linf_2/Segment_Delaunay_graph_Linf_2.txt index 4750eb74287..40748ee0987 100644 --- a/Segment_Delaunay_graph_Linf_2/doc/Segment_Delaunay_graph_Linf_2/Segment_Delaunay_graph_Linf_2.txt +++ b/Segment_Delaunay_graph_Linf_2/doc/Segment_Delaunay_graph_Linf_2/Segment_Delaunay_graph_Linf_2.txt @@ -112,7 +112,7 @@ In general, the software design of the algorithms and traits for the corresponding algorithms and traits for the \f$ L_{2} \f$ Segment Delaunay graph. We implement the \f$ L_{\infty} \f$ classes as subclasses of corresponding \f$ L_{2} \f$ classes from the -package \ref PkgSegmentDelaunayGraph2Summary. +package \ref PkgSegmentDelaunayGraph2. The names of the \f$ L_{\infty} \f$ classes contain an additional `_Linf` after `graph`, in comparison with the corresponding \f$ L_{2} \f$ classes. For more details, see \cgalCite{cdgp-icms-2014}. diff --git a/Segment_Delaunay_graph_Linf_2/examples/Segment_Delaunay_graph_Linf_2/CMakeLists.txt b/Segment_Delaunay_graph_Linf_2/examples/Segment_Delaunay_graph_Linf_2/CMakeLists.txt index f252173bc1d..553dba5a125 100644 --- a/Segment_Delaunay_graph_Linf_2/examples/Segment_Delaunay_graph_Linf_2/CMakeLists.txt +++ b/Segment_Delaunay_graph_Linf_2/examples/Segment_Delaunay_graph_Linf_2/CMakeLists.txt @@ -4,19 +4,13 @@ project( Segment_Delaunay_graph_Linf_2_Examples ) -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - include_directories (BEFORE "../../include") - create_single_source_cgal_program( "sdg-count-sites-linf.cpp" ) create_single_source_cgal_program( "sdg-fast-sp-linf.cpp" ) create_single_source_cgal_program( "sdg-fast-sp-polygon-linf.cpp" ) diff --git a/Segment_Delaunay_graph_Linf_2/test/Segment_Delaunay_graph_Linf_2/CMakeLists.txt b/Segment_Delaunay_graph_Linf_2/test/Segment_Delaunay_graph_Linf_2/CMakeLists.txt index 585c72bb282..29802b5b30c 100644 --- a/Segment_Delaunay_graph_Linf_2/test/Segment_Delaunay_graph_Linf_2/CMakeLists.txt +++ b/Segment_Delaunay_graph_Linf_2/test/Segment_Delaunay_graph_Linf_2/CMakeLists.txt @@ -4,19 +4,14 @@ project( Segment_Delaunay_graph_Linf_2_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET COMPONENTS Core ) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - include_directories (BEFORE "../../include") - - include_directories (BEFORE "include") + include(${CGAL_USE_FILE}) + include_directories (BEFORE "include") # create a target per cppfile file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) diff --git a/Set_movable_separability_2/doc/Set_movable_separability_2/PackageDescription.txt b/Set_movable_separability_2/doc/Set_movable_separability_2/PackageDescription.txt index d67eb0b8c9d..4375f343a6d 100644 --- a/Set_movable_separability_2/doc/Set_movable_separability_2/PackageDescription.txt +++ b/Set_movable_separability_2/doc/Set_movable_separability_2/PackageDescription.txt @@ -1,18 +1,18 @@ -/// \defgroup PkgSetMovableSeparability2 2D Movable Separability of Sets Reference +/// \defgroup PkgSetMovableSeparability2Ref 2D Movable Separability of Sets Reference /// \defgroup top_edges_grp Top Edges /// These function determine whether a cavity (of a mold in the plane) /// that has the shape of a given polygon could be casted in the mold /// and then pulled out of the mold without colliding into the mold (but /// possibly sliding along the mold boundary). -/// \ingroup PkgSetMovableSeparability2 +/// \ingroup PkgSetMovableSeparability2Ref /// \defgroup is_pullout_direction_grp Is Pullout Direction /// These functions determine whether a cavity (of a mold in the plane) /// that has the shape of a given polygon could be casted in the mold /// and then pulled out of the mold in a given direction without colliding /// into the mold (but possibly sliding along the mold boundary). -/// \ingroup PkgSetMovableSeparability2 +/// \ingroup PkgSetMovableSeparability2Ref /// \defgroup pullout_directions_grp Pullout Directions /// These functions determine whether a cavity (of a mold in the plane) @@ -21,14 +21,14 @@ /// without colliding into the mold (but possibly sliding along the mold /// boundary). If the polygon is castable this way, the function /// computes the closed range of pullout directions. -/// \ingroup PkgSetMovableSeparability2 +/// \ingroup PkgSetMovableSeparability2Ref /// \defgroup PkgSetMovableSeparability2Concepts Concepts -/// \ingroup PkgSetMovableSeparability2 +/// \ingroup PkgSetMovableSeparability2Ref /*! -\addtogroup PkgSetMovableSeparability2 -\cgalPkgDescriptionBegin{2D Movable Separability of Sets,PkgSetMovableSeparability2Summary} +\addtogroup PkgSetMovableSeparability2Ref +\cgalPkgDescriptionBegin{2D Movable Separability of Sets,PkgSetMovableSeparability2} \cgalPkgPicture{Casting_2.png} \cgalPkgSummaryBegin \cgalPkgAuthors{Shahar Shamai, Efi Fogel} @@ -37,11 +37,11 @@ class of problems that deal with moving sets of objects, such as polygons in the plane; the challenge is to avoid collisions between the objects while considering different kinds of motions and various definitions of separation.} -\cgalPkgManuals{Chapter_SetMovableSeparability2,PkgSetMovableSeparability2} +\cgalPkgManuals{Chapter_SetMovableSeparability2,PkgSetMovableSeparability2Ref} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{4.12} -\cgalPkgDependsOn{\ref PkgPolygon2Summary} +\cgalPkgDependsOn{\ref PkgPolygon2} \cgalPkgBib{cgal:sf-sms2} \cgalPkgLicense{\ref licensesGPL "GPL"} \cgalPkgShortInfoEnd 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 9d46350f63d..c37b85c338c 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 @@ -18,9 +18,6 @@ set(CMAKE_CXX_STANDARD_REQUIRED TRUE) find_package(CGAL QUIET COMPONENTS ) if (CGAL_FOUND) - include( ${CGAL_USE_FILE} ) - include( CGAL_CreateSingleSourceCGALProgram ) - include_directories (BEFORE "../../include") 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" ) 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 eb482e7fd3d..a2a4916572d 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 @@ -25,9 +25,6 @@ set(CMAKE_CXX_STANDARD_REQUIRED TRUE) find_package(CGAL QUIET COMPONENTS ) if (CGAL_FOUND) - include( ${CGAL_USE_FILE} ) - include( CGAL_CreateSingleSourceCGALProgram ) - include_directories (BEFORE "../../include") 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" ) diff --git a/Set_movable_separability_2/test/Set_movable_separability_2/cgal_test_with_cmake b/Set_movable_separability_2/test/Set_movable_separability_2/cgal_test_with_cmake index 6ecbcff56f4..fc1dcde3929 100755 --- a/Set_movable_separability_2/test/Set_movable_separability_2/cgal_test_with_cmake +++ b/Set_movable_separability_2/test/Set_movable_separability_2/cgal_test_with_cmake @@ -26,7 +26,7 @@ configure() { echo "Configuring... " - if eval 'cmake "$CMAKE_GENERATOR" -DRUNNING_CGAL_AUTO_TEST=TRUE \ + if eval 'cmake ${INIT_FILE:+"-C${INIT_FILE}"} "$CMAKE_GENERATOR" -DRUNNING_CGAL_AUTO_TEST=TRUE \ -DCGAL_DIR="$CGAL_DIR" \ .' ; then diff --git a/Skin_surface_3/doc/Skin_surface_3/CGAL/Skin_surface_3.h b/Skin_surface_3/doc/Skin_surface_3/CGAL/Skin_surface_3.h index 43fe3738db0..2ff4d1a05ca 100644 --- a/Skin_surface_3/doc/Skin_surface_3/CGAL/Skin_surface_3.h +++ b/Skin_surface_3/doc/Skin_surface_3/CGAL/Skin_surface_3.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgSkinSurface3 +\ingroup PkgSkinSurface3Ref The `Skin_surface_3` is the main class in this package. It is a model of the concept `SkinSurface_3`. diff --git a/Skin_surface_3/doc/Skin_surface_3/CGAL/Skin_surface_polyhedral_items_3.h b/Skin_surface_3/doc/Skin_surface_3/CGAL/Skin_surface_polyhedral_items_3.h index 0a9442df293..e2e8e5584ae 100644 --- a/Skin_surface_3/doc/Skin_surface_3/CGAL/Skin_surface_polyhedral_items_3.h +++ b/Skin_surface_3/doc/Skin_surface_3/CGAL/Skin_surface_polyhedral_items_3.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgSkinSurface3 +\ingroup PkgSkinSurface3Ref An items class for the `Polyhedron_3` that stores information in faces instead of an auxiliary data structure. Using it accelerates the subdivision function `subdivide_skin_surface_mesh_3()`. */ diff --git a/Skin_surface_3/doc/Skin_surface_3/CGAL/Skin_surface_traits_3.h b/Skin_surface_3/doc/Skin_surface_3/CGAL/Skin_surface_traits_3.h index 9ab34f3c30a..eb1d74ac693 100644 --- a/Skin_surface_3/doc/Skin_surface_3/CGAL/Skin_surface_traits_3.h +++ b/Skin_surface_3/doc/Skin_surface_3/CGAL/Skin_surface_traits_3.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgSkinSurface3 +\ingroup PkgSkinSurface3Ref The class `Skin_surface_traits_3` is designed as a default traits class for the class `Skin_surface_3`. It is a model of diff --git a/Skin_surface_3/doc/Skin_surface_3/CGAL/Union_of_balls_3.h b/Skin_surface_3/doc/Skin_surface_3/CGAL/Union_of_balls_3.h index 04e523e559e..821e5910268 100644 --- a/Skin_surface_3/doc/Skin_surface_3/CGAL/Union_of_balls_3.h +++ b/Skin_surface_3/doc/Skin_surface_3/CGAL/Union_of_balls_3.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgSkinSurface3 +\ingroup PkgSkinSurface3Ref The `Union_of_balls_3` is used to represent a skin surface with shrink factor equal to one, which is the boundary of the union of the input diff --git a/Skin_surface_3/doc/Skin_surface_3/CGAL/make_skin_surface_mesh_3.h b/Skin_surface_3/doc/Skin_surface_3/CGAL/make_skin_surface_mesh_3.h index 2df94dec5fb..bc6093aab44 100644 --- a/Skin_surface_3/doc/Skin_surface_3/CGAL/make_skin_surface_mesh_3.h +++ b/Skin_surface_3/doc/Skin_surface_3/CGAL/make_skin_surface_mesh_3.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgSkinSurface3 +\ingroup PkgSkinSurface3Ref constructs a mesh of the skin surface defined by the weighted points and the shrink factor. diff --git a/Skin_surface_3/doc/Skin_surface_3/CGAL/mesh_skin_surface_3.h b/Skin_surface_3/doc/Skin_surface_3/CGAL/mesh_skin_surface_3.h index 8ab6fe9ca0b..c18efb9fb39 100644 --- a/Skin_surface_3/doc/Skin_surface_3/CGAL/mesh_skin_surface_3.h +++ b/Skin_surface_3/doc/Skin_surface_3/CGAL/mesh_skin_surface_3.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgSkinSurface3 +\ingroup PkgSkinSurface3Ref constructs a mesh of the `skin_surface` in `p`. diff --git a/Skin_surface_3/doc/Skin_surface_3/CGAL/subdivide_skin_surface_mesh_3.h b/Skin_surface_3/doc/Skin_surface_3/CGAL/subdivide_skin_surface_mesh_3.h index 85c3ef465fa..820aff81571 100644 --- a/Skin_surface_3/doc/Skin_surface_3/CGAL/subdivide_skin_surface_mesh_3.h +++ b/Skin_surface_3/doc/Skin_surface_3/CGAL/subdivide_skin_surface_mesh_3.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgSkinSurface3 +\ingroup PkgSkinSurface3Ref subdivides a skin surface mesh constructed diff --git a/Skin_surface_3/doc/Skin_surface_3/PackageDescription.txt b/Skin_surface_3/doc/Skin_surface_3/PackageDescription.txt index bb541cb99ae..f6d3b35216b 100644 --- a/Skin_surface_3/doc/Skin_surface_3/PackageDescription.txt +++ b/Skin_surface_3/doc/Skin_surface_3/PackageDescription.txt @@ -1,20 +1,20 @@ -/// \defgroup PkgSkinSurface3 3D Skin Surface Meshing Reference +/// \defgroup PkgSkinSurface3Ref 3D Skin Surface Meshing Reference /// \defgroup PkgSkinSurface3Concepts Concepts -/// \ingroup PkgSkinSurface3 +/// \ingroup PkgSkinSurface3Ref /*! -\addtogroup PkgSkinSurface3 +\addtogroup PkgSkinSurface3Ref -\cgalPkgDescriptionBegin{3D Skin Surface Meshing,PkgSkinSurface3Summary} +\cgalPkgDescriptionBegin{3D Skin Surface Meshing,PkgSkinSurface3} \cgalPkgPicture{small.png} \cgalPkgSummaryBegin \cgalPkgAuthor{Nico Kruithof} \cgalPkgDesc{This package allows to build a triangular mesh of a skin surface. Skin surfaces are used for modeling large molecules in biological computing. The surface is defined by a set of balls, representing the atoms of the molecule, and a shrink factor that determines the size of the smooth patches gluing the balls together. The construction of a triangular mesh of a smooth skin surface is often necessary for further analysis and for fast visualization. This package provides functions to construct a triangular mesh approximating the skin surface from a set of balls and a shrink factor. It also contains code to subdivide the mesh efficiently. } -\cgalPkgManuals{Chapter_3D_Skin_Surface_Meshing,PkgSkinSurface3} +\cgalPkgManuals{Chapter_3D_Skin_Surface_Meshing,PkgSkinSurface3Ref} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{3.3} -\cgalPkgDependsOn{\ref PkgTriangulation3Summary and \ref PkgPolyhedronSummary} +\cgalPkgDependsOn{\ref PkgTriangulation3 and \ref PkgPolyhedron} \cgalPkgBib{cgal:k-ssm3} \cgalPkgLicense{\ref licensesGPL "GPL"} \cgalPkgShortInfoEnd diff --git a/Skin_surface_3/examples/Skin_surface_3/CMakeLists.txt b/Skin_surface_3/examples/Skin_surface_3/CMakeLists.txt index 11af4e485bf..eb188b326f1 100644 --- a/Skin_surface_3/examples/Skin_surface_3/CMakeLists.txt +++ b/Skin_surface_3/examples/Skin_surface_3/CMakeLists.txt @@ -3,7 +3,7 @@ project( Skin_surface_3_Examples ) -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.1) find_package(CGAL) @@ -12,9 +12,6 @@ find_package(CGAL) if (CGAL_FOUND) - include( ${CGAL_USE_FILE} ) - include( CGAL_CreateSingleSourceCGALProgram ) - include_directories (BEFORE include) if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/NGHK_skin_surface_simple.cpp") diff --git a/Skin_surface_3/test/Skin_surface_3/CMakeLists.txt b/Skin_surface_3/test/Skin_surface_3/CMakeLists.txt index e5525949d78..36a09ddce8b 100644 --- a/Skin_surface_3/test/Skin_surface_3/CMakeLists.txt +++ b/Skin_surface_3/test/Skin_surface_3/CMakeLists.txt @@ -4,18 +4,12 @@ project( Skin_surface_3_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Snap_rounding_2/doc/Snap_rounding_2/CGAL/Snap_rounding_2.h b/Snap_rounding_2/doc/Snap_rounding_2/CGAL/Snap_rounding_2.h index 4874ee272f8..e407669d24c 100644 --- a/Snap_rounding_2/doc/Snap_rounding_2/CGAL/Snap_rounding_2.h +++ b/Snap_rounding_2/doc/Snap_rounding_2/CGAL/Snap_rounding_2.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgSnapRounding2 +\ingroup PkgSnapRounding2Ref \f$ \def\A{{\cal A}} \f$ \f$ \def\S{{\cal S}} \f$ diff --git a/Snap_rounding_2/doc/Snap_rounding_2/CGAL/Snap_rounding_traits_2.h b/Snap_rounding_2/doc/Snap_rounding_2/CGAL/Snap_rounding_traits_2.h index bd3222545b8..8e0c352ef33 100644 --- a/Snap_rounding_2/doc/Snap_rounding_2/CGAL/Snap_rounding_traits_2.h +++ b/Snap_rounding_2/doc/Snap_rounding_2/CGAL/Snap_rounding_traits_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgSnapRounding2 +\ingroup PkgSnapRounding2Ref The class `Snap_rounding_traits_2` is a model of the `SnapRoundingTraits_2` concept, and is the only traits class supplied diff --git a/Snap_rounding_2/doc/Snap_rounding_2/PackageDescription.txt b/Snap_rounding_2/doc/Snap_rounding_2/PackageDescription.txt index 908837d8052..39d8c15bcd7 100644 --- a/Snap_rounding_2/doc/Snap_rounding_2/PackageDescription.txt +++ b/Snap_rounding_2/doc/Snap_rounding_2/PackageDescription.txt @@ -1,19 +1,19 @@ -/// \defgroup PkgSnapRounding2 2D Snap Rounding Reference +/// \defgroup PkgSnapRounding2Ref 2D Snap Rounding Reference /// \defgroup PkgSnapRounding2Concepts Concepts -/// \ingroup PkgSnapRounding2 +/// \ingroup PkgSnapRounding2Ref /*! -\addtogroup PkgSnapRounding2 +\addtogroup PkgSnapRounding2Ref \todo check generated documentation -\cgalPkgDescriptionBegin{2D Snap Rounding,PkgSnapRounding2Summary} +\cgalPkgDescriptionBegin{2D Snap Rounding,PkgSnapRounding2} \cgalPkgPicture{snap-detail.png} \cgalPkgSummaryBegin \cgalPkgAuthor{Eli Packer} \cgalPkgDesc{Snap Rounding is a well known method for converting arbitrary-precision arrangements of segments into a fixed-precision representation. In the study of robust geometric computing, it can be classified as a finite precision approximation technique. Iterated Snap Rounding is a modification of Snap Rounding in which each vertex is at least half-the-width-of-a-pixel away from any non-incident edge. This package supports both methods.} -\cgalPkgManuals{Chapter_2D_Snap_Rounding,PkgSnapRounding2} +\cgalPkgManuals{Chapter_2D_Snap_Rounding,PkgSnapRounding2Ref} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{3.1} -\cgalPkgDependsOn{\ref PkgArrangement2Summary} +\cgalPkgDependsOn{\ref PkgArrangementOnSurface2} \cgalPkgBib{cgal:p-sr2} \cgalPkgLicense{\ref licensesGPL "GPL"} \cgalPkgDemo{2D Snap Rounding,snap_rounding_2.zip} diff --git a/Snap_rounding_2/examples/Snap_rounding_2/CMakeLists.txt b/Snap_rounding_2/examples/Snap_rounding_2/CMakeLists.txt index 22511418695..224ff142065 100644 --- a/Snap_rounding_2/examples/Snap_rounding_2/CMakeLists.txt +++ b/Snap_rounding_2/examples/Snap_rounding_2/CMakeLists.txt @@ -4,18 +4,12 @@ project( Snap_rounding_2_Examples ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Snap_rounding_2/test/Snap_rounding_2/CMakeLists.txt b/Snap_rounding_2/test/Snap_rounding_2/CMakeLists.txt index 83d6f2a81b0..13598b9fe4c 100644 --- a/Snap_rounding_2/test/Snap_rounding_2/CMakeLists.txt +++ b/Snap_rounding_2/test/Snap_rounding_2/CMakeLists.txt @@ -4,18 +4,12 @@ project( Snap_rounding_2_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - include_directories (BEFORE "../../include") - create_single_source_cgal_program( test_snap_rounding_2.cpp NO_TESTING) function(add_Snap_rounding_tests name) diff --git a/Solver_interface/doc/Solver_interface/Concepts/DiagonalizeTraits.h b/Solver_interface/doc/Solver_interface/Concepts/DiagonalizeTraits.h index 1badaed4564..f982dfc50ad 100644 --- a/Solver_interface/doc/Solver_interface/Concepts/DiagonalizeTraits.h +++ b/Solver_interface/doc/Solver_interface/Concepts/DiagonalizeTraits.h @@ -1,5 +1,5 @@ /*! -\ingroup PkgSolverConcepts +\ingroup PkgSolverInterfaceConcepts \cgalConcept Concept providing functions to extract eigenvectors and eigenvalues diff --git a/Solver_interface/doc/Solver_interface/Concepts/NormalEquationSparseLinearAlgebraTraits_d.h b/Solver_interface/doc/Solver_interface/Concepts/NormalEquationSparseLinearAlgebraTraits_d.h index b911a11cdde..33235cef1dd 100644 --- a/Solver_interface/doc/Solver_interface/Concepts/NormalEquationSparseLinearAlgebraTraits_d.h +++ b/Solver_interface/doc/Solver_interface/Concepts/NormalEquationSparseLinearAlgebraTraits_d.h @@ -1,5 +1,5 @@ /*! -\ingroup PkgSolverConcepts +\ingroup PkgSolverInterfaceConcepts \cgalConcept diff --git a/Solver_interface/doc/Solver_interface/Concepts/SparseLinearAlgebraTraits_d.h b/Solver_interface/doc/Solver_interface/Concepts/SparseLinearAlgebraTraits_d.h index 194359620e8..8d8c480670f 100644 --- a/Solver_interface/doc/Solver_interface/Concepts/SparseLinearAlgebraTraits_d.h +++ b/Solver_interface/doc/Solver_interface/Concepts/SparseLinearAlgebraTraits_d.h @@ -1,5 +1,5 @@ /*! -\ingroup PkgSolverConcepts +\ingroup PkgSolverInterfaceConcepts \cgalConcept diff --git a/Solver_interface/doc/Solver_interface/Concepts/SparseLinearAlgebraWithFactorTraits_d.h b/Solver_interface/doc/Solver_interface/Concepts/SparseLinearAlgebraWithFactorTraits_d.h index d057b1e3135..9adf9c35a6d 100644 --- a/Solver_interface/doc/Solver_interface/Concepts/SparseLinearAlgebraWithFactorTraits_d.h +++ b/Solver_interface/doc/Solver_interface/Concepts/SparseLinearAlgebraWithFactorTraits_d.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgSolverConcepts +\ingroup PkgSolverInterfaceConcepts \cgalConcept @brief Concept describing the set of requirements for a direct sparse linear system solver with factorization. diff --git a/Solver_interface/doc/Solver_interface/Concepts/SvdTraits.h b/Solver_interface/doc/Solver_interface/Concepts/SvdTraits.h index 884eb36a35b..ba6236639eb 100644 --- a/Solver_interface/doc/Solver_interface/Concepts/SvdTraits.h +++ b/Solver_interface/doc/Solver_interface/Concepts/SvdTraits.h @@ -1,5 +1,5 @@ /*! - \ingroup PkgSolverConcepts + \ingroup PkgSolverInterfaceConcepts \cgalConcept The concept `SvdTraits` describes the linear algebra types and algorithms needed diff --git a/Solver_interface/doc/Solver_interface/PackageDescription.txt b/Solver_interface/doc/Solver_interface/PackageDescription.txt index c8cb3e86a2d..255cbc8d473 100644 --- a/Solver_interface/doc/Solver_interface/PackageDescription.txt +++ b/Solver_interface/doc/Solver_interface/PackageDescription.txt @@ -1,17 +1,17 @@ -/// \defgroup PkgSolver CGAL and Solvers Reference +/// \defgroup PkgSolverInterfaceRef CGAL and Solvers Reference -/// \defgroup PkgSolverConcepts Concepts -/// \ingroup PkgSolver +/// \defgroup PkgSolverInterfaceConcepts Concepts +/// \ingroup PkgSolverInterfaceRef /// /*! -\addtogroup PkgSolver -\cgalPkgDescriptionBegin{CGAL and Solvers,PkgSolverSummary} +\addtogroup PkgSolverInterfaceRef +\cgalPkgDescriptionBegin{CGAL and Solvers,PkgSolverInterface} \cgalPkgPicture{solver.png} \cgalPkgSummaryBegin \cgalPkgAuthors{Simon Giraudot, Pierre Alliez, Frédéric Cazals, Gaël Guennebaud, Bruno Lévy, Marc Pouget, and Laurent Saboret} \cgalPkgDesc{This package provides concepts and models for solving linear systems with dense or sparse matrices.} -\cgalPkgManuals{Chapter_CGAL_and_Solvers,PkgSolver} +\cgalPkgManuals{Chapter_CGAL_and_Solvers,PkgSolverInterfaceRef} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{4.8} diff --git a/Solver_interface/doc/Solver_interface/Solver_interface.txt b/Solver_interface/doc/Solver_interface/Solver_interface.txt index 8025bd5cafd..d833f601a1b 100644 --- a/Solver_interface/doc/Solver_interface/Solver_interface.txt +++ b/Solver_interface/doc/Solver_interface/Solver_interface.txt @@ -90,12 +90,12 @@ the solver: \section SolversHistory Implementation History This package is the result of the increasing needs for linear solvers in \cgal. The first packages that introduced the solver concepts were -\ref PkgSurfaceParameterization, \ref PkgPoissonSurfaceReconstruction -and \ref PkgJet_fitting_3. At that time, these packages were relying +\ref PkgSurfaceMeshParameterizationRef, \ref PkgPoissonSurfaceReconstruction3Ref +and \ref PkgJetFitting3Ref. At that time, these packages were relying on \sc{Taucs}, \sc{LAPACK}, \sc{BLAS} and \sc{OpenNL}. Gaël Guennebaud then introduced new models using the \ref thirdpartyEigen library that became the only supported models by \cgal. Later on the packages \ref -PkgMeanCurvatureSkeleton3Summary and \ref PkgSurfaceMeshDeformationSummary +PkgSurfaceMeshSkeletonization and \ref PkgSurfaceMeshDeformation extended the existing concepts. Simon Giraudot was responsible for gathering all concepts and classes, and also wrote this user manual diff --git a/Solver_interface/examples/Solver_interface/CMakeLists.txt b/Solver_interface/examples/Solver_interface/CMakeLists.txt index 0ab1c444377..a3d8d703929 100644 --- a/Solver_interface/examples/Solver_interface/CMakeLists.txt +++ b/Solver_interface/examples/Solver_interface/CMakeLists.txt @@ -4,16 +4,12 @@ project( Solver_interface_Examples ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - include_directories (BEFORE "../include") # Use Eigen diff --git a/Solver_interface/include/CGAL/Default_diagonalize_traits.h b/Solver_interface/include/CGAL/Default_diagonalize_traits.h index 7dd97adf522..55ef057ab53 100644 --- a/Solver_interface/include/CGAL/Default_diagonalize_traits.h +++ b/Solver_interface/include/CGAL/Default_diagonalize_traits.h @@ -30,7 +30,7 @@ namespace CGAL { -/// \ingroup PkgSolver +/// \ingroup PkgSolverInterfaceRef /// /// The class `Default_diagonalize_traits` is a wrapper designed to automatically /// use `Eigen_diagonalize_traits` if Eigen is available and otherwise use diff --git a/Solver_interface/include/CGAL/Diagonalize_traits.h b/Solver_interface/include/CGAL/Diagonalize_traits.h index 57c086ef6b2..85e7458751b 100644 --- a/Solver_interface/include/CGAL/Diagonalize_traits.h +++ b/Solver_interface/include/CGAL/Diagonalize_traits.h @@ -26,15 +26,19 @@ #include #include +#ifndef CGAL_I_WANT_TO_USE_DIAGONALIZE_TRAITS #define CGAL_WARNING_DIAGONALIZE_TRAITS \ CGAL_DEPRECATED_MSG("CGAL::Diagonalize_traits is a deprecated class that can \ lead to precision issues, please use CGAL::Eigen_diagonalize_traits") +#else +#define CGAL_WARNING_DIAGONALIZE_TRAITS +#endif /// \cond SKIP_IN_MANUAL namespace CGAL { -/// \ingroup PkgSolver +/// \ingroup PkgSolverInterfaceRef /// /// The class `Diagonalize_traits` provides an internal /// implementation for the diagonalization of Variance-Covariance diff --git a/Solver_interface/include/CGAL/Eigen_diagonalize_traits.h b/Solver_interface/include/CGAL/Eigen_diagonalize_traits.h index 165a6ed56c0..89c662913c3 100644 --- a/Solver_interface/include/CGAL/Eigen_diagonalize_traits.h +++ b/Solver_interface/include/CGAL/Eigen_diagonalize_traits.h @@ -39,7 +39,7 @@ namespace CGAL { -/// \ingroup PkgSolver +/// \ingroup PkgSolverInterfaceRef /// /// The class `Eigen_diagonalize_traits` provides an interface to the /// diagonalization of covariance matrices of \ref thirdpartyEigen diff --git a/Solver_interface/include/CGAL/Eigen_matrix.h b/Solver_interface/include/CGAL/Eigen_matrix.h index 9293f27c8a2..2af306046ee 100644 --- a/Solver_interface/include/CGAL/Eigen_matrix.h +++ b/Solver_interface/include/CGAL/Eigen_matrix.h @@ -27,7 +27,7 @@ namespace CGAL { /*! -\ingroup PkgSolver +\ingroup PkgSolverInterfaceRef The class `Eigen_sparse_matrix` is a wrapper around \ref thirdpartyEigen "Eigen" matrix type `Eigen::SparseMatrix` @@ -265,7 +265,7 @@ private: }; // Eigen_sparse_matrix /*! -\ingroup PkgSolver +\ingroup PkgSolverInterfaceRef The class `Eigen_sparse_symmetric_matrix` is a wrapper around \ref thirdpartyEigen "Eigen" matrix type `Eigen::SparseMatrix` @@ -301,7 +301,7 @@ struct Eigen_sparse_symmetric_matrix }; /*! -\ingroup PkgSolver +\ingroup PkgSolverInterfaceRef The class `Eigen_matrix` is a wrapper around \ref thirdpartyEigen "Eigen" matrix type `Eigen::Matrix`. diff --git a/Solver_interface/include/CGAL/Eigen_solver_traits.h b/Solver_interface/include/CGAL/Eigen_solver_traits.h index d54e2f4a7d3..0fe107f371b 100644 --- a/Solver_interface/include/CGAL/Eigen_solver_traits.h +++ b/Solver_interface/include/CGAL/Eigen_solver_traits.h @@ -71,7 +71,7 @@ struct Get_eigen_matrix< ::Eigen::SparseLU, FT> } //internal /*! -\ingroup PkgSolver +\ingroup PkgSolverInterfaceRef The class `Eigen_solver_traits` provides an interface to the sparse solvers of \ref thirdpartyEigen "Eigen". \ref thirdpartyEigen "Eigen" version 3.1 (or later) must be available on the system. diff --git a/Solver_interface/include/CGAL/Eigen_svd.h b/Solver_interface/include/CGAL/Eigen_svd.h index a6db6704087..dc6ce1bcd62 100644 --- a/Solver_interface/include/CGAL/Eigen_svd.h +++ b/Solver_interface/include/CGAL/Eigen_svd.h @@ -34,7 +34,7 @@ namespace CGAL { /*! -\ingroup PkgSolver +\ingroup PkgSolverInterfaceRef The class `Eigen_svd` provides an algorithm to solve in the least square sense a linear system with a singular value decomposition using diff --git a/Solver_interface/include/CGAL/Eigen_vector.h b/Solver_interface/include/CGAL/Eigen_vector.h index 7e30d3fadd8..b52f2e757f4 100644 --- a/Solver_interface/include/CGAL/Eigen_vector.h +++ b/Solver_interface/include/CGAL/Eigen_vector.h @@ -26,7 +26,7 @@ namespace CGAL { /*! -\ingroup PkgSolver +\ingroup PkgSolverInterfaceRef The class `Eigen_vector` is a wrapper around \ref thirdpartyEigen "Eigen" vector type , diff --git a/Solver_interface/include/CGAL/Lapack_svd.h b/Solver_interface/include/CGAL/Lapack_svd.h index dea9a3147d4..cb6cc749e0e 100644 --- a/Solver_interface/include/CGAL/Lapack_svd.h +++ b/Solver_interface/include/CGAL/Lapack_svd.h @@ -58,7 +58,7 @@ void dgelss(int *m, int *n, int *nrhs, namespace CGAL { -/// \ingroup PkgSolver +/// \ingroup PkgSolverInterfaceRef /// /// A matrix class to be used in the class `Lapack_svd`. /// @@ -102,7 +102,7 @@ private: Lapack_vector& operator =(const Lapack_vector& toCopy); }; -/// \ingroup PkgSolver +/// \ingroup PkgSolverInterfaceRef /// /// In CLAPACK, matrices are one-dimensional arrays and elements are /// column-major ordered. This class is a wrapper defining set and get @@ -152,7 +152,7 @@ private: Lapack_matrix& operator =(const Lapack_matrix& toCopy); }; -/// \ingroup PkgSolver +/// \ingroup PkgSolverInterfaceRef /// /// This class is a wrapper to the singular value decomposition algorithm of LAPACK. /// diff --git a/Spatial_searching/benchmark/Spatial_searching/CMakeLists.txt b/Spatial_searching/benchmark/Spatial_searching/CMakeLists.txt index 054019dad04..51ab416ab53 100644 --- a/Spatial_searching/benchmark/Spatial_searching/CMakeLists.txt +++ b/Spatial_searching/benchmark/Spatial_searching/CMakeLists.txt @@ -4,40 +4,35 @@ project( Spatial_searching_ ) -cmake_minimum_required(VERSION 2.8.11) - +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET COMPONENTS Core ) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - +include(${CGAL_USE_FILE}) + find_package(Eigen3 3.1.91) #(requires 3.2.0 or greater) if (EIGEN3_FOUND) include( ${EIGEN3_USE_FILE} ) endif() - include( CGAL_CreateSingleSourceCGALProgram ) - - include_directories (BEFORE "../../include" "./include") - - include_directories (BEFORE "include") + include_directories (BEFORE "include") create_single_source_cgal_program( "Compare_ANN_STANN_CGAL.cpp" ) create_single_source_cgal_program( "nanoflan.cpp" ) -create_single_source_cgal_program( "binary.cpp" ) + create_single_source_cgal_program( "binary.cpp" ) create_single_source_cgal_program( "nearest_neighbor_searching_50.cpp" ) create_single_source_cgal_program( "nearest_neighbor_searching_inplace_50.cpp" ) create_single_source_cgal_program( "Nearest_neighbor_searching.cpp" ) create_single_source_cgal_program( "Nearest_neighbor_searching_2D.cpp" ) create_single_source_cgal_program( "Nearest_neighbor_searching_2D_user_defined.cpp" ) create_single_source_cgal_program( "Split_data.cpp" ) -create_single_source_cgal_program( "nn3cgal.cpp" ) -create_single_source_cgal_program( "nn4cgal.cpp" ) -create_single_source_cgal_program( "nn3nanoflan.cpp" ) -create_single_source_cgal_program( "sizeof.cpp" ) -create_single_source_cgal_program( "deque.cpp" ) + create_single_source_cgal_program( "nn3cgal.cpp" ) + create_single_source_cgal_program( "nn4cgal.cpp" ) + create_single_source_cgal_program( "nn3nanoflan.cpp" ) + create_single_source_cgal_program( "sizeof.cpp" ) + create_single_source_cgal_program( "deque.cpp" ) else() diff --git a/Spatial_searching/benchmark/Spatial_searching/tools/CMakeLists.txt b/Spatial_searching/benchmark/Spatial_searching/tools/CMakeLists.txt index 2528a0e25c1..a332558dc48 100644 --- a/Spatial_searching/benchmark/Spatial_searching/tools/CMakeLists.txt +++ b/Spatial_searching/benchmark/Spatial_searching/tools/CMakeLists.txt @@ -4,17 +4,13 @@ project( tools_ ) -cmake_minimum_required(VERSION 2.8.11) - +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET COMPONENTS Core ) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - + include(${CGAL_USE_FILE}) include_directories (BEFORE "../include") create_single_source_cgal_program( "points_in_bbox.cpp" ) diff --git a/Spatial_searching/doc/Spatial_searching/PackageDescription.txt b/Spatial_searching/doc/Spatial_searching/PackageDescription.txt index fb7d95df765..65541683150 100644 --- a/Spatial_searching/doc/Spatial_searching/PackageDescription.txt +++ b/Spatial_searching/doc/Spatial_searching/PackageDescription.txt @@ -1,37 +1,37 @@ -/// \defgroup PkgSpatialSearchingD dD Spatial Searching Reference +/// \defgroup PkgSpatialSearchingDRef dD Spatial Searching Reference /// \defgroup PkgSpatialSearchingDConcepts Concepts -/// \ingroup PkgSpatialSearchingD +/// \ingroup PkgSpatialSearchingDRef /// \defgroup SearchClasses Search Classes -/// \ingroup PkgSpatialSearchingD +/// \ingroup PkgSpatialSearchingDRef /// \defgroup RangeQueryItemClasses Range Query Item Classes -/// \ingroup PkgSpatialSearchingD +/// \ingroup PkgSpatialSearchingDRef /// \defgroup SearchTraitsClasses Search Traits Classes -/// \ingroup PkgSpatialSearchingD +/// \ingroup PkgSpatialSearchingDRef /// \defgroup DistanceClasses Distance Classes -/// \ingroup PkgSpatialSearchingD +/// \ingroup PkgSpatialSearchingDRef /// \defgroup SplitterClasses Splitter Classes -/// \ingroup PkgSpatialSearchingD +/// \ingroup PkgSpatialSearchingDRef /// \defgroup AdvancedClasses Advanced Classes -/// \ingroup PkgSpatialSearchingD +/// \ingroup PkgSpatialSearchingDRef /*! -\addtogroup PkgSpatialSearchingD +\addtogroup PkgSpatialSearchingDRef -\cgalPkgDescriptionBegin{dD Spatial Searching,PkgSpatialSearchingDSummary} +\cgalPkgDescriptionBegin{dD Spatial Searching,PkgSpatialSearchingD} \cgalPkgPicture{windowQuery.png} \cgalPkgSummaryBegin \cgalPkgAuthors{Hans Tangelder and Andreas Fabri} \cgalPkgDesc{This package implements exact and approximate distance browsing by providing exact and approximate algorithms for range searching, k-nearest and k-furthest neighbor searching, as well as incremental nearest and incremental furthest neighbor searching, where the query items are points in dD Euclidean space.} -\cgalPkgManuals{Chapter_dD_Spatial_Searching,PkgSpatialSearchingD} +\cgalPkgManuals{Chapter_dD_Spatial_Searching,PkgSpatialSearchingDRef} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{3.0} diff --git a/Spatial_searching/examples/Spatial_searching/CMakeLists.txt b/Spatial_searching/examples/Spatial_searching/CMakeLists.txt index 9394ea70775..5c66f23a3ee 100644 --- a/Spatial_searching/examples/Spatial_searching/CMakeLists.txt +++ b/Spatial_searching/examples/Spatial_searching/CMakeLists.txt @@ -4,12 +4,11 @@ project( Spatial_searching_Examples ) -cmake_minimum_required(VERSION 2.8.11) - +cmake_minimum_required(VERSION 3.1) # CGAL and its components -find_package( CGAL QUIET COMPONENTS ) +find_package( CGAL QUIET COMPONENTS ) if ( NOT CGAL_FOUND ) @@ -17,9 +16,6 @@ if ( NOT CGAL_FOUND ) return() endif() - -# include helper file -include( ${CGAL_USE_FILE} ) find_package(Eigen3 3.1.91) #(requires 3.2.0 or greater) if (EIGEN3_FOUND) @@ -35,14 +31,10 @@ endif() # include for local directory # include for local package -include_directories( BEFORE ../../include ) - # Creating entries for all .cpp/.C files with "main" routine # ########################################################## -include( CGAL_CreateSingleSourceCGALProgram ) - create_single_source_cgal_program( "circular_query.cpp" ) create_single_source_cgal_program( "distance_browsing.cpp" ) diff --git a/Spatial_searching/test/Spatial_searching/CMakeLists.txt b/Spatial_searching/test/Spatial_searching/CMakeLists.txt index 314827ef493..90cc940fc5b 100644 --- a/Spatial_searching/test/Spatial_searching/CMakeLists.txt +++ b/Spatial_searching/test/Spatial_searching/CMakeLists.txt @@ -4,18 +4,12 @@ project( Spatial_searching_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Spatial_sorting/benchmark/Spatial_sorting/CMakeLists.txt b/Spatial_sorting/benchmark/Spatial_sorting/CMakeLists.txt index 4d382d5db54..5bf9e578e10 100644 --- a/Spatial_sorting/benchmark/Spatial_sorting/CMakeLists.txt +++ b/Spatial_sorting/benchmark/Spatial_sorting/CMakeLists.txt @@ -4,19 +4,14 @@ project( Spatial_sorting_ ) -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET COMPONENTS Core ) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - include_directories (BEFORE "../../include") - + include(${CGAL_USE_FILE}) create_single_source_cgal_program( "simple.cpp" ) else() diff --git a/Spatial_sorting/doc/Spatial_sorting/PackageDescription.txt b/Spatial_sorting/doc/Spatial_sorting/PackageDescription.txt index 08f97469814..540c0f22950 100644 --- a/Spatial_sorting/doc/Spatial_sorting/PackageDescription.txt +++ b/Spatial_sorting/doc/Spatial_sorting/PackageDescription.txt @@ -1,29 +1,29 @@ -/// \defgroup PkgSpatialSorting Spatial Sorting Reference +/// \defgroup PkgSpatialSortingRef Spatial Sorting Reference /// \defgroup PkgSpatialSortingConcepts Concepts -/// \ingroup PkgSpatialSorting +/// \ingroup PkgSpatialSortingRef /// \defgroup PkgSpatialSortingTraits Traits Classes -/// \ingroup PkgSpatialSorting +/// \ingroup PkgSpatialSortingRef /// \defgroup PkgSpatialSortingUtils Utilities -/// \ingroup PkgSpatialSorting +/// \ingroup PkgSpatialSortingRef /// \defgroup PkgSpatialSortingFunctions Functions -/// \ingroup PkgSpatialSorting +/// \ingroup PkgSpatialSortingRef /// \defgroup PkgSpatialSortingFunctionObjects Function Objects -/// \ingroup PkgSpatialSorting +/// \ingroup PkgSpatialSortingRef /*! -\addtogroup PkgSpatialSorting -\cgalPkgDescriptionBegin{Spatial Sorting,PkgSpatialSortingSummary} +\addtogroup PkgSpatialSortingRef +\cgalPkgDescriptionBegin{Spatial Sorting,PkgSpatialSorting} \cgalPkgPicture{hilbert.png} \cgalPkgSummaryBegin \cgalPkgAuthors{Christophe Delage and Olivier Devillers} \cgalPkgDesc{This package provides functions for sorting geometric objects in two, three and higher dimensions, including on a sphere, in order to improve efficiency of incremental geometric algorithms.} -\cgalPkgManuals{Chapter_Spatial_Sorting,PkgSpatialSorting} +\cgalPkgManuals{Chapter_Spatial_Sorting,PkgSpatialSortingRef} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{3.3} diff --git a/Spatial_sorting/examples/Spatial_sorting/CMakeLists.txt b/Spatial_sorting/examples/Spatial_sorting/CMakeLists.txt index 7a2aac7bee3..77db71cd55d 100644 --- a/Spatial_sorting/examples/Spatial_sorting/CMakeLists.txt +++ b/Spatial_sorting/examples/Spatial_sorting/CMakeLists.txt @@ -4,18 +4,12 @@ project( Spatial_sorting_Examples ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Spatial_sorting/test/Spatial_sorting/CMakeLists.txt b/Spatial_sorting/test/Spatial_sorting/CMakeLists.txt index fe8bef10c00..98ded58f5b4 100644 --- a/Spatial_sorting/test/Spatial_sorting/CMakeLists.txt +++ b/Spatial_sorting/test/Spatial_sorting/CMakeLists.txt @@ -4,18 +4,12 @@ project( Spatial_sorting_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/Straight_skeleton_converter_2.h b/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/Straight_skeleton_converter_2.h index 0497ab07c75..0c26fe5caac 100644 --- a/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/Straight_skeleton_converter_2.h +++ b/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/Straight_skeleton_converter_2.h @@ -100,7 +100,7 @@ boost::shared_ptr operator()( Source_skeleton const& s) const; \tparam SrcSs type of the source straight skeleton \tparam TgtSs type of the target straight skeleton \tparam NTConverter a function object that must -provide `TgtSs:Traits::FT operator()(SrcSs::Traits::FT n)` that converts `n` to an +provide `TgtSs::Traits::FT operator()(SrcSs::Traits::FT n)` that converts `n` to an `TgtSs::Traits::FT` which has the same value. The default value of this parameter is `NT_converter`. \cgalModels `StraightSkeletonItemsConverter_2` diff --git a/Straight_skeleton_2/doc/Straight_skeleton_2/PackageDescription.txt b/Straight_skeleton_2/doc/Straight_skeleton_2/PackageDescription.txt index 353a78069b5..409bd9ee32c 100644 --- a/Straight_skeleton_2/doc/Straight_skeleton_2/PackageDescription.txt +++ b/Straight_skeleton_2/doc/Straight_skeleton_2/PackageDescription.txt @@ -1,28 +1,28 @@ -/// \defgroup PkgStraightSkeleton2 2D Straight Skeleton and Polygon Offsetting Reference +/// \defgroup PkgStraightSkeleton2Ref 2D Straight Skeleton and Polygon Offsetting Reference /// \defgroup PkgStraightSkeleton2Concepts Concepts -/// \ingroup PkgStraightSkeleton2 +/// \ingroup PkgStraightSkeleton2Ref /// \defgroup PkgStraightSkeleton2Classes Classes -/// \ingroup PkgStraightSkeleton2 +/// \ingroup PkgStraightSkeleton2Ref /// \defgroup PkgStraightSkeleton2Auxiliary Auxiliary Classes -/// \ingroup PkgStraightSkeleton2 +/// \ingroup PkgStraightSkeleton2Ref /// \defgroup PkgStraightSkeleton2Functions Functions -/// \ingroup PkgStraightSkeleton2 +/// \ingroup PkgStraightSkeleton2Ref /*! -\addtogroup PkgStraightSkeleton2 -\cgalPkgDescriptionBegin{2D Straight Skeleton and Polygon Offsetting,PkgStraightSkeleton2Summary} +\addtogroup PkgStraightSkeleton2Ref +\cgalPkgDescriptionBegin{2D Straight Skeleton and Polygon Offsetting,PkgStraightSkeleton2} \cgalPkgPicture{Straight_skeleton_2/fig/StraightSkeletonTeaser.png} \cgalPkgSummaryBegin \cgalPkgAuthor{Fernando Cacciola} \cgalPkgDesc{This package implements an algorithm to construct a halfedge data structure representing the straight skeleton in the interior of 2D polygons with holes and an algorithm to construct inward offset polygons at any offset distance given a straight skeleton.} -\cgalPkgManuals{Chapter_2D_Straight_Skeleton_and_Polygon_Offsetting,PkgStraightSkeleton2} +\cgalPkgManuals{Chapter_2D_Straight_Skeleton_and_Polygon_Offsetting,PkgStraightSkeleton2Ref} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{3.2} -\cgalPkgDependsOn{\ref PkgHDSSummary} +\cgalPkgDependsOn{\ref PkgHalfedgeDS} \cgalPkgBib{cgal:c-sspo2} \cgalPkgLicense{\ref licensesGPL "GPL"} \cgalPkgDemo{2D Straight Skeleton,straight_skeleton_2.zip,Operations on Polygons,polygon.zip} diff --git a/Straight_skeleton_2/examples/Straight_skeleton_2/CMakeLists.txt b/Straight_skeleton_2/examples/Straight_skeleton_2/CMakeLists.txt index 844b3867350..732fb4b90bc 100644 --- a/Straight_skeleton_2/examples/Straight_skeleton_2/CMakeLists.txt +++ b/Straight_skeleton_2/examples/Straight_skeleton_2/CMakeLists.txt @@ -4,17 +4,13 @@ project( Straight_skeleton_2_Examples ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET COMPONENTS Core ) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - include_directories (BEFORE "../../include") + include(${CGAL_USE_FILE}) # create a target per cppfile file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) diff --git a/Straight_skeleton_2/test/Straight_skeleton_2/CMakeLists.txt b/Straight_skeleton_2/test/Straight_skeleton_2/CMakeLists.txt index 73228f9afaf..2272303a11b 100644 --- a/Straight_skeleton_2/test/Straight_skeleton_2/CMakeLists.txt +++ b/Straight_skeleton_2/test/Straight_skeleton_2/CMakeLists.txt @@ -4,19 +4,14 @@ project( Straight_skeleton_2_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET COMPONENTS Core ) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - include_directories (BEFORE "../../include") - - include_directories (BEFORE "include") + include(${CGAL_USE_FILE}) + include_directories (BEFORE "include") # create a target per cppfile file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) diff --git a/Stream_lines_2/doc/Stream_lines_2/CGAL/Euler_integrator_2.h b/Stream_lines_2/doc/Stream_lines_2/CGAL/Euler_integrator_2.h index 411ee87ee4f..ac38ba5fc8b 100644 --- a/Stream_lines_2/doc/Stream_lines_2/CGAL/Euler_integrator_2.h +++ b/Stream_lines_2/doc/Stream_lines_2/CGAL/Euler_integrator_2.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgPlacementOfStreamlines2 +\ingroup PkgStreamLines2Ref This class implements the first order Euler integrator. diff --git a/Stream_lines_2/doc/Stream_lines_2/CGAL/Regular_grid_2.h b/Stream_lines_2/doc/Stream_lines_2/CGAL/Regular_grid_2.h index 2fcd5696719..c4e249df785 100644 --- a/Stream_lines_2/doc/Stream_lines_2/CGAL/Regular_grid_2.h +++ b/Stream_lines_2/doc/Stream_lines_2/CGAL/Regular_grid_2.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgPlacementOfStreamlines2 +\ingroup PkgStreamLines2Ref This class provides a 2D vector field specified by a set of sample diff --git a/Stream_lines_2/doc/Stream_lines_2/CGAL/Runge_kutta_integrator_2.h b/Stream_lines_2/doc/Stream_lines_2/CGAL/Runge_kutta_integrator_2.h index 9e3e16c6e51..e2ea97470de 100644 --- a/Stream_lines_2/doc/Stream_lines_2/CGAL/Runge_kutta_integrator_2.h +++ b/Stream_lines_2/doc/Stream_lines_2/CGAL/Runge_kutta_integrator_2.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgPlacementOfStreamlines2 +\ingroup PkgStreamLines2Ref This class implements the second order Runge-Kutta integrator. diff --git a/Stream_lines_2/doc/Stream_lines_2/CGAL/Stream_lines_2.h b/Stream_lines_2/doc/Stream_lines_2/CGAL/Stream_lines_2.h index d7de6332e56..97b39271c3c 100644 --- a/Stream_lines_2/doc/Stream_lines_2/CGAL/Stream_lines_2.h +++ b/Stream_lines_2/doc/Stream_lines_2/CGAL/Stream_lines_2.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgPlacementOfStreamlines2 +\ingroup PkgStreamLines2Ref The class `Stream_lines_2` generates a placement of streamlines in a 2D domain according to a bidimensional vector field. diff --git a/Stream_lines_2/doc/Stream_lines_2/CGAL/Triangular_field_2.h b/Stream_lines_2/doc/Stream_lines_2/CGAL/Triangular_field_2.h index eb04eff7d75..76b9c232d68 100644 --- a/Stream_lines_2/doc/Stream_lines_2/CGAL/Triangular_field_2.h +++ b/Stream_lines_2/doc/Stream_lines_2/CGAL/Triangular_field_2.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgPlacementOfStreamlines2 +\ingroup PkgStreamLines2Ref This class provides a vector field specified by a set of sample points diff --git a/Stream_lines_2/doc/Stream_lines_2/Concepts/Integrator_2.h b/Stream_lines_2/doc/Stream_lines_2/Concepts/Integrator_2.h index e7d10c7a256..16fcdac10b1 100644 --- a/Stream_lines_2/doc/Stream_lines_2/Concepts/Integrator_2.h +++ b/Stream_lines_2/doc/Stream_lines_2/Concepts/Integrator_2.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgPlacementOfStreamlines2Concepts +\ingroup PkgStreamLines2Concepts \cgalConcept The concept `Integrator_2` describes the set of requirements for diff --git a/Stream_lines_2/doc/Stream_lines_2/Concepts/StreamLinesTraits_2.h b/Stream_lines_2/doc/Stream_lines_2/Concepts/StreamLinesTraits_2.h index 7eb8fe2630a..6bd7b75c391 100644 --- a/Stream_lines_2/doc/Stream_lines_2/Concepts/StreamLinesTraits_2.h +++ b/Stream_lines_2/doc/Stream_lines_2/Concepts/StreamLinesTraits_2.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgPlacementOfStreamlines2Concepts +\ingroup PkgStreamLines2Concepts \cgalConcept The concept `StreamLinesTraits_2` describes the set of requirements for diff --git a/Stream_lines_2/doc/Stream_lines_2/Concepts/VectorField_2.h b/Stream_lines_2/doc/Stream_lines_2/Concepts/VectorField_2.h index f6fd0f18f8f..0cc2c51f25f 100644 --- a/Stream_lines_2/doc/Stream_lines_2/Concepts/VectorField_2.h +++ b/Stream_lines_2/doc/Stream_lines_2/Concepts/VectorField_2.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgPlacementOfStreamlines2Concepts +\ingroup PkgStreamLines2Concepts \cgalConcept The concept `VectorField_2` describes the set of requirements for diff --git a/Stream_lines_2/doc/Stream_lines_2/PackageDescription.txt b/Stream_lines_2/doc/Stream_lines_2/PackageDescription.txt index ce85d714f8b..6cfd617b10a 100644 --- a/Stream_lines_2/doc/Stream_lines_2/PackageDescription.txt +++ b/Stream_lines_2/doc/Stream_lines_2/PackageDescription.txt @@ -1,19 +1,19 @@ -/// \defgroup PkgPlacementOfStreamlines2 2D Placement of Streamlines Reference -/// \defgroup PkgPlacementOfStreamlines2Concepts Concepts -/// \ingroup PkgPlacementOfStreamlines2 +/// \defgroup PkgStreamLines2Ref 2D Placement of Streamlines Reference +/// \defgroup PkgStreamLines2Concepts Concepts +/// \ingroup PkgStreamLines2Ref /*! -\addtogroup PkgPlacementOfStreamlines2 +\addtogroup PkgStreamLines2Ref -\cgalPkgDescriptionBegin{2D Placement of Streamlines,PkgPlacementOfStreamlines2Summary} +\cgalPkgDescriptionBegin{2D Placement of Streamlines,PkgStreamLines2} \cgalPkgPicture{streamlines-small.jpg} \cgalPkgSummaryBegin \cgalPkgAuthor{Abdelkrim Mebarki} \cgalPkgDesc{Visualizing vector fields is important for many application domains. A good way to do it is to generate streamlines that describe the flow behavior. This package implements the "Farthest Point Seeding" algorithm for placing streamlines in 2D vector fields. It generates a list of streamlines corresponding to an input flow using a specified separating distance. The algorithm uses a Delaunay triangulation to model objects and address different queries, and relies on choosing the centers of the biggest empty circles to start the integration of the streamlines.} -\cgalPkgManuals{Chapter_2D_Placement_of_Streamlines,PkgPlacementOfStreamlines2} +\cgalPkgManuals{Chapter_2D_Placement_of_Streamlines,PkgStreamLines2Ref} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{3.2} -\cgalPkgDependsOn{\ref PkgTriangulation2Summary} +\cgalPkgDependsOn{\ref PkgTriangulation2} \cgalPkgBib{cgal:m-ps} \cgalPkgLicense{\ref licensesGPL "GPL"} \cgalPkgDemo{2D Stream Lines,streamlines.zip} diff --git a/Stream_lines_2/examples/Stream_lines_2/CMakeLists.txt b/Stream_lines_2/examples/Stream_lines_2/CMakeLists.txt index 009aed70f1c..c12378e2b4b 100644 --- a/Stream_lines_2/examples/Stream_lines_2/CMakeLists.txt +++ b/Stream_lines_2/examples/Stream_lines_2/CMakeLists.txt @@ -4,18 +4,12 @@ project( Stream_lines_2_Examples ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Stream_lines_2/test/Stream_lines_2/CMakeLists.txt b/Stream_lines_2/test/Stream_lines_2/CMakeLists.txt index c40dfd713b7..3349e59b68a 100644 --- a/Stream_lines_2/test/Stream_lines_2/CMakeLists.txt +++ b/Stream_lines_2/test/Stream_lines_2/CMakeLists.txt @@ -4,18 +4,12 @@ project( Stream_lines_2_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Stream_support/benchmark/Stream_support/CMakeLists.txt b/Stream_support/benchmark/Stream_support/CMakeLists.txt index 065eda34c45..3e1065efa78 100644 --- a/Stream_support/benchmark/Stream_support/CMakeLists.txt +++ b/Stream_support/benchmark/Stream_support/CMakeLists.txt @@ -4,8 +4,7 @@ project( Stream_support ) -cmake_minimum_required(VERSION 2.8.11) - +cmake_minimum_required(VERSION 3.1) # CGAL and its components @@ -18,10 +17,6 @@ if ( NOT CGAL_FOUND ) endif() -# include helper file -include( ${CGAL_USE_FILE} ) - - # Boost and its components find_package( Boost REQUIRED ) @@ -36,14 +31,10 @@ endif() # include for local directory # include for local package -include_directories( BEFORE ../../include ) - # Creating entries for all .cpp/.C files with "main" routine # ########################################################## -include( CGAL_CreateSingleSourceCGALProgram ) - create_single_source_cgal_program( "read_doubles.cpp" ) create_single_source_cgal_program( "read_points.cpp" ) diff --git a/Stream_support/doc/Stream_support/CGAL/IO/Color.h b/Stream_support/doc/Stream_support/CGAL/IO/Color.h index e3ad9813bdc..bf800b4a7a4 100644 --- a/Stream_support/doc/Stream_support/CGAL/IO/Color.h +++ b/Stream_support/doc/Stream_support/CGAL/IO/Color.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgIOstreams +\ingroup PkgStreamSupportRef An object of the class `Color` is a color available for drawing operations in many \cgal output streams. diff --git a/Stream_support/doc/Stream_support/CGAL/IO/Istream_iterator.h b/Stream_support/doc/Stream_support/CGAL/IO/Istream_iterator.h index cb90ef6695b..4834046a5e8 100644 --- a/Stream_support/doc/Stream_support/CGAL/IO/Istream_iterator.h +++ b/Stream_support/doc/Stream_support/CGAL/IO/Istream_iterator.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgIOstreams +\ingroup PkgStreamSupportRef The class `Istream_iterator` is an input iterator adaptor for the input stream class `Stream` and value type `T`. It is particularly diff --git a/Stream_support/doc/Stream_support/CGAL/IO/Ostream_iterator.h b/Stream_support/doc/Stream_support/CGAL/IO/Ostream_iterator.h index 71ea3de2419..11b0d5cd9ed 100644 --- a/Stream_support/doc/Stream_support/CGAL/IO/Ostream_iterator.h +++ b/Stream_support/doc/Stream_support/CGAL/IO/Ostream_iterator.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgIOstreams +\ingroup PkgStreamSupportRef The class `Ostream_iterator` is an output iterator adaptor for the output stream class `Stream` and value type `T`. diff --git a/Stream_support/doc/Stream_support/CGAL/IO/Verbose_ostream.h b/Stream_support/doc/Stream_support/CGAL/IO/Verbose_ostream.h index 60195fc183d..e6fe4df71b7 100644 --- a/Stream_support/doc/Stream_support/CGAL/IO/Verbose_ostream.h +++ b/Stream_support/doc/Stream_support/CGAL/IO/Verbose_ostream.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgIOstreams +\ingroup PkgStreamSupportRef The class `Verbose_ostream` can be used as an output stream. The stream output operator `<<` is defined for any type. The class diff --git a/Stream_support/doc/Stream_support/CGAL/IO/io.h b/Stream_support/doc/Stream_support/CGAL/IO/io.h index 549aeea9d8b..c2582255fa1 100644 --- a/Stream_support/doc/Stream_support/CGAL/IO/io.h +++ b/Stream_support/doc/Stream_support/CGAL/IO/io.h @@ -3,7 +3,7 @@ namespace CGAL { namespace IO{ /*! - \ingroup PkgIOstreams + \ingroup PkgStreamSupportRef All classes in the \cgal `Kernel` provide input and output operators for IOStreams. The basic task of such an operator is to produce a @@ -38,7 +38,7 @@ enum Mode { ASCII = 0, BINARY, PRETTY }; } /*! -\ingroup PkgIOstreams +\ingroup PkgStreamSupportRef returns the printing mode of the %IO stream `s`. @@ -56,7 +56,7 @@ returns the printing mode of the %IO stream `s`. IO::Mode get_mode(std::ios& s); /*! -\ingroup PkgIOstreams +\ingroup PkgStreamSupportRef sets the mode of the %IO stream `s` to be the `IO::ASCII` mode. Returns the previous mode of `s`. @@ -74,7 +74,7 @@ Returns the previous mode of `s`. IO::Mode set_ascii_mode(std::ios& s); /*! -\ingroup PkgIOstreams +\ingroup PkgStreamSupportRef \sa `CGAL::IO::Mode` \sa `CGAL::set_mode()` @@ -91,7 +91,7 @@ Returns the previous mode of `s`. IO::Mode set_binary_mode(std::ios& s); /*! -\ingroup PkgIOstreams +\ingroup PkgStreamSupportRef sets the printing mode of the %IO stream `s`. @@ -107,7 +107,7 @@ sets the printing mode of the %IO stream `s`. IO::Mode set_mode(std::ios& s, IO::Mode m); /*! -\ingroup PkgIOstreams +\ingroup PkgStreamSupportRef sets the mode of the %IO stream `s` to be the `IO::PRETTY` mode. Returns the previous mode of `s`. @@ -126,7 +126,7 @@ IO::Mode set_pretty_mode(std::ios& s); /*! -\ingroup PkgIOstreams +\ingroup PkgStreamSupportRef The definition of `Input_rep` is completely symmetric to `Output_rep`. @@ -137,7 +137,7 @@ class Input_rep { }; /* end Input_rep */ /*! -\ingroup PkgIOstreams +\ingroup PkgStreamSupportRef The purpose of `Output_rep` is to provide a way to control output formatting that works independently of the object's stream output operator. @@ -171,7 +171,7 @@ class Output_rep { /*! -\ingroup PkgIOstreams +\ingroup PkgStreamSupportRef checks if the %IO stream `s` is in `IO::ASCII` mode. @@ -188,7 +188,7 @@ bool is_ascii(std::ios& s); /*! -\ingroup PkgIOstreams +\ingroup PkgStreamSupportRef checks if the %IO stream `s` is in `IO::BINARY` mode. @@ -204,7 +204,7 @@ checks if the %IO stream `s` is in `IO::BINARY` mode. bool is_binary(std::ios& s); /*! -\ingroup PkgIOstreams +\ingroup PkgStreamSupportRef checks if the %IO stream `s` is in `IO::PRETTY` mode. @@ -221,7 +221,7 @@ checks if the %IO stream `s` is in `IO::PRETTY` mode. bool is_pretty(std::ios& s); /*! -\ingroup PkgIOstreams +\ingroup PkgStreamSupportRef Convenience function to construct an output representation (`Output_rep`) for type `T`. @@ -230,7 +230,7 @@ Generic IO for type `T`. template Output_rep oformat( const T& t); /*! -\ingroup PkgIOstreams +\ingroup PkgStreamSupportRef The definition of this function is completely symmetric to `oformat()`. */ @@ -238,7 +238,7 @@ template Input_rep iformat( const T& t); /*! -\ingroup PkgIOstreams +\ingroup PkgStreamSupportRef Convenience function to construct an output representation (`Output_rep`) for type `T`. diff --git a/Stream_support/doc/Stream_support/PackageDescription.txt b/Stream_support/doc/Stream_support/PackageDescription.txt index 07cf8dcf7ad..6318ddadd62 100644 --- a/Stream_support/doc/Stream_support/PackageDescription.txt +++ b/Stream_support/doc/Stream_support/PackageDescription.txt @@ -1,14 +1,14 @@ -/// \defgroup PkgIOstreams IO Streams Reference +/// \defgroup PkgStreamSupportRef IO Streams Reference /// \defgroup IOstreamOperators Stream Operators -/// \ingroup PkgIOstreams +/// \ingroup PkgStreamSupportRef /*! -\addtogroup PkgIOstreams -\cgalPkgDescriptionBegin{IO Streams,PkgIOstreamsSummary} +\addtogroup PkgStreamSupportRef +\cgalPkgDescriptionBegin{IO Streams,PkgStreamSupport} \cgalPkgPicture{io.png} \cgalPkgSummaryBegin \cgalPkgAuthors{Andreas Fabri, Geert-Jan Giezeman, and Lutz Kettner} \cgalPkgDesc{All classes in the \cgal kernel provide input and output operators for IO streams. The basic task of such an operator is to produce a representation of an object that can be written as a sequence of characters on devices as a console, a file, or a pipe. In \cgal we distinguish between a raw ascii, a raw binary and a pretty printing format.} -\cgalPkgManuals{Chapter_IO_Streams,PkgIOstreams} +\cgalPkgManuals{Chapter_IO_Streams,PkgStreamSupportRef} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{1.0} diff --git a/Stream_support/test/Stream_support/CMakeLists.txt b/Stream_support/test/Stream_support/CMakeLists.txt index b0b71bc5e6d..5eb7092e2b7 100644 --- a/Stream_support/test/Stream_support/CMakeLists.txt +++ b/Stream_support/test/Stream_support/CMakeLists.txt @@ -4,18 +4,12 @@ project( Stream_support_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Subdivision_method_3/doc/Subdivision_method_3/Concepts/DQQMask_3.h b/Subdivision_method_3/doc/Subdivision_method_3/Concepts/DQQMask_3.h index a41bcc18c37..f53d4db7ef4 100644 --- a/Subdivision_method_3/doc/Subdivision_method_3/Concepts/DQQMask_3.h +++ b/Subdivision_method_3/doc/Subdivision_method_3/Concepts/DQQMask_3.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgSurfaceSubdivisionMethods3Concepts +\ingroup PkgSurfaceSubdivisionMethod3Concepts \cgalConcept Required member functions for the `DQQMask_3` concept. This diff --git a/Subdivision_method_3/doc/Subdivision_method_3/Concepts/PQQMask_3.h b/Subdivision_method_3/doc/Subdivision_method_3/Concepts/PQQMask_3.h index 617057ffccc..18f3c196d5f 100644 --- a/Subdivision_method_3/doc/Subdivision_method_3/Concepts/PQQMask_3.h +++ b/Subdivision_method_3/doc/Subdivision_method_3/Concepts/PQQMask_3.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgSurfaceSubdivisionMethods3Concepts +\ingroup PkgSurfaceSubdivisionMethod3Concepts \cgalConcept Required member functions for the `PQQMask_3` concept. This diff --git a/Subdivision_method_3/doc/Subdivision_method_3/Concepts/PTQMask_3.h b/Subdivision_method_3/doc/Subdivision_method_3/Concepts/PTQMask_3.h index c15a6e5099e..d149cd9ee66 100644 --- a/Subdivision_method_3/doc/Subdivision_method_3/Concepts/PTQMask_3.h +++ b/Subdivision_method_3/doc/Subdivision_method_3/Concepts/PTQMask_3.h @@ -1,5 +1,5 @@ /*! -\ingroup PkgSurfaceSubdivisionMethods3Concepts +\ingroup PkgSurfaceSubdivisionMethod3Concepts \cgalConcept Required member functions for the `PTQMask_3` concept. This diff --git a/Subdivision_method_3/doc/Subdivision_method_3/Concepts/Sqrt3Mask_3.h b/Subdivision_method_3/doc/Subdivision_method_3/Concepts/Sqrt3Mask_3.h index 4439618e07d..77fe974dd62 100644 --- a/Subdivision_method_3/doc/Subdivision_method_3/Concepts/Sqrt3Mask_3.h +++ b/Subdivision_method_3/doc/Subdivision_method_3/Concepts/Sqrt3Mask_3.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgSurfaceSubdivisionMethods3Concepts +\ingroup PkgSurfaceSubdivisionMethod3Concepts \cgalConcept Required member functions for the `Sqrt3Mask_3` concept. This diff --git a/Subdivision_method_3/doc/Subdivision_method_3/Concepts/SubdivisionMask_3.h b/Subdivision_method_3/doc/Subdivision_method_3/Concepts/SubdivisionMask_3.h index 2503e06dcc9..e94f0dc8cfe 100644 --- a/Subdivision_method_3/doc/Subdivision_method_3/Concepts/SubdivisionMask_3.h +++ b/Subdivision_method_3/doc/Subdivision_method_3/Concepts/SubdivisionMask_3.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgSurfaceSubdivisionMethods3Concepts +\ingroup PkgSurfaceSubdivisionMethod3Concepts \cgalConcept This concept defines types used by the mask concepts. diff --git a/Subdivision_method_3/doc/Subdivision_method_3/NamedParameters.txt b/Subdivision_method_3/doc/Subdivision_method_3/NamedParameters.txt index 25ccd8f1e11..078b3d202ba 100644 --- a/Subdivision_method_3/doc/Subdivision_method_3/NamedParameters.txt +++ b/Subdivision_method_3/doc/Subdivision_method_3/NamedParameters.txt @@ -1,6 +1,6 @@ /*! \defgroup sm_namedparameters Named Parameters for Subdivision Methods -\ingroup PkgSurfaceSubdivisionMethods3 +\ingroup PkgSurfaceSubdivisionMethod3Ref In this package, all functions optional parameters are implemented as BGL optional named parameters (see \ref BGLNamedParameters for more information on how to use them). @@ -13,7 +13,7 @@ that default values of optional named parameters must be used. In the following, we assume that the type `PolygonMesh` is passed as template parameters of the functions, and is a model of the concept `MutableFaceGraph`. -The following named parameter, offered by the package \ref PkgBGLSummary +The following named parameter, offered by the package \ref PkgBGL (see \ref bgl_namedparameters), is used in this package: \cgalNPTableBegin diff --git a/Subdivision_method_3/doc/Subdivision_method_3/PackageDescription.txt b/Subdivision_method_3/doc/Subdivision_method_3/PackageDescription.txt index 810657c81e5..dda0dc2db38 100644 --- a/Subdivision_method_3/doc/Subdivision_method_3/PackageDescription.txt +++ b/Subdivision_method_3/doc/Subdivision_method_3/PackageDescription.txt @@ -1,20 +1,20 @@ -/// \defgroup PkgSurfaceSubdivisionMethods3 3D Surface Subdivision Methods +/// \defgroup PkgSurfaceSubdivisionMethod3Ref 3D Surface Subdivision Methods -/// \defgroup PkgSurfaceSubdivisionMethods3Concepts Concepts -/// \ingroup PkgSurfaceSubdivisionMethods3 +/// \defgroup PkgSurfaceSubdivisionMethod3Concepts Concepts +/// \ingroup PkgSurfaceSubdivisionMethod3Ref -/// \defgroup PkgSurfaceSubdivisionMethods3Functions Subdivision Methods -/// \ingroup PkgSurfaceSubdivisionMethods3 +/// \defgroup PkgSurfaceSubdivisionMethod3Functions Subdivision Methods +/// \ingroup PkgSurfaceSubdivisionMethod3Ref /*! -\addtogroup PkgSurfaceSubdivisionMethods3 +\addtogroup PkgSurfaceSubdivisionMethod3Ref -\cgalPkgDescriptionBegin{3D Surface Subdivision Methods,PkgSurfaceSubdivisionMethods3Summary} +\cgalPkgDescriptionBegin{3D Surface Subdivision Methods,PkgSurfaceSubdivisionMethod3} \cgalPkgPicture{twoheads-detail.png} \cgalPkgSummaryBegin \cgalPkgAuthor{Le-Jeng Andy Shiue} \cgalPkgDesc{Subdivision methods recursively refine a control mesh and generate points approximating the limit surface. This package consists of four popular subdivision methods and their refinement hosts. Supported subdivision methods include Catmull-Clark, Loop, Doo-Sabin and \f$ \sqrt{3}\f$ subdivisions. Their respective refinement hosts are Pqq, Ptq, Dqq and \f$ \sqrt{3}\f$ refinements. Variations of those methods can be easily extended by substituting the geometry computation of the refinement host.} -\cgalPkgManuals{Chapter_3D_Surface_Subdivision_Methods,PkgSurfaceSubdivisionMethods3} +\cgalPkgManuals{Chapter_3D_Surface_Subdivision_Methods,PkgSurfaceSubdivisionMethod3Ref} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{4.11} diff --git a/Subdivision_method_3/examples/Subdivision_method_3/CMakeLists.txt b/Subdivision_method_3/examples/Subdivision_method_3/CMakeLists.txt index c37dc4524c4..eb57c8246dc 100644 --- a/Subdivision_method_3/examples/Subdivision_method_3/CMakeLists.txt +++ b/Subdivision_method_3/examples/Subdivision_method_3/CMakeLists.txt @@ -4,17 +4,12 @@ project( Subdivision_method_3_Examples ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - # create a target per cppfile file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) foreach(cppfile ${cppfiles}) diff --git a/Subdivision_method_3/include/CGAL/Subdivision_method_3/subdivision_hosts_3.h b/Subdivision_method_3/include/CGAL/Subdivision_method_3/subdivision_hosts_3.h index e144842f73a..014f8b472b7 100644 --- a/Subdivision_method_3/include/CGAL/Subdivision_method_3/subdivision_hosts_3.h +++ b/Subdivision_method_3/include/CGAL/Subdivision_method_3/subdivision_hosts_3.h @@ -42,7 +42,7 @@ namespace CGAL { namespace Subdivision_method_3 { /*! -\addtogroup PkgSurfaceSubdivisionMethods3Functions +\addtogroup PkgSurfaceSubdivisionMethod3Functions */ /// @{ diff --git a/Subdivision_method_3/include/CGAL/Subdivision_method_3/subdivision_masks_3.h b/Subdivision_method_3/include/CGAL/Subdivision_method_3/subdivision_masks_3.h index e6353e38b61..527b79c21ef 100644 --- a/Subdivision_method_3/include/CGAL/Subdivision_method_3/subdivision_masks_3.h +++ b/Subdivision_method_3/include/CGAL/Subdivision_method_3/subdivision_masks_3.h @@ -136,7 +136,7 @@ public: // ====================================================================== /*! -\ingroup PkgSurfaceSubdivisionMethods3 +\ingroup PkgSurfaceSubdivisionMethod3Ref The geometry mask of Catmull-Clark subdivision. @@ -260,7 +260,7 @@ public: // ====================================================================== /*! -\ingroup PkgSurfaceSubdivisionMethods3 +\ingroup PkgSurfaceSubdivisionMethod3Ref The geometry mask of Loop subdivision. @@ -422,7 +422,7 @@ public: // ====================================================================== /*! -\ingroup PkgSurfaceSubdivisionMethods3 +\ingroup PkgSurfaceSubdivisionMethod3Ref The geometry mask of Doo-Sabin subdivision. @@ -517,7 +517,7 @@ public: // ====================================================================== /*! -\ingroup PkgSurfaceSubdivisionMethods3 +\ingroup PkgSurfaceSubdivisionMethod3Ref The geometry mask of Sqrt(3) subdivision. diff --git a/Subdivision_method_3/include/CGAL/Subdivision_method_3/subdivision_methods_3.h b/Subdivision_method_3/include/CGAL/Subdivision_method_3/subdivision_methods_3.h index 7d2235b1b73..a00393d6ed3 100644 --- a/Subdivision_method_3/include/CGAL/Subdivision_method_3/subdivision_methods_3.h +++ b/Subdivision_method_3/include/CGAL/Subdivision_method_3/subdivision_methods_3.h @@ -41,7 +41,7 @@ namespace CGAL { namespace Subdivision_method_3 { /*! -\addtogroup PkgSurfaceSubdivisionMethods3Functions +\addtogroup PkgSurfaceSubdivisionMethod3Functions A subdivision method recursively refines a coarse mesh and generates an ever closer approximation to a smooth surface. diff --git a/Subdivision_method_3/include/CGAL/subdivision_method_3.h b/Subdivision_method_3/include/CGAL/subdivision_method_3.h index 15e6ee141e7..d5403ba25c6 100644 --- a/Subdivision_method_3/include/CGAL/subdivision_method_3.h +++ b/Subdivision_method_3/include/CGAL/subdivision_method_3.h @@ -23,7 +23,7 @@ // ====================================================================== /** -* \ingroup PkgSurfaceSubdivisionMethods3 +* \ingroup PkgSurfaceSubdivisionMethod3Ref * \file CGAL/subdivision_method_3.h * Convenience header file including the headers for all * the free functions of this package. diff --git a/Subdivision_method_3/test/Subdivision_method_3/CMakeLists.txt b/Subdivision_method_3/test/Subdivision_method_3/CMakeLists.txt index df3bcec438a..87cf9f130ba 100644 --- a/Subdivision_method_3/test/Subdivision_method_3/CMakeLists.txt +++ b/Subdivision_method_3/test/Subdivision_method_3/CMakeLists.txt @@ -4,18 +4,12 @@ project( Subdivision_method_3_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Surface_mesh/benchmark/CMakeLists.txt b/Surface_mesh/benchmark/CMakeLists.txt index 267a8115d9b..8d376836e91 100644 --- a/Surface_mesh/benchmark/CMakeLists.txt +++ b/Surface_mesh/benchmark/CMakeLists.txt @@ -1,9 +1,8 @@ project(Surface_mesh_performance) -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.1) find_package(CGAL REQUIRED) -include(${CGAL_USE_FILE}) include_directories(BEFORE "../include") @@ -35,6 +34,5 @@ add_executable(performance_2 target_link_libraries(performance_2 ${CGAL_LIBRARIES}) -include( CGAL_CreateSingleSourceCGALProgram ) create_single_source_cgal_program( "sm_sms.cpp" ) create_single_source_cgal_program( "poly_sms.cpp" ) diff --git a/Surface_mesh/doc/Surface_mesh/PackageDescription.txt b/Surface_mesh/doc/Surface_mesh/PackageDescription.txt index 1707c8a7a3f..4fecf7ee900 100644 --- a/Surface_mesh/doc/Surface_mesh/PackageDescription.txt +++ b/Surface_mesh/doc/Surface_mesh/PackageDescription.txt @@ -11,13 +11,13 @@ /*! \addtogroup PkgSurface_mesh -\cgalPkgDescriptionBegin{Surface Mesh,PkgSurfaceMeshSummary} +\cgalPkgDescriptionBegin{Surface Mesh,PkgSurfaceMesh} \cgalPkgPicture{Surface_mesh_teaser.png} \cgalPkgSummaryBegin \cgalPkgAuthor{Mario Botsch, Daniel Sieger, Philipp Moeller, and Andreas Fabri} \cgalPkgDesc{The surface mesh class provided by this package is an implementation of the halfedge data structure allowing to represent polyhedral surfaces. It is -an alternative to the packages \ref PkgHDSSummary and \ref PkgPolyhedronSummary. +an alternative to the packages \ref PkgHalfedgeDS and \ref PkgPolyhedron. The main differences are that it is indexed based and not pointer based, and that the mechanism for adding information to vertices, halfedges, edges, and faces is much simpler and can be used at runtime and not at compile time.} diff --git a/Surface_mesh/doc/Surface_mesh/Surface_mesh.txt b/Surface_mesh/doc/Surface_mesh/Surface_mesh.txt index 06b7c0dc14d..91459377605 100644 --- a/Surface_mesh/doc/Surface_mesh/Surface_mesh.txt +++ b/Surface_mesh/doc/Surface_mesh/Surface_mesh.txt @@ -13,8 +13,8 @@ namespace CGAL { The class `Surface_mesh` is an implementation of a halfedge data structure and can be used to represent a polyhedral surface. -It is an alternative to the \cgal packages \ref PkgHDSSummary -and \ref PkgPolyhedronSummary. +It is an alternative to the \cgal packages \ref PkgHalfedgeDS +and \ref PkgPolyhedron. The main difference is that it is indexed based and not pointer based. Additionally, the mechanism for adding information to vertices, halfedges, edges, and faces is much simpler and is done at runtime and not at compile time. @@ -29,11 +29,11 @@ When elements are removed, they are only marked as removed, and a garbage collection function must be called to really remove them. The class `Surface_mesh` can be used through its class member functions -as well as through the BGL API as described in the package \ref PkgBGLSummary, +as well as through the BGL API as described in the package \ref PkgBGL, as it is a model of the concepts `MutableFaceGraph` and `FaceListGraph`. Therefore it is possible to apply the algorithms of the packages -\ref PkgSurfaceMeshSimplificationSummary, -\ref PkgSurfaceSegmentationSummary, and \ref PkgSurfaceMeshDeformationSummary on a surface mesh. +\ref PkgSurfaceMeshSimplification, +\ref PkgSurfaceMeshSegmentation, and \ref PkgSurfaceMeshDeformation on a surface mesh. \section sectionSurfaceMeshUsage Usage @@ -92,7 +92,7 @@ in a surface mesh: `Surface_mesh::opposite()`, `Surface_mesh::next()`, functions `Surface_mesh::halfedge()` allows to obtain the halfedge associated to a vertex and to a face. Alternatively, one may use the free functions with the same names -defined in the package \ref PkgBGLSummary. +defined in the package \ref PkgBGL. \cgalFigureBegin{FigSurfaceMeshConnectivity,connectivity.svg} Connectivity of halfedges and vertices in a surface mesh seen from outside. @@ -114,7 +114,7 @@ The connectivity does not allow to represent faces with holes. `Surface_mesh` provides iterator ranges to enumerate all vertices, halfedges, edges, and faces. It provides member functions returning ranges of elements which are compatible with the -Boost.Range +Boost.Range library. \subsection iterators_example Example @@ -129,7 +129,7 @@ and alternatives for range-based loops. \section sectionSurfaceMesh_circulators Circulators Circulators around faces and around vertices are provided as class templates -in the package \ref PkgBGLSummary. +in the package \ref PkgBGL. Circulators around faces basically call `Surface_mesh::next()` in order to go from halfedge to halfedge counterclockwise around the face, and @@ -227,8 +227,8 @@ face of `h`, and for all vertices of the surface mesh, respectively. The class `Surface_mesh` is a model of the concept `IncidenceGraph` defined in the Boost Graph Library. This enables to apply algorithms such as -[Dijkstra shortest path](http://www.boost.org/libs/graph/doc/dijkstra_shortest_paths.html), or -[Kruskal minimum spanning tree](http://www.boost.org/libs/graph/doc/kruskal_min_spanning_tree.html) +[Dijkstra shortest path](https://www.boost.org/libs/graph/doc/dijkstra_shortest_paths.html), or +[Kruskal minimum spanning tree](https://www.boost.org/libs/graph/doc/kruskal_min_spanning_tree.html) directly on a surface mesh. The types and free functions of the BGL API have each a similar type or member function, @@ -250,7 +250,7 @@ fall in the range `[0,num_vertices(g))` which is assumed in many of the algorithms. The class `Surface_mesh` is also a model of the concept `MutableFaceGraph` defined -in the package \ref PkgBGLSummary. This and similar concepts like `HalfedgeGraph` +in the package \ref PkgBGL. This and similar concepts like `HalfedgeGraph` refine the graph concepts of the BGL by introducing the notion of halfedges and faces, as well as cycles of halfedges around faces and around vertices. Again, there are similar types and functions, for example: @@ -268,7 +268,7 @@ Again, there are similar types and functions, for example: | etc. | | The BGL API described -in the package \ref PkgBGLSummary enables us to write geometric algorithms operating +in the package \ref PkgBGL enables us to write geometric algorithms operating on surface meshes, that work for any model of `FaceGraph`, or `MutableFaceGraph`. That is surface mesh simplification, deformation, or segmentation algorithms work for `Surface_mesh` and `Polyhedron_3`. @@ -380,12 +380,12 @@ This package is derived from an early version of Daniel Sieger and Mario Botsch %Surface_mesh \cgalCite{sieger2011design}, which is inspired from the design of OpenMesh and the \cgal package -\ref PkgPolyhedronSummary. +\ref PkgPolyhedron. Philipp Moeller and Andreas Fabri worked on the code so that iterators fulfill the requirements of the \stl iterator concepts, and changed the API so that it becomes a model of the concepts `MutableFaceGraph` -and `FaceListGraph` of the package \ref PkgBGLSummary. +and `FaceListGraph` of the package \ref PkgBGL. */ diff --git a/Surface_mesh/examples/Surface_mesh/CMakeLists.txt b/Surface_mesh/examples/Surface_mesh/CMakeLists.txt index 6170d1bb2b7..6ad86b00d0d 100644 --- a/Surface_mesh/examples/Surface_mesh/CMakeLists.txt +++ b/Surface_mesh/examples/Surface_mesh/CMakeLists.txt @@ -4,11 +4,18 @@ project( Surface_mesh_Examples ) -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.1) -if(NOT POLICY CMP0070 AND POLICY CMP0053) +if(POLICY CMP0053) # Only set CMP0053 to OLD with CMake<3.10, otherwise there is a warning. - cmake_policy(SET CMP0053 OLD) + if(NOT POLICY CMP0070) + cmake_policy(SET CMP0053 OLD) + else() + cmake_policy(SET CMP0053 NEW) + endif() +endif() +if(POLICY CMP0071) + cmake_policy(SET CMP0071 NEW) endif() find_package(CGAL COMPONENTS Qt5) @@ -19,12 +26,6 @@ endif() if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - include_directories (BEFORE "../../include") - create_single_source_cgal_program( "sm_derivation.cpp" ) create_single_source_cgal_program( "sm_join.cpp" ) create_single_source_cgal_program( "sm_aabbtree.cpp" ) diff --git a/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h b/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h index b28d643f531..88aad1e20b9 100644 --- a/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h +++ b/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h @@ -73,7 +73,7 @@ namespace CGAL { public: typedef boost::uint32_t size_type; /// Constructor. %Default construction creates an invalid index. - /// We write -1, which is + /// We write -1, which is /// std::numeric_limits::max() /// as `size_type` is an unsigned type. explicit SM_Index(size_type _idx=(std::numeric_limits::max)()) : idx_(_idx) {} @@ -269,7 +269,7 @@ namespace CGAL { /// \ingroup PkgSurface_mesh /// This class is a data structure that can be used as halfedge data structure or polyhedral /// surface. It is an alternative to the classes `HalfedgeDS` and `Polyhedron_3` - /// defined in the packages \ref PkgHDSSummary and \ref PkgPolyhedronSummary. + /// defined in the packages \ref PkgHalfedgeDS and \ref PkgPolyhedron. /// The main difference is that it is indexed based and not pointer based, /// and that the mechanism for adding information to vertices, halfedges, edges, /// and faces is much simpler and done at runtime and not at compile time. @@ -566,7 +566,7 @@ public: /// \brief The range over all vertex indices. /// - /// A model of BidirectionalRange with value type `Vertex_index`. + /// A model of BidirectionalRange with value type `Vertex_index`. /// \sa `vertices()` /// \sa `Halfedge_range`, `Edge_range`, `Face_range` #ifdef DOXYGEN_RUNNING @@ -581,7 +581,7 @@ public: /// \brief The range over all halfedge indices. /// - /// A model of BidirectionalRange with value type `Halfedge_index`. + /// A model of BidirectionalRange with value type `Halfedge_index`. /// \sa `halfedges()` /// \sa `Vertex_range`, `Edge_range`, `Face_range` #ifdef DOXYGEN_RUNNING @@ -596,7 +596,7 @@ public: /// \brief The range over all edge indices. /// - /// A model of BidirectionalRange with value type `Edge_index`. + /// A model of BidirectionalRange with value type `Edge_index`. /// \sa `edges()` /// \sa `Halfedge_range`, `Vertex_range`, `Face_range` #ifdef DOXYGEN_RUNNING @@ -611,7 +611,7 @@ public: #endif /// \brief The range over all face indices. /// - /// A model of BidirectionalRange with value type `Face_index`. + /// A model of BidirectionalRange with value type `Face_index`. /// \sa `faces()` /// \sa `Vertex_range`, `Halfedge_range`, `Edge_range` #ifdef DOXYGEN_RUNNING @@ -1112,7 +1112,7 @@ public: bool join(const Surface_mesh& other) { - size_type nv = num_vertices(), nh = num_halfedges(), nf = num_faces(); + const size_type nv = num_vertices(), nh = num_halfedges(), nf = num_faces(); resize(num_vertices()+ other.num_vertices(), num_edges()+ other.num_edges(), num_faces()+ other.num_faces()); @@ -1155,7 +1155,9 @@ public: Vertex_index vi(nv+other.vertices_freelist_); Halfedge_index inf((std::numeric_limits::max)()); while(vconn_[vi].halfedge_ != inf){ - vi = Vertex_index(size_type(vconn_[vi].halfedge_)); + Vertex_index corrected_vi = Vertex_index(size_type(vconn_[vi].halfedge_)+nv-nh); + vconn_[vi].halfedge_ = Halfedge_index(corrected_vi); + vi = corrected_vi; } vconn_[vi].halfedge_ = Halfedge_index(vertices_freelist_); } @@ -1166,7 +1168,9 @@ public: Face_index fi(nf+other.faces_freelist_); Halfedge_index inf((std::numeric_limits::max)()); while(fconn_[fi].halfedge_ != inf){ - fi = Face_index(size_type(fconn_[fi].halfedge_)); + Face_index corrected_fi = Face_index(size_type(fconn_[fi].halfedge_)+nf-nh); + fconn_[fi].halfedge_ = Halfedge_index(corrected_fi); + fi = corrected_fi; } fconn_[fi].halfedge_ = Halfedge_index(faces_freelist_); } @@ -1174,14 +1178,14 @@ public: } if(other.edges_freelist_ != inf_value){ if(edges_freelist_ != inf_value){ - Halfedge_index hi((nh>>1)+other.edges_freelist_); + Halfedge_index hi(nh+other.edges_freelist_); Halfedge_index inf((std::numeric_limits::max)()); while(hconn_[hi].next_halfedge_ != inf){ hi = hconn_[hi].next_halfedge_; } hconn_[hi].next_halfedge_ = Halfedge_index(edges_freelist_); } - edges_freelist_ = (nh>>1) + other.edges_freelist_; + edges_freelist_ = nh + other.edges_freelist_; } garbage_ = garbage_ || other.garbage_; removed_vertices_ += other.removed_vertices_; @@ -1962,6 +1966,22 @@ private: //--------------------------------------------------- property handling } /// @} +#if defined(CGAL_SURFACE_MESH_TEST_SUITE) + Vertex_index vertex_freelist() const + { + return Vertex_index(vertices_freelist_); + } + + Face_index face_freelist() const + { + return Face_index(faces_freelist_); + } + + Edge_index edge_freelist() const + { + return Edge_index(edges_freelist_>>1); + } +#endif private: //--------------------------------------------------- helper functions diff --git a/Surface_mesh/include/CGAL/draw_surface_mesh.h b/Surface_mesh/include/CGAL/draw_surface_mesh.h index 3e5f602d94c..6d34dd96f90 100644 --- a/Surface_mesh/include/CGAL/draw_surface_mesh.h +++ b/Surface_mesh/include/CGAL/draw_surface_mesh.h @@ -71,7 +71,7 @@ class SimpleSurfaceMeshViewerQt : public Basic_viewer_qt typedef typename SM::Face_index face_descriptor; typedef typename SM::Edge_index edge_descriptor; typedef typename SM::Halfedge_index halfedge_descriptor; - + public: /// Construct the viewer. /// @param amesh the surface mesh to view @@ -156,40 +156,41 @@ protected: } protected: - typename Kernel::Vector_3 get_face_normal(halfedge_descriptor he) + Local_vector get_face_normal(halfedge_descriptor he) { - typename Kernel::Vector_3 normal=CGAL::NULL_VECTOR; + Local_vector normal=CGAL::NULL_VECTOR; halfedge_descriptor end=he; unsigned int nb=0; do { - internal::newell_single_step_3(sm.point(sm.source(he)), - sm.point(sm.target(he)), normal); + internal::newell_single_step_3 + (internal::Geom_utils::get_local_point(sm.point(sm.source(he))), + internal::Geom_utils::get_local_point(sm.point(sm.target(he))), normal); ++nb; he=sm.next(he); } while (he!=end); assert(nb>0); - return (typename Kernel::Construct_scaled_vector_3()(normal, 1.0/nb)); + return (typename Local_kernel::Construct_scaled_vector_3()(normal, 1.0/nb)); } - typename Kernel::Vector_3 get_vertex_normal(halfedge_descriptor he) + Local_vector get_vertex_normal(halfedge_descriptor he) { - typename Kernel::Vector_3 normal=CGAL::NULL_VECTOR; + Local_vector normal=CGAL::NULL_VECTOR; halfedge_descriptor end=he; do { if (!sm.is_border(he)) { - typename Kernel::Vector_3 n=get_face_normal(he); - normal=typename Kernel::Construct_sum_of_vectors_3()(normal, n); + Local_vector n=get_face_normal(he); + normal=typename Local_kernel::Construct_sum_of_vectors_3()(normal, n); } he=sm.next(sm.opposite(he)); } while (he!=end); - if (!typename Kernel::Equal_3()(normal, CGAL::NULL_VECTOR)) - { normal=(typename Kernel::Construct_scaled_vector_3() + if (!typename Local_kernel::Equal_3()(normal, CGAL::NULL_VECTOR)) + { normal=(typename Local_kernel::Construct_scaled_vector_3() (normal, 1.0/CGAL::sqrt(normal.squared_length()))); } return normal; diff --git a/Surface_mesh/test/Surface_mesh/CMakeLists.txt b/Surface_mesh/test/Surface_mesh/CMakeLists.txt index 3665eabc560..07743df73f9 100644 --- a/Surface_mesh/test/Surface_mesh/CMakeLists.txt +++ b/Surface_mesh/test/Surface_mesh/CMakeLists.txt @@ -4,18 +4,12 @@ project( Surface_mesh_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Surface_mesh/test/Surface_mesh/sm_join_test.cpp b/Surface_mesh/test/Surface_mesh/sm_join_test.cpp new file mode 100644 index 00000000000..937f7b05e5b --- /dev/null +++ b/Surface_mesh/test/Surface_mesh/sm_join_test.cpp @@ -0,0 +1,77 @@ +#define CGAL_SURFACE_MESH_TEST_SUITE 1 // so that we can access the freelists + +#include +#include +#include + +#include +#include + +typedef CGAL::Simple_cartesian K; +typedef K::Point_3 Point_3; +typedef CGAL::Surface_mesh Sm; + +typedef boost::graph_traits::vertex_descriptor vertex_descriptor; +typedef boost::graph_traits::halfedge_descriptor halfedge_descriptor; +typedef boost::graph_traits::edge_descriptor edge_descriptor; +typedef boost::graph_traits::face_descriptor face_descriptor; + +void +freelist(const Sm& sm, int vc, int fc, int ec) +{ + std::cout << "vertex freelist" << std::endl; + vertex_descriptor vd = sm.vertex_freelist(); + while(vd != sm.null_vertex()){ + --vc; + std::cout << vd << std::endl; + halfedge_descriptor hd = halfedge(vd,sm); + vd = vertex_descriptor((Sm::size_type)hd); + } + assert(vc == 0); + + std::cout << "face freelist" << std::endl; + face_descriptor fd = sm.face_freelist(); + while(fd != sm.null_face()){ + --fc; + std::cout << fd << std::endl; + halfedge_descriptor hd = halfedge(fd,sm); + fd = face_descriptor((Sm::size_type)hd); + } + assert(fc == 0); + + std::cout << "edge freelist" << std::endl; + edge_descriptor ed = sm.edge_freelist(); + while(ed != sm.null_edge()){ + --ec; + std::cout << ed << std::endl; + halfedge_descriptor hd = next(halfedge(ed,sm),sm); + ed = edge(hd,sm); + } + assert(ec == 0); +} + + +int main() +{ + Sm sm1, sm2; + { + std::ifstream in("cube.off"); + in >> sm1; + CGAL::Euler::remove_center_vertex(*(halfedges(sm1).first),sm1); + } + freelist(sm1,1,5,6); + + { + std::ifstream in("cube.off"); + in >> sm2; + CGAL::Euler::remove_center_vertex(*(halfedges(sm2).first),sm2); + } + + freelist(sm1,1,5,6); + + sm1.join(sm2); + freelist(sm1,2,10,12); + + return 0; +} + 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 619a3b5eea0..cd75dcec4e3 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 @@ -1,20 +1,17 @@ project( benchmark_for_closest_rotation ) -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET COMPONENTS Core ) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) + include(${CGAL_USE_FILE}) find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) if (EIGEN3_FOUND) include( ${EIGEN3_USE_FILE} ) - include( CGAL_CreateSingleSourceCGALProgram ) - - include_directories (BEFORE "../../include") create_single_source_cgal_program( "benchmark_for_concept_models.cpp" ) diff --git a/Surface_mesh_deformation/demo/Surface_mesh_deformation/CMakeLists.txt b/Surface_mesh_deformation/demo/Surface_mesh_deformation/CMakeLists.txt index 95cc6a9871b..17b6de5841c 100644 --- a/Surface_mesh_deformation/demo/Surface_mesh_deformation/CMakeLists.txt +++ b/Surface_mesh_deformation/demo/Surface_mesh_deformation/CMakeLists.txt @@ -16,14 +16,10 @@ find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - find_package(Eigen3 3.1.91) #(requires 3.2.0 or greater) if (EIGEN3_FOUND) include( ${EIGEN3_USE_FILE} ) - include( CGAL_CreateSingleSourceCGALProgram ) - include_directories (BEFORE "../../include") create_single_source_cgal_program( "deform_mesh_for_botsch08_format.cpp" ) else() diff --git a/Surface_mesh_deformation/doc/Surface_mesh_deformation/PackageDescription.txt b/Surface_mesh_deformation/doc/Surface_mesh_deformation/PackageDescription.txt index 9e6d03b2ed2..24fb3febb41 100644 --- a/Surface_mesh_deformation/doc/Surface_mesh_deformation/PackageDescription.txt +++ b/Surface_mesh_deformation/doc/Surface_mesh_deformation/PackageDescription.txt @@ -1,20 +1,20 @@ -/// \defgroup PkgSurfaceMeshDeformation Triangulated Surface Mesh Deformation Reference +/// \defgroup PkgSurfaceMeshDeformationRef Triangulated Surface Mesh Deformation Reference /// \defgroup PkgSurfaceMeshDeformationConcepts Concepts -/// \ingroup PkgSurfaceMeshDeformation +/// \ingroup PkgSurfaceMeshDeformationRef /*! -\addtogroup PkgSurfaceMeshDeformation -\cgalPkgDescriptionBegin{Triangulated Surface Mesh Deformation,PkgSurfaceMeshDeformationSummary} +\addtogroup PkgSurfaceMeshDeformationRef +\cgalPkgDescriptionBegin{Triangulated Surface Mesh Deformation,PkgSurfaceMeshDeformation} \cgalPkgPicture{deform-ico.png} \cgalPkgSummaryBegin \cgalPkgAuthor{Sébastien Loriot, Olga Sorkine-Hornung, Yin Xu and Ilker %O. Yaz} \cgalPkgDesc{This package offers surface mesh deformation algorithms which provide new positions to the vertices of a surface mesh under positional constraints of some of its vertices, without requiring any additional structure other than the surface mesh itself.} -\cgalPkgManuals{Chapter_SurfaceMeshDeformation,PkgSurfaceMeshDeformation} +\cgalPkgManuals{Chapter_SurfaceMeshDeformation,PkgSurfaceMeshDeformationRef} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{4.5} -\cgalPkgDependsOn{\ref PkgSolverSummary and \ref thirdpartyEigen} +\cgalPkgDependsOn{\ref PkgSolverInterface and \ref thirdpartyEigen} \cgalPkgBib{cgal:lsxy-tsmd} \cgalPkgLicense{\ref licensesGPL "GPL"} \cgalPkgDemo{Polyhedron demo,polyhedron_3.zip} diff --git a/Surface_mesh_deformation/examples/Surface_mesh_deformation/CMakeLists.txt b/Surface_mesh_deformation/examples/Surface_mesh_deformation/CMakeLists.txt index a00d63cb99c..ceac6ce44de 100644 --- a/Surface_mesh_deformation/examples/Surface_mesh_deformation/CMakeLists.txt +++ b/Surface_mesh_deformation/examples/Surface_mesh_deformation/CMakeLists.txt @@ -4,21 +4,16 @@ project( Surface_mesh_deformation_Examples ) -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - find_package(Eigen3 3.1.91) #(requires 3.2.0 or greater) if (EIGEN3_FOUND) include( ${EIGEN3_USE_FILE} ) - include( CGAL_CreateSingleSourceCGALProgram ) - - include_directories (BEFORE "../../include") create_single_source_cgal_program( "all_roi_assign_example.cpp" ) create_single_source_cgal_program( "all_roi_assign_example_custom_polyhedron.cpp" ) diff --git a/Surface_mesh_deformation/include/CGAL/Deformation_Eigen_closest_rotation_traits_3.h b/Surface_mesh_deformation/include/CGAL/Deformation_Eigen_closest_rotation_traits_3.h index 1350947abdf..30fa0065b7e 100644 --- a/Surface_mesh_deformation/include/CGAL/Deformation_Eigen_closest_rotation_traits_3.h +++ b/Surface_mesh_deformation/include/CGAL/Deformation_Eigen_closest_rotation_traits_3.h @@ -26,7 +26,7 @@ #include namespace CGAL { -/// \ingroup PkgSurfaceMeshDeformation +/// \ingroup PkgSurfaceMeshDeformationRef /// A class to compute the closest rotation in Frobenius norm to a 3x3 Matrix using the \link thirdpartyEigen `Eigen` library \endlink. /// The internal computation relies on `Eigen::JacobiSVD<>` solver. /// diff --git a/Surface_mesh_deformation/include/CGAL/Deformation_Eigen_polar_closest_rotation_traits_3.h b/Surface_mesh_deformation/include/CGAL/Deformation_Eigen_polar_closest_rotation_traits_3.h index 24e12cb0de2..b481ee01ece 100644 --- a/Surface_mesh_deformation/include/CGAL/Deformation_Eigen_polar_closest_rotation_traits_3.h +++ b/Surface_mesh_deformation/include/CGAL/Deformation_Eigen_polar_closest_rotation_traits_3.h @@ -27,7 +27,7 @@ #include namespace CGAL { - /// \ingroup PkgSurfaceMeshDeformation + /// \ingroup PkgSurfaceMeshDeformationRef /// A class to compute the closest rotation in Frobenius norm to a 3x3 Matrix using the \link thirdpartyEigen `Eigen` library \endlink. /// The internal computation relies on a hybrid system using the solvers `Eigen::SelfAdjointEigenSolver<>` /// and `Eigen::JacobiSVD<>` (polar decomposition). diff --git a/Surface_mesh_deformation/include/CGAL/Surface_mesh_deformation.h b/Surface_mesh_deformation/include/CGAL/Surface_mesh_deformation.h index c9d2b7576f0..f25f6f43a9d 100644 --- a/Surface_mesh_deformation/include/CGAL/Surface_mesh_deformation.h +++ b/Surface_mesh_deformation/include/CGAL/Surface_mesh_deformation.h @@ -52,7 +52,7 @@ namespace CGAL { -/// \ingroup PkgSurfaceMeshDeformation +/// \ingroup PkgSurfaceMeshDeformationRef ///@brief Deformation algorithm type enum Deformation_algorithm_tag { @@ -173,7 +173,7 @@ struct SC_on_the_fly_pmap: public Vertex_point_map{ /// @endcond /// - /// \ingroup PkgSurfaceMeshDeformation + /// \ingroup PkgSurfaceMeshDeformationRef /// @brief Class providing the functionalities for deforming a triangulated surface mesh /// /// @tparam TM a model of `HalfedgeGraph` diff --git a/Surface_mesh_deformation/test/Surface_mesh_deformation/CMakeLists.txt b/Surface_mesh_deformation/test/Surface_mesh_deformation/CMakeLists.txt index 291b39ae8a1..a857d6c00e8 100644 --- a/Surface_mesh_deformation/test/Surface_mesh_deformation/CMakeLists.txt +++ b/Surface_mesh_deformation/test/Surface_mesh_deformation/CMakeLists.txt @@ -4,18 +4,13 @@ project( Surface_mesh_deformation_Tests ) -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - include_directories (BEFORE "../../include") find_package(Eigen3 3.1.91) #(requires 3.2.0 or greater) if (EIGEN3_FOUND) include( ${EIGEN3_USE_FILE} ) diff --git a/Surface_mesh_parameterization/doc/Surface_mesh_parameterization/Concepts/Parameterizer_3.h b/Surface_mesh_parameterization/doc/Surface_mesh_parameterization/Concepts/Parameterizer_3.h index 9d3c6753322..35046b4d110 100644 --- a/Surface_mesh_parameterization/doc/Surface_mesh_parameterization/Concepts/Parameterizer_3.h +++ b/Surface_mesh_parameterization/doc/Surface_mesh_parameterization/Concepts/Parameterizer_3.h @@ -1,5 +1,5 @@ /*! -\ingroup PkgSurfaceParameterizationConcepts +\ingroup PkgSurfaceMeshParameterizationConcepts \cgalConcept `Parameterizer_3` is a concept of parameterization object for a given type diff --git a/Surface_mesh_parameterization/doc/Surface_mesh_parameterization/PackageDescription.txt b/Surface_mesh_parameterization/doc/Surface_mesh_parameterization/PackageDescription.txt index 834d640d929..64da5b2ec5e 100644 --- a/Surface_mesh_parameterization/doc/Surface_mesh_parameterization/PackageDescription.txt +++ b/Surface_mesh_parameterization/doc/Surface_mesh_parameterization/PackageDescription.txt @@ -1,9 +1,9 @@ -/// \defgroup PkgSurfaceParameterization Triangulated Surface Mesh Parameterization Reference +/// \defgroup PkgSurfaceMeshParameterizationRef Triangulated Surface Mesh Parameterization Reference /*! -\addtogroup PkgSurfaceParameterization -\cgalPkgDescriptionBegin{Triangulated Surface Mesh Parameterization,PkgSurfaceParameterizationSummary} +\addtogroup PkgSurfaceMeshParameterizationRef +\cgalPkgDescriptionBegin{Triangulated Surface Mesh Parameterization,PkgSurfaceMeshParameterization} \cgalPkgPicture{bimbaDetail.png} \cgalPkgSummaryBegin \cgalPkgAuthors{Laurent Saboret, Pierre Alliez, Bruno Lévy, Mael Rouxel-Labbé, and Andreas Fabri} @@ -15,11 +15,11 @@ As Rigid As Possible Parameterization, Discrete Authalic Parameterization, Discrete Conformal Map, Floater Mean Value Coordinates, Least Squares Conformal Maps, Orbifold Tutte Embedding, or Tutte Barycentric Mapping. The code is generic and works with any model of the `FaceGraph` concept.} -\cgalPkgManuals{Chapter_Planar_Parameterization_of_Triangulated_Surface_Meshes, PkgSurfaceParameterization} +\cgalPkgManuals{Chapter_Planar_Parameterization_of_Triangulated_Surface_Meshes, PkgSurfaceMeshParameterizationRef} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{3.2} -\cgalPkgDependsOn{\ref PkgSolverSummary} +\cgalPkgDependsOn{\ref PkgSolverInterface} \cgalPkgBib{cgal:salf-pptsm2} \cgalPkgLicense{\ref licensesGPL "GPL"} \cgalPkgDemo{Polyhedron demo,polyhedron_3.zip} @@ -113,29 +113,29 @@ The package performs the next checks: */ /*! - \defgroup PkgSurfaceParameterizationMainFunction Main Functions - \ingroup PkgSurfaceParameterization + \defgroup PkgSurfaceMeshParameterizationMainFunction Main Functions + \ingroup PkgSurfaceMeshParameterizationRef The central functions, main entry point of the package. */ /*! - \defgroup PkgSurfaceParameterizationEnums Enums - \ingroup PkgSurfaceParameterization + \defgroup PkgSurfaceMeshParameterizationEnums Enums + \ingroup PkgSurfaceMeshParameterizationRef The enum classes defined and used in this package. */ /*! - \defgroup PkgSurfaceParameterizationConcepts Concepts - \ingroup PkgSurfaceParameterization + \defgroup PkgSurfaceMeshParameterizationConcepts Concepts + \ingroup PkgSurfaceMeshParameterizationRef The concepts of this package. */ /*! - \defgroup PkgSurfaceParameterizationMethods Surface Parameterization Methods - \ingroup PkgSurfaceParameterization + \defgroup PkgSurfaceMeshParameterizationMethods Surface Parameterization Methods + \ingroup PkgSurfaceMeshParameterizationRef This \cgal package implements several parameterization methods: @@ -156,8 +156,8 @@ The package performs the next checks: */ /*! - \defgroup PkgSurfaceParameterizationBorderParameterizationMethods Border Parameterization Methods - \ingroup PkgSurfaceParameterization + \defgroup PkgSurfaceMeshParameterizationBorderParameterizationMethods Border Parameterization Methods + \ingroup PkgSurfaceMeshParameterizationRef Border parameterization methods define a set of constraints (a constraint specifies two (u,v) coordinates for @@ -175,8 +175,8 @@ vertices). */ /*! - \defgroup PkgSurfaceParameterizationOrbifoldHelperFunctions Orbifold Helper Functions - \ingroup PkgSurfaceParameterizationMethods + \defgroup PkgSurfaceMeshParameterizationOrbifoldHelperFunctions Orbifold Helper Functions + \ingroup PkgSurfaceMeshParameterizationMethods */ diff --git a/Surface_mesh_parameterization/doc/Surface_mesh_parameterization/Surface_mesh_parameterization.txt b/Surface_mesh_parameterization/doc/Surface_mesh_parameterization/Surface_mesh_parameterization.txt index a94c5bcf38d..383e48fa9c4 100644 --- a/Surface_mesh_parameterization/doc/Surface_mesh_parameterization/Surface_mesh_parameterization.txt +++ b/Surface_mesh_parameterization/doc/Surface_mesh_parameterization/Surface_mesh_parameterization.txt @@ -52,7 +52,7 @@ disk-or-sphere topology requirement. Since parameterizing meshes requires an efficient representation of sparse matrices and efficient iterative or direct linear solvers, we provide a unified interface to linear solvers as described in Chapter -\ref PkgSolverSummary. +\ref PkgSolverInterface. Note that linear solvers commonly use double precision floating point numbers. Therefore, this package is intended to be used with a \cgal %Cartesian kernel with doubles. @@ -90,7 +90,7 @@ and homeomorphic to a disc (possibly with holes). The last requirement is not hard and we will later show how to parameterize a mesh that is not a topological disk (Section \ref secCuttingaMesh). The result is stored in a property map (whose type is here VertexUVMap) -for the mesh vertices. See also Chapter \ref PkgProperty_mapSummary. +for the mesh vertices. See also Chapter \ref PkgPropertyMap. \subsection Surface_mesh_parameterizationDefaultExample Default Parameterization Example In the following example, we apply the default parameterization (Floater Mean Value diff --git a/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/CMakeLists.txt b/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/CMakeLists.txt index 79737b538dc..4f384e746bf 100644 --- a/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/CMakeLists.txt +++ b/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/CMakeLists.txt @@ -3,20 +3,17 @@ project( Surface_mesh_parameterization_Examples ) -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.1) # Include this package's headers first -include_directories (BEFORE . include ../../include) +include_directories (BEFORE . include) # Find CGAL find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - include( CGAL_CreateSingleSourceCGALProgram ) - find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) if (EIGEN3_FOUND) # Executables that require Eigen 3.1 @@ -41,10 +38,14 @@ if ( CGAL_FOUND ) endif(NOT SuiteSparse_FOUND) if(SuiteSparse_FOUND) - message(STATUS "SuiteSparse_LIBS: ${SuiteSparse_LIBRARIES}") - message(STATUS "Orbifold Tutte Embeddings will use UmfPackLU") - add_definitions(-DEIGEN_DONT_ALIGN_STATICALLY) - add_definitions(-DCGAL_SMP_USE_SPARSESUITE_SOLVERS) + if (SuiteSparse_UMFPACK_FOUND) + message(STATUS "SuiteSparse_LIBS: ${SuiteSparse_LIBRARIES}") + message(STATUS "Orbifold Tutte Embeddings will use UmfPackLU") + 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.") + endif() else(SuiteSparse_FOUND) message(STATUS "NOTICE: The example `orbifold.cpp` will be compiled without the Sparsesuite library.") endif(SuiteSparse_FOUND) diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/ARAP_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/ARAP_parameterizer_3.h index ffb4c2a3e64..9ea58125de5 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/ARAP_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/ARAP_parameterizer_3.h @@ -115,7 +115,7 @@ namespace Surface_mesh_parameterization { // Declaration // ------------------------------------------------------------------------------------ -/// \ingroup PkgSurfaceParameterizationMethods +/// \ingroup PkgSurfaceMeshParameterizationMethods /// /// The class `ARAP_parameterizer_3` implements the /// *Local/Global Approach to Mesh Parameterization* \cgalCite{liu2008local}. diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Barycentric_mapping_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Barycentric_mapping_parameterizer_3.h index fe9efdc8d35..c120638bff6 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Barycentric_mapping_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Barycentric_mapping_parameterizer_3.h @@ -41,7 +41,7 @@ namespace CGAL { namespace Surface_mesh_parameterization { -/// \ingroup PkgSurfaceParameterizationMethods +/// \ingroup PkgSurfaceMeshParameterizationMethods /// /// The class `Barycentric_mapping_parameterizer_3` implements Tutte Barycentric /// Mapping algorithm. This algorithm is also called diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Circular_border_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Circular_border_parameterizer_3.h index 1c56f6d7f65..d1f506f9ed8 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Circular_border_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Circular_border_parameterizer_3.h @@ -45,7 +45,7 @@ namespace Surface_mesh_parameterization { // Class Circular_border_parameterizer_3 // -/// \ingroup PkgSurfaceParameterizationBorderParameterizationMethods +/// \ingroup PkgSurfaceMeshParameterizationBorderParameterizationMethods /// /// This is the base class of strategies that parameterize the border /// of a 3D surface onto a circle. @@ -179,7 +179,7 @@ public: // Class Circular_border_uniform_parameterizer_3 // -/// \ingroup PkgSurfaceParameterizationBorderParameterizationMethods +/// \ingroup PkgSurfaceMeshParameterizationBorderParameterizationMethods /// /// This class parameterizes the border of a 3D surface onto a circle /// in a uniform manner: points are equally spaced. @@ -231,7 +231,7 @@ public: // Class Circular_border_arc_length_parameterizer_3 // -/// \ingroup PkgSurfaceParameterizationBorderParameterizationMethods +/// \ingroup PkgSurfaceMeshParameterizationBorderParameterizationMethods /// /// This class parameterizes the border of a 3D surface onto a circle, /// with an arc-length parameterization: the `(u,v)` values are proportional diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Discrete_authalic_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Discrete_authalic_parameterizer_3.h index 52326a5f16d..591acd3ef72 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Discrete_authalic_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Discrete_authalic_parameterizer_3.h @@ -43,7 +43,7 @@ namespace CGAL { namespace Surface_mesh_parameterization { -/// \ingroup PkgSurfaceParameterizationMethods +/// \ingroup PkgSurfaceMeshParameterizationMethods /// /// The class `Discrete_authalic_parameterizer_3` /// implements the *Discrete Authalic Parameterization* algorithm. This method diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Discrete_conformal_map_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Discrete_conformal_map_parameterizer_3.h index 6550678212c..ae73354cb9d 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Discrete_conformal_map_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Discrete_conformal_map_parameterizer_3.h @@ -43,7 +43,7 @@ namespace CGAL { namespace Surface_mesh_parameterization { -/// \ingroup PkgSurfaceParameterizationMethods +/// \ingroup PkgSurfaceMeshParameterizationMethods /// /// The class `Discrete_conformal_map_parameterizer_3` /// implements the Discrete Conformal Map (DCM) parameterization. diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Error_code.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Error_code.h index 92c68372a0a..bb8329d6c36 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Error_code.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Error_code.h @@ -29,7 +29,7 @@ namespace CGAL { namespace Surface_mesh_parameterization { -/// \ingroup PkgSurfaceParameterizationEnums +/// \ingroup PkgSurfaceMeshParameterizationEnums /// /// List of errors detected by this package enum Error_code @@ -46,7 +46,7 @@ enum Error_code ERROR_WRONG_PARAMETER ///< A method received an unexpected parameter }; -/// \ingroup PkgSurfaceParameterizationEnums +/// \ingroup PkgSurfaceMeshParameterizationEnums /// \brief Get the message corresponding to an error code. /// \param error_code The code returned by `parameterize()` /// \return The string describing the error code. diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Fixed_border_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Fixed_border_parameterizer_3.h index a1d7a824fbe..9cb2304f041 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Fixed_border_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Fixed_border_parameterizer_3.h @@ -56,7 +56,7 @@ namespace Surface_mesh_parameterization { // Declaration // ------------------------------------------------------------------------------------ -/// \ingroup PkgSurfaceParameterizationMethods +/// \ingroup PkgSurfaceMeshParameterizationMethods /// /// The class `Fixed_border_parameterizer_3` /// is the base class of fixed border parameterization methods (Tutte, Floater, ...). diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/LSCM_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/LSCM_parameterizer_3.h index 9adda4bf219..10034cffb64 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/LSCM_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/LSCM_parameterizer_3.h @@ -56,7 +56,7 @@ namespace Surface_mesh_parameterization { // Declaration // ------------------------------------------------------------------------------------ -/// \ingroup PkgSurfaceParameterizationMethods +/// \ingroup PkgSurfaceMeshParameterizationMethods /// /// The class `LSCM_parameterizer_3` implements the /// *Least Squares Conformal Maps (LSCM)* parameterization \cgalCite{cgal:lprm-lscm-02}. diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Mean_value_coordinates_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Mean_value_coordinates_parameterizer_3.h index 8233acd540d..fde33c1214c 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Mean_value_coordinates_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Mean_value_coordinates_parameterizer_3.h @@ -40,7 +40,7 @@ namespace CGAL { namespace Surface_mesh_parameterization { -/// \ingroup PkgSurfaceParameterizationMethods +/// \ingroup PkgSurfaceMeshParameterizationMethods /// /// The class `Mean_value_coordinates_parameterizer_3` /// implements *Floater Mean Value Coordinates* parameterization. diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Orbifold_Tutte_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Orbifold_Tutte_parameterizer_3.h index fdb68bc3d09..6a465b5b68d 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Orbifold_Tutte_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Orbifold_Tutte_parameterizer_3.h @@ -72,7 +72,7 @@ namespace CGAL { namespace Surface_mesh_parameterization { -/// \ingroup PkgSurfaceParameterizationOrbifoldHelperFunctions +/// \ingroup PkgSurfaceMeshParameterizationOrbifoldHelperFunctions /// /// Read a serie of cones from an input stream. Cones are passed as an /// integer value that is the index of a vertex handle in the mesh tm`, using @@ -93,7 +93,7 @@ namespace Surface_mesh_parameterization { /// \param vpmap an initialized vertex index map /// \param out the output iterator /// -/// \pre The number of cones must match the chosen \link PkgSurfaceParameterizationEnums Orbifold_type \endlink. +/// \pre The number of cones must match the chosen \link PkgSurfaceMeshParameterizationEnums Orbifold_type \endlink. /// \pre No two cones correspond to the same vertex (all cones have different index). /// /// \return The corresponding vertex descriptors are output, in the same order as the input integers, in `out`. @@ -150,7 +150,7 @@ Error_code read_cones(const TriangleMesh& tm, std::ifstream& in, VertexIndexMap return OK; } -/// \ingroup PkgSurfaceParameterizationOrbifoldHelperFunctions +/// \ingroup PkgSurfaceMeshParameterizationOrbifoldHelperFunctions /// /// Same as above, using the default indexation of the vertices of `tm`: vertices /// are numbered from `0` to `num_vertices(tm)-1`, in the order that they appear @@ -175,7 +175,7 @@ Error_code read_cones(const TriangleMesh& tm, std::ifstream& in, ConeOutputItera return read_cones(tm, in, boost::make_assoc_property_map(m), out); } -/// \ingroup PkgSurfaceParameterizationOrbifoldHelperFunctions +/// \ingroup PkgSurfaceMeshParameterizationOrbifoldHelperFunctions /// /// Same as above, but from a file instead of a stream. template @@ -185,7 +185,7 @@ Error_code read_cones(const TriangleMesh& tm, const char* filename, VertexIndexM return read_cones(tm, in, vpmap, out); } -/// \ingroup PkgSurfaceParameterizationOrbifoldHelperFunctions +/// \ingroup PkgSurfaceMeshParameterizationOrbifoldHelperFunctions /// /// Same as above, but from a file instead of a stream. The default indexation /// of the vertices of `tm` is used: vertices are numbered from `0` to `num_vertices(tm)-1`, @@ -197,11 +197,11 @@ Error_code read_cones(const TriangleMesh& tm, const char* filename, ConeOutputIt return read_cones(tm, in, out); } -/// \ingroup PkgSurfaceParameterizationOrbifoldHelperFunctions +/// \ingroup PkgSurfaceMeshParameterizationOrbifoldHelperFunctions /// /// Locate the cones on the seam mesh (that is, find the corresponding seam mesh /// `vertex_descriptor`) and mark them with a tag to indicate whether the cone is a -/// simple cone or a duplicated cone (see \link PkgSurfaceParameterizationEnums Cone_type \endlink). +/// simple cone or a duplicated cone (see \link PkgSurfaceMeshParameterizationEnums Cone_type \endlink). /// /// \attention The cones must be ordered: the first and last cones are the extremities of the seam. /// @@ -210,9 +210,9 @@ Error_code read_cones(const TriangleMesh& tm, const char* filename, ConeOutputIt /// having to pass the multiple template parameters of the class `CGAL::Seam_mesh`. /// \tparam ConeInputBidirectionalIterator must be a model of `BidirectionalIterator` /// with value type `boost::graph_traits::%vertex_descriptor`. -/// \tparam ConeMap must be a model of AssociativeContainer +/// \tparam ConeMap must be a model of `AssociativeContainer` /// with `boost::graph_traits::%vertex_descriptor` as key type and -/// \link PkgSurfaceParameterizationEnums Cone_type \endlink as value type. +/// \link PkgSurfaceMeshParameterizationEnums Cone_type \endlink as value type. /// /// \param mesh the seam mesh /// \param first, beyond the range of cones, as vertex descriptors of the base mesh. @@ -258,7 +258,7 @@ bool locate_cones(const SeamMesh& mesh, return internal::check_cone_validity(mesh, first, beyond, cones); } -/// \ingroup PkgSurfaceParameterizationOrbifoldHelperFunctions +/// \ingroup PkgSurfaceMeshParameterizationOrbifoldHelperFunctions /// /// Same as above, but the cones are not ordered and we thus use seam mesh /// information to determine which cones are extremities of the seam (so-called @@ -345,7 +345,7 @@ bool locate_unordered_cones(const SeamMesh& mesh, return internal::check_cone_validity(mesh, first, beyond, cones); } -/// \ingroup PkgSurfaceParameterizationMethods +/// \ingroup PkgSurfaceMeshParameterizationMethods /// /// The class `Orbifold_Tutte_parameterizer_3` implements Orbifold Tutte Planar /// Embeddings \cgalCite{aigerman2015orbifold}. @@ -359,7 +359,7 @@ bool locate_unordered_cones(const SeamMesh& mesh, /// /// Some helper functions related to the class `Orbifold_Tutte_parameterizer_3` /// (for example to read and compute paths between cones) can be found -/// \link PkgSurfaceParameterizationOrbifoldHelperFunctions here \endlink. +/// \link PkgSurfaceMeshParameterizationOrbifoldHelperFunctions here \endlink. /// /// The example \ref Surface_mesh_parameterization/orbifold.cpp "orbifold.cpp" /// shows how to select cones on the input mesh and automatically construct @@ -384,7 +384,7 @@ bool locate_unordered_cones(const SeamMesh& mesh, /// Eigen::UmfPackLU::EigenType> > /// \endcode /// -/// \sa \ref PkgSurfaceParameterizationOrbifoldHelperFunctions +/// \sa \ref PkgSurfaceMeshParameterizationOrbifoldHelperFunctions /// template < typename SeamMesh, typename SolverTraits_ = Default> @@ -896,9 +896,9 @@ public: /// The mapping is piecewise linear (linear in each triangle). /// The result is the (u,v) pair image of each vertex of the 3D surface. /// - /// \tparam ConeMap must be a model of AssociativeContainer + /// \tparam ConeMap must be a model of `AssociativeContainer` /// with key type `boost::graph_traits::%vertex_descriptor` and - /// \link PkgSurfaceParameterizationEnums Cone_type \endlink as value type. + /// \link PkgSurfaceMeshParameterizationEnums Cone_type \endlink as value type. /// \tparam VertexUVmap must be a model of `ReadWritePropertyMap` with /// `boost::graph_traits::%vertex_descriptor` as key type and /// %Point_2 (type deduced from `Seam_mesh` using `Kernel_traits`) @@ -910,7 +910,7 @@ public: /// \param mesh a `Seam_mesh` parameterized by any model of a `FaceListGraph` and `HalfedgeListGraph` /// \param bhd a halfedge on the border of the seam mesh /// \param cmap a mapping of the `vertex_descriptor`s of `mesh` that are cones - /// to their respective \link PkgSurfaceParameterizationEnums Cone_type \endlink + /// to their respective \link PkgSurfaceMeshParameterizationEnums Cone_type \endlink /// classification. /// \param uvmap an instanciation of the class `VertexUVmap`. /// \param vimap an instanciation of the class `VertexIndexMap`. diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Square_border_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Square_border_parameterizer_3.h index c257682fcc4..484981c7f95 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Square_border_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Square_border_parameterizer_3.h @@ -47,7 +47,7 @@ namespace Surface_mesh_parameterization { // Class Square_border_parameterizer_3 // -/// \ingroup PkgSurfaceParameterizationBorderParameterizationMethods +/// \ingroup PkgSurfaceMeshParameterizationBorderParameterizationMethods /// /// This is the base class of strategies that parameterize the border /// of a 3D surface onto a square. @@ -383,7 +383,7 @@ public: // Class Square_border_uniform_parameterizer_3 // -/// \ingroup PkgSurfaceParameterizationBorderParameterizationMethods +/// \ingroup PkgSurfaceMeshParameterizationBorderParameterizationMethods /// /// This class parameterizes the border of a 3D surface onto a square /// in a uniform manner: points are equally spaced. @@ -449,7 +449,7 @@ protected: // Class Square_border_arc_length_parameterizer_3 // -/// \ingroup PkgSurfaceParameterizationBorderParameterizationMethods +/// \ingroup PkgSurfaceMeshParameterizationBorderParameterizationMethods /// /// This class parameterizes the border of a 3D surface onto a square, /// with an arc-length parameterization: `(u,v)` values are diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Two_vertices_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Two_vertices_parameterizer_3.h index 45baf92e460..1fb24b7064f 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Two_vertices_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Two_vertices_parameterizer_3.h @@ -46,7 +46,7 @@ namespace Surface_mesh_parameterization { // Declaration // -/// \ingroup PkgSurfaceParameterizationBorderParameterizationMethods +/// \ingroup PkgSurfaceMeshParameterizationBorderParameterizationMethods /// /// The class `Two_vertices_parameterizer_3` parameterizes two extreme vertices /// of a 3D surface. diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/orbifold_enums.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/orbifold_enums.h index b634c2197cf..e60fd1ead14 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/orbifold_enums.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/orbifold_enums.h @@ -29,7 +29,7 @@ namespace CGAL { namespace Surface_mesh_parameterization { -/// \ingroup PkgSurfaceParameterizationEnums +/// \ingroup PkgSurfaceMeshParameterizationEnums /// /// The two possible weight types available in the Orbifold Tutte parameterization. enum Weight_type @@ -40,7 +40,7 @@ enum Weight_type /// and the parameterization is guaranteed to be injective. }; -/// \ingroup PkgSurfaceParameterizationEnums +/// \ingroup PkgSurfaceMeshParameterizationEnums /// /// A classification type for the cones used in Orbifold Tutte parameterization. enum Cone_type @@ -52,7 +52,7 @@ enum Cone_type /// at two different positions. }; -/// \ingroup PkgSurfaceParameterizationEnums +/// \ingroup PkgSurfaceMeshParameterizationEnums /// /// The four Orbifold types available in the Orbifold Tutte parameterization. /// The different shapes result from the number of cones and the angle constraints @@ -65,7 +65,7 @@ enum Orbifold_type Parallelogram ///< Four cones, forming a parallelogram-shaped basic tile. }; -/// \ingroup PkgSurfaceParameterizationEnums +/// \ingroup PkgSurfaceMeshParameterizationEnums /// \brief Convert the orbifold type to a literal message. /// \param orb_type the integer value in the enum /// \return the string describing the Orbifold type. diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/orbifold_shortest_path.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/orbifold_shortest_path.h index 3a21e30b78d..c7b9c335473 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/orbifold_shortest_path.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/orbifold_shortest_path.h @@ -107,10 +107,10 @@ public: } // namespace internal -/// \ingroup PkgSurfaceParameterizationOrbifoldHelperFunctions +/// \ingroup PkgSurfaceMeshParameterizationOrbifoldHelperFunctions /// /// Compute the shortest path between `source` and `target` over `mesh`, using -/// +/// /// boost::dijkstra_shortest_paths(). /// /// \tparam TriangleMesh A triangle mesh, model of `FaceListGraph` and `HalfedgeListGraph`. @@ -166,7 +166,7 @@ void compute_shortest_paths_between_two_cones(const TriangleMesh& mesh, } while (s != source); } -/// \ingroup PkgSurfaceParameterizationOrbifoldHelperFunctions +/// \ingroup PkgSurfaceMeshParameterizationOrbifoldHelperFunctions /// /// Given a range `[first; beyond[` of cones (described as vertex descriptors), /// compute the shortest path for all pairs of consecutive entries in the range @@ -175,8 +175,8 @@ void compute_shortest_paths_between_two_cones(const TriangleMesh& mesh, /// \tparam TriangleMesh A triangle mesh, model of `FaceListGraph` and `HalfedgeListGraph`. /// \tparam InputConesForwardIterator A model of `ForwardIterator` with value type /// `boost::graph_traits::%vertex_descriptor`. -/// \tparam SeamContainer A model of SequenceContainer -/// with value type `boost::graph_traits::%edge_descriptor`. +/// \tparam SeamContainer A model of `SequenceContainer` with value type +/// `boost::graph_traits::%edge_descriptor`. /// /// \param mesh the triangular mesh on which paths are computed /// \param first, beyond a range of cones diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/parameterize.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/parameterize.h index 675343f3fd7..9c3360aecdd 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/parameterize.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/parameterize.h @@ -44,7 +44,7 @@ namespace CGAL { namespace Surface_mesh_parameterization { -/// \ingroup PkgSurfaceParameterizationMainFunction +/// \ingroup PkgSurfaceMeshParameterizationMainFunction /// /// Compute a one-to-one mapping from a 3D triangle surface `mesh` to a /// simple 2D domain. @@ -96,7 +96,7 @@ Error_code parameterize(TriangleMesh& mesh, return parameterizer.parameterize(mesh, bhd, uvm, vipm, vpm); } -/// \ingroup PkgSurfaceParameterizationMainFunction +/// \ingroup PkgSurfaceMeshParameterizationMainFunction /// /// Compute a one-to-one mapping from a 3D triangle surface `mesh` to a /// 2D circle, using Floater Mean Value Coordinates algorithm. diff --git a/Surface_mesh_parameterization/test/Surface_mesh_parameterization/CMakeLists.txt b/Surface_mesh_parameterization/test/Surface_mesh_parameterization/CMakeLists.txt index 5fac5052e19..9455b197844 100644 --- a/Surface_mesh_parameterization/test/Surface_mesh_parameterization/CMakeLists.txt +++ b/Surface_mesh_parameterization/test/Surface_mesh_parameterization/CMakeLists.txt @@ -3,20 +3,17 @@ project( Surface_mesh_parameterization_Tests ) -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.1) # Include this package's headers first -include_directories (BEFORE . include ../../include) +include_directories (BEFORE . include) # Find CGAL find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - include( CGAL_CreateSingleSourceCGALProgram ) - # VisualC++ optimization for applications dealing with large data if (MSVC) diff --git a/Surface_mesh_segmentation/doc/Surface_mesh_segmentation/Concepts/SegmentationGeomTraits.h b/Surface_mesh_segmentation/doc/Surface_mesh_segmentation/Concepts/SegmentationGeomTraits.h index 2070f82314e..b5f5010acdc 100644 --- a/Surface_mesh_segmentation/doc/Surface_mesh_segmentation/Concepts/SegmentationGeomTraits.h +++ b/Surface_mesh_segmentation/doc/Surface_mesh_segmentation/Concepts/SegmentationGeomTraits.h @@ -1,5 +1,5 @@ /*! -\ingroup PkgSurfaceSegmentationConcepts +\ingroup PkgSurfaceMeshSegmentationConcepts \cgalConcept The concept `SegmentationGeomTraits` describes the set of requirements diff --git a/Surface_mesh_segmentation/doc/Surface_mesh_segmentation/PackageDescription.txt b/Surface_mesh_segmentation/doc/Surface_mesh_segmentation/PackageDescription.txt index 43c56dfdf1e..5a4738da305 100644 --- a/Surface_mesh_segmentation/doc/Surface_mesh_segmentation/PackageDescription.txt +++ b/Surface_mesh_segmentation/doc/Surface_mesh_segmentation/PackageDescription.txt @@ -1,13 +1,13 @@ -/// \defgroup PkgSurfaceSegmentation Triangulated Surface Mesh Segmentation Reference +/// \defgroup PkgSurfaceMeshSegmentationRef Triangulated Surface Mesh Segmentation Reference -/// \defgroup PkgSurfaceSegmentationConcepts Concepts -/// \ingroup PkgSurfaceSegmentation +/// \defgroup PkgSurfaceMeshSegmentationConcepts Concepts +/// \ingroup PkgSurfaceMeshSegmentationRef /*! -\addtogroup PkgSurfaceSegmentation +\addtogroup PkgSurfaceMeshSegmentationRef -\cgalPkgDescriptionBegin{Triangulated Surface Mesh Segmentation,PkgSurfaceSegmentationSummary} +\cgalPkgDescriptionBegin{Triangulated Surface Mesh Segmentation,PkgSurfaceMeshSegmentation} \cgalPkgPicture{segmentation_ico.png} \cgalPkgSummaryBegin @@ -17,12 +17,12 @@ Shape Diameter Function (SDF) for all facets and applies a graph-cut based algorithm over these values. Low level functions are provided to replace any intermediate step by a custom one. } -\cgalPkgManuals{Chapter_3D_SurfaceSegmentation,PkgSurfaceSegmentation} +\cgalPkgManuals{Chapter_3D_SurfaceSegmentation,PkgSurfaceMeshSegmentationRef} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{4.4} -\cgalPkgDependsOn{\ref PkgAABB_treeSummary} +\cgalPkgDependsOn{\ref PkgAABBTree} \cgalPkgBib{cgal:y-smsimpl} \cgalPkgLicense{\ref licensesGPL "GPL"} \cgalPkgDemo{Polyhedron demo,polyhedron_3.zip} diff --git a/Surface_mesh_segmentation/doc/Surface_mesh_segmentation/Surface_Mesh_Segmentation.txt b/Surface_mesh_segmentation/doc/Surface_mesh_segmentation/Surface_Mesh_Segmentation.txt index 4d91a642741..a574e9d53dc 100644 --- a/Surface_mesh_segmentation/doc/Surface_mesh_segmentation/Surface_Mesh_Segmentation.txt +++ b/Surface_mesh_segmentation/doc/Surface_mesh_segmentation/Surface_Mesh_Segmentation.txt @@ -174,7 +174,7 @@ the following properties: \note The current implementation executes fine on meshes that do not match some of these properties but may produce unreliable or meaningless segmentations. -The current implementation of the computation of the SDF values relies on the \ref PkgAABB_treeSummary package. +The current implementation of the computation of the SDF values relies on the \ref PkgAABBTree package. This operation is reliable when the `AABBTraits` model provided has exact predicates. `::CGAL::Exact_predicates_inexact_constructions_kernel` is recommended as geometric traits for this algorithm. diff --git a/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/CMakeLists.txt b/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/CMakeLists.txt index 30d27b2c15e..be1faa2c864 100644 --- a/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/CMakeLists.txt +++ b/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/CMakeLists.txt @@ -4,7 +4,7 @@ project( Surface_mesh_segmentation_Examples ) -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.1) @@ -18,10 +18,6 @@ if ( NOT CGAL_FOUND ) endif() -# include helper file -include( ${CGAL_USE_FILE} ) - - # Boost and its components find_package( Boost ) @@ -43,15 +39,11 @@ endif() # include for local package -include_directories( BEFORE ../../include ) - # Creating entries for all .cpp/.C files with "main" routine # ########################################################## -include( CGAL_CreateSingleSourceCGALProgram ) - create_single_source_cgal_program( "sdf_values_example.cpp" ) create_single_source_cgal_program( "segmentation_from_sdf_values_example.cpp" ) diff --git a/Surface_mesh_segmentation/include/CGAL/mesh_segmentation.h b/Surface_mesh_segmentation/include/CGAL/mesh_segmentation.h index 49da4622a96..60790b8b212 100644 --- a/Surface_mesh_segmentation/include/CGAL/mesh_segmentation.h +++ b/Surface_mesh_segmentation/include/CGAL/mesh_segmentation.h @@ -69,7 +69,7 @@ sdf_values( const TriangleMesh& triangle_mesh, /// @endcond /*! - * \ingroup PkgSurfaceSegmentation + * \ingroup PkgSurfaceMeshSegmentationRef * @brief Function computing the Shape Diameter Function over a surface mesh. * * This function implements the Shape Diameter Function (SDF) as described in \cgalCite{shapira2008consistent}. @@ -117,7 +117,7 @@ sdf_values( const TriangleMesh& triangle_mesh, /*! - * \ingroup PkgSurfaceSegmentation + * \ingroup PkgSurfaceMeshSegmentationRef * @brief Function post-processing raw SDF values computed per facet. * * Post-processing steps applied : @@ -152,7 +152,7 @@ sdf_values_postprocessing(const TriangleMesh& triangle_mesh, /*! - * \ingroup PkgSurfaceSegmentation + * \ingroup PkgSurfaceMeshSegmentationRef * @brief Function computing the segmentation of a surface mesh given an SDF value per facet. * * This function fills a property map which associates a segment-id (in [0, number of segments -1]) @@ -252,7 +252,7 @@ segmentation_via_sdf_values(const TriangleMesh& triangle_mesh, /*! - * \ingroup PkgSurfaceSegmentation + * \ingroup PkgSurfaceMeshSegmentationRef * @brief Function computing the segmentation of a surface mesh. * * This function is equivalent to calling the functions `CGAL::sdf_values()` and diff --git a/Surface_mesh_segmentation/test/Surface_mesh_segmentation/CMakeLists.txt b/Surface_mesh_segmentation/test/Surface_mesh_segmentation/CMakeLists.txt index c7472517d7d..677d2711e22 100644 --- a/Surface_mesh_segmentation/test/Surface_mesh_segmentation/CMakeLists.txt +++ b/Surface_mesh_segmentation/test/Surface_mesh_segmentation/CMakeLists.txt @@ -4,18 +4,12 @@ project( Surface_mesh_segmentation_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Surface_mesh_shortest_path/doc/Surface_mesh_shortest_path/PackageDescription.txt b/Surface_mesh_shortest_path/doc/Surface_mesh_shortest_path/PackageDescription.txt index 92612538034..97fe67ef39b 100644 --- a/Surface_mesh_shortest_path/doc/Surface_mesh_shortest_path/PackageDescription.txt +++ b/Surface_mesh_shortest_path/doc/Surface_mesh_shortest_path/PackageDescription.txt @@ -1,26 +1,26 @@ // Triangulated Surface Mesh Geodesic Shortest Paths -/// \defgroup PkgSurfaceMeshShortestPath Triangulated Surface Mesh Geodesic Shortest Paths Reference +/// \defgroup PkgSurfaceMeshShortestPathRef Triangulated Surface Mesh Geodesic Shortest Paths Reference /// \defgroup PkgSurfaceMeshShortestPathConcepts Concepts -/// \ingroup PkgSurfaceMeshShortestPath +/// \ingroup PkgSurfaceMeshShortestPathRef /// \defgroup PkgSurfaceMeshShortestPathTraitsClasses Traits Classes -/// \ingroup PkgSurfaceMeshShortestPath +/// \ingroup PkgSurfaceMeshShortestPathRef /*! -\addtogroup PkgSurfaceMeshShortestPath +\addtogroup PkgSurfaceMeshShortestPathRef \todo Modify the algorithm to support more efficient incremental construction \todo Add parallelization to the algorithm \todo Add methods for computing the ridge tree using the output of the algorithm \todo Add methods for computing shortest paths from geodesic sources as well -\cgalPkgDescriptionBegin{Triangulated Surface Mesh Shortest Paths,PkgSurfaceMeshShortestPathSummary} +\cgalPkgDescriptionBegin{Triangulated Surface Mesh Shortest Paths,PkgSurfaceMeshShortestPath} \cgalPkgPicture{shortestpathspackage-ico.png} \cgalPkgSummaryBegin \cgalPkgAuthors{Stephen Kiazyk, Sébastien Loriot, Éric Colin de Verdière} \cgalPkgDesc{The package provides methods for computing geodesic shortest path on triangulated surface meshes. The algorithm used is based on a paper by Xin and Wang \cgalCite{XinWang2009improvingchenandhan} . The input of this package can be any model of the `FaceListGraph` concept. } -\cgalPkgManuals{Chapter_Surface_mesh_shortest_path,PkgSurfaceMeshShortestPath} +\cgalPkgManuals{Chapter_Surface_mesh_shortest_path,PkgSurfaceMeshShortestPathRef} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{4.7} 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 a25a6a49cac..edd21e2855a 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 @@ -5,19 +5,13 @@ project( Surface_mesh_shortest_path_Examples ) -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - include_directories (BEFORE "../../include") - create_single_source_cgal_program( "shortest_path_sequence.cpp" ) create_single_source_cgal_program( "shortest_paths_multiple_sources.cpp" ) create_single_source_cgal_program( "shortest_paths_no_id.cpp" ) diff --git a/Surface_mesh_shortest_path/include/CGAL/Surface_mesh_shortest_path.h b/Surface_mesh_shortest_path/include/CGAL/Surface_mesh_shortest_path.h index e196e2e63ac..2f9d75f00fd 100644 --- a/Surface_mesh_shortest_path/include/CGAL/Surface_mesh_shortest_path.h +++ b/Surface_mesh_shortest_path/include/CGAL/Surface_mesh_shortest_path.h @@ -25,7 +25,7 @@ /** - * \ingroup PkgSurfaceMeshShortestPath + * \ingroup PkgSurfaceMeshShortestPathRef * \file CGAL/Surface_mesh_shortest_path.h * Convenience header file only including `CGAL/Surface_mesh_shortest_path/Surface_mesh_shortest_path.h` * and `CGAL/Surface_mesh_shortest_path/Surface_mesh_shortest_path_traits.h`. diff --git a/Surface_mesh_shortest_path/include/CGAL/Surface_mesh_shortest_path/Surface_mesh_shortest_path.h b/Surface_mesh_shortest_path/include/CGAL/Surface_mesh_shortest_path/Surface_mesh_shortest_path.h index 68bd9b9327c..15170a91326 100644 --- a/Surface_mesh_shortest_path/include/CGAL/Surface_mesh_shortest_path/Surface_mesh_shortest_path.h +++ b/Surface_mesh_shortest_path/include/CGAL/Surface_mesh_shortest_path/Surface_mesh_shortest_path.h @@ -54,7 +54,7 @@ namespace CGAL { /*! -\ingroup PkgSurfaceMeshShortestPath +\ingroup PkgSurfaceMeshShortestPathRef \brief Computes shortest surface paths from one or more source points on a surface mesh. 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 558d8763d8c..77817ce208c 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 @@ -4,20 +4,15 @@ project( Surface_mesh_shortest_path_Tests ) -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET COMPONENTS Core ) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - include_directories (BEFORE "../../include") - - include_directories (BEFORE "include") + include(${CGAL_USE_FILE}) + include_directories (BEFORE "include") create_single_source_cgal_program( "Surface_mesh_shortest_path_test_1.cpp" ) create_single_source_cgal_program( "Surface_mesh_shortest_path_test_2.cpp" ) diff --git a/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Edge_collapse_visitor_base.h b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Edge_collapse_visitor_base.h index 4fb784a6762..6f3f8b45fcc 100644 --- a/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Edge_collapse_visitor_base.h +++ b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Edge_collapse_visitor_base.h @@ -2,7 +2,7 @@ namespace CGAL { namespace Surface_mesh_simplification { /*! -\ingroup PkgSurfaceMeshSimplification +\ingroup PkgSurfaceMeshSimplificationRef The class `Surface_mesh_simplification::Edge_collapse_visitor_base` provides a base class for models of the `EdgeCollapseSimplificationVisitor` concept. diff --git a/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Bounded_normal_change_placement.h b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Bounded_normal_change_placement.h index d8db52c58d5..3fabd75ee17 100644 --- a/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Bounded_normal_change_placement.h +++ b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Bounded_normal_change_placement.h @@ -3,7 +3,7 @@ namespace CGAL { namespace Surface_mesh_simplification { /*! -\ingroup PkgSurfaceMeshSimplification +\ingroup PkgSurfaceMeshSimplificationRef The class `Bounded_normal_change_placement` is a model for the `GetPlacement` concept which serves as a filter for another placement. It rejects the placement if any diff --git a/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Constrained_placement.h b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Constrained_placement.h index 6dbd277a059..94e5c193e39 100644 --- a/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Constrained_placement.h +++ b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Constrained_placement.h @@ -3,7 +3,7 @@ namespace CGAL { namespace Surface_mesh_simplification { /*! -\ingroup PkgSurfaceMeshSimplification +\ingroup PkgSurfaceMeshSimplificationRef The class `Constrained_placement` is a model for the `GetPlacement` concept provided the template parameter `BasePlacement` is such a model. diff --git a/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Count_ratio_stop_predicate.h b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Count_ratio_stop_predicate.h index 726294904e6..0d01d7b04a7 100644 --- a/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Count_ratio_stop_predicate.h +++ b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Count_ratio_stop_predicate.h @@ -3,7 +3,7 @@ namespace CGAL { namespace Surface_mesh_simplification { /*! -\ingroup PkgSurfaceMeshSimplification +\ingroup PkgSurfaceMeshSimplificationRef The class `Count_ratio_stop_predicate` is a model for the `StopPredicate` concept which returns `true` when the relation between the initial and current number of edges drops below a certain ratio. diff --git a/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Count_stop_predicate.h b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Count_stop_predicate.h index a7f5861cbea..7e11c1950ad 100644 --- a/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Count_stop_predicate.h +++ b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Count_stop_predicate.h @@ -3,7 +3,7 @@ namespace CGAL { namespace Surface_mesh_simplification { /*! -\ingroup PkgSurfaceMeshSimplification +\ingroup PkgSurfaceMeshSimplificationRef The class `Count_stop_predicate` is a model for the `StopPredicate` concept, which returns `true` when the number of current edges drops below a certain threshold. diff --git a/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Edge_length_cost.h b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Edge_length_cost.h index 8d6f35ace4d..58f43d54057 100644 --- a/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Edge_length_cost.h +++ b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Edge_length_cost.h @@ -3,7 +3,7 @@ namespace CGAL { namespace Surface_mesh_simplification { /*! -\ingroup PkgSurfaceMeshSimplification +\ingroup PkgSurfaceMeshSimplificationRef The class `Edge_length_cost` is a model for the `GetCost` concept, which computes the collapse cost as the squared length of the edge. diff --git a/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Edge_length_stop_predicate.h b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Edge_length_stop_predicate.h index 1363c60da46..d2c11fec0be 100644 --- a/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Edge_length_stop_predicate.h +++ b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Edge_length_stop_predicate.h @@ -3,7 +3,7 @@ namespace CGAL { namespace Surface_mesh_simplification { /*! -\ingroup PkgSurfaceMeshSimplification +\ingroup PkgSurfaceMeshSimplificationRef The class `Edge_length_stop_predicate` is a model for the `StopPredicate` concept, which returns `true` when the top edge in the priority queue is larger than a certain threshold. diff --git a/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Edge_profile.h b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Edge_profile.h index dc0bf118dd2..77fd121f6f7 100644 --- a/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Edge_profile.h +++ b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Edge_profile.h @@ -3,7 +3,7 @@ namespace CGAL { namespace Surface_mesh_simplification { /*! -\ingroup PkgSurfaceMeshSimplification +\ingroup PkgSurfaceMeshSimplificationRef The class `Edge_profile` provides a model for the `EdgeProfile` concept. diff --git a/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/LindstromTurk_cost.h b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/LindstromTurk_cost.h index c4a5e75a712..8a5a91dd3ac 100644 --- a/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/LindstromTurk_cost.h +++ b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/LindstromTurk_cost.h @@ -2,7 +2,7 @@ namespace CGAL { namespace Surface_mesh_simplification { /*! -\ingroup PkgSurfaceMeshSimplification +\ingroup PkgSurfaceMeshSimplificationRef The class `LindstromTurk_cost` provides a model for the `GetCost` concept. It computes the collapse cost following the Lindstrom-Turk strategy diff --git a/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/LindstromTurk_placement.h b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/LindstromTurk_placement.h index 431de0560dd..b182d0f246b 100644 --- a/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/LindstromTurk_placement.h +++ b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/LindstromTurk_placement.h @@ -3,7 +3,7 @@ namespace CGAL { namespace Surface_mesh_simplification { /*! -\ingroup PkgSurfaceMeshSimplification +\ingroup PkgSurfaceMeshSimplificationRef The class `LindstromTurk_placement` provides a model for the `GetPlacement` concept. It computes the placement, that is, the new position for the remaining vertex after diff --git a/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Midpoint_placement.h b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Midpoint_placement.h index 76f0e524b04..feef0b812da 100644 --- a/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Midpoint_placement.h +++ b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Midpoint_placement.h @@ -3,7 +3,7 @@ namespace CGAL { namespace Surface_mesh_simplification { /*! -\ingroup PkgSurfaceMeshSimplification +\ingroup PkgSurfaceMeshSimplificationRef The class `Midpoint_placement` is a model for the `GetPlacement` concept which computes the placement as the midpoint position along the edge. diff --git a/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/edge_collapse.h b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/edge_collapse.h index a6e25392da0..878278b4b69 100644 --- a/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/edge_collapse.h +++ b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/edge_collapse.h @@ -2,7 +2,7 @@ namespace CGAL { namespace Surface_mesh_simplification { /*! -\ingroup PkgSurfaceMeshSimplification +\ingroup PkgSurfaceMeshSimplificationRef Simplifies `surface_mesh` in-place by collapsing edges, and returns the number of edges effectively removed. diff --git a/Surface_mesh_simplification/doc/Surface_mesh_simplification/NamedParameters.txt b/Surface_mesh_simplification/doc/Surface_mesh_simplification/NamedParameters.txt index 8ed97de9fab..123c4dcfd03 100644 --- a/Surface_mesh_simplification/doc/Surface_mesh_simplification/NamedParameters.txt +++ b/Surface_mesh_simplification/doc/Surface_mesh_simplification/NamedParameters.txt @@ -1,6 +1,6 @@ /*! \defgroup sms_namedparameters Named Parameters for Surface Mesh Simplification -\ingroup PkgSurfaceMeshSimplification +\ingroup PkgSurfaceMeshSimplificationRef In this package, some optional parameters are implemented as BGL optional named parameters (see \ref BGLNamedParameters for more information on how to use them). @@ -26,7 +26,7 @@ designates the formal argument, the order of named parameters in the list is tot In the following, we assume that the type `TriangleMesh` is passed as template parameters of the functions, and is a model of the concept `MutableFaceGraph`. -The following named parameters, offered by the package \ref PkgBGLSummary +The following named parameters, offered by the package \ref PkgBGL (see \ref bgl_namedparameters), are used in this package: \cgalNPTableBegin diff --git a/Surface_mesh_simplification/doc/Surface_mesh_simplification/PackageDescription.txt b/Surface_mesh_simplification/doc/Surface_mesh_simplification/PackageDescription.txt index ca6427cd49c..4e7034f0578 100644 --- a/Surface_mesh_simplification/doc/Surface_mesh_simplification/PackageDescription.txt +++ b/Surface_mesh_simplification/doc/Surface_mesh_simplification/PackageDescription.txt @@ -1,15 +1,15 @@ -/// \defgroup PkgSurfaceMeshSimplification Triangulated Surface Mesh Simplification Reference +/// \defgroup PkgSurfaceMeshSimplificationRef Triangulated Surface Mesh Simplification Reference /// \defgroup PkgSurfaceMeshSimplificationConcepts Concepts -/// \ingroup PkgSurfaceMeshSimplification +/// \ingroup PkgSurfaceMeshSimplificationRef /*! -\addtogroup PkgSurfaceMeshSimplification +\addtogroup PkgSurfaceMeshSimplificationRef \todo check generated documentation -\cgalPkgDescriptionBegin{Triangulated Surface Mesh Simplification,PkgSurfaceMeshSimplificationSummary} +\cgalPkgDescriptionBegin{Triangulated Surface Mesh Simplification,PkgSurfaceMeshSimplification} \cgalPkgPicture{SMS-detail.png} \cgalPkgSummaryBegin \cgalPkgAuthor{Fernando Cacciola} \cgalPkgDesc{This package provides an algorithm to simplify a triangulated surface mesh by edge collapsing. It is an implementation of the Turk/Lindstrom memoryless surface mesh simplification algorithm.} -\cgalPkgManuals{Chapter_Triangulated_Surface_Mesh_Simplification,PkgSurfaceMeshSimplification} +\cgalPkgManuals{Chapter_Triangulated_Surface_Mesh_Simplification,PkgSurfaceMeshSimplificationRef} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{3.3} diff --git a/Surface_mesh_simplification/examples/Surface_mesh_simplification/CMakeLists.txt b/Surface_mesh_simplification/examples/Surface_mesh_simplification/CMakeLists.txt index c1251e12009..e6cdccf2eb9 100644 --- a/Surface_mesh_simplification/examples/Surface_mesh_simplification/CMakeLists.txt +++ b/Surface_mesh_simplification/examples/Surface_mesh_simplification/CMakeLists.txt @@ -4,7 +4,7 @@ project( Surface_mesh_simplification_Examples ) -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.1) @@ -18,10 +18,6 @@ if ( NOT CGAL_FOUND ) endif() -# include helper file -include( ${CGAL_USE_FILE} ) - - # Boost and its components find_package( Boost ) @@ -45,16 +41,10 @@ endif() # include for local directory # include for local package -include_directories( BEFORE ../../include ) - - # Creating entries for all .cpp/.C files with "main" routine # ########################################################## -include( CGAL_CreateSingleSourceCGALProgram ) - - create_single_source_cgal_program( "edge_collapse_constrain_sharp_edges.cpp" ) create_single_source_cgal_program( "edge_collapse_constrained_border_polyhedron.cpp" ) create_single_source_cgal_program( "edge_collapse_enriched_polyhedron.cpp" ) diff --git a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Detail/Edge_collapse_impl.h b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Detail/Edge_collapse_impl.h index cd2266babd6..964bbc367e2 100644 --- a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Detail/Edge_collapse_impl.h +++ b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Detail/Edge_collapse_impl.h @@ -506,6 +506,13 @@ bool EdgeCollapse::Is_collapse_topologically_vali rR = false ; CGAL_SMS_TRACE(3," p-q belongs to a tetrahedron. NON-COLLAPSABLE edge." ) ; } + + if ( next(aProfile.v0_v1(), mSurface) == opposite(prev(aProfile.v1_v0(), mSurface), mSurface) && + prev(aProfile.v0_v1(), mSurface) == opposite(next(aProfile.v1_v0(), mSurface), mSurface) ) + { + CGAL_SMS_TRACE(3," degenerate volume." ) ; + return false ; + } } } } diff --git a/Surface_mesh_simplification/test/Surface_mesh_simplification/CMakeLists.txt b/Surface_mesh_simplification/test/Surface_mesh_simplification/CMakeLists.txt index 407398b388c..b7b1999faa4 100644 --- a/Surface_mesh_simplification/test/Surface_mesh_simplification/CMakeLists.txt +++ b/Surface_mesh_simplification/test/Surface_mesh_simplification/CMakeLists.txt @@ -4,18 +4,12 @@ project( Surface_mesh_simplification_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Surface_mesh_skeletonization/benchmark/Surface_mesh_skeletonization/CMakeLists.txt b/Surface_mesh_skeletonization/benchmark/Surface_mesh_skeletonization/CMakeLists.txt index 311563d93bb..a5b04d07df7 100644 --- a/Surface_mesh_skeletonization/benchmark/Surface_mesh_skeletonization/CMakeLists.txt +++ b/Surface_mesh_skeletonization/benchmark/Surface_mesh_skeletonization/CMakeLists.txt @@ -7,8 +7,7 @@ project( Mean_curvature_skeleton ) #SET(GCC_COVERAGE_COMPILE_FLAGS "-fprofile-arcs -ftest-coverage") #SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_COVERAGE_COMPILE_FLAGS}" ) -cmake_minimum_required(VERSION 2.8.11) - +cmake_minimum_required(VERSION 3.1) # CGAL and its components @@ -21,10 +20,6 @@ if ( NOT CGAL_FOUND ) endif() -# include helper file -include( ${CGAL_USE_FILE} ) - - # Boost and its components find_package( Boost REQUIRED ) @@ -39,8 +34,6 @@ endif() # include for local directory # include for local package -include_directories( BEFORE ../../include ) - find_package(Eigen3 3.2.0) #(requires 3.2.0 or greater) if(NOT EIGEN3_FOUND) @@ -53,8 +46,6 @@ endif(NOT EIGEN3_FOUND) # Creating entries for all .cpp/.C files with "main" routine # ########################################################## -include( CGAL_CreateSingleSourceCGALProgram ) - create_single_source_cgal_program( "solver_benchmark.cpp" ) create_single_source_cgal_program( "mcf_scale_invariance.cpp" ) diff --git a/Surface_mesh_skeletonization/doc/Surface_mesh_skeletonization/Concepts/MeanCurvatureSkeletonizationTraits.h b/Surface_mesh_skeletonization/doc/Surface_mesh_skeletonization/Concepts/MeanCurvatureSkeletonizationTraits.h index 31dbe628baf..824b21454e5 100644 --- a/Surface_mesh_skeletonization/doc/Surface_mesh_skeletonization/Concepts/MeanCurvatureSkeletonizationTraits.h +++ b/Surface_mesh_skeletonization/doc/Surface_mesh_skeletonization/Concepts/MeanCurvatureSkeletonizationTraits.h @@ -1,6 +1,6 @@ /*! - * \ingroup PkgMeanCurvatureSkeleton3Concepts + * \ingroup PkgSurfaceMeshSkeletonizationConcepts * \cgalConcept * * Traits class concept defining the requirements of the class `CGAL::Mean_curvature_flow_skeletonization`. diff --git a/Surface_mesh_skeletonization/doc/Surface_mesh_skeletonization/PackageDescription.txt b/Surface_mesh_skeletonization/doc/Surface_mesh_skeletonization/PackageDescription.txt index 2163696092f..f9c589b6f1d 100644 --- a/Surface_mesh_skeletonization/doc/Surface_mesh_skeletonization/PackageDescription.txt +++ b/Surface_mesh_skeletonization/doc/Surface_mesh_skeletonization/PackageDescription.txt @@ -1,10 +1,10 @@ -/// \defgroup PkgMeanCurvatureSkeleton3 Triangulated Surface Mesh Skeletonization Reference -/// \defgroup PkgMeanCurvatureSkeleton3Concepts Concepts -/// \ingroup PkgMeanCurvatureSkeleton3 +/// \defgroup PkgSurfaceMeshSkeletonizationRef Triangulated Surface Mesh Skeletonization Reference +/// \defgroup PkgSurfaceMeshSkeletonizationConcepts Concepts +/// \ingroup PkgSurfaceMeshSkeletonizationRef /*! -\addtogroup PkgMeanCurvatureSkeleton3 -\cgalPkgDescriptionBegin{Triangulated Surface Mesh Skeletonization,PkgMeanCurvatureSkeleton3Summary} +\addtogroup PkgSurfaceMeshSkeletonizationRef +\cgalPkgDescriptionBegin{Triangulated Surface Mesh Skeletonization,PkgSurfaceMeshSkeletonization} \cgalPkgPicture{mcfskel-small.png} \cgalPkgSummaryBegin \cgalPkgAuthor{Xiang Gao, Sébastien Loriot and Andrea Tagliasacchi} @@ -14,11 +14,11 @@ The code is generic and works with any model of the `FaceListGraph` concept. } -\cgalPkgManuals{Chapter_3D_Surface_mesh_skeletonization,PkgMeanCurvatureSkeleton3} +\cgalPkgManuals{Chapter_3D_Surface_mesh_skeletonization,PkgSurfaceMeshSkeletonizationRef} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{4.7} -\cgalPkgDependsOn{ \ref PkgSolverSummary} +\cgalPkgDependsOn{ \ref PkgSolverInterface} \cgalPkgBib{cgal:glt-tsms} \cgalPkgLicense{\ref licensesGPL "GPL"} \cgalPkgDemo{Polyhedron demo,polyhedron_3.zip} diff --git a/Surface_mesh_skeletonization/doc/Surface_mesh_skeletonization/Surface_mesh_skeletonization.txt b/Surface_mesh_skeletonization/doc/Surface_mesh_skeletonization/Surface_mesh_skeletonization.txt index 83cfeea28f3..bf915e7fd6b 100644 --- a/Surface_mesh_skeletonization/doc/Surface_mesh_skeletonization/Surface_mesh_skeletonization.txt +++ b/Surface_mesh_skeletonization/doc/Surface_mesh_skeletonization/Surface_mesh_skeletonization.txt @@ -31,7 +31,7 @@ The input is a triangulated surface mesh, model of the `FaceListGraph` concept (`CGAL::Surface_mesh`, `CGAL::Polyhedron_3`, ...) that has no boundary and that has only one connected component. The skeleton is provided as a graph of type -boost::adjacency_list. +boost::adjacency_list. Each vertex of the skeleton is associated to a 3D location point and to the set of input vertices that contracted to that skeleton vertex. Note that due to the construction process of the skeleton, a @@ -97,7 +97,7 @@ In this example, we show how to use the API of the class As a proof of concept, we show how to use the skeleton and the association of input vertices to skeleton to compute a segmentation of the input triangulated surface mesh using the package -\ref PkgSurfaceSegmentationSummary. +\ref PkgSurfaceMeshSegmentation. The segmentation algorithm consists in computing a shape diameter function for each face of the input mesh, followed by solving a graph cut problem. Here we use the skeleton to define a new shape diameter function. diff --git a/Surface_mesh_skeletonization/examples/Surface_mesh_skeletonization/CMakeLists.txt b/Surface_mesh_skeletonization/examples/Surface_mesh_skeletonization/CMakeLists.txt index 646c604e206..9f711c7c4f6 100644 --- a/Surface_mesh_skeletonization/examples/Surface_mesh_skeletonization/CMakeLists.txt +++ b/Surface_mesh_skeletonization/examples/Surface_mesh_skeletonization/CMakeLists.txt @@ -4,26 +4,18 @@ project( Surface_mesh_skeletonization_Examples ) -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - find_package(Eigen3 3.2.0) #(requires 3.2.0 or greater) if(EIGEN3_FOUND) include( ${EIGEN3_USE_FILE} ) - include( CGAL_CreateSingleSourceCGALProgram ) - - include_directories (BEFORE "../../include") - create_single_source_cgal_program( "simple_mcfskel_example.cpp" ) create_single_source_cgal_program( "simple_mcfskel_sm_example.cpp" ) create_single_source_cgal_program( "simple_mcfskel_LCC_example.cpp" ) diff --git a/Surface_mesh_skeletonization/include/CGAL/Mean_curvature_flow_skeletonization.h b/Surface_mesh_skeletonization/include/CGAL/Mean_curvature_flow_skeletonization.h index 967cb23d44c..cc403bb788a 100644 --- a/Surface_mesh_skeletonization/include/CGAL/Mean_curvature_flow_skeletonization.h +++ b/Surface_mesh_skeletonization/include/CGAL/Mean_curvature_flow_skeletonization.h @@ -112,7 +112,7 @@ struct Skel_polyhedron_items_3: CGAL::Polyhedron_items_with_id_3 { } //end of namespace internal -/// \ingroup PkgMeanCurvatureSkeleton3 +/// \ingroup PkgSurfaceMeshSkeletonizationRef /// Function object that enables to extract the mean curvature /// flow skeleton of a triangulated surface mesh. /// @@ -218,7 +218,7 @@ public: /// `Vmap` is a struct with a member `point` of type `Traits::Point_3` /// and a member `vertices` of type /// `std::vector::%vertex_descriptor>`. - /// See the boost documentation page for more details + /// See the boost documentation page for more details typedef boost::adjacency_list Skeleton; @@ -789,7 +789,7 @@ public: /** * Converts the contracted surface mesh to a skeleton curve. * @tparam Skeleton - * an instantiation of `boost::adjacency_list` + * an instantiation of `boost::adjacency_list` * as a data structure for the skeleton curve. * @param skeleton * graph that will contain the skeleton of `tmesh`. It should be empty before passed to the function. diff --git a/Surface_mesh_skeletonization/include/CGAL/extract_mean_curvature_flow_skeleton.h b/Surface_mesh_skeletonization/include/CGAL/extract_mean_curvature_flow_skeleton.h index e49279a405d..30f89868adb 100644 --- a/Surface_mesh_skeletonization/include/CGAL/extract_mean_curvature_flow_skeleton.h +++ b/Surface_mesh_skeletonization/include/CGAL/extract_mean_curvature_flow_skeleton.h @@ -35,7 +35,7 @@ namespace CGAL{ #if defined(DOXYGEN_RUNNING) || defined(CGAL_EIGEN3_ENABLED) -/// \ingroup PkgMeanCurvatureSkeleton3 +/// \ingroup PkgSurfaceMeshSkeletonizationRef /// @brief extracts a medially centered curve skeleton for the triangle mesh `tmesh`. /// This function uses the class CGAL::Mean_curvature_flow_skeletonization with the default parameters. /// This function is provided only if \ref thirdpartyEigen "Eigen" 3.2 (or greater) is available and `CGAL_EIGEN3_ENABLED` is defined. diff --git a/Surface_mesh_skeletonization/test/Surface_mesh_skeletonization/CMakeLists.txt b/Surface_mesh_skeletonization/test/Surface_mesh_skeletonization/CMakeLists.txt index 13e62d7b5f0..8aed6ec2d5a 100644 --- a/Surface_mesh_skeletonization/test/Surface_mesh_skeletonization/CMakeLists.txt +++ b/Surface_mesh_skeletonization/test/Surface_mesh_skeletonization/CMakeLists.txt @@ -4,24 +4,18 @@ project( Surface_mesh_skeletonization_Tests ) -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - -find_package(Eigen3 3.2.0) #(requires 3.2.0 or greater) + find_package(Eigen3 3.2.0) #(requires 3.2.0 or greater) if(EIGEN3_FOUND) include( ${EIGEN3_USE_FILE} ) - include( CGAL_CreateSingleSourceCGALProgram ) - - include_directories (BEFORE "../../include") - create_single_source_cgal_program( "MCF_Skeleton_test.cpp" ) create_single_source_cgal_program( "skeleton_connectivity_test.cpp" ) else() diff --git a/Surface_mesh_skeletonization/test/Surface_mesh_skeletonization/MCF_Skeleton_test.cpp b/Surface_mesh_skeletonization/test/Surface_mesh_skeletonization/MCF_Skeleton_test.cpp index 63deba74b69..4d710853a78 100644 --- a/Surface_mesh_skeletonization/test/Surface_mesh_skeletonization/MCF_Skeleton_test.cpp +++ b/Surface_mesh_skeletonization/test/Surface_mesh_skeletonization/MCF_Skeleton_test.cpp @@ -2,7 +2,7 @@ #include #include #include -#include +#include #include @@ -34,12 +34,16 @@ bool is_mesh_valid(Polyhedron& pMesh) return false; } + std::size_t i = 0; + BOOST_FOREACH(Polyhedron::Face_handle fh, faces(pMesh)) + fh->id()=i++; + // the algorithm is only applicable on a mesh // that has only one connected component - std::size_t num_component; - CGAL::Counting_output_iterator output_it(&num_component); - CGAL::internal::corefinement::extract_connected_components(pMesh, output_it); - ++output_it; + std::size_t num_component = + CGAL::Polygon_mesh_processing::connected_components( + pMesh, get(CGAL::dynamic_face_property_t(), pMesh)); + if (num_component != 1) { std::cerr << "The mesh is not a single closed mesh. It has " diff --git a/Surface_mesh_skeletonization/test/Surface_mesh_skeletonization/skeleton_connectivity_test.cpp b/Surface_mesh_skeletonization/test/Surface_mesh_skeletonization/skeleton_connectivity_test.cpp index 4409100ab7e..49da555bf98 100644 --- a/Surface_mesh_skeletonization/test/Surface_mesh_skeletonization/skeleton_connectivity_test.cpp +++ b/Surface_mesh_skeletonization/test/Surface_mesh_skeletonization/skeleton_connectivity_test.cpp @@ -2,7 +2,7 @@ #include #include #include -#include +#include #include @@ -35,13 +35,15 @@ bool is_mesh_valid(Polyhedron& pMesh) std::cerr << "The mesh is not a pure triangle mesh."; return false; } + std::size_t i=0; + BOOST_FOREACH(Polyhedron::Face_handle fh, faces(pMesh)) + fh->id()=i++; // the algorithm is only applicable on a mesh // that has only one connected component - std::size_t num_component; - CGAL::Counting_output_iterator output_it(&num_component); - CGAL::internal::corefinement::extract_connected_components(pMesh, output_it); - ++output_it; + std::size_t num_component = + CGAL::Polygon_mesh_processing::connected_components( + pMesh, get(CGAL::dynamic_face_property_t(), pMesh)); if (num_component != 1) { std::cerr << "The mesh is not a single closed mesh. It has " diff --git a/Surface_mesher/demo/Surface_mesher/CMakeLists.txt b/Surface_mesher/demo/Surface_mesher/CMakeLists.txt index 1882fe86c53..6644c8d37ff 100644 --- a/Surface_mesher/demo/Surface_mesher/CMakeLists.txt +++ b/Surface_mesher/demo/Surface_mesher/CMakeLists.txt @@ -44,7 +44,6 @@ find_package(CGAL COMPONENTS ImageIO Qt5) if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND CGAL_ImageIO_FOUND) add_definitions(-DQT_NO_KEYWORDS) - include( ${CGAL_USE_FILE} ) find_package(Qt5 QUIET COMPONENTS OpenGL Xml Svg) find_package(OpenGL ) diff --git a/Surface_mesher/doc/Surface_mesher/PackageDescription.txt b/Surface_mesher/doc/Surface_mesher/PackageDescription.txt index df23e90f9b6..ec3655b7dea 100644 --- a/Surface_mesher/doc/Surface_mesher/PackageDescription.txt +++ b/Surface_mesher/doc/Surface_mesher/PackageDescription.txt @@ -1,18 +1,18 @@ -/// \defgroup PkgSurfaceMesher3 3D Surface Mesh Generation Reference +/// \defgroup PkgSurfaceMesher3Ref 3D Surface Mesh Generation Reference /// \defgroup PkgSurfaceMesher3Concepts Concepts -/// \ingroup PkgSurfaceMesher3 +/// \ingroup PkgSurfaceMesher3Ref /// \defgroup PkgSurfaceMesher3Classes Mesh and Domain Classes -/// \ingroup PkgSurfaceMesher3 +/// \ingroup PkgSurfaceMesher3Ref /// \defgroup PkgSurfaceMesher3TagClasses Tag Classes -/// \ingroup PkgSurfaceMesher3 +/// \ingroup PkgSurfaceMesher3Ref /// \defgroup PkgSurfaceMesher3Functions Functions -/// \ingroup PkgSurfaceMesher3 +/// \ingroup PkgSurfaceMesher3Ref /// \defgroup PkgSurfaceMesher3FunctionsMakeMesh Mesh Generation @@ -24,18 +24,18 @@ /*! -\addtogroup PkgSurfaceMesher3 +\addtogroup PkgSurfaceMesher3Ref \todo check generated documentation -\cgalPkgDescriptionBegin{3D Surface Mesh Generation,PkgSurfaceMesher3Summary} +\cgalPkgDescriptionBegin{3D Surface Mesh Generation,PkgSurfaceMesher3} \cgalPkgPicture{segmented_head-small.png} \cgalPkgSummaryBegin \cgalPkgAuthors{Laurent Rineau and Mariette Yvinec} \cgalPkgDesc{This package provides functions to generate surface meshes that interpolate smooth surfaces. The meshing algorithm is based on Delaunay refinement and provides some guarantees on the resulting mesh: the user is able to control the size and shape of the mesh elements and the accuracy of the surface approximation. There is no restriction on the topology and number of components of input surfaces. The surface mesh generator may also be used for non smooth surfaces but without guarantee. Currently, implementations are provided for implicit surfaces described as the zero level set of some function and surfaces described as a gray level set in a three-dimensional image.} -\cgalPkgManuals{Chapter_3D_Surface_Mesh_Generation,PkgSurfaceMesher3} +\cgalPkgManuals{Chapter_3D_Surface_Mesh_Generation,PkgSurfaceMesher3Ref} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{3.2} -\cgalPkgDependsOn{\ref PkgTriangulation3Summary} +\cgalPkgDependsOn{\ref PkgTriangulation3} \cgalPkgBib{cgal:ry-smg} \cgalPkgLicense{\ref licensesGPL} \cgalPkgDemo{Surface Mesh Generator,surface_mesher.zip} diff --git a/Surface_mesher/examples/Surface_mesher/CMakeLists.txt b/Surface_mesher/examples/Surface_mesher/CMakeLists.txt index f7881ea64d4..589ad5d54c7 100644 --- a/Surface_mesher/examples/Surface_mesher/CMakeLists.txt +++ b/Surface_mesher/examples/Surface_mesher/CMakeLists.txt @@ -3,18 +3,13 @@ project( Surface_mesher_Examples ) -cmake_minimum_required(VERSION 2.8.11) - - -include_directories(../../include) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET COMPONENTS ImageIO) if ( CGAL_FOUND AND CGAL_ImageIO_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) + include(${CGAL_USE_FILE}) create_single_source_cgal_program( "mesh_a_3d_gray_image.cpp" ) create_single_source_cgal_program( "mesh_an_implicit_function.cpp" ) diff --git a/Surface_mesher/test/Surface_mesher/CMakeLists.txt b/Surface_mesher/test/Surface_mesher/CMakeLists.txt index c70609c0ea7..dcc5829c499 100644 --- a/Surface_mesher/test/Surface_mesher/CMakeLists.txt +++ b/Surface_mesher/test/Surface_mesher/CMakeLists.txt @@ -4,18 +4,12 @@ project( Surface_mesher_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Surface_sweep_2/doc/Surface_sweep_2/CGAL/Surface_sweep_2_algorithms.h b/Surface_sweep_2/doc/Surface_sweep_2/CGAL/Surface_sweep_2_algorithms.h index 65d4383e56d..a7c674c921f 100644 --- a/Surface_sweep_2/doc/Surface_sweep_2/CGAL/Surface_sweep_2_algorithms.h +++ b/Surface_sweep_2/doc/Surface_sweep_2/CGAL/Surface_sweep_2_algorithms.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgIntersectionOfCurves2 +\ingroup PkgSurfaceSweep2Ref Given a range of curves, compute all intersection points between two (or more) input curves. When the flag `report_endpoints` is `true`, @@ -20,7 +20,7 @@ OutputIterator compute_intersection_points (InputIterator curves_begin, bool report_endpoints = false); /*! -\ingroup PkgIntersectionOfCurves2 +\ingroup PkgSurfaceSweep2Ref Given a range of curves, compute all intersection points between two (or more) input curves. When the flag `report_endpoints` is `true`, @@ -40,7 +40,7 @@ OutputIterator compute_intersection_points (InputIterator curves_begin, Traits traits); /*! -\ingroup PkgIntersectionOfCurves2 +\ingroup PkgSurfaceSweep2Ref Given a range of curves, compute all \f$ x\f$-monotone subcurves that are pairwise disjoint in their interior, as induced by the input curves. @@ -57,7 +57,7 @@ OutputIterator compute_subcurves (InputIterator curves_begin, bool multiple_overlaps = false); /*! -\ingroup PkgIntersectionOfCurves2 +\ingroup PkgSurfaceSweep2Ref Given a range of curves, compute all \f$ x\f$-monotone subcurves that are pairwise disjoint in their interior, as induced by the input curves. @@ -76,7 +76,7 @@ OutputIterator compute_subcurves (InputIterator curves_begin, Traits traits = Default_traits()); /*! -\ingroup PkgIntersectionOfCurves2 +\ingroup PkgSurfaceSweep2Ref Given a range of curves, check whether there is at least one pair of curves that intersect in their interior. The function returns `true` if such @@ -88,7 +88,7 @@ bool do_curves_intersect (InputIterator curves_begin, InputIterator curves_end); /*! -\ingroup PkgIntersectionOfCurves2 +\ingroup PkgSurfaceSweep2Ref Given a range of curves, check whether there is at least one pair of curves that intersect in their interior. The function returns `true` if such diff --git a/Surface_sweep_2/doc/Surface_sweep_2/PackageDescription.txt b/Surface_sweep_2/doc/Surface_sweep_2/PackageDescription.txt index 131f7fa07c1..4fefb482e2d 100644 --- a/Surface_sweep_2/doc/Surface_sweep_2/PackageDescription.txt +++ b/Surface_sweep_2/doc/Surface_sweep_2/PackageDescription.txt @@ -1,17 +1,17 @@ -/// \defgroup PkgIntersectionOfCurves2 2D Intersection of Curves Reference +/// \defgroup PkgSurfaceSweep2Ref 2D Intersection of Curves Reference /*! -\addtogroup PkgIntersectionOfCurves2 +\addtogroup PkgSurfaceSweep2Ref \todo check generated documentation -\cgalPkgDescriptionBegin{2D Intersection of Curves,PkgIntersectionOfCurves2Summary} +\cgalPkgDescriptionBegin{2D Intersection of Curves,PkgSurfaceSweep2} \cgalPkgPicture{Curve_intersections_2.png} \cgalPkgSummaryBegin \cgalPkgAuthors{Baruch Zukerman, Ron Wein, and Efi Fogel} \cgalPkgDesc{This package provides three free functions implemented based on the sweep-line paradigm: given a collection of input curves, compute all intersection points, compute the set of subcurves that are pairwise interior-disjoint induced by them, and check whether there is at least one pair of curves among them that intersect in their interior.} -\cgalPkgManuals{Chapter_2D_Intersection_of_Curves,PkgIntersectionOfCurves2} +\cgalPkgManuals{Chapter_2D_Intersection_of_Curves,PkgSurfaceSweep2Ref} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{2.4} -\cgalPkgDependsOn{\ref PkgArrangement2Summary} +\cgalPkgDependsOn{\ref PkgArrangementOnSurface2} \cgalPkgBib{cgal:wfz-ic2} \cgalPkgLicense{\ref licensesGPL "GPL"} \cgalPkgShortInfoEnd diff --git a/Surface_sweep_2/examples/Surface_sweep_2/CMakeLists.txt b/Surface_sweep_2/examples/Surface_sweep_2/CMakeLists.txt index b924fdabad3..06dad81f73f 100644 --- a/Surface_sweep_2/examples/Surface_sweep_2/CMakeLists.txt +++ b/Surface_sweep_2/examples/Surface_sweep_2/CMakeLists.txt @@ -4,7 +4,7 @@ project( Surface_sweep_2_Examples ) -cmake_minimum_required(VERSION 2.6.2) +cmake_minimum_required(VERSION 3.1) if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" VERSION_GREATER 2.6) if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}" VERSION_GREATER 2.8.3) cmake_policy(VERSION 2.8.4) @@ -24,10 +24,6 @@ if ( NOT CGAL_FOUND ) endif() -# include helper file -include( ${CGAL_USE_FILE} ) - - # Boost and its components find_package( Boost REQUIRED ) @@ -42,13 +38,8 @@ endif() # include for local directory # include for local package -include_directories( BEFORE ../../include ) - # Creating entries for all .cpp/.C files with "main" routine # ########################################################## -include( CGAL_CreateSingleSourceCGALProgram ) - - create_single_source_cgal_program( "plane_sweep.cpp" ) diff --git a/Surface_sweep_2/test/Surface_sweep_2/CMakeLists.txt b/Surface_sweep_2/test/Surface_sweep_2/CMakeLists.txt index 66da70cbcdf..7165020fb83 100644 --- a/Surface_sweep_2/test/Surface_sweep_2/CMakeLists.txt +++ b/Surface_sweep_2/test/Surface_sweep_2/CMakeLists.txt @@ -4,7 +4,7 @@ project( Surface_sweep_2_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET COMPONENTS Core ) @@ -19,11 +19,7 @@ set(WALK 3) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - include_directories (BEFORE "../../include") + include(${CGAL_USE_FILE}) function(compile name source_file point_location traits) # message(compile ${source_file}) diff --git a/Surface_sweep_2/test/Surface_sweep_2/cgal_test_base b/Surface_sweep_2/test/Surface_sweep_2/cgal_test_base index 7152f915d58..59f380da802 100755 --- a/Surface_sweep_2/test/Surface_sweep_2/cgal_test_base +++ b/Surface_sweep_2/test/Surface_sweep_2/cgal_test_base @@ -32,7 +32,7 @@ configure() rm CMakeCache.txt - if eval 'cmake --no-warn-unused-cli "$CMAKE_GENERATOR" -DRUNNING_CGAL_AUTO_TEST=TRUE \ + if eval 'cmake --no-warn-unused-cli ${INIT_FILE:+"-C${INIT_FILE}"} "$CMAKE_GENERATOR" -DRUNNING_CGAL_AUTO_TEST=TRUE \ -DCGAL_DIR="$CGAL_DIR" \ -DCGAL_CXX_FLAGS:STRING="$TESTSUITE_CXXFLAGS" \ -DCGAL_EXE_LINKER_FLAGS="$TESTSUITE_LDFLAGS" \ diff --git a/TDS_2/doc/TDS_2/CGAL/Triangulation_data_structure_2.h b/TDS_2/doc/TDS_2/CGAL/Triangulation_data_structure_2.h index 47455af8bba..4409f5f7243 100644 --- a/TDS_2/doc/TDS_2/CGAL/Triangulation_data_structure_2.h +++ b/TDS_2/doc/TDS_2/CGAL/Triangulation_data_structure_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgTDS2 +\ingroup PkgTDS2Ref The class `Triangulation_data_structure_2` is a model for the `TriangulationDataStructure_2` concept. diff --git a/TDS_2/doc/TDS_2/CGAL/Triangulation_ds_face_base_2.h b/TDS_2/doc/TDS_2/CGAL/Triangulation_ds_face_base_2.h index fe921c4f1c0..f9b9784fde9 100644 --- a/TDS_2/doc/TDS_2/CGAL/Triangulation_ds_face_base_2.h +++ b/TDS_2/doc/TDS_2/CGAL/Triangulation_ds_face_base_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgTDS2 +\ingroup PkgTDS2Ref The class `Triangulation_ds_face_base_2` is a model for the concept `TriangulationDSFaceBase_2` to be used by diff --git a/TDS_2/doc/TDS_2/CGAL/Triangulation_ds_vertex_base_2.h b/TDS_2/doc/TDS_2/CGAL/Triangulation_ds_vertex_base_2.h index 80d0064167e..822a61e891d 100644 --- a/TDS_2/doc/TDS_2/CGAL/Triangulation_ds_vertex_base_2.h +++ b/TDS_2/doc/TDS_2/CGAL/Triangulation_ds_vertex_base_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgTDS2 +\ingroup PkgTDS2Ref The class `Triangulation_ds_vertex_base_2` can be used as the base vertex for a `Triangulation_data_structure_2`, it is a model of the concept diff --git a/TDS_2/doc/TDS_2/PackageDescription.txt b/TDS_2/doc/TDS_2/PackageDescription.txt index 35ca4dbe5e7..b5741586343 100644 --- a/TDS_2/doc/TDS_2/PackageDescription.txt +++ b/TDS_2/doc/TDS_2/PackageDescription.txt @@ -1,15 +1,15 @@ -/// \defgroup PkgTDS2 2D Triangulation Data Structure Reference +/// \defgroup PkgTDS2Ref 2D Triangulation Data Structure Reference /// \defgroup PkgTDS2Concepts Concepts -/// \ingroup PkgTDS2 +/// \ingroup PkgTDS2Ref /*! -\addtogroup PkgTDS2 +\addtogroup PkgTDS2Ref \todo check generated documentation -\cgalPkgDescriptionBegin{2D Triangulation Data Structure,PkgTDS2Summary} +\cgalPkgDescriptionBegin{2D Triangulation Data Structure,PkgTDS2} \cgalPkgPicture{tds_small.png} \cgalPkgSummaryBegin \cgalPkgAuthors{Sylvain Pion and Mariette Yvinec} \cgalPkgDesc{This package provides a data structure to store a two-dimensional triangulation that has the topology of a two-dimensional sphere. The package acts as a container for the vertices and faces of the triangulation and provides basic combinatorial operation on the triangulation. } -\cgalPkgManuals{Chapter_2D_Triangulation_Data_Structure,PkgTDS2} +\cgalPkgManuals{Chapter_2D_Triangulation_Data_Structure,PkgTDS2Ref} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{2.2} diff --git a/TDS_2/test/TDS_2/CMakeLists.txt b/TDS_2/test/TDS_2/CMakeLists.txt index 6e020478e86..93b60a87707 100644 --- a/TDS_2/test/TDS_2/CMakeLists.txt +++ b/TDS_2/test/TDS_2/CMakeLists.txt @@ -4,19 +4,13 @@ project( TDS_2_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - include_directories (BEFORE "../../include") - - include_directories (BEFORE "include") + include_directories (BEFORE "include") # create a target per cppfile file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) diff --git a/TDS_3/doc/TDS_3/PackageDescription.txt b/TDS_3/doc/TDS_3/PackageDescription.txt index 9167af3f17a..939d992cde2 100644 --- a/TDS_3/doc/TDS_3/PackageDescription.txt +++ b/TDS_3/doc/TDS_3/PackageDescription.txt @@ -1,20 +1,20 @@ -/// \defgroup PkgTDS3 3D Triangulation Data Structure Reference +/// \defgroup PkgTDS3Ref 3D Triangulation Data Structure Reference /// \defgroup PkgTDS3Concepts Concepts -/// \ingroup PkgTDS3 +/// \ingroup PkgTDS3Ref /// \defgroup PkgTDS3Classes Classes -/// \ingroup PkgTDS3 +/// \ingroup PkgTDS3Ref /*! -\addtogroup PkgTDS3 +\addtogroup PkgTDS3Ref \todo check generated documentation -\cgalPkgDescriptionBegin{3D Triangulation Data Structure,PkgTDS3Summary} +\cgalPkgDescriptionBegin{3D Triangulation Data Structure,PkgTDS3} \cgalPkgPicture{tds3_small.png} \cgalPkgSummaryBegin \cgalPkgAuthors{Clément Jamin, Sylvain Pion and Monique Teillaud} \cgalPkgDesc{This package provides a data structure to store a three-dimensional triangulation that has the topology of a three-dimensional sphere. The package acts as a container for the vertices and cells of the triangulation and provides basic combinatorial operations on the triangulation.} -\cgalPkgManuals{Chapter_3D_Triangulation_Data_Structure,PkgTDS3} +\cgalPkgManuals{Chapter_3D_Triangulation_Data_Structure,PkgTDS3Ref} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{2.1} diff --git a/TDS_3/examples/TDS_3/CMakeLists.txt b/TDS_3/examples/TDS_3/CMakeLists.txt index 04d1893c4bd..c3be4897d87 100644 --- a/TDS_3/examples/TDS_3/CMakeLists.txt +++ b/TDS_3/examples/TDS_3/CMakeLists.txt @@ -4,18 +4,12 @@ project( TDS_3_Examples ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/TDS_3/include/CGAL/Triangulation_ds_cell_base_3.h b/TDS_3/include/CGAL/Triangulation_ds_cell_base_3.h index b8046fa77af..38726c9fa30 100644 --- a/TDS_3/include/CGAL/Triangulation_ds_cell_base_3.h +++ b/TDS_3/include/CGAL/Triangulation_ds_cell_base_3.h @@ -164,7 +164,7 @@ public: void set_neighbor(int i, Cell_handle n) { CGAL_triangulation_precondition( i >= 0 && i <= 3); - CGAL_triangulation_precondition( this != &*n ); + CGAL_triangulation_precondition( this != n.operator->() ); N[i] = n; } diff --git a/Three/demo/Three/CMakeLists.txt b/Three/demo/Three/CMakeLists.txt new file mode 100644 index 00000000000..e118f6b919f --- /dev/null +++ b/Three/demo/Three/CMakeLists.txt @@ -0,0 +1,22 @@ +# Created by the script cgal_create_cmake_script +# This is the CMake script for compiling a CGAL application. + + +project( Three_Demo ) + +cmake_minimum_required(VERSION 3.1) + +set(CMAKE_CXX_STANDARD 14) + +find_package(CGAL QUIET COMPONENTS Core ) + +if ( CGAL_FOUND ) + + include(${CGAL_USE_FILE}) + +else() + + message(STATUS "This program requires the CGAL library, and will not be compiled.") + +endif() + diff --git a/Three/demo/Three/Example_plugin/CMakeLists.txt b/Three/demo/Three/Example_plugin/CMakeLists.txt index 8dfeda7fd3f..15d708e4137 100644 --- a/Three/demo/Three/Example_plugin/CMakeLists.txt +++ b/Three/demo/Three/Example_plugin/CMakeLists.txt @@ -11,7 +11,6 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) #Find CGAL find_package(CGAL COMPONENTS Qt5) -include( ${CGAL_USE_FILE} ) # Find Qt5 itself find_package(Qt5 QUIET @@ -38,6 +37,6 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}") polyhedron_demo_plugin(basic_item_plugin Basic_item_plugin) # links the library containing the scene_plane_item with the plugin - target_link_libraries(basic_item_plugin Polyhedron_scene_basic_objects) + target_link_libraries(basic_item_plugin PUBLIC Polyhedron_scene_basic_objects) endif() diff --git a/Three/doc/Three/PackageDescription.txt b/Three/doc/Three/PackageDescription.txt index 3347d8e1677..72012cfaaae 100644 --- a/Three/doc/Three/PackageDescription.txt +++ b/Three/doc/Three/PackageDescription.txt @@ -1,14 +1,14 @@ -/// \defgroup PkgThree Three +/// \defgroup PkgThreeRef Three /// /*! -\addtogroup PkgThree +\addtogroup PkgThreeRef -\cgalPkgDescriptionBegin{Three,PkgThreeSummary} +\cgalPkgDescriptionBegin{Three,PkgThree} \cgalPkgPicture{pkg-small.png} \cgalPkgSummaryBegin \cgalPkgAuthors{Laurent Rineau, Sebastien Loriot, Andreas Fabri, Maxime Gimeno} \cgalPkgDesc{This package provides base classes for building a plugin. } -\cgalPkgManuals{Chapter_Three,PkgThree} +\cgalPkgManuals{Chapter_Three,PkgThreeRef} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{4.8} diff --git a/Three/doc/Three/Three.txt b/Three/doc/Three/Three.txt index 7251e6a62e9..8c615392b71 100644 --- a/Three/doc/Three/Three.txt +++ b/Three/doc/Three/Three.txt @@ -199,7 +199,7 @@ Once your code is written, you will need to link the item's library to your plug polyhedron_demo_plugin(basic_item_plugin Basic_item_plugin) # links the library containing the scene_plane_item with the plugin - target_link_libraries(basic_item_plugin scene_basic_objects) + target_link_libraries(basic_item_plugin PUBLIC scene_basic_objects) \subsubsection exampleCreatingANewTypeItem Creating a new type of item @@ -241,7 +241,7 @@ To display, you need to call the same program that got configured previously, an If you created your item in a specific file and you need to use it outside your plugin (like in another plugin), it is recommended to put it in the demo's root directory, and you will have to define your item in the general Polyhedron_demo's CMakeLists.txt by using the macro add_item : add_item(scene_trivial_item Scene_trivial_item.cpp) - target_link_libraries(scene_trivial_item scene_dependances_item) + target_link_libraries(scene_trivial_item PUBLIC scene_dependances_item) \subsection exampleUsingAGroupItem Using a Scene_group_item @@ -342,7 +342,7 @@ Finally, you can declare your plugin If you need targets from the Polyhedron_demo, you will have to add the prefix 'Polyhedron_' to the target's name, as the exported targets belong to the namespace Polyhedron_ polyhedron_demo_plugin(basic_item_plugin Basic_item_plugin) - target_link_libraries(basic_item_plugin Polyhedron_scene_basic_objects) + target_link_libraries(basic_item_plugin PUBLIC Polyhedron_scene_basic_objects) Notice that an external plugin will not be automatically loaded in the Polyhedron demo. It must be built in its own project. @@ -380,7 +380,7 @@ Notice that an external plugin will not be automatically loaded in the Polyhedro \section example Examples -All the examples have been constructed as external plugins in CGAL/Three/demo/Three/Example_plugin. You will have to use "Load plugin" in the File menu if you want to test it. +All the examples have been constructed as external plugins in CGAL/Three/demo/Three/Example_plugin. You will have to use "Load plugin" in the File menu or set the environment variable POLYHEDRON_DEMO_PLUGINS_PATH if you want to test it. \subsection example1 Creating a Basic Plugin \cgalExample{Three/Example_plugin/Basic_plugin.cpp} diff --git a/Three/include/CGAL/Three/Scene_interface.h b/Three/include/CGAL/Three/Scene_interface.h index 065d30e7c0f..b6e39f9feb6 100644 --- a/Three/include/CGAL/Three/Scene_interface.h +++ b/Three/include/CGAL/Three/Scene_interface.h @@ -26,7 +26,7 @@ #define SCENE_INTERFACE_H #include /*! -* \ingroup PkgThree +* \ingroup PkgThreeRef * The RenderingMode determines which of an item's primitives must be drawn. * It can be Points, PointsPlusNormals, Wireframe, Flat, FlatPlusEdges, or Gouraud. * - Points, PointsPlusNormals, and Wireframe have no light model. diff --git a/Three/include/CGAL/Three/Scene_item.h b/Three/include/CGAL/Three/Scene_item.h index 07470eee936..4d5539a35f3 100644 --- a/Three/include/CGAL/Three/Scene_item.h +++ b/Three/include/CGAL/Three/Scene_item.h @@ -246,6 +246,9 @@ public: //! int getId()const; + //! invalidates the context menu. Call it when supportsRenderingMode() changes, + //! for example. + void resetMenu(); //!Handles key press events. virtual bool keyPressEvent(QKeyEvent*){return false;} @@ -469,6 +472,13 @@ protected: /*! Compatibility function. Calls `viewer->getShaderProgram()`. */ virtual QOpenGLShaderProgram* getShaderProgram(int name , CGAL::Three::Viewer_interface *viewer = 0) const; +public: + //! \brief defaultSaveName returns the name to be used as default + //! when saving this item. + //! + //! Default is `name()`. + //! \return A new name for the default value in the "save as" dialog. + virtual QString defaultSaveName() const { return name(); } }; // end class Scene_item } } diff --git a/Three/include/CGAL/Three/Three.h b/Three/include/CGAL/Three/Three.h index 307034838d0..9887ed55727 100644 --- a/Three/include/CGAL/Three/Three.h +++ b/Three/include/CGAL/Three/Three.h @@ -48,14 +48,20 @@ public: static Scene_interface* scene(); static QObject* connectableScene(); static Three* messages(); + static RenderingMode defaultSurfaceMeshRenderingMode(); + static RenderingMode defaultPointSetRenderingMode(); + static QString modeName(RenderingMode mode); + static RenderingMode modeFromName(QString name); /*! \brief Adds a dock widget to the interface * - * Adds a dock widget in the left section of the MainWindow. If the slot is already taken, the dock widgets will be tabified. + * Adds a dock widget in the left section of the MainWindow. If the slot is already + * taken, the dock widgets will be tabified. */ void addDockWidget(QDockWidget* dock_widget); /*! \brief Gets an item of the templated type. - * \returns the first `SceneType` item found in the scene's list of currently selected items; + * \returns the first `SceneType` item found in the scene's list of currently selected + * items; * \returns NULL if there is no `SceneType` in the list. */ template @@ -63,7 +69,8 @@ public: /*! \brief Automatically connects each action of `plugin` to the corresponding slot. * - * \attention Each action named `ActionName` in the plugin's `actions()` list must have a corresponding slot named `on_ActionsName_triggered()` + * \attention Each action named `ActionName` in the plugin's `actions()` list must have + * a corresponding slot named `on_ActionsName_triggered()` * in the plugin. */ static void autoConnectActions(CGAL::Three::Polyhedron_demo_plugin_interface* plugin); @@ -72,6 +79,8 @@ protected: static Scene_interface* s_scene; static QObject* s_connectable_scene; static Three* s_three; + static RenderingMode s_defaultSMRM; + static RenderingMode s_defaultPSRM; }; } diff --git a/Three/include/CGAL/Three/Triangle_container.h b/Three/include/CGAL/Three/Triangle_container.h index ecea0b1ed69..0a5eff72be2 100644 --- a/Three/include/CGAL/Three/Triangle_container.h +++ b/Three/include/CGAL/Three/Triangle_container.h @@ -35,6 +35,7 @@ using namespace CGAL::Three; # define DEMO_FRAMEWORK_EXPORT Q_DECL_IMPORT #endif struct Tri_d; +class QMatrix4x4; namespace CGAL { namespace Three { @@ -95,12 +96,16 @@ struct DEMO_FRAMEWORK_EXPORT Triangle_container :public Primitive_container QVector4D getPlane(); //! getter for the "alpha" parameter float getAlpha(); + //! getter for the "f_matrix" parameter + QMatrix4x4 getFrameMatrix()const; //! setter for the "shrink_factor" parameter void setShrinkFactor(const float&); //! setter for the "plane" parameter void setPlane (const QVector4D&); //! setter for the "alpha" parameter void setAlpha (const float&); + //! setter for the "f_matrix" parameter + void setFrameMatrix(const QMatrix4x4&); ///@} //drawing variables diff --git a/Three/include/CGAL/Three/Viewer_interface.h b/Three/include/CGAL/Three/Viewer_interface.h index 0c78e97c68b..5dddd1ae5d2 100644 --- a/Three/include/CGAL/Three/Viewer_interface.h +++ b/Three/include/CGAL/Three/Viewer_interface.h @@ -253,6 +253,10 @@ public Q_SLOTS: //! \param animation_duration is the duration of the animation of the movement. virtual bool moveCameraToCoordinates(QString target, float animation_duration = 0.5f) = 0; + //! + //! Setter for the orthogonal projection of the viewer. + //! + virtual void SetOrthoProjection( bool b) =0; public: //! Gives acces to recent openGL(4.3) features, allowing use of things like diff --git a/Triangulation/applications/Triangulation/CMakeLists.txt b/Triangulation/applications/Triangulation/CMakeLists.txt index de87a2cedcc..4955332d74e 100644 --- a/Triangulation/applications/Triangulation/CMakeLists.txt +++ b/Triangulation/applications/Triangulation/CMakeLists.txt @@ -4,7 +4,7 @@ project( Triangulation_apps ) -cmake_minimum_required(VERSION 2.6.2) +cmake_minimum_required(VERSION 3.1) if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" VERSION_GREATER 2.6) if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}" VERSION_GREATER 2.8.3) cmake_policy(VERSION 2.8.4) @@ -26,10 +26,6 @@ if ( NOT CGAL_FOUND ) endif() -# include helper file -include( ${CGAL_USE_FILE} ) - - # Boost and its components find_package( Boost REQUIRED ) @@ -50,14 +46,10 @@ endif() include_directories( BEFORE include ) # include for local package -include_directories( BEFORE ../../include ) - # Creating entries for all .cpp/.C files with "main" routine # ########################################################## -include( CGAL_CreateSingleSourceCGALProgram ) - create_single_source_cgal_program( "points_to_RT_to_off.cpp" ) 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 97c0fe9b2db..8daf709e47b 100644 --- a/Triangulation/benchmark/Triangulation/CMakeLists.txt +++ b/Triangulation/benchmark/Triangulation/CMakeLists.txt @@ -4,21 +4,18 @@ project( Triangulation_benchmark ) -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET COMPONENTS Core ) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) + include(${CGAL_USE_FILE}) find_package(Eigen3 3.1.0) if (EIGEN3_FOUND) include( ${EIGEN3_USE_FILE} ) - include_directories (BEFORE "../../include") include_directories (BEFORE "include") create_single_source_cgal_program( "delaunay.cpp" ) create_single_source_cgal_program( "Td_vs_T2_and_T3.cpp" ) diff --git a/Triangulation/doc/Triangulation/PackageDescription.txt b/Triangulation/doc/Triangulation/PackageDescription.txt index b3bf73dd86f..bc863b04bc8 100644 --- a/Triangulation/doc/Triangulation/PackageDescription.txt +++ b/Triangulation/doc/Triangulation/PackageDescription.txt @@ -1,19 +1,19 @@ -/// \defgroup PkgTriangulations dD Triangulations +/// \defgroup PkgTriangulationsRef dD Triangulations /// \defgroup PkgTriangulationsConcepts Concepts -/// \ingroup PkgTriangulations +/// \ingroup PkgTriangulationsRef /// \defgroup PkgTriangulationsTriangulationClasses Triangulation Classes -/// \ingroup PkgTriangulations +/// \ingroup PkgTriangulationsRef /// \defgroup PkgTriangulationsTraitsClasses Traits Classes -/// \ingroup PkgTriangulations +/// \ingroup PkgTriangulationsRef /// \defgroup PkgTriangulationsVertexCellClasses Vertex, Face and Cell Classes -/// \ingroup PkgTriangulations +/// \ingroup PkgTriangulationsRef /*! -\addtogroup PkgTriangulations -\cgalPkgDescriptionBegin{dD Triangulations,PkgTriangulationsSummary} +\addtogroup PkgTriangulationsRef +\cgalPkgDescriptionBegin{dD Triangulations,PkgTriangulations} \cgalPkgPicture{Hypertriangle.png} \cgalPkgSummaryBegin \cgalPkgAuthors{Olivier Devillers, Samuel Hornus, and Clément Jamin} @@ -23,7 +23,7 @@ can be specified at compile-time or at run-time. Specifically, it provides a data structure to store the triangulations, and two classes to handle triangulations and Delaunay triangulations of point sets. Point location and point insertion are supported. The Delaunay triangulation also supports point removal.} -\cgalPkgManuals{Chapter_Triangulations,PkgTriangulations} +\cgalPkgManuals{Chapter_Triangulations,PkgTriangulationsRef} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{4.6} diff --git a/Triangulation/doc/Triangulation/Triangulation.txt b/Triangulation/doc/Triangulation/Triangulation.txt index 63861571602..f315bc65a13 100644 --- a/Triangulation/doc/Triangulation/Triangulation.txt +++ b/Triangulation/doc/Triangulation/Triangulation.txt @@ -181,7 +181,7 @@ corresponding to a face \f$ f \f$ stores a reference to a full cell `c` containing \f$ f \f$, and the indices of the vertices of `c` that belong to \f$ f \f$. -\cond +\if READY_TO_PUBLISH \cgalAdvanced The index of a full cell \f$ c\f$ in the \f$ i\f$-th neighbor of \f$ c\f$ is called the \f$ i\f$-th mirror-index of \f$ c\f$ (Figure \cgalFigureRef{triangulationfigfullcell}). Mirror indices are @@ -197,7 +197,7 @@ triangulation. Its second template parameter is used to specify wether or not the mirror indices should be kept in memory or computed on-the-fly, which is the default case. Please refer to the documentation of that class template for specific details. -\endcond +\endif ###Template Parameters### diff --git a/Triangulation/examples/Triangulation/CMakeLists.txt b/Triangulation/examples/Triangulation/CMakeLists.txt index d8c9e5df57c..741f732649b 100644 --- a/Triangulation/examples/Triangulation/CMakeLists.txt +++ b/Triangulation/examples/Triangulation/CMakeLists.txt @@ -15,15 +15,10 @@ endif() find_package(CGAL QUIET) if ( CGAL_FOUND ) - - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) find_package(Eigen3 3.1.0) if (EIGEN3_FOUND) include( ${EIGEN3_USE_FILE} ) - include_directories (BEFORE "../../include") create_single_source_cgal_program( "barycentric_subdivision.cpp" ) create_single_source_cgal_program( "delaunay_triangulation.cpp" ) diff --git a/Triangulation/include/CGAL/IO/Triangulation_off_ostream.h b/Triangulation/include/CGAL/IO/Triangulation_off_ostream.h index 016a28be19d..1255d6e7bba 100644 --- a/Triangulation/include/CGAL/IO/Triangulation_off_ostream.h +++ b/Triangulation/include/CGAL/IO/Triangulation_off_ostream.h @@ -118,88 +118,6 @@ input_point(std::istream & is, const Traits &traits, P & p) // TODO: replace these operator>> by an "input_point" function /////////////////////////////////////////////////////////////// -// TODO: test if the stream is binary or text? -template -std::istream & -operator>>(std::istream &is, typename Wrap::Point_d & p) -{ - typedef typename Wrap::Point_d P; - typedef typename K::FT FT; - std::vector coords; - - std::string line; - for(;;) - { - if (!std::getline(is, line)) - return is; - if (line != "") - break; - } - std::stringstream line_sstr(line); - FT temp; - while (line_sstr >> temp) - coords.push_back(temp); - - p = P(coords.begin(), coords.end()); - return is; -} - -// TODO: test if the stream is binary or text? -template -std::istream & -operator>>(std::istream &is, typename Wrap::Weighted_point_d & wp) -{ - typedef typename Wrap::Point_d P; - typedef typename Wrap::Weighted_point_d WP; - typedef typename K::FT FT; - - std::string line; - for(;;) - { - if (!std::getline(is, line)) - return is; - if (line != "") - break; - } - std::stringstream line_sstr(line); - FT temp; - std::vector coords; - while (line_sstr >> temp) - coords.push_back(temp); - - typename std::vector::iterator last = coords.end() - 1; - P p = P(coords.begin(), last); - wp = WP(p, *last); - - return is; -} - -// TODO: test if the stream is binary or text? -template -std::istream & -operator>>(std::istream &is, typename Wrap::Vector_d & v) -{ - typedef typename Wrap::Vector_d V; - typedef typename K::FT FT; - std::vector coords; - - std::string line; - for (;;) - { - if (!std::getline(is, line)) - return is; - if (line != "") - break; - } - std::stringstream line_sstr(line); - FT temp; - while (line_sstr >> temp) - coords.push_back(temp); - - v = V(coords.begin(), coords.end()); - return is; -} - template < class GT, class TDS > std::ostream & export_triangulation_to_off(std::ostream & os, diff --git a/Triangulation/include/CGAL/Triangulation.h b/Triangulation/include/CGAL/Triangulation.h index 284626cac26..20cfc0633d8 100644 --- a/Triangulation/include/CGAL/Triangulation.h +++ b/Triangulation/include/CGAL/Triangulation.h @@ -460,9 +460,9 @@ public: Facet_iterator facets_begin() { return tds().facets_begin(); } Facet_iterator facets_end() { return tds().facets_end(); } - Facet_iterator finite_facets_begin() + Finite_facet_iterator finite_facets_begin() { return Finite_facet_iterator(Finiteness_predicate(*this), facets_begin(), facets_end()); } - Facet_iterator finite_facets_end() + Finite_facet_iterator finite_facets_end() { return Finite_facet_iterator(Finiteness_predicate(*this), facets_end(), facets_end()); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - SOME PREDICATE FUNCTORS @@ -1352,7 +1352,7 @@ operator>>(std::istream & is, Triangulation & tr) else { read(is, cd); - read(is, n, io_Read_write()); + read(is, n); } CGAL_assertion_msg( cd <= tr.maximal_dimension(), "input Triangulation has too high dimension"); @@ -1404,27 +1404,34 @@ operator<<(std::ostream & os, const Triangulation & tr) else { write(os, tr.current_dimension()); - write(os, n, io_Read_write()); + write(os, n); } if( n == 0 ) return os; - size_t i(0); + int i = 0; // write the vertices std::map index_of_vertex; // infinite vertex has index 0 (among all the vertices) index_of_vertex[tr.infinite_vertex()] = i++; - os << *tr.infinite_vertex(); + if(is_ascii(os)) + os << *tr.infinite_vertex() <<"\n"; + else + write(os, *tr.infinite_vertex()); + for( Vertex_iterator it = tr.vertices_begin(); it != tr.vertices_end(); ++it ) { if( tr.is_infinite(it) ) continue; - os << *it; // write the vertex + if(is_ascii(os)) + os << *it <<"\n"; // write the vertex + else + write(os, *it); index_of_vertex[it] = i++; } - CGAL_assertion( i == n+1 ); + CGAL_assertion( size_t(i) == n+1 ); // output the combinatorial information return tr.tds().write_full_cells(os, index_of_vertex); diff --git a/Triangulation/include/CGAL/Triangulation_data_structure.h b/Triangulation/include/CGAL/Triangulation_data_structure.h index 411ac09b6bf..bfd8b078b3a 100644 --- a/Triangulation/include/CGAL/Triangulation_data_structure.h +++ b/Triangulation/include/CGAL/Triangulation_data_structure.h @@ -1392,7 +1392,9 @@ Triangulation_data_structure std::size_t i = 0; while( i < m ) { - Full_cell_handle s = new_full_cell(); + Full_cell_handle s = (i==0 && full_cells_.size()==1 ) + ? full_cells_begin() + : new_full_cell(); full_cells.push_back(s); for( int j = 0; j <= cd; ++j ) { diff --git a/Triangulation/include/CGAL/Triangulation_vertex.h b/Triangulation/include/CGAL/Triangulation_vertex.h index 11094d00f43..bb2b22db17e 100644 --- a/Triangulation/include/CGAL/Triangulation_vertex.h +++ b/Triangulation/include/CGAL/Triangulation_vertex.h @@ -115,7 +115,9 @@ template < class A, typename Data, class B > std::istream & operator>>(std::istream & is, Triangulation_vertex & v) { - is >> v.point(); + typename Triangulation_vertex::Point tmp; + is >> tmp; + v.set_point(tmp); return (is >> v.data()); } diff --git a/Triangulation/include/CGAL/internal/Triangulation/Triangulation_ds_iterators.h b/Triangulation/include/CGAL/internal/Triangulation/Triangulation_ds_iterators.h index a94aa306d65..77b99c67f9a 100644 --- a/Triangulation/include/CGAL/internal/Triangulation/Triangulation_ds_iterators.h +++ b/Triangulation/include/CGAL/internal/Triangulation/Triangulation_ds_iterators.h @@ -32,6 +32,7 @@ namespace Triangulation { template< typename TDS > class Triangulation_ds_facet_iterator { +public: typedef typename TDS::Full_cell_handle Full_cell_handle; typedef typename TDS::Facet Facet; @@ -48,7 +49,6 @@ class Triangulation_ds_facet_iterator Facet ft_; const int cur_dim_; -public: Triangulation_ds_facet_iterator(TDS & tds) : tds_(tds), ft_(tds.full_cells_begin(), 0), cur_dim_(tds.current_dimension()) { diff --git a/Triangulation/test/Triangulation/CMakeLists.txt b/Triangulation/test/Triangulation/CMakeLists.txt index 81c417948dc..67ea3dc2a8b 100644 --- a/Triangulation/test/Triangulation/CMakeLists.txt +++ b/Triangulation/test/Triangulation/CMakeLists.txt @@ -13,15 +13,10 @@ endif() find_package(CGAL QUIET) if ( CGAL_FOUND ) - - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) find_package(Eigen3 3.1.0) if (EIGEN3_FOUND) include( ${EIGEN3_USE_FILE} ) - include_directories (BEFORE "../../include") include_directories (BEFORE "include") create_single_source_cgal_program( "test_triangulation.cpp" ) diff --git a/Triangulation/test/Triangulation/test_triangulation.cpp b/Triangulation/test/Triangulation/test_triangulation.cpp index 4e225333054..308b3f10c7d 100644 --- a/Triangulation/test/Triangulation/test_triangulation.cpp +++ b/Triangulation/test/Triangulation/test_triangulation.cpp @@ -15,6 +15,8 @@ int main() #include #include #include +#include +#include using namespace std; @@ -27,8 +29,9 @@ void test(const int d, const string & type, int N) typedef typename T::Full_cell_handle Full_cell_handle; typedef typename T::Point Point; typedef typename T::Geom_traits::RT RT; - typedef typename T::Finite_full_cell_const_iterator Finite_full_cell_const_iterator; typedef typename T::Finite_vertex_const_iterator Finite_vertex_const_iterator; + typedef typename T::Finite_facet_iterator Finite_facet_iterator; + typedef typename T::Finite_full_cell_const_iterator Finite_full_cell_const_iterator; typedef CGAL::Random_points_in_cube_d Random_points_iterator; @@ -61,6 +64,16 @@ void test(const int d, const string & type, int N) nbis = infinite_full_cells.size(); cerr << nbis << " = " << (nbis+nbfs) << " = " << tri.number_of_full_cells(); + assert(nbfs + nbis == tri.number_of_full_cells()); + + cerr << "\nTraversing finite facets... "; + size_t nbff(0); + Finite_facet_iterator ffit = tri.finite_facets_begin(); + while( ffit != tri.finite_facets_end() ) + { + ++ffit, ++nbff; + } + cerr << nbff << " finite facets"; cerr << "\nTraversing finite vertices... "; size_t nbfv(0); @@ -70,6 +83,7 @@ void test(const int d, const string & type, int N) ++fvit, ++nbfv; } cerr << nbfv << " finite vertices (should be " << tri.number_of_vertices() << ")."; + assert(nbfv == tri.number_of_vertices()); // TEST Copy Constructor T tri2(tri); @@ -79,11 +93,32 @@ void test(const int d, const string & type, int N) assert( tri.number_of_vertices() == tri2.number_of_vertices() ); assert( tri.number_of_full_cells() == tri2.number_of_full_cells() ); + std::stringstream buffer; + buffer << tri; + // CLEAR tri.clear(); assert(-1==tri.current_dimension()); assert(tri.empty()); assert( tri.is_valid() ); + + buffer >> tri; + assert( tri.current_dimension() == tri2.current_dimension() ); + assert( tri.maximal_dimension() == tri2.maximal_dimension() ); + assert( tri.number_of_vertices() == tri2.number_of_vertices() ); + assert( tri.number_of_full_cells() == tri2.number_of_full_cells() ); + + std::ofstream ofs("tri", std::ios::binary); + ofs << tri; + ofs.close(); + + std::ifstream ifs("tri", std::ios::binary); + ifs >> tri2; + ifs.close(); + assert( tri.current_dimension() == tri2.current_dimension() ); + assert( tri.maximal_dimension() == tri2.maximal_dimension() ); + assert( tri.number_of_vertices() == tri2.number_of_vertices() ); + assert( tri.number_of_full_cells() == tri2.number_of_full_cells() ); } /*#define test_static(DIM) { \ diff --git a/Triangulation_2/doc/Triangulation_2/PackageDescription.txt b/Triangulation_2/doc/Triangulation_2/PackageDescription.txt index 0984fbd61b3..da532e54375 100644 --- a/Triangulation_2/doc/Triangulation_2/PackageDescription.txt +++ b/Triangulation_2/doc/Triangulation_2/PackageDescription.txt @@ -1,20 +1,20 @@ -/// \defgroup PkgTriangulation2 2D Triangulation Reference +/// \defgroup PkgTriangulation2Ref 2D Triangulation Reference /// \defgroup PkgTriangulation2Concepts Concepts -/// \ingroup PkgTriangulation2 +/// \ingroup PkgTriangulation2Ref /// \defgroup PkgTriangulation2TriangulationClasses Triangulation Classes -/// \ingroup PkgTriangulation2 +/// \ingroup PkgTriangulation2Ref /// \defgroup PkgTriangulation2TraitsClasses Traits Classes -/// \ingroup PkgTriangulation2 +/// \ingroup PkgTriangulation2Ref /// \defgroup PkgTriangulation2VertexFaceClasses Vertex and Face Classes -/// \ingroup PkgTriangulation2 +/// \ingroup PkgTriangulation2Ref /// \defgroup PkgTriangulation2Miscellaneous Miscellaneous -/// \ingroup PkgTriangulation2 +/// \ingroup PkgTriangulation2Ref /*! Draw. \code @@ -22,21 +22,21 @@ \endcode */ /// \defgroup PkgDrawTriangulation2 Draw a Triangulation 2 -/// \ingroup PkgTriangulation2 +/// \ingroup PkgTriangulation2Ref /*! -\addtogroup PkgTriangulation2 +\addtogroup PkgTriangulation2Ref \todo check generated documentation -\cgalPkgDescriptionBegin{2D Triangulation,PkgTriangulation2Summary} +\cgalPkgDescriptionBegin{2D Triangulation,PkgTriangulation2} \cgalPkgPicture{cdt2d-small.png} \cgalPkgSummaryBegin \cgalPkgAuthor{Mariette Yvinec} \cgalPkgDesc{This package allows to build and handle various triangulations for point sets two dimensions. Any \cgal triangulation covers the convex hull of its vertices. Triangulations are built incrementally and can be modified by insertion or removal of vertices. They offer point location facilities. The package provides plain triangulation (whose faces depend on the insertion order of the vertices) and Delaunay triangulations. Regular triangulations are also provided for sets of weighted points. Delaunay and regular triangulations offer nearest neighbor queries and primitives to build the dual Voronoi and power diagrams. Finally, constrained and Delaunay constrained triangulations allows to force some constrained segments to appear as edges of the triangulation. Several versions of constrained and Delaunay constrained triangulations are provided: some of them handle intersections between input constraints segment while others do not. } -\cgalPkgManuals{Chapter_2D_Triangulations,PkgTriangulation2} +\cgalPkgManuals{Chapter_2D_Triangulations,PkgTriangulation2Ref} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{0.9} -\cgalPkgDependsOn{\ref PkgTDS2Summary} +\cgalPkgDependsOn{\ref PkgTDS2} \cgalPkgBib{cgal:y-t2} \cgalPkgLicense{\ref licensesGPL "GPL"} \cgalPkgDemo{Delaunay Triangulation,delaunay_triangulation_2.zip,Regular Triangulation,regular_triangulation_2.zip,Constrained Delaunay Triangulation,constrained_delaunay_triangulation_2.zip} @@ -66,7 +66,7 @@ of triangulation data structure acting as a container for faces and vertices while taking care of the combinatorial aspects of the triangulation. The concepts and models relative to the triangulation data structure -are described in Chapter \ref PkgTDS2 "2D Triangulation Data Structure". +are described in Chapter \ref PkgTDS2Ref "2D Triangulation Data Structure". \cgalClassifedRefPages diff --git a/Triangulation_2/doc/Triangulation_2/Triangulation_2.txt b/Triangulation_2/doc/Triangulation_2/Triangulation_2.txt index 65688e950b0..e9bcdeccf88 100644 --- a/Triangulation_2/doc/Triangulation_2/Triangulation_2.txt +++ b/Triangulation_2/doc/Triangulation_2/Triangulation_2.txt @@ -379,12 +379,12 @@ Flip. \subsection Triangulation_2Implementation Implementation -Locate is implemented by a line walk. The walk -begins at a vertex of the face which +Locate is implemented by a stochastic walk \cgalCite{cgal:dpt-wt-02}. +The walk begins at a vertex of the face which is given as an optional argument or at an arbitrary vertex of the triangulation if no optional argument is given. It takes -time \f$ O(n)\f$ in the worst case, but only \f$ O(\sqrt{n})\f$ +time \f$ O(n)\f$ in the worst case for Delaunay Triangulations, but only \f$ O(\sqrt{n})\f$ on average if the vertices are distributed uniformly at random. The class `Triangulation_hierarchy_2`, described in section \ref Section_2D_Triangulations_Hierarchy, diff --git a/Triangulation_2/examples/Triangulation_2/CMakeLists.txt b/Triangulation_2/examples/Triangulation_2/CMakeLists.txt index f1a119e58b6..b6972c19b0a 100644 --- a/Triangulation_2/examples/Triangulation_2/CMakeLists.txt +++ b/Triangulation_2/examples/Triangulation_2/CMakeLists.txt @@ -19,12 +19,6 @@ endif() if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h b/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h index 2fedc83264a..248159481ed 100644 --- a/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h +++ b/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h @@ -268,7 +268,7 @@ public: { // protects against inserting a zero length constraint if(va == vb){ - return Constraint_id(NULL); + return Constraint_id(NULL); } // protects against inserting twice the same constraint Constraint_id cid = hierarchy.insert_constraint(va, vb); diff --git a/Triangulation_2/include/CGAL/Polyline_constraint_hierarchy_2.h b/Triangulation_2/include/CGAL/Polyline_constraint_hierarchy_2.h index 13553b7460f..2c1654cece4 100644 --- a/Triangulation_2/include/CGAL/Polyline_constraint_hierarchy_2.h +++ b/Triangulation_2/include/CGAL/Polyline_constraint_hierarchy_2.h @@ -192,9 +192,10 @@ private: Compare comp; Constraint_set constraint_set; Sc_to_c_map sc_to_c_map; - std::map, - Constraint_id, - Pair_compare> constraint_map; + typedef std::map, + Constraint_id, + Pair_compare> Constraint_map; + Constraint_map constraint_map; public: Polyline_constraint_hierarchy_2(const Compare& comp) @@ -867,6 +868,14 @@ typename Polyline_constraint_hierarchy_2::Vertex_list* Polyline_constraint_hierarchy_2:: insert_constraint(T va, T vb){ Edge he = make_edge(va, vb); + + // First, check if the constraint was already inserted. + // If it was not, then the iterator to the lower bound will serve as + // the hint of the insertion. + typename Constraint_map::iterator c_map_it = constraint_map.lower_bound(he); + if(c_map_it != constraint_map.end() && he == c_map_it->first) + return 0; + Vertex_list* children = new Vertex_list; Context_list* fathers; @@ -886,7 +895,8 @@ insert_constraint(T va, T vb){ ctxt.pos = children->skip_begin(); fathers->push_front(ctxt); - constraint_map[he] = children; + constraint_map.insert(c_map_it, + typename Constraint_map::value_type(he, children)); return children; } diff --git a/Triangulation_2/include/CGAL/draw_triangulation_2.h b/Triangulation_2/include/CGAL/draw_triangulation_2.h index a1cfc460fdb..193e12e20ea 100644 --- a/Triangulation_2/include/CGAL/draw_triangulation_2.h +++ b/Triangulation_2/include/CGAL/draw_triangulation_2.h @@ -47,11 +47,11 @@ struct DefaultColorFunctorT2 template class SimpleTriangulation2ViewerQt : public Basic_viewer_qt { - typedef Basic_viewer_qt Base; - typedef typename T2::Vertex_handle Vertex_const_handle; + typedef Basic_viewer_qt Base; + typedef typename T2::Vertex_handle Vertex_const_handle; typedef typename T2::Finite_edges_iterator Edge_const_handle; typedef typename T2::Finite_faces_iterator Facet_const_handle; - typedef typename T2::Point Point; + typedef typename T2::Point Point; public: /// Construct the viewer. diff --git a/Triangulation_2/test/Triangulation_2/CMakeLists.txt b/Triangulation_2/test/Triangulation_2/CMakeLists.txt index 8ea01498ffd..1441e226126 100644 --- a/Triangulation_2/test/Triangulation_2/CMakeLists.txt +++ b/Triangulation_2/test/Triangulation_2/CMakeLists.txt @@ -4,19 +4,13 @@ project( Triangulation_2_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - include_directories (BEFORE "../../include") - - include_directories (BEFORE "include") + include_directories (BEFORE "include") # create a target per cppfile file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) diff --git a/Triangulation_3/demo/Triangulation_3/CMakeLists.txt b/Triangulation_3/demo/Triangulation_3/CMakeLists.txt index d5cd96d8e99..e3d3fe6d5ba 100644 --- a/Triangulation_3/demo/Triangulation_3/CMakeLists.txt +++ b/Triangulation_3/demo/Triangulation_3/CMakeLists.txt @@ -19,13 +19,13 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) find_package(CGAL COMPONENTS Qt5) -include(${CGAL_USE_FILE}) -find_package(Qt5 QUIET COMPONENTS OpenGL) +find_package(Qt5 QUIET COMPONENTS OpenGL Xml) if(Qt5_FOUND) add_definitions(-DQT_NO_KEYWORDS) + set(CMAKE_INCLUDE_CURRENT_DIR ON) endif(Qt5_FOUND) # Activate concurrency ? (turned OFF by default) @@ -48,7 +48,7 @@ endif() if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND ) - include_directories (BEFORE ../../include ./ ) + include_directories (BEFORE ./ ) # ui files, created with Qt Designer qt5_wrap_ui( uis MainWindow.ui ) @@ -65,8 +65,8 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND ) add_to_cached_list( CGAL_EXECUTABLE_TARGETS T3_demo ) - target_link_libraries( T3_demo PRIVATE ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES}) - target_link_libraries( T3_demo PRIVATE Qt5::OpenGL) + target_link_libraries( T3_demo PRIVATE CGAL::CGAL CGAL::CGAL_Qt5) + target_link_libraries( T3_demo PRIVATE Qt5::OpenGL Qt5::Xml) if(TBB_FOUND) CGAL_target_use_TBB(T3_demo) endif() diff --git a/Triangulation_3/demo/Triangulation_3_Geomview_demos/CMakeLists.txt b/Triangulation_3/demo/Triangulation_3_Geomview_demos/CMakeLists.txt index 78a70d166d1..20e8bf1d3b2 100644 --- a/Triangulation_3/demo/Triangulation_3_Geomview_demos/CMakeLists.txt +++ b/Triangulation_3/demo/Triangulation_3_Geomview_demos/CMakeLists.txt @@ -16,10 +16,6 @@ find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - create_single_source_cgal_program( "Triangulation_3_demo.cpp" ) create_single_source_cgal_program( "Triangulation_3_color_demo.cpp" ) create_single_source_cgal_program( "Triangulation_3_remove_demo.cpp" ) diff --git a/Triangulation_3/doc/Triangulation_3/CGAL/link_to_face_graph.h b/Triangulation_3/doc/Triangulation_3/CGAL/link_to_face_graph.h index 4a61bbdf8ae..600ec0441e8 100644 --- a/Triangulation_3/doc/Triangulation_3/CGAL/link_to_face_graph.h +++ b/Triangulation_3/doc/Triangulation_3/CGAL/link_to_face_graph.h @@ -1,7 +1,7 @@ namespace CGAL { /*! -\ingroup PkgTriangulation3 +\ingroup PkgTriangulation3Ref fills the face graph `tm` with the link of triangulation vertex `vh`. diff --git a/Triangulation_3/doc/Triangulation_3/PackageDescription.txt b/Triangulation_3/doc/Triangulation_3/PackageDescription.txt index d24aa743c3b..e8d7828e926 100644 --- a/Triangulation_3/doc/Triangulation_3/PackageDescription.txt +++ b/Triangulation_3/doc/Triangulation_3/PackageDescription.txt @@ -1,17 +1,17 @@ -/// \defgroup PkgTriangulation3 3D Triangulations Reference +/// \defgroup PkgTriangulation3Ref 3D Triangulations Reference /// \defgroup PkgTriangulation3Concepts Concepts -/// \ingroup PkgTriangulation3 +/// \ingroup PkgTriangulation3Ref /// \defgroup PkgTriangulation3TriangulationClasses Triangulation Classes -/// \ingroup PkgTriangulation3 +/// \ingroup PkgTriangulation3Ref /// \defgroup PkgTriangulation3TraitsClasses Traits Classes -/// \ingroup PkgTriangulation3 +/// \ingroup PkgTriangulation3Ref /// \defgroup PkgTriangulation3VertexCellClasses Vertex and Cell Classes -/// \ingroup PkgTriangulation3 +/// \ingroup PkgTriangulation3Ref /*! Draw. \code @@ -19,20 +19,20 @@ \endcode */ /// \defgroup PkgDrawTriangulation3 Draw a Triangulation 3 -/// \ingroup PkgTriangulation3 +/// \ingroup PkgTriangulation3Ref /*! -\addtogroup PkgTriangulation3 -\cgalPkgDescriptionBegin{3D Triangulations,PkgTriangulation3Summary} +\addtogroup PkgTriangulation3Ref +\cgalPkgDescriptionBegin{3D Triangulations,PkgTriangulation3} \cgalPkgPicture{twotets.png} \cgalPkgSummaryBegin \cgalPkgAuthors{Clément Jamin, Sylvain Pion and Monique Teillaud} \cgalPkgDesc{This package allows to build and handle triangulations for point sets in three dimensions. Any \cgal triangulation covers the convex hull of its vertices. Triangulations are build incrementally and can be modified by insertion, displacements or removal of vertices. They offer point location facilities. The package provides plain triangulation (whose faces depends on the insertion order of the vertices) and Delaunay triangulations. Regular triangulations are also provided for sets of weighted points. Delaunay and regular triangulations offer nearest neighbor queries and primitives to build the dual Voronoi and power diagrams. Optionally, the main Delaunay and regular triangulation algorithms (insert, remove) support multi-core shared-memory architectures to take advantage of available parallelism.} -\cgalPkgManuals{Chapter_3D_Triangulations,PkgTriangulation3} +\cgalPkgManuals{Chapter_3D_Triangulations,PkgTriangulation3Ref} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{2.1} -\cgalPkgDependsOn{\ref PkgTDS3Summary} +\cgalPkgDependsOn{\ref PkgTDS3} \cgalPkgBib{cgal:pt-t3} \cgalPkgLicense{\ref licensesGPL "GPL" } \cgalPkgDemo{3D Triangulations,triangulation_3.zip} diff --git a/Triangulation_3/examples/Triangulation_3/CMakeLists.txt b/Triangulation_3/examples/Triangulation_3/CMakeLists.txt index c13b8b4bbe0..371b8c62fb2 100644 --- a/Triangulation_3/examples/Triangulation_3/CMakeLists.txt +++ b/Triangulation_3/examples/Triangulation_3/CMakeLists.txt @@ -1,6 +1,6 @@ project( Triangulation_3_Examples ) -cmake_minimum_required(VERSION 2.8.12) +cmake_minimum_required(VERSION 3.1) if(NOT POLICY CMP0070 AND POLICY CMP0053) # Only set CMP0053 to OLD with CMake<3.10, otherwise there is a warning. @@ -33,6 +33,21 @@ if ( CGAL_FOUND ) target_link_libraries(draw_triangulation_3 PUBLIC CGAL::CGAL_Qt5) endif() + find_package( TBB QUIET ) + + if( TBB_FOUND ) + include( CGAL_target_use_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" ) + CGAL_target_use_TBB( parallel_insertion_and_removal_in_regular_3 ) + CGAL_target_use_TBB( parallel_insertion_in_delaunay_3 ) + CGAL_target_use_TBB( sequential_parallel ) + else() + message(STATUS "NOTICE: a few examples require TBB and will not be compiled.") + endif() + else() message(STATUS "This program requires the CGAL library, and will not be compiled.") diff --git a/Triangulation_3/include/CGAL/Delaunay_triangulation_3.h b/Triangulation_3/include/CGAL/Delaunay_triangulation_3.h index cb7979f430e..5d19859a5f9 100644 --- a/Triangulation_3/include/CGAL/Delaunay_triangulation_3.h +++ b/Triangulation_3/include/CGAL/Delaunay_triangulation_3.h @@ -56,6 +56,7 @@ #ifdef CGAL_LINKED_WITH_TBB # include # include +# include # include # include #endif diff --git a/Triangulation_3/include/CGAL/Regular_triangulation_3.h b/Triangulation_3/include/CGAL/Regular_triangulation_3.h index 804bada951d..5170956468e 100644 --- a/Triangulation_3/include/CGAL/Regular_triangulation_3.h +++ b/Triangulation_3/include/CGAL/Regular_triangulation_3.h @@ -41,6 +41,7 @@ #ifdef CGAL_LINKED_WITH_TBB # include # include +# include # include # include #endif diff --git a/Triangulation_3/include/CGAL/draw_triangulation_3.h b/Triangulation_3/include/CGAL/draw_triangulation_3.h index 709bd15924f..8de53e720f0 100644 --- a/Triangulation_3/include/CGAL/draw_triangulation_3.h +++ b/Triangulation_3/include/CGAL/draw_triangulation_3.h @@ -51,12 +51,12 @@ struct DefaultColorFunctorT3 template class SimpleTriangulation3ViewerQt : public Basic_viewer_qt { - typedef Basic_viewer_qt Base; - typedef typename T3::Vertex_handle Vertex_const_handle; + typedef Basic_viewer_qt Base; + typedef typename T3::Vertex_handle Vertex_const_handle; typedef typename T3::Finite_edges_iterator Edge_const_handle; typedef typename T3::Finite_facets_iterator Facet_const_handle; - typedef typename T3::Cell_handle Cell_handle; - typedef typename T3::Point Point; + typedef typename T3::Cell_handle Cell_handle; + typedef typename T3::Point Point; public: /// Construct the viewer. diff --git a/Triangulation_3/test/Triangulation_3/CMakeLists.txt b/Triangulation_3/test/Triangulation_3/CMakeLists.txt index 26494983c37..53e46c63ba4 100644 --- a/Triangulation_3/test/Triangulation_3/CMakeLists.txt +++ b/Triangulation_3/test/Triangulation_3/CMakeLists.txt @@ -4,22 +4,16 @@ project( Triangulation_3_Tests ) -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - find_package( TBB QUIET ) - include( CGAL_CreateSingleSourceCGALProgram ) - - include_directories (BEFORE "../../include") - - include_directories (BEFORE "include") + include_directories (BEFORE "include") create_single_source_cgal_program( "test_delaunay_3.cpp" ) create_single_source_cgal_program( "test_delaunay_hierarchy_3.cpp" ) diff --git a/Union_find/test/Union_find/CMakeLists.txt b/Union_find/test/Union_find/CMakeLists.txt index 3634f05b200..3894840ebee 100644 --- a/Union_find/test/Union_find/CMakeLists.txt +++ b/Union_find/test/Union_find/CMakeLists.txt @@ -4,19 +4,13 @@ project( Union_find_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - include_directories (BEFORE "../../include") - - include_directories (BEFORE "include") + include_directories (BEFORE "include") # create a target per cppfile file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) diff --git a/Visibility_2/doc/Visibility_2/CGAL/Rotational_sweep_visibility_2.h b/Visibility_2/doc/Visibility_2/CGAL/Rotational_sweep_visibility_2.h index f11a3ab543a..0202607f6bf 100644 --- a/Visibility_2/doc/Visibility_2/CGAL/Rotational_sweep_visibility_2.h +++ b/Visibility_2/doc/Visibility_2/CGAL/Rotational_sweep_visibility_2.h @@ -1,6 +1,6 @@ namespace CGAL { /*! -\ingroup PkgVisibility_2Classes +\ingroup PkgVisibility2Classes \brief This class is a model of the concept `Visibility_2` can answer visibility queries within a polygon that may have holes. diff --git a/Visibility_2/doc/Visibility_2/CGAL/Simple_polygon_visibility_2.h b/Visibility_2/doc/Visibility_2/CGAL/Simple_polygon_visibility_2.h index c1a906e1433..1860630e3d0 100644 --- a/Visibility_2/doc/Visibility_2/CGAL/Simple_polygon_visibility_2.h +++ b/Visibility_2/doc/Visibility_2/CGAL/Simple_polygon_visibility_2.h @@ -1,6 +1,6 @@ namespace CGAL { /*! -\ingroup PkgVisibility_2Classes +\ingroup PkgVisibility2Classes \brief This class is a model of the concept `Visibility_2` can answer visibility queries within a simple polygon with no holes. diff --git a/Visibility_2/doc/Visibility_2/CGAL/Triangular_expansion_visibility_2.h b/Visibility_2/doc/Visibility_2/CGAL/Triangular_expansion_visibility_2.h index ec9f8fdb981..dcaefc6e643 100644 --- a/Visibility_2/doc/Visibility_2/CGAL/Triangular_expansion_visibility_2.h +++ b/Visibility_2/doc/Visibility_2/CGAL/Triangular_expansion_visibility_2.h @@ -1,6 +1,6 @@ namespace CGAL { /*! -\ingroup PkgVisibility_2Classes +\ingroup PkgVisibility2Classes \brief This class is a model of the concept `Visibility_2` can answer visibility queries within a polygon that may have holes. diff --git a/Visibility_2/doc/Visibility_2/Concepts/Visibility_2.h b/Visibility_2/doc/Visibility_2/Concepts/Visibility_2.h index 7ce62e3315e..11d55c5a485 100644 --- a/Visibility_2/doc/Visibility_2/Concepts/Visibility_2.h +++ b/Visibility_2/doc/Visibility_2/Concepts/Visibility_2.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgVisibility_2Concepts +\ingroup PkgVisibility2Concepts \cgalConcept A model of the `Visibility_2` concept can be attached to an `Arrangement_2` instance to diff --git a/Visibility_2/doc/Visibility_2/PackageDescription.txt b/Visibility_2/doc/Visibility_2/PackageDescription.txt index 3b3a2ad8672..a339f2e5c6e 100644 --- a/Visibility_2/doc/Visibility_2/PackageDescription.txt +++ b/Visibility_2/doc/Visibility_2/PackageDescription.txt @@ -1,25 +1,25 @@ -/// \defgroup PkgVisibility_2 Visibility_2 Reference +/// \defgroup PkgVisibility2Ref Visibility_2 Reference -/// \defgroup PkgVisibility_2Concepts Concepts -/// \ingroup PkgVisibility_2 +/// \defgroup PkgVisibility2Concepts Concepts +/// \ingroup PkgVisibility2Ref -/// \defgroup PkgVisibility_2Classes Classes -/// \ingroup PkgVisibility_2 +/// \defgroup PkgVisibility2Classes Classes +/// \ingroup PkgVisibility2Ref /*! -\addtogroup PkgVisibility_2 -\cgalPkgDescriptionBegin{2D Visibility Computation,PkgVisibility_2Summary} +\addtogroup PkgVisibility2Ref +\cgalPkgDescriptionBegin{2D Visibility Computation,PkgVisibility2} \cgalPkgPicture{visibility-teaser-thumbnail.png} \cgalPkgSummaryBegin \cgalPkgAuthors{Michael Hemmer, Kan Huang, Francisc Bungiu, Ning Xu} \cgalPkgDesc{This package provides several variants to compute the visibility area of a point within polygonal regions in two dimensions.} -\cgalPkgManuals{Chapter_2D_Visibility_Computation,PkgVisibility_2} +\cgalPkgManuals{Chapter_2D_Visibility_Computation,PkgVisibility2Ref} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{4.7} -\cgalPkgDependsOn{\ref PkgArrangement2Summary} -\cgalPkgDependsOn{\ref PkgTriangulation2Summary} +\cgalPkgDependsOn{\ref PkgArrangementOnSurface2} +\cgalPkgDependsOn{\ref PkgTriangulation2} \cgalPkgBib{hhb-visibility-2} \cgalPkgLicense{\ref licensesGPL "GPL"} \cgalPkgShortInfoEnd diff --git a/Visibility_2/doc/Visibility_2/visibility_2.txt b/Visibility_2/doc/Visibility_2/visibility_2.txt index 3f571caac98..34fa2d8674e 100644 --- a/Visibility_2/doc/Visibility_2/visibility_2.txt +++ b/Visibility_2/doc/Visibility_2/visibility_2.txt @@ -12,7 +12,7 @@ namespace CGAL { \section visibility_2_introduction Introduction This package provides functionality to compute the visibility region within polygons in two dimensions. -The package is based on the package \ref PkgArrangement2Summary and uses CGAL::Arrangement_2 +The package is based on the package \ref PkgArrangementOnSurface2 and uses CGAL::Arrangement_2 as the fundamental class to specify the input as well as the output. Hence, a polygon \f$ P \f$ is represented by a bounded arrangement face \f$ f \f$ that does not have any isolated vertices and any edge that is adjacent to \f$ f \f$ separates \f$ f \f$ from another face. @@ -45,12 +45,12 @@ Therefore, this package offers also functionality to compute the regularized visibility area \f$ \overline{V_q} = closure(interior(V_q)) = (V_q\setminus\partial V_q) \cup \partial (V_q\setminus\partial V_q)\f$, as shown in \cgalFigureRef{definition-fig} (2). -For more information about regularization, refer to Chapter \ref PkgBooleanSetOperations2Summary. +For more information about regularization, refer to Chapter \ref PkgBooleanSetOperations2. \section visibility_2_classes Classes and Algorithms Answering visibility queries is, in many ways, similar to answering point-location queries. -Thus, we use the same design used to implement \ref PkgArrangement2Summary point location. +Thus, we use the same design used to implement \ref PkgArrangementOnSurface2 point location. Each of the various visibility class templates employs a different algorithm or \em strategy for answering queries\cgalFootnote{The term \em strategy is borrowed from the diff --git a/Visibility_2/examples/Visibility_2/CMakeLists.txt b/Visibility_2/examples/Visibility_2/CMakeLists.txt index 34cddd902ce..68efc6b823d 100644 --- a/Visibility_2/examples/Visibility_2/CMakeLists.txt +++ b/Visibility_2/examples/Visibility_2/CMakeLists.txt @@ -4,18 +4,12 @@ project( Visibility_2_Examples ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Visibility_2/test/Visibility_2/CMakeLists.txt b/Visibility_2/test/Visibility_2/CMakeLists.txt index d20d03637f7..211276c3e2a 100644 --- a/Visibility_2/test/Visibility_2/CMakeLists.txt +++ b/Visibility_2/test/Visibility_2/CMakeLists.txt @@ -4,19 +4,13 @@ project( Visibility_2_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - include_directories (BEFORE "../../include") - - include_directories (BEFORE "include") + include_directories (BEFORE "include") # create a target per cppfile file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) diff --git a/Voronoi_diagram_2/doc/Voronoi_diagram_2/CGAL/Apollonius_graph_adaptation_policies_2.h b/Voronoi_diagram_2/doc/Voronoi_diagram_2/CGAL/Apollonius_graph_adaptation_policies_2.h index 046b26390b6..3d70125e062 100644 --- a/Voronoi_diagram_2/doc/Voronoi_diagram_2/CGAL/Apollonius_graph_adaptation_policies_2.h +++ b/Voronoi_diagram_2/doc/Voronoi_diagram_2/CGAL/Apollonius_graph_adaptation_policies_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgVoronoiDiagramAdaptor2Disks +\ingroup PkgVoronoiDiagram2Disks The class `Apollonius_graph_caching_degeneracy_removal_policy_2` provides a model for the `AdaptationPolicy_2` concept. The template parameter of the `Apollonius_graph_caching_degeneracy_removal_policy_2` class must be a @@ -41,7 +41,7 @@ typedef CGAL::Tag_true Has_inserter; namespace CGAL { /*! -\ingroup PkgVoronoiDiagramAdaptor2Disks +\ingroup PkgVoronoiDiagram2Disks The class `Apollonius_graph_degeneracy_removal_policy_2` provides a model for the `AdaptationPolicy_2` concept. The template parameter of the `Apollonius_graph_degeneracy_removal_policy_2` class must be a diff --git a/Voronoi_diagram_2/doc/Voronoi_diagram_2/CGAL/Apollonius_graph_adaptation_traits_2.h b/Voronoi_diagram_2/doc/Voronoi_diagram_2/CGAL/Apollonius_graph_adaptation_traits_2.h index 79fe519a94c..178b18161d1 100644 --- a/Voronoi_diagram_2/doc/Voronoi_diagram_2/CGAL/Apollonius_graph_adaptation_traits_2.h +++ b/Voronoi_diagram_2/doc/Voronoi_diagram_2/CGAL/Apollonius_graph_adaptation_traits_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgVoronoiDiagramAdaptor2Disks +\ingroup PkgVoronoiDiagram2Disks The class `Apollonius_graph_adaptation_traits_2` provides a model for the `AdaptationTraits_2` concept. The template parameter of the `Apollonius_graph_adaptation_traits_2` class must be a diff --git a/Voronoi_diagram_2/doc/Voronoi_diagram_2/CGAL/Delaunay_triangulation_adaptation_policies_2.h b/Voronoi_diagram_2/doc/Voronoi_diagram_2/CGAL/Delaunay_triangulation_adaptation_policies_2.h index 74d53779415..468b5a4e045 100644 --- a/Voronoi_diagram_2/doc/Voronoi_diagram_2/CGAL/Delaunay_triangulation_adaptation_policies_2.h +++ b/Voronoi_diagram_2/doc/Voronoi_diagram_2/CGAL/Delaunay_triangulation_adaptation_policies_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgVoronoiDiagramAdaptor2Points +\ingroup PkgVoronoiDiagram2Points The class `Delaunay_triangulation_caching_degeneracy_removal_policy_2` provides a model for the `AdaptationPolicy_2` concept. The template parameter of the `Delaunay_triangulation_caching_degeneracy_removal_policy_2` class must be a @@ -40,7 +40,7 @@ typedef CGAL::Tag_true Has_inserter; namespace CGAL { /*! -\ingroup PkgVoronoiDiagramAdaptor2Points +\ingroup PkgVoronoiDiagram2Points The class `Delaunay_triangulation_degeneracy_removal_policy_2` provides a model for the `AdaptationPolicy_2` concept. The template parameter of the `Delaunay_triangulation_degeneracy_removal_policy_2` class must be a diff --git a/Voronoi_diagram_2/doc/Voronoi_diagram_2/CGAL/Delaunay_triangulation_adaptation_traits_2.h b/Voronoi_diagram_2/doc/Voronoi_diagram_2/CGAL/Delaunay_triangulation_adaptation_traits_2.h index e95a9b327c9..6c6b0c30b77 100644 --- a/Voronoi_diagram_2/doc/Voronoi_diagram_2/CGAL/Delaunay_triangulation_adaptation_traits_2.h +++ b/Voronoi_diagram_2/doc/Voronoi_diagram_2/CGAL/Delaunay_triangulation_adaptation_traits_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgVoronoiDiagramAdaptor2Points +\ingroup PkgVoronoiDiagram2Points The class `Delaunay_triangulation_adaptation_traits_2` provides a model for the `AdaptationTraits_2` concept. The template parameter of the `Delaunay_triangulation_adaptation_traits_2` class must be a diff --git a/Voronoi_diagram_2/doc/Voronoi_diagram_2/CGAL/Identity_policy_2.h b/Voronoi_diagram_2/doc/Voronoi_diagram_2/CGAL/Identity_policy_2.h index 9360de7f479..4912cf744f0 100644 --- a/Voronoi_diagram_2/doc/Voronoi_diagram_2/CGAL/Identity_policy_2.h +++ b/Voronoi_diagram_2/doc/Voronoi_diagram_2/CGAL/Identity_policy_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgVoronoiDiagramAdaptor2 +\ingroup PkgVoronoiDiagram2Ref The class `Identity_policy_2` provides a model for the `AdaptationPolicy_2` concept. The first template parameter of the `Identity_policy_2` class must be a diff --git a/Voronoi_diagram_2/doc/Voronoi_diagram_2/CGAL/Regular_triangulation_adaptation_policies_2.h b/Voronoi_diagram_2/doc/Voronoi_diagram_2/CGAL/Regular_triangulation_adaptation_policies_2.h index fc6a2f8b332..2b1451083f7 100644 --- a/Voronoi_diagram_2/doc/Voronoi_diagram_2/CGAL/Regular_triangulation_adaptation_policies_2.h +++ b/Voronoi_diagram_2/doc/Voronoi_diagram_2/CGAL/Regular_triangulation_adaptation_policies_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgVoronoiDiagramAdaptor2Points +\ingroup PkgVoronoiDiagram2Points The class `Regular_triangulation_caching_degeneracy_removal_policy_2` provides a model for the `AdaptationPolicy_2` concept. The template parameter of the `Regular_triangulation_caching_degeneracy_removal_policy_2` class must be a @@ -40,7 +40,7 @@ typedef CGAL::Tag_true Has_inserter; namespace CGAL { /*! -\ingroup PkgVoronoiDiagramAdaptor2Points +\ingroup PkgVoronoiDiagram2Points The class `Regular_triangulation_degeneracy_removal_policy_2` provides a model for the `AdaptationPolicy_2` concept. The template parameter of the `Regular_triangulation_degeneracy_removal_policy_2` class must be a diff --git a/Voronoi_diagram_2/doc/Voronoi_diagram_2/CGAL/Regular_triangulation_adaptation_traits_2.h b/Voronoi_diagram_2/doc/Voronoi_diagram_2/CGAL/Regular_triangulation_adaptation_traits_2.h index 294523fdaee..3455fd8d436 100644 --- a/Voronoi_diagram_2/doc/Voronoi_diagram_2/CGAL/Regular_triangulation_adaptation_traits_2.h +++ b/Voronoi_diagram_2/doc/Voronoi_diagram_2/CGAL/Regular_triangulation_adaptation_traits_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgVoronoiDiagramAdaptor2Points +\ingroup PkgVoronoiDiagram2Points The class `Regular_triangulation_adaptation_traits_2` provides a model for the `AdaptationTraits_2` concept. The template parameter of the `Regular_triangulation_adaptation_traits_2` class must be a diff --git a/Voronoi_diagram_2/doc/Voronoi_diagram_2/CGAL/Segment_Delaunay_graph_adaptation_policies_2.h b/Voronoi_diagram_2/doc/Voronoi_diagram_2/CGAL/Segment_Delaunay_graph_adaptation_policies_2.h index 945264b1c92..d9df89b1bef 100644 --- a/Voronoi_diagram_2/doc/Voronoi_diagram_2/CGAL/Segment_Delaunay_graph_adaptation_policies_2.h +++ b/Voronoi_diagram_2/doc/Voronoi_diagram_2/CGAL/Segment_Delaunay_graph_adaptation_policies_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgVoronoiDiagramAdaptor2Segments +\ingroup PkgVoronoiDiagram2Segments The class `Segment_Delaunay_graph_caching_degeneracy_removal_policy_2` provides a model for the `AdaptationPolicy_2` concept. The template parameter of the `Segment_Delaunay_graph_caching_degeneracy_removal_policy_2` class must be a @@ -41,7 +41,7 @@ typedef CGAL::Tag_false Has_inserter; namespace CGAL { /*! -\ingroup PkgVoronoiDiagramAdaptor2Segments +\ingroup PkgVoronoiDiagram2Segments The class `Segment_Delaunay_graph_degeneracy_removal_policy_2` provides a model for the `AdaptationPolicy_2` concept. The template parameter of the `Segment_Delaunay_graph_degeneracy_removal_policy_2` class must be a diff --git a/Voronoi_diagram_2/doc/Voronoi_diagram_2/CGAL/Segment_Delaunay_graph_adaptation_traits_2.h b/Voronoi_diagram_2/doc/Voronoi_diagram_2/CGAL/Segment_Delaunay_graph_adaptation_traits_2.h index 8d7dbe37637..cbac4eec2fd 100644 --- a/Voronoi_diagram_2/doc/Voronoi_diagram_2/CGAL/Segment_Delaunay_graph_adaptation_traits_2.h +++ b/Voronoi_diagram_2/doc/Voronoi_diagram_2/CGAL/Segment_Delaunay_graph_adaptation_traits_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgVoronoiDiagramAdaptor2Segments +\ingroup PkgVoronoiDiagram2Segments The class `Segment_Delaunay_graph_adaptation_traits_2` provides a model for the `AdaptationTraits_2` concept. The template parameter of the `Segment_Delaunay_graph_adaptation_traits_2` class must be a diff --git a/Voronoi_diagram_2/doc/Voronoi_diagram_2/CGAL/Voronoi_diagram_2.h b/Voronoi_diagram_2/doc/Voronoi_diagram_2/CGAL/Voronoi_diagram_2.h index dd98107e487..6f26ea48f7b 100644 --- a/Voronoi_diagram_2/doc/Voronoi_diagram_2/CGAL/Voronoi_diagram_2.h +++ b/Voronoi_diagram_2/doc/Voronoi_diagram_2/CGAL/Voronoi_diagram_2.h @@ -2,7 +2,7 @@ namespace CGAL { /*! -\ingroup PkgVoronoiDiagramAdaptor2 +\ingroup PkgVoronoiDiagram2Ref The class `Voronoi_diagram_2` provides an adaptor that enables us to view a triangulated Delaunay graph as their dual subdivision, the @@ -34,7 +34,7 @@ public: /*! - \ingroup PkgVoronoiDiagramAdaptor2 + \ingroup PkgVoronoiDiagram2Ref The class `Face` is the class provided by the `Voronoi_diagram_2` class for Voronoi faces. Below we @@ -162,7 +162,7 @@ public: /*! - \ingroup PkgVoronoiDiagramAdaptor2 + \ingroup PkgVoronoiDiagram2Ref The class `Halfedge` is the class provided by the `Voronoi_diagram_2` class for Voronoi halfedges. @@ -403,7 +403,7 @@ public: /*! - \ingroup PkgVoronoiDiagramAdaptor2 + \ingroup PkgVoronoiDiagram2Ref The class `Vertex` is the Voronoi vertex class provided by the class `Voronoi_diagram_2` class. Below we present its interface. diff --git a/Voronoi_diagram_2/doc/Voronoi_diagram_2/Concepts/AdaptationPolicy_2.h b/Voronoi_diagram_2/doc/Voronoi_diagram_2/Concepts/AdaptationPolicy_2.h index 10c4036eb60..14ecc82dd4d 100644 --- a/Voronoi_diagram_2/doc/Voronoi_diagram_2/Concepts/AdaptationPolicy_2.h +++ b/Voronoi_diagram_2/doc/Voronoi_diagram_2/Concepts/AdaptationPolicy_2.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgVoronoiDiagramAdaptor2Concepts +\ingroup PkgVoronoiDiagram2Concepts \cgalConcept The concept `AdaptationPolicy_2` defines the requirements on diff --git a/Voronoi_diagram_2/doc/Voronoi_diagram_2/Concepts/AdaptationTraits_2.h b/Voronoi_diagram_2/doc/Voronoi_diagram_2/Concepts/AdaptationTraits_2.h index 55a7c03de6e..ba55c78ede9 100644 --- a/Voronoi_diagram_2/doc/Voronoi_diagram_2/Concepts/AdaptationTraits_2.h +++ b/Voronoi_diagram_2/doc/Voronoi_diagram_2/Concepts/AdaptationTraits_2.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgVoronoiDiagramAdaptor2Concepts +\ingroup PkgVoronoiDiagram2Concepts \cgalConcept The concept `AdaptationTraits_2` defines the functors required for diff --git a/Voronoi_diagram_2/doc/Voronoi_diagram_2/Concepts/DelaunayGraph_2.h b/Voronoi_diagram_2/doc/Voronoi_diagram_2/Concepts/DelaunayGraph_2.h index 47af9baf642..52d1565933c 100644 --- a/Voronoi_diagram_2/doc/Voronoi_diagram_2/Concepts/DelaunayGraph_2.h +++ b/Voronoi_diagram_2/doc/Voronoi_diagram_2/Concepts/DelaunayGraph_2.h @@ -1,6 +1,6 @@ /*! -\ingroup PkgVoronoiDiagramAdaptor2Concepts +\ingroup PkgVoronoiDiagram2Concepts \cgalConcept The concept `DelaunayGraph_2` defines the requirements for the diff --git a/Voronoi_diagram_2/doc/Voronoi_diagram_2/PackageDescription.txt b/Voronoi_diagram_2/doc/Voronoi_diagram_2/PackageDescription.txt index 6c2c370f9ad..20b0c0a0780 100644 --- a/Voronoi_diagram_2/doc/Voronoi_diagram_2/PackageDescription.txt +++ b/Voronoi_diagram_2/doc/Voronoi_diagram_2/PackageDescription.txt @@ -1,26 +1,26 @@ -/// \defgroup PkgVoronoiDiagramAdaptor2 2D Voronoi Diagram Adaptor Reference -/// \defgroup PkgVoronoiDiagramAdaptor2Concepts Concepts -/// \ingroup PkgVoronoiDiagramAdaptor2 +/// \defgroup PkgVoronoiDiagram2Ref 2D Voronoi Diagram Adaptor Reference +/// \defgroup PkgVoronoiDiagram2Concepts Concepts +/// \ingroup PkgVoronoiDiagram2Ref -/// \defgroup PkgVoronoiDiagramAdaptor2Points Voronoi Diagram of Points -/// \ingroup PkgVoronoiDiagramAdaptor2 +/// \defgroup PkgVoronoiDiagram2Points Voronoi Diagram of Points +/// \ingroup PkgVoronoiDiagram2Ref -/// \defgroup PkgVoronoiDiagramAdaptor2Segments Voronoi Diagram of Segments -/// \ingroup PkgVoronoiDiagramAdaptor2 +/// \defgroup PkgVoronoiDiagram2Segments Voronoi Diagram of Segments +/// \ingroup PkgVoronoiDiagram2Ref -/// \defgroup PkgVoronoiDiagramAdaptor2Disks Voronoi Diagram of Disks -/// \ingroup PkgVoronoiDiagramAdaptor2 +/// \defgroup PkgVoronoiDiagram2Disks Voronoi Diagram of Disks +/// \ingroup PkgVoronoiDiagram2Ref /*! -\addtogroup PkgVoronoiDiagramAdaptor2 +\addtogroup PkgVoronoiDiagram2Ref \todo check generated documentation -\cgalPkgDescriptionBegin{2D Voronoi Diagram Adaptor,PkgVoronoiDiagramAdaptor2Summary} +\cgalPkgDescriptionBegin{2D Voronoi Diagram Adaptor,PkgVoronoiDiagram2} \cgalPkgPicture{voronoi.png} \cgalPkgSummaryBegin \cgalPkgAuthor{Menelaos Karavelas} \cgalPkgDesc{The 2D Voronoi diagram adaptor package provides an adaptor that adapts a 2-dimensional triangulated Delaunay graph to the corresponding Voronoi diagram, represented as a doubly connected edge list (DCEL) data structure. The adaptor has the ability to automatically eliminate, in a consistent manner, degenerate features of the Voronoi diagram, that are artifacts of the requirement that Delaunay graphs should be triangulated even in degenerate configurations. Depending on the type of operations that the underlying Delaunay graph supports, the adaptor allows for the incremental or dynamic construction of Voronoi diagrams and can support point location queries. } -\cgalPkgManuals{Chapter_2D_Voronoi_Diagram_Adaptor,PkgVoronoiDiagramAdaptor2} +\cgalPkgManuals{Chapter_2D_Voronoi_Diagram_Adaptor,PkgVoronoiDiagram2Ref} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{3.2} diff --git a/Voronoi_diagram_2/examples/Voronoi_diagram_2/CMakeLists.txt b/Voronoi_diagram_2/examples/Voronoi_diagram_2/CMakeLists.txt index c24339b8d6c..92893d16599 100644 --- a/Voronoi_diagram_2/examples/Voronoi_diagram_2/CMakeLists.txt +++ b/Voronoi_diagram_2/examples/Voronoi_diagram_2/CMakeLists.txt @@ -4,18 +4,12 @@ project( Voronoi_diagram_2_Examples ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - 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}) diff --git a/Voronoi_diagram_2/test/Voronoi_diagram_2/CMakeLists.txt b/Voronoi_diagram_2/test/Voronoi_diagram_2/CMakeLists.txt index 2d5f9f44b9f..6f57717084a 100644 --- a/Voronoi_diagram_2/test/Voronoi_diagram_2/CMakeLists.txt +++ b/Voronoi_diagram_2/test/Voronoi_diagram_2/CMakeLists.txt @@ -4,19 +4,13 @@ project( Voronoi_diagram_2_Tests ) -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.1) find_package(CGAL QUIET) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - include_directories (BEFORE "../../include") - - include_directories (BEFORE "include") + include_directories (BEFORE "include") # create a target per cppfile file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) diff --git a/wininst/developer_scripts/script_cgal.nsi b/wininst/developer_scripts/script_cgal.nsi index 201416d42e4..d31200cb3fb 100644 --- a/wininst/developer_scripts/script_cgal.nsi +++ b/wininst/developer_scripts/script_cgal.nsi @@ -153,6 +153,8 @@ Section "!Main CGAL" MAIN_Idx File /r "${CGAL_SRC}\doc_html\*.*" SetOutPath "$INSTDIR\include" File /r "${CGAL_SRC}\include\*.*" + SetOutPath "$INSTDIR\lib" + File /r "${CGAL_SRC}\lib\*.*" SetOutPath "$INSTDIR\scripts" File /r "${CGAL_SRC}\scripts\*.*" SetOutPath "$INSTDIR\src"