diff --git a/.gitignore b/.gitignore index 44a3f3a6bd0..20228a69fcb 100644 --- a/.gitignore +++ b/.gitignore @@ -1063,7 +1063,7 @@ cmake_install.cmake *~ .#* -# MacOS file http://en.wikipedia.org/wiki/.DS_Store( +# MacOS file https://en.wikipedia.org/wiki/.DS_Store .DS_Store # Binaries: diff --git a/.travis.yml b/.travis.yml index 82227701898..2a75418a55f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,78 +1,79 @@ -language: cpp -dist: xenial -sudo: required -git: - depth: 3 +language: cpp +dist: xenial +sudo: required +git: + depth: 3 env: - matrix: - - PACKAGE='CHECK' - - PACKAGE='AABB_tree Advancing_front_surface_reconstruction Algebraic_foundations ' - - PACKAGE='Algebraic_kernel_d Algebraic_kernel_for_circles Algebraic_kernel_for_spheres ' - - PACKAGE='Alpha_shapes_2 Alpha_shapes_3 Apollonius_graph_2 ' - - PACKAGE='Arithmetic_kernel Arrangement_on_surface_2 Barycentric_coordinates_2 ' - - PACKAGE='BGL Boolean_set_operations_2 Bounding_volumes ' - - PACKAGE='Box_intersection_d Cartesian_kernel CGAL_Core ' - - PACKAGE='CGAL_ImageIO CGAL_ipelets Circular_kernel_2 ' - - PACKAGE='Circular_kernel_3 Circulator Classification ' - - PACKAGE='Combinatorial_map Cone_spanners_2 Convex_decomposition_3 ' - - PACKAGE='Convex_hull_2 Convex_hull_3 Convex_hull_d ' - - PACKAGE='Distance_2 Distance_3 Envelope_2 ' - - PACKAGE='Envelope_3 Filtered_kernel Generalized_map ' - - PACKAGE='Generator Geomview GraphicsView ' - - PACKAGE='HalfedgeDS Hash_map Heat_method_3 ' - - PACKAGE='Homogeneous_kernel Hyperbolic_triangulation_2 Inscribed_areas ' - - PACKAGE='Installation Interpolation Intersections_2 ' - - PACKAGE='Intersections_3 Interval_skip_list Interval_support ' - - PACKAGE='Inventor Jet_fitting_3 Kernel_23 ' - - PACKAGE='Kernel_d LEDA Linear_cell_complex ' - - PACKAGE='MacOSX Maintenance Matrix_search ' - - PACKAGE='Mesh_2 Mesh_3 Mesher_level ' - - PACKAGE='Minkowski_sum_2 Minkowski_sum_3 Modifier ' - - PACKAGE='Modular_arithmetic Nef_2 Nef_3 ' - - PACKAGE='Nef_S2 NewKernel_d Number_types ' - - PACKAGE='OpenNL Optimal_transportation_reconstruction_2 Optimisation_basic ' - - PACKAGE='Partition_2 Periodic_2_triangulation_2 Periodic_3_mesh_3 ' - - PACKAGE='Periodic_3_triangulation_3 Periodic_4_hyperbolic_triangulation_2 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_approximation ' - - 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 ' + matrix: + - PACKAGE='CHECK' + - PACKAGE='AABB_tree Advancing_front_surface_reconstruction Algebraic_foundations ' + - PACKAGE='Algebraic_kernel_d Algebraic_kernel_for_circles Algebraic_kernel_for_spheres ' + - PACKAGE='Alpha_shapes_2 Alpha_shapes_3 Apollonius_graph_2 ' + - PACKAGE='Arithmetic_kernel Arrangement_on_surface_2 Barycentric_coordinates_2 ' + - PACKAGE='BGL Boolean_set_operations_2 Bounding_volumes ' + - PACKAGE='Box_intersection_d Cartesian_kernel CGAL_Core ' + - PACKAGE='CGAL_ImageIO CGAL_ipelets Circular_kernel_2 ' + - PACKAGE='Circular_kernel_3 Circulator Classification ' + - PACKAGE='Combinatorial_map Cone_spanners_2 Convex_decomposition_3 ' + - PACKAGE='Convex_hull_2 Convex_hull_3 Convex_hull_d ' + - PACKAGE='Distance_2 Distance_3 Envelope_2 ' + - PACKAGE='Envelope_3 Filtered_kernel Generalized_map ' + - PACKAGE='Generator Geomview GraphicsView ' + - PACKAGE='HalfedgeDS Hash_map Heat_method_3 ' + - PACKAGE='Homogeneous_kernel Hyperbolic_triangulation_2 Inscribed_areas ' + - PACKAGE='Installation Interpolation Intersections_2 ' + - PACKAGE='Intersections_3 Interval_skip_list Interval_support ' + - PACKAGE='Inventor Jet_fitting_3 Kernel_23 ' + - PACKAGE='Kernel_d LEDA Linear_cell_complex ' + - PACKAGE='MacOSX Maintenance Matrix_search ' + - PACKAGE='Mesh_2 Mesh_3 Mesher_level ' + - PACKAGE='Minkowski_sum_2 Minkowski_sum_3 Modifier ' + - PACKAGE='Modular_arithmetic Nef_2 Nef_3 ' + - PACKAGE='Nef_S2 NewKernel_d Number_types ' + - PACKAGE='OpenNL Optimal_transportation_reconstruction_2 Optimisation_basic ' + - PACKAGE='Partition_2 Periodic_2_triangulation_2 Periodic_3_mesh_3 ' + - PACKAGE='Periodic_3_triangulation_3 Periodic_4_hyperbolic_triangulation_2 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_approximation ' + - 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 ' compiler: clang -install: +install: - echo "$PWD" - if [ -n "$TRAVIS_PULL_REQUEST" ] && [ "$PACKAGE" != CHECK ]; then DO_IGNORE=FALSE; for ARG in $(echo "$PACKAGE");do if [ "$ARG" = "Maintenance" ]; then continue; fi; . $PWD/.travis/test_package.sh "$PWD" "$ARG"; echo "DO_IGNORE is $DO_IGNORE"; if [ "$DO_IGNORE" = "FALSE" ]; then break; fi; done; if [ "$DO_IGNORE" = "TRUE" ]; then travis_terminate 0; fi;fi - - bash .travis/install.sh + - /usr/bin/time -f 'Spend time of %C -- %E (real)' bash .travis/install.sh - export CXX=clang++ CC=clang; -before_script: -- wget -O doxygen_exe https://cgal.geometryfactory.com/~mgimeno/doxygen_exe -- sudo mv doxygen_exe /usr/bin/doxygen -- sudo chmod +x /usr/bin/doxygen -- mkdir -p build -- cd build -- cmake -DCMAKE_CXX_FLAGS="-std=c++11" -DCGAL_HEADER_ONLY=ON -DCMAKE_CXX_FLAGS_RELEASE=-DCGAL_NDEBUG -DWITH_examples=ON -DWITH_demos=ON -DWITH_tests=ON .. -- make -- sudo make install &>/dev/null -- cd .. -script: -- cd ./.travis -- bash ./build_package.sh $PACKAGE +before_script: + - wget -O doxygen_exe https://cgal.geometryfactory.com/~mgimeno/doxygen_exe + - sudo mv doxygen_exe /usr/bin/doxygen + - sudo chmod +x /usr/bin/doxygen + - mkdir -p build + - cd build + - /usr/bin/time -f 'Spend time of %C -- %E (real)' cmake -DCMAKE_CXX_FLAGS="-std=c++11" -DCGAL_HEADER_ONLY=ON -DCMAKE_CXX_FLAGS_RELEASE=-DCGAL_NDEBUG -DWITH_examples=ON -DWITH_demos=ON -DWITH_tests=ON .. + - /usr/bin/time -f 'Spend time of %C -- %E (real)' make + - /usr/bin/time -f 'Spend time of %C -- %E (real)' sudo make install &>/dev/null + - cd .. +script: + - cd ./.travis + - /usr/bin/time -f 'Spend time of %C -- %E (real)' bash ./build_package.sh $PACKAGE notifications: email: - on_success: change # default: always - on_failure: always # default: always - + on_success: change + # default: always + on_failure: always + # default: always diff --git a/.travis/build_package.sh b/.travis/build_package.sh index adfc3bda083..e7bf90935a1 100755 --- a/.travis/build_package.sh +++ b/.travis/build_package.sh @@ -4,11 +4,15 @@ set -e CXX_FLAGS="-DCGAL_NDEBUG -ftemplate-backtrace-limit=0" +function mytime { + /usr/bin/time -f "Spend time of %C: %E (real)" "$@" +} + function build_examples { mkdir -p build-travis cd build-travis - cmake -DCGAL_DIR="/usr/local/lib/cmake/CGAL" -DCMAKE_CXX_FLAGS="${CXX_FLAGS}" .. - make -j2 + mytime cmake -DCGAL_DIR="/usr/local/lib/cmake/CGAL" -DCMAKE_CXX_FLAGS="${CXX_FLAGS}" .. + mytime make -j2 } function build_tests { @@ -24,8 +28,8 @@ function build_demo { EXTRA_CXX_FLAGS="-Werror=inconsistent-missing-override" ;; esac - cmake -DCGAL_DIR="/usr/local/lib/cmake/CGAL" -DCGAL_DONT_OVERRIDE_CMAKE_FLAGS:BOOL=ON -DCMAKE_CXX_FLAGS="${CXX_FLAGS} ${EXTRA_CXX_FLAGS}" .. - make -j2 + mytime cmake -DCGAL_DIR="/usr/local/lib/cmake/CGAL" -DCGAL_DONT_OVERRIDE_CMAKE_FLAGS:BOOL=ON -DCMAKE_CXX_FLAGS="${CXX_FLAGS} ${EXTRA_CXX_FLAGS}" .. + mytime make -j2 } old_IFS=$IFS IFS=$' ' @@ -42,20 +46,20 @@ cd $ROOT [ "$ARG" = Polygon_mesh_processing ] || [ "$ARG" = Property_map ] ||\ [ "$ARG" = Surface_mesh_deformation ] || [ "$ARG" = Surface_mesh_shortest_path ] ||\ [ "$ARG" = Surface_mesh_simplification ]; then - sudo bash .travis/install_openmesh.sh + mytime sudo bash .travis/install_openmesh.sh fi if [ "$ARG" = "CHECK" ] then cd .travis - ./generate_travis.sh --check + mytime ./generate_travis.sh --check cd .. IFS=$old_IFS - zsh $ROOT/Scripts/developer_scripts/test_merge_of_branch HEAD + mytime zsh $ROOT/Scripts/developer_scripts/test_merge_of_branch HEAD #test dependencies cd $ROOT - bash Scripts/developer_scripts/cgal_check_dependencies.sh --check_headers /usr/bin/doxygen + mytime bash Scripts/developer_scripts/cgal_check_dependencies.sh --check_headers /usr/bin/doxygen cd .travis #parse current matrix and check that no package has been forgotten @@ -92,8 +96,8 @@ cd $ROOT cd $ROOT mkdir build_test cd build_test - cmake -DCMAKE_INSTALL_PREFIX=install/ .. - make install + mytime cmake -DCMAKE_INSTALL_PREFIX=install/ .. + mytime make install # test install with minimal downstream example mkdir installtest cd installtest @@ -106,7 +110,7 @@ cd $ROOT echo 'target_link_libraries(${PROJECT_NAME} CGAL::CGAL)' >> CMakeLists.txt echo '#include "CGAL/remove_outliers.h"' >> main.cpp cd build - cmake -DCMAKE_INSTALL_PREFIX=../../install .. + mytime cmake -DCMAKE_INSTALL_PREFIX=../../install .. cd .. exit 0 fi diff --git a/.travis/generate_travis.sh b/.travis/generate_travis.sh index 63a5e1f3705..6f70a2d0eb6 100755 --- a/.travis/generate_travis.sh +++ b/.travis/generate_travis.sh @@ -41,19 +41,19 @@ old_IFS=$IFS IFS=$'\n' for LINE in $(cat "$PWD/.travis/template.txt") do - if [ "$LINE" != " matrix:" ] + if [ "$LINE" != " matrix:" ] then echo "$LINE" >> .travis.yml else break fi done -echo " matrix: " >> .travis.yml +echo " matrix:" >> .travis.yml #writes the matrix -echo " - PACKAGE='CHECK' " >> .travis.yml +echo " - PACKAGE='CHECK'" >> .travis.yml for package in ${PACKAGES[@]} do -echo " - PACKAGE='$package' " >> .travis.yml +echo " - PACKAGE='$package'" >> .travis.yml done #writes the end of the file @@ -69,7 +69,6 @@ do echo "$LINE" >> .travis.yml fi done -echo "" >> .travis.yml IFS=$' ' #check if there are differences between the files if ! cmp -s ./.travis.yml ./.travis.old; diff --git a/.travis/template.txt b/.travis/template.txt index 97662bb5b89..0958db78412 100644 --- a/.travis/template.txt +++ b/.travis/template.txt @@ -1,33 +1,34 @@ -language: cpp -dist: xenial -sudo: required -git: - depth: 3 +language: cpp +dist: xenial +sudo: required +git: + depth: 3 env: - matrix: + matrix: PACKAGES_MATRIX compiler: clang -install: +install: - echo "$PWD" - if [ -n "$TRAVIS_PULL_REQUEST" ] && [ "$PACKAGE" != CHECK ]; then DO_IGNORE=FALSE; for ARG in $(echo "$PACKAGE");do if [ "$ARG" = "Maintenance" ]; then continue; fi; . $PWD/.travis/test_package.sh "$PWD" "$ARG"; echo "DO_IGNORE is $DO_IGNORE"; if [ "$DO_IGNORE" = "FALSE" ]; then break; fi; done; if [ "$DO_IGNORE" = "TRUE" ]; then travis_terminate 0; fi;fi - - bash .travis/install.sh + - /usr/bin/time -f 'Spend time of %C -- %E (real)' bash .travis/install.sh - export CXX=clang++ CC=clang; -before_script: -- wget -O doxygen_exe https://cgal.geometryfactory.com/~mgimeno/doxygen_exe -- sudo mv doxygen_exe /usr/bin/doxygen -- sudo chmod +x /usr/bin/doxygen -- mkdir -p build -- cd build -- cmake -DCMAKE_CXX_FLAGS="-std=c++11" -DCGAL_HEADER_ONLY=ON -DCMAKE_CXX_FLAGS_RELEASE=-DCGAL_NDEBUG -DWITH_examples=ON -DWITH_demos=ON -DWITH_tests=ON .. -- make -- sudo make install &>/dev/null -- cd .. -script: -- cd ./.travis -- bash ./build_package.sh $PACKAGE +before_script: + - wget -O doxygen_exe https://cgal.geometryfactory.com/~mgimeno/doxygen_exe + - sudo mv doxygen_exe /usr/bin/doxygen + - sudo chmod +x /usr/bin/doxygen + - mkdir -p build + - cd build + - /usr/bin/time -f 'Spend time of %C -- %E (real)' cmake -DCMAKE_CXX_FLAGS="-std=c++11" -DCGAL_HEADER_ONLY=ON -DCMAKE_CXX_FLAGS_RELEASE=-DCGAL_NDEBUG -DWITH_examples=ON -DWITH_demos=ON -DWITH_tests=ON .. + - /usr/bin/time -f 'Spend time of %C -- %E (real)' make + - /usr/bin/time -f 'Spend time of %C -- %E (real)' sudo make install &>/dev/null + - cd .. +script: + - cd ./.travis + - /usr/bin/time -f 'Spend time of %C -- %E (real)' bash ./build_package.sh $PACKAGE notifications: email: - on_success: change # default: always - on_failure: always # default: always - + on_success: change + # default: always + on_failure: always + # default: always diff --git a/.travis/test_package.sh b/.travis/test_package.sh index 4f0bdd87b95..c1c7ba238cc 100644 --- a/.travis/test_package.sh +++ b/.travis/test_package.sh @@ -9,7 +9,7 @@ if [ ! -f "$2/package_info/$2/dependencies" ];then echo "No dependencies found for $2" exit 1 fi -LIST_OF_FILES=$(git diff --name-only origin/master |cut -d/ -f1 |uniq |sort) +LIST_OF_FILES=$(git diff --name-only origin/master... |cut -d/ -f1 |uniq |sort) LIST_OF_DEPS=$(cat "$2/package_info/$2/dependencies") echo "$LIST_OF_DEPS" for flie in $LIST_OF_DEPS diff --git a/AABB_tree/examples/AABB_tree/AABB_cached_bbox_example.cpp b/AABB_tree/examples/AABB_tree/AABB_cached_bbox_example.cpp index 76c4e19357f..c02b622a1c7 100644 --- a/AABB_tree/examples/AABB_tree/AABB_cached_bbox_example.cpp +++ b/AABB_tree/examples/AABB_tree/AABB_cached_bbox_example.cpp @@ -64,7 +64,7 @@ void surface_mesh_cache_bbox(const char* fname) t.start(); Bbox_pmap bb = tmesh.add_property_map("f:bbox",Bbox_3()).first; - BOOST_FOREACH(face_descriptor fd, faces(tmesh)){ + for(face_descriptor fd : faces(tmesh)){ put(bb, fd, bbox(fd,tmesh)); } Traits traits(bb); diff --git a/AABB_tree/examples/AABB_tree/AABB_ray_shooting_example.cpp b/AABB_tree/examples/AABB_tree/AABB_ray_shooting_example.cpp index c06e26e0dc5..5ce92466ed1 100644 --- a/AABB_tree/examples/AABB_tree/AABB_ray_shooting_example.cpp +++ b/AABB_tree/examples/AABB_tree/AABB_ray_shooting_example.cpp @@ -51,7 +51,7 @@ int main(int argc, char* argv[]) double d = CGAL::Polygon_mesh_processing::is_outward_oriented(mesh)?-1:1; - BOOST_FOREACH(face_descriptor fd, faces(mesh)){ + for(face_descriptor fd : faces(mesh)){ halfedge_descriptor hd = halfedge(fd,mesh); Point p = CGAL::centroid(mesh.point(source(hd,mesh)), mesh.point(target(hd,mesh)), diff --git a/AABB_tree/include/CGAL/AABB_traits.h b/AABB_tree/include/CGAL/AABB_traits.h index a3e20752516..92c42070c4c 100644 --- a/AABB_tree/include/CGAL/AABB_traits.h +++ b/AABB_tree/include/CGAL/AABB_traits.h @@ -60,41 +60,10 @@ template struct AABB_traits_base{ typename Primitive::Shared_data m_primitive_data; - #if !defined(CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES) && !defined(CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE) template void set_shared_data(T&& ... t){ m_primitive_data=Primitive::construct_shared_data(std::forward(t)...); } - #else - void set_shared_data(){ - m_primitive_data=Primitive::construct_shared_data(); - } - - template - void set_shared_data(T1& t1){ - m_primitive_data=Primitive::construct_shared_data(t1); - } - - template - void set_shared_data(T1& t1, T2& t2){ - m_primitive_data=Primitive::construct_shared_data(t1,t2); - } - - template - void set_shared_data(T1& t1,T2& t2,T3& t3){ - m_primitive_data=Primitive::construct_shared_data(t1,t2,t3); - } - - template - void set_shared_data(T1& t1,T2& t2,T3& t3,T4& t4){ - m_primitive_data=Primitive::construct_shared_data(t1,t2,t3,t4); - } - - template - void set_shared_data(T1& t1,T2& t2,T3& t3,T4& t4,T5& t5){ - m_primitive_data=Primitive::construct_shared_data(t1,t2,t3,t4,t5); - } - #endif const typename Primitive::Shared_data& shared_data() const {return m_primitive_data;} }; @@ -396,20 +365,6 @@ public: public: Intersection(const AABB_traits& traits) :m_traits(traits) {} - #if CGAL_INTERSECTION_VERSION < 2 - template - boost::optional - operator()(const Query& query, const typename AT::Primitive& primitive) const - { - typedef boost::optional Intersection; - - CGAL::Object object = GeomTraits().intersect_3_object()(internal::Primitive_helper::get_datum(primitive,m_traits),query); - if ( object.empty() ) - return Intersection(); - else - return Intersection(Object_and_primitive_id(object,primitive.id())); - } - #else template boost::optional< typename Intersection_and_primitive_id::Type > operator()(const Query& query, const typename AT::Primitive& primitive) const { @@ -419,7 +374,6 @@ public: return boost::none; return boost::make_optional( std::make_pair(*inter_res, primitive.id()) ); } - #endif }; Intersection intersection_object() const {return Intersection(*this);} diff --git a/AABB_tree/include/CGAL/AABB_tree.h b/AABB_tree/include/CGAL/AABB_tree.h index 50600ec6944..b57f0260a05 100644 --- a/AABB_tree/include/CGAL/AABB_tree.h +++ b/AABB_tree/include/CGAL/AABB_tree.h @@ -126,27 +126,10 @@ namespace CGAL { * @param beyond past-the-end iterator * * It is equivalent to constructing an empty tree and calling `insert(first,last,t...)`. - * For compilers that do not support variadic templates, overloads up to - * 5 template arguments are provided. * The tree stays empty if the memory allocation is not successful. */ - #if !defined(CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES) && !defined(CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE) template AABB_tree(InputIterator first, InputIterator beyond,T&& ...); - #else - template - AABB_tree(InputIterator first, InputIterator beyond); - template - AABB_tree(InputIterator first, InputIterator beyond, T1&); - template - AABB_tree(InputIterator first, InputIterator beyond,T1&,T2&); - template - AABB_tree(InputIterator first, InputIterator beyond,T1&,T2&,T3&); - template - AABB_tree(InputIterator first, InputIterator beyond,T1&,T2&,T3&,T4&); - template - AABB_tree(InputIterator first, InputIterator beyond,T1&,T2&,T3&,T4&,T5&); - #endif /// After one or more calls to `insert()` the internal data /// structure of the tree must be reconstructed. This procedure @@ -158,26 +141,10 @@ namespace CGAL { /// 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&& ...); #ifndef DOXYGEN_RUNNING void build(); -#endif -#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 ///@} @@ -185,25 +152,8 @@ namespace CGAL { ///@{ /// Equivalent to calling `clear()` and then `insert(first,last,t...)`. - /// 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 rebuild(ConstPrimitiveIterator first, ConstPrimitiveIterator beyond,T&& ...); - #else - template - void rebuild(ConstPrimitiveIterator first, ConstPrimitiveIterator beyond); - template - void rebuild(ConstPrimitiveIterator first, ConstPrimitiveIterator beyond, T1&); - template - void rebuild(ConstPrimitiveIterator first, ConstPrimitiveIterator beyond,T1&,T2&); - template - void rebuild(ConstPrimitiveIterator first, ConstPrimitiveIterator beyond,T1&,T2&,T3&); - template - void rebuild(ConstPrimitiveIterator first, ConstPrimitiveIterator beyond,T1&,T2&,T3&,T4&); - template - void rebuild(ConstPrimitiveIterator first, ConstPrimitiveIterator beyond,T1&,T2&,T3&,T4&,T5&); - #endif /// Add a sequence of primitives to the set of primitives of the AABB tree. @@ -212,25 +162,8 @@ namespace CGAL { /// `Primitive(%InputIterator, T...)`. If `Primitive` is a model of the concept /// `AABBPrimitiveWithSharedData`, 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 insert(InputIterator first, InputIterator beyond,T&& ...); - #else - template - void insert(InputIterator first, InputIterator beyond); - template - void insert(InputIterator first, InputIterator beyond,T1&); - template - void insert(InputIterator first, InputIterator beyond,T1&, T2&); - template - void insert(InputIterator first, InputIterator beyond,T1&,T2&,T3&); - template - void insert(InputIterator first, InputIterator beyond,T1&,T2&,T3&,T4&); - template - void insert(InputIterator first, InputIterator beyond,T1&,T2&,T3&,T4&,T5&); - #endif /// Adds a primitive to the set of primitives of the tree. inline void insert(const Primitive& p); @@ -274,7 +207,6 @@ namespace CGAL { ///@} private: - #if !defined(CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES) && !defined(CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE) template void set_primitive_data_impl(CGAL::Boolean_tag,T ... ){} template @@ -285,64 +217,6 @@ namespace CGAL { void set_shared_data(T&& ...t){ set_primitive_data_impl(CGAL::Boolean_tag::value>(),std::forward(t)...); } - #else - void set_primitive_data_impl(CGAL::Boolean_tag){} - void set_primitive_data_impl(CGAL::Boolean_tag) - {m_traits.set_shared_data();} - void set_shared_data(){ - set_primitive_data_impl(CGAL::Boolean_tag::value>()); - } - - template - void set_primitive_data_impl(CGAL::Boolean_tag,T1){} - template - void set_primitive_data_impl(CGAL::Boolean_tag,T1& t1) - {m_traits.set_shared_data(t1);} - template - void set_shared_data(T1& t1){ - set_primitive_data_impl(Boolean_tag::value>(),t1); - } - - template - void set_primitive_data_impl(CGAL::Boolean_tag,T1,T2){} - template - void set_primitive_data_impl(CGAL::Boolean_tag,T1& t1,T2& t2) - {m_traits.set_shared_data(t1,t2);} - template - void set_shared_data(const T1& t1,const T2& t2){ - set_primitive_data_impl(Boolean_tag::value>(),t1,t2); - } - - template - void set_primitive_data_impl(CGAL::Boolean_tag,T1,T2,T3){} - template - void set_primitive_data_impl(CGAL::Boolean_tag,T1& t1,T2& t2,T3& t3) - {m_traits.set_shared_data(t1,t2,t3);} - template - void set_shared_data(T1& t1,T2& t2,T3& t3){ - set_primitive_data_impl(Boolean_tag::value>(),t1,t2,t3); - } - - template - void set_primitive_data_impl(CGAL::Boolean_tag,T1,T2,T3,T4){} - template - void set_primitive_data_impl(CGAL::Boolean_tag,T1& t1,T2& t2,T3& t3,T4& t4) - {m_traits.set_shared_data(t1,t2,t3,t4);} - template - void set_shared_data(T1& t1,T2& t2,T3& t3,T4& t4){ - set_primitive_data_impl(Boolean_tag::value>(),t1,t2,t3,t4); - } - - template - void set_primitive_data_impl(CGAL::Boolean_tag,T1,T2,T3,T4,T5){} - template - void set_primitive_data_impl(CGAL::Boolean_tag,T1& t1,T2& t2,T3& t3,T4& t4,T5& t5) - {m_traits.set_shared_data(t1,t2,t3,t4,t5);} - template - void set_shared_data(T1& t1,T2& t2,T3& t3,T4& t4,T5& t5){ - set_primitive_data_impl(Boolean_tag::value>(),t1,t2,t3,t4,t5); - } - #endif bool build_kd_tree() const; template @@ -410,11 +284,7 @@ public: /// for which `do_intersect` predicates /// and intersections are defined in the traits class AABBTraits. template - #if CGAL_INTERSECTION_VERSION < 2 && !defined(DOXYGEN_RUNNING) - boost::optional - #else boost::optional< typename Intersection_and_primitive_id::Type > - #endif any_intersection(const Query& query) const; @@ -744,7 +614,6 @@ public: , m_need_build(false) {} - #if !defined(CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES) && !defined(CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE) template template AABB_tree::AABB_tree(ConstPrimitiveIterator first, @@ -800,324 +669,6 @@ public: set_shared_data(std::forward(t)...); build(); } - #else - //=============constructor====================== - template - template - AABB_tree::AABB_tree(ConstPrimitiveIterator first, - ConstPrimitiveIterator beyond) - : m_traits() - , m_primitives() - , m_p_root_node(NULL) - , m_p_search_tree(NULL) - , m_search_tree_constructed(false) - , m_default_search_tree_constructed(false) - , m_need_build(false) - { - // Insert each primitive into tree - insert(first, beyond); - } - - template - template - AABB_tree::AABB_tree(ConstPrimitiveIterator first, - ConstPrimitiveIterator beyond, - T1& t1) - : m_traits() - , m_primitives() - , m_p_root_node(NULL) - , m_p_search_tree(NULL) - , m_search_tree_constructed(false) - , m_default_search_tree_constructed(false) - , m_need_build(false) - { - // Insert each primitive into tree - insert(first, beyond,t1); - } - - template - template - AABB_tree::AABB_tree(ConstPrimitiveIterator first, - ConstPrimitiveIterator beyond, - T1& t1,T2& t2) - : m_traits() - , m_primitives() - , m_p_root_node(NULL) - , m_p_search_tree(NULL) - , m_search_tree_constructed(false) - , m_default_search_tree_constructed(false) - , m_need_build(false) - { - // Insert each primitive into tree - insert(first, beyond,t1,t2); - } - - template - template - AABB_tree::AABB_tree(ConstPrimitiveIterator first, - ConstPrimitiveIterator beyond, - T1& t1,T2& t2,T3& t3) - : m_traits() - , m_primitives() - , m_p_root_node(NULL) - , m_p_search_tree(NULL) - , m_search_tree_constructed(false) - , m_default_search_tree_constructed(false) - , m_need_build(false) - { - // Insert each primitive into tree - insert(first, beyond,t1,t2,t3); - } - - template - template - AABB_tree::AABB_tree(ConstPrimitiveIterator first, - ConstPrimitiveIterator beyond, - T1& t1,T2& t2,T3& t3,T4& t4) - : m_traits() - , m_primitives() - , m_p_root_node(NULL) - , m_p_search_tree(NULL) - , m_search_tree_constructed(false) - , m_default_search_tree_constructed(false) - , m_need_build(false) - { - // Insert each primitive into tree - insert(first, beyond,t1,t2,t3,t4); - } - - template - template - AABB_tree::AABB_tree(ConstPrimitiveIterator first, - ConstPrimitiveIterator beyond, - T1& t1,T2& t2,T3& t3,T4& t4,T5& t5) - : m_traits() - , m_primitives() - , m_p_root_node(NULL) - , m_p_search_tree(NULL) - , m_search_tree_constructed(false) - , m_default_search_tree_constructed(false) - , m_need_build(false) - { - // Insert each primitive into tree - insert(first, beyond,t1,t2,t3,t4,t5); - } - //=============insert====================== - template - template - void AABB_tree::insert(ConstPrimitiveIterator first, - ConstPrimitiveIterator beyond) - { - set_shared_data(); - while(first != beyond) - { - m_primitives.push_back(Primitive(first)); - ++first; - } - m_need_build = true; - } - - template - template - void AABB_tree::insert(ConstPrimitiveIterator first, - ConstPrimitiveIterator beyond, - T1& t1) - { - set_shared_data(t1); - while(first != beyond) - { - m_primitives.push_back(Primitive(first,t1)); - ++first; - } - m_need_build = true; - } - - template - template - void AABB_tree::insert(ConstPrimitiveIterator first, - ConstPrimitiveIterator beyond, - T1& t1, T2& t2) - { - set_shared_data(t1,t2); - while(first != beyond) - { - m_primitives.push_back(Primitive(first,t1,t2)); - ++first; - } - m_need_build = true; - } - - template - template - void AABB_tree::insert(ConstPrimitiveIterator first, - ConstPrimitiveIterator beyond, - T1& t1,T2& t2,T3& t3) - { - set_shared_data(t1,t2,t3); - while(first != beyond) - { - m_primitives.push_back(Primitive(first,t1,t2,t3)); - ++first; - } - m_need_build = true; - } - - template - template - void AABB_tree::insert(ConstPrimitiveIterator first, - ConstPrimitiveIterator beyond, - T1& t1,T2& t2,T3& t3,T4& t4) - { - set_shared_data(t1,t2,t3,t4); - while(first != beyond) - { - m_primitives.push_back(Primitive(first,t1,t2,t3,t4)); - ++first; - } - m_need_build = true; - } - - template - template - void AABB_tree::insert(ConstPrimitiveIterator first, - ConstPrimitiveIterator beyond, - T1& t1,T2& t2,T3& t3,T4& t4,T5& t5) - { - set_shared_data(t1,t2,t3,t4,t5); - while(first != beyond) - { - m_primitives.push_back(Primitive(first,t1,t2,t3,t4,t5)); - ++first; - } - m_need_build = true; - } - - //=============rebuild====================== - template - template - void AABB_tree::rebuild(ConstPrimitiveIterator first, - ConstPrimitiveIterator beyond) - { - // cleanup current tree and internal KD tree - clear(); - - // inserts primitives - insert(first, beyond); - - build(); - } - - template - template - void AABB_tree::rebuild(ConstPrimitiveIterator first, - ConstPrimitiveIterator beyond, - T1& t1) - { - // cleanup current tree and internal KD tree - clear(); - - // inserts primitives - insert(first, beyond,t1); - - build(); - } - - template - template - void AABB_tree::rebuild(ConstPrimitiveIterator first, - ConstPrimitiveIterator beyond, - T1& t1, T2& t2) - { - // cleanup current tree and internal KD tree - clear(); - - // inserts primitives - insert(first, beyond,t1,t2); - - build(); - } - - template - template - void AABB_tree::rebuild(ConstPrimitiveIterator first, - ConstPrimitiveIterator beyond, - T1& t1,T2& t2,T3& t3) - { - // cleanup current tree and internal KD tree - clear(); - - // inserts primitives - insert(first, beyond,t1,t2,t3); - - build(); - } - - template - template - void AABB_tree::rebuild(ConstPrimitiveIterator first, - ConstPrimitiveIterator beyond, - T1& t1,T2& t2,T3& t3,T4& t4) - { - // cleanup current tree and internal KD tree - clear(); - - // inserts primitives - insert(first, beyond,t1,t2,t3,t4); - - build(); - } - - template - template - void AABB_tree::rebuild(ConstPrimitiveIterator first, - ConstPrimitiveIterator beyond, - T1& t1,T2& t2,T3& t3,T4& t4,T5& t5) - { - // cleanup current tree and internal KD tree - clear(); - - // inserts primitives - insert(first, beyond,t1,t2,t3,t4,t5); - - build(); - } - //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) @@ -1291,11 +842,7 @@ public: template template - #if CGAL_INTERSECTION_VERSION < 2 - boost::optional::Object_and_primitive_id> - #else boost::optional< typename AABB_tree::template Intersection_and_primitive_id::Type > - #endif AABB_tree::any_intersection(const Query& query) const { using namespace CGAL::internal::AABB_tree; diff --git a/AABB_tree/include/CGAL/internal/AABB_tree/AABB_ray_intersection.h b/AABB_tree/include/CGAL/internal/AABB_tree/AABB_ray_intersection.h index ccebce05bb8..52b8d879e64 100644 --- a/AABB_tree/include/CGAL/internal/AABB_tree/AABB_ray_intersection.h +++ b/AABB_tree/include/CGAL/internal/AABB_tree/AABB_ray_intersection.h @@ -188,7 +188,14 @@ private: struct as_ray_param_visitor { typedef FT result_type; - as_ray_param_visitor(const Ray* ray) : ray(ray) {} + as_ray_param_visitor(const Ray* ray) + : ray(ray), max_i(0) + { + typename AABB_traits::Geom_traits::Vector_3 v = ray->to_vector(); + for (int i=1; i<3; ++i) + if( CGAL::abs(v[i]) > CGAL::abs(v[max_i]) ) + max_i = i; + } template FT operator()(const T& s) @@ -204,16 +211,11 @@ private: typename AABB_traits::Geom_traits::Vector_3 x(ray->source(), point); typename AABB_traits::Geom_traits::Vector_3 v = ray->to_vector(); - for(int i = 0; i < 3; ++i) { - if(v[i] != FT(0.)) { - return x[i] / v[i]; - } - } - CGAL_assertion(false); // should never end-up here - return FT(0.); + return x[max_i] / v[max_i]; } const Ray* ray; + int max_i; }; }; diff --git a/AABB_tree/include/CGAL/internal/AABB_tree/AABB_search_tree.h b/AABB_tree/include/CGAL/internal/AABB_tree/AABB_search_tree.h index b02bb264fb2..214a8d2644a 100644 --- a/AABB_tree/include/CGAL/internal/AABB_tree/AABB_search_tree.h +++ b/AABB_tree/include/CGAL/internal/AABB_tree/AABB_search_tree.h @@ -65,9 +65,7 @@ namespace CGAL m_id = rhs.m_id; } -#ifndef CGAL_CFG_NO_CPP0X_DELETED_AND_DEFAULT_FUNCTIONS Decorated_point& operator=(const Decorated_point&)=default; -#endif private: Id m_id; diff --git a/AABB_tree/include/CGAL/internal/AABB_tree/AABB_traversal_traits.h b/AABB_tree/include/CGAL/internal/AABB_tree/AABB_traversal_traits.h index b6b2e8057bc..fe3d9738884 100644 --- a/AABB_tree/include/CGAL/internal/AABB_tree/AABB_traversal_traits.h +++ b/AABB_tree/include/CGAL/internal/AABB_tree/AABB_traversal_traits.h @@ -78,11 +78,7 @@ class First_intersection_traits public: typedef - #if CGAL_INTERSECTION_VERSION < 2 - boost::optional - #else boost::optional< typename AABBTraits::template Intersection_and_primitive_id::Type > - #endif Result; public: First_intersection_traits(const AABBTraits& traits) @@ -137,11 +133,7 @@ public: void intersection(const Query& query, const Primitive& primitive) { - #if CGAL_INTERSECTION_VERSION < 2 - boost::optional - #else boost::optional< typename AABBTraits::template Intersection_and_primitive_id::Type > - #endif intersection = m_traits.intersection_object()(query, primitive); if(intersection) diff --git a/AABB_tree/test/AABB_tree/AABB_test_util.h b/AABB_tree/test/AABB_tree/AABB_test_util.h index ef9cbc59f4a..14bc9811101 100644 --- a/AABB_tree/test/AABB_tree/AABB_test_util.h +++ b/AABB_tree/test/AABB_tree/AABB_test_util.h @@ -104,17 +104,9 @@ void test_all_intersection_query_types(Tree& tree) tree.all_intersected_primitives(segment,std::back_inserter(primitives)); // any_intersection - #if CGAL_INTERSECTION_VERSION < 2 - typedef typename Tree::Object_and_primitive_id Object_and_primitive_id; - boost::optional optional_object_and_primitive; - optional_object_and_primitive = tree.any_intersection(ray); - optional_object_and_primitive = tree.any_intersection(line); - optional_object_and_primitive = tree.any_intersection(segment); - #else boost::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id::Type > r = tree.any_intersection(ray); boost::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id::Type > l = tree.any_intersection(line); boost::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id::Type > s = tree.any_intersection(segment); - #endif // any_intersected_primitive boost::optional optional_primitive; @@ -123,19 +115,12 @@ void test_all_intersection_query_types(Tree& tree) optional_primitive = tree.any_intersected_primitive(segment); // all_intersections - #if CGAL_INTERSECTION_VERSION < 2 - std::list intersections; - tree.all_intersections(ray,std::back_inserter(intersections)); - tree.all_intersections(line,std::back_inserter(intersections)); - tree.all_intersections(segment,std::back_inserter(intersections)); - #else std::list< boost::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id::Type > > intersections_r; std::list< boost::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id::Type > > intersections_l; std::list< boost::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id::Type > > intersections_s; tree.all_intersections(ray,std::back_inserter(intersections_r)); tree.all_intersections(line,std::back_inserter(intersections_l)); tree.all_intersections(segment,std::back_inserter(intersections_s)); - #endif } @@ -404,13 +389,8 @@ public: Polyhedron_primitive_iterator it = Pr_generator().begin(p); for ( ; it != Pr_generator().end(p) ; ++it ) { - #if CGAL_INTERSECTION_VERSION < 2 - Intersection_result - intersection = Traits().intersection_object()(query, Pr(it,p)); - #else boost::optional< typename Traits::template Intersection_and_primitive_id::Type > intersection = m_traits.intersection_object()(query, Pr(it,p)); - #endif if ( intersection ) *out++ = *intersection; } @@ -717,11 +697,7 @@ private: const Naive_implementation& naive) const { typedef - #if CGAL_INTERSECTION_VERSION < 2 - Object_and_primitive_id - #else typename Tree::AABB_traits::template Intersection_and_primitive_id::Type - #endif Obj_type; typedef @@ -759,11 +735,7 @@ private: } // Any intersection test (do not count time here) - #if CGAL_INTERSECTION_VERSION < 2 - boost::optional - #else boost::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id::Type > - #endif intersection = tree.any_intersection(query); // Check: verify we do get the result by naive method diff --git a/AABB_tree/test/AABB_tree/aabb_any_all_benchmark.cpp b/AABB_tree/test/AABB_tree/aabb_any_all_benchmark.cpp index 394bce109b5..fbd3d215a96 100644 --- a/AABB_tree/test/AABB_tree/aabb_any_all_benchmark.cpp +++ b/AABB_tree/test/AABB_tree/aabb_any_all_benchmark.cpp @@ -1,5 +1,3 @@ -#define CGAL_INTERSECTION_VERSION 2 - #include #include #include @@ -40,11 +38,7 @@ struct FilterP { template std::size_t intersect(ForwardIterator b, ForwardIterator e, const Tree& tree, long& counter) { typedef -#if CGAL_INTERSECTION_VERSION < 2 - typename Tree::Object_and_primitive_id -#else typename Tree::AABB_traits::template Intersection_and_primitive_id::Type -#endif Obj_type; std::vector v; @@ -84,7 +78,7 @@ boost::tuple test(const char* name) std::vector points; points.reserve(elements * 2); - CGAL::cpp11::copy_n(g, elements * 2, std::back_inserter(points)); + std::copy_n(g, elements * 2, std::back_inserter(points)); // generate a bunch of happy random primitives std::vector lines; diff --git a/AABB_tree/test/AABB_tree/aabb_naive_vs_tree_distance_triangle_test.cpp b/AABB_tree/test/AABB_tree/aabb_naive_vs_tree_distance_triangle_test.cpp index 04f6bbfbb8c..e1383eec8fa 100644 --- a/AABB_tree/test/AABB_tree/aabb_naive_vs_tree_distance_triangle_test.cpp +++ b/AABB_tree/test/AABB_tree/aabb_naive_vs_tree_distance_triangle_test.cpp @@ -24,8 +24,6 @@ // //****************************************************************************** -#define CGAL_INTERSECTION_VERSION 1 - #include #include diff --git a/AABB_tree/test/AABB_tree/aabb_naive_vs_tree_triangle_test.cpp b/AABB_tree/test/AABB_tree/aabb_naive_vs_tree_triangle_test.cpp index 0035f0b5259..c15c304361c 100644 --- a/AABB_tree/test/AABB_tree/aabb_naive_vs_tree_triangle_test.cpp +++ b/AABB_tree/test/AABB_tree/aabb_naive_vs_tree_triangle_test.cpp @@ -24,8 +24,6 @@ // //****************************************************************************** -#define CGAL_INTERSECTION_VERSION 2 - #include #include diff --git a/AABB_tree/test/AABB_tree/aabb_test_ray_intersection.cpp b/AABB_tree/test/AABB_tree/aabb_test_ray_intersection.cpp index 549f925fb9e..06adc76dae7 100644 --- a/AABB_tree/test/AABB_tree/aabb_test_ray_intersection.cpp +++ b/AABB_tree/test/AABB_tree/aabb_test_ray_intersection.cpp @@ -109,8 +109,8 @@ int main() const double r = max_extent / 2; // Generate NB_RAYS*2 points that lie on a sphere of radius r, centered around bbox_center CGAL::Random rand = CGAL::Random(23); // fix the seed to yield the same results each run - CGAL::cpp11::copy_n(CGAL::Random_points_on_sphere_3(r, rand), NB_RAYS, std::back_inserter(v1)); - CGAL::cpp11::copy_n(CGAL::Random_points_on_sphere_3(r, rand), NB_RAYS, std::back_inserter(v2)); + std::copy_n(CGAL::Random_points_on_sphere_3(r, rand), NB_RAYS, std::back_inserter(v1)); + std::copy_n(CGAL::Random_points_on_sphere_3(r, rand), NB_RAYS, std::back_inserter(v2)); for(std::vector::iterator it = v1.begin(); it != v1.end(); ++it) { *it = *it + bbox_center; diff --git a/Advancing_front_surface_reconstruction/examples/Advancing_front_surface_reconstruction/boundaries.cpp b/Advancing_front_surface_reconstruction/examples/Advancing_front_surface_reconstruction/boundaries.cpp index 7e4d85e2371..e123bce9156 100644 --- a/Advancing_front_surface_reconstruction/examples/Advancing_front_surface_reconstruction/boundaries.cpp +++ b/Advancing_front_surface_reconstruction/examples/Advancing_front_surface_reconstruction/boundaries.cpp @@ -2,7 +2,6 @@ #include #include #include -#include struct Perimeter { @@ -64,15 +63,15 @@ int main(int argc, char* argv[]) reconstruction.run(); std::cout << reconstruction.number_of_outliers() << " outliers:\n" << std::endl; - BOOST_FOREACH(const Point_3& p, reconstruction.outliers()){ + for(const Point_3& p : reconstruction.outliers()){ std::cout << p << std::endl; } std::cout << "Boundaries:" << std::endl ; - BOOST_FOREACH(const Vertex_on_boundary_range & vobr, reconstruction.boundaries()){ + for(const Vertex_on_boundary_range& vobr : reconstruction.boundaries()){ std::cout << "boundary\n"; - // As we use BOOST_FOREACH we do not use the type Boundary_range - BOOST_FOREACH(Vertex_handle v, vobr){ + // As we use range-base loop we do not use the type Boundary_range + for(Vertex_handle v : vobr){ std::cout << v->point() << std::endl; } } diff --git a/Advancing_front_surface_reconstruction/examples/Advancing_front_surface_reconstruction/reconstruction_fct.cpp b/Advancing_front_surface_reconstruction/examples/Advancing_front_surface_reconstruction/reconstruction_fct.cpp index b9f31a3707f..f3b259d80e4 100644 --- a/Advancing_front_surface_reconstruction/examples/Advancing_front_surface_reconstruction/reconstruction_fct.cpp +++ b/Advancing_front_surface_reconstruction/examples/Advancing_front_surface_reconstruction/reconstruction_fct.cpp @@ -9,7 +9,7 @@ typedef CGAL::Simple_cartesian K; typedef K::Point_3 Point_3; -typedef CGAL::cpp11::array Facet; +typedef std::array Facet; namespace std { std::ostream& diff --git a/Advancing_front_surface_reconstruction/examples/Advancing_front_surface_reconstruction/reconstruction_structured.cpp b/Advancing_front_surface_reconstruction/examples/Advancing_front_surface_reconstruction/reconstruction_structured.cpp index ecbaba4ebc3..6680342cbc7 100644 --- a/Advancing_front_surface_reconstruction/examples/Advancing_front_surface_reconstruction/reconstruction_structured.cpp +++ b/Advancing_front_surface_reconstruction/examples/Advancing_front_surface_reconstruction/reconstruction_structured.cpp @@ -37,7 +37,7 @@ typedef CGAL::Triangulation_data_structure_3 Tds; typedef CGAL::Delaunay_triangulation_3 Triangulation_3; typedef Triangulation_3::Vertex_handle Vertex_handle; -typedef CGAL::cpp11::array Facet; +typedef std::array Facet; // Functor to init the advancing front algorithm with indexed points diff --git a/Advancing_front_surface_reconstruction/examples/Advancing_front_surface_reconstruction/reconstruction_surface_mesh.cpp b/Advancing_front_surface_reconstruction/examples/Advancing_front_surface_reconstruction/reconstruction_surface_mesh.cpp index 56ef63557e0..80bff330b4d 100644 --- a/Advancing_front_surface_reconstruction/examples/Advancing_front_surface_reconstruction/reconstruction_surface_mesh.cpp +++ b/Advancing_front_surface_reconstruction/examples/Advancing_front_surface_reconstruction/reconstruction_surface_mesh.cpp @@ -7,7 +7,7 @@ #include #include -typedef CGAL::cpp11::array Facet; +typedef std::array Facet; typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; typedef Kernel::Point_3 Point_3; 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 317c04ee863..926c95c41b1 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 @@ -2488,7 +2488,7 @@ namespace CGAL { \tparam PointInputIterator must be an input iterator with 3D points as value type. This point type must be convertible to `Exact_predicates_inexact_constructions_kernel::Point_3` with the `Cartesian_converter`. \tparam IndicesOutputIterator must be an output iterator to which - `CGAL::cpp11::array` can be assigned. + `std::array` can be assigned. \param b iterator on the first point of the sequence \param e past the end iterator of the point sequence @@ -2540,7 +2540,7 @@ namespace CGAL { \tparam PointInputIterator must be an input iterator with 3D points as value type. This point type must be convertible to `Exact_predicates_inexact_constructions_kernel::Point_3` with the `Cartesian_converter`. \tparam IndicesOutputIterator must be an output iterator to which - `CGAL::cpp11::array` can be assigned. + `std::array` can be assigned. \tparam Priority must be a functor with `double operator()(AdvancingFront,Cell_handle,int)` returning the priority of the facet `(Cell_handle,int)`. diff --git a/Advancing_front_surface_reconstruction/test/Advancing_front_surface_reconstruction/kernels.cpp b/Advancing_front_surface_reconstruction/test/Advancing_front_surface_reconstruction/kernels.cpp index 68ae25a20e0..36b354e1c53 100644 --- a/Advancing_front_surface_reconstruction/test/Advancing_front_surface_reconstruction/kernels.cpp +++ b/Advancing_front_surface_reconstruction/test/Advancing_front_surface_reconstruction/kernels.cpp @@ -9,7 +9,7 @@ typedef CGAL::Simple_cartesian K; -typedef CGAL::cpp11::array Facet; +typedef std::array Facet; namespace std { std::ostream& diff --git a/Advancing_front_surface_reconstruction/test/Advancing_front_surface_reconstruction/lowdim.cpp b/Advancing_front_surface_reconstruction/test/Advancing_front_surface_reconstruction/lowdim.cpp index 5bd09771f38..83567497416 100644 --- a/Advancing_front_surface_reconstruction/test/Advancing_front_surface_reconstruction/lowdim.cpp +++ b/Advancing_front_surface_reconstruction/test/Advancing_front_surface_reconstruction/lowdim.cpp @@ -8,7 +8,7 @@ typedef CGAL::Simple_cartesian K; typedef K::Point_3 Point_3; -typedef CGAL::cpp11::array Facet; +typedef std::array Facet; namespace std { std::ostream& diff --git a/Advancing_front_surface_reconstruction/test/Advancing_front_surface_reconstruction/polyhedron.cpp b/Advancing_front_surface_reconstruction/test/Advancing_front_surface_reconstruction/polyhedron.cpp index 26daecb46c9..c0aeb0d9662 100644 --- a/Advancing_front_surface_reconstruction/test/Advancing_front_surface_reconstruction/polyhedron.cpp +++ b/Advancing_front_surface_reconstruction/test/Advancing_front_surface_reconstruction/polyhedron.cpp @@ -12,7 +12,7 @@ typedef K::Point_3 Point_3; typedef CGAL::Polyhedron_3 Polyhedron; -typedef CGAL::cpp11::array Facet; +typedef std::array Facet; namespace std { std::ostream& 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 5c8d68973d5..d69f64efc50 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 @@ -23,7 +23,7 @@ public: /*! */ -typedef CGAL::cpp11::array result_type; +typedef std::array result_type; /// @} @@ -31,7 +31,7 @@ typedef CGAL::cpp11::array result_type; /// @{ /*! -The returned `CGAL::cpp11::array` \f$ [xl,xu,yl,yu]\f$ represents an open isolating box \f$ B=(xl,xu)\times(yl,yu)\f$ +The returned `std::array` \f$ [xl,xu,yl,yu]\f$ represents an open isolating box \f$ B=(xl,xu)\times(yl,yu)\f$ for \f$ a\f$ with respect to \f$ f\f$. \pre \f$ f(a)\neq0\f$ \post \f$ a \in B\f$. @@ -42,7 +42,7 @@ result_type operator()( AlgebraicKernel_d_2::Algebraic_real_2 a, AlgebraicKernel_d_2::Polynomial_2 f); /*! -The returned `CGAL::cpp11::array` \f$ [xl,xu,yl,yu]\f$ represents an open isolating box \f$ B=(xl,xu)\times(yl,yu)\f$ +The returned `std::array` \f$ [xl,xu,yl,yu]\f$ represents an open isolating box \f$ B=(xl,xu)\times(yl,yu)\f$ for \f$ a\f$ with respect to the common solutions of \f$ f\f$ and \f$ g\f$. It is not necessary that \f$ a\f$ is a common solution of \f$ f\f$ and \f$ g\f$. \post \f$ a \in B\f$. diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_curve_kernel_2.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_curve_kernel_2.h index dec15ae0fd9..bcc17651c39 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_curve_kernel_2.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_curve_kernel_2.h @@ -736,7 +736,7 @@ public: public: - typedef CGAL::cpp11::array result_type; + typedef std::array result_type; Isolate_2(const Algebraic_kernel_d_2* kernel) : _m_kernel(kernel) {} diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_descartes_E08_tree.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_descartes_E08_tree.h index d6f0e659ce0..c99b9c4905f 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_descartes_E08_tree.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_descartes_E08_tree.h @@ -476,9 +476,7 @@ private: log_C_eps_ = n.log_C_eps_; } -#ifndef CGAL_CFG_NO_CPP0X_DELETED_AND_DEFAULT_FUNCTIONS Self& operator= (const Self&) = delete; -#endif }; // struct Bitstream_descartes_E08_node diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_descartes_rndl_tree.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_descartes_rndl_tree.h index 5fc1321d51f..ab338ae6243 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_descartes_rndl_tree.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_descartes_rndl_tree.h @@ -567,9 +567,7 @@ private: log_C_eps_ = n.log_C_eps_; } -#ifndef CGAL_CFG_NO_CPP0X_DELETED_AND_DEFAULT_FUNCTIONS Self& operator= (const Self&)=delete; -#endif }; // struct Bitstream_descartes_rndl_node diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Interval_evaluate_1.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Interval_evaluate_1.h index a3438c72dc7..e6ed5c12bcc 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Interval_evaluate_1.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Interval_evaluate_1.h @@ -62,7 +62,7 @@ struct Interval_evaluate_1 : public CGAL::cpp98::binary_function } result_type operator()(const Polynomial_1& p, - const CGAL::cpp11::array< Bound, 2 >& b) const { + const std::array< Bound, 2 >& b) const { typename CT::Cast cast; @@ -79,7 +79,7 @@ struct Interval_evaluate_1 : public CGAL::cpp98::binary_function Coefficient_const_iterator_range range = typename PT_1::Construct_coefficient_const_iterator_range()(p); - Coefficient_const_iterator it = CGAL::cpp11::prev(range.second); + Coefficient_const_iterator it = std::prev(range.second); Coercion_interval res(cast(*it)); diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Interval_evaluate_2.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Interval_evaluate_2.h index 0078b698e58..558911bf0e1 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Interval_evaluate_2.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Interval_evaluate_2.h @@ -41,7 +41,7 @@ namespace internal { template struct Interval_evaluate_2 : public CGAL::cpp98::binary_function -, +, std::pair::Innermost_coefficient_type,Bound>::Type, typename CGAL::Coercion_traits::Innermost_coefficient_type,Bound>::Type> > { @@ -58,7 +58,7 @@ public: typedef std::pair< Coercion_type, Coercion_type > result_type; result_type operator()(const Polynomial_2& p, - const CGAL::cpp11::array< Bound, 4 >& b) const { + const std::array< Bound, 4 >& b) const { typename CT::Cast cast; @@ -87,7 +87,7 @@ public: Coefficient_const_iterator_range range = typename PT_2::Construct_coefficient_const_iterator_range()(p); - Coefficient_const_iterator it = CGAL::cpp11::prev(range.second); + Coefficient_const_iterator it = std::prev(range.second); Interval_result_type initial_pair = interval_evaluate_1(*it,x_pair); Coercion_interval res(initial_pair.first,initial_pair.second); diff --git a/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_algebraic_kernel_2.h b/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_algebraic_kernel_2.h index d10054e8aa2..1de44826604 100644 --- a/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_algebraic_kernel_2.h +++ b/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_algebraic_kernel_2.h @@ -48,7 +48,7 @@ void test_algebraic_kernel_2(const AlgebraicKernel_2& ak_2) { typedef typename AK_2::Coefficient Coefficient; typedef typename AK_2::Bound Bound; typedef std::pair BInterval; - typedef CGAL::cpp11::array BArray; + typedef std::array BArray; typedef typename AK_2::Polynomial_1 Polynomial_1; typedef typename AK_2::Polynomial_2 Polynomial_2; typedef typename AK_2::Algebraic_real_1 Algebraic_real_1; diff --git a/Alpha_shapes_2/examples/Alpha_shapes_2/ex_alpha_projection_traits.cpp b/Alpha_shapes_2/examples/Alpha_shapes_2/ex_alpha_projection_traits.cpp index a9b28fb2f06..4e7586384f7 100644 --- a/Alpha_shapes_2/examples/Alpha_shapes_2/ex_alpha_projection_traits.cpp +++ b/Alpha_shapes_2/examples/Alpha_shapes_2/ex_alpha_projection_traits.cpp @@ -107,7 +107,7 @@ bool file_input(OutputIterator out) int n; is >> n; std::cout << "Reading " << n << " points from file" << std::endl; - CGAL::cpp11::copy_n(std::istream_iterator(is), n, out); + std::copy_n(std::istream_iterator(is), n, out); return true; } diff --git a/Alpha_shapes_2/examples/Alpha_shapes_2/ex_alpha_shapes_2.cpp b/Alpha_shapes_2/examples/Alpha_shapes_2/ex_alpha_shapes_2.cpp index 505c2bcac4e..8057bb88226 100644 --- a/Alpha_shapes_2/examples/Alpha_shapes_2/ex_alpha_shapes_2.cpp +++ b/Alpha_shapes_2/examples/Alpha_shapes_2/ex_alpha_shapes_2.cpp @@ -50,7 +50,7 @@ bool file_input(OutputIterator out) int n; is >> n; std::cout << "Reading " << n << " points from file" << std::endl; - CGAL::cpp11::copy_n(std::istream_iterator(is), n, out); + std::copy_n(std::istream_iterator(is), n, out); return true; } diff --git a/Alpha_shapes_2/examples/Alpha_shapes_2/ex_periodic_alpha_shapes_2.cpp b/Alpha_shapes_2/examples/Alpha_shapes_2/ex_periodic_alpha_shapes_2.cpp index 7cb9a1243e0..71ae7483b6a 100644 --- a/Alpha_shapes_2/examples/Alpha_shapes_2/ex_periodic_alpha_shapes_2.cpp +++ b/Alpha_shapes_2/examples/Alpha_shapes_2/ex_periodic_alpha_shapes_2.cpp @@ -52,7 +52,7 @@ bool file_input(OutputIterator out) int n; is >> n; std::cout << "Reading " << n << " points from file" << std::endl; - CGAL::cpp11::copy_n(std::istream_iterator(is), n, out); + std::copy_n(std::istream_iterator(is), n, out); return true; } diff --git a/Alpha_shapes_2/test/Alpha_shapes_2/test_alpha.cpp b/Alpha_shapes_2/test/Alpha_shapes_2/test_alpha.cpp index 60d900af146..9d8aad735ac 100644 --- a/Alpha_shapes_2/test/Alpha_shapes_2/test_alpha.cpp +++ b/Alpha_shapes_2/test/Alpha_shapes_2/test_alpha.cpp @@ -97,7 +97,7 @@ file_input(OutputIterator out) int n; is >> n; std::cout << "Reading " << n << " points from file" << std::endl; - CGAL::cpp11::copy_n(std::istream_iterator(is), n, out); + std::copy_n(std::istream_iterator(is), n, out); return true; } diff --git a/Alpha_shapes_3/demo/Alpha_shapes_3/Alpha_shape_3.cpp b/Alpha_shapes_3/demo/Alpha_shapes_3/Alpha_shape_3.cpp index 6b03dd52b54..79ffcaf0a9f 100644 --- a/Alpha_shapes_3/demo/Alpha_shapes_3/Alpha_shape_3.cpp +++ b/Alpha_shapes_3/demo/Alpha_shapes_3/Alpha_shape_3.cpp @@ -19,7 +19,7 @@ int main(int argc, char** argv) #endif // Import resources from libCGALQt (Qt5). - // See http://doc.qt.io/qt-5/qdir.html#Q_INIT_RESOURCE + // See https://doc.qt.io/qt-5/qdir.html#Q_INIT_RESOURCE CGAL_QT_INIT_RESOURCES; Q_INIT_RESOURCE(Alpha_shape_3); 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 index 2949f50983f..f12c5233acb 100644 --- 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 @@ -10,7 +10,6 @@ #include #include -#include typedef CGAL::Exact_predicates_inexact_constructions_kernel Gt; @@ -73,7 +72,7 @@ int main() 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) + for(Alpha_shape_3::Facet f : regular_facets) { if ( marked_cells.count(f.first)==1 ) filtered_regular_facets.push_back(f); @@ -90,7 +89,7 @@ int main() 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(Alpha_shape_3::Facet f : filtered_regular_facets) { for (int i=1;i<4; ++i) { @@ -104,7 +103,7 @@ int main() 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) + for(const Alpha_shape_3::Facet& f : filtered_regular_facets) { output << 3; diff --git a/Alpha_shapes_3/include/CGAL/Alpha_shape_3.h b/Alpha_shapes_3/include/CGAL/Alpha_shape_3.h index a9a209886d9..a2d5dc0df3d 100644 --- a/Alpha_shapes_3/include/CGAL/Alpha_shape_3.h +++ b/Alpha_shapes_3/include/CGAL/Alpha_shape_3.h @@ -979,8 +979,8 @@ public: template OutputIterator filtration(OutputIterator it) const { - Dispatch_or_drop_output_iterator, cpp11::tuple > out(it); - return cpp11::template get<0>( filtration_with_alpha_values(out) ); + Dispatch_or_drop_output_iterator, std::tuple > out(it); + return std::template get<0>( filtration_with_alpha_values(out) ); } private: diff --git a/Arrangement_on_surface_2/archive/demo/Arr_algebraic_segment_traits_2/xalci/misc.cpp b/Arrangement_on_surface_2/archive/demo/Arr_algebraic_segment_traits_2/xalci/misc.cpp index 5641b3e6296..453a43b5e6a 100644 --- a/Arrangement_on_surface_2/archive/demo/Arr_algebraic_segment_traits_2/xalci/misc.cpp +++ b/Arrangement_on_surface_2/archive/demo/Arr_algebraic_segment_traits_2/xalci/misc.cpp @@ -479,7 +479,7 @@ void xAlci_main_window::setup(int w, int h) tab_widget->addTab(cad_tab,"cad"); tab_widget->addTab(arr_tab,"arrangement"); - *widget << CGAL::LineWidth(2) << CGAL::BackgroundColor(CGAL::WHITE); + *widget << CGAL::LineWidth(2) << CGAL::BackgroundColor(CGAL::white()); resize(w,h); double ratio = 1.0;//(double)h/w; widget->set_window(-1, 1, -ratio, ratio, true); diff --git a/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/arr_bench.cpp b/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/arr_bench.cpp index 86e299c27ad..903fc5a1b90 100644 --- a/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/arr_bench.cpp +++ b/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/arr_bench.cpp @@ -277,11 +277,11 @@ inline std::ostream & operator<<(std::ostream & os, const Arr::Vertex & vertex) inline Window_stream & operator<<(Window_stream & ws, Arr & arr) { Arr::Edge_iterator ei; - ws << CGAL::BLUE; + ws << CGAL::blue(); for (ei = arr.edges_begin(); ei != arr.edges_end(); ++ei) ws << (*ei).curve(); Arr::Vertex_iterator vi; - ws << CGAL::RED; + ws << CGAL::red(); for (vi = arr.vertices_begin(); vi != arr.vertices_end(); ++vi) ws << (*vi).point(); return ws; @@ -474,7 +474,7 @@ public: m_window->flush(); #else m_window->lock(); - *m_window << CGAL::BackgroundColor(CGAL::WHITE) << CGAL::RED; + *m_window << CGAL::BackgroundColor(CGAL::white()) << CGAL::red(); (*m_window) << arr; m_window->unlock(); App->flush(); @@ -490,9 +490,9 @@ public: ps_stream.set_line_width(1); CGAL::Arr_drawer drawer(ps_stream); // drawer.draw_faces(arr.faces_begin(), arr.faces_end()); - ps_stream << CGAL::BLUE; + ps_stream << CGAL::blue(); drawer.draw_halfedges(arr.halfedges_begin(), arr.halfedges_end()); - ps_stream << CGAL::RED; + ps_stream << CGAL::red(); drawer.draw_vertices(arr.vertices_begin(), arr.vertices_end()); // draw_arr(arr, drawer, ps_stream); diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/OverlayDialog.cpp b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/OverlayDialog.cpp index e18fb22c5a5..982960e9bbf 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/OverlayDialog.cpp +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/OverlayDialog.cpp @@ -34,7 +34,7 @@ OverlayDialog::OverlayDialog( ArrangementDemoWindow* parent, ui( new Ui::OverlayDialog ) { // An extra parenthesis around QColor to avoid the - // http://en.wikipedia.org/wiki/Most_vexing_parse + // https://en.wikipedia.org/wiki/Most_vexing_parse // on clang QBrush segColor( ( QColor( ::Qt::red ) ) ); QBrush polyColor( ( QColor( ::Qt::darkGreen ) ) ); 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 6230d15e4c7..08c5e3efae8 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 @@ -10,7 +10,7 @@ of both types `CGAL::Line_arc_2` or `CGAL::Circular_arc_2`. -It uses the boost::variant. +It uses the boost::variant. \cgalModels `ArrangementTraits_2` 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 f53f8db1978..fc41e4c1f97 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,12 +1,3 @@ -/// \ingroup PkgArrangementOnSurface2Macros -/// @{ -/*! - * If the macro is set to one, then \f$x\f$-monotone curves are always - * directed from left-to-right. - */ -#define CGAL_ALWAYS_LEFT_TO_RIGHT -/// @} - namespace CGAL { /*! \ingroup PkgArrangementOnSurface2TraitsClasses * diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_bounded_planar_topology_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_bounded_planar_topology_traits_2.h index bda5c76ac68..b48363c2913 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_bounded_planar_topology_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_bounded_planar_topology_traits_2.h @@ -208,82 +208,6 @@ public: // defining a type that inherits from the template we need to alias. However, // the non-C++11 code requires the (re)definition of all constructors of the // derived class. -#if defined(CGAL_CFG_NO_CPP0X_TEMPLATE_ALIASES) - // Type definition for the construction surface-sweep visitor. - template - struct Construction_helper : - public Arr_bounded_planar_construction_helper - { - typedef Arr_bounded_planar_construction_helper - Base; - Construction_helper(Arr* arr) : Base(arr) {} - }; - - // Type definition for the no-intersection construction surface-sweep visitor. - template - struct No_intersection_construction_helper : - public Arr_bounded_planar_construction_helper - { - typedef Arr_bounded_planar_construction_helper - Base; - No_intersection_construction_helper(Arr* arr) : Base(arr) {} - }; - - // Type definition for the insertion surface-sweep visitor. - typedef Arr_insertion_traits_2 I_traits; - template - struct Insertion_helper : - public Arr_bounded_planar_insertion_helper - { - typedef Arr_bounded_planar_insertion_helper - Base; - Insertion_helper(Arr* arr) : Base(arr) {} - }; - - // Type definition for the no-intersection insertion surface-sweep visitor. - typedef Arr_basic_insertion_traits_2 Nxi_traits; - template - struct No_intersection_insertion_helper : - public Arr_bounded_planar_insertion_helper - { - typedef Arr_bounded_planar_insertion_helper - Base; - No_intersection_insertion_helper(Arr* arr) : Base(arr) {} - }; - - // Type definition for the batched point-location surface-sweep visitor. - typedef Arr_batched_point_location_traits_2 Bpl_traits; - template - struct Batched_point_location_helper : - public Arr_bounded_planar_batched_pl_helper - { - typedef Arr_bounded_planar_batched_pl_helper - Base; - Batched_point_location_helper(const Arr* arr) : Base(arr) {} - }; - - // Type definition for the vertical decomposition sweep-line visitor. - typedef Arr_batched_point_location_traits_2 Vd_traits; - template - struct Vertical_decomposition_helper : - public Arr_bounded_planar_vert_decomp_helper - { - typedef Arr_bounded_planar_vert_decomp_helper - Base; - Vertical_decomposition_helper(const Arr* arr) : Base(arr) {} - }; - - // Type definition for the overlay surface-sweep visitor. - template - struct Overlay_helper : - public Arr_bounded_planar_overlay_helper - { - typedef Arr_bounded_planar_overlay_helper - Base; - Overlay_helper(const ArrA* arr_a, const ArrB* arr_b) : Base(arr_a, arr_b) {} - }; -#else // Type definition for the construction surface-sweep visitor. template using Construction_helper = @@ -323,7 +247,6 @@ public: typename ArrA, typename ArrB> using Overlay_helper = Arr_bounded_planar_overlay_helper; -#endif //@} public: diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Circle_segment_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Circle_segment_2.h index cf4f1e84e61..8b4d0602224 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Circle_segment_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Circle_segment_2.h @@ -109,9 +109,7 @@ public: Point_handle (p) {} -#ifndef CGAL_CFG_NO_CPP0X_DELETED_AND_DEFAULT_FUNCTIONS _One_root_point_2& operator=(const _One_root_point_2&)=default; -#endif /*! Constructor of a point with one-root coefficients. This constructor of a point can also be used with rational coefficients diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Rational_function.h b/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Rational_function.h index 7f359ed9b3b..96e57b266bf 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Rational_function.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Rational_function.h @@ -232,9 +232,7 @@ public: Rational_function (const Self & r) : Base(static_cast (r)) {} -#ifndef CGAL_CFG_NO_CPP0X_DELETED_AND_DEFAULT_FUNCTIONS Self& operator=(const Self&)=default; -#endif CGAL::Sign sign_at(const Algebraic_real_1& x, CGAL::Sign epsilon = CGAL::ZERO) const diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_spherical_topology_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_spherical_topology_traits_2.h index 2a0eac365ec..bf6412cab20 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_spherical_topology_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_spherical_topology_traits_2.h @@ -321,7 +321,6 @@ public: // the non-C++11 code requires the (re)definition of all constructors of the // derived class. The non-C++11 code follows the commented out C++11 code. // When we move to C++11 we can use the more elgant code. -#if defined(CGAL_CFG_NO_CPP0X_TEMPLATE_ALIASES) // Type definition for the construction surface-sweep visitor. template struct Construction_helper : @@ -396,47 +395,6 @@ public: Base; Overlay_helper(const ArrA* arr_a, const ArrB* arr_b) : Base(arr_a, arr_b) {} }; -#else - // Type definition for the construction surface-sweep visitor. - template - using Construction_helper = - Arr_spherical_construction_helper; - - // Type definition for the no-intersection construction surface-sweep visitor. - template - using No_intersection_construction_helper = - Arr_spherical_construction_helper; - - // Type definition for the insertion surface-sweep visitor. - typedef Arr_insertion_traits_2 I_traits; - template - using Insertion_helper = - Arr_spherical_insertion_helper; - - // Type definition for the no-intersection insertion surface-sweep visitor. - typedef Arr_basic_insertion_traits_2 Nxi_traits; - template - using No_intersection_insertion_helper = - Arr_spherical_insertion_helper; - - // Type definition for the batched point-location surface-sweep visitor. - typedef Arr_batched_point_location_traits_2 Bpl_traits; - template - using Batched_point_location_helper = - Arr_spherical_batched_pl_helper; - - // Type definition for the vertical decomposition surface-sweep visitor. - typedef Arr_batched_point_location_traits_2 Vd_traits; - template - using Vertical_decomposition_helper = - Arr_spherical_vert_decomp_helper; - - // Type definition for the overlay surface-sweep visitor. - template - using Overlay_helper = - Arr_spherical_overlay_helper; -#endif //@} public: diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_unb_planar_topology_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_unb_planar_topology_traits_2.h index 20f3db2581b..df288fae935 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_unb_planar_topology_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_unb_planar_topology_traits_2.h @@ -226,82 +226,6 @@ public: // defining a type that inherits from the template we need to alias. However, // the non-C++11 code requires the (re)definition of all constructors of the // derived class. -#if defined(CGAL_CFG_NO_CPP0X_TEMPLATE_ALIASES) - // Type definition for the construction surface-sweep visitor. - template - struct Construction_helper : - public Arr_unb_planar_construction_helper - { - typedef Arr_unb_planar_construction_helper - Base; - Construction_helper(Arr* arr) : Base(arr) {} - }; - - // Type definition for the no-intersection construction surface-sweep visitor. - template - struct No_intersection_construction_helper : - public Arr_unb_planar_construction_helper - { - typedef Arr_unb_planar_construction_helper - Base; - No_intersection_construction_helper(Arr* arr) : Base(arr) {} - }; - - // Type definition for the insertion surface-sweep visitor. - typedef Arr_insertion_traits_2 I_traits; - template - struct Insertion_helper : - public Arr_unb_planar_insertion_helper - { - typedef Arr_unb_planar_insertion_helper - Base; - Insertion_helper(Arr* arr) : Base(arr) {} - }; - - // Type definition for the no-intersection insertion surface-sweep visitor. - typedef Arr_basic_insertion_traits_2 Nxi_traits; - template - struct No_intersection_insertion_helper : - public Arr_unb_planar_insertion_helper - { - typedef Arr_unb_planar_insertion_helper - Base; - No_intersection_insertion_helper(Arr* arr) : Base(arr) {} - }; - - // Type definition for the batched point-location surface-sweep visitor. - typedef Arr_batched_point_location_traits_2 Bpl_traits; - template - struct Batched_point_location_helper : - public Arr_unb_planar_batched_pl_helper - { - typedef Arr_unb_planar_batched_pl_helper - Base; - Batched_point_location_helper(const Arr* arr) : Base(arr) {} - }; - - // Type definition for the vertical decomposition surface-sweep visitor. - typedef Arr_batched_point_location_traits_2 Vd_traits; - template - struct Vertical_decomposition_helper : - public Arr_unb_planar_vert_decomp_helper - { - typedef Arr_unb_planar_vert_decomp_helper - Base; - Vertical_decomposition_helper(const Arr* arr) : Base(arr) {} - }; - - // Type definition for the overlay surface-sweep visitor. - template - struct Overlay_helper : - public Arr_unb_planar_overlay_helper - { - typedef Arr_unb_planar_overlay_helper - Base; - Overlay_helper(const ArrA* arr_a, const ArrB* arr_b) : Base(arr_a, arr_b) {} - }; -#else // Type definition for the construction surface-sweep visitor. template using Construction_helper = @@ -341,7 +265,6 @@ public: typename ArrA, typename ArrB> using Overlay_helper = Arr_unb_planar_overlay_helper; -#endif //@} public: diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Point_location_test.h b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Point_location_test.h index 3224dfe54eb..d18fdc47f67 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Point_location_test.h +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Point_location_test.h @@ -641,20 +641,6 @@ private: #define QUERY_PL_TRAPEZOID_RIC_NO_GUARANTEE(obj) #endif -#if defined(CGAL_CFG_NO_CPP0X_LAMBDAS) -#define MEASURE_NAIVE_PL(timer, op) op -#define MEASURE_SIMPLE_PL(timer, op) op -#define MEASURE_WALK_PL(timer, op) op -#define MEASURE_LM_PL(timer, op) op -#define MEASURE_LM_RANDOM_PL(timer, op) op -#define MEASURE_LM_GRID_PL(timer, op) op -#define MEASURE_LM_HALTON_PL(timer, op) op -#define MEASURE_LM_MIDDLE_EDGES_PL(timer, op) op -#define MEASURE_LM_SPECIFIED_POINTS_PL(timer, op) op -#define MEASURE_TRIANGULATION_PL(timer, op) op -#define MEASURE_TRAPEZOID_RIC_PL(timer, op) op -#define MEASURE_TRAPEZOID_RIC_NO_GUARANTEE_PL(timer, op) op -#else #define MEASURE_NAIVE_PL(timer, op) measure(timer, [&](){ op; }); #define MEASURE_SIMPLE_PL(timer, op) measure(timer, [&](){ op; }); #define MEASURE_WALK_PL(timer, op) measure(timer, [&](){ op; }); @@ -675,7 +661,6 @@ private: measure(timer, [&](){ op; }); #define MEASURE_TRAPEZOID_RIC_NO_GUARANTEE_PL(timer, op) \ measure(timer, [&](){ op; }); -#endif //! Constructor. template diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test.cmake b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test.cmake index fc61895ed77..4753352d565 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test.cmake +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test.cmake @@ -194,24 +194,10 @@ function(run_test_alt name datafile) endif() cgal_debug_message(STATUS "# run_test_alt(${ARGN})") cgal_debug_message(STATUS "# -> ./${name} ${datafile} ${ARGN}") - set(command ${name} ${datafile} ${ARGN}) string(MAKE_C_IDENTIFIER "${name} ${ARGV4} ${ARGV5}" test_name) - add_test(NAME ${test_name} COMMAND ${command} - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) - set_property(TEST "${test_name}" - APPEND PROPERTY DEPENDS "compilation_of__${name}") - if(POLICY CMP0066) # CMake 3.7 or later - set_tests_properties("${test_name}" - PROPERTIES - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/__exec_test_dir - FIXTURES_REQUIRED ${PROJECT_NAME}) - endif() - cgal_debug_message(STATUS "# .. depends on compilation_of__${name}") - -# message(" successful execution of ${name} ${ARGV4} ${ARGV5}") - set_property(TEST "${test_name}" - APPEND PROPERTY LABELS "${PROJECT_NAME}") - cgal_debug_message(STATUS "add test \"${test_name}\": ${name} ${datafile} ${ARGN}") + cgal_add_test(${name} + TEST_NAME ${test_name} + ARGUMENTS ${datafile} ${ARGN}) endfunction() function(run_trapped_test name datafile) diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_rational_function_traits_2.cpp b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_rational_function_traits_2.cpp index b3b5f39c226..407d5e27016 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_rational_function_traits_2.cpp +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_rational_function_traits_2.cpp @@ -19,7 +19,6 @@ int main() #include //Traits #include //Arrangement #include -#include typedef CGAL::CORE_arithmetic_kernel::Integer Number_type; typedef CGAL::Algebraic_kernel_d_1 AK1; @@ -303,19 +302,19 @@ int main() curves.push_back(construct_curve_2(x*x*x)); curves.push_back(construct_curve_2(x*x*x, x*x-2)); - BOOST_FOREACH(const Curve_2& curve, curves){ + for(const Curve_2& curve : curves){ assert(CGAL::degree(curve.numerator()) >= 0); } CGAL::compute_subcurves(curves.begin(),curves.end(), std::back_inserter(xcurves),false,traits); - BOOST_FOREACH(const X_monotone_curve_2& xcurve, xcurves) { + for(const X_monotone_curve_2& xcurve : xcurves) { assert(CGAL::degree(xcurve.numerator()) >= 0); } CGAL::compute_intersection_points(curves.begin(),curves.end(), std::back_inserter(points), false, traits); - BOOST_FOREACH(const Point_2& point, points) { + for(const Point_2& point : points) { assert(CGAL::degree(point.numerator()) >= 0); } } @@ -333,18 +332,18 @@ int main() curves.push_back(construct_curve_2(x*x*x, x*x-2)); traits.cleanup_cache(); - BOOST_FOREACH(const Curve_2& curve, curves){ + for(const Curve_2& curve : curves){ assert(CGAL::degree(curve.numerator()) >= 0); } CGAL::compute_subcurves(curves.begin(), curves.end(), std::back_inserter(xcurves), false, traits); - BOOST_FOREACH(const X_monotone_curve_2& xcurve, xcurves) { + for(const X_monotone_curve_2& xcurve : xcurves) { assert(CGAL::degree(xcurve.numerator()) >= 0); } CGAL::compute_intersection_points(curves.begin(), curves.end(), std::back_inserter(points), false, traits); - BOOST_FOREACH(const Point_2& point, points) { + for(const Point_2& point : points) { assert(CGAL::degree(point.numerator()) >= 0); } diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_spherical_removal.cpp b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_spherical_removal.cpp index 8019eff7ae0..2c591b44c07 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_spherical_removal.cpp +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_spherical_removal.cpp @@ -85,7 +85,7 @@ bool test_one_file(std::ifstream& in_file, bool /* verbose */) std::cout.flush(); CGAL::insert_non_intersecting_curves(arr, xcurves.begin(), xcurves.end()); std::cout << "inserted" << std::endl; - BOOST_FOREACH(Halfedge_handle hh, arr.halfedge_handles()) + for(Halfedge_handle hh : arr.halfedge_handles()) halfedges.push_back(hh); #endif @@ -108,7 +108,7 @@ bool test_one_file(std::ifstream& in_file, bool /* verbose */) { std::cout << "Faces:" << std::endl; - BOOST_FOREACH(Arrangement_2::Face_handle fh, arr.face_handles()) + for(Arrangement_2::Face_handle fh : arr.face_handles()) { std::cout << " Face: " << &(fh) diff --git a/BGL/doc/BGL/CGAL/Linear_cell_complex_bgl_min_items.h b/BGL/doc/BGL/CGAL/Linear_cell_complex_bgl_min_items.h index 2d4f9c7d7f1..d340982eec0 100644 --- a/BGL/doc/BGL/CGAL/Linear_cell_complex_bgl_min_items.h +++ b/BGL/doc/BGL/CGAL/Linear_cell_complex_bgl_min_items.h @@ -22,7 +22,7 @@ struct Linear_cell_complex_bgl_min_items typedef CGAL::Tag_true Darts_with_id; typedef CGAL::Cell_attribute_with_point_and_id Vertex_attrib; typedef CGAL::Cell_attribute_with_id Face_attrib; - typedef CGAL::cpp11::tuple Attributes; + typedef std::tuple Attributes; }; }; diff --git a/BGL/doc/BGL/graph_traits.txt b/BGL/doc/BGL/graph_traits.txt index bbc9deabdd9..b16313ed534 100644 --- a/BGL/doc/BGL/graph_traits.txt +++ b/BGL/doc/BGL/graph_traits.txt @@ -4,7 +4,7 @@ \ingroup PkgBGLRef The \sc{Bgl} defines the class template -`boost::graph_traits` +`boost::graph_traits` as a uniform interface to the properties and types of %graph types. We provide specializations of this class template for several \cgal data structures. @@ -162,7 +162,7 @@ with the default property map of \sc{Bgl} algorithms (obtained with `get(t, boost::edge_weight)`) is the length of the edge, the edge weight is not well defined for infinite edges. For algorithms that make use of the edge weight, the user must therefore -define a `boost::filtered_graph` or pass a property map to the +define a `boost::filtered_graph` or pass a property map to the algorithm that returns "infinity" for infinite edges. | Member | Value | Description | diff --git a/BGL/examples/BGL_LCC/range_lcc.cpp b/BGL/examples/BGL_LCC/range_lcc.cpp index d33676676b4..e98acb8a5bc 100644 --- a/BGL/examples/BGL_LCC/range_lcc.cpp +++ b/BGL/examples/BGL_LCC/range_lcc.cpp @@ -2,7 +2,6 @@ #include #include -#include #include #include @@ -37,17 +36,10 @@ void fct(const LCC& lcc) { vertex_range vr(vertices(lcc)); -#ifndef CGAL_CFG_NO_CPP0X_RANGE_BASED_FOR std::cout << "new for loop" << std::endl; for(vertex_descriptor vd : vr){ std::cout << vd->point() << std::endl; } -#endif - - std::cout << "BOOST_FOREACH" << std::endl; - BOOST_FOREACH(vertex_descriptor vd, vr){ - std::cout << vd->point() << std::endl; - } std::cout << "boost::tie + std::for_each" << std::endl; vertex_iterator vb, ve; diff --git a/BGL/examples/BGL_OpenMesh/TriMesh.cpp b/BGL/examples/BGL_OpenMesh/TriMesh.cpp index a5803a51473..83626bcb9c7 100644 --- a/BGL/examples/BGL_OpenMesh/TriMesh.cpp +++ b/BGL/examples/BGL_OpenMesh/TriMesh.cpp @@ -13,7 +13,6 @@ #include #include -#include typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; @@ -31,8 +30,8 @@ int main(int argc, char** argv ) std::vector V; std::ifstream in((argc>1)?argv[1]:"in.off"); CGAL::read_off(in, mesh); - BOOST_FOREACH(vertex_descriptor vd, vertices(mesh)){ - BOOST_FOREACH(halfedge_descriptor hd, CGAL::halfedges_around_target(vd,mesh)){ + for(vertex_descriptor vd : vertices(mesh)){ + for(halfedge_descriptor hd : CGAL::halfedges_around_target(vd,mesh)){ if(! CGAL::is_border(edge(hd,mesh),mesh)){ CGAL::Euler::flip_edge(hd,mesh); CGAL::write_off((argc>2)?argv[2]:"out.off", mesh); diff --git a/BGL/examples/BGL_polyhedron_3/range.cpp b/BGL/examples/BGL_polyhedron_3/range.cpp index 48343cca787..b1b77d2fb74 100644 --- a/BGL/examples/BGL_polyhedron_3/range.cpp +++ b/BGL/examples/BGL_polyhedron_3/range.cpp @@ -2,7 +2,6 @@ #include #include -#include #include #include @@ -36,18 +35,11 @@ void fct(const Polyhedron& p) { vertex_range vr(vertices(p)); -#ifndef CGAL_CFG_NO_CPP0X_RANGE_BASED_FOR std::cout << "new for loop" << std::endl; for(vertex_descriptor vd : vr){ std::cout << vd->point() << std::endl; } -#endif - - std::cout << "BOOST_FOREACH" << std::endl; - BOOST_FOREACH(vertex_descriptor vd, vr){ - std::cout << vd->point() << std::endl; - } - + std::cout << "boost::tie + std::for_each" << std::endl; vertex_iterator vb, ve; diff --git a/BGL/examples/BGL_surface_mesh/connected_components.cpp b/BGL/examples/BGL_surface_mesh/connected_components.cpp index a3d1f0ea4ba..e5ad68d3915 100644 --- a/BGL/examples/BGL_surface_mesh/connected_components.cpp +++ b/BGL/examples/BGL_surface_mesh/connected_components.cpp @@ -5,7 +5,6 @@ #include #include -#include typedef CGAL::Simple_cartesian Kernel; typedef Kernel::Point_3 Point; @@ -24,7 +23,7 @@ int main(int argc, char* argv[]) int num = connected_components(sm, ccmap); std::cout << num << " connected components" << std::endl; - BOOST_FOREACH(vertex_descriptor v, vertices(sm)){ + for(vertex_descriptor v : vertices(sm)){ std::cout << v << " is in component " << ccmap[v] << std::endl; } diff --git a/BGL/examples/BGL_surface_mesh/prim.cpp b/BGL/examples/BGL_surface_mesh/prim.cpp index 08ad8806170..7aff244d40f 100644 --- a/BGL/examples/BGL_surface_mesh/prim.cpp +++ b/BGL/examples/BGL_surface_mesh/prim.cpp @@ -5,7 +5,6 @@ #include #include -#include typedef CGAL::Simple_cartesian Kernel; typedef Kernel::Point_3 Point; @@ -36,14 +35,14 @@ int main(int argc, char* argv[]) " coord Coordinate {\n" " point [ \n"; - BOOST_FOREACH(vertex_descriptor vd, vertices(P)){ + for(vertex_descriptor vd : vertices(P)){ std::cout << " " << P.point(vd) << "\n"; } std::cout << " ]\n" " }\n" " coordIndex [\n"; - BOOST_FOREACH(vertex_descriptor vd, vertices(P)){ + for(vertex_descriptor vd : vertices(P)){ if(predecessor[vd]!=vd){ std::cout << " " << std::size_t(vd) << ", " << std::size_t(predecessor[vd]) << ", -1\n"; } diff --git a/BGL/examples/BGL_surface_mesh/seam_mesh.cpp b/BGL/examples/BGL_surface_mesh/seam_mesh.cpp index 06733fa3e2a..98cf38e8b4c 100644 --- a/BGL/examples/BGL_surface_mesh/seam_mesh.cpp +++ b/BGL/examples/BGL_surface_mesh/seam_mesh.cpp @@ -11,7 +11,6 @@ #include #include -#include typedef CGAL::Simple_cartesian Kernel; typedef Kernel::Point_3 Point; @@ -72,43 +71,43 @@ int main(int argc, char* argv[]) std::cout << "opposite of seam halfedge in seam mesh: " << opposite(bhd, mesh) << std::endl; std::cout << "vertices on one of the seams" << std::endl; - BOOST_FOREACH(halfedge_descriptor hd, + for(halfedge_descriptor hd : halfedges_around_face(opposite(bhd, mesh), mesh)){ std::cout << target(hd.tmhd, sm) << " "; } std::cout << std::endl; std::cout << "vertices around " << target(smhd , sm) << " in (base) mesh" << std::endl; - BOOST_FOREACH(SM_halfedge_descriptor hd, halfedges_around_target(smhd, sm)){ + for(SM_halfedge_descriptor hd : halfedges_around_target(smhd, sm)){ std::cout << source(hd, sm) << " "; } std::cout << std::endl; std::cout << "vertices around " << target(bhd , mesh) << " in seam mesh" << std::endl; - BOOST_FOREACH(halfedge_descriptor hd, halfedges_around_target(bhd, mesh)){ + for(halfedge_descriptor hd : halfedges_around_target(bhd, mesh)){ std::cout << source(hd.tmhd, sm) << " "; } std::cout << std::endl; std::cout << "vertices around " << source(smhd , sm) << " in (base) mesh" << std::endl; - BOOST_FOREACH(SM_halfedge_descriptor hd, + for(SM_halfedge_descriptor hd : halfedges_around_source(source(smhd, sm), sm)){ std::cout << target(hd, sm) << " "; } std::cout << std::endl; std::cout << "vertices around " << source(bhd , mesh) << " in seam mesh" << std::endl; - BOOST_FOREACH(halfedge_descriptor hd, + for(halfedge_descriptor hd : halfedges_around_source(source(bhd, mesh), mesh)){ std::cout << target(hd.tmhd, sm) << " "; } std::cout << std::endl; std::cout << "vertices around vertices in seam mesh" << std::endl; - BOOST_FOREACH(vertex_descriptor vd, vertices(mesh)){ + for(vertex_descriptor vd : vertices(mesh)){ halfedge_descriptor hd = halfedge(vd, mesh); std::cout << " " << vd << " has incident vertices:" << std::endl; - BOOST_FOREACH(halfedge_descriptor hd2, halfedges_around_target(hd, mesh)){ + for(halfedge_descriptor hd2 : halfedges_around_target(hd, mesh)){ std::cout << " " << hd2; } std::cout << std::endl; @@ -118,19 +117,19 @@ int main(int argc, char* argv[]) std::cout << "the (base) mesh has: " << num_halfedges(sm) << " halfedges" << std::endl; std::cout << "the seam mesh has: " << num_halfedges(mesh) << " halfedges" << std::endl; std::cout << "halfedges in (base) mesh" << std::endl; - BOOST_FOREACH(SM_halfedge_descriptor hd, halfedges(sm)){ + for(SM_halfedge_descriptor hd : halfedges(sm)){ std::cout << hd << " "; } std::cout << std::endl; std::cout << "halfedges in seam mesh" << std::endl; - BOOST_FOREACH(halfedge_descriptor hd, halfedges(mesh)){ + for(halfedge_descriptor hd : halfedges(mesh)){ std::cout << hd << " "; } std::cout << std::endl; std::cout << "faces of the base and seam meshes" << std::endl; - BOOST_FOREACH(face_descriptor fd, faces(mesh)){ + for(face_descriptor fd : faces(mesh)){ std::cout << fd << " "; } std::cout << std::endl; diff --git a/BGL/examples/BGL_surface_mesh/surface_mesh_dual.cpp b/BGL/examples/BGL_surface_mesh/surface_mesh_dual.cpp index 883b46cf852..91c2b51c79e 100644 --- a/BGL/examples/BGL_surface_mesh/surface_mesh_dual.cpp +++ b/BGL/examples/BGL_surface_mesh/surface_mesh_dual.cpp @@ -8,7 +8,6 @@ #include #include -#include typedef CGAL::Simple_cartesian Kernel; typedef Kernel::Point_3 Point; @@ -52,19 +51,19 @@ int main(int argc, char* argv[]) std::cout << "dual has " << num_vertices(dual) << " vertices" << std::endl; std::cout << "The vertices of dual are faces in primal"<< std::endl; - BOOST_FOREACH(boost::graph_traits::vertex_descriptor dvd , vertices(dual)) { + for(boost::graph_traits::vertex_descriptor dvd : vertices(dual)) { std::cout << dvd << std::endl; } std::cout << "The edges in primal and dual with source and target" << std::endl; - BOOST_FOREACH(edge_descriptor e , edges(dual)) { + for(edge_descriptor e : edges(dual)) { std::cout << e << " in primal: " << source(e,primal) << " -- " << target(e,primal) << " " << " in dual : " << source(e,finite_dual) << " -- " << target(e,finite_dual) << std::endl; } std::cout << "edges of the finite dual graph" << std::endl; - BOOST_FOREACH(boost::graph_traits::edge_descriptor e , edges(finite_dual)) { + for(boost::graph_traits::edge_descriptor e : CGAL::make_range(edges(finite_dual))) { std::cout << e << " " << source(e,primal) << " " << source(e,finite_dual) << std::endl; } @@ -74,7 +73,7 @@ int main(int argc, char* argv[]) int num = connected_components(finite_dual, fccmap); std::cout << "The graph has " << num << " connected components (face connectivity)" << std::endl; - BOOST_FOREACH(face_descriptor f , faces(primal)) { + for(face_descriptor f : faces(primal)) { std::cout << f << " in connected component " << fccmap[f] << std::endl; } @@ -83,7 +82,7 @@ int main(int argc, char* argv[]) num = connected_components(primal, vccmap); std::cout << "The graph has " << num << " connected components (edge connectvity)" << std::endl; - BOOST_FOREACH(vertex_descriptor v , vertices(primal)) { + for(vertex_descriptor v : vertices(primal)) { std::cout << v << " in connected component " << vccmap[v] << std::endl; } return 0; diff --git a/BGL/examples/BGL_surface_mesh/surface_mesh_partition.cpp b/BGL/examples/BGL_surface_mesh/surface_mesh_partition.cpp index 314d95a7944..a1771262a5d 100644 --- a/BGL/examples/BGL_surface_mesh/surface_mesh_partition.cpp +++ b/BGL/examples/BGL_surface_mesh/surface_mesh_partition.cpp @@ -44,10 +44,12 @@ int main(int argc, char** argv) // Output the mesh extracted from subpart n°0 std::ofstream out("sm_part_0.off"); + out.precision(17); CGAL::write_off(out, part_sm); // Output all the vertices that are in the part n°0 std::ofstream outxyz("out.xyz"); + outxyz.precision(17); boost::graph_traits::vertex_iterator vit, ve; boost::tie(vit, ve) = vertices(sm); for(; vit!=ve; ++vit) diff --git a/BGL/examples/BGL_surface_mesh/write_inp.cpp b/BGL/examples/BGL_surface_mesh/write_inp.cpp index 0bb624e99c9..fce8f932b11 100644 --- a/BGL/examples/BGL_surface_mesh/write_inp.cpp +++ b/BGL/examples/BGL_surface_mesh/write_inp.cpp @@ -6,7 +6,6 @@ #include #include -#include typedef CGAL::Simple_cartesian Kernel; typedef Kernel::Point_3 Point; diff --git a/BGL/examples/BGL_triangulation_2/face_graph.cpp b/BGL/examples/BGL_triangulation_2/face_graph.cpp index 1e84a508914..efc5535a6a3 100644 --- a/BGL/examples/BGL_triangulation_2/face_graph.cpp +++ b/BGL/examples/BGL_triangulation_2/face_graph.cpp @@ -5,7 +5,6 @@ #include #include -#include typedef CGAL::Exact_predicates_inexact_constructions_kernel Epic; @@ -104,7 +103,7 @@ main(int,char*[]) Ppmap ppmap = get(boost::vertex_point, t); - BOOST_FOREACH(vertex_descriptor vd, vertices_around_target(*vertices(t).first, t)){ + for(vertex_descriptor vd : vertices_around_target(*vertices(t).first, t)){ std::cout << ppmap[vd] << std::endl; } diff --git a/BGL/include/CGAL/boost/graph/Euler_operations.h b/BGL/include/CGAL/boost/graph/Euler_operations.h index 11dd34b1922..64a2ac94226 100644 --- a/BGL/include/CGAL/boost/graph/Euler_operations.h +++ b/BGL/include/CGAL/boost/graph/Euler_operations.h @@ -785,7 +785,7 @@ void fill_hole(typename boost::graph_traits::halfedge_descriptor h, typedef typename Traits::halfedge_descriptor halfedge_descriptor; face_descriptor f = add_face(g); - BOOST_FOREACH(halfedge_descriptor hd, halfedges_around_face(h,g)){ + for(halfedge_descriptor hd : halfedges_around_face(h,g)){ set_face(hd, f,g); } set_halfedge(f,h,g); diff --git a/BGL/include/CGAL/boost/graph/Face_filtered_graph.h b/BGL/include/CGAL/boost/graph/Face_filtered_graph.h index 80300b96a3f..fb6036dc89e 100644 --- a/BGL/include/CGAL/boost/graph/Face_filtered_graph.h +++ b/BGL/include/CGAL/boost/graph/Face_filtered_graph.h @@ -28,11 +28,9 @@ #include #include #include -#include #include #include #include -#include #include #include #include @@ -286,12 +284,12 @@ struct Face_filtered_graph selected_faces.reset(); selected_vertices.reset(); selected_halfedges.reset(); - BOOST_FOREACH(face_descriptor fd, faces(_graph) ) + for(face_descriptor fd : faces(_graph) ) { if(get(face_patch_index_map, fd) == face_patch_id) { selected_faces.set(get(fimap, fd)); - BOOST_FOREACH(halfedge_descriptor hd, halfedges_around_face(halfedge(fd, _graph), _graph)) + for(halfedge_descriptor hd : halfedges_around_face(halfedge(fd, _graph), _graph)) { selected_halfedges.set(get(himap, hd)); selected_halfedges.set(get(himap, opposite(hd, _graph))); @@ -325,12 +323,12 @@ struct Face_filtered_graph boost::unordered_set pids(boost::begin(selected_face_patch_indices), boost::end(selected_face_patch_indices)); - BOOST_FOREACH(face_descriptor fd, faces(_graph) ) + for(face_descriptor fd : faces(_graph) ) { if(pids.count(get(face_patch_index_map, fd)) != 0) { selected_faces.set(get(fimap, fd)); - BOOST_FOREACH(halfedge_descriptor hd, halfedges_around_face(halfedge(fd, _graph), _graph)) + for(halfedge_descriptor hd : halfedges_around_face(halfedge(fd, _graph), _graph)) { selected_halfedges.set(get(himap, hd)); selected_halfedges.set(get(himap, opposite(hd, _graph))); @@ -353,10 +351,10 @@ struct Face_filtered_graph selected_faces.reset(); selected_vertices.reset(); selected_halfedges.reset(); - BOOST_FOREACH(face_descriptor fd, selection) + for(face_descriptor fd : selection) { selected_faces.set(get(fimap, fd)); - BOOST_FOREACH(halfedge_descriptor hd, halfedges_around_face(halfedge(fd, _graph), _graph)) + for(halfedge_descriptor hd : halfedges_around_face(halfedge(fd, _graph), _graph)) { selected_halfedges.set(get(himap, hd)); selected_halfedges.set(get(himap, opposite(hd, _graph))); @@ -467,7 +465,7 @@ struct Face_filtered_graph /// there is at most one connected set of selected faces. bool is_selection_valid() { - BOOST_FOREACH(vertex_descriptor vd, vertices(*this) ) + for(vertex_descriptor vd : vertices(*this) ) { face_descriptor first_selected = boost::graph_traits::null_face(); bool first_unselected_found(false), diff --git a/BGL/include/CGAL/boost/graph/Seam_mesh.h b/BGL/include/CGAL/boost/graph/Seam_mesh.h index 58d6c65e94c..73e35ae949e 100644 --- a/BGL/include/CGAL/boost/graph/Seam_mesh.h +++ b/BGL/include/CGAL/boost/graph/Seam_mesh.h @@ -29,7 +29,6 @@ #include #include -#include #include #include @@ -1057,8 +1056,8 @@ public: /// \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 - /// described by pairs of integers, on the third line of the file. + /// \pre filename should be the name of a \cgal selection file with file extension "*.selection.txt": + /// edges are described by pairs of integers, on the third line of the file. template TM_halfedge_descriptor add_seams(const char* filename, const VdContainer& tm_vds) @@ -1067,7 +1066,7 @@ public: // Check the file type std::string str = filename; - if(str.substr(str.length() - 14) != ".selection.txt") { + if( (str.length()) < 14 || (str.substr(str.length() - 14) != ".selection.txt") ) { std::cerr << "Error: seams must be given by a *.selection.txt file" << std::endl; return tmhd; } @@ -1099,8 +1098,8 @@ public: /// /// \returns one of the halfedges of the seam mesh that is on a seam. /// - /// \pre filename should be the name of a CGAL selection file: edges are - /// described by pairs of integers, on the third line of the file. + /// \pre filename should be the name of a \cgal selection file with file extension "*.selection.txt": + /// edges are described by pairs of integers, on the third line of the file. TM_halfedge_descriptor add_seams(const char* filename) { std::vector tm_vds; diff --git a/BGL/include/CGAL/boost/graph/copy_face_graph.h b/BGL/include/CGAL/boost/graph/copy_face_graph.h index 6be3d3ac865..311a5c28cac 100644 --- a/BGL/include/CGAL/boost/graph/copy_face_graph.h +++ b/BGL/include/CGAL/boost/graph/copy_face_graph.h @@ -72,7 +72,7 @@ void copy_face_graph_impl(const SourceMesh& sm, TargetMesh& tm, tm_face_descriptor tm_null_face = boost::graph_traits::null_face(); //insert halfedges and create each vertex when encountering its halfedge - BOOST_FOREACH(sm_edge_descriptor sm_e, edges(sm)) + for(sm_edge_descriptor sm_e : edges(sm)) { tm_edge_descriptor tm_e = add_edge(tm); sm_halfedge_descriptor sm_h = halfedge(sm_e, sm), sm_h_opp = opposite(sm_h, sm); @@ -121,7 +121,7 @@ void copy_face_graph_impl(const SourceMesh& sm, TargetMesh& tm, } } //create faces and connect halfedges - BOOST_FOREACH(sm_face_descriptor sm_f, faces(sm)) + for(sm_face_descriptor sm_f : faces(sm)) { tm_face_descriptor tm_f = add_face(tm); *f2f++=std::make_pair(sm_f, tm_f); @@ -131,7 +131,7 @@ void copy_face_graph_impl(const SourceMesh& sm, TargetMesh& tm, set_halfedge(tm_f, tm_h_prev, tm); CGAL_precondition(*halfedges_around_face(sm_h_i, sm).first == sm_h_i); - BOOST_FOREACH(sm_halfedge_descriptor sm_h, halfedges_around_face(sm_h_i, sm)) + for(sm_halfedge_descriptor sm_h : halfedges_around_face(sm_h_i, sm)) { tm_halfedge_descriptor tm_h = get(hmap, sm_h); set_next(tm_h_prev, tm_h, tm); @@ -151,7 +151,7 @@ void copy_face_graph_impl(const SourceMesh& sm, TargetMesh& tm, tm_halfedge_descriptor tm_h_prev = tm_h; CGAL_precondition(*halfedges_around_face(sm_border_halfedges[i], sm).first == sm_border_halfedges[i]); - BOOST_FOREACH(sm_halfedge_descriptor sm_h, + for(sm_halfedge_descriptor sm_h : halfedges_around_face(next(sm_border_halfedges[i], sm), sm)) { CGAL_assertion(next(tm_h_prev, tm) == tm_h_prev); diff --git a/BGL/include/CGAL/boost/graph/dijkstra_shortest_paths.hpp b/BGL/include/CGAL/boost/graph/dijkstra_shortest_paths.hpp index 0ae2eef517d..90a72cd0c00 100644 --- a/BGL/include/CGAL/boost/graph/dijkstra_shortest_paths.hpp +++ b/BGL/include/CGAL/boost/graph/dijkstra_shortest_paths.hpp @@ -10,7 +10,7 @@ // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) +// https://www.boost.org/LICENSE_1_0.txt) //======================================================================= // // $URL$ diff --git a/BGL/include/CGAL/boost/graph/helpers.h b/BGL/include/CGAL/boost/graph/helpers.h index d574d7cc9ca..85a468bf33a 100644 --- a/BGL/include/CGAL/boost/graph/helpers.h +++ b/BGL/include/CGAL/boost/graph/helpers.h @@ -22,7 +22,6 @@ #define CGAL_BOOST_GRAPH_HELPERS_H -#include #include #include #include @@ -104,7 +103,7 @@ template bool is_closed(const FaceGraph& g) { typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; - BOOST_FOREACH(halfedge_descriptor hd, halfedges(g)){ + for(halfedge_descriptor hd : halfedges(g)){ if(is_border(hd,g)){ return false; } @@ -131,7 +130,7 @@ template { typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; - BOOST_FOREACH(vertex_descriptor vd, vertices(g)){ + for(vertex_descriptor vd : vertices(g)){ halfedge_descriptor hd = halfedge(vd,g); if((hd == boost::graph_traits::null_halfedge()) || (! is_bivalent(hd,g))){ @@ -161,7 +160,7 @@ template { typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; - BOOST_FOREACH(vertex_descriptor vd, vertices(g)){ + for(vertex_descriptor vd : vertices(g)){ halfedge_descriptor hd = halfedge(vd,g); if((hd == boost::graph_traits::null_halfedge()) || (! is_trivalent(halfedge(hd,g),g))){ @@ -207,7 +206,7 @@ template bool is_triangle_mesh(const FaceGraph& g) { typedef typename boost::graph_traits::face_descriptor face_descriptor; - BOOST_FOREACH(face_descriptor fd, faces(g)){ + for(face_descriptor fd : faces(g)){ if(! is_triangle(halfedge(fd,g),g)){ return false; } @@ -251,7 +250,7 @@ template bool is_quad_mesh(const FaceGraph& g) { typedef typename boost::graph_traits::face_descriptor face_descriptor; - BOOST_FOREACH(face_descriptor fd, faces(g)){ + for(face_descriptor fd : faces(g)){ if(! is_quad(halfedge(fd,g),g)){ return false; } @@ -388,7 +387,7 @@ bool is_valid_halfedge_graph(const Graph& g, bool verb = false) // All halfedges. halfedges_size_type n = 0; - BOOST_FOREACH(halfedge_descriptor begin, halfedges(g)) { + for(halfedge_descriptor begin : halfedges(g)) { if(!valid) break; verr << "halfedge " << n << std::endl; @@ -440,7 +439,7 @@ bool is_valid_halfedge_graph(const Graph& g, bool verb = false) // All vertices. vertex_size_type v = 0; n = 0; - BOOST_FOREACH(vertex_descriptor vbegin, vertices(g)){ + for(vertex_descriptor vbegin : vertices(g)){ if(!valid) break; verr << "vertex " << v << std::endl; @@ -480,7 +479,7 @@ bool is_valid_halfedge_graph(const Graph& g, bool verb = false) // All halfedges. n = 0; - BOOST_FOREACH(halfedge_descriptor i, halfedges(g)){ + for(halfedge_descriptor i : halfedges(g)){ verr << "halfedge " << n << std::endl; // At least triangular facets and distinct geometry. valid = valid && ( next(i, g) != i); @@ -538,7 +537,7 @@ bool is_valid_face_graph(const Graph& g, bool verb = false) faces_size_type f = 0; std::size_t n = 0; halfedges_size_type nb = 0; - BOOST_FOREACH(face_descriptor fbegin, faces(g)){ + for(face_descriptor fbegin : faces(g)){ if(!valid) break; verr << "face " << f << std::endl; @@ -571,7 +570,7 @@ bool is_valid_face_graph(const Graph& g, bool verb = false) if ( valid && f != num_f) verr << "counting faces failed." << std::endl; - BOOST_FOREACH(halfedge_descriptor i, halfedges(g)){ + for(halfedge_descriptor i : halfedges(g)){ //counting borders if ( is_border(i, g)) ++nb; @@ -619,7 +618,7 @@ bool is_valid_polygon_mesh(const Mesh& g, bool verb = false) bool valid=is_valid_face_graph(g, verb); //test for 2-manifoldness // Distinct facets on each side of an halfedge. - BOOST_FOREACH(halfedge_descriptor i, halfedges(g)){ + for(halfedge_descriptor i : halfedges(g)){ valid = valid && (face(i, g) != face(opposite(i, g), g)); if ( ! valid) { verr << " both incident facets are equal." << std::endl; @@ -1383,9 +1382,9 @@ void swap_vertices( halfedge_descriptor hq=halfedge(q, g); halfedge_descriptor hp=halfedge(p, g); - BOOST_FOREACH(halfedge_descriptor h, halfedges_around_target(hq, g)) + for(halfedge_descriptor h : halfedges_around_target(hq, g)) set_target(h, p, g); - BOOST_FOREACH(halfedge_descriptor h, halfedges_around_target(hp, g)) + for(halfedge_descriptor h : halfedges_around_target(hp, g)) set_target(h, q, g); set_halfedge(p, hq, g); set_halfedge(q, hp, g); diff --git a/BGL/include/CGAL/boost/graph/io.h b/BGL/include/CGAL/boost/graph/io.h index cb5c8082b21..ade5d54f684 100644 --- a/BGL/include/CGAL/boost/graph/io.h +++ b/BGL/include/CGAL/boost/graph/io.h @@ -22,7 +22,6 @@ #define CGAL_BOOST_GRAPH_IO_H #include -#include #include #include @@ -87,15 +86,15 @@ bool write_wrl(std::ostream& os, "coord Coordinate {\n" "point [\n"; - BOOST_FOREACH(vertex_descriptor v, vertices(g)){ + for(vertex_descriptor v : vertices(g)){ os << get(vpm,v) << ",\n"; reindex[v]=n++; } os << "] #point\n" "} #coord Coordinate\n" "coordIndex [\n"; - BOOST_FOREACH(face_descriptor f, faces(g)){ - BOOST_FOREACH(vertex_descriptor v, vertices_around_face(halfedge(f,g),g)){ + for(face_descriptor f : faces(g)){ + for(vertex_descriptor v : vertices_around_face(halfedge(f,g),g)){ os << reindex[v] << ","; } os << "-1,\n"; @@ -152,14 +151,14 @@ bool write_off(std::ostream& os, os << "OFF\n" << nv << " " << nf << " 0\n"; boost::container::flat_map reindex; int n = 0; - BOOST_FOREACH(vertex_descriptor v, vertices(g)){ + for(vertex_descriptor v : vertices(g)){ os << get(vpm,v) << '\n'; reindex[v]=n++; } - BOOST_FOREACH(face_descriptor f, faces(g)){ + for(face_descriptor f : faces(g)){ os << degree(f,g); - BOOST_FOREACH(vertex_descriptor v, vertices_around_face(halfedge(f,g),g)){ + for(vertex_descriptor v : vertices_around_face(halfedge(f,g),g)){ os << " " << reindex[v]; } os << '\n'; @@ -376,16 +375,16 @@ bool write_inp(std::ostream& os, os << "*Part, name=" << name << "\n*Node\n"; boost::container::flat_map reindex; int n = 1; - BOOST_FOREACH(vertex_descriptor v, vertices(g)){ + for(vertex_descriptor v : vertices(g)){ Point_3 p = get(vpm,v); os << n << ", " << p.x() << ", " << p.y() << ", " << p.z() << '\n'; reindex[v]=n++; } n = 1; os << "*Element, type=" << type << std::endl; - BOOST_FOREACH(face_descriptor f, faces(g)){ + for(face_descriptor f : faces(g)){ os << n++; - BOOST_FOREACH(vertex_descriptor v, vertices_around_face(halfedge(f,g),g)){ + for(vertex_descriptor v : vertices_around_face(halfedge(f,g),g)){ os << ", " << reindex[v]; } os << '\n'; @@ -431,7 +430,7 @@ write_polys(std::ostream& os, { off += 3; offsets.push_back(off); - BOOST_FOREACH(vertex_descriptor v, + for(vertex_descriptor v : vertices_around_face(halfedge(*fit, mesh), mesh)) connectivity_table.push_back(V[v]); } @@ -481,7 +480,7 @@ write_polys_tag(std::ostream& os, fit != faces(mesh).end() ; ++fit ) { - BOOST_FOREACH(vertex_descriptor v, + for(vertex_descriptor v : vertices_around_face(halfedge(*fit, mesh), mesh)) os << V[v] << " "; } diff --git a/BGL/include/CGAL/boost/graph/named_function_params.h b/BGL/include/CGAL/boost/graph/named_function_params.h index 205269a856d..9ec2365d134 100644 --- a/BGL/include/CGAL/boost/graph/named_function_params.h +++ b/BGL/include/CGAL/boost/graph/named_function_params.h @@ -6,7 +6,7 @@ // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) +// https://www.boost.org/LICENSE_1_0.txt) //======================================================================= // Copyright (c) 2007 GeometryFactory (France). All rights reserved. // diff --git a/BGL/include/CGAL/boost/graph/named_params_helper.h b/BGL/include/CGAL/boost/graph/named_params_helper.h index e585269eba0..90e8bdc08cd 100644 --- a/BGL/include/CGAL/boost/graph/named_params_helper.h +++ b/BGL/include/CGAL/boost/graph/named_params_helper.h @@ -6,7 +6,7 @@ // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) +// https://www.boost.org/LICENSE_1_0.txt) //======================================================================= // Copyright (c) 2007-2015 GeometryFactory (France). All rights reserved. // diff --git a/BGL/include/CGAL/boost/graph/properties.h b/BGL/include/CGAL/boost/graph/properties.h index 9a86de3f6b8..f9a915dba68 100644 --- a/BGL/include/CGAL/boost/graph/properties.h +++ b/BGL/include/CGAL/boost/graph/properties.h @@ -25,7 +25,6 @@ #include #include #include -#include #include #include #include @@ -132,7 +131,7 @@ void init_face_indices(PolygonMesh& pm, Tag) { typename boost::property_traits::value_type i = 0; - BOOST_FOREACH(typename boost::graph_traits::face_descriptor fd, + for(typename boost::graph_traits::face_descriptor fd : faces(pm)) { put(fid, fd, i); @@ -146,7 +145,7 @@ void init_vertex_indices(PolygonMesh& pm, Tag) { typename boost::property_traits::value_type i = 0; - BOOST_FOREACH(typename boost::graph_traits::vertex_descriptor vd, + for(typename boost::graph_traits::vertex_descriptor vd : vertices(pm)) { put(vid, vd, i); @@ -160,7 +159,7 @@ void init_halfedge_indices(PolygonMesh& pm, Tag) { typename boost::property_traits::value_type i = 0; - BOOST_FOREACH(typename boost::graph_traits::halfedge_descriptor hd, + for(typename boost::graph_traits::halfedge_descriptor hd : halfedges(pm)) { put(hid, hd, i); diff --git a/BGL/include/CGAL/boost/graph/selection.h b/BGL/include/CGAL/boost/graph/selection.h index d44c297a696..7768d62b792 100644 --- a/BGL/include/CGAL/boost/graph/selection.h +++ b/BGL/include/CGAL/boost/graph/selection.h @@ -22,7 +22,6 @@ #define CGAL_BOOST_GRAPH_SELECTION_H #include -#include #include #include @@ -45,10 +44,10 @@ extract_selection_boundary( typedef typename GT::face_descriptor face_descriptor; typedef typename GT::halfedge_descriptor halfedge_descriptor; - BOOST_FOREACH(face_descriptor fd, face_range) + for(face_descriptor fd : face_range) { - BOOST_FOREACH( halfedge_descriptor h, - halfedges_around_face(halfedge(fd, fg), fg) ) + for(halfedge_descriptor h : + halfedges_around_face(halfedge(fd, fg), fg) ) { halfedge_descriptor opp_hd = opposite(h, fg); face_descriptor opp_fd = face( opp_hd, fg ); @@ -114,7 +113,7 @@ expand_face_selection( //collect faces around the target vertex of the selection boundary halfedges std::set new_selection_set; - BOOST_FOREACH(halfedge_descriptor hd, selection_boundary_halfedges) + for(halfedge_descriptor hd : selection_boundary_halfedges) { face_descriptor fd=face(hd, fg); while( !get(is_selected,fd) ) @@ -128,7 +127,7 @@ expand_face_selection( // extract unique selection std::vector new_selection; - BOOST_FOREACH(face_descriptor fd, new_selection_set) + for(face_descriptor fd : new_selection_set) { *out++=fd; new_selection.push_back(fd); @@ -184,7 +183,7 @@ reduce_face_selection( //collect faces around the target vertex of the selection boundary halfedges std::set elements_to_remove; - BOOST_FOREACH(halfedge_descriptor hd, selection_boundary_halfedges) + for(halfedge_descriptor hd : selection_boundary_halfedges) { hd = opposite(hd, fg); face_descriptor fd=face( hd, fg ); @@ -197,7 +196,7 @@ reduce_face_selection( } /// update is-selected attribute and output iterator - BOOST_FOREACH(face_descriptor fd, elements_to_remove) + for(face_descriptor fd : elements_to_remove) { *out++=fd; put( is_selected, fd, false ); @@ -205,7 +204,7 @@ reduce_face_selection( // update the set of currently selected faces std::vector new_selection; - BOOST_FOREACH(face_descriptor fd, current_selection) + for(face_descriptor fd : current_selection) if ( !elements_to_remove.count(fd) ) new_selection.push_back(fd); current_selection.swap(new_selection); @@ -239,7 +238,7 @@ select_incident_faces( //collect faces around the target vertex of the selection boundary halfedges std::set selection_set; - BOOST_FOREACH(halfedge_descriptor hd, hedges) + for(halfedge_descriptor hd : hedges) { halfedge_descriptor first = hd; face_descriptor fd=face(hd, fg); @@ -294,15 +293,15 @@ expand_edge_selection( //collect adjacent edges not already selected std::set new_selection_set; - BOOST_FOREACH(edge_descriptor ed, current_selection) + for(edge_descriptor ed : current_selection) { halfedge_descriptor hdi=halfedge(ed,fg); - BOOST_FOREACH(halfedge_descriptor hd, halfedges_around_source( hdi, fg)) + for(halfedge_descriptor hd : halfedges_around_source( hdi, fg)) { edge_descriptor ned=edge(hd, fg); if (!get(is_selected, ned)) new_selection_set.insert(ned); } - BOOST_FOREACH(halfedge_descriptor hd, halfedges_around_target( hdi, fg)) + for(halfedge_descriptor hd : halfedges_around_target( hdi, fg)) { edge_descriptor ned=edge(hd, fg); if (!get(is_selected, ned)) new_selection_set.insert(ned); @@ -311,7 +310,7 @@ expand_edge_selection( // extract unique selection std::vector new_selection; - BOOST_FOREACH(edge_descriptor ed, new_selection_set) + for(edge_descriptor ed : new_selection_set) { *out++=ed; new_selection.push_back(ed); @@ -357,10 +356,10 @@ reduce_edge_selection( // extract the set of vertices on the border std::set unique_vertex_set; - BOOST_FOREACH(edge_descriptor ed, selection) + for(edge_descriptor ed : selection) { halfedge_descriptor hd=halfedge(ed,fg); - BOOST_FOREACH(halfedge_descriptor nhd, halfedges_around_source( hd, fg)) + for(halfedge_descriptor nhd : halfedges_around_source( hd, fg)) { edge_descriptor ned=edge(nhd, fg); if (!get(is_selected, ned)){ @@ -368,7 +367,7 @@ reduce_edge_selection( break; } } - BOOST_FOREACH(halfedge_descriptor nhd, halfedges_around_target( hd, fg)) + for(halfedge_descriptor nhd : halfedges_around_target( hd, fg)) { edge_descriptor ned=edge(nhd, fg); if (!get(is_selected, ned)){ @@ -386,8 +385,8 @@ reduce_edge_selection( //collect incident edges selected std::set edges_to_deselect; unique_vertex_set.clear(); - BOOST_FOREACH(vertex_descriptor vd, current_selection_border) - BOOST_FOREACH(halfedge_descriptor hd, halfedges_around_target( halfedge(vd,fg), fg)) + for(vertex_descriptor vd : current_selection_border) + for(halfedge_descriptor hd : halfedges_around_target( halfedge(vd,fg), fg)) { edge_descriptor ed = edge(hd, fg); if (get(is_selected, ed)){ @@ -397,7 +396,7 @@ reduce_edge_selection( } // extract unique selection - BOOST_FOREACH(edge_descriptor ed, edges_to_deselect) + for(edge_descriptor ed : edges_to_deselect) { *out++=ed; put( is_selected, ed, false ); @@ -446,13 +445,13 @@ expand_vertex_selection( //collect adjacent vertices not already selected std::set new_selection_set; - BOOST_FOREACH(vertex_descriptor vd, current_selection) - BOOST_FOREACH(vertex_descriptor nvd, vertices_around_target( halfedge(vd,fg), fg)) + for(vertex_descriptor vd : current_selection) + for(vertex_descriptor nvd : vertices_around_target( halfedge(vd,fg), fg)) if (!get(is_selected, nvd)) new_selection_set.insert(nvd); // extract unique selection std::vector new_selection; - BOOST_FOREACH(vertex_descriptor vd, new_selection_set) + for(vertex_descriptor vd : new_selection_set) { *out++=vd; new_selection.push_back(vd); @@ -496,8 +495,8 @@ reduce_vertex_selection( // collect vertices incident to a selected one std::set unique_vertex_set; - BOOST_FOREACH(vertex_descriptor vd, selection) - BOOST_FOREACH(vertex_descriptor nvd, vertices_around_target( halfedge(vd,fg), fg)) + for(vertex_descriptor vd : selection) + for(vertex_descriptor nvd : vertices_around_target( halfedge(vd,fg), fg)) if (!get(is_selected, nvd)) unique_vertex_set.insert(nvd); std::vector current_selection_border(unique_vertex_set.begin(), unique_vertex_set.end()); @@ -507,13 +506,13 @@ reduce_vertex_selection( //collect adjacent vertices selected std::set vertices_to_deselect; - BOOST_FOREACH(vertex_descriptor vd, current_selection_border) - BOOST_FOREACH(vertex_descriptor nvd, vertices_around_target( halfedge(vd,fg), fg)) + for(vertex_descriptor vd : current_selection_border) + for(vertex_descriptor nvd : vertices_around_target( halfedge(vd,fg), fg)) if (get(is_selected, nvd)) vertices_to_deselect.insert(nvd); // extract unique selection std::vector new_selection_border; - BOOST_FOREACH(vertex_descriptor vd, vertices_to_deselect) + for(vertex_descriptor vd : vertices_to_deselect) { *out++=vd; new_selection_border.push_back(vd); @@ -557,7 +556,7 @@ void expand_face_selection_for_removal(const FaceRange& faces_to_be_deleted, boost::unordered_set vertices_queue; // collect vertices belonging to at least a triangle that will be removed - BOOST_FOREACH(face_descriptor fd, faces_to_be_deleted) + for(face_descriptor fd : faces_to_be_deleted) { halfedge_descriptor h = halfedge(fd, tm); vertices_queue.insert( target(h, tm) ); @@ -615,7 +614,7 @@ void expand_face_selection_for_removal(const FaceRange& faces_to_be_deleted, if (next_around_vertex==start) break; - BOOST_FOREACH(halfedge_descriptor f_hd, faces_traversed) + for(halfedge_descriptor f_hd : faces_traversed) { assert(target(f_hd, tm) == vd); put(is_selected, face(f_hd, tm), true); @@ -637,9 +636,9 @@ bool is_selection_a_topological_disk(const FaceRange& face_selection, typedef typename boost::graph_traits::edge_descriptor edge_descriptor; boost::unordered_set sel_vertices; boost::unordered_set sel_edges; - BOOST_FOREACH(face_descriptor f, face_selection) + for(face_descriptor f : face_selection) { - BOOST_FOREACH(halfedge_descriptor h, halfedges_around_face(halfedge(f, pm), pm)) + for(halfedge_descriptor h : halfedges_around_face(halfedge(f, pm), pm)) { sel_vertices.insert(target(h, pm)); sel_edges.insert(edge(h,pm)); 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 2fc9ed6b461..ae78df3ce8c 100644 --- a/BGL/include/CGAL/boost/graph/split_graph_into_polylines.h +++ b/BGL/include/CGAL/boost/graph/split_graph_into_polylines.h @@ -26,10 +26,10 @@ #include #include #include -#include #include #include #include +#include namespace CGAL { @@ -158,7 +158,7 @@ void duplicate_terminal_vertices(Graph& graph, vertex_iterator b,e; boost::tie(b,e) = vertices(graph); std::vector V(b,e); - BOOST_FOREACH(vertex_descriptor v, V) + for(vertex_descriptor v : V) { typename boost::graph_traits::vertex_descriptor orig_v = graph[v]; typename boost::graph_traits::degree_size_type deg = degree(v, graph); @@ -186,12 +186,12 @@ void duplicate_terminal_vertices(Graph& graph, // check all vertices are of degree 1 or 2 and that the source // and target of each edge are different vertices with different ids CGAL_assertion_code( - BOOST_FOREACH(vertex_descriptor v, vertices(graph)){ + for(vertex_descriptor v : make_range(vertices(graph))){ typename boost::graph_traits::degree_size_type n = degree(v, graph); CGAL_assertion( n == 0 || n == 1 || n == 2); } - BOOST_FOREACH(edge_descriptor e, edges(graph)){ + for(edge_descriptor e : make_range(edges(graph))){ vertex_descriptor v = target(e, graph); vertex_descriptor w = source(e, graph); CGAL_assertion(v != w); @@ -267,13 +267,13 @@ split_graph_into_polylines(const Graph& graph, typename graph_traits::vertex_descriptor> V2vmap; V2vmap v2vmap; - BOOST_FOREACH(Graph_vertex_descriptor v, vertices(graph)){ + for(Graph_vertex_descriptor v : make_range(vertices(graph))){ vertex_descriptor vc = add_vertex(g_copy); g_copy[vc] = v; v2vmap[v] = vc; } - BOOST_FOREACH(Graph_edge_descriptor e, edges(graph)){ + for(Graph_edge_descriptor e : make_range(edges(graph))){ Graph_vertex_descriptor vs = source(e,graph); Graph_vertex_descriptor vt = target(e,graph); CGAL_warning_msg(vs != vt, "ignore self loops"); @@ -294,7 +294,7 @@ split_graph_into_polylines(const Graph& graph, G_copy_less g_copy_less(g_copy, less); std::set terminal(g_copy_less); - BOOST_FOREACH(vertex_descriptor v, vertices(g_copy)){ + for(vertex_descriptor v : make_range(vertices(g_copy))){ typename graph_traits::degree_size_type n = degree(v, g_copy); if ( n == 1 ) terminal.insert(v); if ( n ==0 ){ diff --git a/BGL/test/BGL/test_Collapse_edge.cpp b/BGL/test/BGL/test_Collapse_edge.cpp index d1f9e0e22d8..1fc66f17c8e 100644 --- a/BGL/test/BGL/test_Collapse_edge.cpp +++ b/BGL/test/BGL/test_Collapse_edge.cpp @@ -14,7 +14,7 @@ halfedge_descriptor find_halfedge(double x1, double y1, typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; VPMAP vpmap = get(CGAL::vertex_point, m); - BOOST_FOREACH(halfedge_descriptor h, halfedges(m)) + for(halfedge_descriptor h : halfedges(m)) { if(get(vpmap, source(h, m)) == Point(x1,y1,0) && get(vpmap, target(h, m)) == Point(x2,y2,0)) @@ -61,7 +61,7 @@ collapse_edge_test() bool ok = CGAL::Euler::collapse_edge(edge(he, test_mesh), test_mesh) == v1; assert(ok); char found = 0; - BOOST_FOREACH(halfedge_descriptor it, CGAL::halfedges_around_target(v1,test_mesh)) + for(halfedge_descriptor it : CGAL::halfedges_around_target(v1,test_mesh)) { if(it == eno || it == eno_prime){ @@ -90,7 +90,7 @@ collapse_edge_test() bool ok = CGAL::Euler::collapse_edge(edge(he, test_mesh), test_mesh) == v1; assert(ok); char found = 0; - BOOST_FOREACH(halfedge_descriptor it, CGAL::halfedges_around_target(v1,test_mesh)) + for(halfedge_descriptor it : CGAL::halfedges_around_target(v1,test_mesh)) { if(it == eno || it == eno_prime){ @@ -118,7 +118,7 @@ collapse_edge_test() bool ok = CGAL::Euler::collapse_edge(edge(he, test_mesh), test_mesh) == v1; assert(ok); char found = 0; - BOOST_FOREACH(halfedge_descriptor it, CGAL::halfedges_around_target(v1,test_mesh)) + for(halfedge_descriptor it : CGAL::halfedges_around_target(v1,test_mesh)) { if(it == eno || it == eno_prime){ @@ -156,7 +156,7 @@ collapse_edge_test() bool ok = CGAL::Euler::collapse_edge(edge(he, test_mesh), test_mesh) == v1; assert(ok); char found = 0; - BOOST_FOREACH(halfedge_descriptor it, CGAL::halfedges_around_target(v1,test_mesh)) + for(halfedge_descriptor it : CGAL::halfedges_around_target(v1,test_mesh)) { if(it == eno || it == eno_prime @@ -197,7 +197,7 @@ collapse_edge_test() bool ok = CGAL::Euler::collapse_edge(edge(he, test_mesh), test_mesh) == v1; assert(ok); char found = 0; - BOOST_FOREACH(halfedge_descriptor it, CGAL::halfedges_around_target(v1,test_mesh)) + for(halfedge_descriptor it : CGAL::halfedges_around_target(v1,test_mesh)) { if(it == ep) ++found; diff --git a/BGL/test/BGL/test_Euler_operations.cpp b/BGL/test/BGL/test_Euler_operations.cpp index 3ae73d6c38d..7b5439470a8 100644 --- a/BGL/test/BGL/test_Euler_operations.cpp +++ b/BGL/test/BGL/test_Euler_operations.cpp @@ -152,7 +152,7 @@ add_vertex_and_face_to_border_test() assert(dist == 2); int blength = 0; - BOOST_FOREACH(halfedge_descriptor hd, CGAL::halfedges_around_face(h1,m)){ + for(halfedge_descriptor hd : CGAL::halfedges_around_face(h1,m)){ CGAL_USE(hd); blength++; } @@ -163,7 +163,7 @@ add_vertex_and_face_to_border_test() assert(! CGAL::is_border(res,m)); assert(CGAL::is_border(opposite(res,m),m)); res = opposite(res,m); - BOOST_FOREACH(halfedge_descriptor hd, CGAL::halfedges_around_face(res,m)){ + for(halfedge_descriptor hd : CGAL::halfedges_around_face(res,m)){ CGAL_USE(hd); blength--; } @@ -394,8 +394,8 @@ test_swap_edges() { Graph g; CGAL::make_tetrahedron(pt,pt,pt,pt,g); - halfedge_descriptor h1 = *CGAL::cpp11::next(boost::begin(halfedges(g)), i); - halfedge_descriptor h2 = *CGAL::cpp11::next(boost::begin(halfedges(g)), j); + halfedge_descriptor h1 = *std::next(boost::begin(halfedges(g)), i); + halfedge_descriptor h2 = *std::next(boost::begin(halfedges(g)), j); CGAL::internal::swap_edges(h1, h2, g); CGAL_assertion(CGAL::is_valid_polygon_mesh(g)); } diff --git a/BGL/test/BGL/test_Face_filtered_graph.cpp b/BGL/test/BGL/test_Face_filtered_graph.cpp index 5446a660266..9e234d411f3 100644 --- a/BGL/test/BGL/test_Face_filtered_graph.cpp +++ b/BGL/test/BGL/test_Face_filtered_graph.cpp @@ -3,7 +3,6 @@ #include #include "test_Prefix.h" #include -#include #include #include #include @@ -279,7 +278,7 @@ template void test(const std::vector& graphs) { - BOOST_FOREACH(Graph p, graphs){ + for(Graph p : graphs){ test_read(p); test_vertex_iterators(p); test_out_edges(p); diff --git a/BGL/test/BGL/test_Manifold_face_removal.cpp b/BGL/test/BGL/test_Manifold_face_removal.cpp index 851399d67cc..97ab16b3026 100644 --- a/BGL/test/BGL/test_Manifold_face_removal.cpp +++ b/BGL/test/BGL/test_Manifold_face_removal.cpp @@ -28,7 +28,7 @@ int main() std::vector faces_to_remove; int index = 0; - BOOST_FOREACH(face_descriptor fh, faces(sm)) + for(face_descriptor fh : faces(sm)) { if(index_set.count(index)==0) is_selected_map[fh]=false; @@ -47,7 +47,7 @@ int main() boost::make_assoc_property_map(is_selected_map)); index=0; - BOOST_FOREACH(face_descriptor fh, faces(sm)) + for(face_descriptor fh : faces(sm)) { if (is_selected_map[fh]) { diff --git a/BGL/test/BGL/test_Properties.cpp b/BGL/test/BGL/test_Properties.cpp index b84e92b99de..07975c24940 100644 --- a/BGL/test/BGL/test_Properties.cpp +++ b/BGL/test/BGL/test_Properties.cpp @@ -1,7 +1,6 @@ #include "test_Prefix.h" #include -#include template< typename G, typename ForwardRange, @@ -80,26 +79,26 @@ main() { std::vector polys = poly_data(); - BOOST_FOREACH(Polyhedron p, polys){ + for(Polyhedron p : polys){ index_uniqueness_poly(p); } std::vector lccs = lcc_data(); - BOOST_FOREACH(LCC p, lccs){ + for(LCC p : lccs){ index_uniqueness_lcc(p); } #if defined(CGAL_USE_SURFACE_MESH) std::vector sms = sm_data(); - BOOST_FOREACH(SM p, sms){ + for(SM p : sms){ index_uniqueness_sm(p); } #endif #if defined(CGAL_USE_OPENMESH) std::vector omeshs = omesh_data(); - BOOST_FOREACH(OMesh p, omeshs){ + for(OMesh p : omeshs){ index_uniqueness_omesh(p); } #endif diff --git a/BGL/test/BGL/test_bgl_dual.cpp b/BGL/test/BGL/test_bgl_dual.cpp index 1456eec0cc7..8f14a234c38 100644 --- a/BGL/test/BGL/test_bgl_dual.cpp +++ b/BGL/test/BGL/test_bgl_dual.cpp @@ -4,7 +4,6 @@ #include #include -#include typedef CGAL::Simple_cartesian Kernel; typedef Kernel::Point_3 Point; @@ -30,14 +29,14 @@ int main() assert(hd != nhd); assert(hd == prev(nhd,dual)); assert(face(nhd,dual) == fd); - BOOST_FOREACH(halfedge_descriptor lhd, halfedges_around_face(hd,dual)){ + for(halfedge_descriptor lhd : halfedges_around_face(hd,dual)){ assert(face(lhd,dual) == fd); } vertex_descriptor vd = *vertices(dual).first; assert(target(halfedge(vd,dual),dual) == vd); - BOOST_FOREACH(halfedge_descriptor lhd, halfedges_around_target(halfedge(vd,dual),dual)){ + for(halfedge_descriptor lhd : halfedges_around_target(halfedge(vd,dual),dual)){ assert(target(lhd,dual) == vd); } diff --git a/BGL/test/BGL/test_circulator.cpp b/BGL/test/BGL/test_circulator.cpp index 1237d2e4801..c41847308ad 100644 --- a/BGL/test/BGL/test_circulator.cpp +++ b/BGL/test/BGL/test_circulator.cpp @@ -2,7 +2,6 @@ #include #include -#include #include #include @@ -134,7 +133,7 @@ int main(int argc, char* argv[]) } { - BOOST_FOREACH(edge_descriptor ed,out_edges(target(hd,P),P)){ + for(edge_descriptor ed : out_edges(target(hd,P),P)){ halfedge_descriptor hd2 = halfedge(ed,P); std::cout << get(CGAL::vertex_point, P, target(hd2,P)) << std::endl; } diff --git a/BGL/test/BGL/test_graph_traits.cpp b/BGL/test/BGL/test_graph_traits.cpp index 3224d91c010..102b04ff3ba 100644 --- a/BGL/test/BGL/test_graph_traits.cpp +++ b/BGL/test/BGL/test_graph_traits.cpp @@ -2,7 +2,6 @@ #include "test_Prefix.h" #include -#include #include #include @@ -262,7 +261,7 @@ template void test(const std::vector& graphs) { - BOOST_FOREACH(const Graph& p, graphs){ + for(const Graph& p : graphs){ test_edge_iterators(p); test_read(p); test_vertex_iterators(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 5c9edab1683..9ec647a34eb 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 @@ -43,7 +43,7 @@ Example's point pattern. \cgalExample{Barycentric_coordinates_2/Segment_coordinates_example.cpp} \subsection tri_example Triangle Coordinates -In this example we show how to use the class `CGAL::Barycentric_coordinates::Triangle_coordinates_2` with the `Simple_cartesian` kernel for double type. We compute coordinates for three sets of points: interior (green), boundary (red), and exterior (blue). Note that some of the coordinate values for the exterior points are negative. We use a standard container of the type `std::vector` and `std::insert_iterator` to access and store the resulting coordinate values. +In this example we show how to use the class `CGAL::Barycentric_coordinates::Triangle_coordinates_2` with the `Simple_cartesian` kernel for double type. We compute coordinates for three sets of points: interior (green), boundary (red), and exterior (blue). Note that some of the coordinate values for the exterior points are negative. We use a standard container of the type `std::vector` and `std::insert_iterator` to access and store the resulting coordinate values. \anchor tri_coord_example \cgalFigureBegin{tri__example,triangle_coordinates_example.png} @@ -53,12 +53,12 @@ Example's point pattern. \cgalExample{Barycentric_coordinates_2/Triangle_coordinates_example.cpp} \subsection wp_example Wachspress Coordinates -In the following example we create 1000 random points, then we take the convex hull of this set of points as our polygon, and compute Wachspress coordinates at all the defined points. We use the `Simple_cartesian` kernel with double type as a traits class and store obtained coordinate values in a container of the type `std::vector`. The output iterator is `std::back_insert_iterator`. +In the following example we create 1000 random points, then we take the convex hull of this set of points as our polygon, and compute Wachspress coordinates at all the defined points. We use the `Simple_cartesian` kernel with double type as a traits class and store obtained coordinate values in a container of the type `std::vector`. The output iterator is `std::back_insert_iterator`. \cgalExample{Barycentric_coordinates_2/Wachspress_coordinates_example.cpp} \subsection dh_example Discrete Harmonic Coordinates -In this example we compute discrete harmonic coordinates for a set of green (interior), red (boundary), and blue (exterior) points with respect to a unit square. We also show how to specify the location of a query point using additional function parameters. The used kernel is exact, and we use an output container of the type `std::vector`. Since all the points are symmetric, it is easy to debug the correctness of the obtained coordinate values. The output iterator is `std::back_insert_iterator`. +In this example we compute discrete harmonic coordinates for a set of green (interior), red (boundary), and blue (exterior) points with respect to a unit square. We also show how to specify the location of a query point using additional function parameters. The used kernel is exact, and we use an output container of the type `std::vector`. Since all the points are symmetric, it is easy to debug the correctness of the obtained coordinate values. The output iterator is `std::back_insert_iterator`. \anchor dh_coord_example \cgalFigureBegin{dh__example,discrete_harmonic_coordinates_example.png} @@ -68,7 +68,7 @@ Example's point pattern. \cgalExample{Barycentric_coordinates_2/Discrete_harmonic_coordinates_example.cpp} \subsection mv_example Mean Value Coordinates -This is an example that shows how to compute mean value coordinates for a set of green points in a star-shaped polygon. We note that this type of coordinates is well-defined for such a concave polygon while Wachspress and discrete harmonic coordinates are not. However, it may give negative coordinate values for points outside the polygon's kernel (shown in red). We use an inexact data type, an output container of the type `std::vector`, and an output iterator of the type std::back_insert_iterator to compute, access, and store the resulting coordinate values. We also show how to choose different algorithms to compute generalized barycentric coordinates (one is more precise while the other is faster). +This is an example that shows how to compute mean value coordinates for a set of green points in a star-shaped polygon. We note that this type of coordinates is well-defined for such a concave polygon while Wachspress and discrete harmonic coordinates are not. However, it may give negative coordinate values for points outside the polygon's kernel (shown in red). We use an inexact data type, an output container of the type `std::vector`, and an output iterator of the type std::back_insert_iterator to compute, access, and store the resulting coordinate values. We also show how to choose different algorithms to compute generalized barycentric coordinates (one is more precise while the other is faster). \anchor mv_coord_example \cgalFigureBegin{mv__example,mean_value_coordinates_example.png} @@ -193,7 +193,7 @@ After the normalization of these weights as before
\f$b_i = \frac{w_i}{W^{mv}}\qquad\f$ with \f$\qquad W^{mv} = \sum_{j=1}^n w_j\f$
-we obtain the precise \f$O(n^2)\f$ algorithm. The fast O(n) algorithm computes the weights \f$w_i\f$ using the pseudocode from here. These weights +we obtain the precise \f$O(n^2)\f$ algorithm. The fast O(n) algorithm computes the weights \f$w_i\f$ using the pseudocode from here. These weights
\f$w_i = \frac{t_{i-1} + t_i}{r_i}\qquad\f$ with \f$\qquad t_i = \frac{\text{det}(d_i, d_{i+1})}{r_ir_{i+1} + d_id_{i+1}}\f$
@@ -231,7 +231,7 @@ The package is implemented in a way that later, if needed, other two-dimensional \section gbc_theory Theory of 2D Generalized Barycentric Coordinates -In 1827, the German mathematician and theoretical astronomer August Ferdinand Möbius (1790--1868) proposed a method \cite cgal:bc:m-dbc-27 to find coordinates of a point in the plane with respect to the vertices of a triangle. These coordinates are called triangle barycentric coordinates (sometimes area coordinates), and they are widely used in a variety of applications. Some of these applications are linear interpolation over a triangle and a triangle inclusion test. The first one is used for so-called shading, and the second one arises in the rasterization step when an image in vector graphics format needs to be converted into a raster image. +In 1827, the German mathematician and theoretical astronomer August Ferdinand Möbius (1790--1868) proposed a method \cite cgal:bc:m-dbc-27 to find coordinates of a point in the plane with respect to the vertices of a triangle. These coordinates are called triangle barycentric coordinates (sometimes area coordinates), and they are widely used in a variety of applications. Some of these applications are linear interpolation over a triangle and a triangle inclusion test. The first one is used for so-called shading, and the second one arises in the rasterization step when an image in vector graphics format needs to be converted into a raster image. Triangle barycentric coordinates have many important properties, including \em constant and linear precision, the Lagrange property, and positivity inside a triangle. These properties make these coordinates a unique tool in many scientific fields. If we restrict triangle coordinates to one of the edges of a triangle and its supporting line, we get barycentric coordinates with respect to a segment and call them \ref compute_seg_coord "segment coordinates". @@ -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 PkgSurfaceMeshParameterization "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. @@ -276,7 +276,7 @@ Mean value coordinates with respect to \f$v_3\f$. The colour bar indicates the r Interesting fact: all the coordinates discussed in this section and implemented in the package come from one and the same family of generalized barycentric coordinates named 3-point family of coordinates \cite cgal:bc:fhk-gcbcocp-06. \section gbc_acknowledgments Acknowledgments -The authors wish to thank Teseo Schneider and Randolf Schaerfig for helpful comments and discussions. We also appreciate the great effort invested in this package by our reviewers Andreas Fabri and Sébastien Loriot. Finally, to create pictures for this manual, we used two programs: Geogebra and Matlab. +The authors wish to thank Teseo Schneider and Randolf Schaerfig for helpful comments and discussions. We also appreciate the great effort invested in this package by our reviewers Andreas Fabri and Sébastien Loriot. Finally, to create pictures for this manual, we used two programs: Geogebra and Matlab. */ diff --git a/Barycentric_coordinates_2/examples/Barycentric_coordinates_2/Segment_coordinates_example.cpp b/Barycentric_coordinates_2/examples/Barycentric_coordinates_2/Segment_coordinates_example.cpp index 33da1812635..56ce6402c48 100644 --- a/Barycentric_coordinates_2/examples/Barycentric_coordinates_2/Segment_coordinates_example.cpp +++ b/Barycentric_coordinates_2/examples/Barycentric_coordinates_2/Segment_coordinates_example.cpp @@ -10,7 +10,7 @@ typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel; typedef Kernel::FT Scalar; typedef Kernel::Point_2 Point; -typedef CGAL::cpp11::array Pair; +typedef std::array Pair; using std::cout; using std::endl; using std::string; @@ -29,7 +29,7 @@ int main() }; // Compute segment coordinates for all the defined points. - // We use a global function and return the segment coordinates stored in an array of the type CGAL::cpp11::array. + // We use a global function and return the segment coordinates stored in an array of the type std::array. cout << endl << "Computed segment coordinates: " << endl << endl; for(int i = 0; i < 5; ++i) { const Pair pair = BC::compute_segment_coordinates_2(first_vertex, second_vertex, query_points[i], Kernel()); diff --git a/Barycentric_coordinates_2/examples/Barycentric_coordinates_2/Wachspress_coordinates_example.cpp b/Barycentric_coordinates_2/examples/Barycentric_coordinates_2/Wachspress_coordinates_example.cpp index bb02864713c..8c322404836 100644 --- a/Barycentric_coordinates_2/examples/Barycentric_coordinates_2/Wachspress_coordinates_example.cpp +++ b/Barycentric_coordinates_2/examples/Barycentric_coordinates_2/Wachspress_coordinates_example.cpp @@ -30,7 +30,7 @@ int main() // Generate a set of random points. CGAL::Random_points_in_square_2 point_generator(1.0); - CGAL::cpp11::copy_n(point_generator, number_of_points, std::back_inserter(points)); + std::copy_n(point_generator, number_of_points, std::back_inserter(points)); // Find the convex hull of the generated set of points. // This convex hull gives the vertices of a convex polygon that contains all the generated points. 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 cbd74d8fb21..d94d1a54ac5 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 @@ -217,7 +217,7 @@ private: */ template - inline CGAL::cpp11::array compute_segment_coordinates_2(const typename Traits::Point_2 &first_vertex, const typename Traits::Point_2 &second_vertex, const typename Traits::Point_2 &query_point, const Traits &barycentric_traits = Traits()) + inline std::array compute_segment_coordinates_2(const typename Traits::Point_2 &first_vertex, const typename Traits::Point_2 &second_vertex, const typename Traits::Point_2 &query_point, const Traits &barycentric_traits = Traits()) { // Some predefined functions. typename Traits::Compute_scalar_product_2 scalar_product_2 = barycentric_traits.compute_scalar_product_2_object(); @@ -230,7 +230,7 @@ template const FT opposite_scalar_product = scalar_product_2(query_point - second_vertex, first_vertex - second_vertex); const FT b_first = opposite_scalar_product / squared_distance_2(first_vertex, second_vertex); - // Return the CGAL::cpp11::array type of coordinates. + // Return the std::array type of coordinates. return CGAL::make_array(b_first, FT(1) - b_first); } 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 8d8222db4aa..f38d91822a2 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 @@ -51,7 +51,7 @@ namespace Barycentric_coordinates { /*! * \ingroup PkgBarycentricCoordinates2Ref * The class `Triangle_coordinates_2` implements barycentric coordinates ( [1], - * [2] ) with respect to an arbitrary non-degenerate triangle in the plane. + * [2] ) with respect to an arbitrary non-degenerate triangle in the plane. * This class is parameterized by a traits class `Traits`. \tparam Traits must be a model of the concept `BarycentricTraits_2`. @@ -237,7 +237,7 @@ private: */ template - inline CGAL::cpp11::array compute_triangle_coordinates_2(const typename Traits::Point_2 &first_vertex, const typename Traits::Point_2 &second_vertex, const typename Traits::Point_2 &third_vertex, const typename Traits::Point_2 &query_point, const Traits &barycentric_traits = Traits()) + inline std::array compute_triangle_coordinates_2(const typename Traits::Point_2 &first_vertex, const typename Traits::Point_2 &second_vertex, const typename Traits::Point_2 &third_vertex, const typename Traits::Point_2 &query_point, const Traits &barycentric_traits = Traits()) { // Some predefined functions. typename Traits::Compute_area_2 area_2 = barycentric_traits.compute_area_2_object(); @@ -256,7 +256,7 @@ template const FT b_first = area_second * inverted_total_area; const FT b_second = area_third * inverted_total_area; - // Return the CGAL::cpp11::array type of coordinates. + // Return the std::array type of coordinates. return CGAL::make_array(b_first, b_second, FT(1) - b_first - b_second); } diff --git a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/Segment_test_with_array.cpp b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/Segment_test_with_array.cpp index 6e8d3983f32..c7fb23045a0 100644 --- a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/Segment_test_with_array.cpp +++ b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/Segment_test_with_array.cpp @@ -1,7 +1,7 @@ // Author: Dmitry Anisimov. // We use a simple segment of length 2 and inexact data type // in order to test coordinates computed for the center point of the segment. -// We test the function compute_segment_coordinates_2() and return CGAL::cpp11::array set of coordinates. +// We test the function compute_segment_coordinates_2() and return std::array set of coordinates. // It also works with exact kernel. @@ -14,7 +14,7 @@ typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; typedef Kernel::FT Scalar; typedef Kernel::Point_2 Point; -typedef CGAL::cpp11::array Pair; +typedef std::array Pair; using std::cout; using std::endl; using std::string; diff --git a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/Triangle_test_with_array.cpp b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/Triangle_test_with_array.cpp index 69891a9fbcf..b11ec23a86e 100644 --- a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/Triangle_test_with_array.cpp +++ b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/Triangle_test_with_array.cpp @@ -1,7 +1,7 @@ // Author: Dmitry Anisimov. // We use a simple triangle and inexact data type // in order to test coordinates computed for the center point of the triangle. -// We test the function compute_triangle_coordinates_2() and return CGAL::cpp11::array set of coordinates. +// We test the function compute_triangle_coordinates_2() and return std::array set of coordinates. // It also works with exact kernel. @@ -14,7 +14,7 @@ typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; typedef Kernel::FT Scalar; typedef Kernel::Point_2 Point; -typedef CGAL::cpp11::array Triple; +typedef std::array Triple; using std::cout; using std::endl; using std::string; diff --git a/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/boolean_operations_2.cpp b/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/boolean_operations_2.cpp index 81dfcdb9cad..90b4fcaec9c 100644 --- a/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/boolean_operations_2.cpp +++ b/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/boolean_operations_2.cpp @@ -946,7 +946,7 @@ bool read_bezier ( QString aFileName, Bezier_polygon_set& rSet, Bezier_region_so if ( bezier_polygons.size() > 1 ) { - for ( Bezier_polygon_vector::const_iterator it = CGAL::cpp11::next(bezier_polygons.begin()) + for ( Bezier_polygon_vector::const_iterator it = std::next(bezier_polygons.begin()) ; it != bezier_polygons.end() ; ++ it ) diff --git a/Boolean_set_operations_2/benchmark/Boolean_set_operations_2/polygon_set_2_join.cpp b/Boolean_set_operations_2/benchmark/Boolean_set_operations_2/polygon_set_2_join.cpp index 47dd22b54b6..d3adafadeb2 100644 --- a/Boolean_set_operations_2/benchmark/Boolean_set_operations_2/polygon_set_2_join.cpp +++ b/Boolean_set_operations_2/benchmark/Boolean_set_operations_2/polygon_set_2_join.cpp @@ -7,7 +7,6 @@ #include #include -#include typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel; typedef Kernel::Segment_2 Segment_2; @@ -96,7 +95,7 @@ void print_polygons(std::ostream& out, const Polygon_set_2& polygon_set) { std::vector polygons_wh(polygon_set.number_of_polygons_with_holes()); polygon_set.polygons_with_holes(&polygons_wh[0]); - BOOST_FOREACH(Polygon_with_holes_2& polygon_wh, polygons_wh) + for(Polygon_with_holes_2& polygon_wh : polygons_wh) { print_polygon(out, polygon_wh.outer_boundary()); for(Polygon_with_holes_2::Hole_const_iterator it=polygon_wh.holes_begin(); @@ -125,7 +124,7 @@ int main( int argc , char ** argv ) build_segments(all_segments); std::ofstream out("polygons_grid.cgal"); - BOOST_FOREACH(const Segment_2& s, all_segments) + for(const Segment_2& s : all_segments) { out << "2 " << s.source() << " 0" << " " << s.target() << " 0\n"; diff --git a/Boolean_set_operations_2/examples/Boolean_set_operations_2/bezier_traits_adapter2.cpp b/Boolean_set_operations_2/examples/Boolean_set_operations_2/bezier_traits_adapter2.cpp index 0b4db4c4505..2c5b160b40a 100644 --- a/Boolean_set_operations_2/examples/Boolean_set_operations_2/bezier_traits_adapter2.cpp +++ b/Boolean_set_operations_2/examples/Boolean_set_operations_2/bezier_traits_adapter2.cpp @@ -147,7 +147,7 @@ bool read_bezier(char const* aFileName, Bezier_polygon_set& rSet) if (polygons.size() > 1) { Bezier_polygon_vector::const_iterator it; - for (it = CGAL::cpp11::next(polygons.begin()); + for (it = std::next(polygons.begin()); it != polygons.end(); ++it) pwh.add_hole(*it); } diff --git a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_on_surface_base_2.h b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_on_surface_base_2.h index 5da2a35fb2b..24435cb3c3b 100644 --- a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_on_surface_base_2.h +++ b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_on_surface_base_2.h @@ -46,7 +46,6 @@ #include #include -#include /*! \file Gps_on_surface_base_2.h @@ -1093,7 +1092,7 @@ protected: // update halfedge flag according to the flag of the twin halfedge // or if the outer ccb of the cc was set - BOOST_FOREACH(Halfedge_handle h, halfedges_that_was_on_an_outer_ccb) + for(Halfedge_handle h : halfedges_that_was_on_an_outer_ccb) { if (h->flag()!=NOT_VISITED) continue; std::size_t face_master_id=(*uf_faces.find(face_handles[h->face()->id()]))->id(); @@ -1112,6 +1111,15 @@ protected: } } while(something_was_updated); + // last loop, if some tags are not set it means that they are the only ccb + // of the face and that they have to be the outer ccb + for(Halfedge_handle h : halfedges_that_was_on_an_outer_ccb) + { + if (h->flag()!=NOT_VISITED) continue; + std::size_t face_master_id=(*uf_faces.find(face_handles[h->face()->id()]))->id(); + set_flag_of_halfedges_of_final_argt(h,ON_OUTER_CCB); + face_outer_ccb_set[face_master_id]=true; + } // at this position there might be some bits in face_outer_ccb_set not set // but they are corresponding to the unbounded face // End tagging ccbs @@ -1182,9 +1190,9 @@ protected: } //collect for reuse/removal all inner and outer ccbs - BOOST_FOREACH(void* ptr, (*it)->_outer_ccbs()) + for(void* ptr : (*it)->_outer_ccbs()) outer_ccbs_to_remove.push_back( static_cast(ptr)->outer_ccb() ); - BOOST_FOREACH(void* ptr, (*it)->_inner_ccbs()) + for(void* ptr : (*it)->_inner_ccbs()) inner_ccbs_to_remove.push_back( static_cast(ptr)->inner_ccb() ); (*it)->_outer_ccbs().clear(); (*it)->_inner_ccbs().clear(); @@ -1259,9 +1267,9 @@ protected: } // now set the new face for all ccbs - BOOST_FOREACH(Outer_ccb_and_face& ccb_and_face, outer_ccb_and_new_face_pairs) + for(Outer_ccb_and_face& ccb_and_face : outer_ccb_and_new_face_pairs) ccb_and_face.first->set_face(ccb_and_face.second); - BOOST_FOREACH(Inner_ccb_and_face& ccb_and_face, inner_ccb_and_new_face_pairs) + for(Inner_ccb_and_face& ccb_and_face : inner_ccb_and_new_face_pairs) ccb_and_face.first->set_face(ccb_and_face.second); //remove no longer used edges, vertices and faces diff --git a/Boolean_set_operations_2/test/Boolean_set_operations_2/simple_join_diff_bso_2.cpp b/Boolean_set_operations_2/test/Boolean_set_operations_2/simple_join_diff_bso_2.cpp index 712d30c7f11..cbc15c67717 100644 --- a/Boolean_set_operations_2/test/Boolean_set_operations_2/simple_join_diff_bso_2.cpp +++ b/Boolean_set_operations_2/test/Boolean_set_operations_2/simple_join_diff_bso_2.cpp @@ -21,7 +21,7 @@ void print_polygons(std::ostream& out, const Polygon_set_2& polygon_set) { std::vector polygons_wh(polygon_set.number_of_polygons_with_holes()); polygon_set.polygons_with_holes(&polygons_wh[0]); - BOOST_FOREACH(Polygon_with_holes_2& polygon_wh, polygons_wh) + for(Polygon_with_holes_2& polygon_wh : polygons_wh) { print_polygon(out, polygon_wh.outer_boundary()); for(Polygon_with_holes_2::Hole_const_iterator it=polygon_wh.holes_begin(); diff --git a/Bounding_volumes/examples/Rectangular_p_center_2/rectangular_p_center_2.cpp b/Bounding_volumes/examples/Rectangular_p_center_2/rectangular_p_center_2.cpp index ed47f2667eb..920df52e0e3 100644 --- a/Bounding_volumes/examples/Rectangular_p_center_2/rectangular_p_center_2.cpp +++ b/Bounding_volumes/examples/Rectangular_p_center_2/rectangular_p_center_2.cpp @@ -24,7 +24,7 @@ int main() CGAL::set_pretty_mode(std::cout); Cont points; - CGAL::cpp11::copy_n(Generator(1), n, std::back_inserter(points)); + std::copy_n(Generator(1), n, std::back_inserter(points)); std::cout << "Generated Point Set:\n"; std::copy(points.begin(), points.end(), cout_ip); diff --git a/Bounding_volumes/include/CGAL/Approximate_min_ellipsoid_d/Approximate_min_ellipsoid_d_impl.h b/Bounding_volumes/include/CGAL/Approximate_min_ellipsoid_d/Approximate_min_ellipsoid_d_impl.h index 8de0a5fe3a8..27661867a6f 100644 --- a/Bounding_volumes/include/CGAL/Approximate_min_ellipsoid_d/Approximate_min_ellipsoid_d_impl.h +++ b/Bounding_volumes/include/CGAL/Approximate_min_ellipsoid_d/Approximate_min_ellipsoid_d_impl.h @@ -152,11 +152,11 @@ namespace CGAL { CGAL_APPEL_ASSERT(d==2); // write matrix M' as [ a, b; b, c ]: - const CGAL::cpp11::array matrix = {{ E->matrix(0, 0), // a + const std::array matrix = {{ E->matrix(0, 0), // a E->matrix(0, 1), // b E->matrix(1, 1) }}; // c - CGAL::cpp11::array eigenvectors; // Note: not neces. normalized. - CGAL::cpp11::array eigenvalues; // Note: sorted ascendent. + std::array eigenvectors; // Note: not neces. normalized. + std::array eigenvalues; // Note: sorted ascendent. CGAL::Default_diagonalize_traits::diagonalize_selfadjoint_covariance_matrix (matrix, eigenvalues, eigenvectors); @@ -191,15 +191,15 @@ namespace CGAL { // M' = [ b d e ] // [ c e f ] // - const CGAL::cpp11::array matrix = {{ E->matrix(0, 0), // a + const std::array matrix = {{ E->matrix(0, 0), // a E->matrix(0, 1), // b E->matrix(0, 2), // c E->matrix(1, 1), // d E->matrix(1, 2), // e E->matrix(2, 2) }}; // f - CGAL::cpp11::array eigenvectors; // Note: not necessarily normalized. - CGAL::cpp11::array eigenvalues; // Note: sorted ascendent. + std::array eigenvectors; // Note: not necessarily normalized. + std::array eigenvalues; // Note: sorted ascendent. CGAL::Default_diagonalize_traits::diagonalize_selfadjoint_covariance_matrix (matrix, eigenvalues, eigenvectors); diff --git a/Bounding_volumes/include/CGAL/Approximate_min_ellipsoid_d/Khachiyan_approximation.h b/Bounding_volumes/include/CGAL/Approximate_min_ellipsoid_d/Khachiyan_approximation.h index 8ff7d9d7151..efe71c77b3e 100644 --- a/Bounding_volumes/include/CGAL/Approximate_min_ellipsoid_d/Khachiyan_approximation.h +++ b/Bounding_volumes/include/CGAL/Approximate_min_ellipsoid_d/Khachiyan_approximation.h @@ -250,7 +250,7 @@ namespace CGAL { // Complexity: O((n-start) d^2) // // Todo: maybe use something like Kahan Summation here? See - // . + // . { for (int k=start; k #include -#if !defined CGAL_CFG_NO_CPP0X_ISFINITE - #define CGAL_CORE_finite(x) std::isfinite(x) - #define CGAL_CORE_ilogb(x) ilogb(x) -#elif defined (_MSC_VER) || defined (__MINGW32__) // add support for MinGW - #define CGAL_CORE_finite(x) _finite(x) - #define CGAL_CORE_ilogb(x) (int)_logb(x) -#else - #define CGAL_CORE_finite(x) finite(x) - #define CGAL_CORE_ilogb(x) ilogb(x) -#endif +#define CGAL_CORE_finite(x) std::isfinite(x) +#define CGAL_CORE_ilogb(x) ilogb(x) #if defined(sun) || defined(__sun) #include diff --git a/CGAL_ImageIO/include/CGAL/Image_3.h b/CGAL_ImageIO/include/CGAL/Image_3.h index b87ebe990d8..a9bae14a3e8 100644 --- a/CGAL_ImageIO/include/CGAL/Image_3.h +++ b/CGAL_ImageIO/include/CGAL/Image_3.h @@ -479,7 +479,7 @@ Image_3::labellized_trilinear_interpolation const int i2 = i1 + 1; const int j2 = j1 + 1; - CGAL::cpp11::array index; + std::array index; index[0] = (i1 * dimy + j1) * dimx + k1; index[1] = index[0] + 1; index[2] = (i1 * dimy + j2) * dimx + k1; @@ -489,7 +489,7 @@ Image_3::labellized_trilinear_interpolation index[6] = (i2 * dimy + j2) * dimx + k1; index[7] = index[6] + 1; - CGAL::cpp11::array labels; + std::array labels; labels[0] = ((Image_word_type*)image()->data)[index[0]]; int lc = 1; diff --git a/CGAL_ipelets/demo/CGAL_ipelets/arrangement.cpp b/CGAL_ipelets/demo/CGAL_ipelets/arrangement.cpp index db7bb998fc0..76eaa144616 100644 --- a/CGAL_ipelets/demo/CGAL_ipelets/arrangement.cpp +++ b/CGAL_ipelets/demo/CGAL_ipelets/arrangement.cpp @@ -96,11 +96,11 @@ void ArrPolyIpelet::protected_run(int fn){ for (std::list::iterator it=arc_list.begin();it!=arc_list.end();++it) input_curves.push_back( - Curve_2( CGAL::cpp11::get<0>(*it).center(), - sqrt(CGAL::to_double(CGAL::cpp11::get<0>(*it).squared_radius())), - CGAL::cpp11::get<3>(*it), - Traits::Point_2(CGAL::cpp11::get<1>(*it).x(),CGAL::cpp11::get<1>(*it).y()), - Traits::Point_2(CGAL::cpp11::get<2>(*it).x(),CGAL::cpp11::get<2>(*it).y()) + Curve_2( std::get<0>(*it).center(), + sqrt(CGAL::to_double(std::get<0>(*it).squared_radius())), + std::get<3>(*it), + Traits::Point_2(std::get<1>(*it).x(),std::get<1>(*it).y()), + Traits::Point_2(std::get<2>(*it).x(),std::get<2>(*it).y()) ) ); diff --git a/CGAL_ipelets/demo/CGAL_ipelets/cone_spanners.cpp b/CGAL_ipelets/demo/CGAL_ipelets/cone_spanners.cpp index 4c5104ba330..8083a0d478e 100644 --- a/CGAL_ipelets/demo/CGAL_ipelets/cone_spanners.cpp +++ b/CGAL_ipelets/demo/CGAL_ipelets/cone_spanners.cpp @@ -38,7 +38,7 @@ typedef Kernel::Direction_2 Direction /* Note: due to a bug in the boost library, using a directed graph * will cause a compilation error with g++ and clang++ when using c++11 standard. - * See http://lists.boost.org/Archives/boost/2016/05/229458.php. + * See https://lists.boost.org/Archives/boost/2016/05/229458.php. */ typedef boost::adjacency_list gs( size); - CGAL::cpp11::copy_n( gs, nbelements, std::back_inserter(points)); + std::copy_n( gs, nbelements, std::back_inserter(points)); } break; @@ -139,7 +139,7 @@ void generator::protected_run(int fn) case 6: case 2://points in a square : side = {CGAL::Random_points_in_square_2 gc (size); - CGAL::cpp11::copy_n( gc, nbelements, std::back_inserter(points)); + std::copy_n( gc, nbelements, std::back_inserter(points)); } break; @@ -166,7 +166,7 @@ void generator::protected_run(int fn) typedef CGAL::Creator_uniform_2< Point_2, Segment_2> Seg_creator; typedef CGAL::Join_input_iterator_2< P1, P2, Seg_creator> Seg_iterator; Seg_iterator g( p1, p2); - CGAL::cpp11::copy_n( g, nbelements, std::back_inserter(segments) ); + std::copy_n( g, nbelements, std::back_inserter(segments) ); break; }; 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 5152f1a50a2..bc587a1bf3a 100644 --- a/CGAL_ipelets/doc/CGAL_ipelets/CGAL/CGAL_Ipelet_base.h +++ b/CGAL_ipelets/doc/CGAL_ipelets/CGAL/CGAL_Ipelet_base.h @@ -198,7 +198,7 @@ The returned output iterator will accept assignments from objects of types `Polygon_2` or `Segment_2` or `Point_2`, it decomposes them in objects of type `Point_2` and assigns them to `it`. For more details on the returned output iterator refer to the Boost library -documentation. +documentation. */ template @@ -211,7 +211,7 @@ The returned output iterator will accept assignments from objects of types `Polygon_2` or `Segment_2`, it decomposes them in objects of type `Segment_2` and assigns them to `it`. For more details on the returned output iterator refer to the Boost library -documentation. +documentation. */ template diff --git a/CGAL_ipelets/doc/CGAL_ipelets/CGAL_ipelets.txt b/CGAL_ipelets/doc/CGAL_ipelets/CGAL_ipelets.txt index 6d01a2c201e..60598a5bb48 100644 --- a/CGAL_ipelets/doc/CGAL_ipelets/CGAL_ipelets.txt +++ b/CGAL_ipelets/doc/CGAL_ipelets/CGAL_ipelets.txt @@ -9,7 +9,7 @@ namespace CGAL { \section CGAL_ipeletsIntroduction Introduction -The Ipe extensible drawing editor (http://tclab.kaist.ac.kr/ipe/) \cgalCite{schwarzkopf1995ede}, \cgalCite{ipe:man-09} +The Ipe extensible drawing editor (http://ipe.otfried.org) \cgalCite{schwarzkopf1995ede}, \cgalCite{ipe:man-09} is a tool used by computational geometry researchers to produce 2D figures for inclusion in articles or presentations. The extensible adjective sheds a light on an important feature: the possibility for users to write small extensions (called ipelets) diff --git a/CGAL_ipelets/include/CGAL/CGAL_Ipelet_base_v6.h b/CGAL_ipelets/include/CGAL/CGAL_Ipelet_base_v6.h index 1eb814c208f..027a83bc6c0 100644 --- a/CGAL_ipelets/include/CGAL/CGAL_Ipelet_base_v6.h +++ b/CGAL_ipelets/include/CGAL/CGAL_Ipelet_base_v6.h @@ -67,7 +67,7 @@ namespace CGAL{ typedef typename CGAL::Polygon_2 Polygon_2; typedef typename Kernel::Circle_2 Circle_2; - typedef CGAL::cpp11::tuple Circular_arc_2; + typedef std::tuple Circular_arc_2; Ipelet_base(const std::string NameS,const std::string SubLabS[],const std::string HMsgS[]) @@ -411,15 +411,15 @@ public: draw_in_ipe(const Circular_arc_2& arc,bool deselect_all=false) const { IpeSegmentSubPath* SSP_ipe = new IpeSegmentSubPath; - IpeVector ipeS=IpeVector( CGAL::to_double(CGAL::cpp11::get<1>(arc).x()), - CGAL::to_double(CGAL::cpp11::get<1>(arc).y()));//convert ot ipe format - IpeVector ipeT=IpeVector( CGAL::to_double(CGAL::cpp11::get<2>(arc).x()), - CGAL::to_double(CGAL::cpp11::get<2>(arc).y()));//convert ot ipe format - SSP_ipe->AppendArc(IpeMatrix(sqrt(CGAL::to_double(CGAL::cpp11::get<0>(arc).squared_radius())),0, - 0,(CGAL::cpp11::get<3>(arc)==CGAL::COUNTERCLOCKWISE?1:-1)* - sqrt(CGAL::to_double(CGAL::cpp11::get<0>(arc).squared_radius())), - CGAL::to_double(CGAL::cpp11::get<0>(arc).center().x()), - CGAL::to_double(CGAL::cpp11::get<0>(arc).center().y())), + IpeVector ipeS=IpeVector( CGAL::to_double(std::get<1>(arc).x()), + CGAL::to_double(std::get<1>(arc).y()));//convert ot ipe format + IpeVector ipeT=IpeVector( CGAL::to_double(std::get<2>(arc).x()), + CGAL::to_double(std::get<2>(arc).y()));//convert ot ipe format + SSP_ipe->AppendArc(IpeMatrix(sqrt(CGAL::to_double(std::get<0>(arc).squared_radius())),0, + 0,(std::get<3>(arc)==CGAL::COUNTERCLOCKWISE?1:-1)* + sqrt(CGAL::to_double(std::get<0>(arc).squared_radius())), + CGAL::to_double(std::get<0>(arc).center().x()), + CGAL::to_double(std::get<0>(arc).center().y())), ipeS,ipeT); IpePath* obj_ipe = new IpePath(_helper->Attributes()); obj_ipe->AddSubPath(SSP_ipe); @@ -482,17 +482,17 @@ public: draw_in_ipe(const Circular_arc_2& object,const Iso_rectangle_2& bbox,bool deselect_all=false) const { std::vector arc_list; - const Circle_2& circle=CGAL::cpp11::get<0>(object); + const Circle_2& circle=std::get<0>(object); restrict_circle_to_bbox(circle,bbox,std::back_inserter(arc_list)); if (arc_list.empty() && bbox.has_on_bounded_side(circle.center()) ){ draw_in_ipe(object,deselect_all); return; } - const Point_2* source=(CGAL::cpp11::get<3>(object)==CGAL::COUNTERCLOCKWISE)? - &CGAL::cpp11::get<1>(object):&CGAL::cpp11::get<2>(object); - const Point_2* target=(CGAL::cpp11::get<3>(object)==CGAL::COUNTERCLOCKWISE)? - &CGAL::cpp11::get<2>(object):&CGAL::cpp11::get<1>(object); + const Point_2* source=(std::get<3>(object)==CGAL::COUNTERCLOCKWISE)? + &std::get<1>(object):&std::get<2>(object); + const Point_2* target=(std::get<3>(object)==CGAL::COUNTERCLOCKWISE)? + &std::get<2>(object):&std::get<1>(object); std::multimap > map_theta; typedef typename std::multimap >::iterator Map_theta_iterator; Map_theta_iterator s_it=map_theta.insert( @@ -501,10 +501,10 @@ public: std::make_pair(get_theta(*target,circle),std::make_pair(OTRG,target))); for (typename std::vector::iterator it_arc=arc_list.begin();it_arc!=arc_list.end();++it_arc){ - const Point_2* arc_s=(CGAL::cpp11::get<3>(*it_arc)==CGAL::COUNTERCLOCKWISE)? - &CGAL::cpp11::get<1>(*it_arc):&CGAL::cpp11::get<2>(*it_arc); - const Point_2* arc_t=(CGAL::cpp11::get<3>(*it_arc)==CGAL::COUNTERCLOCKWISE)? - &CGAL::cpp11::get<2>(*it_arc):&CGAL::cpp11::get<1>(*it_arc); + const Point_2* arc_s=(std::get<3>(*it_arc)==CGAL::COUNTERCLOCKWISE)? + &std::get<1>(*it_arc):&std::get<2>(*it_arc); + const Point_2* arc_t=(std::get<3>(*it_arc)==CGAL::COUNTERCLOCKWISE)? + &std::get<2>(*it_arc):&std::get<1>(*it_arc); map_theta.insert( std::make_pair(get_theta(*arc_s,circle),std::make_pair(SRC,arc_s) ) ); map_theta.insert( std::make_pair(get_theta(*arc_t,circle),std::make_pair(TRG,arc_t) ) ); } @@ -773,9 +773,9 @@ public: Circle_2 approx_circle=conv(exact_circle); if (!sign_known){ CGAL::Sign sign = (CGAL::orientation(sd,td,center)==CGAL::LEFT_TURN)?CGAL::POSITIVE:CGAL::NEGATIVE; - return CGAL::cpp11::make_tuple(approx_circle,sd,td,sign); + return std::make_tuple(approx_circle,sd,td,sign); } - return CGAL::cpp11::make_tuple(approx_circle,sd,td,CGAL::POSITIVE); + return std::make_tuple(approx_circle,sd,td,CGAL::POSITIVE); } void diff --git a/CGAL_ipelets/include/CGAL/CGAL_Ipelet_base_v7.h b/CGAL_ipelets/include/CGAL/CGAL_Ipelet_base_v7.h index 37562338996..22ec39cbff4 100644 --- a/CGAL_ipelets/include/CGAL/CGAL_Ipelet_base_v7.h +++ b/CGAL_ipelets/include/CGAL/CGAL_Ipelet_base_v7.h @@ -103,7 +103,7 @@ namespace CGAL{ typedef CGAL::Polygon_2 Polygon_2; typedef typename Kernel::Circle_2 Circle_2; - typedef CGAL::cpp11::tuple Circular_arc_2; + typedef std::tuple Circular_arc_2; Ipelet_base(const std::string NameS,const std::string SubLabS[],const std::string HMsgS[]) @@ -422,15 +422,15 @@ public: draw_in_ipe(const Circular_arc_2& arc,bool deselect_all=false) const { ipe::Curve* SSP_ipe = new ipe::Curve; - ipe::Vector ipeS=ipe::Vector( CGAL::to_double(CGAL::cpp11::get<1>(arc).x()), - CGAL::to_double(CGAL::cpp11::get<1>(arc).y()));//convert ot ipe format - ipe::Vector ipeT=ipe::Vector( CGAL::to_double(CGAL::cpp11::get<2>(arc).x()), - CGAL::to_double(CGAL::cpp11::get<2>(arc).y()));//convert ot ipe format - SSP_ipe->appendArc(ipe::Matrix(sqrt(CGAL::to_double(CGAL::cpp11::get<0>(arc).squared_radius())),0, - 0,(CGAL::cpp11::get<3>(arc)==CGAL::COUNTERCLOCKWISE?1:-1)* - sqrt(CGAL::to_double(CGAL::cpp11::get<0>(arc).squared_radius())), - CGAL::to_double(CGAL::cpp11::get<0>(arc).center().x()), - CGAL::to_double(CGAL::cpp11::get<0>(arc).center().y())), + ipe::Vector ipeS=ipe::Vector( CGAL::to_double(std::get<1>(arc).x()), + CGAL::to_double(std::get<1>(arc).y()));//convert ot ipe format + ipe::Vector ipeT=ipe::Vector( CGAL::to_double(std::get<2>(arc).x()), + CGAL::to_double(std::get<2>(arc).y()));//convert ot ipe format + SSP_ipe->appendArc(ipe::Matrix(sqrt(CGAL::to_double(std::get<0>(arc).squared_radius())),0, + 0,(std::get<3>(arc)==CGAL::COUNTERCLOCKWISE?1:-1)* + sqrt(CGAL::to_double(std::get<0>(arc).squared_radius())), + CGAL::to_double(std::get<0>(arc).center().x()), + CGAL::to_double(std::get<0>(arc).center().y())), ipeS,ipeT); ipe::Shape shape; shape.appendSubPath(SSP_ipe); @@ -490,17 +490,17 @@ public: draw_in_ipe(const Circular_arc_2& object,const Iso_rectangle_2& bbox,bool deselect_all=false) const { std::vector arc_list; - const Circle_2& circle=CGAL::cpp11::get<0>(object); + const Circle_2& circle=std::get<0>(object); restrict_circle_to_bbox(circle,bbox,std::back_inserter(arc_list)); if (arc_list.empty() && bbox.has_on_bounded_side(circle.center()) ){ draw_in_ipe(object,deselect_all); return; } - const Point_2* source=(CGAL::cpp11::get<3>(object)==CGAL::COUNTERCLOCKWISE)? - &CGAL::cpp11::get<1>(object):&CGAL::cpp11::get<2>(object); - const Point_2* target=(CGAL::cpp11::get<3>(object)==CGAL::COUNTERCLOCKWISE)? - &CGAL::cpp11::get<2>(object):&CGAL::cpp11::get<1>(object); + const Point_2* source=(std::get<3>(object)==CGAL::COUNTERCLOCKWISE)? + &std::get<1>(object):&std::get<2>(object); + const Point_2* target=(std::get<3>(object)==CGAL::COUNTERCLOCKWISE)? + &std::get<2>(object):&std::get<1>(object); std::multimap > map_theta; typedef typename std::multimap >::iterator Map_theta_iterator; Map_theta_iterator s_it=map_theta.insert( @@ -510,10 +510,10 @@ public: std::make_pair(get_theta(*target,circle),std::make_pair(OTRG,target))); for (typename std::vector::iterator it_arc=arc_list.begin();it_arc!=arc_list.end();++it_arc){ - const Point_2* arc_s=(CGAL::cpp11::get<3>(*it_arc)==CGAL::COUNTERCLOCKWISE)? - &CGAL::cpp11::get<1>(*it_arc):&CGAL::cpp11::get<2>(*it_arc); - const Point_2* arc_t=(CGAL::cpp11::get<3>(*it_arc)==CGAL::COUNTERCLOCKWISE)? - &CGAL::cpp11::get<2>(*it_arc):&CGAL::cpp11::get<1>(*it_arc); + const Point_2* arc_s=(std::get<3>(*it_arc)==CGAL::COUNTERCLOCKWISE)? + &std::get<1>(*it_arc):&std::get<2>(*it_arc); + const Point_2* arc_t=(std::get<3>(*it_arc)==CGAL::COUNTERCLOCKWISE)? + &std::get<2>(*it_arc):&std::get<1>(*it_arc); map_theta.insert( std::make_pair(get_theta(*arc_s,circle),std::make_pair(SRC,arc_s) ) ); map_theta.insert( std::make_pair(get_theta(*arc_t,circle),std::make_pair(TRG,arc_t) ) ); } @@ -779,9 +779,9 @@ public: Circle_2 approx_circle=conv(exact_circle); if (!sign_known){ CGAL::Sign sign = (CGAL::orientation(sd,td,center)==CGAL::LEFT_TURN)?CGAL::POSITIVE:CGAL::NEGATIVE; - return CGAL::cpp11::make_tuple(approx_circle,sd,td,sign); + return std::make_tuple(approx_circle,sd,td,sign); } - return CGAL::cpp11::make_tuple(approx_circle,sd,td,CGAL::POSITIVE); + return std::make_tuple(approx_circle,sd,td,CGAL::POSITIVE); } void diff --git a/CMakeLists.txt b/CMakeLists.txt index 216f1c2829f..cc901cea606 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ # Top level CMakeLists.txt for CGAL-branchbuild message( "== CMake setup ==" ) project(CGAL CXX C) - +export(PACKAGE CGAL) # Minimal version of CMake: cmake_minimum_required(VERSION 3.1) diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Cartesian_base.h b/Cartesian_kernel/include/CGAL/Cartesian/Cartesian_base.h index f7feb4cc182..008680df480 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Cartesian_base.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Cartesian_base.h @@ -143,8 +143,8 @@ struct Cartesian_base typedef Aff_transformationC3 Aff_transformation_3; typedef Weighted_pointC3 Weighted_point_3; - typedef typename cpp11::array::const_iterator Cartesian_const_iterator_2; - typedef typename cpp11::array::const_iterator Cartesian_const_iterator_3; + typedef typename std::array::const_iterator Cartesian_const_iterator_2; + typedef typename std::array::const_iterator Cartesian_const_iterator_3; // Undocumented stuff. typedef Data_accessorC2 Data_accessor_2; diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Direction_2.h b/Cartesian_kernel/include/CGAL/Cartesian/Direction_2.h index 422aa39c9af..5fcb279c111 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Direction_2.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Direction_2.h @@ -44,7 +44,7 @@ class DirectionC2 typedef typename R_::Segment_2 Segment_2; typedef typename R_::Direction_2 Direction_2; - typedef cpp11::array Rep; + typedef std::array Rep; typedef typename R_::template Handle::type Base; Base base; diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Direction_3.h b/Cartesian_kernel/include/CGAL/Cartesian/Direction_3.h index 70cc256b722..385622b5aba 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Direction_3.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Direction_3.h @@ -42,7 +42,7 @@ class DirectionC3 typedef typename R_::Segment_3 Segment_3; typedef typename R_::Direction_3 Direction_3; - typedef cpp11::array Rep; + typedef std::array Rep; typedef typename R_::template Handle::type Base; Base base; diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Iso_cuboid_3.h b/Cartesian_kernel/include/CGAL/Cartesian/Iso_cuboid_3.h index f9ab466d9b5..ca44a5fe7e6 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Iso_cuboid_3.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Iso_cuboid_3.h @@ -41,7 +41,7 @@ class Iso_cuboidC3 typedef typename R_::Aff_transformation_3 Aff_transformation_3; typedef typename R_::Construct_point_3 Construct_point_3; - typedef cpp11::array Rep; + typedef std::array Rep; typedef typename R_::template Handle::type Base; Base base; diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Iso_rectangle_2.h b/Cartesian_kernel/include/CGAL/Cartesian/Iso_rectangle_2.h index f24916a291b..c13f67963fa 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Iso_rectangle_2.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Iso_rectangle_2.h @@ -38,7 +38,7 @@ class Iso_rectangleC2 typedef typename R_::Iso_rectangle_2 Iso_rectangle_2; typedef typename R_::Construct_point_2 Construct_point_2; - typedef cpp11::array Rep; + typedef std::array Rep; typedef typename R_::template Handle::type Base; Base base; diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Line_2.h b/Cartesian_kernel/include/CGAL/Cartesian/Line_2.h index 519cfb8ff07..d60fd5e745e 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Line_2.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Line_2.h @@ -43,7 +43,7 @@ class LineC2 typedef typename R_::Segment_2 Segment_2; typedef typename R_::Line_2 Line_2; - typedef cpp11::array Rep; + typedef std::array Rep; typedef typename R_::template Handle::type Base; Base base; diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Plane_3.h b/Cartesian_kernel/include/CGAL/Cartesian/Plane_3.h index 46d965ac501..5f7c58faa0b 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Plane_3.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Plane_3.h @@ -49,7 +49,7 @@ class PlaneC3 typedef typename R_::Construct_point_3 Construct_point_3; typedef typename R_::Construct_point_2 Construct_point_2; - typedef cpp11::array Rep; + typedef std::array Rep; typedef typename R_::template Handle::type Base; Base base; diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Ray_2.h b/Cartesian_kernel/include/CGAL/Cartesian/Ray_2.h index 70fdc1d1ca4..638ae09250e 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Ray_2.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Ray_2.h @@ -37,7 +37,7 @@ class RayC2 typedef typename R_::Point_2 Point_2; typedef typename R_::Ray_2 Ray_2; - typedef cpp11::array Rep; + typedef std::array Rep; typedef typename R_::template Handle::type Base; Base base; diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Ray_3.h b/Cartesian_kernel/include/CGAL/Cartesian/Ray_3.h index 90bab86272c..78842015ecb 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Ray_3.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Ray_3.h @@ -41,7 +41,7 @@ class RayC3 typedef typename R_::Line_3 Line_3; typedef typename R_::Ray_3 Ray_3; - typedef cpp11::array Rep; + typedef std::array Rep; typedef typename R_::template Handle::type Base; Base base; diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Segment_2.h b/Cartesian_kernel/include/CGAL/Cartesian/Segment_2.h index 8ca94707aaf..a394c29799f 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Segment_2.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Segment_2.h @@ -36,7 +36,7 @@ class SegmentC2 typedef typename R_::Point_2 Point_2; typedef typename R_::Segment_2 Segment_2; - typedef cpp11::array Rep; + typedef std::array Rep; typedef typename R_::template Handle::type Base; Base base; diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Segment_3.h b/Cartesian_kernel/include/CGAL/Cartesian/Segment_3.h index 0a5ddfc2b3e..8a12cc0ab6a 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Segment_3.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Segment_3.h @@ -40,7 +40,7 @@ class SegmentC3 typedef typename R_::Line_3 Line_3; typedef typename R_::Segment_3 Segment_3; - typedef cpp11::array Rep; + typedef std::array Rep; typedef typename R_::template Handle::type Base; Base base; diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Tetrahedron_3.h b/Cartesian_kernel/include/CGAL/Cartesian/Tetrahedron_3.h index f8fe0479e99..f08c27c13cd 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Tetrahedron_3.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Tetrahedron_3.h @@ -42,7 +42,7 @@ class TetrahedronC3 typedef typename R_::Plane_3 Plane_3; typedef typename R_::Tetrahedron_3 Tetrahedron_3; - typedef cpp11::array Rep; + typedef std::array Rep; typedef typename R_::template Handle::type Base; Base base; diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Triangle_2.h b/Cartesian_kernel/include/CGAL/Cartesian/Triangle_2.h index c4acea64318..91e8d91627e 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Triangle_2.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Triangle_2.h @@ -39,7 +39,7 @@ class TriangleC2 typedef typename R_::Vector_2 Vector_2; typedef typename R_::Triangle_2 Triangle_2; - typedef cpp11::array Rep; + typedef std::array Rep; typedef typename R_::template Handle::type Base; Base base; diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Triangle_3.h b/Cartesian_kernel/include/CGAL/Cartesian/Triangle_3.h index 7a78d4958fa..e658bb4d0ed 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Triangle_3.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Triangle_3.h @@ -40,7 +40,7 @@ class TriangleC3 typedef typename R_::Plane_3 Plane_3; typedef typename R_::Triangle_3 Triangle_3; - typedef cpp11::array Rep; + typedef std::array Rep; typedef typename R_::template Handle::type Base; Base base; diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Vector_2.h b/Cartesian_kernel/include/CGAL/Cartesian/Vector_2.h index 4204320c9df..1e5b1142927 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Vector_2.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Vector_2.h @@ -44,7 +44,7 @@ class VectorC2 typedef typename R_::Line_2 Line_2; typedef typename R_::Direction_2 Direction_2; - typedef cpp11::array Rep; + typedef std::array Rep; typedef typename R_::template Handle::type Base; Base base; diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Vector_3.h b/Cartesian_kernel/include/CGAL/Cartesian/Vector_3.h index 5aa432b840b..b0cd713aff8 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Vector_3.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Vector_3.h @@ -44,7 +44,7 @@ class VectorC3 typedef typename R_::Line_3 Line_3; typedef typename R_::Direction_3 Direction_3; - typedef cpp11::array Rep; + typedef std::array Rep; typedef typename R_::template Handle::type Base; Base base; diff --git a/Circular_kernel_2/include/CGAL/Circular_kernel_2/Intersection_traits.h b/Circular_kernel_2/include/CGAL/Circular_kernel_2/Intersection_traits.h index 537332f2a04..e5d1f3ce210 100644 --- a/Circular_kernel_2/include/CGAL/Circular_kernel_2/Intersection_traits.h +++ b/Circular_kernel_2/include/CGAL/Circular_kernel_2/Intersection_traits.h @@ -26,11 +26,8 @@ #ifndef CGAL_CIRCULAR_KERNEL_2_INTERSECTION_TRAITS_H #define CGAL_CIRCULAR_KERNEL_2_INTERSECTION_TRAITS_H -//this include is needed to know the value of CGAL_INTERSECTION_VERSION #include -#if !(CGAL_INTERSECTION_VERSION < 2) - #include namespace CGAL { @@ -187,16 +184,6 @@ struct CK2_Intersection_traits } //end of namespace CGAL -#else - -#include - -template -struct CK2_Intersection_traits -{ typedef CGAL::Object type; }; - -#endif - namespace CGAL{ namespace internal{ @@ -208,33 +195,12 @@ namespace internal{ // _could_ come with conversion overhead and so we rather go for // the real type. // Overloads for empty returns are also provided. -#if CGAL_INTERSECTION_VERSION < 2 - #if defined(CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE) - template - inline - CGAL::Object ck2_intersection_return(const T& t) { return CGAL::make_object(t); } - #else - template - inline - CGAL::Object ck2_intersection_return(T&& t) { return CGAL::make_object(std::forward(t)); } - #endif // CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE - template - inline - CGAL::Object ck2_intersection_return() { return CGAL::Object(); } -#else - #if defined(CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE) - template - inline RT - ck2_intersection_return(const T& t) { return RT(t); } - #else - template - inline RT - ck2_intersection_return(T&& t) { return RT(std::forward(t)); } - #endif // CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE + template + inline RT + ck2_intersection_return(T&& t) { return RT(std::forward(t)); } template inline RT ck2_intersection_return() { return RT(); } -#endif // CGAL_INTERSECTION_VERSION < 2 } } //end of namespace CGAL::internal diff --git a/Circular_kernel_2/include/CGAL/Circular_kernel_2/internal_functions_on_line_arc_2.h b/Circular_kernel_2/include/CGAL/Circular_kernel_2/internal_functions_on_line_arc_2.h index ad82a932929..49045e1c728 100644 --- a/Circular_kernel_2/include/CGAL/Circular_kernel_2/internal_functions_on_line_arc_2.h +++ b/Circular_kernel_2/include/CGAL/Circular_kernel_2/internal_functions_on_line_arc_2.h @@ -536,18 +536,8 @@ namespace CircularFunctors { for (typename solutions_container::iterator it = solutions.begin(); it != solutions.end(); ++it) { - #if CGAL_INTERSECTION_VERSION < 2 - if(const std::pair* p = - object_cast< std::pair< typename CK::Circular_arc_point_2, unsigned> >(& (*it))) { - Has_on_visitor vis(&l); - if(vis(*p)) { - *res++ = *it; - } - } - #else if(boost::apply_visitor(Has_on_visitor(&l), *it)) *res++ = *it; - #endif } return res; @@ -700,26 +690,11 @@ namespace CircularFunctors { for (typename solutions_container::iterator it = solutions.begin(); it != solutions.end(); ++it) { - #if CGAL_INTERSECTION_VERSION < 2 - if(const std::pair* p = - object_cast< std::pair< typename CK::Circular_arc_point_2, unsigned> >(& (*it))) - { - #ifdef CGAL_CK_TEST_BBOX_BEFORE_HAS_ON - Bbox_2 rb = p->first.bbox(); - if(!do_overlap(l.bbox(), rb) || !do_overlap(c.bbox(),rb)) continue; - #endif - Has_on_visitor vis1(&l); - Has_on_visitor vis2(&c); - if(vis1(*p) && vis2(*p)) - *res++ = *it; - } - #else if(boost::apply_visitor(Has_on_visitor(&l), *it) && boost::apply_visitor(Has_on_visitor(&c), *it) ) { *res++ = *it; } - #endif } return res; } @@ -824,16 +799,8 @@ namespace CircularFunctors { for (typename solutions_container::const_iterator it = solutions.begin(); it != solutions.end(); ++it) { -#if CGAL_INTERSECTION_VERSION < 2 - typedef typename CK::Circular_arc_point_2 Circular_arc_point_2; - const std::pair* p = - object_cast >(& (*it)); - Has_on_visitor vis(&c); - if(vis(*p)) *res++ = *it; -#else if(boost::apply_visitor(Has_on_visitor(&c), *it)) *res++ = *it; -#endif } return res; } diff --git a/Circular_kernel_2/include/CGAL/IO/Dxf_reader_doubles.h b/Circular_kernel_2/include/CGAL/IO/Dxf_reader_doubles.h index 49e25316b9a..edc80df3278 100644 --- a/Circular_kernel_2/include/CGAL/IO/Dxf_reader_doubles.h +++ b/Circular_kernel_2/include/CGAL/IO/Dxf_reader_doubles.h @@ -48,7 +48,7 @@ class Dxf_reader_doubles { public: typedef double FT; - typedef cpp11::array Triplet; + typedef std::array Triplet; typedef Triplet Point_2_and_bulge; typedef Triplet Circle_2; diff --git a/Circular_kernel_2/include/CGAL/IO/Dxf_variant_reader.h b/Circular_kernel_2/include/CGAL/IO/Dxf_variant_reader.h index d56826aafa1..2acc60f80cf 100644 --- a/Circular_kernel_2/include/CGAL/IO/Dxf_variant_reader.h +++ b/Circular_kernel_2/include/CGAL/IO/Dxf_variant_reader.h @@ -48,7 +48,7 @@ template OutputIterator variant_load(std::istream& is, OutputIterator res) { - typedef cpp11::array Triplet; + typedef std::array Triplet; typedef typename CK::FT FT; typedef typename CK::Circular_arc_point_2 Circular_arc_point_2; typedef typename CK::Root_of_2 Root_of_2; diff --git a/Circular_kernel_3/include/CGAL/Circular_kernel_3/Intersection_traits.h b/Circular_kernel_3/include/CGAL/Circular_kernel_3/Intersection_traits.h index 4a690b64562..fd680d45b0c 100644 --- a/Circular_kernel_3/include/CGAL/Circular_kernel_3/Intersection_traits.h +++ b/Circular_kernel_3/include/CGAL/Circular_kernel_3/Intersection_traits.h @@ -22,11 +22,8 @@ #ifndef CGAL_CIRCULAR_KERNEL_3_INTERSECTION_TRAITS_H #define CGAL_CIRCULAR_KERNEL_3_INTERSECTION_TRAITS_H -//this include is needed to know the value of CGAL_INTERSECTION_VERSION #include -#if !(CGAL_INTERSECTION_VERSION < 2) - #include #include @@ -179,16 +176,6 @@ struct SK3_Intersection_traits - -template -struct SK3_Intersection_traits -{ typedef CGAL::Object type; }; - -#endif - namespace CGAL{ namespace internal{ @@ -200,33 +187,12 @@ namespace internal{ // _could_ come with conversion overhead and so we rather go for // the real type. // Overloads for empty returns are also provided. -#if CGAL_INTERSECTION_VERSION < 2 - #if defined(CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE) - template - inline - CGAL::Object sk3_intersection_return(const T& t) { return CGAL::make_object(t); } - #else - template - inline - CGAL::Object sk3_intersection_return(T&& t) { return CGAL::make_object(std::forward(t)); } - #endif // CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE - template - inline - CGAL::Object sk3_intersection_return() { return CGAL::Object(); } -#else - #if defined(CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE) - template - inline RT - sk3_intersection_return(const T& t) { return RT(t); } - #else - template - inline RT - sk3_intersection_return(T&& t) { return RT(std::forward(t)); } - #endif // CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE + template + inline RT + sk3_intersection_return(T&& t) { return RT(std::forward(t)); } template inline RT sk3_intersection_return() { return RT(); } -#endif // CGAL_INTERSECTION_VERSION < 2 } } //end of namespace CGAL::internal diff --git a/Circular_kernel_3/include/CGAL/Circular_kernel_3/function_objects_polynomial_sphere.h b/Circular_kernel_3/include/CGAL/Circular_kernel_3/function_objects_polynomial_sphere.h index 31453bddbb9..4af23d82ae5 100644 --- a/Circular_kernel_3/include/CGAL/Circular_kernel_3/function_objects_polynomial_sphere.h +++ b/Circular_kernel_3/include/CGAL/Circular_kernel_3/function_objects_polynomial_sphere.h @@ -1198,14 +1198,10 @@ template < class SK > \ //only ternary from the linear kernel template struct result { - #if CGAL_INTERSECTION_VERSION < 2 - typedef CGAL::Object type; - #else typedef boost::optional< boost::variant< Point_3, Line_3, Plane_3 > > type; - #endif }; //using SK::Linear_kernel::Intersect_3::operator(); diff --git a/Circular_kernel_3/include/CGAL/Circular_kernel_3/internal_functions_on_sphere_3.h b/Circular_kernel_3/include/CGAL/Circular_kernel_3/internal_functions_on_sphere_3.h index 81c43824786..4e4faeeb0a1 100644 --- a/Circular_kernel_3/include/CGAL/Circular_kernel_3/internal_functions_on_sphere_3.h +++ b/Circular_kernel_3/include/CGAL/Circular_kernel_3/internal_functions_on_sphere_3.h @@ -292,43 +292,25 @@ namespace CGAL { CGAL_kernel_precondition(!s2.is_degenerate()); CGAL_kernel_precondition(!s3.is_degenerate()); if(non_oriented_equal(s1,s2) && non_oriented_equal(s2,s3)) { - #if CGAL_INTERSECTION_VERSION < 2 - *res++ = make_object(s1); - #else *res++ = result_type(s1); - #endif return res; } if(non_oriented_equal(s1,s2)) { if(typename Intersection_traits::result_type v = SK().intersect_3_object()(s1, s3)) { - #if CGAL_INTERSECTION_VERSION < 2 - if( const Point_3* p = object_cast(&v) ) - *res++ = make_object(std::make_pair(Circular_arc_point_3(*p), 2u)); - else - *res++ = v; - #else internal::Point_conversion_visitor visitor(res); return boost::apply_visitor(visitor, *v); - #endif } return res; } if(non_oriented_equal(s1,s3) || non_oriented_equal(s2,s3)) { if(typename Intersection_traits::result_type v = SK().intersect_3_object()(s1, s2)) { - #if CGAL_INTERSECTION_VERSION < 2 - if( const Point_3* p = object_cast(&v) ) - *res++ = make_object(std::make_pair(Circular_arc_point_3(*p), 2u)); - else - *res++ = v; - #else internal::Point_conversion_visitor visitor(res); return boost::apply_visitor( visitor, *v); - #endif } return res; } @@ -338,21 +320,13 @@ namespace CGAL { if(!v) return res; if(const Point_3* p = CGAL::Intersections::internal::intersect_get(v)) { if(SK().has_on_3_object()(s3, *p)) { - #if CGAL_INTERSECTION_VERSION < 2 - *res++ = make_object(std::make_pair(Circular_arc_point_3(*p),2u)); - #else *res++ = result_type(std::make_pair(Circular_arc_point_3(*p),2u)); - #endif } return res; } if(const Circle_3* c = CGAL::Intersections::internal::intersect_get(v)) { if(SK().has_on_3_object()(s3, *c)) { - #if CGAL_INTERSECTION_VERSION < 2 - *res++ = make_object(*c); - #else *res++ = result_type(*c); - #endif } return res; } @@ -384,26 +358,16 @@ namespace CGAL { typedef typename SK::Plane_3 Plane_3; typedef typename SK::Sphere_3 Sphere_3; typedef typename SK::Algebraic_kernel Algebraic_kernel; - #if CGAL_INTERSECTION_VERSION < 2 - typedef typename SK::Circular_arc_point_3 Circular_arc_point_3; - #endif CGAL_kernel_precondition(!p.is_degenerate()); CGAL_kernel_precondition(!s1.is_degenerate()); CGAL_kernel_precondition(!s2.is_degenerate()); if(non_oriented_equal(s1,s2)) { if(typename Intersection_traits::result_type v = SK().intersect_3_object()(p, s1)) { - #if CGAL_INTERSECTION_VERSION < 2 - if( const typename SK::Point_3* p = CGAL::object_cast(&v) ) - *res++ = make_object(std::make_pair(Circular_arc_point_3(*p), 2u)); - else - *res++ = v; - #else internal::Point_conversion_visitor visitor(res); return boost::apply_visitor( visitor, *v); - #endif } return res; } @@ -411,17 +375,10 @@ namespace CGAL { if(non_oriented_equal(p,radical_p)) { if(typename Intersection_traits::result_type v = SK().intersect_3_object()(p, s1)) { - #if CGAL_INTERSECTION_VERSION < 2 - if( const typename SK::Point_3* p = CGAL::object_cast(&v) ) - *res++ = make_object(std::make_pair(Circular_arc_point_3(*p), 2u)); - else - *res++ = v; - #else internal::Point_conversion_visitor visitor(res); return boost::apply_visitor( visitor, *v); - #endif } return res; } @@ -456,18 +413,10 @@ namespace CGAL { if(non_oriented_equal(p1,p2)) { if(typename Intersection_traits::result_type v = SK().intersect_3_object()(p1, s)) { - #if CGAL_INTERSECTION_VERSION < 2 - typedef typename SK::Circular_arc_point_3 Circular_arc_point_3; - if( const typename SK::Point_3* p = CGAL::object_cast(&v) ) - *res++ = make_object(std::make_pair(Circular_arc_point_3(*p), 2u)); - else - *res++ = v; - #else internal::Point_conversion_visitor visitor(res); return boost::apply_visitor( visitor, *v); - #endif } return res; } diff --git a/Circulator/doc/Circulator/Concepts/ConstRange.h b/Circulator/doc/Circulator/Concepts/ConstRange.h index 661c257aa3d..e25c0ad2912 100644 --- a/Circulator/doc/Circulator/Concepts/ConstRange.h +++ b/Circulator/doc/Circulator/Concepts/ConstRange.h @@ -8,7 +8,7 @@ A constant iterator range. Refer to the `Range` concept for more details. \cgalRefines Boost's Range concept \cgalHasModel STL containers -\cgalHasModel `boost::iterator_range` +\cgalHasModel `boost::iterator_range` \sa `Range` diff --git a/Circulator/doc/Circulator/Concepts/Range.h b/Circulator/doc/Circulator/Concepts/Range.h index 7b60925b9cb..7e4ac32aa9f 100644 --- a/Circulator/doc/Circulator/Concepts/Range.h +++ b/Circulator/doc/Circulator/Concepts/Range.h @@ -22,7 +22,7 @@ documentation of any model of these concepts. For example, in the case of a vect and its value type is `Point`. Boost also offers the -Boost.Range library +Boost.Range library which provides good support for ranges. Finally, let us note that ranges, in general (especially in template context) diff --git a/Classification/doc/Classification/Classification.txt b/Classification/doc/Classification/Classification.txt index 2138985acd5..fdb296567dc 100644 --- a/Classification/doc/Classification/Classification.txt +++ b/Classification/doc/Classification/Classification.txt @@ -9,8 +9,8 @@ namespace CGAL { This component implements the algorithm described in \cgalCite{cgal:lm-clscm-12} (section 2), generalized to handle different types of data, multiple features and multiple labels. It classifies a data set into a user-defined set of labels, such as _ground_, _vegetation_ and _buildings_. A flexible API is provided so that users can classify any type of data which they can index and for which they can compute relevant features, compute their own local features on the input data set and define their own labels. \note This component requires C++11 and depends on the Boost libraries -[Serialization](http://www.boost.org/libs/serialization) and -[IO Streams](http://www.boost.org/libs/iostreams) (compiled with the GZIP dependency). +[Serialization](https://www.boost.org/libs/serialization) and +[IO Streams](https://www.boost.org/libs/iostreams) (compiled with the GZIP dependency). \section Classification_Organization Package Organization @@ -235,7 +235,7 @@ to README provided in the [ETH Zurich's code archive](https://www.ethz.ch/conten The second classifier is [OpenCV::Random_forest_classifier](@ref CGAL::Classification::OpenCV::Random_forest_classifier). It uses the \ref thirdpartyOpenCV library, more specifically the -[Random Trees](http://docs.opencv.org/2.4/modules/ml/doc/random_trees.html) +[Random Trees](https://docs.opencv.org/2.4/modules/ml/doc/random_trees.html) package. Note that this classifier usually produces results with a lower @@ -246,7 +246,7 @@ Forest instead. An [example](\ref Classification_example_opencv_random_forest) shows how to use this classifier. For more details about the algorithm, please refer -to [the official documentation](http://docs.opencv.org/2.4/modules/ml/doc/random_trees.html) +to [the official documentation](https://docs.opencv.org/2.4/modules/ml/doc/random_trees.html) of OpenCV. \subsection Classification_TensorFlow_neural_network TensorFlow Neural Network diff --git a/Classification/doc/Classification/PackageDescription.txt b/Classification/doc/Classification/PackageDescription.txt index d82ffd8b503..3d78a28993a 100644 --- a/Classification/doc/Classification/PackageDescription.txt +++ b/Classification/doc/Classification/PackageDescription.txt @@ -77,8 +77,8 @@ Data structures specialized to classify clusters. \cgalPkgShortInfoBegin \cgalPkgSince{4.12} -\cgalPkgDependsOn{\ref PkgSolverInterface, \ref PkgSpatialSearchingD, [Boost Serialization](http://www.boost.org/libs/serialization) and -[Boost IO Streams](http://www.boost.org/libs/iostreams)} +\cgalPkgDependsOn{\ref PkgSolverInterface, \ref PkgSpatialSearchingD, [Boost Serialization](https://www.boost.org/libs/serialization) and +[Boost IO Streams](https://www.boost.org/libs/iostreams)} \cgalPkgBib{cgal:lm-clscm-12} \cgalPkgLicense{\ref licensesGPL "GPL"} \cgalPkgDemo{Operations on Polyhedra,polyhedron_3.zip} diff --git a/Classification/include/CGAL/Classification.h b/Classification/include/CGAL/Classification.h index 6be192f22b8..fea4a0c044c 100644 --- a/Classification/include/CGAL/Classification.h +++ b/Classification/include/CGAL/Classification.h @@ -36,7 +36,6 @@ #endif #include -#include #include #include #include diff --git a/Classification/include/CGAL/Classification/Color.h b/Classification/include/CGAL/Classification/Color.h deleted file mode 100644 index 8b619b9c497..00000000000 --- a/Classification/include/CGAL/Classification/Color.h +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright (c) 2017 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 -// 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) : Simon Giraudot - -#ifndef CGAL_CLASSIFICATION_COLOR_H -#define CGAL_CLASSIFICATION_COLOR_H - -#include -#include -#include -#include - -namespace CGAL { -namespace Classification { - - /*! - \ingroup PkgClassificationColor - - %Color described in red/green/blue space. Each component is stored - as an unsigned char ranging from 0 (no color) to 255 (full color). - */ -typedef CGAL::cpp11::array RGB_Color; - /*! - \ingroup PkgClassificationColor - - %Color described in hue/saturation/value space. Each component is stored - as a float: - - - `hue` ranges from 0° to 360° (corresponding to the color tint) - - `saturation` ranges from 0.0 (gray) to 100.0 (full saturation) - - `value` ranges from 0.0 (black) to 100.0 (white) - */ -typedef CGAL::cpp11::array HSV_Color; - - - /// \cond SKIP_IN_MANUAL -inline HSV_Color rgb_to_hsv (const RGB_Color& c) -{ - double r = (double)(c[0]) / 255.; - double g = (double)(c[1]) / 255.; - double b = (double)(c[2]) / 255.; - double Cmax = (std::max) (r, (std::max) (g, b)); - double Cmin = (std::min) (r, (std::min) (g, b)); - double delta = Cmax - Cmin; - double H = 0.; - - if (delta != 0.) - { - if (Cmax == r) - H = 60. * ((g - b) / delta); - else if (Cmax == g) - H = 60. * (((b - r) / delta) + 2.); - else - H = 60. * (((r - g) / delta) + 4.); - } - if (H < 0.) H += 360.; - double S = (Cmax == 0. ? 0. : 100. * (delta / Cmax)); - double V = 100. * Cmax; - HSV_Color out = {{ float(H), float(S), float(V) }}; - return out; -} - -inline RGB_Color hsv_to_rgb (const HSV_Color& c) -{ - double h = c[0]; - double s = c[1]; - double v = c[2]; - - s /= 100.; - v /= 100.; - double C = v*s; - int hh = (int)(h/60.); - double X = C * (1-CGAL::abs (hh % 2 - 1)); - double r = 0, g = 0, b = 0; - - if( hh>=0 && hh<1 ) - { - r = C; - g = X; - } - else if( hh>=1 && hh<2 ) - { - r = X; - g = C; - } - else if( hh>=2 && hh<3 ) - { - g = C; - b = X; - } - else if( hh>=3 && hh<4 ) - { - g = X; - b = C; - } - else if( hh>=4 && hh<5 ) - { - r = X; - b = C; - } - else - { - r = C; - b = X; - } - double m = v-C; - r += m; - g += m; - b += m; - r *= 255.0; - g *= 255.0; - b *= 255.0; - - RGB_Color out = {{ (unsigned char)r, (unsigned char)g, (unsigned char)b }}; - return out; -} - /// \endcond - -} // namespace Classification -} // namespace CGAL - - - -#endif // CGAL_CLASSIFICATION_COLOR_H diff --git a/Classification/include/CGAL/Classification/ETHZ/internal/random-forest/common-libraries.hpp b/Classification/include/CGAL/Classification/ETHZ/internal/random-forest/common-libraries.hpp index ec70abfdada..469867737b5 100644 --- a/Classification/include/CGAL/Classification/ETHZ/internal/random-forest/common-libraries.hpp +++ b/Classification/include/CGAL/Classification/ETHZ/internal/random-forest/common-libraries.hpp @@ -46,7 +46,6 @@ #include #include #include -#include #include #include #if BOOST_VERSION >= 104700 diff --git a/Classification/include/CGAL/Classification/ETHZ/internal/random-forest/node-gini.hpp b/Classification/include/CGAL/Classification/ETHZ/internal/random-forest/node-gini.hpp index 2b42b35843b..513708f32c5 100644 --- a/Classification/include/CGAL/Classification/ETHZ/internal/random-forest/node-gini.hpp +++ b/Classification/include/CGAL/Classification/ETHZ/internal/random-forest/node-gini.hpp @@ -46,7 +46,7 @@ namespace RandomForest { /* template class X : Y {} --> http://en.wikipedia.org/wiki/Curiously_recurring_template_pattern#Static_polymorphism +-> https://en.wikipedia.org/wiki/Curiously_recurring_template_pattern#Static_polymorphism */ template diff --git a/Classification/include/CGAL/Classification/Feature/Color_channel.h b/Classification/include/CGAL/Classification/Feature/Color_channel.h index 73ff155f5b8..6c5778548c2 100644 --- a/Classification/include/CGAL/Classification/Feature/Color_channel.h +++ b/Classification/include/CGAL/Classification/Feature/Color_channel.h @@ -25,8 +25,8 @@ #include -#include #include +#include namespace CGAL { @@ -65,7 +65,7 @@ namespace Feature { `ColorMap`. \tparam ColorMap model of `ReadablePropertyMap` whose key type is the value type of the iterator of `PointRange` and value type - is `CGAL::Classification::RGB_Color`. + is `CGAL::Color`. */ template class Color_channel : public Feature_base @@ -82,9 +82,6 @@ public: private: - typedef typename Classification::RGB_Color RGB_Color; - typedef typename Classification::HSV_Color HSV_Color; - const PointRange& input; ColorMap color_map; Channel m_channel; @@ -111,8 +108,8 @@ public: /// \cond SKIP_IN_MANUAL virtual float value (std::size_t pt_index) { - HSV_Color c = Classification::rgb_to_hsv (get(color_map, *(input.begin()+pt_index))); - return c[std::size_t(m_channel)]; + cpp11::array c = get(color_map, *(input.begin()+pt_index)).to_hsv(); + return float(c[std::size_t(m_channel)]); } /// \endcond }; diff --git a/Classification/include/CGAL/Classification/Feature/Eigen.h b/Classification/include/CGAL/Classification/Feature/Eigen.h deleted file mode 100644 index 793e3433449..00000000000 --- a/Classification/include/CGAL/Classification/Feature/Eigen.h +++ /dev/null @@ -1,431 +0,0 @@ -// Copyright (c) 2017 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 -// 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) : Simon Giraudot - -#ifndef CGAL_CLASSIFICATION_FEATURES_EIGEN_H -#define CGAL_CLASSIFICATION_FEATURES_EIGEN_H - -#include - -#include -#include -#include - -/// \cond SKIP_IN_MANUAL -#ifndef CGAL_NO_DEPRECATED_CODE - -namespace CGAL { - -namespace Classification { - -namespace Feature { - -class Eigen_feature : public Feature_base -{ -protected: -#ifdef CGAL_CLASSIFICATION_PRECOMPUTE_FEATURES - std::vector attrib; -#else - const Classification::Local_eigen_analysis& eigen; -#endif - -public: - template - Eigen_feature (const InputRange&, - const Classification::Local_eigen_analysis& eigen) -#ifndef CGAL_CLASSIFICATION_PRECOMPUTE_FEATURES - : eigen (eigen) -#endif - { - } - -#ifdef CGAL_CLASSIFICATION_PRECOMPUTE_FEATURES - virtual void init (std::size_t size, const Classification::Local_eigen_analysis& eigen) - { - attrib.reserve (size); - for (std::size_t i = 0; i < size; ++ i) - attrib.push_back (get_value (eigen, i)); - } -#else - virtual void init (std::size_t, const Classification::Local_eigen_analysis&) - { - } -#endif - - virtual float get_value (const Classification::Local_eigen_analysis& eigen, std::size_t i) = 0; - virtual float value (std::size_t pt_index) - { -#ifdef CGAL_CLASSIFICATION_PRECOMPUTE_FEATURES - return attrib[pt_index]; -#else - return get_value(eigen, pt_index); -#endif - } - -}; - - /*! - \ingroup PkgClassificationFeatures - - %Feature based on the eigenvalues of the covariance matrix of a - local neighborhood. Linearity is defined, for the 3 eigenvalues - \f$\lambda_1 \ge \lambda_2 \ge \lambda_3 \ge 0\f$, as: - - \f[ - \frac{\lambda_1 - \lambda_2}{\lambda_1} - \f] - - Its default name is "linearity". - */ -CGAL_DEPRECATED_MSG("you are using the deprecated feature Linearity, please update your code with Eigenvalue instead") -class Linearity -#ifdef DOXYGEN_RUNNING - : public Feature_base -#else - : public Eigen_feature -#endif -{ -public: - /*! - Constructs the feature. - - \tparam Input model of `ConstRange`. Its iterator type - is `RandomAccessIterator`. - \param input point range. - \param eigen class with precomputed eigenvectors and eigenvalues. - */ - template - Linearity (const InputRange& input, - const Local_eigen_analysis& eigen) : Eigen_feature (input, eigen) - { - this->set_name("linearity"); - this->init(input.size(), eigen); - } - - virtual float get_value (const Local_eigen_analysis& eigen, std::size_t i) - { - const Local_eigen_analysis::Eigenvalues& ev = eigen.eigenvalue(i); - if (ev[2] < 1e-15) - return 0.; - else - return ((ev[2] - ev[1]) / ev[2]); - } -}; - - /*! - \ingroup PkgClassificationFeatures - - %Feature based on the eigenvalues of the covariance matrix of a - local neighborhood. Planarity is defined, for the 3 eigenvalues - \f$\lambda_1 \ge \lambda_2 \ge \lambda_3 \ge 0\f$, as: - - \f[ - \frac{\lambda_2 - \lambda_3}{\lambda_1} - \f] - - Its default name is "planarity". - */ -CGAL_DEPRECATED_MSG("you are using the deprecated feature Planarity, please update your code with Eigenvalue instead") -class Planarity -#ifdef DOXYGEN_RUNNING - : public Feature_base -#else - : public Eigen_feature -#endif -{ -public: - /*! - Constructs the feature. - - \param input point range. - \param eigen class with precomputed eigenvectors and eigenvalues. - */ - template - Planarity (const InputRange& input, - const Local_eigen_analysis& eigen) - : Eigen_feature(input, eigen) - { - this->set_name("planarity"); - this->init(input.size(), eigen); - } - - virtual float get_value (const Local_eigen_analysis& eigen, std::size_t i) - { - const Local_eigen_analysis::Eigenvalues& ev = eigen.eigenvalue(i); - if (ev[2] < 1e-15) - return 0.; - else - return ((ev[1] - ev[0]) / ev[2]); - } - -}; - - /*! - \ingroup PkgClassificationFeatures - - %Feature based on the eigenvalues of the covariance matrix of a - local neighborhood. Sphericity is defined, for the 3 eigenvalues - \f$\lambda_1 \ge \lambda_2 \ge \lambda_3 \ge 0\f$, as: - - \f[ - \frac{\lambda_3}{\lambda_1} - \f] - - Its default name is "sphericity". - */ -CGAL_DEPRECATED_MSG("you are using the deprecated feature Sphericity, please update your code with Eigenvalue instead") -class Sphericity -#ifdef DOXYGEN_RUNNING - : public Feature_base -#else - : public Eigen_feature -#endif -{ -public: - /*! - Constructs the feature. - - \param input point range. - \param eigen class with precomputed eigenvectors and eigenvalues. - */ - template - Sphericity (const InputRange& input, - const Local_eigen_analysis& eigen) - : Eigen_feature(input, eigen) - { - this->set_name("sphericity"); - this->init(input.size(), eigen); - } - - virtual float get_value (const Local_eigen_analysis& eigen, std::size_t i) - { - const Local_eigen_analysis::Eigenvalues& ev = eigen.eigenvalue(i); - if (ev[2] < 1e-15) - return 0.; - else - return (ev[0] / ev[2]); - } - -}; - - /*! - \ingroup PkgClassificationFeatures - - %Feature based on the eigenvalues of the covariance matrix of a - local neighborhood. Omnivariance is defined, for the 3 eigenvalues - \f$\lambda_1 \ge \lambda_2 \ge \lambda_3 \ge 0\f$, as: - - \f[ - (\lambda_1 \times \lambda_2 \times \lambda_3)^{\frac{1}{3}} - \f] - - Its default name is "omnivariance". - */ -CGAL_DEPRECATED_MSG("you are using the deprecated feature Omnivariance, please update your code with Eigenvalue instead") -class Omnivariance -#ifdef DOXYGEN_RUNNING - : public Feature_base -#else - : public Eigen_feature -#endif -{ -public: - /*! - Constructs the feature. - - \param input point range. - \param eigen class with precomputed eigenvectors and eigenvalues. - */ - template - Omnivariance (const InputRange& input, - const Local_eigen_analysis& eigen) - : Eigen_feature(input, eigen) - { - this->set_name("omnivariance"); - this->init(input.size(), eigen); - } - - virtual float get_value (const Local_eigen_analysis& eigen, std::size_t i) - { - const Local_eigen_analysis::Eigenvalues& ev = eigen.eigenvalue(i); - return (std::pow (CGAL::abs(ev[0] * ev[1] * ev[2]), 0.333333333f)); - } - -}; - - /*! - \ingroup PkgClassificationFeatures - - %Feature based on the eigenvalues of the covariance matrix of a - local neighborhood. Anisotropy is defined, for the 3 eigenvalues - \f$\lambda_1 \ge \lambda_2 \ge \lambda_3 \ge 0\f$, as: - - \f[ - \frac{\lambda_1 - \lambda_3}{\lambda_1} - \f] - - Its default name is "anisotropy". - */ -CGAL_DEPRECATED_MSG("you are using the deprecated feature Anisotropy, please update your code with Eigenvalue instead") -class Anisotropy -#ifdef DOXYGEN_RUNNING - : public Feature_base -#else - : public Eigen_feature -#endif -{ -public: - /*! - Constructs the feature. - - \param input point range. - \param eigen class with precomputed eigenvectors and eigenvalues. - */ - template - Anisotropy (const InputRange& input, - const Local_eigen_analysis& eigen) - : Eigen_feature(input, eigen) - { - this->set_name("anisotropy"); - this->init(input.size(), eigen); - } - - virtual float get_value (const Local_eigen_analysis& eigen, std::size_t i) - { - const Local_eigen_analysis::Eigenvalues& ev = eigen.eigenvalue(i); - if (ev[2] < 1e-15) - return 0.; - else - return ((ev[2] - ev[0]) / ev[2]); - } - -}; - - /*! - \ingroup PkgClassificationFeatures - - %Feature based on the eigenvalues of the covariance matrix of a - local neighborhood. Eigentropy is defined, for the 3 eigenvalues - \f$\lambda_1 \ge \lambda_2 \ge \lambda_3 \ge 0\f$, as: - - \f[ - - \sum_{i=1}^3 \lambda_i \times \log{\lambda_i} - \f] - - Its default name is "eigentropy". - */ -CGAL_DEPRECATED_MSG("you are using the deprecated feature Eigentropy, please update your code with Eigenvalue instead") -class Eigentropy -#ifdef DOXYGEN_RUNNING - : public Feature_base -#else - : public Eigen_feature -#endif -{ -public: - /*! - Constructs the feature. - - \param input point range. - \param eigen class with precomputed eigenvectors and eigenvalues. - */ - template - Eigentropy (const InputRange& input, - const Local_eigen_analysis& eigen) - : Eigen_feature(input, eigen) - { - this->set_name("eigentropy"); - this->init(input.size(), eigen); - } - - virtual float get_value (const Local_eigen_analysis& eigen, std::size_t i) - { - const Local_eigen_analysis::Eigenvalues& ev = eigen.eigenvalue(i); - if (ev[0] < 1e-15 - || ev[1] < 1e-15 - || ev[2] < 1e-15) - return 0.; - else - return (- ev[0] * std::log(ev[0]) - - ev[1] * std::log(ev[1]) - - ev[2] * std::log(ev[2])); - } - -}; - - - /*! - \ingroup PkgClassificationFeatures - - %Feature based on the eigenvalues of the covariance - matrix of a local neighborhood. Surface variation is defined, for - the 3 eigenvalues \f$\lambda_1 \ge \lambda_2 \ge \lambda_3 \ge - 0\f$, as: - - \f[ - \frac{\lambda_3}{\lambda_1 + \lambda_2 + \lambda_3} - \f] - - Its default name is "surface_variation". - */ -CGAL_DEPRECATED_MSG("you are using the deprecated feature Surface_variation, please update your code with Eigenvalue instead") -class Surface_variation -#ifdef DOXYGEN_RUNNING - : public Feature_base -#else - : public Eigen_feature -#endif -{ -public: - /*! - Constructs the feature. - - \param input point range. - \param eigen class with precomputed eigenvectors and eigenvalues. - */ - template - Surface_variation (const InputRange& input, - const Local_eigen_analysis& eigen) - : Eigen_feature(input, eigen) - { - this->set_name("surface_variation"); - this->init(input.size(), eigen); - } - - virtual float get_value (const Local_eigen_analysis& eigen, std::size_t i) - { - const Local_eigen_analysis::Eigenvalues& ev = eigen.eigenvalue(i); - if (ev[0] + ev[1] + ev[2] < 1e-15) - return 0.; - else - return (ev[0] / (ev[0] + ev[1] + ev[2])); - } - -}; - -} // namespace Feature - -} // namespace Classification - -} // namespace CGAL - -#endif -/// \endcond - -#endif // CGAL_CLASSIFICATION_FEATURES_EIGEN_H diff --git a/Classification/include/CGAL/Classification/Feature/Hsv.h b/Classification/include/CGAL/Classification/Feature/Hsv.h deleted file mode 100644 index 536d6aaa5b0..00000000000 --- a/Classification/include/CGAL/Classification/Feature/Hsv.h +++ /dev/null @@ -1,175 +0,0 @@ -// Copyright (c) 2017 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 -// 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) : Simon Giraudot - -#ifndef CGAL_CLASSIFICATION_FEATURE_HSV_H -#define CGAL_CLASSIFICATION_FEATURE_HSV_H - -#include - -#include - -#include -#include - -/// \cond SKIP_IN_MANUAL -#ifndef CGAL_NO_DEPRECATED_CODE - -namespace CGAL { - -namespace Classification { - -namespace Feature { - - /*! - \ingroup PkgClassificationFeatures - - %Feature based on HSV colorimetric information. If the input - point cloud has colorimetric information, it can be used for - classification purposes. This feature is based on a Gaussian - probabilistic model on one of the three HSV channels (hue, - saturation or value). It computes the probability of the color of - the input point to match this specific color channel defined by a - mean and a standard deviation. - - The HSV channels are defined this way: - - - Hue ranges from 0 to 360 and measures the general "tint" of the - color (green, blue, pink, etc.) - - - Saturation ranges from 0 to 100 and measures the "strength" of the - color (0 is gray and 100 is the fully saturated color) - - - Value ranges from 0 to 100 and measures the "brightness" of the - color (0 is black and 100 is the fully bright color) - - For example, such an feature using the channel 0 (hue) with a - mean of 90 (which corresponds to a green hue) can help to identify - trees. - - \image html trees.png - -
Left: input point set with colors. Right: HSV feature on hue with - a mean of 90 (from low values in white to high values in dark - red).
- - Its default name is the channel followed by the mean value (for - example: "hue_180", "saturation_20" or "value_98"). - - \note The user only needs to provide a map to standard (and more common) - RGB colors, the conversion to HSV is done internally. - - \tparam GeomTraits model of \cgal Kernel. - \tparam PointRange model of `ConstRange`. Its iterator type - is `RandomAccessIterator` and its value type is the key type of - `ColorMap`. - \tparam ColorMap model of `ReadablePropertyMap` whose key - type is the value type of the iterator of `PointRange` and value type - is `CGAL::Classification::RGB_Color`. - */ -template -CGAL_DEPRECATED_MSG("you are using the deprecated feature Hsv, please update your code with Color_channel instead") -class Hsv : public Feature_base -{ -public: - - /// Selected channel. - enum Channel - { - HUE = 0, ///< 0 - SATURATION = 1, ///< 1 - VALUE = 2 ///< 2 - }; - -private: - - typedef typename Classification::RGB_Color RGB_Color; - typedef typename Classification::HSV_Color HSV_Color; - -#ifdef CGAL_CLASSIFICATION_PRECOMPUTE_FEATURES - std::vector color_feature; -#else - const PointRange& input; - ColorMap color_map; - Channel m_channel; - float m_mean; - float m_sd; -#endif - -public: - - /*! - - \brief Constructs a feature based on the given color channel, - mean and standard deviation. - - \param input point range. - \param color_map property map to access the colors of the input points. - \param channel chosen HSV channel. - \param mean mean value of the specified channel. - \param sd standard deviation of the specified channel. - */ - Hsv (const PointRange& input, - ColorMap color_map, - Channel channel, - float mean, float sd) -#ifndef CGAL_CLASSIFICATION_PRECOMPUTE_FEATURES - : input(input), color_map(color_map), m_channel(channel), m_mean(mean), m_sd(sd) -#endif - { - -#ifdef CGAL_CLASSIFICATION_PRECOMPUTE_FEATURES - for(std::size_t i = 0; i < input.size();i++) - { - HSV_Color c = Classification::rgb_to_hsv (get(color_map, *(input.begin()+i))); - color_feature.push_back (std::exp (-(c[std::size_t(channel)] - mean) - * (c[std::size_t(channel)] - mean) / (2. * sd * sd))); - } -#endif - std::ostringstream oss; - if (channel == HUE) oss << "hue"; - else if (channel == SATURATION) oss << "saturation"; - else if (channel == VALUE) oss << "value"; - oss << "_" << mean; - this->set_name (oss.str()); - } - - virtual float value (std::size_t pt_index) - { -#ifdef CGAL_CLASSIFICATION_PRECOMPUTE_FEATURES - return color_feature[pt_index]; -#else - HSV_Color c = Classification::rgb_to_hsv (get(color_map, *(input.begin()+pt_index))); - return std::exp (-(c[std::size_t(m_channel)] - m_mean) - * (c[std::size_t(m_channel)] - m_mean) / (2.f * m_sd * m_sd)); -#endif - } - -}; - -} // namespace Feature - -} // namespace Classification - -} // namespace CGAL - -#endif -/// \endcond - -#endif // CGAL_CLASSIFICATION_FEATURE_HSV_H diff --git a/Classification/include/CGAL/Classification/Local_eigen_analysis.h b/Classification/include/CGAL/Classification/Local_eigen_analysis.h index 9838411e010..17b4cd85f30 100644 --- a/Classification/include/CGAL/Classification/Local_eigen_analysis.h +++ b/Classification/include/CGAL/Classification/Local_eigen_analysis.h @@ -65,7 +65,7 @@ namespace Classification { class Local_eigen_analysis { public: - typedef CGAL::cpp11::array Eigenvalues; ///< Eigenvalues (sorted in ascending order) + typedef std::array Eigenvalues; ///< Eigenvalues (sorted in ascending order) private: @@ -199,9 +199,9 @@ private: }; - typedef CGAL::cpp11::array float3; - typedef CGAL::cpp11::array float2; - typedef CGAL::cpp11::array cfloat2; + typedef std::array float3; + typedef std::array float2; + typedef std::array cfloat2; struct Content { @@ -379,7 +379,7 @@ public: else #endif { - BOOST_FOREACH(face_descriptor fd, range) + for(face_descriptor fd : range) { std::vector neighbors; neighbor_query (fd, std::back_inserter (neighbors)); @@ -522,7 +522,7 @@ private: typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; float out = 0.f; - BOOST_FOREACH(halfedge_descriptor hd, halfedges_around_face(halfedge(fd, g), g)) + for(halfedge_descriptor hd : halfedges_around_face(halfedge(fd, g), g)) { out = (std::max)(out, float(CGAL::squared_distance (get(get (CGAL::vertex_point, g), source(hd,g)), @@ -547,7 +547,7 @@ private: Point centroid = CGAL::centroid (neighbor_points.begin(), neighbor_points.end()); m_content->centroids[index] = make_array( float(centroid.x()), float(centroid.y()), float(centroid.z()) ); - CGAL::cpp11::array covariance = make_array( 0.f, 0.f, 0.f, 0.f, 0.f, 0.f ); + std::array covariance = make_array( 0.f, 0.f, 0.f, 0.f, 0.f, 0.f ); for (std::size_t i = 0; i < neighbor_points.size(); ++ i) { @@ -560,8 +560,8 @@ private: covariance[5] += float(d.z () * d.z ()); } - CGAL::cpp11::array evalues = make_array( 0.f, 0.f, 0.f ); - CGAL::cpp11::array evectors = make_array( 0.f, 0.f, 0.f, + std::array evalues = make_array( 0.f, 0.f, 0.f ); + std::array evectors = make_array( 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f ); @@ -601,7 +601,7 @@ private: m_content->eigenvalues[get(get(CGAL::face_index,g), query)] = make_array(compressed_float(0), compressed_float(0)); - CGAL::cpp11::array tr + std::array tr = {{ Triangle (get(get (CGAL::vertex_point, g), target(halfedge(query, g), g)), get(get (CGAL::vertex_point, g), target(next(halfedge(query, g), g), g)), get(get (CGAL::vertex_point, g), target(next(next(halfedge(query, g), g), g), g))) }}; @@ -627,7 +627,7 @@ private: get(get (CGAL::vertex_point, g), target(next(next(halfedge(fd, g), g), g), g)))); } - CGAL::cpp11::array covariance = {{ 0.f, 0.f, 0.f, 0.f, 0.f, 0.f }}; + std::array covariance = {{ 0.f, 0.f, 0.f, 0.f, 0.f, 0.f }}; Point c = CGAL::centroid(triangles.begin(), triangles.end(), Kernel(), CGAL::Dimension_tag<2>()); @@ -637,8 +637,8 @@ private: m_content->centroids[get(get(CGAL::face_index,g), query)] = {{ float(c.x()), float(c.y()), float(c.z()) }}; - CGAL::cpp11::array evalues = {{ 0.f, 0.f, 0.f }}; - CGAL::cpp11::array evectors = {{ 0.f, 0.f, 0.f, + std::array evalues = {{ 0.f, 0.f, 0.f }}; + std::array evectors = {{ 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f }}; diff --git a/Classification/include/CGAL/Classification/Mesh_feature_generator.h b/Classification/include/CGAL/Classification/Mesh_feature_generator.h index d15b139cb3e..6212b4d0aff 100644 --- a/Classification/include/CGAL/Classification/Mesh_feature_generator.h +++ b/Classification/include/CGAL/Classification/Mesh_feature_generator.h @@ -45,7 +45,6 @@ #include #include -#include #include #include #include @@ -153,8 +152,6 @@ public: typedef Classification::Feature::Verticality Verticality; typedef Classification::Feature::Eigenvalue Eigenvalue; - - typedef typename Classification::RGB_Color RGB_Color; /// \endcond private: diff --git a/Classification/include/CGAL/Classification/Mesh_neighborhood.h b/Classification/include/CGAL/Classification/Mesh_neighborhood.h index 6304b8a71c4..cc0bdd3d029 100644 --- a/Classification/include/CGAL/Classification/Mesh_neighborhood.h +++ b/Classification/include/CGAL/Classification/Mesh_neighborhood.h @@ -27,12 +27,13 @@ #include #include -#include #include #include #include #include +#include + namespace CGAL { namespace Classification { @@ -63,7 +64,7 @@ private: typedef bool value_type; typedef bool reference; typedef boost::read_write_property_map_tag category; - typedef typename CGAL::cpp11::unordered_set Set; + typedef typename std::unordered_set Set; private: Set* m_set; @@ -203,7 +204,7 @@ private: template void direct_neighbors (const face_descriptor& query, OutputIterator output) const { - BOOST_FOREACH(halfedge_descriptor hd, halfedges_around_face(halfedge(query, m_mesh), m_mesh)) + for(halfedge_descriptor hd : halfedges_around_face(halfedge(query, m_mesh), m_mesh)) { *(output ++ ) = face(opposite(hd, m_mesh), m_mesh); } @@ -219,7 +220,7 @@ private: void n_ring_neighbors (const face_descriptor& query, OutputIterator output, const std::size_t n) const { *(output ++) = get(get(CGAL::face_index, m_mesh), query); - CGAL::cpp11::array init = {{ query }}; + std::array init = {{ query }}; typename Is_face_selected::Set done; done.insert(query); std::vector desc; diff --git a/Classification/include/CGAL/Classification/OpenCV/Random_forest_classifier.h b/Classification/include/CGAL/Classification/OpenCV/Random_forest_classifier.h index 8b04c5d0b8d..b68173e1b14 100644 --- a/Classification/include/CGAL/Classification/OpenCV/Random_forest_classifier.h +++ b/Classification/include/CGAL/Classification/OpenCV/Random_forest_classifier.h @@ -72,7 +72,7 @@ public: /*! \brief Instantiates the classifier using the sets of `labels` and `features`. - Parameters documentation is copy-pasted from [the official documentation of OpenCV](http://docs.opencv.org/2.4/modules/ml/doc/random_trees.html). For more details on this method, please refer to it. + Parameters documentation is copy-pasted from [the official documentation of OpenCV](https://docs.opencv.org/2.4/modules/ml/doc/random_trees.html). For more details on this method, please refer to it. \param labels label set used. \param features feature set used. diff --git a/Classification/include/CGAL/Classification/Point_set_feature_generator.h b/Classification/include/CGAL/Classification/Point_set_feature_generator.h index b017ebe427c..478de14227e 100644 --- a/Classification/include/CGAL/Classification/Point_set_feature_generator.h +++ b/Classification/include/CGAL/Classification/Point_set_feature_generator.h @@ -51,7 +51,6 @@ #include #include -#include #include #include #include @@ -154,8 +153,6 @@ public: typedef Classification::Feature::Gradient_of_feature Gradient_of_feature; #endif - - typedef typename Classification::RGB_Color RGB_Color; /// \endcond private: @@ -295,64 +292,6 @@ public: /// @} /// \cond SKIP_IN_MANUAL - -#ifndef CGAL_NO_DEPRECATED_CODE - // deprecated - template - CGAL_DEPRECATED_MSG("you are using a deprecated constructor of CGAL::Classification::Point_set_feature_generator, please update your code") - Point_set_feature_generator(Feature_set& features, - const PointRange& input, - PointMap point_map, - std::size_t nb_scales, - VectorMap normal_map = VectorMap(), - ColorMap color_map = ColorMap(), - EchoMap echo_map = EchoMap(), - float voxel_size = -1.f) - : m_input (input), m_point_map (point_map) - { - m_bbox = CGAL::bounding_box - (boost::make_transform_iterator (m_input.begin(), CGAL::Property_map_to_unary_function(m_point_map)), - boost::make_transform_iterator (m_input.end(), CGAL::Property_map_to_unary_function(m_point_map))); - - CGAL::Real_timer t; t.start(); - - m_scales.reserve (nb_scales); - - m_scales.push_back (new Scale (m_input, m_point_map, m_bbox, voxel_size)); - - if (voxel_size == -1.f) - voxel_size = m_scales[0]->grid_resolution(); - - for (std::size_t i = 1; i < nb_scales; ++ i) - { - voxel_size *= 2; - m_scales.push_back (new Scale (m_input, m_point_map, m_bbox, voxel_size, m_scales[i-1]->grid)); - } - t.stop(); - CGAL_CLASSIFICATION_CERR << "Scales computed in " << t.time() << " second(s)" << std::endl; - t.reset(); - - typedef typename Default::Get::type - Vmap; - typedef typename Default::Get::type - Cmap; - typedef typename Default::Get::type - Emap; - - generate_point_based_features (features); - generate_normal_based_features (features, get_parameter(normal_map)); - generate_color_based_features (features, get_parameter(color_map)); - generate_echo_based_features (features, get_parameter(echo_map)); - } - - // Functions to remove when deprecated constructor is removed - void generate_normal_based_features(const CGAL::Constant_property_map&) { } - void generate_color_based_features(const CGAL::Constant_property_map&) { } - void generate_echo_based_features(const CGAL::Constant_property_map&) { } -#endif - virtual ~Point_set_feature_generator() { clear(); @@ -435,7 +374,7 @@ public: \tparam ColorMap model of `ReadablePropertyMap` whose key type is the value type of the iterator of `PointRange` and value type is - `CGAL::Classification::RGB_Color`. + `CGAL::Color`. \param features the feature set where the features are instantiated. \param color_map property map to access the colors of the input points (if any). diff --git a/Classification/include/CGAL/Classification/Sum_of_weighted_features_classifier.h b/Classification/include/CGAL/Classification/Sum_of_weighted_features_classifier.h index 7426f275899..c7987f6d234 100644 --- a/Classification/include/CGAL/Classification/Sum_of_weighted_features_classifier.h +++ b/Classification/include/CGAL/Classification/Sum_of_weighted_features_classifier.h @@ -32,7 +32,6 @@ #include #include -#include #include #include #include @@ -744,7 +743,7 @@ public: boost::property_tree::ptree tree; boost::property_tree::read_xml(input, tree); - BOOST_FOREACH(boost::property_tree::ptree::value_type &v, tree.get_child("classification.features")) + for(boost::property_tree::ptree::value_type& v : tree.get_child("classification.features")) { std::string name = v.second.get("name"); std::map::iterator @@ -759,7 +758,7 @@ public: } } - BOOST_FOREACH(boost::property_tree::ptree::value_type &v, tree.get_child("classification.labels")) + for(boost::property_tree::ptree::value_type& v : tree.get_child("classification.labels")) { std::string label_name = v.second.get("name"); std::map::iterator @@ -775,7 +774,7 @@ public: continue; } - BOOST_FOREACH(boost::property_tree::ptree::value_type &v2, v.second) + for(boost::property_tree::ptree::value_type& v2 : v.second) { if (v2.first == "name") continue; diff --git a/Classification/include/CGAL/Classification/TensorFlow/Neural_network_classifier.h b/Classification/include/CGAL/Classification/TensorFlow/Neural_network_classifier.h index b3df48bb72b..2627251b3bd 100644 --- a/Classification/include/CGAL/Classification/TensorFlow/Neural_network_classifier.h +++ b/Classification/include/CGAL/Classification/TensorFlow/Neural_network_classifier.h @@ -34,7 +34,6 @@ #include #include -#include #include #include #include @@ -581,7 +580,7 @@ public: m_learning_rate = tree.get("classification.metadata.learning_rate"); std::size_t idx = 0; - BOOST_FOREACH(boost::property_tree::ptree::value_type &v, tree.get_child("classification.features")) + for(boost::property_tree::ptree::value_type& v : tree.get_child("classification.features")) { std::string name = v.second.get("name"); @@ -606,7 +605,7 @@ public: } idx = 0; - BOOST_FOREACH(boost::property_tree::ptree::value_type &v, tree.get_child("classification.labels")) + for(boost::property_tree::ptree::value_type& v : tree.get_child("classification.labels")) { std::string name = v.second.get("name"); if (name != m_labels[idx]->name()) @@ -630,7 +629,7 @@ public: m_bias.resize (nb_layers); std::vector hidden_layers; - BOOST_FOREACH(boost::property_tree::ptree::value_type &v, tree.get_child("classification.layers")) + for(boost::property_tree::ptree::value_type& v : tree.get_child("classification.layers")) { if (idx >= nb_layers) { diff --git a/Classification/include/CGAL/Classification/classify.h b/Classification/include/CGAL/Classification/classify.h index 492d1855237..e4a94e15386 100644 --- a/Classification/include/CGAL/Classification/classify.h +++ b/Classification/include/CGAL/Classification/classify.h @@ -556,11 +556,11 @@ namespace internal { (boost::make_transform_iterator (input.begin(), CGAL::Property_map_to_unary_function(item_map)), boost::make_transform_iterator (input.end(), CGAL::Property_map_to_unary_function(item_map))); - float Dx = float(bbox.xmax() - bbox.xmin()); - float Dy = float(bbox.ymax() - bbox.ymin()); - float A = Dx * Dy; - float a = A / min_number_of_subdivisions; - float l = std::sqrt(a); + double Dx = double(bbox.xmax() - bbox.xmin()); + double Dy = double(bbox.ymax() - bbox.ymin()); + double A = Dx * Dy; + double a = A / min_number_of_subdivisions; + double l = std::sqrt(a); std::size_t nb_x = std::size_t(Dx / l) + 1; std::size_t nb_y = std::size_t((A / nb_x) / a) + 1; std::size_t nb = nb_x * nb_y; @@ -571,11 +571,11 @@ namespace internal { for (std::size_t y = 0; y < nb_y; ++ y) { bboxes.push_back - (CGAL::Bbox_3 (bbox.xmin() + Dx * (x / float(nb_x)), - bbox.ymin() + Dy * (y / float(nb_y)), + (CGAL::Bbox_3 (bbox.xmin() + Dx * (x / double(nb_x)), + bbox.ymin() + Dy * (y / double(nb_y)), bbox.zmin(), - bbox.xmin() + Dx * ((x+1) / float(nb_x)), - bbox.ymin() + Dy * ((y+1) / float(nb_y)), + (x == nb_x - 1 ? bbox.xmax() : bbox.xmin() + Dx * ((x+1) / double(nb_x))), + (y == nb_y - 1 ? bbox.ymax() : bbox.ymin() + Dy * ((y+1) / double(nb_y))), bbox.zmax())); } @@ -590,14 +590,16 @@ namespace internal { for (std::size_t s = 0; s < input.size(); ++ s) { CGAL::Bbox_3 b = get(item_map, *(input.begin() + s)).bbox(); - - for (std::size_t i = 0; i < bboxes.size(); ++ i) + + std::size_t i = 0; + for (; i < bboxes.size(); ++ i) if (CGAL::do_overlap (b, bboxes[i])) { input_to_indices[s] = std::make_pair (i, indices[i].size()); indices[i].push_back (s); break; } + CGAL_assertion_msg (i != bboxes.size(), "Point was not assigned to any subdivision."); } internal::Classify_functor_graphcut diff --git a/Classification/include/CGAL/Classification/property_maps.h b/Classification/include/CGAL/Classification/property_maps.h index 53832d610ed..16a437dcd9a 100644 --- a/Classification/include/CGAL/Classification/property_maps.h +++ b/Classification/include/CGAL/Classification/property_maps.h @@ -80,7 +80,7 @@ public: { std::vector points; - BOOST_FOREACH(vertex_descriptor v, vertices_around_face(halfedge(f, *(map.m_mesh)), *(map.m_mesh))) + for(vertex_descriptor v : vertices_around_face(halfedge(f, *(map.m_mesh)), *(map.m_mesh))) points.push_back (get (map.m_vpm, v)); return CGAL::centroid (points.begin(), points.end()); @@ -152,7 +152,7 @@ public: { CGAL::Bbox_3 bbox; - BOOST_FOREACH(vertex_descriptor v, vertices_around_face(halfedge(f, *(map.m_mesh)), *(map.m_mesh))) + for(vertex_descriptor v : vertices_around_face(halfedge(f, *(map.m_mesh)), *(map.m_mesh))) bbox = bbox + get(map.m_vpm, v).bbox(); return value_type (f, bbox); diff --git a/Classification/test/Classification/CMakeLists.txt b/Classification/test/Classification/CMakeLists.txt index fd5d89785b2..f6967a11db1 100644 --- a/Classification/test/Classification/CMakeLists.txt +++ b/Classification/test/Classification/CMakeLists.txt @@ -89,14 +89,6 @@ if(TARGET test_classification_point_set) endif() endif() -create_single_source_cgal_program( "deprecated_test_classification_point_set.cpp" CXX_FEATURES ${needed_cxx_features} ) -if(TARGET deprecated_test_classification_point_set) - target_link_libraries(deprecated_test_classification_point_set PUBLIC ${classification_linked_libraries}) - if (TBB_FOUND) - 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}) diff --git a/Classification/test/Classification/deprecated_test_classification_point_set.cpp b/Classification/test/Classification/deprecated_test_classification_point_set.cpp deleted file mode 100644 index 46dc85b46a5..00000000000 --- a/Classification/test/Classification/deprecated_test_classification_point_set.cpp +++ /dev/null @@ -1,136 +0,0 @@ -#include - -#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::Sum_of_weighted_features_classifier Classifier; - -typedef Classification::Point_set_feature_generator Feature_generator; - -typedef Point_set::Property_map Size_t_map; -typedef Point_set::Property_map Color_map; - - - -int main (int, char**) -{ - Point_set pts; - - pts.add_normal_map(); - - bool map_added = false; - Size_t_map echo_map; - Color_map color_map; - - boost::tie (echo_map, map_added) = pts.add_property_map ("echo"); - assert (map_added); - boost::tie (color_map, map_added) = pts.add_property_map ("color"); - assert (map_added); - - for (std::size_t i = 0; i < 1000; ++ i) - { - Point_set::iterator it - = pts.insert (Point (CGAL::get_default_random().get_double(), - CGAL::get_default_random().get_double(), - CGAL::get_default_random().get_double()), - Vector (CGAL::get_default_random().get_double(), - CGAL::get_default_random().get_double(), - CGAL::get_default_random().get_double())); - echo_map[*it] = std::size_t(CGAL::get_default_random().get_int(0, 4)); - color_map[*it] = CGAL::make_array ((unsigned char)(CGAL::get_default_random().get_int(0, 255)), - (unsigned char)(CGAL::get_default_random().get_int(0, 255)), - (unsigned char)(CGAL::get_default_random().get_int(0, 255))); - } - - Feature_set features; - Feature_generator generator (features, pts, pts.point_map(), - 5, // using 5 scales - pts.normal_map(), - color_map, echo_map); - - assert (generator.number_of_scales() == 5); - assert (features.size() == 59); - - Label_set labels; - - std::vector training_set (pts.size(), -1); - for (std::size_t i = 0; i < 20; ++ i) - { - std::ostringstream oss; - oss << "label_" << i; - Label_handle lh = labels.add(oss.str().c_str()); - - for (std::size_t j = 0; j < 10; ++ j) - training_set[std::size_t(CGAL::get_default_random().get_int(0, int(training_set.size())))] = int(i); - } - assert (labels.size() == 20); - - Classifier classifier (labels, features); - - classifier.train (training_set, 800); -#ifdef CGAL_LINKED_WITH_TBB - classifier.train (training_set, 800); -#endif - - std::vector label_indices(pts.size(), -1); - - Classification::classify - (pts, labels, classifier, label_indices); - - Classification::classify_with_local_smoothing - (pts, pts.point_map(), labels, classifier, - generator.neighborhood().sphere_neighbor_query(0.01f), - label_indices); - - Classification::classify_with_graphcut - (pts, pts.point_map(), labels, classifier, - generator.neighborhood().k_neighbor_query(12), - 0.2f, 10, label_indices); - -#ifdef CGAL_LINKED_WITH_TBB - Classification::classify - (pts, labels, classifier, label_indices); - - Classification::classify_with_local_smoothing - (pts, pts.point_map(), labels, classifier, - generator.neighborhood().sphere_neighbor_query(0.01f), - label_indices); - - Classification::classify_with_graphcut - (pts, pts.point_map(), labels, classifier, - generator.neighborhood().k_neighbor_query(12), - 0.2f, 10, label_indices); -#endif - - Classification::Evaluation evaluation (labels, training_set, label_indices); - - return EXIT_SUCCESS; -} diff --git a/Classification/test/Classification/test_classification_point_set.cpp b/Classification/test/Classification/test_classification_point_set.cpp index 4636e07913b..3890533b608 100644 --- a/Classification/test/Classification/test_classification_point_set.cpp +++ b/Classification/test/Classification/test_classification_point_set.cpp @@ -37,7 +37,7 @@ typedef Classification::Point_set_feature_generator Size_t_map; -typedef Point_set::Property_map Color_map; +typedef Point_set::Property_map Color_map; @@ -55,7 +55,7 @@ int main (int, char**) normal_map = pts.normal_map(); boost::tie (echo_map, map_added) = pts.add_property_map ("echo"); assert (map_added); - boost::tie (color_map, map_added) = pts.add_property_map ("color"); + boost::tie (color_map, map_added) = pts.add_property_map ("color"); assert (map_added); for (std::size_t i = 0; i < 1000; ++ i) @@ -68,9 +68,9 @@ int main (int, char**) CGAL::get_default_random().get_double(), CGAL::get_default_random().get_double())); echo_map[*it] = std::size_t(CGAL::get_default_random().get_int(0, 4)); - color_map[*it] = CGAL::make_array ((unsigned char)(CGAL::get_default_random().get_int(0, 255)), - (unsigned char)(CGAL::get_default_random().get_int(0, 255)), - (unsigned char)(CGAL::get_default_random().get_int(0, 255))); + color_map[*it] = CGAL::Color ((unsigned char)(CGAL::get_default_random().get_int(0, 255)), + (unsigned char)(CGAL::get_default_random().get_int(0, 255)), + (unsigned char)(CGAL::get_default_random().get_int(0, 255))); } Feature_set features; diff --git a/Combinatorial_map/doc/Combinatorial_map/CGAL/Combinatorial_map.h b/Combinatorial_map/doc/Combinatorial_map/CGAL/Combinatorial_map.h index 084d951d88b..c7175837df6 100644 --- a/Combinatorial_map/doc/Combinatorial_map/CGAL/Combinatorial_map.h +++ b/Combinatorial_map/doc/Combinatorial_map/CGAL/Combinatorial_map.h @@ -65,7 +65,7 @@ Information associated with darts. Equal to `void` if `Dart_info` is not defined typedef Items::Dart_wrapper::Dart_info Dart_info; /*! -The tuple of cell attributes. Equal to `CGAL::cpp11::tuple<>` if `Attributes` is not defined in the items class. +The tuple of cell attributes. Equal to `std::tuple<>` if `Attributes` is not defined in the items class. */ typedef Items::Dart_wrapper::Attributes Attributes; diff --git a/Combinatorial_map/doc/Combinatorial_map/CGAL/Combinatorial_map_min_items.h b/Combinatorial_map/doc/Combinatorial_map/CGAL/Combinatorial_map_min_items.h index f00a5ee1d9d..57251b9b555 100644 --- a/Combinatorial_map/doc/Combinatorial_map/CGAL/Combinatorial_map_min_items.h +++ b/Combinatorial_map/doc/Combinatorial_map/CGAL/Combinatorial_map_min_items.h @@ -22,7 +22,7 @@ struct Combinatorial_map_min_items struct Dart_wrapper { typedef CGAL::Dart Dart; - typedef CGAL::cpp11::tuple<> Attributes; + typedef std::tuple<> Attributes; }; }; \endcode diff --git a/Combinatorial_map/doc/Combinatorial_map/Combinatorial_map.txt b/Combinatorial_map/doc/Combinatorial_map/Combinatorial_map.txt index 0ea4f517a5c..31a7ba36d91 100644 --- a/Combinatorial_map/doc/Combinatorial_map/Combinatorial_map.txt +++ b/Combinatorial_map/doc/Combinatorial_map/Combinatorial_map.txt @@ -221,7 +221,7 @@ struct Example_items_3 { typedef double Dart_info; typedef CGAL::Cell_attribute Edge_attrib; - typedef CGAL::cpp11::tuple Attributes; + typedef std::tuple Attributes; }; }; typedef CGAL::Combinatorial_map<3, Example_items_3> Example_custom_cmap3; diff --git a/Combinatorial_map/doc/Combinatorial_map/Concepts/GenericMapItems.h b/Combinatorial_map/doc/Combinatorial_map/Concepts/GenericMapItems.h index 9eda140a162..c84d30dc7e4 100644 --- a/Combinatorial_map/doc/Combinatorial_map/Concepts/GenericMapItems.h +++ b/Combinatorial_map/doc/Combinatorial_map/Concepts/GenericMapItems.h @@ -28,7 +28,7 @@ The following examples show two possible models of the `GenericMapItems` concept { typedef double Dart_info; typedef CGAL::Cell_attribute Edge_attrib; - typedef CGAL::cpp11::tuple Attributes; + typedef std::tuple Attributes; }; }; \endcode diff --git a/Combinatorial_map/examples/Combinatorial_map/map_3_dynamic_onmerge.cpp b/Combinatorial_map/examples/Combinatorial_map/map_3_dynamic_onmerge.cpp index 951013b3dde..147653f426b 100644 --- a/Combinatorial_map/examples/Combinatorial_map/map_3_dynamic_onmerge.cpp +++ b/Combinatorial_map/examples/Combinatorial_map/map_3_dynamic_onmerge.cpp @@ -10,7 +10,7 @@ struct Myitem struct Dart_wrapper { typedef CGAL::Cell_attribute Face_attribute; // A weight - typedef CGAL::cpp11::tuple Attributes; + typedef std::tuple Attributes; }; }; diff --git a/Combinatorial_map/examples/Combinatorial_map/map_3_with_colored_facets.cpp b/Combinatorial_map/examples/Combinatorial_map/map_3_with_colored_facets.cpp index ff8d316a54f..766cbfa57ec 100644 --- a/Combinatorial_map/examples/Combinatorial_map/map_3_with_colored_facets.cpp +++ b/Combinatorial_map/examples/Combinatorial_map/map_3_with_colored_facets.cpp @@ -27,7 +27,7 @@ struct Myitem { typedef CGAL::Cell_attribute Facet_attribute; - typedef CGAL::cpp11::tuple Attributes; + typedef std::tuple Attributes; }; }; diff --git a/Combinatorial_map/include/CGAL/Combinatorial_map.h b/Combinatorial_map/include/CGAL/Combinatorial_map.h index 341789472da..c951257df00 100644 --- a/Combinatorial_map/include/CGAL/Combinatorial_map.h +++ b/Combinatorial_map/include/CGAL/Combinatorial_map.h @@ -294,7 +294,7 @@ namespace CGAL { boost::unordered_map* dart_mapping=NULL) { - CGAL::cpp11::tuple<> converters; + std::tuple<> converters; Default_converter_dart_info dartinfoconverter; Default_converter_cmap_0attributes_with_point pointconverter; copy(amap, converters, dartinfoconverter, pointconverter, dart_mapping); @@ -431,7 +431,6 @@ namespace CGAL { * is unmarked for all the marks. * @return a Dart_handle on the new dart. */ -#ifndef CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES template < typename... Args > Dart_handle create_dart(const Args&... args) { @@ -439,90 +438,6 @@ namespace CGAL { init_dart(res); return res; } -#else - Dart_handle create_dart() - { - Dart_handle res=mdarts.emplace(); - init_dart(res); - return res; - } - template < typename T1 > - Dart_handle create_dart(const T1 &t1) - { - Dart_handle res=mdarts.emplace(t1); - init_dart(res); - return res; - } - template < typename T1, typename T2 > - Dart_handle create_dart(const T1 &t1, const T2 &t2) - { - Dart_handle res=mdarts.emplace(t1, t2); - init_dart(res); - return res; - } - template < typename T1, typename T2, typename T3 > - Dart_handle create_dart(const T1 &t1, const T2 &t2, const T3 &t3) - { - Dart_handle res=mdarts.emplace(t1, t2, t3); - init_dart(res); - return res; - } - template < typename T1, typename T2, typename T3, typename T4 > - Dart_handle create_dart(const T1 &t1, const T2 &t2, const T3 &t3, - const T4 &t4) - { - Dart_handle res=mdarts.emplace(t1, t2, t3, t4); - init_dart(res); - return res; - } - template < typename T1, typename T2, typename T3, typename T4, typename T5 > - Dart_handle create_dart(const T1 &t1, const T2 &t2, const T3 &t3, - const T4 &t4, const T5 &t5) - { - Dart_handle res=mdarts.emplace(t1, t2, t3, t4, t5); - init_dart(res); - return res; - } - template < typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6 > - Dart_handle create_dart(const T1 &t1, const T2 &t2, const T3 &t3, - const T4 &t4, const T5 &t5, const T6 &t6) - { - Dart_handle res=mdarts.emplace(t1, t2, t3, t4, t5, t6); - init_dart(res); - return res; - } - template < typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7 > - Dart_handle create_dart(const T1 &t1, const T2 &t2, const T3 &t3, - const T4 &t4, const T5 &t5, const T6 &t6, - const T7 &t7) - { - Dart_handle res=mdarts.emplace(t1, t2, t3, t4, t5, t6, t7); - init_dart(res); - return res; - } - template < typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8 > - Dart_handle create_dart(const T1 &t1, const T2 &t2, const T3 &t3, - const T4 &t4, const T5 &t5, const T6 &t6, - const T7 &t7, const T8 &t8) - { - Dart_handle res=mdarts.emplace(t1, t2, t3, t4, t5, t6, t7, t8); - init_dart(res); - return res; - } - template < typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9 > - Dart_handle create_dart(const T1 &t1, const T2 &t2, const T3 &t3, - const T4 &t4, const T5 &t5, const T6 &t6, - const T7 &t7, const T8 &t8, const T9 &t9) - { - Dart_handle res=mdarts.emplace(t1, t2, t3, t4, t5, t6, t7, t8, t9); - init_dart(res); - return res; - } -#endif /** Erase a dart from the list of darts. * @param adart the dart to erase. @@ -731,8 +646,6 @@ namespace CGAL { /// @return the betas of ADart (beta are used in the same order than /// they are given as parameters) - -#ifndef CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES template Dart_handle beta(Dart_handle ADart, Betas... betas) { return CGAL::internal::Beta_functor:: @@ -749,119 +662,6 @@ namespace CGAL { Dart_const_handle beta(Dart_const_handle ADart) const { return CGAL::internal::Beta_functor_static:: run(*this, ADart); } -#else - Dart_handle beta(Dart_handle ADart, int B1) - { return this->get_beta(ADart, B1); } - Dart_handle beta(Dart_handle ADart, int B1, int B2) - { return beta(beta(ADart, B1), B2); } - Dart_handle beta(Dart_handle ADart, int B1, int B2, int B3) - { return beta(beta(ADart, B1), B2, B3); } - Dart_handle beta(Dart_handle ADart, int B1, int B2, int B3, - int B4) - { return beta(beta(ADart, B1), B2, B3, B4); } - Dart_handle beta(Dart_handle ADart, int B1, int B2, int B3, - int B4, int B5) - { return beta(beta(ADart, B1), B2, B3, B4, B5); } - Dart_handle beta(Dart_handle ADart, int B1, int B2, int B3, - int B4, int B5, int B6) - { return beta(beta(ADart, B1), B2, B3, B4, B5, B6); } - Dart_handle beta(Dart_handle ADart, int B1, int B2, int B3, - int B4, int B5, int B6, int B7) - { return beta(beta(ADart, B1), B2, B3, B4, B5, B6, B7); } - Dart_handle beta(Dart_handle ADart, int B1, int B2, int B3, - int B4, int B5, int B6, int B7, int B8) - { return beta(beta(ADart, B1), B2, B3, B4, B5, B6, B7, B8); } - Dart_handle beta(Dart_handle ADart, int B1, int B2, int B3, - int B4, int B5, int B6, int B7, int B8, int B9) - { return beta(beta(ADart, B1), B2, B3, B4, B5, B6, B7, B8, B9); } - - template - Dart_handle beta(Dart_handle ADart) - { return this->template get_beta(ADart); } - template - Dart_handle beta(Dart_handle ADart) - { return beta(beta(ADart)); } - template - Dart_handle beta(Dart_handle ADart) - { return beta(beta(ADart)); } - template - Dart_handle beta(Dart_handle ADart) - { return beta(beta(ADart)); } - template - Dart_handle beta(Dart_handle ADart) - { return beta(beta(ADart)); } - template - Dart_handle beta(Dart_handle ADart) - { return beta(beta(ADart)); } - template - Dart_handle beta(Dart_handle ADart) - { return beta(beta(ADart)); } - template - Dart_handle beta(Dart_handle ADart) - { return beta(beta(ADart)); } - template - Dart_handle beta(Dart_handle ADart) - { return beta(beta(ADart)); } - - Dart_const_handle beta(Dart_const_handle ADart, int B1) const - { return this->get_beta(ADart, B1); } - Dart_const_handle beta(Dart_const_handle ADart, int B1, int B2) const - { return beta(beta(ADart, B1), B2); } - Dart_const_handle beta(Dart_const_handle ADart, int B1, int B2, int B3) const - { return beta(beta(ADart, B1), B2, B3); } - Dart_const_handle beta(Dart_const_handle ADart, int B1, int B2, int B3, - int B4) const - { return beta(beta(ADart, B1), B2, B3, B4); } - Dart_const_handle beta(Dart_const_handle ADart, int B1, int B2, int B3, - int B4, int B5) const - { return beta(beta(ADart, B1), B2, B3, B4, B5); } - Dart_const_handle beta(Dart_const_handle ADart, int B1, int B2, int B3, - int B4, int B5, int B6) const - { return beta(beta(ADart, B1), B2, B3, B4, B5, B6); } - Dart_const_handle beta(Dart_const_handle ADart, int B1, int B2, int B3, - int B4, int B5, int B6, int B7) const - { return beta(beta(ADart, B1), B2, B3, B4, B5, B6, B7); } - Dart_const_handle beta(Dart_const_handle ADart, int B1, int B2, int B3, - int B4, int B5, int B6, int B7, int B8) const - { return beta(beta(ADart, B1), B2, B3, B4, B5, B6, B7, B8); } - Dart_const_handle beta(Dart_const_handle ADart, int B1, int B2, int B3, - int B4, int B5, int B6, int B7, int B8, int B9) const - { return beta(beta(ADart, B1), B2, B3, B4, B5, B6, B7, B8, B9); } - - template - Dart_const_handle beta(Dart_const_handle ADart) const - { return this->template get_beta(ADart); } - template - Dart_const_handle beta(Dart_const_handle ADart) const - { return beta(beta(ADart)); } - template - Dart_const_handle beta(Dart_const_handle ADart) const - { return beta(beta(ADart)); } - template - Dart_const_handle beta(Dart_const_handle ADart) const - { return beta(beta(ADart)); } - template - Dart_const_handle beta(Dart_const_handle ADart) const - { return beta(beta(ADart)); } - template - Dart_const_handle beta(Dart_const_handle ADart) const - { return beta(beta(ADart)); } - template - Dart_const_handle beta(Dart_const_handle ADart) const - { return beta(beta(ADart)); } - template - Dart_const_handle beta(Dart_const_handle ADart) const - { return beta(beta(ADart)); } - template - Dart_const_handle beta(Dart_const_handle ADart) const - { return beta(beta(ADart)); } -#endif // Generic function to iterate on CMap or GMap in a generic way bool is_previous_exist(Dart_const_handle ADart) const @@ -1505,14 +1305,13 @@ namespace CGAL { /// Create a new attribute. /// @return a handle on the new attribute. -#ifndef CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES template typename Attribute_handle::type create_attribute(const Args&... args) { CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, "create_attribute but i-attributes are disabled"); typename Attribute_handle::type res= - CGAL::cpp11::get::value> + std::get::value> (mattribute_containers).emplace(args...); // Reinitialize the ref counting of the new attribute. This is normally // not required except if create_attribute is used as "copy contructor". @@ -1521,152 +1320,6 @@ namespace CGAL { (this->template attributes(), res); return res; } -#else - template - typename Attribute_handle::type - create_attribute() - { - CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, - "create_attribute but i-attributes are disabled"); - typename Attribute_handle::type res= - CGAL::cpp11::get::value> - (mattribute_containers).emplace(); - internal::Init_id::type>::run - (this->template attributes(), res); - return res; - } - template - typename Attribute_handle::type - create_attribute(const T1 &t1) - { - CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, - "create_attribute but i-attributes are disabled"); - typename Attribute_handle::type res= - CGAL::cpp11::get::value> - (mattribute_containers).emplace(t1); - // Reinitialize the ref counting of the new attribute. This is normally - // not required except if create_attribute is used as "copy contructor". - this->template init_attribute_ref_counting(res); - internal::Init_id::type>::run - (this->template attributes(), res); - return res; - } - template - typename Attribute_handle::type - create_attribute(const T1 &t1, const T2 &t2) - { - CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, - "create_attribute but i-attributes are disabled"); - typename Attribute_handle::type res= - CGAL::cpp11::get::value> - (mattribute_containers).emplace(t1, t2); - internal::Init_id::type>::run - (this->template attributes(), res); - return res; - } - template - typename Attribute_handle::type - create_attribute(const T1 &t1, const T2 &t2, const T3 &t3) - { - CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, - "create_attribute but i-attributes are disabled"); - typename Attribute_handle::type res= - CGAL::cpp11::get::value> - (mattribute_containers).emplace(t1, t2, t3); - internal::Init_id::type>::run - (this->template attributes(), res); - return res; - } - template - typename Attribute_handle::type - create_attribute(const T1 &t1, const T2 &t2, const T3 &t3, const T4 &t4) - { - CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, - "create_attribute but i-attributes are disabled"); - typename Attribute_handle::type res= - CGAL::cpp11::get::value> - (mattribute_containers).emplace(t1, t2, t3, t4); - internal::Init_id::type>::run - (this->template attributes(), res); - return res; - } - template - typename Attribute_handle::type - create_attribute(const T1 &t1, const T2 &t2, const T3 &t3, const T4 &t4, - const T5 &t5) - { - CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, - "create_attribute but i-attributes are disabled"); - typename Attribute_handle::type res= - CGAL::cpp11::get::value> - (mattribute_containers).emplace(t1, t2, t3, t4, t5); - internal::Init_id::type>::run - (this->template attributes(), res); - return res; - } - template - typename Attribute_handle::type - create_attribute(const T1 &t1, const T2 &t2, const T3 &t3, const T4 &t4, - const T5 &t5, const T6 &t6) - { - CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, - "create_attribute but i-attributes are disabled"); - typename Attribute_handle::type res= - CGAL::cpp11::get::value> - (mattribute_containers).emplace(t1, t2, t3, t4, t5, t6); - internal::Init_id::type>::run - (this->template attributes(), res); - return res; - } - template - typename Attribute_handle::type - create_attribute(const T1 &t1, const T2 &t2, const T3 &t3, const T4 &t4, - const T5 &t5, const T6 &t6, const T7 &t7) - { - CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, - "create_attribute but i-attributes are disabled"); - typename Attribute_handle::type res= - CGAL::cpp11::get::value> - (mattribute_containers).emplace(t1, t2, t3, t4, t5, t6, t7); - internal::Init_id::type>::run - (this->template attributes(), res); - return res; - } - template - typename Attribute_handle::type - create_attribute(const T1 &t1, const T2 &t2, const T3 &t3, const T4 &t4, - const T5 &t5, const T6 &t6, const T7 &t7, const T8 &t8) - { - CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, - "create_attribute but i-attributes are disabled"); - typename Attribute_handle::type res= - CGAL::cpp11::get::value> - (mattribute_containers).emplace(t1, t2, t3, t4, t5, t6, t7, t8); - internal::Init_id::type>::run - (this->template attributes(), res); - return res; - } - template - typename Attribute_handle::type - create_attribute(const T1 &t1, const T2 &t2, const T3 &t3, const T4 &t4, - const T5 &t5, const T6 &t6, const T7 &t7, const T8 &t8, - const T9 &t9) - { - CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, - "create_attribute but i-attributes are disabled"); - typename Attribute_handle::type res= - CGAL::cpp11::get::value> - (mattribute_containers).emplace(t1, t2, t3, t4, t5, t6, t7, t8, t9); - internal::Init_id::type>::run - (this->template attributes(), res); - return res; - } -#endif /// Erase an attribute. /// @param h a handle to the attribute to erase. @@ -1675,7 +1328,7 @@ namespace CGAL { { CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, "erase_attribute but i-attributes are disabled"); - CGAL::cpp11::get::value> + std::get::value> (mattribute_containers).erase(h); } @@ -1685,7 +1338,7 @@ namespace CGAL { { CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, "is_attribute_used but i-attributes are disabled"); - return CGAL::cpp11::get::value> + return std::get::value> (mattribute_containers).is_used(ah); } @@ -1695,7 +1348,7 @@ namespace CGAL { { CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, "number_of_attributes but i-attributes are disabled"); - return CGAL::cpp11::get::value> + return std::get::value> (mattribute_containers).size(); } @@ -1724,7 +1377,7 @@ namespace CGAL { { CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, "attributes but i-attributes are disabled"); - return CGAL::cpp11::get::value> + return std::get::value> (mattribute_containers); } @@ -1733,7 +1386,7 @@ namespace CGAL { { CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, "attributes but i-attributes are disabled"); - return CGAL::cpp11::get::value> + return std::get::value> (mattribute_containers); } @@ -1749,7 +1402,7 @@ namespace CGAL { "onsplit_functor but " "i-attributes are disabled"); - return CGAL::cpp11::get::value> + return std::get::value> (m_onsplit_functors); } @@ -1765,7 +1418,7 @@ namespace CGAL { "onsplit_functor but " "i-attributes are disabled"); - return CGAL::cpp11::get::value> + return std::get::value> (m_onsplit_functors); } @@ -1781,7 +1434,7 @@ namespace CGAL { "onsplit_functor but " "i-attributes are disabled"); - return CGAL::cpp11::get::value> + return std::get::value> (m_onmerge_functors); } // Get the ith dynamic onmerge functor (by reference so that we can @@ -1796,7 +1449,7 @@ namespace CGAL { "onsplit_functor but " "i-attributes are disabled"); - return CGAL::cpp11::get::value> + return std::get::value> (m_onmerge_functors); } @@ -2815,7 +2468,6 @@ namespace CGAL { return res; } -#ifndef CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES //************************************************************************** // Dart_of_orbit_basic_range template @@ -2894,307 +2546,6 @@ namespace CGAL { darts_of_orbit_basic(Dart_const_handle adart, size_type amark=INVALID_MARK) const { return Dart_of_orbit_basic_const_range(*this,adart,amark); } //************************************************************************** -#else - //************************************************************************** - // Dart_of_orbit_basic_range - template - struct Dart_of_orbit_basic_range: public CGAL::CMap_range - , - CGAL::CMap_dart_const_iterator_basic_of_orbit > - { - typedef CGAL::CMap_range - , - CGAL::CMap_dart_const_iterator_basic_of_orbit > Base; - - Dart_of_orbit_basic_range(Self &amap, Dart_handle adart, - size_type /*amark*/=INVALID_MARK): - Base(amap, adart) - {} - }; - //************************************************************************** - // Dart_of_orbit_basic_const_range - template - struct Dart_of_orbit_basic_const_range: public CMap_const_range - > - { - typedef CMap_const_range - > Base; - - Dart_of_orbit_basic_const_range(const Self &amap, - Dart_const_handle adart, size_type amark=INVALID_MARK): - Base(amap, adart, amark) - {} - }; - //************************************************************************** - // Dart_of_orbit_range - template - struct Dart_of_orbit_range: public CGAL::CMap_range - , - CGAL::CMap_dart_const_iterator_of_orbit > - { - typedef CGAL::CMap_range - , - CGAL::CMap_dart_const_iterator_of_orbit > - Base; - - Dart_of_orbit_range(Self &amap, Dart_handle adart): - Base(amap, adart) - {} - }; - //************************************************************************** - // Dart_of_orbit_const_range - template - struct Dart_of_orbit_const_range: public CMap_const_range - > - { - typedef CMap_const_range - > Base; - - Dart_of_orbit_const_range(const Self &amap, Dart_const_handle adart): - Base(amap, adart) - {} - }; - //************************************************************************** - /// @return a range on all the darts of the given orbit - Dart_of_orbit_range<> darts_of_orbit(Dart_handle adart) - { return Dart_of_orbit_range<>(*this,adart); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_range darts_of_orbit(Dart_handle adart) - { return Dart_of_orbit_range(*this,adart); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_range darts_of_orbit(Dart_handle adart) - { return Dart_of_orbit_range(*this,adart); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_range darts_of_orbit(Dart_handle adart) - { return Dart_of_orbit_range(*this,adart); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_range darts_of_orbit(Dart_handle adart) - { return Dart_of_orbit_range(*this,adart); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_range darts_of_orbit(Dart_handle adart) - { return Dart_of_orbit_range(*this,adart); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_range darts_of_orbit(Dart_handle adart) - { return Dart_of_orbit_range(*this,adart); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_range darts_of_orbit(Dart_handle adart) - { return Dart_of_orbit_range(*this,adart); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_range darts_of_orbit - (Dart_handle adart) - { return Dart_of_orbit_range(*this,adart); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_range - darts_of_orbit(Dart_handle adart) - { return Dart_of_orbit_range(*this,adart); } - //-------------------------------------------------------------------------- - // Const versions. - Dart_of_orbit_const_range<> darts_of_orbit(Dart_const_handle adart) const - { return Dart_of_orbit_const_range<>(*this,adart); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_const_range darts_of_orbit(Dart_const_handle - adart) const - { return Dart_of_orbit_const_range(*this,adart); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_const_range darts_of_orbit(Dart_const_handle - adart) const - { return Dart_of_orbit_const_range(*this,adart); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_const_range darts_of_orbit - (Dart_const_handle adart) const - { return Dart_of_orbit_const_range(*this,adart); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_const_range - darts_of_orbit(Dart_const_handle adart) const - { return Dart_of_orbit_const_range(*this,adart); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_const_range - darts_of_orbit(Dart_const_handle adart) const - { return Dart_of_orbit_const_range(*this,adart); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_const_range - darts_of_orbit(Dart_const_handle adart) const - { return Dart_of_orbit_const_range(*this,adart); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_const_range - darts_of_orbit(Dart_const_handle adart) const - { return Dart_of_orbit_const_range(*this,adart); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_const_range - darts_of_orbit(Dart_const_handle adart) const - { return Dart_of_orbit_const_range(*this,adart); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_const_range - darts_of_orbit(Dart_const_handle adart) const - { return Dart_of_orbit_const_range - (*this,adart); } - //-------------------------------------------------------------------------- - // Basic versions - Dart_of_orbit_basic_range<> darts_of_orbit_basic(Dart_handle adart, - size_type amark=INVALID_MARK) - { return Dart_of_orbit_basic_range<>(*this,adart,amark); } - //-------------------------------------------------------------------------- - Dart_of_orbit_basic_const_range<> darts_of_orbit_basic - (Dart_const_handle adart,size_type amark=INVALID_MARK) const - { return Dart_of_orbit_basic_const_range<>(*this,adart,amark); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_basic_range darts_of_orbit_basic(Dart_handle adart, - size_type amark=INVALID_MARK) - { return Dart_of_orbit_basic_range(*this,adart,amark); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_basic_const_range darts_of_orbit_basic - (Dart_const_handle adart, size_type amark=INVALID_MARK) const - { return Dart_of_orbit_basic_const_range(*this,adart,amark); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_basic_range darts_of_orbit_basic(Dart_handle adart, - size_type amark=INVALID_MARK) - { return Dart_of_orbit_basic_range(*this,adart,amark); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_basic_const_range darts_of_orbit_basic - (Dart_const_handle adart, size_type amark=INVALID_MARK) const - { return Dart_of_orbit_basic_const_range(*this,adart,amark); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_basic_range darts_of_orbit_basic(Dart_handle adart, - size_type amark=INVALID_MARK) - { return Dart_of_orbit_basic_range(*this,adart,amark); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_basic_const_range darts_of_orbit_basic - (Dart_const_handle adart, size_type amark=INVALID_MARK) const - { return Dart_of_orbit_basic_const_range(*this,adart,amark); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_basic_range darts_of_orbit_basic - (Dart_handle adart, size_type amark=INVALID_MARK) - { return Dart_of_orbit_basic_range(*this,adart,amark); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_basic_const_range - darts_of_orbit_basic(Dart_const_handle adart, size_type amark=INVALID_MARK) const - { return Dart_of_orbit_basic_const_range(*this,adart,amark); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_basic_range darts_of_orbit_basic - (Dart_handle adart, size_type amark=INVALID_MARK) - { return Dart_of_orbit_basic_range(*this,adart,amark); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_basic_const_range - darts_of_orbit_basic(Dart_const_handle adart, size_type amark=INVALID_MARK) const - { return Dart_of_orbit_basic_const_range - (*this,adart,amark); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_basic_range darts_of_orbit_basic - (Dart_handle adart, size_type amark=INVALID_MARK) - { return Dart_of_orbit_basic_range(*this,adart,amark); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_basic_const_range - darts_of_orbit_basic(Dart_const_handle adart, size_type amark=INVALID_MARK) const - { return Dart_of_orbit_basic_const_range - (*this,adart,amark); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_basic_range darts_of_orbit_basic - (Dart_handle adart, size_type amark=INVALID_MARK) - { return Dart_of_orbit_basic_range - (*this,adart,amark); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_basic_const_range - darts_of_orbit_basic(Dart_const_handle adart, size_type amark=INVALID_MARK) const - { return Dart_of_orbit_basic_const_range - (*this,adart,amark); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_basic_range darts_of_orbit - (Dart_handle adart, size_type amark=INVALID_MARK) - { return Dart_of_orbit_basic_range - (*this,adart,amark); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_basic_const_range - darts_of_orbit_basic(Dart_const_handle adart, size_type amark=INVALID_MARK) const - { return Dart_of_orbit_basic_const_range - (*this,adart,amark); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_basic_range - darts_of_orbit_basic(Dart_handle adart, size_type amark=INVALID_MARK) - { return Dart_of_orbit_basic_range - (*this,adart,amark); } - //-------------------------------------------------------------------------- - template - Dart_of_orbit_basic_const_range - darts_of_orbit_basic(Dart_const_handle adart, size_type amark=INVALID_MARK) const - { return Dart_of_orbit_basic_const_range - (*this,adart,amark); } - //************************************************************************** -#endif //CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES - //************************************************************************** // Dart_of_cell_basic_range template struct Dart_of_cell_basic_range: public CGAL::CMap_range diff --git a/Combinatorial_map/include/CGAL/Combinatorial_map_min_items.h b/Combinatorial_map/include/CGAL/Combinatorial_map_min_items.h index 4835076d627..3f1f1fcdb31 100644 --- a/Combinatorial_map/include/CGAL/Combinatorial_map_min_items.h +++ b/Combinatorial_map/include/CGAL/Combinatorial_map_min_items.h @@ -43,7 +43,7 @@ namespace CGAL { struct Dart_wrapper { typedef CGAL::Dart< d, Refs > Dart; - typedef CGAL::cpp11::tuple<> Attributes; + typedef std::tuple<> Attributes; }; }; diff --git a/Combinatorial_map/include/CGAL/Combinatorial_map_save_load.h b/Combinatorial_map/include/CGAL/Combinatorial_map_save_load.h index a80fd758301..884e2bb059a 100644 --- a/Combinatorial_map/include/CGAL/Combinatorial_map_save_load.h +++ b/Combinatorial_map/include/CGAL/Combinatorial_map_save_load.h @@ -23,7 +23,6 @@ #ifndef CGAL_COMBINATORIAL_MAP_SAVE_LOAD_H #define CGAL_COMBINATORIAL_MAP_SAVE_LOAD_H -#include #include #include #include @@ -525,8 +524,8 @@ namespace CGAL { static void run(const boost::property_tree::ptree& pt, CMap& amap, const std::vector& myDarts) { - BOOST_FOREACH( const boost::property_tree::ptree::value_type &v0, - pt.get_child("data.attributes") ) + for(const boost::property_tree::ptree::value_type& v0 : + pt.get_child("data.attributes") ) { // if (v0.first == "dimension") @@ -552,14 +551,14 @@ namespace CGAL { return; }*/ - BOOST_FOREACH(const boost::property_tree::ptree::value_type &v1, + for(const boost::property_tree::ptree::value_type &v1 : v0.second ) { if( v1.first == "a" ) { id_dart_cellule=v1.second.get("d")-1; - BOOST_FOREACH(const boost::property_tree::ptree::value_type &v2, + for(const boost::property_tree::ptree::value_type &v2 : v1.second ) { if( type==type_map && v2.first == "v" ) @@ -601,7 +600,7 @@ namespace CGAL { static void run(const boost::property_tree::ptree& pt, CMap& amap, const std::vector& myDarts) { - BOOST_FOREACH( const boost::property_tree::ptree::value_type &v0, + for( const boost::property_tree::ptree::value_type &v0 : pt.get_child("data.attributes") ) { // @@ -623,14 +622,14 @@ namespace CGAL { return; }*/ - BOOST_FOREACH(const boost::property_tree::ptree::value_type &v1, + for(const boost::property_tree::ptree::value_type &v1 : v0.second ) { if( v1.first == "a" ) { id_dart_cellule=v1.second.get("d")-1; - BOOST_FOREACH(const boost::property_tree::ptree::value_type &v2, + for(const boost::property_tree::ptree::value_type &v2 : v1.second ) { if( v2.first == "p" ) @@ -662,7 +661,7 @@ namespace CGAL { static void run(const boost::property_tree::ptree& pt, CMap& amap, const std::vector& myDarts) { - BOOST_FOREACH( const boost::property_tree::ptree::value_type &v0, + for( const boost::property_tree::ptree::value_type &v0 : pt.get_child("data.attributes") ) { // @@ -684,14 +683,14 @@ namespace CGAL { return; } */ - BOOST_FOREACH(const boost::property_tree::ptree::value_type &v1, + for(const boost::property_tree::ptree::value_type &v1 : v0.second ) { if( v1.first == "a" ) { id_dart_cellule=v1.second.get("d")-1; - BOOST_FOREACH(const boost::property_tree::ptree::value_type &v2, + for(const boost::property_tree::ptree::value_type &v2 : v1.second ) { if( v2.first == "v" ) @@ -721,7 +720,7 @@ namespace CGAL { static void run(const boost::property_tree::ptree& pt, CMap& amap, const std::vector& myDarts) { - BOOST_FOREACH( const boost::property_tree::ptree::value_type &v0, + for( const boost::property_tree::ptree::value_type &v0 : pt.get_child("data.attributes") ) { // @@ -734,7 +733,7 @@ namespace CGAL { { unsigned int id_dart_cellule=0; - BOOST_FOREACH(const boost::property_tree::ptree::value_type &v1, + for(const boost::property_tree::ptree::value_type &v1 : v0.second ) { if( v1.first == "a" ) @@ -777,7 +776,7 @@ namespace CGAL { using boost::property_tree::ptree; // make darts - BOOST_FOREACH( const ptree::value_type &v, pt.get_child("data.darts") ) + for( const ptree::value_type &v : pt.get_child("data.darts") ) { if( v.first == "d" ) myDarts.push_back(amap.create_dart()); @@ -788,11 +787,11 @@ namespace CGAL { unsigned int currentDartInt = 0; unsigned int nextDartInt; - BOOST_FOREACH( const ptree::value_type &v, pt.get_child("data.darts") ) + for( const ptree::value_type &v : pt.get_child("data.darts") ) { if( v.first == "d" ) { - BOOST_FOREACH( const ptree::value_type &v2, v.second ) + for( const ptree::value_type &v2 : v.second ) { if (v2.first == "b") { diff --git a/Combinatorial_map/include/CGAL/Combinatorial_map_storages.h b/Combinatorial_map/include/CGAL/Combinatorial_map_storages.h index 4cd59641644..5b37734b84f 100644 --- a/Combinatorial_map/include/CGAL/Combinatorial_map_storages.h +++ b/Combinatorial_map/include/CGAL/Combinatorial_map_storages.h @@ -212,7 +212,7 @@ namespace CGAL { { CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, "attribute called but i-attributes are disabled."); - return CGAL::cpp11::get::value> + return std::get::value> (ADart->mattribute_handles); } template @@ -221,7 +221,7 @@ namespace CGAL { { CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, "attribute called but i-attributes are disabled."); - return CGAL::cpp11::get::value> + return std::get::value> (ADart->mattribute_handles); } @@ -233,7 +233,7 @@ namespace CGAL { CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, "copy_attribute called but i-attributes are disabled."); typename Attribute_handle::type res= - CGAL::cpp11::get::value> + std::get::value> (mattribute_containers).emplace(*ah); this->template init_attribute_ref_counting(res); return res; @@ -377,7 +377,7 @@ namespace CGAL { template void display_attribute(typename Attribute_const_handle::type ah) const - { std::cout<< CGAL::cpp11::get::value> + { std::cout<< std::get::value> (mattribute_containers).index(ah); } protected: @@ -386,7 +386,7 @@ namespace CGAL { void basic_set_dart_attribute(Dart_handle dh, typename Attribute_handle::type ah) { - CGAL::cpp11::get::value> + std::get::value> (dh->mattribute_handles) = ah; } diff --git a/Combinatorial_map/include/CGAL/Dart.h b/Combinatorial_map/include/CGAL/Dart.h index e2de6901fc4..7c304075109 100644 --- a/Combinatorial_map/include/CGAL/Dart.h +++ b/Combinatorial_map/include/CGAL/Dart.h @@ -186,7 +186,7 @@ namespace CGAL { { CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, "attribute called but i-attributes are disabled."); - return CGAL::cpp11::get::value> + return std::get::value> (mattribute_handles); } template @@ -194,7 +194,7 @@ namespace CGAL { { CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, "attribute called but i-attributes are disabled."); - return CGAL::cpp11::get::value> + return std::get::value> (mattribute_handles); } @@ -299,7 +299,7 @@ namespace CGAL { { CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, "attribute called but i-attributes are disabled."); - return CGAL::cpp11::get::value> + return std::get::value> (mattribute_handles); } template @@ -307,7 +307,7 @@ namespace CGAL { { CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, "attribute called but i-attributes are disabled."); - return CGAL::cpp11::get::value> + return std::get::value> (mattribute_handles); } }; diff --git a/Combinatorial_map/include/CGAL/Dart_const_iterators.h b/Combinatorial_map/include/CGAL/Dart_const_iterators.h index 389081b2f5a..40ec329ac14 100644 --- a/Combinatorial_map/include/CGAL/Dart_const_iterators.h +++ b/Combinatorial_map/include/CGAL/Dart_const_iterators.h @@ -38,7 +38,7 @@ namespace CGAL { * - CMap_dart_const_iterator_basic_of_involution_inv */ //**************************************************************************** -#ifndef CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES + template class CMap_dart_const_iterator_basic_of_orbit: public CMap_dart_iterator_basic_of_orbit_generic @@ -92,71 +92,6 @@ namespace CGAL { it.get_first_dart()) {} }; -#else - //**************************************************************************** - template - class CMap_dart_const_iterator_basic_of_orbit: - public CMap_dart_iterator_basic_of_orbit_generic - { - public: - typedef CMap_dart_const_iterator_basic_of_orbit Self; - typedef CMap_dart_iterator_basic_of_orbit_generic Base; - - typedef typename Map_::Dart_const_handle Dart_const_handle; - typedef typename Map_::size_type size_type; - - /// Main constructor. - CMap_dart_const_iterator_basic_of_orbit(const Map_& amap, - Dart_const_handle adart): - Base(amap,adart) - {} - /// Main constructor. - CMap_dart_const_iterator_basic_of_orbit(const Map_& amap, - Dart_const_handle adart, - size_type amark): - Base(amap,adart,amark) - {} - /// Constructor from non const version. - CMap_dart_const_iterator_basic_of_orbit - (const CMap_dart_iterator_basic_of_orbit& it): - Base(*const_cast(it.get_combinatorial_map()), - it.get_first_dart(), - it.mmark_number) - {} - }; - //**************************************************************************** - template - class CMap_dart_const_iterator_of_orbit: - public CMap_dart_iterator_of_orbit_generic - { - public: - typedef CMap_dart_const_iterator_of_orbit Self; - typedef CMap_dart_iterator_of_orbit_generic Base; - - typedef typename Map_::Dart_const_handle Dart_const_handle; - - /// Main constructor. - CMap_dart_const_iterator_of_orbit(const Map_& amap, - Dart_const_handle adart): - Base(amap,adart) - {} - /// Constructor from non const version. - CMap_dart_const_iterator_of_orbit - (const CMap_dart_iterator_of_orbit& it): - Base(*const_cast(it.get_combinatorial_map()), - it.get_first_dart()) - {} - }; -#endif // CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES //**************************************************************************** template class CMap_dart_const_iterator_basic_of_all: diff --git a/Combinatorial_map/include/CGAL/Dart_iterators.h b/Combinatorial_map/include/CGAL/Dart_iterators.h index c8172f0038f..d9b6b3607bd 100644 --- a/Combinatorial_map/include/CGAL/Dart_iterators.h +++ b/Combinatorial_map/include/CGAL/Dart_iterators.h @@ -45,97 +45,8 @@ namespace CGAL { /* Class CMap_dart_iterator_basic_of_orbit: to iterate * on the darts of the orbit */ -#ifndef CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES template class CMap_dart_iterator_basic_of_orbit_generic; -#else - template - class CMap_dart_iterator_basic_of_orbit_generic; - - template - struct Get_CMap_dart_iterator_basic_of_orbit; - - template - struct Get_CMap_dart_iterator_basic_of_orbit - { - typedef CMap_dart_iterator_basic_of_orbit_generic type; - }; - - template - struct Get_CMap_dart_iterator_basic_of_orbit - { - typedef CMap_dart_iterator_basic_of_orbit_generic type; - }; - - template - struct Get_CMap_dart_iterator_basic_of_orbit - { - typedef CMap_dart_iterator_basic_of_orbit_generic type; - }; - - template - struct Get_CMap_dart_iterator_basic_of_orbit - { - typedef CMap_dart_iterator_basic_of_orbit_generic type; - }; - - template - struct Get_CMap_dart_iterator_basic_of_orbit - { - typedef CMap_dart_iterator_basic_of_orbit_generic type; - }; - - template - struct Get_CMap_dart_iterator_basic_of_orbit - { - typedef CMap_dart_iterator_basic_of_orbit_generic type; - }; - - template - struct Get_CMap_dart_iterator_basic_of_orbit - { - typedef CMap_dart_iterator_basic_of_orbit_generic type; - }; - - template - struct Get_CMap_dart_iterator_basic_of_orbit - { - typedef CMap_dart_iterator_basic_of_orbit_generic type; - }; - - template - struct Get_CMap_dart_iterator_basic_of_orbit - { - typedef CMap_dart_iterator_basic_of_orbit_generic type; - }; - - template - struct Get_CMap_dart_iterator_basic_of_orbit - { - typedef CMap_dart_iterator_basic_of_orbit_generic type; - }; -#endif //CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES //**************************************************************************** // Case when Beta... is empty: iterator of self template @@ -994,7 +905,6 @@ namespace CGAL { //**************************************************************************** /* Generic nD version. */ -#ifndef CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES template class CMap_dart_iterator_basic_of_orbit_generic: public CMap_extend_iterator - class CMap_dart_iterator_basic_of_orbit_generic: - public CMap_extend_iterator - ::type, B3> - { - public: - typedef typename Get_CMap_dart_iterator_basic_of_orbit - ::type Self; - - typedef CMap_extend_iterator - ::type, B3> Base; - - typedef typename Base::Dart_handle Dart_handle; - typedef typename Base::Map Map; - typedef typename Map::size_type size_type; - - /// True iff this iterator is basic - typedef Tag_true Basic_iterator; - - public: - /// Main constructor. - CMap_dart_iterator_basic_of_orbit_generic(Map& amap, Dart_handle adart, - size_type amark): - Base(amap, adart, amark) - {} - }; -#endif //CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES //**************************************************************************** // TODO? we can optimize the iterators when // 1 class CMap_dart_iterator_basic_of_orbit: public CMap_dart_iterator_basic_of_orbit_generic @@ -1080,33 +958,6 @@ namespace CGAL { Base(amap,adart,amark) {} }; -#else - //**************************************************************************** - template - class CMap_dart_iterator_basic_of_orbit: - public Get_CMap_dart_iterator_basic_of_orbit::type - { - public: - typedef CMap_dart_iterator_basic_of_orbit - Self; - typedef typename Get_CMap_dart_iterator_basic_of_orbit - ::type Base; - - typedef typename Map::Dart_handle Dart_handle; - typedef typename Map::size_type size_type; - - /// Main constructor. - CMap_dart_iterator_basic_of_orbit(Map& amap,Dart_handle adart): - Base(amap,adart) - {} - /// Main constructor. - CMap_dart_iterator_basic_of_orbit(Map& amap,Dart_handle adart,size_type amark): - Base(amap,adart,amark) - {} - }; -#endif // CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES //**************************************************************************** /* Class CMap_dart_iterator_basic_of_all: to iterate onto all the * darts of the map. @@ -1789,7 +1640,6 @@ namespace CGAL { //*************************ITERATORS*NON*BASIC******************************** //**************************************************************************** //**************************************************************************** -#ifndef CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES template class CMap_dart_iterator_of_orbit_generic: public CMap_non_basic_iterator - class CMap_dart_iterator_of_orbit_generic: - public CMap_non_basic_iterator::type> - { - public: - typedef CMap_dart_iterator_of_orbit_generic Self; - typedef CMap_non_basic_iterator::type> Base; - - typedef typename Base::Map Map; - typedef typename Base::Dart_handle Dart_handle; - - /// Main constructor. - CMap_dart_iterator_of_orbit_generic(Map& amap, Dart_handle adart1): - Base(amap, adart1) - {} - }; - //**************************************************************************** - template - class CMap_dart_iterator_of_orbit: - public CMap_dart_iterator_of_orbit_generic - { - public: - typedef CMap_dart_iterator_of_orbit Self; - typedef CMap_dart_iterator_of_orbit_generic Base; - - typedef typename Base::Dart_handle Dart_handle; - - /// Main constructor. - CMap_dart_iterator_of_orbit(Map& amap, Dart_handle adart): - Base(amap, adart) - {} - }; -#endif // CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES //**************************************************************************** template class CMap_dart_iterator_of_cell: diff --git a/Combinatorial_map/include/CGAL/internal/Combinatorial_map_copy_functors.h b/Combinatorial_map/include/CGAL/internal/Combinatorial_map_copy_functors.h index 47f240c2967..9875d97a787 100644 --- a/Combinatorial_map/include/CGAL/internal/Combinatorial_map_copy_functors.h +++ b/Combinatorial_map/include/CGAL/internal/Combinatorial_map_copy_functors.h @@ -163,7 +163,7 @@ struct Get_convert_attribute_functor run( const Map1& cmap1, Map2& cmap2, typename Map1::Dart_const_handle dh1, typename Map2::Dart_handle dh2, const Converters& converters) { - return CGAL::cpp11::get(converters) (cmap1, cmap2, dh1, dh2); + return std::get(converters) (cmap1, cmap2, dh1, dh2); } }; // **************************************************************************** diff --git a/Combinatorial_map/include/CGAL/internal/Combinatorial_map_internal_functors.h b/Combinatorial_map/include/CGAL/internal/Combinatorial_map_internal_functors.h index 26286c5f5c7..4392a284012 100644 --- a/Combinatorial_map/include/CGAL/internal/Combinatorial_map_internal_functors.h +++ b/Combinatorial_map/include/CGAL/internal/Combinatorial_map_internal_functors.h @@ -114,9 +114,9 @@ struct Swap_attributes_functor template static void run( CMap& cmap1, CMap& cmap2) - { CGAL::cpp11::get::value> + { std::get::value> (cmap1.mattribute_containers).swap( - CGAL::cpp11::get::value> + std::get::value> (cmap2.mattribute_containers)); } }; @@ -159,9 +159,9 @@ struct Call_split_functor run(amap.template get_attribute(a1), amap.template get_attribute(a2)); // Dynamic version - if ( CGAL::cpp11::get::value> + if ( std::get::value> (amap.m_onsplit_functors) ) - CGAL::cpp11::get::value> + std::get::value> (amap.m_onsplit_functors) (amap.template get_attribute(a1), amap.template get_attribute(a2)); } @@ -196,9 +196,9 @@ struct Call_merge_functor run(amap.template get_attribute(a1), amap.template get_attribute(a2)); // Dynamic version - if ( CGAL::cpp11::get::value> + if ( std::get::value> (amap.m_onmerge_functors) ) - CGAL::cpp11::get::value> + std::get::value> (amap.m_onmerge_functors) (amap.template get_attribute(a1), amap.template get_attribute(a2)); } @@ -984,7 +984,6 @@ struct Reverse_orientation_of_connected_component_functor }; // **************************************************************************** // Beta functor, used to combine several beta. -#ifndef CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES template struct Beta_functor; @@ -1036,7 +1035,6 @@ struct Beta_functor_static { return Beta_functor_static:: run(AMap, AMap.template get_beta(ADart)); } }; -#endif //CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES // **************************************************************************** template diff --git a/Combinatorial_map/include/CGAL/internal/Combinatorial_map_utility.h b/Combinatorial_map/include/CGAL/internal/Combinatorial_map_utility.h index 3ffbdec6657..ef34a88e8d4 100644 --- a/Combinatorial_map/include/CGAL/internal/Combinatorial_map_utility.h +++ b/Combinatorial_map/include/CGAL/internal/Combinatorial_map_utility.h @@ -72,37 +72,35 @@ namespace CGAL { typedef CGAL::Tag_true type; }; // Get the type Attributes defined as inner type of T. - // If T::Attributes is not defined, defined CGAL::cpp11::tuple<> as type. + // If T::Attributes is not defined, defined std::tuple<> as type. BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(Has_attributes_tuple,Attributes,false) template::value > struct Get_attributes_tuple - { typedef CGAL::cpp11::tuple<> type; }; + { typedef std::tuple<> type; }; template struct Get_attributes_tuple { typedef typename T::Attributes type; }; -#if ! defined(CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES) && \ - ! defined(CGAL_CFG_NO_CPP0X_TUPLE) // Convert a tuple in a same tuple where each void type was replaced into // CGAL::Void. template struct Convert_tuple_with_void; template - struct Convert_tuple_with_void > + struct Convert_tuple_with_void > { - typedef CGAL::cpp11::tuple::type... > type; + typedef std::tuple::type... > type; }; // Length of a variadic template template struct My_length; template - struct My_length > + struct My_length > { - static const int value = My_length >::value + 1; + static const int value = My_length >::value + 1; }; template<> - struct My_length > + struct My_length > { static const int value = 0; }; @@ -111,17 +109,17 @@ namespace CGAL template struct Number_of_type_in_tuple; template - struct Number_of_type_in_tuple >{ + struct Number_of_type_in_tuple >{ static const int value=Number_of_type_in_tuple - >::value+1; + >::value+1; }; template - struct Number_of_type_in_tuple >{ + struct Number_of_type_in_tuple >{ static const int value=Number_of_type_in_tuple - >::value; + >::value; }; template - struct Number_of_type_in_tuple >{ + struct Number_of_type_in_tuple >{ static const int value=0; }; @@ -129,21 +127,21 @@ namespace CGAL template struct Number_of_different_type_in_tuple; template - struct Number_of_different_type_in_tuple > { static const int value=Number_of_different_type_in_tuple - >::value+1; + >::value+1; }; template - struct Number_of_different_type_in_tuple > { static const int value=Number_of_different_type_in_tuple - >::value; + >::value; }; template - struct Number_of_different_type_in_tuple > + struct Number_of_different_type_in_tuple > { static const int value=0; }; @@ -156,23 +154,23 @@ namespace CGAL struct Nb_type_in_tuple_up_to_k; template - struct Nb_type_in_tuple_up_to_k,dim> + struct Nb_type_in_tuple_up_to_k,dim> { static const int pos= Nb_type_in_tuple_up_to_k - ,dim>::pos - 1; + ,dim>::pos - 1; static const int value = ( pos==k ) ? ( boost::is_same::value ? 0:-dim-1 ) : ( ( pos::value ? 1:0 ) + Nb_type_in_tuple_up_to_k - ,dim >::value) :0 ); }; template - struct Nb_type_in_tuple_up_to_k,dim > + struct Nb_type_in_tuple_up_to_k,dim > { static const int pos=dim; static const int value=(pos==k? @@ -189,23 +187,23 @@ namespace CGAL template struct Nb_type_different_in_tuple_up_to_k,dim> + std::tuple,dim> { static const int pos = Nb_type_different_in_tuple_up_to_k - ,dim >::pos - 1; + ,dim >::pos - 1; static const int value = ( pos==k ) ? ( boost::is_same::value ? -dim-1 : 0 ) : ( ( pos::value ? 0:1 ) + Nb_type_different_in_tuple_up_to_k - ,dim >::value) + ,dim >::value) :0 ); }; template struct Nb_type_different_in_tuple_up_to_k,dim > + std::tuple,dim > { static const int pos=dim; static const int value=(pos==k? @@ -217,38 +215,38 @@ namespace CGAL template