From a7eb7cfe040e57dfda8fc004a00488abd4e1f404 Mon Sep 17 00:00:00 2001 From: Ahmed Essam Date: Thu, 12 Mar 2020 23:14:42 +0200 Subject: [PATCH 1/9] Fix bug in point_position in the brazier traits --- .../include/CGAL/Arr_geometry_traits/Bezier_x_monotone_2.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Bezier_x_monotone_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Bezier_x_monotone_2.h index ae06841ffea..ded1a7cf313 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Bezier_x_monotone_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Bezier_x_monotone_2.h @@ -959,11 +959,12 @@ _Bezier_x_monotone_2::point_position if ( p.is_rational() ){ - const Rational& px = ((Rat_point_2) p).x(); + const Rational px = ((Rat_point_2) p).x(); Integer denom_px=nt_traits.denominator(px); Integer numer_px=nt_traits.numerator(px); - Polynomial poly_px = CGAL::sign(numer_px) == ZERO ? Polynomial() : nt_traits.construct_polynomial(&numer_px,0); + Integer poly_px_scale = numer_px * _curve.x_norm(); + Polynomial poly_px = CGAL::sign(numer_px) == ZERO ? Polynomial() : nt_traits.construct_polynomial(&poly_px_scale,0); Polynomial poly_x = nt_traits.scale(_curve.x_polynomial(),denom_px) - poly_px; std::vector roots; From 905dabc3a2d9f6a9f6a4a4795d14c589adbf28d9 Mon Sep 17 00:00:00 2001 From: Jeff Trull Date: Mon, 6 Apr 2020 13:34:20 -0700 Subject: [PATCH 2/9] Fix reference-to-null-pointer UB Hash compact_container iterators directly from their underlying pointers, rather than taking the address of their dereferenced objects --- STL_Extension/include/CGAL/Compact_container.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/STL_Extension/include/CGAL/Compact_container.h b/STL_Extension/include/CGAL/Compact_container.h index a31df3910b0..121917188ac 100644 --- a/STL_Extension/include/CGAL/Compact_container.h +++ b/STL_Extension/include/CGAL/Compact_container.h @@ -39,6 +39,7 @@ #include #include #include +#include #include @@ -1310,9 +1311,21 @@ namespace internal { std::size_t hash_value(const CC_iterator& i) { typedef Time_stamper_impl Stamper; - return Stamper::hash_value(&*i); + return Stamper::hash_value(i.operator->()); } +namespace handle { + // supply a specialization for Hash_functor + template + struct Hash_functor>{ + std::size_t + operator()(const CC_iterator& i) + { + return hash_value(i); + } + }; +} // namespace handle + } // namespace internal } //namespace CGAL From 8b21a6750812e66a78608cd6b841ecd7673b361a Mon Sep 17 00:00:00 2001 From: Jeff Trull Date: Tue, 7 Apr 2020 13:55:20 -0700 Subject: [PATCH 3/9] Forward declare class template Instead of including a new header --- STL_Extension/include/CGAL/Compact_container.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/STL_Extension/include/CGAL/Compact_container.h b/STL_Extension/include/CGAL/Compact_container.h index 121917188ac..02d21c775ea 100644 --- a/STL_Extension/include/CGAL/Compact_container.h +++ b/STL_Extension/include/CGAL/Compact_container.h @@ -39,7 +39,6 @@ #include #include #include -#include #include @@ -1316,6 +1315,10 @@ namespace internal { namespace handle { // supply a specialization for Hash_functor + + // forward declare base template + template struct Hash_functor; + template struct Hash_functor>{ std::size_t From d3082b114130e8779984788debf56ed99383ad3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Mon, 13 Apr 2020 11:34:02 +0200 Subject: [PATCH 4/9] Three doc should not be built by default in public releases --- Documentation/doc/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/doc/CMakeLists.txt b/Documentation/doc/CMakeLists.txt index 4afa99ec635..df8c81710c4 100644 --- a/Documentation/doc/CMakeLists.txt +++ b/Documentation/doc/CMakeLists.txt @@ -339,6 +339,12 @@ else() endforeach() endif() +option(CGAL_BUILD_THREE_DOC "Build the documentation of the Three package" OFF) + +if (NOT CGAL_BUILD_THREE_DOC) + list(REMOVE_ITEM CGAL_DOC_PACKAGES "Three") +endif() + foreach(package ${CGAL_DOC_PACKAGES}) configure_doxygen_package(${package}) endforeach() From f1a126e1c8e31b46b9c5c368f5183f91c9fb2b85 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Tue, 14 Apr 2020 09:58:14 +0200 Subject: [PATCH 5/9] Switch on for three in travis --- .travis/build_package.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis/build_package.sh b/.travis/build_package.sh index c55fc19b5a9..7fbe3c29aa2 100755 --- a/.travis/build_package.sh +++ b/.travis/build_package.sh @@ -11,7 +11,7 @@ function mytime { function build_examples { mkdir -p build-travis cd build-travis - mytime cmake -DCGAL_DIR="/usr/local/lib/cmake/CGAL" -DCMAKE_CXX_FLAGS="${CXX_FLAGS}" .. + mytime cmake -DCGAL_DIR="/usr/local/lib/cmake/CGAL" -DCMAKE_CXX_FLAGS="${CXX_FLAGS}" -DCGAL_BUILD_THREE_DOC=TRUE .. mytime make -j2 VERBOSE=1 } @@ -96,7 +96,7 @@ cd $ROOT cd $ROOT mkdir build_test cd build_test - mytime cmake -DCMAKE_INSTALL_PREFIX=install/ .. + mytime cmake -DCMAKE_INSTALL_PREFIX=install/ -DCGAL_BUILD_THREE_DOC=TRUE .. mytime make install # test install with minimal downstream example mkdir installtest @@ -110,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 - mytime cmake -DCMAKE_INSTALL_PREFIX=../../install .. + mytime cmake -DCMAKE_INSTALL_PREFIX=../../install -DCGAL_BUILD_THREE_DOC=TRUE .. cd .. exit 0 fi From 6c7cf090c2fa944de14a4125036d9d14d2c2db7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 14 Apr 2020 17:50:32 +0200 Subject: [PATCH 6/9] fix typos --- .../CGAL/Boolean_set_operations_2.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Boolean_set_operations_2.h b/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Boolean_set_operations_2.h index 7e2f9cfb60a..66686d1dbd2 100644 --- a/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Boolean_set_operations_2.h +++ b/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Boolean_set_operations_2.h @@ -75,7 +75,7 @@ The signature of the function is \cgalHeading{Parameters} -The types of the paramters of the `difference()` function are any of the following combinations. +The types of the parameters of the `difference()` function are any of the following combinations.
@@ -194,7 +194,7 @@ The signature of the function is \cgalHeading{Parameters} -The types of the paramters of the `do_intersect()` function are any of the following combinations. +The types of the parameters of the `do_intersect()` function are any of the following combinations.
@@ -324,7 +324,7 @@ The signature of the function is \cgalHeading{Parameters} -The types of the paramters of the `intersection()` function are any of the following combinations. +The types of the parameters of the `intersection()` function are any of the following combinations.
@@ -483,7 +483,7 @@ The signature of the function is \cgalHeading{Parameters} -The types of the paramters of the `join()` function are any of the following combinations. +The types of the parameters of the `join()` function are any of the following combinations.
@@ -637,7 +637,7 @@ The signature of the function is \cgalHeading{Parameters} -The types of the paramters of the `oriented_side()` function are any of the following combinations. +The types of the parameters of the `oriented_side()` function are any of the following combinations.
@@ -723,7 +723,7 @@ The signature of the function is \cgalHeading{Parameters} -The types of the paramters of the `symmetric_difference()` function are any of the following combinations. +The types of the parameters of the `symmetric_difference()` function are any of the following combinations.
From cdcc50de20d1e81a52ca70a27f7bd99f0158133f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 14 Apr 2020 18:07:42 +0200 Subject: [PATCH 7/9] change format to avoid useless link creations --- .../CGAL/Boolean_set_operations_2.h | 42 ++++++++----------- 1 file changed, 17 insertions(+), 25 deletions(-) diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Boolean_set_operations_2.h b/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Boolean_set_operations_2.h index 66686d1dbd2..4f1ed78e348 100644 --- a/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Boolean_set_operations_2.h +++ b/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Boolean_set_operations_2.h @@ -68,10 +68,9 @@ The value type of the `OutputIterator` is either `Polygon_with_holes_2` or `General_polygon_with_holes_2`. -The signature of the function is -\code - OutputIterator difference(const Type1 & p1, const Type2 & p2, OutputIterator oi); -\endcode +The signature of the function is: + - `%OutputIterator %difference(const Type1 & p1, const Type2 & p2, %OutputIterator oi);` + \cgalHeading{Parameters} @@ -187,14 +186,13 @@ namespace CGAL { Each one of these functions computes if the interior of two given polygons `p1` and `p2` intersect. -The signature of the function is -\code - bool do_intersect(const Type1 & p1, const Type2 & p2); -\endcode +The signature of the function is: + - `bool do_intersect(const Type1 & p1, const Type2 & p2);` + \cgalHeading{Parameters} -The types of the parameters of the `do_intersect()` function are any of the following combinations. +The types of the parameters of the \link ref_bso_do_intersect `do_intersect()` \endlink function are any of the following combinations.
@@ -316,10 +314,9 @@ holes into an output container through a given output iterator `General_polygon_with_holes_2`. -The signature of the function is -\code - OutputIterator intersection(const Type1 & p1, const Type2 & p2, OutputIterator oi); -\endcode +The signature of the function is: + - `%OutputIterator %intersection(const Type1 & p1, const Type2 & p2, %OutputIterator oi);` + \cgalHeading{Parameters} @@ -476,10 +473,9 @@ Each one of these functions computes the union of two given polygons returns `false`. -The signature of the function is -\code - bool join(const Type1 & p1, const Type2 & p2, General_polygon_with_holes_2 & res); -\endcode +The signature of the function is: + - `bool join(const Type1 & p1, const Type2 & p2, General_polygon_with_holes_2 & res);` + \cgalHeading{Parameters} @@ -630,10 +626,8 @@ given polygons `p1` and `p2` intersect in their interior, all, and `ON_ORIENTED_BOUNDARY` if `p1` and `p2` intersect only in their boundaries. -The signature of the function is -\code - Oriented_side oriented_side(const Type1 & p1, const Type2 & p2); -\endcode +The signature of the function is: + - `Oriented_side oriented_side(const Type1 & p1, const Type2 & p2);` \cgalHeading{Parameters} @@ -716,10 +710,8 @@ iterator `oi`. The value type of the `OutputIterator` is either `Polygon_with_holes_2` or `General_polygon_with_holes_2`. -The signature of the function is -\code - OutputIterator symmetric_difference(const Type1 & p1, const Type2 & p2, OutputIterator oi); -\endcode +The signature of the function is: + - `%OutputIterator symmetric_difference(const Type1 & p1, const Type2 & p2, %OutputIterator oi);` \cgalHeading{Parameters} From 589eb8c01fc1a32011d2cae4ef0cb44fa2218c83 Mon Sep 17 00:00:00 2001 From: Simon Giraudot Date: Thu, 16 Apr 2020 09:16:52 +0200 Subject: [PATCH 8/9] Fix warnings with float kernel --- Point_set_3/include/CGAL/Point_set_3.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Point_set_3/include/CGAL/Point_set_3.h b/Point_set_3/include/CGAL/Point_set_3.h index 14bc9e0ca44..7285d39c587 100644 --- a/Point_set_3/include/CGAL/Point_set_3.h +++ b/Point_set_3/include/CGAL/Point_set_3.h @@ -330,8 +330,8 @@ public: void clear() { m_base.clear(); - boost::tie (m_indices, boost::tuples::ignore) = this->add_property_map("index", typename Index::size_type(-1)); - boost::tie (m_points, boost::tuples::ignore) = this->add_property_map("point", Point (0., 0., 0.)); + m_indices = this->add_property_map("index", typename Index::size_type(-1)).first; + m_points = this->add_property_map("point", CGAL::ORIGIN).first; m_nb_removed = 0; } @@ -345,12 +345,12 @@ public: { Base other; other.template add("index", typename Index::size_type(-1)); - other.template add("point", Point (0., 0., 0.)); + other.template add("point", CGAL::ORIGIN); other.resize(m_base.size()); other.transfer(m_base); m_base.swap(other); - boost::tie (m_indices, boost::tuples::ignore) = this->property_map("index"); - boost::tie (m_points, boost::tuples::ignore) = this->property_map("point"); + m_indices = this->property_map("index").first; + m_points = this->property_map("point").first; } /*! @@ -799,7 +799,7 @@ public: { Property_map pm; bool added = false; - boost::tie (pm, added) = m_base.template add (name, t); + std::tie (pm, added) = m_base.template add (name, t); return std::make_pair (pm, added); } @@ -820,7 +820,7 @@ public: { Property_map pm; bool okay = false; - boost::tie (pm, okay) = m_base.template get(name); + std::tie (pm, okay) = m_base.template get(name); return std::make_pair (pm, okay); } @@ -861,10 +861,10 @@ public: that is `true` if the property was added and `false` if it already exists (and was therefore not added but only returned). */ - std::pair add_normal_map (const Vector& default_value = Vector(0., 0., 0.)) + std::pair add_normal_map (const Vector& default_value = CGAL::NULL_VECTOR) { bool out = false; - boost::tie (m_normals, out) = this->add_property_map ("normal", default_value); + std::tie (m_normals, out) = this->add_property_map ("normal", default_value); return std::make_pair (m_normals, out); } /*! From 75152e76d2427cfa32525a2a136d8bd84f492e1f Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Thu, 16 Apr 2020 12:06:50 +0200 Subject: [PATCH 9/9] Add switch in dependency script --- Installation/CMakeLists.txt | 2 +- Scripts/developer_scripts/cgal_check_dependencies.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Installation/CMakeLists.txt b/Installation/CMakeLists.txt index 70270d33ee5..13ef48188f8 100644 --- a/Installation/CMakeLists.txt +++ b/Installation/CMakeLists.txt @@ -1183,7 +1183,7 @@ You must disable CGAL_ENABLE_CHECK_HEADERS.") # Build the doc set(DOC_DIR "${CMAKE_BINARY_DIR}/build_doc") file(MAKE_DIRECTORY "${DOC_DIR}") - execute_process(COMMAND "${CMAKE_COMMAND}" -DDOXYGEN_EXECUTABLE=${DOXYGEN_EXECUTABLE} "${CMAKE_SOURCE_DIR}/Documentation/doc" + execute_process(COMMAND "${CMAKE_COMMAND}" -DCGAL_BUILD_THREE_DOC=TRUE -DDOXYGEN_EXECUTABLE=${DOXYGEN_EXECUTABLE} "${CMAKE_SOURCE_DIR}/Documentation/doc" WORKING_DIRECTORY "${DOC_DIR}" ) execute_process(COMMAND "${CMAKE_COMMAND}" --build . --target "doc" diff --git a/Scripts/developer_scripts/cgal_check_dependencies.sh b/Scripts/developer_scripts/cgal_check_dependencies.sh index 65b989a8ca2..43ccc1966b9 100644 --- a/Scripts/developer_scripts/cgal_check_dependencies.sh +++ b/Scripts/developer_scripts/cgal_check_dependencies.sh @@ -30,7 +30,7 @@ do fi done -cmake -DCGAL_HEADER_ONLY=FALSE -DCGAL_ENABLE_CHECK_HEADERS=TRUE -DDOXYGEN_EXECUTABLE="$DOX_PATH" -DCGAL_COPY_DEPENDENCIES=TRUE -DCMAKE_CXX_FLAGS="-std=c++11" .. +cmake -DCGAL_HEADER_ONLY=FALSE -DCGAL_BUILD_THREE_DOC=TRUE -DCGAL_ENABLE_CHECK_HEADERS=TRUE -DDOXYGEN_EXECUTABLE="$DOX_PATH" -DCGAL_COPY_DEPENDENCIES=TRUE -DCMAKE_CXX_FLAGS="-std=c++11" .. if [ -n "$DO_CHECK_HEADERS" ]; then make -j$(nproc --all) -k check_headers fi