diff --git a/.github/workflows/cmake-all.yml b/.github/workflows/cmake-all.yml
index e619a597cf3..5e2faa05026 100644
--- a/.github/workflows/cmake-all.yml
+++ b/.github/workflows/cmake-all.yml
@@ -1,9 +1,9 @@
-name: CMake all CGAL
+name: CMake Testsuite
on: [push, pull_request]
jobs:
- build:
+ cmake-testsuite:
runs-on: ubuntu-latest
@@ -12,4 +12,21 @@ jobs:
- name: install dependencies
run: sudo apt-get install -y libboost-dev libboost-program-options-dev libmpfr-dev libeigen3-dev
- name: configure all
- run: mkdir build && cd build && CXX=clang++ cmake -DWITH_examples=ON -DWITH_tests=ON -DWITH_demos=ON ..
+ run: |
+ set -e
+ mkdir build && cd build && CXX=clang++ cmake -DWITH_examples=ON -DWITH_tests=ON -DWITH_demos=ON -DBUILD_TESTING=ON ..
+ ctest -L CGAL_cmake_testsuite
+
+ cmake-testsuite-with-qt5:
+
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v2.0.0
+ - name: install dependencies
+ run: sudo bash -e .github/install.sh
+ - name: configure all
+ run: |
+ set -e
+ mkdir build && cd build && CXX=clang++ cmake -DWITH_examples=ON -DWITH_tests=ON -DWITH_demos=ON -DBUILD_TESTING=ON ..
+ ctest -L CGAL_cmake_testsuite
diff --git a/.github/workflows/delete_doc.yml b/.github/workflows/delete_doc.yml
index 38dbc242e31..0abf8bb7046 100644
--- a/.github/workflows/delete_doc.yml
+++ b/.github/workflows/delete_doc.yml
@@ -22,11 +22,10 @@ jobs:
if [ -n "$(diff -q ./index.html ./tmp.html)" ]; then
mv tmp.html index.html
fi
- if [ -d ${PR_NUMBER} ]; then
- git rm -r ${PR_NUMBER}
+ if [ -d ${PR_NUMBER} ]; then
+ git rm -r ${PR_NUMBER}
fi
- #git diff exits with 1 if there is no diff
- if git diff --quiet; then
+ # `git diff --quiet` exits with 1 if there is a diff
+ if ! git diff --quiet; then
git commit -a --amend -m"base commit" && git push -f -u origin master
fi
-
diff --git a/AABB_tree/doc/AABB_tree/Concepts/AABBGeomTraits.h b/AABB_tree/doc/AABB_tree/Concepts/AABBGeomTraits.h
index e9a664c2ff8..808f4506c5c 100644
--- a/AABB_tree/doc/AABB_tree/Concepts/AABBGeomTraits.h
+++ b/AABB_tree/doc/AABB_tree/Concepts/AABBGeomTraits.h
@@ -3,13 +3,19 @@
\ingroup PkgAABBTreeConcepts
\cgalConcept
-The concept `AABBGeomTraits` defines the requirements for the first template parameter of the class `CGAL::AABB_traits`. It provides predicates and constructors to detect and compute intersections between query objects and the primitives stored in the AABB tree. In addition, it contains predicates and constructors to compute distances between a point query and the primitives stored in the AABB tree.
+The concept `AABBGeomTraits` defines the requirements for the first template parameter of the class
+`CGAL::AABB_traits`. It provides predicates and constructors to detect
+and compute intersections between query objects and the primitives stored in the AABB tree.
+In addition, it contains predicates and constructors to compute distances between a point query
+and the primitives stored in the AABB tree.
\cgalRefines `SearchGeomTraits_3`
-\cgalHasModel Any 3D Kernel is a model of this traits concept.
+\cgalHasModel All models of the concept `Kernel`
\sa `CGAL::AABB_traits`
+\sa `CGAL::AABB_tree`
+\sa `AABBPrimitive`
*/
@@ -19,118 +25,123 @@ public:
/// \name Types
/// @{
-/*!
-A number type model of `Field`.
-*/
-typedef unspecified_type FT;
-
-/*!
-Sphere type, that should be consistent with the distance function chosen for the distance queries, namely the `Squared_distance_3` functor.
-*/
-typedef unspecified_type Sphere_3;
-
-/*!
-Point type.
-*/
-typedef unspecified_type Point_3;
-
/*!
A functor object to detect intersections between two geometric objects.
-Provides the operators:
-`bool operator()(const Type_1& type_1, const Type_2& type_2);`
-where `Type_1` and `Type_2` are relevant types
-among `Ray_3`, `Segment_3`, `Line_3`, `Triangle_3`, `Plane_3` and `Bbox_3`. Relevant herein means that a line primitive (ray, segment, line) is tested against a planar or solid primitive (plane, triangle, box), and a solid primitive is tested against another solid primitive (box against box). The operator returns `true` iff `type_1` and `type_2` have a non empty intersection.
+Provides the following operators:
+
+`bool operator()(Query, Bbox_3)`,
+
+`bool operator()(Query, Primitive::Datum)`,
+
+`bool operator()(Sphere_3, Bbox_3)`.
+
+The operator returns `true` iff there exists a non-empty intersection.
*/
typedef unspecified_type Do_intersect_3;
/*!
A functor object to construct the intersection between two geometric objects.
-Provides the operators:
-`decltype(auto) operator()(const A& a, const B& b);`
-where `A` and `B` are any relevant types among `Ray_3`, `Segment_3`, `Line_3`,
-`Triangle_3`, `Plane_3` and `Bbox_3`.
-Relevant herein means that a line primitive (ray, segment, line) is tested
-against a planar or solid primitive (plane, triangle, box).
-A model of `Kernel::Intersect_3` fulfills those requirements.
+Provides the operator:
+
+`return_type operator()(const Query& q, const Primitive::Datum& d)`,
+
+which computes the intersection between `q` and `d`. The type of the returned object
+must be a `boost::optional` of a `boost::variant` of the possible intersection types.
*/
typedef unspecified_type Intersect_3;
/*!
-A functor object to construct the sphere centered at one point and passing through another one. Provides the operator:
-- `Sphere_3 operator()(const Point_3& p, const FT & sr)` which returns the sphere centered at `p` with `sr` as squared radius.
+A functor object to construct the sphere centered at one point and passing through another one.
+Provides the operator:
+
+`Sphere_3 operator()(const Point_3& p, const FT & sr)`,
+
+which returns the sphere centered at `p` with `sr` as squared radius.
*/
typedef unspecified_type Construct_sphere_3;
/*!
-A functor object to compute the point on a geometric primitive which is closest from a query. Provides the operator:
-`Point_3 operator()(const Type_2& type_2, const Point_3& p);` where `Type_2` can be any of the following types : `Segment_3`, `Ray_3`, or `Triangle_3`.
-The operator returns the point on `type_2` which is closest to `p`.
+A functor object to compute the point on a geometric primitive which is closest from a query.
+Provides the operator:
+
+`Point_3 operator()(const Primitive::Datum& d, const Point_3& p)`,
+
+which returns the point on `d` that is closest to `p`.
*/
typedef unspecified_type Construct_projected_point_3;
/*!
-A functor object to compare the distance of two points wrt a third one.
-Provides the operator:
-`CGAL::Comparision_result operator()(const Point_3& p1, const Point_3& p2, const Point_3& p3)`. The operator compare the distance between `p1 and `p2`, and between `p2` and `p3`.
+A functor object to compare the distance of two points wrt a third one. Provides the operator:
+
+`CGAL::Comparision_result operator()(const Point_3& p1, const Point_3& p2, const Point_3& p3)`,
+
+which compares the distance between `p1 and `p2`, and between `p2` and `p3`.
*/
typedef unspecified_type Compare_distance_3;
/*!
-A functor object to detect if a point lies inside a sphere or not.
+A functor object to compute the squared radius of a sphere.
Provides the operator:
-`bool operator()(const Sphere_3& s, const Point_3& p);` which returns `true` iff the closed volume bounded by `s` contains `p`.
-*/
-typedef unspecified_type Has_on_bounded_side_3;
-/*!
-A functor object to compute the squared radius of a sphere. Provides the operator:
-`FT operator()(const Sphere_3& s);` which returns the squared radius of `s`.
+`FT operator()(const Sphere_3& s),`
+
+which returns the squared radius of `s`.
*/
typedef unspecified_type Compute_squared_radius_3;
/*!
A functor object to compute the squared distance between two points. Provides the operator:
-`FT operator()(const Point_3& p, const Point_3& q);}` which returns the squared distance between `p` and `q`.
+
+`FT operator()(const Point_3& p, const Point_3& q),`
+
+which returns the squared distance between `p` and `q`.
*/
typedef unspecified_type Compute_squared_distance_3;
/*!
A functor object to compare the x-coordinates of two points. Provides the operator:
-`bool operator()(const Point_3& p, const Point_3& q);}` which returns `true` if the x-coordinate of `p` is smaller
-than the x-coordinate of `q`.
+
+`bool operator()(const Point_3& p, const Point_3& q)`,
+
+ which returns `true` iff the x-coordinate of `p` is smaller than the x-coordinate of `q`.
*/
typedef unspecified_type Less_x_3;
/*!
A functor object to compare the y-coordinates of two points. Provides the operator:
-`bool operator()(const Point_3& p, const Point_3& q);}` which returns `true` if the y-coordinate of `p` is smaller
-than the y-coordinate of `q`.
+
+`bool operator()(const Point_3& p, const Point_3& q)`,
+
+which returns `true` iff the y-coordinate of `p` is smaller than the y-coordinate of `q`.
*/
typedef unspecified_type Less_y_3;
/*!
A functor object to compare the z-coordinates of two points. Provides the operator:
-`bool operator()(const Point_3& p, const Point_3& q);}` which returns `true` if the z-coordinate of `p` is smaller
-than the z-coordinate of `q`.
+
+`bool operator()(const Point_3& p, const Point_3& q)`,
+
+which returns `true` iff the z-coordinate of `p` is smaller than the z-coordinate of `q`.
*/
typedef unspecified_type Less_z_3;
/*!
A functor object to compare two points. Provides the operator:
-`bool operator()(const Point_3& p, const Point_3& q);}` which returns `true` if `p` is equal to `q`.
+
+`bool operator()(const Point_3& p, const Point_3& q)`,
+
+which returns `true` iff `p` is equal to `q`.
*/
typedef unspecified_type Equal_3;
-
-
/// @}
/// \name Operations
/// @{
/*!
-returns the intersection detection functor.
+returns the intersection detection predicate.
*/
Do_intersect_3 do_intersect_3_object();
@@ -150,15 +161,10 @@ returns the closest point constructor.
Construct_projected_point_3 construct_projected_point_3_object();
/*!
-returns the compare distance constructor.
+returns the compare distance predicate.
*/
Compare_distance_3 compare_distance_3_object();
-/*!
-returns the closest point constructor.
-*/
-Has_on_bounded_side_3 has_on_bounded_side_3_object();
-
/*!
returns the squared radius functor.
*/
@@ -170,22 +176,22 @@ returns the squared distance functor.
Compute_squared_distance_3 compute_squared_distance_3_object();
/*!
-returns the `Less_x_3` functor.
+returns the `Less_x_3` predicate.
*/
Less_x_3 less_x_3_object();
/*!
-returns the `Less_y_3` functor.
+returns the `Less_y_3` predicate.
*/
Less_y_3 less_y_3_object();
/*!
-returns the `Less_z_3` functor.
+returns the `Less_z_3` predicate.
*/
Less_z_3 less_z_3_object();
/*!
-returns the equal functor.
+returns the equal predicate.
*/
Equal_3 equal_3_object();
diff --git a/AABB_tree/doc/AABB_tree/Concepts/AABBRayIntersectionGeomTraits.h b/AABB_tree/doc/AABB_tree/Concepts/AABBRayIntersectionGeomTraits.h
index 22ce34118d3..de83a001ec8 100644
--- a/AABB_tree/doc/AABB_tree/Concepts/AABBRayIntersectionGeomTraits.h
+++ b/AABB_tree/doc/AABB_tree/Concepts/AABBRayIntersectionGeomTraits.h
@@ -8,7 +8,8 @@ concept `AABBGeomTraits`. In addition to the types required by
define the Intersection_distance functor.
\cgalRefines `AABBGeomTraits`
-\cgalHasModel Any 3D Kernel is a model of this concept.
+
+\cgalHasModel All models of the concept `Kernel`
\sa `CGAL::AABB_traits`
\sa `CGAL::AABB_tree`
@@ -17,11 +18,6 @@ define the Intersection_distance functor.
*/
class AABBRayIntersectionGeomTraits {
public:
- /*!
- Type of a 3D point.
- */
- typedef unspecified_type Point_3;
-
/*!
Type of a 3D ray.
*/
diff --git a/AABB_tree/doc/AABB_tree/Concepts/AABBRayIntersectionTraits.h b/AABB_tree/doc/AABB_tree/Concepts/AABBRayIntersectionTraits.h
index 2633242ab96..630a569ebfb 100644
--- a/AABB_tree/doc/AABB_tree/Concepts/AABBRayIntersectionTraits.h
+++ b/AABB_tree/doc/AABB_tree/Concepts/AABBRayIntersectionTraits.h
@@ -9,7 +9,6 @@ distance of an intersection along a ray.
\cgalHasModel `CGAL::AABB_traits`
-\sa `CGAL::AABB_traits`
\sa `CGAL::AABB_tree`
\sa `AABBPrimitive`
diff --git a/AABB_tree/doc/AABB_tree/PackageDescription.txt b/AABB_tree/doc/AABB_tree/PackageDescription.txt
index 931f14adb53..d59794e62d5 100644
--- a/AABB_tree/doc/AABB_tree/PackageDescription.txt
+++ b/AABB_tree/doc/AABB_tree/PackageDescription.txt
@@ -25,8 +25,10 @@
\cgalCRPSection{Concepts}
- `AABBPrimitive`
- `AABBPrimitiveWithSharedData`
-- `AABBTraits`
- `AABBGeomTraits`
+- `AABBTraits`
+- `AABBRayIntersectionGeomTraits`
+- `AABBRayIntersectionTraits`
\cgalCRPSection{Classes}
- `CGAL::AABB_traits`
diff --git a/AABB_tree/include/CGAL/AABB_traits.h b/AABB_tree/include/CGAL/AABB_traits.h
index 4afce689bc9..4e83a3ad7c1 100644
--- a/AABB_tree/include/CGAL/AABB_traits.h
+++ b/AABB_tree/include/CGAL/AABB_traits.h
@@ -160,7 +160,7 @@ class AABB_tree;
/// \tparam BboxMap must be a model of `ReadablePropertyMap` that has as key type a primitive id,
/// and as value type a `Bounding_box`.
/// If the type is `Default` the `Datum` must have the
-/// member function `bbox()` that returns the bounding box of the primitive.
+/// member function `bbox()` that returns the bounding box of the primitive.
///
/// If the argument `GeomTraits` is a model of the concept \ref
/// AABBRayIntersectionGeomTraits, this class is also a model of \ref
@@ -366,7 +366,7 @@ public:
template
boost::optional< typename Intersection_and_primitive_id::Type >
operator()(const Query& query, const typename AT::Primitive& primitive) const {
- auto inter_res = GeomTraits().intersect_3_object()(internal::Primitive_helper::get_datum(primitive,m_traits),query);
+ auto inter_res = GeomTraits().intersect_3_object()(query, internal::Primitive_helper::get_datum(primitive,m_traits));
if (!inter_res)
return boost::none;
return boost::make_optional( std::make_pair(*inter_res, primitive.id()) );
@@ -391,9 +391,9 @@ public:
GeomTraits geom_traits;
Point closest_point = geom_traits.construct_projected_point_3_object()(
internal::Primitive_helper::get_datum(pr,m_traits), p);
- return
- geom_traits.compare_distance_3_object()(p, closest_point, bound)==LARGER ?
- bound : closest_point;
+
+ return (geom_traits.compare_distance_3_object()(p, closest_point, bound) == LARGER) ?
+ bound : closest_point;
}
};
@@ -406,15 +406,6 @@ public:
typedef typename AT::FT FT;
typedef typename AT::Primitive Primitive;
public:
- template
- CGAL::Comparison_result operator()(const Point& p, const Solid& pr, const Point& bound) const
- {
- return GeomTraits().do_intersect_3_object()
- (GeomTraits().construct_sphere_3_object()
- (p, GeomTraits().compute_squared_distance_3_object()(p, bound)), pr)?
- CGAL::SMALLER : CGAL::LARGER;
- }
-
CGAL::Comparison_result operator()(const Point& p, const Bounding_box& bb, const Point& bound, Tag_true) const
{
return GeomTraits().do_intersect_3_object()
@@ -436,6 +427,16 @@ public:
return (*this)(p, bb, bound, Boolean_tag::value>());
}
+ // The following functions seem unused...?
+ template
+ CGAL::Comparison_result operator()(const Point& p, const Solid& pr, const Point& bound) const
+ {
+ return GeomTraits().do_intersect_3_object()
+ (GeomTraits().construct_sphere_3_object()
+ (p, GeomTraits().compute_squared_distance_3_object()(p, bound)), pr)?
+ CGAL::SMALLER : CGAL::LARGER;
+ }
+
template
CGAL::Comparison_result operator()(const Point& p, const Solid& pr, const FT& sq_distance) const
{
@@ -445,7 +446,6 @@ public:
CGAL::SMALLER :
CGAL::LARGER;
}
-
};
Closest_point closest_point_object() const {return Closest_point(*this);}
diff --git a/AABB_tree/test/AABB_tree/aabb_test_is_ray_intersection_geomtraits.cpp b/AABB_tree/test/AABB_tree/aabb_test_is_ray_intersection_geomtraits.cpp
index 7552e4ab53d..c7198fe98e0 100644
--- a/AABB_tree/test/AABB_tree/aabb_test_is_ray_intersection_geomtraits.cpp
+++ b/AABB_tree/test/AABB_tree/aabb_test_is_ray_intersection_geomtraits.cpp
@@ -12,14 +12,12 @@ struct AABBGeomTraits {
typedef nope Intersect_3;
typedef nope Construct_sphere_3;
typedef nope Compute_closest_point_3;
- typedef nope Has_on_bounded_side_3;
typedef nope Compute_squared_radius_3;
typedef nope Compute_squared_distance_3;
Do_intersect_3 do_intersect_3_object();
Intersect_3 intersect_3_object();
Construct_sphere_3 construct_sphere_3_object();
Compute_closest_point_3 compute_closest_point_3_object();
- Has_on_bounded_side_3 has_on_bounded_side_3_object();
Compute_squared_radius_3 compute_squared_radius_3_object();
Compute_squared_distance_3 compute_squared_distance_3_object();
}; /* end AABBGeomTraits */
diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_counting_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_counting_traits_2.h
index ab71867c2bc..7aa1fded18f 100644
--- a/Arrangement_on_surface_2/include/CGAL/Arr_counting_traits_2.h
+++ b/Arrangement_on_surface_2/include/CGAL/Arr_counting_traits_2.h
@@ -27,6 +27,7 @@
#include
#include
#include
+#include
#include
#include
@@ -885,11 +886,11 @@ public:
/*! Clean all operation counters */
void clear_counters()
- { memset(m_counters, 0, sizeof(m_counters)); }
+ { m_counters = {}; }
private:
/*! The operation counters */
- mutable size_t m_counters[NUMBER_OF_OPERATIONS];
+ mutable std::array m_counters;
};
template
diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Conic_x_monotone_arc_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Conic_x_monotone_arc_2.h
index b6587f4e1ab..761e38b1693 100644
--- a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Conic_x_monotone_arc_2.h
+++ b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Conic_x_monotone_arc_2.h
@@ -263,7 +263,7 @@ public:
Comparison_result res =
ker.compare_x_2_object()(this->_source, this->_target);
- this->_info = (Conic_arc_2::IS_VALID | DEGREE_1);
+ this->_info = (static_cast(Conic_arc_2::IS_VALID) | static_cast(DEGREE_1));
if (res == EQUAL) {
// Mark that the segment is vertical.
this->_info = (this->_info | IS_VERTICAL_SEGMENT);
diff --git a/Arrangement_on_surface_2/include/CGAL/IO/Fig_stream.h b/Arrangement_on_surface_2/include/CGAL/IO/Fig_stream.h
index 22562cd1663..0a89ec038a3 100644
--- a/Arrangement_on_surface_2/include/CGAL/IO/Fig_stream.h
+++ b/Arrangement_on_surface_2/include/CGAL/IO/Fig_stream.h
@@ -20,6 +20,7 @@
#include
#include
+#include
#include
namespace CGAL {
@@ -750,14 +751,17 @@ public:
return;
// Prepare a string desribing the color.
- char color_desc [10];
- sprintf ("#%02x%02x%02x", r, g, b);
+ std::stringstream out;
+ out << "0x" << std::hex
+ << std::setfill('0') << std::setw(2) << r
+ << std::setfill('0') << std::setw(2) << g
+ << std::setfill('0') << std::setw(2) << b;
// Write the color to the FIG file.
_ofile << "0 " // Desginates a color pseudo-object.
<< static_cast(color) << ' '
- << color_desc << std::endl;
+ << out.str() << std::endl;
// Mark that the color is now defined.
colors[static_cast(color)] = true;
@@ -1700,7 +1704,6 @@ protected:
_ofile << ' ' << ix << ' ' << iy << ' ';
// Write the text.
- char oct[10];
int i;
for (i = 0; i < len_text; i++)
@@ -1712,9 +1715,11 @@ protected:
}
else
{
- // Convert the current character to an octal string and write it.
- sprintf (oct, "\\%03o", text[i]);
- _ofile << oct;
+ // Convert the current character to an octal string and write
+ // it.
+ std::stringstream out;
+ out << "\\" << std::setfill('0') << std::setw(3) << std::oct << text[i];
+ _ofile << out.str();
}
}
diff --git a/BGL/include/CGAL/boost/graph/IO/PLY.h b/BGL/include/CGAL/boost/graph/IO/PLY.h
index 38af496f723..f14ad0173af 100644
--- a/BGL/include/CGAL/boost/graph/IO/PLY.h
+++ b/BGL/include/CGAL/boost/graph/IO/PLY.h
@@ -84,7 +84,7 @@ bool read_PLY_BGL(std::istream& is,
The data is expected to represent a 2-manifold (possibly with borders).
- \attention When reading a binary file, the flag `std::ios::binary` flag must be set during the creation of the `ifstream`.
+ \attention To read a binary file, the flag `std::ios::binary` must be set during the creation of the `ifstream`.
\tparam Graph a model of `MutableFaceGraph`
\tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters"
@@ -266,7 +266,9 @@ bool read_PLY(const std::string& fname, Graph& g,
\brief writes the graph in an output stream, using the \ref IOStreamPLY.
- \attention When writing a binary file, the flag `std::ios::binary` flag must be set during the creation of the `ofstream`.
+ \attention To write to a binary file, the flag `std::ios::binary` must be set during the creation
+ of the `ofstream`, and the \link PkgStreamSupportEnumRef `IO::Mode` \endlink
+ of the stream must be set to `BINARY`.
\tparam Graph a model of `FaceListGraph`
\tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters"
diff --git a/BGL/include/CGAL/boost/graph/IO/STL.h b/BGL/include/CGAL/boost/graph/IO/STL.h
index 11e9ed59ac1..1a1c05e082c 100644
--- a/BGL/include/CGAL/boost/graph/IO/STL.h
+++ b/BGL/include/CGAL/boost/graph/IO/STL.h
@@ -73,7 +73,7 @@ public:
\attention The graph `g` is not cleared, and the data from the stream are appended.
- \attention When reading a binary file, the flag `std::ios::binary` flag must be set during the creation of the `ifstream`.
+ \attention To read a binary file, the flag `std::ios::binary` must be set during the creation of the `ifstream`.
\tparam Graph a model of `MutableFaceGraph`
\tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters"
@@ -208,7 +208,9 @@ bool read_STL(const std::string& fname, Graph& g) { return read_STL(fname, g, pa
\brief writes the graph `g` in the output stream `os`, using the \ref IOStreamSTL.
- \attention When writing a binary file, the flag `std::ios::binary` flag must be set during the creation of the `ofstream`.
+ \attention To write to a binary file, the flag `std::ios::binary` must be set during the creation
+ of the `ofstream`, and the \link PkgStreamSupportEnumRef `IO::Mode` \endlink of the stream
+ must be set to `BINARY`.
\tparam Graph a model of `FaceListGraph` and `HalfedgeListGraph`
\tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters"
diff --git a/BGL/include/CGAL/boost/graph/iterator.h b/BGL/include/CGAL/boost/graph/iterator.h
index c5df2626252..c8af78eaf8b 100644
--- a/BGL/include/CGAL/boost/graph/iterator.h
+++ b/BGL/include/CGAL/boost/graph/iterator.h
@@ -205,7 +205,7 @@ private:
public:
Halfedge_around_source_iterator()
- : anchor(), pos(), g(0)
+ : anchor(), pos(), g(nullptr), winding(0)
{}
Halfedge_around_source_iterator(halfedge_descriptor hd, const Graph& g, int n=0)
@@ -305,7 +305,7 @@ private:
public:
Halfedge_around_target_iterator()
- : anchor(), pos(), g(0)
+ : anchor(), pos(), g(nullptr), winding(0)
{}
Halfedge_around_target_iterator(halfedge_descriptor hd, const Graph& g, int n=0)
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 581cf898979..679d48896f1 100644
--- a/BGL/include/CGAL/boost/graph/split_graph_into_polylines.h
+++ b/BGL/include/CGAL/boost/graph/split_graph_into_polylines.h
@@ -153,7 +153,7 @@ void duplicate_terminal_vertices(Graph& graph,
{
typename boost::graph_traits::vertex_descriptor orig_v = graph[v];
typename boost::graph_traits::degree_size_type deg = degree(v, graph);
- if ((deg != 0 && is_terminal(orig_v, orig)) || deg > 2)
+ if (deg != 2 || is_terminal(orig_v, orig))
{
out_edge_iterator b, e;
boost::tie(b, e) = out_edges(v, graph);
@@ -170,7 +170,6 @@ void duplicate_terminal_vertices(Graph& graph,
const std::pair pair = add_edge(vc, w, graph);
graph[pair.first] = orig_e;
}
- CGAL_assertion(degree(v, graph) == 1);
}
}
diff --git a/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Discrete_harmonic_2.h b/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Discrete_harmonic_2.h
index b6c086dc9c8..c86dd852c03 100644
--- a/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Discrete_harmonic_2.h
+++ b/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Discrete_harmonic_2.h
@@ -32,6 +32,8 @@ namespace CGAL {
// Barycentric coordinates namespace.
namespace Barycentric_coordinates {
+#if !defined(CGAL_NO_DEPRECATED_CODE) || defined(DOXYGEN_RUNNING)
+
// Examples: see the User Manual here - https://doc.cgal.org/latest/Manual/index.html.
// [1] Reference: "M. S. Floater, K. Hormann, and G. Kos. A general construction of barycentric coordinates over convex polygons. Advances in Computational Mathematics, 24(1-4):311-331, 2006.".
@@ -430,6 +432,8 @@ private:
}
};
+#endif // CGAL_NO_DEPRECATED_CODE
+
} // namespace Barycentric_coordinates
} // namespace CGAL
diff --git a/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Generalized_barycentric_coordinates_2.h b/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Generalized_barycentric_coordinates_2.h
index 5faf72b6f98..ef4bfc7f365 100644
--- a/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Generalized_barycentric_coordinates_2.h
+++ b/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Generalized_barycentric_coordinates_2.h
@@ -32,6 +32,8 @@ namespace CGAL {
// Barycentric coordinates namespace.
namespace Barycentric_coordinates {
+#if !defined(CGAL_NO_DEPRECATED_CODE) || defined(DOXYGEN_RUNNING)
+
// Examples: see the User Manual here - https://doc.cgal.org/latest/Manual/index.html.
/*!
@@ -585,6 +587,8 @@ private:
}
};
+#endif // CGAL_NO_DEPRECATED_CODE
+
} // namespace Barycentric_coordinates
} // namespace CGAL
diff --git a/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Mean_value_2.h b/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Mean_value_2.h
index abc0a783139..406d1d6b0bf 100644
--- a/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Mean_value_2.h
+++ b/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Mean_value_2.h
@@ -37,6 +37,8 @@ namespace CGAL {
// Barycentric coordinates namespace.
namespace Barycentric_coordinates {
+#if !defined(CGAL_NO_DEPRECATED_CODE) || defined(DOXYGEN_RUNNING)
+
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Try to find a square root object in the provided `Traits` class. If not, then use the default square root from CGAL.
@@ -498,6 +500,8 @@ private:
}
};
+#endif // CGAL_NO_DEPRECATED_CODE
+
} // namespace Barycentric_coordinates
} // namespace CGAL
diff --git a/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Wachspress_2.h b/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Wachspress_2.h
index 6fecef7ffe7..f4aaa32412c 100644
--- a/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Wachspress_2.h
+++ b/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/Wachspress_2.h
@@ -32,6 +32,8 @@ namespace CGAL {
// Barycentric coordinates namespace.
namespace Barycentric_coordinates {
+#if !defined(CGAL_NO_DEPRECATED_CODE) || defined(DOXYGEN_RUNNING)
+
// Examples: see the User Manual here - https://doc.cgal.org/latest/Manual/index.html.
// [1] Reference: "M. S. Floater, K. Hormann, and G. Kos. A general construction of barycentric coordinates over convex polygons. Advances in Computational Mathematics, 24(1-4):311-331, 2006.".
@@ -413,6 +415,8 @@ private:
}
};
+#endif // CGAL_NO_DEPRECATED_CODE
+
} // namespace Barycentric_coordinates
} // namespace CGAL
diff --git a/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/barycentric_enum_2.h b/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/barycentric_enum_2.h
index 1a0e5480dd3..740d5716beb 100644
--- a/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/barycentric_enum_2.h
+++ b/Barycentric_coordinates_2/include/CGAL/Barycentric_coordinates_2/barycentric_enum_2.h
@@ -73,6 +73,8 @@ enum class Computation_policy_2 {
namespace CGAL {
namespace Barycentric_coordinates {
+#if !defined(CGAL_NO_DEPRECATED_CODE) || defined(DOXYGEN_RUNNING)
+
/// \name Locations of a Query Point
/// @{
@@ -142,6 +144,8 @@ enum Type_of_polygon {
/// \endcond
+#endif // CGAL_NO_DEPRECATED_CODE
+
} // namespace Barycentric_coordinates
} // namespace CGAL
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 60514f58f51..8ef4719853c 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
@@ -172,6 +172,8 @@ namespace Barycentric_coordinates {
namespace CGAL {
namespace Barycentric_coordinates {
+#if !defined(CGAL_NO_DEPRECATED_CODE) || defined(DOXYGEN_RUNNING)
+
/*!
\ingroup PkgBarycentricCoordinates2RefDeprecated
* The class `Segment_coordinates_2` implements barycentric coordinates with respect to an arbitrary non-degenerate segment along an arbitrary line in the plane.
@@ -376,6 +378,8 @@ namespace Barycentric_coordinates {
return CGAL::make_array(b_first, FT(1) - b_first);
}
+#endif // CGAL_NO_DEPRECATED_CODE
+
} // namespace Barycentric_coordinates
} // namespace CGAL
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 ea16596a4ec..8fd076c12d7 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
@@ -182,6 +182,8 @@ namespace Barycentric_coordinates {
namespace CGAL {
namespace Barycentric_coordinates {
+#if !defined(CGAL_NO_DEPRECATED_CODE) || defined(DOXYGEN_RUNNING)
+
/*!
* \ingroup PkgBarycentricCoordinates2RefDeprecated
* The class `Triangle_coordinates_2` implements barycentric coordinates ( [1],
@@ -413,6 +415,8 @@ namespace Barycentric_coordinates {
return CGAL::make_array(b_first, b_second, FT(1) - b_first - b_second);
}
+#endif // CGAL_NO_DEPRECATED_CODE
+
} // namespace Barycentric_coordinates
} // namespace CGAL
diff --git a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_dh_deprecated_api.cpp b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_dh_deprecated_api.cpp
index 221f55a02b6..c19f597f43f 100644
--- a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_dh_deprecated_api.cpp
+++ b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_dh_deprecated_api.cpp
@@ -1,5 +1,3 @@
-#include
-#include
#include
#include
#include
diff --git a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_hm_const_linear_precision.cpp b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_hm_const_linear_precision.cpp
index ed349c1a5c4..e39d545d569 100644
--- a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_hm_const_linear_precision.cpp
+++ b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_hm_const_linear_precision.cpp
@@ -1,7 +1,3 @@
-// #define HMC_SparseLU
-// #define HMC_SimplicialLLT
-// #define HMC_SimplicialLDLT // default
-
#include
#include
#include
diff --git a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_hm_triangle.cpp b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_hm_triangle.cpp
index 5f2ff679f24..73e718ebc69 100644
--- a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_hm_triangle.cpp
+++ b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_hm_triangle.cpp
@@ -1,7 +1,3 @@
-// #define HMC_SparseLU
-// #define HMC_SimplicialLLT
-// #define HMC_SimplicialLDLT // default
-
#include
#include
#include
diff --git a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_hm_unit_square.cpp b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_hm_unit_square.cpp
index 8fa5a2a5e32..4dc8f6853ee 100644
--- a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_hm_unit_square.cpp
+++ b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_hm_unit_square.cpp
@@ -1,7 +1,3 @@
-// #define HMC_SparseLU
-// #define HMC_SimplicialLLT
-// #define HMC_SimplicialLDLT // default
-
#include
#include
#include
diff --git a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_mv_deprecated_api.cpp b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_mv_deprecated_api.cpp
index b41a9720a30..25436a0bd6e 100644
--- a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_mv_deprecated_api.cpp
+++ b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_mv_deprecated_api.cpp
@@ -1,5 +1,3 @@
-#include
-#include
#include
#include
#include
diff --git a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_sc_deprecated_api.cpp b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_sc_deprecated_api.cpp
index 152257cd72d..d0b363c7a7e 100644
--- a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_sc_deprecated_api.cpp
+++ b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_sc_deprecated_api.cpp
@@ -1,5 +1,3 @@
-#include
-#include
#include
#include
#include
diff --git a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_tc_deprecated_api.cpp b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_tc_deprecated_api.cpp
index 68db234168a..e37784a8adb 100644
--- a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_tc_deprecated_api.cpp
+++ b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_tc_deprecated_api.cpp
@@ -1,5 +1,3 @@
-#include
-#include
#include
#include
#include
diff --git a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_wp_deprecated_api.cpp b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_wp_deprecated_api.cpp
index 5dc2f114399..a44bdb5391d 100644
--- a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_wp_deprecated_api.cpp
+++ b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/test_wp_deprecated_api.cpp
@@ -1,5 +1,3 @@
-#include
-#include
#include
#include
#include
diff --git a/CGAL_Core/include/CGAL/CORE/BigFloat_impl.h b/CGAL_Core/include/CGAL/CORE/BigFloat_impl.h
index 93a3e659a1b..3cbd077e487 100644
--- a/CGAL_Core/include/CGAL/CORE/BigFloat_impl.h
+++ b/CGAL_Core/include/CGAL/CORE/BigFloat_impl.h
@@ -39,6 +39,7 @@
#include
+#include
#include
#include
#include
@@ -1057,8 +1058,8 @@ void BigFloatRep :: fromString(const char *str, extLong prec ) {
CGAL_INLINE_FUNCTION
std::istream& BigFloatRep :: operator >>(std::istream& i) {
int size = 20;
- char *str = new char[size];
- char *p = str;
+ std::string str;
+ str.reserve(size);
char c;
int d = 0, e = 0, s = 0;
// d=1 means dot is found
@@ -1078,14 +1079,13 @@ std::istream& BigFloatRep :: operator >>(std::istream& i) {
// Chen Li, "if (c == EOF)" is unsafe since c is of char type and
// EOF is of int tyep with a negative value -1
if (i.eof()) {
- delete [] str;
i.clear(std::ios::eofbit | std::ios::failbit);
return i;
}
// the current content in "c" should be the first non-whitespace char
if (c == '-' || c == '+') {
- *p++ = c;
+ str += c;
i.get(c);
}
@@ -1097,19 +1097,8 @@ std::istream& BigFloatRep :: operator >>(std::istream& i) {
// xxxx.xxxe+xxx.xxx:
if (e && (c == '.'))
break;
- if (p - str == size) {
- char *t = str;
- str = new char[size*2];
- memcpy(str, t, size);
- delete [] t;
- p = str + size;
- size *= 2;
- }
-#ifdef CGAL_CORE_DEBUG
- CGAL_assertion((p-str) < size);
-#endif
- *p++ = c;
+ str += c;
if (c == '.')
d = 1;
// Chen Li: fix a bug -- the sign of exponent can not happen before
@@ -1121,24 +1110,8 @@ std::istream& BigFloatRep :: operator >>(std::istream& i) {
e = 1;
}
- // chenli: make sure that the p is still in the range
- if (p - str >= size) {
- std::size_t len = p - str;
- char *t = str;
- str = new char[len + 1];
- memcpy(str, t, len);
- delete [] t;
- p = str + len;
- }
-
-#ifdef CGAL_CORE_DEBUG
- CGAL_assertion(p - str < size);
-#endif
-
- *p = '\0';
i.putback(c);
- fromString(str);
- delete [] str;
+ fromString(str.c_str());
return i;
}//operator >>
diff --git a/CGAL_Core/include/CGAL/CORE/CoreAux_impl.h b/CGAL_Core/include/CGAL/CORE/CoreAux_impl.h
index 341c83c5819..3a01758911f 100644
--- a/CGAL_Core/include/CGAL/CORE/CoreAux_impl.h
+++ b/CGAL_Core/include/CGAL/CORE/CoreAux_impl.h
@@ -139,27 +139,6 @@ long gcd(long m, long n) {
return p;
}
-// char* core_itoa(int n, char* buffer, int buffer_size)
-// returns a pointer to the null-terminated string in buffer
-// NOTES:
-// 0. Buffer size should be 17 bytes (resp., 33 bytes, 65 bytes) on 16-bit
-// (resp., 32-bit, 64-bit) machines. Formula: 1+sizeof(int)*8 bytes.
-// 1. itoa(...) is available on some stdlib.h, but it is
-// not defined by ANSI-C and so not all compilers support it.
-// 2. Our use of sprintf(...) to do the job is known to
-// be inefficient, but this is hardly critical for our usage.
-// 3. A more general program should take a 3rd argument (the radix of
-// output number). We assume radix 10.
-CGAL_INLINE_FUNCTION
-char * core_itoa(int n, char* buffer, int buffer_size) {
-#if defined(_MSC_VER)
- sprintf_s(buffer, buffer_size, "%d", n);
-#else
- CGAL_USE(buffer_size);
- std::sprintf(buffer, "%d", n);
-#endif
- return buffer;
-}
/// implements the "integer mantissa" function
// (See CORE_PATH/progs/ieee/frexp.cpp for details)
@@ -197,11 +176,8 @@ void core_error(std::string msg, std::string file, int lineno, bool err) {
<< msg << std::endl;
outFile.close();
if (err) {
- char buf[65];
- // perror((std::string("CORE ERROR") + " (file " + file + ", line "
- // + core_itoa(lineno,buf, 65) +"):" + msg + "\n").c_str());
std::cerr << (std::string("CORE ERROR") + " (file " + file + ", line "
- + core_itoa(lineno,buf, 65) +"):" + msg + "\n").c_str();
+ + std::to_string(lineno) +"):" + msg + "\n").c_str();
std::exit(1); //Note: do not call abort()
}
}
diff --git a/CGAL_Core/include/CGAL/CORE/Real_impl.h b/CGAL_Core/include/CGAL/CORE/Real_impl.h
index ee55ed80891..c3a3041720a 100644
--- a/CGAL_Core/include/CGAL/CORE/Real_impl.h
+++ b/CGAL_Core/include/CGAL/CORE/Real_impl.h
@@ -33,6 +33,7 @@
#include
+#include
#include
#include
#include
@@ -189,8 +190,9 @@ void Real::constructFromString(const char *str, const extLong& prec )
CGAL_INLINE_FUNCTION
std::istream& operator >>(std::istream& i, Real& x) {
int size = 20;
- char *str = new char[size];
- char *p = str;
+ std::string str;
+ str.reserve(size);
+
char c;
int d = 0, e = 0, s = 0;
// int done = 0;
@@ -211,13 +213,12 @@ std::istream& operator >>(std::istream& i, Real& x) {
if (i.eof()) {
i.clear(std::ios::eofbit | std::ios::failbit);
- delete [] str;
return i;
}
// the current content in "c" should be the first non-whitespace char
if (c == '-' || c == '+') {
- *p++ = c;
+ str += c;
i.get(c);
}
@@ -230,19 +231,9 @@ std::istream& operator >>(std::istream& i, Real& x) {
// xxxx.xxxe+xxx.xxx:
if (e && (c == '.'))
break;
- if (p - str == size) {
- char *t = str;
- str = new char[size*2];
- std::memcpy(str, t, size);
- delete [] t;
- p = str + size;
- size *= 2;
- }
-#ifdef CORE_DEBUG
- CGAL_assertion((p-str) < size);
-#endif
- *p++ = c;
+ str += c;
+
if (c == '.')
d = 1;
// Chen Li: fix a bug -- the sign of exponent can not happen before
@@ -255,29 +246,13 @@ std::istream& operator >>(std::istream& i, Real& x) {
}
if (!i && !i.eof()) {
- delete [] str;
return i;
}
- // chenli: make sure that the p is still in the range
- if (p - str >= size) {
- std::ptrdiff_t len = p - str;
- char *t = str;
- str = new char[len + 1];
- std::memcpy(str, t, len);
- delete [] t;
- p = str + len;
- }
-#ifdef CORE_DEBUG
- CGAL_assertion(p - str < size);
-#endif
-
- *p = '\0';
i.putback(c);
i.clear();
// old: x = Real(str, i.precision()); // use precision of input stream.
- x = Real(str); // default precision = get_static_defInputDigits()
- delete [] str;
+ x = Real(str.c_str()); // default precision = get_static_defInputDigits()
return i;
}//operator >> (std::istream&, Real&)
diff --git a/Cartesian_kernel/include/CGAL/Cartesian/function_objects.h b/Cartesian_kernel/include/CGAL/Cartesian/function_objects.h
index ce58ca93cc4..e5b2c6f9de5 100644
--- a/Cartesian_kernel/include/CGAL/Cartesian/function_objects.h
+++ b/Cartesian_kernel/include/CGAL/Cartesian/function_objects.h
@@ -3341,8 +3341,17 @@ namespace CartesianKernelFunctors {
typedef typename K::Segment_3 Segment_3;
typedef typename K::Ray_3 Ray_3;
typedef typename K::FT FT;
+
public:
- typedef Point_3 result_type;
+ template
+ struct result {
+ typedef const Point_3 type;
+ };
+
+ template
+ struct result {
+ typedef const Point_3& type;
+ };
Point_3
operator()( const Line_3& l, const Point_3& p ) const
@@ -3369,15 +3378,19 @@ namespace CartesianKernelFunctors {
Point_3
operator()( const Triangle_3& t, const Point_3& p ) const
- { return CommonKernelFunctors::Construct_projected_point_3()(p,t,K()); }
+ { return CommonKernelFunctors::Construct_projected_point_3()(t,p,K()); }
Point_3
operator()( const Segment_3& s, const Point_3& p ) const
- { return CommonKernelFunctors::Construct_projected_point_3()(p,s,K()); }
+ { return CommonKernelFunctors::Construct_projected_point_3()(s,p,K()); }
Point_3
operator()( const Ray_3& r, const Point_3& p ) const
- { return CommonKernelFunctors::Construct_projected_point_3()(p,r,K()); }
+ { return CommonKernelFunctors::Construct_projected_point_3()(r,p,K()); }
+
+ const Point_3&
+ operator()( const Point_3& p, const Point_3& q) const
+ { return CommonKernelFunctors::Construct_projected_point_3()(p,q,K()); }
};
template
diff --git a/Cone_spanners_2/include/CGAL/Cone_spanners_2/Plane_scan_tree_impl.h b/Cone_spanners_2/include/CGAL/Cone_spanners_2/Plane_scan_tree_impl.h
index 411a671f843..b76b5a64208 100644
--- a/Cone_spanners_2/include/CGAL/Cone_spanners_2/Plane_scan_tree_impl.h
+++ b/Cone_spanners_2/include/CGAL/Cone_spanners_2/Plane_scan_tree_impl.h
@@ -20,7 +20,7 @@
#include
-
+#include
#include
namespace CGAL {
@@ -134,9 +134,8 @@ public:
_Leaf (const key_compare& less, const value_compare& vless, tree_type *const t,
_leaf_type *const prev = nullptr,
_leaf_type *const next = nullptr)
- : _node_type (less, vless, t), prev (prev), next (next) {
- std::memset (values, 0, 2*sizeof(value_type*));
- }
+ : _node_type (less, vless, t), values({nullptr,nullptr}), prev (prev), next (next)
+ {}
/* Destructor.
* Frees memory used for storing key-value pair, thus invalidating any
@@ -242,7 +241,7 @@ protected:
private:
/* Key-value pairs */
- value_type* values[2];
+ std::array values;
/* Linked list structure of the B+ tree */
_leaf_type* prev;
@@ -268,11 +267,8 @@ public:
typedef typename _node_type::tree_type tree_type;
_Internal (const Comp& less, const VComp& vless, tree_type *const t)
- : _node_type(less, vless, t) {
- std::memset (keys, 0, 2*sizeof(key_type*));
- std::memset (children, 0, 3*sizeof(_node_type*));
- std::memset (vMin, 0, 3*sizeof(mapped_type*));
- }
+ : _node_type(less, vless, t), keys({nullptr, nullptr}), children({nullptr, nullptr, nullptr}), vMin({nullptr, nullptr, nullptr})
+ {}
virtual ~_Internal() {
keys[0] = nullptr;
@@ -492,9 +488,9 @@ protected:
}
private:
- const key_type* keys[2];
- _node_type* children[3];
- const mapped_type* vMin[3];
+ std::array keys;
+ std::array< _node_type*, 3> children;
+ std::array vMin;
};
template
diff --git a/Convex_decomposition_3/include/CGAL/Convex_decomposition_3/Edge_sorter.h b/Convex_decomposition_3/include/CGAL/Convex_decomposition_3/Edge_sorter.h
index 1516219ce2f..c54f3ab89f5 100644
--- a/Convex_decomposition_3/include/CGAL/Convex_decomposition_3/Edge_sorter.h
+++ b/Convex_decomposition_3/include/CGAL/Convex_decomposition_3/Edge_sorter.h
@@ -212,7 +212,7 @@ template
SNC_point_locator* pl;
public:
- Edge_sorter(Container& cin) : c(cin) {}
+ Edge_sorter(Container& cin) : c(cin), sncp(nullptr), pl(nullptr) {}
void operator()(SNC_and_PL& sncpl) {
sncp = sncpl.sncp;
diff --git a/Convex_decomposition_3/include/CGAL/Convex_decomposition_3/Ray_hit_generator2.h b/Convex_decomposition_3/include/CGAL/Convex_decomposition_3/Ray_hit_generator2.h
index c0e8cdeb858..6fb98e4f858 100644
--- a/Convex_decomposition_3/include/CGAL/Convex_decomposition_3/Ray_hit_generator2.h
+++ b/Convex_decomposition_3/include/CGAL/Convex_decomposition_3/Ray_hit_generator2.h
@@ -69,7 +69,8 @@ class Ray_hit_generator2 : public Modifier_base {
bool vertex_added;
public:
- Ray_hit_generator2(Vector_3 d, Vertex_handle v) : dir(d), vs(v) {}
+ Ray_hit_generator2(Vector_3 d, Vertex_handle v)
+ : dir(d), vs(v), sncp(nullptr), pl(nullptr), edge_splitted(false), vertex_added(false) {}
Vertex_handle create_vertex_on_first_hit(const Ray_3& r) {
diff --git a/Convex_decomposition_3/include/CGAL/Convex_decomposition_3/Single_wall_creator.h b/Convex_decomposition_3/include/CGAL/Convex_decomposition_3/Single_wall_creator.h
index d0e8b498a59..5497f197db8 100644
--- a/Convex_decomposition_3/include/CGAL/Convex_decomposition_3/Single_wall_creator.h
+++ b/Convex_decomposition_3/include/CGAL/Convex_decomposition_3/Single_wall_creator.h
@@ -74,7 +74,7 @@ class Single_wall_creator : public Modifier_base {
public:
Single_wall_creator(SVertex_handle e, Vector_3 d)
- : ein(e), dir(d)
+ : ein(e), dir(d), sncp(nullptr), pl(nullptr)
#ifndef CGAL_NEF_NO_INDEXED_ITEMS
, index1(0), index2(0)
#endif
diff --git a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h
index 02d557a8a44..3bf83132a3a 100644
--- a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h
+++ b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h
@@ -160,11 +160,11 @@ public:
&arrays[SMOOTH_NORMAL_COLORED_FACES])
{
// Define 'Control+Q' as the new exit shortcut (default was 'Escape')
- setShortcut(qglviewer::EXIT_VIEWER, ::Qt::CTRL+::Qt::Key_Q);
+ setShortcut(qglviewer::EXIT_VIEWER, ::Qt::CTRL, ::Qt::Key_Q);
// Add custom key description (see keyPressEvent).
setKeyDescription(::Qt::Key_C, "Switch clipping plane display mode");
- setKeyDescription(::Qt::Key_C+::Qt::AltModifier, "Toggle clipping plane rendering on/off");
+ setKeyDescription(::Qt::AltModifier, ::Qt::Key_C, "Toggle clipping plane rendering on/off");
setKeyDescription(::Qt::Key_E, "Toggles edges display");
setKeyDescription(::Qt::Key_M, "Toggles mono color");
setKeyDescription(::Qt::Key_N, "Inverse direction of normals");
@@ -175,8 +175,8 @@ public:
setKeyDescription(::Qt::Key_W, "Toggles faces display");
setKeyDescription(::Qt::Key_Plus, "Increase size of edges");
setKeyDescription(::Qt::Key_Minus, "Decrease size of edges");
- setKeyDescription(::Qt::Key_Plus+::Qt::ControlModifier, "Increase size of vertices");
- setKeyDescription(::Qt::Key_Minus+::Qt::ControlModifier, "Decrease size of vertices");
+ setKeyDescription(::Qt::ControlModifier, ::Qt::Key_Plus, "Increase size of vertices");
+ setKeyDescription(::Qt::ControlModifier, ::Qt::Key_Minus, "Decrease size of vertices");
setKeyDescription(::Qt::Key_PageDown, "Increase light (all colors, use shift/alt/ctrl for one rgb component)");
setKeyDescription(::Qt::Key_PageUp, "Decrease light (all colors, use shift/alt/ctrl for one rgb component)");
setKeyDescription(::Qt::Key_O, "Toggles 2D mode only");
diff --git a/GraphicsView/include/CGAL/Qt/qglviewer.h b/GraphicsView/include/CGAL/Qt/qglviewer.h
index 1c11c9e4a52..da0dbace517 100644
--- a/GraphicsView/include/CGAL/Qt/qglviewer.h
+++ b/GraphicsView/include/CGAL/Qt/qglviewer.h
@@ -833,8 +833,26 @@ public:
public Q_SLOTS:
void setShortcut(qglviewer::KeyboardAction action, unsigned int key);
+ void setShortcut(qglviewer::KeyboardAction action, ::Qt::Modifier modifier, ::Qt::Key key)
+ {
+ setShortcut(action,
+ static_cast(modifier)+
+ static_cast(key));
+ }
void setKeyDescription(unsigned int key, QString description);
+ void setKeyDescription(::Qt::KeyboardModifier modifier, ::Qt::Key key, QString description)
+ {
+ setKeyDescription(static_cast(modifier) +
+ static_cast(key),
+ description);
+ }
+ void setKeyDescription(::Qt::Modifier modifier, ::Qt::Key key, QString description)
+ {
+ setKeyDescription(static_cast(modifier) +
+ static_cast(key),
+ description);
+ }
void clearShortcuts();
// Key Frames shortcut keys
diff --git a/GraphicsView/include/CGAL/Qt/qglviewer_impl.h b/GraphicsView/include/CGAL/Qt/qglviewer_impl.h
index 7aa487408c3..70fdfdd9a15 100644
--- a/GraphicsView/include/CGAL/Qt/qglviewer_impl.h
+++ b/GraphicsView/include/CGAL/Qt/qglviewer_impl.h
@@ -657,10 +657,10 @@ void CGAL::QGLViewer::setDefaultShortcuts() {
setShortcut(qglviewer::DRAW_AXIS, ::Qt::Key_A);
setShortcut(qglviewer::DRAW_GRID, ::Qt::Key_G);
setShortcut(qglviewer::DISPLAY_FPS, ::Qt::Key_F);
- setShortcut(qglviewer::ENABLE_TEXT, ::Qt::SHIFT + ::Qt::Key_Question);
+ setShortcut(qglviewer::ENABLE_TEXT, ::Qt::SHIFT, ::Qt::Key_Question);
setShortcut(qglviewer::EXIT_VIEWER, ::Qt::Key_Escape);
setShortcut(qglviewer::CAMERA_MODE, ::Qt::Key_Space);
- setShortcut(qglviewer::FULL_SCREEN, ::Qt::ALT + ::Qt::Key_Return);
+ setShortcut(qglviewer::FULL_SCREEN, ::Qt::ALT, ::Qt::Key_Return);
setShortcut(qglviewer::ANIMATION, ::Qt::Key_Return);
setShortcut(qglviewer::HELP, ::Qt::Key_H);
setShortcut(qglviewer::MOVE_CAMERA_LEFT, ::Qt::Key_Left);
diff --git a/Heat_method_3/doc/Heat_method_3/Concepts/HeatMethodTraits_3.h b/Heat_method_3/doc/Heat_method_3/Concepts/HeatMethodTraits_3.h
index f33440e95cf..dcfe6d573e0 100644
--- a/Heat_method_3/doc/Heat_method_3/Concepts/HeatMethodTraits_3.h
+++ b/Heat_method_3/doc/Heat_method_3/Concepts/HeatMethodTraits_3.h
@@ -49,6 +49,8 @@ public:
/// Functor with operator: `FT operator()(const Point_3& p, const Point_3& q) const` which computes the squared distance between `p` and `q`.
typedef unspecified_type Compute_squared_distance_3;
+ /// Functor with operator: `FT operator()(const Vector_3& v) const` which computes the squared length of `v`.
+ typedef unspecified_type Compute_squared_length_3;
/// @}
diff --git a/Heat_method_3/include/CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h b/Heat_method_3/include/CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h
index 96f7846baa6..d8592b1346f 100644
--- a/Heat_method_3/include/CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h
+++ b/Heat_method_3/include/CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h
@@ -29,6 +29,7 @@
#include
#endif
+#include
#include
#include
@@ -361,7 +362,6 @@ private:
void
compute_divergence()
{
- typename Traits::Construct_cross_product_vector_3 cross_product = Traits().construct_cross_product_vector_3_object();
typename Traits::Compute_scalar_product_3 scalar_product = Traits().compute_scalar_product_3_object();
typename Traits::Construct_vector_3 construct_vector = Traits().construct_vector_3_object();
Matrix indexD(dimension,1);
@@ -374,36 +374,30 @@ private:
Index i = get(vertex_id_map, current);
Index j = get(vertex_id_map, neighbor_one);
Index k = get(vertex_id_map, neighbor_two);
- VertexPointMap_reference p_i = get(vpm,current);
+ VertexPointMap_reference p_i = get(vpm, current);
VertexPointMap_reference p_j = get(vpm, neighbor_one);
VertexPointMap_reference p_k = get(vpm, neighbor_two);
Index face_i = get(face_id_map, f);
- Vector_3 v_ij = construct_vector(p_i,p_j);
- Vector_3 v_ik = construct_vector(p_i,p_k);
- Vector_3 cross = cross_product(v_ij, v_ik);
- double norm_cross = CGAL::sqrt(to_double(scalar_product(cross,cross)));
- double dot = to_double(scalar_product(v_ij, v_ik));
- double cotan_i = dot/norm_cross;
+ const Vector_3 v_ij = construct_vector(p_i, p_j);
+ const Vector_3 v_ik = construct_vector(p_i, p_k);
+ const Vector_3 v_ji = construct_vector(p_j, p_i);
+ const Vector_3 v_jk = construct_vector(p_j, p_k);
+ const Vector_3 v_ki = construct_vector(p_k, p_i);
+ const Vector_3 v_kj = construct_vector(p_k, p_j);
- Vector_3 v_ji = construct_vector(p_j, p_i);
- Vector_3 v_jk = construct_vector(p_j, p_k);
+ const Traits traits;
+ const FT cotan_i = CGAL::Weights::cotangent(p_k, p_i, p_j, traits);
+ const FT cotan_j = CGAL::Weights::cotangent(p_k, p_j, p_i, traits);
+ const FT cotan_k = CGAL::Weights::cotangent(p_j, p_k, p_i, traits);
- cross = cross_product(v_ji, v_jk);
- dot = to_double(scalar_product(v_ji, v_jk));
- double cotan_j = dot/norm_cross;
-
- Vector_3 v_ki = construct_vector(p_k,p_i);
- Vector_3 v_kj = construct_vector(p_k,p_j);
-
- cross = cross_product(v_ki, v_kj);
- dot = to_double(scalar_product(v_ki,v_kj));
- double cotan_k = dot/norm_cross;
-
- const Vector_3& a = m_X[face_i];
- double i_entry = (to_double(scalar_product(a,v_ij)) * cotan_k) + (to_double(scalar_product(a,v_ik)) * cotan_j);
- double j_entry = (to_double(scalar_product(a,v_jk)) * cotan_i) + (to_double(scalar_product(a,v_ji)) * cotan_k);
- double k_entry = (to_double(scalar_product(a,v_ki)) * cotan_j) + (to_double(scalar_product(a,v_kj)) * cotan_i);
+ const Vector_3& a = m_X[face_i];
+ const double i_entry = (CGAL::to_double(scalar_product(a, v_ij) * cotan_k)) +
+ (CGAL::to_double(scalar_product(a, v_ik) * cotan_j));
+ const double j_entry = (CGAL::to_double(scalar_product(a, v_jk) * cotan_i)) +
+ (CGAL::to_double(scalar_product(a, v_ji) * cotan_k));
+ const double k_entry = (CGAL::to_double(scalar_product(a, v_ki) * cotan_j)) +
+ (CGAL::to_double(scalar_product(a, v_kj) * cotan_i));
indexD.add_coef(i, 0, (1./2)*i_entry);
indexD.add_coef(j, 0, (1./2)*j_entry);
@@ -549,47 +543,40 @@ private:
Index k = get(vertex_id_map, neighbor_two);
Point_3 pi, pj, pk;
- VertexPointMap_reference p_i = get(vpm,current);
+ const Traits traits;
+ VertexPointMap_reference p_i = get(vpm, current);
VertexPointMap_reference p_j = get(vpm, neighbor_one);
VertexPointMap_reference p_k = get(vpm, neighbor_two);
pi = p_i;
pj = p_j;
pk = p_k;
- Vector_3 v_ij = construct_vector(p_i,p_j);
- Vector_3 v_ik = construct_vector(p_i,p_k);
+ const double cotan_i = CGAL::to_double(
+ CGAL::Weights::cotangent(pk, pi, pj, traits));
+ m_cotan_matrix.add_coef(j, k, -(1./2) * cotan_i);
+ m_cotan_matrix.add_coef(k, j, -(1./2) * cotan_i);
+ m_cotan_matrix.add_coef(j, j, (1./2) * cotan_i);
+ m_cotan_matrix.add_coef(k, k, (1./2) * cotan_i);
- Vector_3 cross = cross_product(v_ij, v_ik);
- double dot = to_double(scalar_product(v_ij,v_ik));
+ const double cotan_j = CGAL::to_double(
+ CGAL::Weights::cotangent(pk, pj, pi, traits));
+ m_cotan_matrix.add_coef(i, k, -(1./2) * cotan_j);
+ m_cotan_matrix.add_coef(k, i, -(1./2) * cotan_j);
+ m_cotan_matrix.add_coef(i, i, (1./2) * cotan_j);
+ m_cotan_matrix.add_coef(k, k, (1./2) * cotan_j);
- double norm_cross = (CGAL::sqrt(to_double(scalar_product(cross,cross))));
+ const double cotan_k = CGAL::to_double(
+ CGAL::Weights::cotangent(pj, pk, pi, traits));
+ m_cotan_matrix.add_coef(i, j, -(1./2) * cotan_k);
+ m_cotan_matrix.add_coef(j, i, -(1./2) * cotan_k);
+ m_cotan_matrix.add_coef(i, i, (1./2) * cotan_k);
+ m_cotan_matrix.add_coef(j, j, (1./2) * cotan_k);
- double cotan_i = dot/norm_cross;
- m_cotan_matrix.add_coef(j,k ,-(1./2)*cotan_i);
- m_cotan_matrix.add_coef(k,j,-(1./2)* cotan_i);
- m_cotan_matrix.add_coef(j,j,(1./2)*cotan_i);
- m_cotan_matrix.add_coef(k,k,(1./2)* cotan_i);
-
- Vector_3 v_ji = construct_vector(p_j,p_i);
- Vector_3 v_jk = construct_vector(p_j,p_k);
-
- cross = cross_product(v_ji, v_jk);
- dot = to_double(scalar_product(v_ji, v_jk));
- double cotan_j = dot/norm_cross;
- m_cotan_matrix.add_coef(i,k ,-(1./2)*cotan_j);
- m_cotan_matrix.add_coef(k,i,-(1./2)* cotan_j);
- m_cotan_matrix.add_coef(i,i,(1./2)* cotan_j);
- m_cotan_matrix.add_coef(k,k,(1./2)* cotan_j);
-
- Vector_3 v_ki = construct_vector(p_k,p_i);
- Vector_3 v_kj = construct_vector(p_k,p_j);
- cross = cross_product(v_ki, v_kj);
- dot = to_double(scalar_product(v_ki,v_kj));
- double cotan_k = dot/norm_cross;
- m_cotan_matrix.add_coef(i,j,-(1./2)*cotan_k);
- m_cotan_matrix.add_coef(j,i,-(1./2)* cotan_k);
- m_cotan_matrix.add_coef(i,i,(1./2)* cotan_k);
- m_cotan_matrix.add_coef(j,j,(1./2)* cotan_k);
+ const Vector_3 v_ij = construct_vector(p_i, p_j);
+ const Vector_3 v_ik = construct_vector(p_i, p_k);
+ const Vector_3 cross = cross_product(v_ij, v_ik);
+ const double norm_cross = CGAL::sqrt(
+ CGAL::to_double(scalar_product(cross, cross)));
//double area_face = CGAL::Polygon_mesh_processing::face_area(f,tm);
//cross is 2*area
diff --git a/Heat_method_3/package_info/Heat_method_3/dependencies b/Heat_method_3/package_info/Heat_method_3/dependencies
index 90510db1ab2..50488d5544f 100644
--- a/Heat_method_3/package_info/Heat_method_3/dependencies
+++ b/Heat_method_3/package_info/Heat_method_3/dependencies
@@ -18,3 +18,4 @@ Random_numbers
STL_Extension
Solver_interface
Stream_support
+Weights
diff --git a/Heat_method_3/test/Heat_method_3/Heat_method_traits_3.h b/Heat_method_3/test/Heat_method_3/Heat_method_traits_3.h
index b64613c641b..8b8e28c76f4 100644
--- a/Heat_method_3/test/Heat_method_3/Heat_method_traits_3.h
+++ b/Heat_method_3/test/Heat_method_3/Heat_method_traits_3.h
@@ -59,6 +59,11 @@ struct Heat_method_traits_3
{ return 0;}
};
+ struct Compute_squared_length_3 {
+
+ double operator()(const Vector_3&) const
+ { return 0;}
+ };
Construct_vector_3 construct_vector_3_object() const
{
@@ -79,6 +84,11 @@ struct Heat_method_traits_3
return Compute_squared_distance_3();
}
+ Compute_squared_length_3 compute_squared_length_3_object() const
+ {
+ return Compute_squared_length_3();
+ }
+
Compute_scalar_product_3 compute_scalar_product_3_object() const
{
return Compute_scalar_product_3();
diff --git a/Homogeneous_kernel/include/CGAL/Homogeneous/SphereH3.h b/Homogeneous_kernel/include/CGAL/Homogeneous/SphereH3.h
index 2515212200a..a00ec51b275 100644
--- a/Homogeneous_kernel/include/CGAL/Homogeneous/SphereH3.h
+++ b/Homogeneous_kernel/include/CGAL/Homogeneous/SphereH3.h
@@ -198,7 +198,7 @@ template
CGAL_KERNEL_MEDIUM_INLINE
Oriented_side
SphereH3::oriented_side(const typename SphereH3::Point_3& p) const
-{ return Oriented_side(bounded_side(p) * orientation()); }
+{ return Oriented_side(static_cast(bounded_side(p)) * static_cast(orientation())); }
template
CGAL_KERNEL_INLINE
diff --git a/Homogeneous_kernel/include/CGAL/Homogeneous/function_objects.h b/Homogeneous_kernel/include/CGAL/Homogeneous/function_objects.h
index 8091a640d18..833d09e413d 100644
--- a/Homogeneous_kernel/include/CGAL/Homogeneous/function_objects.h
+++ b/Homogeneous_kernel/include/CGAL/Homogeneous/function_objects.h
@@ -3398,8 +3398,17 @@ namespace HomogeneousKernelFunctors {
typedef typename K::Triangle_3 Triangle_3;
typedef typename K::Segment_3 Segment_3;
typedef typename K::Ray_3 Ray_3;
+
public:
- typedef Point_3 result_type;
+ template
+ struct result {
+ typedef const Point_3 type;
+ };
+
+ template
+ struct result {
+ typedef const Point_3& type;
+ };
Point_3
operator()( const Line_3& l, const Point_3& p ) const
@@ -3429,15 +3438,19 @@ namespace HomogeneousKernelFunctors {
Point_3
operator()( const Triangle_3& t, const Point_3& p ) const
- { return CommonKernelFunctors::Construct_projected_point_3()(p,t,K()); }
+ { return CommonKernelFunctors::Construct_projected_point_3()(t,p,K()); }
Point_3
operator()( const Segment_3& s, const Point_3& p ) const
- { return CommonKernelFunctors::Construct_projected_point_3()(p,s,K()); }
+ { return CommonKernelFunctors::Construct_projected_point_3()(s,p,K()); }
Point_3
operator()( const Ray_3& r, const Point_3& p ) const
- { return CommonKernelFunctors::Construct_projected_point_3()(p,r,K()); }
+ { return CommonKernelFunctors::Construct_projected_point_3()(r,p,K()); }
+
+ const Point_3&
+ operator()( const Point_3& p, const Point_3& q) const
+ { return CommonKernelFunctors::Construct_projected_point_3()(p,q,K()); }
};
template
@@ -4675,7 +4688,7 @@ namespace HomogeneousKernelFunctors {
result_type
operator()( const Circle_2& c, const Point_2& p) const
- { return Oriented_side(c.bounded_side(p) * c.orientation()); }
+ { return Oriented_side(static_cast(c.bounded_side(p)) * static_cast(c.orientation())); }
result_type
operator()( const Line_2& l, const Point_2& p) const
diff --git a/Installation/CHANGES.md b/Installation/CHANGES.md
index 27dc295dcf1..9ca67be1cc9 100644
--- a/Installation/CHANGES.md
+++ b/Installation/CHANGES.md
@@ -37,7 +37,7 @@ Release date: December 2021
### [2D and 3D Linear Geometry Kernel](https://doc.cgal.org/5.4/Manual/packages.html#PkgKernel23)
- Added `construct_centroid_2_object()` and `compute_determinant_2_object()` in `Projection_traits_xy_3`, `Projection_traits_xz_3`,
- and`Projection_traits_yz_3` classes.
+ and `Projection_traits_yz_3` classes.
- Added documentation for the class `Projection_traits_3`, which enables the use of 2D algorithms on the projections of 3D data onto an arbitrary plane.
@@ -62,6 +62,10 @@ Release date: December 2021
- Added an option to [`CGAL::Polygon_mesh_processing::self_intersections()`](https://doc.cgal.org/5.4/Polygon_mesh_processing/group__PMP__intersection__grp.html#gaf19c80ec12cbff7ebe9e69453f1d40b8) to report only a limited number of intersections (`maximum_number()`)
+### [The Heat Method](https://doc.cgal.org/5.4/Manual/packages.html#PkgHeatMethod)
+
+- **Breaking change**: Added the functor `Compute_squared_length_3` that has an operator `operator(const Vector_3& v)`, which computes the squared length of `v`, to the `HeatMethodTraits_3` concept.
+
### [Shape Regularization](https://doc.cgal.org/5.4/Manual/packages.html#PkgShapeRegularization) (new package)
- This package enables to regularize a set of segments and open or closed contours in 2D
diff --git a/Installation/CMakeLists.txt b/Installation/CMakeLists.txt
index 43d3cbadc95..e050c6b9c2b 100644
--- a/Installation/CMakeLists.txt
+++ b/Installation/CMakeLists.txt
@@ -653,6 +653,10 @@ cache_get(CGAL_3RD_PARTY_LIBRARIES )
cache_get(CGAL_3RD_PARTY_LIBRARIES_DIRS)
install(DIRECTORY "${CGAL_GRAPHICSVIEW_PACKAGE_DIR}/include/CGAL/Qt/" DESTINATION "${CGAL_INSTALL_INC_DIR}/CGAL/Qt" COMPONENT CGAL_Qt5)
+if(CGAL_BRANCH_BUILD)
+ install(DIRECTORY "${CGAL_GRAPHICSVIEW_PACKAGE_DIR}/demo/resources/" DESTINATION "${CGAL_INSTALL_CMAKE_DIR}/demo/resources" COMPONENT CGAL_Qt5)
+ install(DIRECTORY "${CGAL_GRAPHICSVIEW_PACKAGE_DIR}/demo/icons/" DESTINATION "${CGAL_INSTALL_CMAKE_DIR}/demo/icons" COMPONENT CGAL_Qt5)
+endif()
#
# Variables used when WITH_{demos|examples|tests} are TRUE
diff --git a/Installation/cmake/modules/CGAL_pointmatcher_support.cmake b/Installation/cmake/modules/CGAL_pointmatcher_support.cmake
index 7323feae702..ab55c3b86f9 100644
--- a/Installation/cmake/modules/CGAL_pointmatcher_support.cmake
+++ b/Installation/cmake/modules/CGAL_pointmatcher_support.cmake
@@ -9,7 +9,7 @@ if(libpointmatcher_FOUND AND NOT TARGET CGAL::pointmatcher_support)
add_library(CGAL::pointmatcher_support INTERFACE IMPORTED)
target_compile_definitions(CGAL::pointmatcher_support INTERFACE "CGAL_LINKED_WITH_POINTMATCHER")
target_include_directories(CGAL::pointmatcher_support INTERFACE "${libpointmatcher_INCLUDE_DIR}")
- target_link_libraries(CGAL::pointmatcher_support INTERFACE "${libpointmatcher_LIBRARIES}")
+ target_link_libraries(CGAL::pointmatcher_support INTERFACE ${libpointmatcher_LIBRARIES})
else()
message(STATUS "NOTICE : the libpointmatcher library requires the following boost components: thread filesystem system program_options date_time chrono.")
endif()
diff --git a/Intersections_2/include/CGAL/Intersections_2/Iso_rectangle_2_Line_2.h b/Intersections_2/include/CGAL/Intersections_2/Iso_rectangle_2_Line_2.h
index 3315328d876..a8d188a7a42 100644
--- a/Intersections_2/include/CGAL/Intersections_2/Iso_rectangle_2_Line_2.h
+++ b/Intersections_2/include/CGAL/Intersections_2/Iso_rectangle_2_Line_2.h
@@ -36,11 +36,10 @@ namespace internal {
template
class Line_2_Iso_rectangle_2_pair {
public:
- enum Intersection_results {NO_INTERSECTION, POINT, SEGMENT};
+ enum Intersection_results {NO_INTERSECTION, POINT, SEGMENT, UNKNOWN};
Line_2_Iso_rectangle_2_pair(typename K::Line_2 const *line,
typename K::Iso_rectangle_2 const *iso)
- : _known(false),
- _ref_point(line->point()),
+ : _ref_point(line->point()),
_dir(line->direction().to_vector()),
_isomin((iso->min)()),
_isomax((iso->max)()) {}
@@ -50,8 +49,7 @@ public:
typename K::Point_2 intersection_point() const;
typename K::Segment_2 intersection_segment() const;
protected:
- mutable bool _known;
- mutable Intersection_results _result;
+ mutable Intersection_results _result = UNKNOWN;
mutable typename K::FT _min, _max;
typename K::Point_2 _ref_point;
typename K::Vector_2 _dir;
@@ -84,10 +82,9 @@ typename Line_2_Iso_rectangle_2_pair::Intersection_results
Line_2_Iso_rectangle_2_pair::intersection_type() const
{
//typedef typename K::Line_2 line_t;
- if (_known)
+ if (_result!=UNKNOWN)
return _result;
// The non const this pointer is used to cast away const.
- _known = true;
typedef typename K::FT FT;
typedef typename K::RT RT;
bool all_values = true;
@@ -156,7 +153,7 @@ intersection_point() const
typename K::Construct_translated_point_2 translated_point;
typename K::Construct_scaled_vector_2 construct_scaled_vector;
- if (!_known)
+ if (_result==UNKNOWN)
intersection_type();
CGAL_kernel_assertion(_result == POINT);
return translated_point(_ref_point, construct_scaled_vector(_dir, _min));
@@ -170,7 +167,7 @@ intersection_segment() const
typename K::Construct_segment_2 construct_segment_2;
typename K::Construct_translated_point_2 translated_point;
typename K::Construct_scaled_vector_2 construct_scaled_vector;
- if (!_known)
+ if (_result==UNKNOWN)
intersection_type();
CGAL_kernel_assertion(_result == SEGMENT);
return construct_segment_2(translated_point(_ref_point, construct_scaled_vector(_dir,_min)),
diff --git a/Intersections_2/include/CGAL/Intersections_2/Iso_rectangle_2_Ray_2.h b/Intersections_2/include/CGAL/Intersections_2/Iso_rectangle_2_Ray_2.h
index 8f4136e0843..5f2b52a311a 100644
--- a/Intersections_2/include/CGAL/Intersections_2/Iso_rectangle_2_Ray_2.h
+++ b/Intersections_2/include/CGAL/Intersections_2/Iso_rectangle_2_Ray_2.h
@@ -35,10 +35,10 @@ namespace internal {
template
class Ray_2_Iso_rectangle_2_pair {
public:
- enum Intersection_results {NO_INTERSECTION, POINT, SEGMENT};
+ enum Intersection_results {NO_INTERSECTION, POINT, SEGMENT, UNKNOWN};
Ray_2_Iso_rectangle_2_pair(typename K::Ray_2 const *ray,
typename K::Iso_rectangle_2 const *iso)
- : _known(false), _ref_point(ray->source()), _dir(ray->direction().to_vector()),
+ : _ref_point(ray->source()), _dir(ray->direction().to_vector()),
_isomin((iso->min)()), _isomax((iso->max)()), _min((typename K::FT)(0)) {}
Intersection_results intersection_type() const;
@@ -46,8 +46,7 @@ public:
typename K::Point_2 intersection_point() const;
typename K::Segment_2 intersection_segment() const;
protected:
- mutable bool _known;
- mutable Intersection_results _result;
+ mutable Intersection_results _result = UNKNOWN;
mutable typename K::Point_2 _ref_point;
mutable typename K::Vector_2 _dir;
mutable typename K::Point_2 _isomin;
@@ -109,9 +108,8 @@ Ray_2_Iso_rectangle_2_pair::intersection_type() const
{
typedef typename K::RT RT;
typedef typename K::FT FT;
- if (_known)
+ if (_result!=UNKNOWN)
return _result;
- _known = true;
bool to_infinity = true;
typename K::Construct_cartesian_const_iterator_2 construct_cccit;
@@ -175,7 +173,7 @@ Ray_2_Iso_rectangle_2_pair::intersection_segment() const
typedef typename K::Segment_2 Segment_2;
typename K::Construct_translated_point_2 translated_point;
typename K::Construct_scaled_vector_2 construct_scaled_vector;
- if (!_known)
+ if (_result==UNKNOWN)
intersection_type();
CGAL_kernel_assertion(_result == SEGMENT);
typename K::Point_2 p1(translated_point(_ref_point, construct_scaled_vector(_dir,_min)));
@@ -190,7 +188,7 @@ Ray_2_Iso_rectangle_2_pair::intersection_point() const
typedef typename K::Point_2 Point_2;
typename K::Construct_translated_point_2 translated_point;
typename K::Construct_scaled_vector_2 construct_scaled_vector;
- if (!_known)
+ if (_result==UNKNOWN)
intersection_type();
CGAL_kernel_assertion(_result == POINT);
return Point_2(translated_point(_ref_point, construct_scaled_vector(_dir, _min)));
diff --git a/Intersections_2/include/CGAL/Intersections_2/Iso_rectangle_2_Segment_2.h b/Intersections_2/include/CGAL/Intersections_2/Iso_rectangle_2_Segment_2.h
index 3b82ffd42a3..28121109d10 100644
--- a/Intersections_2/include/CGAL/Intersections_2/Iso_rectangle_2_Segment_2.h
+++ b/Intersections_2/include/CGAL/Intersections_2/Iso_rectangle_2_Segment_2.h
@@ -36,7 +36,7 @@ namespace internal {
template
class Segment_2_Iso_rectangle_2_pair {
public:
- enum Intersection_results {NO_INTERSECTION, POINT, SEGMENT};
+ enum Intersection_results {NO_INTERSECTION, POINT, SEGMENT, UNKNOWN};
Segment_2_Iso_rectangle_2_pair(typename K::Segment_2 const *seg,
typename K::Iso_rectangle_2 const *rect) ;
@@ -45,8 +45,7 @@ public:
typename K::Point_2 intersection_point() const;
typename K::Segment_2 intersection_segment() const;
protected:
- mutable bool _known;
- mutable Intersection_results _result;
+ mutable Intersection_results _result = UNKNOWN;
mutable typename K::Point_2 _ref_point;
mutable typename K::Vector_2 _dir;
mutable typename K::Point_2 _isomin;
@@ -108,7 +107,6 @@ Segment_2_Iso_rectangle_2_pair(
typename K::Segment_2 const *seg,
typename K::Iso_rectangle_2 const *iso)
{
- _known = false;
_isomin = (iso->min)();
_isomax = (iso->max)();
_ref_point = seg->source();
@@ -130,9 +128,8 @@ Segment_2_Iso_rectangle_2_pair::intersection_type() const
{
typedef typename K::RT RT;
typedef typename K::FT FT;
- if (_known)
+ if (_result!=UNKNOWN)
return _result;
- _known = true;
typename K::Construct_cartesian_const_iterator_2 construct_cccit;
typename K::Cartesian_const_iterator_2 ref_point_it = construct_cccit(_ref_point);
@@ -190,7 +187,7 @@ intersection_segment() const
typedef typename K::Segment_2 Segment_2;
typename K::Construct_translated_point_2 translated_point;
typename K::Construct_scaled_vector_2 construct_scaled_vector;
- if (!_known)
+ if (_result==UNKNOWN)
intersection_type();
CGAL_kernel_assertion(_result == SEGMENT);
typename K::Point_2 p1(translated_point(_ref_point, construct_scaled_vector(_dir,_min)));
@@ -205,7 +202,7 @@ intersection_point() const
{
typename K::Construct_translated_point_2 translated_point;
typename K::Construct_scaled_vector_2 construct_scaled_vector;
- if (!_known)
+ if (_result==UNKNOWN)
intersection_type();
CGAL_kernel_assertion(_result == POINT);
return translated_point(_ref_point, construct_scaled_vector(_dir,_min));
diff --git a/Intersections_2/include/CGAL/Intersections_2/Line_2_Line_2.h b/Intersections_2/include/CGAL/Intersections_2/Line_2_Line_2.h
index d95ddec8f2a..8d2d3e6ae0d 100644
--- a/Intersections_2/include/CGAL/Intersections_2/Line_2_Line_2.h
+++ b/Intersections_2/include/CGAL/Intersections_2/Line_2_Line_2.h
@@ -36,10 +36,10 @@ namespace internal {
template
class Line_2_Line_2_pair {
public:
- enum Intersection_results {NOT_COMPUTED_YET, NO_INTERSECTION, POINT, LINE};
+ enum Intersection_results {NO_INTERSECTION, POINT, LINE, UNKNOWN};
Line_2_Line_2_pair(typename K::Line_2 const *line1,
typename K::Line_2 const *line2)
- : _line1(line1), _line2(line2), _result(NOT_COMPUTED_YET) {}
+ : _line1(line1), _line2(line2) {}
Intersection_results intersection_type() const;
@@ -48,7 +48,7 @@ public:
protected:
typename K::Line_2 const* _line1;
typename K::Line_2 const * _line2;
- mutable Intersection_results _result;
+ mutable Intersection_results _result = UNKNOWN;
mutable typename K::Point_2 _intersection_point;
};
@@ -140,7 +140,7 @@ typename Line_2_Line_2_pair::Intersection_results
Line_2_Line_2_pair::intersection_type() const
{
typedef typename K::RT RT;
- if (_result != NOT_COMPUTED_YET)
+ if (_result != UNKNOWN)
return _result;
RT nom1, nom2, denom;
// The non const this pointer is used to cast away const.
@@ -178,7 +178,7 @@ template
typename K::Point_2
Line_2_Line_2_pair::intersection_point() const
{
- if (_result == NOT_COMPUTED_YET)
+ if (_result == UNKNOWN)
intersection_type();
CGAL_kernel_assertion(_result == POINT);
return _intersection_point;
@@ -188,7 +188,7 @@ template
typename K::Line_2
Line_2_Line_2_pair::intersection_line() const
{
- if (_result == NOT_COMPUTED_YET)
+ if (_result == UNKNOWN)
intersection_type();
CGAL_kernel_assertion(_result == LINE);
return *_line1;
diff --git a/Intersections_2/include/CGAL/Intersections_2/Line_2_Ray_2.h b/Intersections_2/include/CGAL/Intersections_2/Line_2_Ray_2.h
index eada9a07ec2..87f59d8a45a 100644
--- a/Intersections_2/include/CGAL/Intersections_2/Line_2_Ray_2.h
+++ b/Intersections_2/include/CGAL/Intersections_2/Line_2_Ray_2.h
@@ -35,11 +35,11 @@ namespace internal {
template
class Ray_2_Line_2_pair {
public:
- enum Intersection_results {NOT_COMPUTED_YET, NO_INTERSECTION, POINT, RAY};
+ enum Intersection_results {NO_INTERSECTION, POINT, RAY, UNKNOWN};
typedef typename K::FT FT;
Ray_2_Line_2_pair(typename K::Ray_2 const *ray,
typename K::Line_2 const *line)
- : _ray(ray), _line(line), _result(NOT_COMPUTED_YET),
+ : _ray(ray), _line(line),
_intersection_point(K().construct_point_2_object()(ORIGIN))
{}
@@ -50,7 +50,7 @@ public:
protected:
typename K::Ray_2 const * _ray;
typename K::Line_2 const * _line;
- mutable Intersection_results _result;
+ mutable Intersection_results _result = UNKNOWN;
mutable typename K::Point_2 _intersection_point;
};
@@ -117,7 +117,7 @@ template
typename Ray_2_Line_2_pair::Intersection_results
Ray_2_Line_2_pair::intersection_type() const
{
- if (_result != NOT_COMPUTED_YET)
+ if (_result != UNKNOWN)
return _result;
// The non const this pointer is used to cast away const.
const typename K::Line_2 &l1 = _ray->supporting_line();
@@ -144,7 +144,7 @@ template
typename K::Point_2
Ray_2_Line_2_pair::intersection_point() const
{
- if (_result == NOT_COMPUTED_YET)
+ if (_result == UNKNOWN)
intersection_type();
CGAL_kernel_assertion(_result == POINT);
return _intersection_point;
@@ -154,7 +154,7 @@ template
typename K::Ray_2
Ray_2_Line_2_pair::intersection_ray() const
{
- if (_result == NOT_COMPUTED_YET)
+ if (_result == UNKNOWN)
intersection_type();
CGAL_kernel_assertion(_result == RAY);
return *_ray;
diff --git a/Intersections_2/include/CGAL/Intersections_2/Line_2_Segment_2.h b/Intersections_2/include/CGAL/Intersections_2/Line_2_Segment_2.h
index 17d60e41a07..0c5d881b544 100644
--- a/Intersections_2/include/CGAL/Intersections_2/Line_2_Segment_2.h
+++ b/Intersections_2/include/CGAL/Intersections_2/Line_2_Segment_2.h
@@ -34,10 +34,10 @@ namespace internal {
template
class Segment_2_Line_2_pair {
public:
- enum Intersection_results {NO_INTERSECTION, POINT, SEGMENT};
+ enum Intersection_results {NO_INTERSECTION, POINT, SEGMENT, UNKNOWN};
Segment_2_Line_2_pair(typename K::Segment_2 const *seg,
typename K::Line_2 const *line)
- : _seg(seg), _line(line), _known(false) {}
+ : _seg(seg), _line(line) {}
Intersection_results intersection_type() const;
@@ -46,8 +46,7 @@ public:
protected:
typename K::Segment_2 const*_seg;
typename K::Line_2 const * _line;
- mutable bool _known;
- mutable Intersection_results _result;
+ mutable Intersection_results _result = UNKNOWN;
mutable typename K::Point_2 _intersection_point;
};
@@ -108,10 +107,9 @@ template
typename Segment_2_Line_2_pair::Intersection_results
Segment_2_Line_2_pair::intersection_type() const
{
- if (_known)
+ if (_result!=UNKNOWN)
return _result;
// The non const this pointer is used to cast away const.
- _known = true;
const typename K::Line_2 &l1 = _seg->supporting_line();
Line_2_Line_2_pair linepair(&l1, _line);
switch ( linepair.intersection_type()) {
@@ -136,7 +134,7 @@ template
typename K::Point_2
Segment_2_Line_2_pair::intersection_point() const
{
- if (!_known)
+ if (_result==UNKNOWN)
intersection_type();
CGAL_kernel_assertion(_result == POINT);
return _intersection_point;
@@ -146,7 +144,7 @@ template
typename K::Segment_2
Segment_2_Line_2_pair::intersection_segment() const
{
- if (!_known)
+ if (_result==UNKNOWN)
intersection_type();
CGAL_kernel_assertion(_result == SEGMENT);
return *_seg;
diff --git a/Intersections_2/include/CGAL/Intersections_2/Line_2_Triangle_2.h b/Intersections_2/include/CGAL/Intersections_2/Line_2_Triangle_2.h
index 7dc337bade3..9f514030f8a 100644
--- a/Intersections_2/include/CGAL/Intersections_2/Line_2_Triangle_2.h
+++ b/Intersections_2/include/CGAL/Intersections_2/Line_2_Triangle_2.h
@@ -36,10 +36,10 @@ namespace internal {
template
class Line_2_Triangle_2_pair {
public:
- enum Intersection_results {NO_INTERSECTION, POINT, SEGMENT};
+ enum Intersection_results {NO_INTERSECTION, POINT, SEGMENT, UNKNOWN};
Line_2_Triangle_2_pair(typename K::Line_2 const *line,
typename K::Triangle_2 const *trian)
- : _line(line), _trian(trian), _known(false) {}
+ : _line(line), _trian(trian) {}
Intersection_results intersection_type() const;
@@ -48,8 +48,7 @@ public:
protected:
typename K::Line_2 const*_line;
typename K::Triangle_2 const * _trian;
- mutable bool _known;
- mutable Intersection_results _result;
+ mutable Intersection_results _result = UNKNOWN;
mutable typename K::Point_2 _intersection_point;
mutable typename K::Point_2 _other_point;
};
@@ -81,10 +80,9 @@ typename Line_2_Triangle_2_pair::Intersection_results
Line_2_Triangle_2_pair::intersection_type() const
{
typedef typename K::Line_2 Line_2;
- if (_known)
+ if (_result!=UNKNOWN)
return _result;
// The non const this pointer is used to cast away const.
- _known = true;
Straight_2_ straight(*_line);
Line_2 l(_trian->vertex(0), _trian->vertex(1));
if (l.oriented_side(_trian->vertex(2)) == ON_POSITIVE_SIDE) {
@@ -133,7 +131,7 @@ typename K::Point_2
Line_2_Triangle_2_pair::
intersection_point() const
{
- if (!_known)
+ if (_result==UNKNOWN)
intersection_type();
CGAL_kernel_assertion(_result == POINT);
return _intersection_point;
@@ -145,7 +143,7 @@ Line_2_Triangle_2_pair::
intersection_segment() const
{
typedef typename K::Segment_2 Segment_2;
- if (!_known)
+ if (_result==UNKNOWN)
intersection_type();
CGAL_kernel_assertion(_result == SEGMENT);
return Segment_2(_intersection_point, _other_point);
diff --git a/Intersections_2/include/CGAL/Intersections_2/Point_2_Triangle_2.h b/Intersections_2/include/CGAL/Intersections_2/Point_2_Triangle_2.h
index 74f8db8c01a..ba496198cd9 100644
--- a/Intersections_2/include/CGAL/Intersections_2/Point_2_Triangle_2.h
+++ b/Intersections_2/include/CGAL/Intersections_2/Point_2_Triangle_2.h
@@ -33,10 +33,10 @@ namespace internal {
template
class Point_2_Triangle_2_pair {
public:
- enum Intersection_results {NO_INTERSECTION, POINT};
+ enum Intersection_results {NO_INTERSECTION, POINT, UNKNOWN};
Point_2_Triangle_2_pair(typename K::Point_2 const *pt,
typename K::Triangle_2 const *trian)
- : _pt(pt), _trian(trian), _known(false) {}
+ : _pt(pt), _trian(trian) {}
Intersection_results intersection_type() const;
@@ -44,8 +44,7 @@ public:
protected:
typename K::Point_2 const * _pt;
typename K::Triangle_2 const * _trian;
- mutable bool _known;
- mutable Intersection_results _result;
+ mutable Intersection_results _result = UNKNOWN;
mutable typename K::Point_2 _intersection_point;
mutable typename K::Point_2 _other_point;
};
@@ -73,10 +72,9 @@ template
typename Point_2_Triangle_2_pair::Intersection_results
Point_2_Triangle_2_pair::intersection_type() const
{
- if (_known)
+ if (_result!=UNKNOWN)
return _result;
// The non const this pointer is used to cast away const.
- _known = true;
if (_trian->has_on_unbounded_side(*_pt)) {
_result = NO_INTERSECTION;
} else {
@@ -92,7 +90,7 @@ typename K::Point_2
Point_2_Triangle_2_pair::
intersection_point() const
{
- if (!_known)
+ if (_result==UNKNOWN)
intersection_type();
CGAL_kernel_assertion(_result == POINT);
return *_pt;
diff --git a/Intersections_2/include/CGAL/Intersections_2/Ray_2_Ray_2.h b/Intersections_2/include/CGAL/Intersections_2/Ray_2_Ray_2.h
index a59f4ba4443..2b0c166797b 100644
--- a/Intersections_2/include/CGAL/Intersections_2/Ray_2_Ray_2.h
+++ b/Intersections_2/include/CGAL/Intersections_2/Ray_2_Ray_2.h
@@ -36,10 +36,10 @@ namespace internal {
template
class Ray_2_Ray_2_pair {
public:
- enum Intersection_results {NO_INTERSECTION, POINT, SEGMENT, RAY};
+ enum Intersection_results {NO_INTERSECTION, POINT, SEGMENT, RAY, UNKNOWN};
Ray_2_Ray_2_pair(typename K::Ray_2 const *ray1,
typename K::Ray_2 const *ray2)
- : _ray1(ray1), _ray2(ray2), _known(false) {}
+ : _ray1(ray1), _ray2(ray2) {}
Intersection_results intersection_type() const;
@@ -49,8 +49,7 @@ public:
protected:
typename K::Ray_2 const* _ray1;
typename K::Ray_2 const * _ray2;
- mutable bool _known;
- mutable Intersection_results _result;
+ mutable Intersection_results _result = UNKNOWN;
mutable typename K::Point_2 _intersection_point, _other_point;
};
@@ -71,10 +70,9 @@ template
typename Ray_2_Ray_2_pair::Intersection_results
Ray_2_Ray_2_pair::intersection_type() const
{
- if (_known)
+ if (_result!=UNKNOWN)
return _result;
// The non const this pointer is used to cast away const.
- _known = true;
// if (!do_overlap(_ray1->bbox(), _ray2->bbox()))
// return NO_INTERSECTION;
const typename K::Line_2 &l1 = _ray1->supporting_line();
@@ -196,7 +194,7 @@ template
typename K::Point_2
Ray_2_Ray_2_pair::intersection_point() const
{
- if (!_known)
+ if (_result==UNKNOWN)
intersection_type();
CGAL_kernel_assertion(_result == POINT);
return _intersection_point;
@@ -207,7 +205,7 @@ typename K::Segment_2
Ray_2_Ray_2_pair::intersection_segment() const
{
typedef typename K::Segment_2 Segment_2;
- if (!_known)
+ if (_result==UNKNOWN)
intersection_type();
CGAL_kernel_assertion(_result == SEGMENT);
return Segment_2(_ray1->source(), _ray2->source());
@@ -218,7 +216,7 @@ typename K::Ray_2
Ray_2_Ray_2_pair::intersection_ray() const
{
typedef typename K::Ray_2 Ray_2;
- if (!_known)
+ if (_result==UNKNOWN)
intersection_type();
CGAL_kernel_assertion(_result == RAY);
return Ray_2(_intersection_point, _ray1->direction());
diff --git a/Intersections_2/include/CGAL/Intersections_2/Ray_2_Segment_2.h b/Intersections_2/include/CGAL/Intersections_2/Ray_2_Segment_2.h
index 579938c97fc..2cdebe84a13 100644
--- a/Intersections_2/include/CGAL/Intersections_2/Ray_2_Segment_2.h
+++ b/Intersections_2/include/CGAL/Intersections_2/Ray_2_Segment_2.h
@@ -37,10 +37,10 @@ namespace internal {
template
class Ray_2_Segment_2_pair {
public:
- enum Intersection_results {NO_INTERSECTION, POINT, SEGMENT};
+ enum Intersection_results {NO_INTERSECTION, POINT, SEGMENT, UNKNOWN};
Ray_2_Segment_2_pair(typename K::Ray_2 const *ray,
typename K::Segment_2 const *seg)
- : _ray(ray), _seg(seg), _known(false) {}
+ : _ray(ray), _seg(seg) {}
Intersection_results intersection_type() const;
@@ -49,8 +49,7 @@ public:
protected:
typename K::Ray_2 const * _ray;
typename K::Segment_2 const * _seg;
- mutable bool _known;
- mutable Intersection_results _result;
+ mutable Intersection_results _result = UNKNOWN;
mutable typename K::Point_2 _intersection_point, _other_point;
};
@@ -76,10 +75,9 @@ template
typename Ray_2_Segment_2_pair::Intersection_results
Ray_2_Segment_2_pair::intersection_type() const
{
- if (_known)
+ if (_result!=UNKNOWN)
return _result;
// The non const this pointer is used to cast away const.
- _known = true;
// if (!do_overlap(_ray->bbox(), _seg->bbox()))
// return NO_INTERSECTION;
const typename K::Line_2 &l1 = _ray->supporting_line();
@@ -211,7 +209,7 @@ template
typename K::Point_2
Ray_2_Segment_2_pair::intersection_point() const
{
- if (!_known)
+ if (_result==UNKNOWN)
intersection_type();
CGAL_kernel_assertion(_result == POINT);
return _intersection_point;
@@ -222,7 +220,7 @@ typename K::Segment_2
Ray_2_Segment_2_pair::intersection_segment() const
{
typedef typename K::Segment_2 Segment_2;
- if (!_known)
+ if (_result==UNKNOWN)
intersection_type();
CGAL_kernel_assertion(_result == SEGMENT);
return Segment_2(_intersection_point, _other_point);
diff --git a/Intersections_2/include/CGAL/Intersections_2/Ray_2_Triangle_2.h b/Intersections_2/include/CGAL/Intersections_2/Ray_2_Triangle_2.h
index 8384f917299..6db56586c55 100644
--- a/Intersections_2/include/CGAL/Intersections_2/Ray_2_Triangle_2.h
+++ b/Intersections_2/include/CGAL/Intersections_2/Ray_2_Triangle_2.h
@@ -34,10 +34,10 @@ namespace internal {
template
class Ray_2_Triangle_2_pair {
public:
- enum Intersection_results {NO_INTERSECTION, POINT, SEGMENT};
+ enum Intersection_results {NO_INTERSECTION, POINT, SEGMENT, UNKNOWN};
Ray_2_Triangle_2_pair(typename K::Ray_2 const *ray,
typename K::Triangle_2 const *trian)
- : _ray(ray), _trian(trian), _known(false) {}
+ : _ray(ray), _trian(trian) {}
Intersection_results intersection_type() const;
@@ -46,8 +46,7 @@ public:
protected:
typename K::Ray_2 const* _ray;
typename K::Triangle_2 const * _trian;
- mutable bool _known;
- mutable Intersection_results _result;
+ mutable Intersection_results _result = UNKNOWN;
mutable typename K::Point_2 _intersection_point;
mutable typename K::Point_2 _other_point;
};
@@ -59,10 +58,9 @@ typename Ray_2_Triangle_2_pair::Intersection_results
Ray_2_Triangle_2_pair::intersection_type() const
{
typedef typename K::Line_2 Line_2;
- if (_known)
+ if (_result!=UNKNOWN)
return _result;
// The non const this pointer is used to cast away const.
- _known = true;
Straight_2_ straight(*_ray);
Line_2 l(_trian->vertex(0), _trian->vertex(1));
if (l.oriented_side(_trian->vertex(2)) == ON_POSITIVE_SIDE) {
@@ -111,7 +109,7 @@ typename K::Point_2
Ray_2_Triangle_2_pair::
intersection_point() const
{
- if (!_known)
+ if (_result==UNKNOWN)
intersection_type();
CGAL_kernel_assertion(_result == POINT);
return _intersection_point;
@@ -123,7 +121,7 @@ Ray_2_Triangle_2_pair::
intersection_segment() const
{
typedef typename K::Segment_2 Segment_2;
- if (!_known)
+ if (_result==UNKNOWN)
intersection_type();
CGAL_kernel_assertion(_result == SEGMENT);
return Segment_2(_intersection_point, _other_point);
diff --git a/Intersections_2/include/CGAL/Intersections_2/Segment_2_Segment_2.h b/Intersections_2/include/CGAL/Intersections_2/Segment_2_Segment_2.h
index ba3d8b9567c..3b9e7003a40 100644
--- a/Intersections_2/include/CGAL/Intersections_2/Segment_2_Segment_2.h
+++ b/Intersections_2/include/CGAL/Intersections_2/Segment_2_Segment_2.h
@@ -274,10 +274,10 @@ do_intersect(const typename K::Segment_2 &seg1,
template
class Segment_2_Segment_2_pair {
public:
- enum Intersection_results {NO_INTERSECTION, POINT, SEGMENT};
+ enum Intersection_results {NO_INTERSECTION, POINT, SEGMENT, UNKNOWN};
Segment_2_Segment_2_pair(typename K::Segment_2 const *seg1,
typename K::Segment_2 const *seg2)
- : _seg1(seg1), _seg2(seg2), _known(false) {}
+ : _seg1(seg1), _seg2(seg2) {}
Intersection_results intersection_type() const;
@@ -286,8 +286,7 @@ public:
protected:
typename K::Segment_2 const* _seg1;
typename K::Segment_2 const * _seg2;
- mutable bool _known;
- mutable Intersection_results _result;
+ mutable Intersection_results _result = UNKNOWN;
mutable typename K::Point_2 _intersection_point, _other_point;
};
@@ -296,9 +295,8 @@ typename Segment_2_Segment_2_pair::Intersection_results
Segment_2_Segment_2_pair::intersection_type() const
{
typename K::Construct_vector_2 construct_vector;
- if (_known)
+ if (_result!=UNKNOWN)
return _result;
- _known = true;
if (!internal::do_intersect(*_seg1, *_seg2, K())) {
_result = NO_INTERSECTION;
return _result;
@@ -408,7 +406,7 @@ template
typename K::Point_2
Segment_2_Segment_2_pair::intersection_point() const
{
- if (!_known)
+ if (_result==UNKNOWN)
intersection_type();
CGAL_kernel_assertion(_result == POINT);
return _intersection_point;
@@ -419,7 +417,7 @@ typename K::Segment_2
Segment_2_Segment_2_pair::intersection_segment() const
{
typedef typename K::Segment_2 Segment_2;
- if (!_known)
+ if (_result==UNKNOWN)
intersection_type();
CGAL_kernel_assertion(_result == SEGMENT);
return Segment_2(_intersection_point, _other_point);
diff --git a/Intersections_2/include/CGAL/Intersections_2/Segment_2_Triangle_2.h b/Intersections_2/include/CGAL/Intersections_2/Segment_2_Triangle_2.h
index f048c2bd35f..4d2b93c05cf 100644
--- a/Intersections_2/include/CGAL/Intersections_2/Segment_2_Triangle_2.h
+++ b/Intersections_2/include/CGAL/Intersections_2/Segment_2_Triangle_2.h
@@ -34,10 +34,10 @@ namespace internal {
template
class Segment_2_Triangle_2_pair {
public:
- enum Intersection_results {NO_INTERSECTION, POINT, SEGMENT};
+ enum Intersection_results {NO_INTERSECTION, POINT, SEGMENT, UNKNOWN};
Segment_2_Triangle_2_pair(typename K::Segment_2 const *seg,
typename K::Triangle_2 const *trian)
- : _seg(seg), _trian(trian), _known(false) {}
+ : _seg(seg), _trian(trian) {}
Intersection_results intersection_type() const;
@@ -46,8 +46,7 @@ public:
protected:
typename K::Segment_2 const * _seg;
typename K::Triangle_2 const * _trian;
- mutable bool _known;
- mutable Intersection_results _result;
+ mutable Intersection_results _result = UNKNOWN;
mutable typename K::Point_2 _intersection_point;
mutable typename K::Point_2 _other_point;
};
@@ -71,10 +70,9 @@ template
typename Segment_2_Triangle_2_pair::Intersection_results
Segment_2_Triangle_2_pair::intersection_type() const
{
- if (_known)
+ if (_result!=UNKNOWN)
return _result;
// The non const this pointer is used to cast away const.
- _known = true;
Straight_2_ straight(*_seg);
typedef typename K::Line_2 Line_2;
@@ -124,7 +122,7 @@ typename K::Point_2
Segment_2_Triangle_2_pair::
intersection_point() const
{
- if (!_known)
+ if (_result==UNKNOWN)
intersection_type();
CGAL_kernel_assertion(_result == POINT);
return _intersection_point;
@@ -136,7 +134,7 @@ Segment_2_Triangle_2_pair::
intersection_segment() const
{
typedef typename K::Segment_2 Segment_2;
- if (!_known)
+ if (_result==UNKNOWN)
intersection_type();
CGAL_kernel_assertion(_result == SEGMENT);
return Segment_2(_intersection_point, _other_point);
diff --git a/Intersections_2/include/CGAL/Intersections_2/internal/Triangle_2_Triangle_2_intersection_impl.h b/Intersections_2/include/CGAL/Intersections_2/internal/Triangle_2_Triangle_2_intersection_impl.h
index 3a22168af8e..d752d7c87e9 100644
--- a/Intersections_2/include/CGAL/Intersections_2/internal/Triangle_2_Triangle_2_intersection_impl.h
+++ b/Intersections_2/include/CGAL/Intersections_2/internal/Triangle_2_Triangle_2_intersection_impl.h
@@ -154,10 +154,10 @@ void _cut_off(Pointlist_2_ &list,
template
class Triangle_2_Triangle_2_pair {
public:
- enum Intersection_results {NO_INTERSECTION, POINT, SEGMENT, TRIANGLE, POLYGON};
+ enum Intersection_results {NO_INTERSECTION, POINT, SEGMENT, TRIANGLE, POLYGON, UNKNOWN};
Triangle_2_Triangle_2_pair(typename K::Triangle_2 const *trian1,
typename K::Triangle_2 const *trian2)
- : _trian1(trian1), _trian2(trian2), _known(false) {}
+ : _trian1(trian1), _trian2(trian2) {}
Intersection_results intersection_type() const;
@@ -170,8 +170,7 @@ public:
protected:
typename K::Triangle_2 const* _trian1;
typename K::Triangle_2 const * _trian2;
- mutable bool _known;
- mutable Intersection_results _result;
+ mutable Intersection_results _result = UNKNOWN;
mutable Pointlist_2_ _pointlist;
};
@@ -180,10 +179,9 @@ typename Triangle_2_Triangle_2_pair::Intersection_results
Triangle_2_Triangle_2_pair::intersection_type() const
{
typedef typename K::Line_2 Line_2;
- if (_known)
+ if (_result!=UNKNOWN)
return _result;
// The non const this pointer is used to cast away const.
- _known = true;
if (!do_overlap(_trian1->bbox(), _trian2->bbox())) {
_result = NO_INTERSECTION;
return _result;
@@ -235,7 +233,7 @@ bool
Triangle_2_Triangle_2_pair::intersection(
/* Polygon_2 &result */) const
{
- if (!_known)
+ if (_result==UNKNOWN)
intersection_type();
if (_result != TRIANGLE && _result != POLYGON)
return false;
@@ -255,7 +253,7 @@ template
int
Triangle_2_Triangle_2_pair::vertex_count() const
{
- CGAL_kernel_assertion(_known);
+ CGAL_kernel_assertion(_result!=UNKNOWN);
return _pointlist.size;
}
@@ -263,7 +261,7 @@ template
typename K::Point_2
Triangle_2_Triangle_2_pair::vertex(int n) const
{
- CGAL_kernel_assertion(_known);
+ CGAL_kernel_assertion(_result!=UNKNOWN);
CGAL_kernel_assertion(n >= 0 && n < _pointlist.size);
Pointlist_2_rec_ *cur;
int k;
@@ -279,7 +277,7 @@ typename K::Triangle_2
Triangle_2_Triangle_2_pair::intersection_triangle() const
{
typedef typename K::Triangle_2 Triangle_2;
- if (!_known)
+ if (_result==UNKNOWN)
intersection_type();
CGAL_kernel_assertion(_result == TRIANGLE);
if(CGAL::left_turn(_pointlist.first->point,
@@ -302,7 +300,7 @@ typename K::Segment_2
Triangle_2_Triangle_2_pair::intersection_segment() const
{
typedef typename K::Segment_2 Segment_2;
- if (!_known)
+ if (_result==UNKNOWN)
intersection_type();
CGAL_kernel_assertion(_result == SEGMENT);
return Segment_2(_pointlist.first->point,
@@ -313,7 +311,7 @@ template
typename K::Point_2
Triangle_2_Triangle_2_pair::intersection_point() const
{
- if (!_known)
+ if (_result==UNKNOWN)
intersection_type();
CGAL_kernel_assertion(_result == POINT);
return _pointlist.first->point;
diff --git a/Kernel_23/include/CGAL/Kernel/function_objects.h b/Kernel_23/include/CGAL/Kernel/function_objects.h
index 06758a7d7a3..c3a7337aefb 100644
--- a/Kernel_23/include/CGAL/Kernel/function_objects.h
+++ b/Kernel_23/include/CGAL/Kernel/function_objects.h
@@ -2850,8 +2850,8 @@ namespace CommonKernelFunctors {
public:
typename K::Point_3
- operator()(const typename K::Point_3& origin,
- const typename K::Triangle_3& triangle,
+ operator()(const typename K::Triangle_3& triangle,
+ const typename K::Point_3& origin,
const K& k)
{
typedef typename K::Point_3 Point_3;
@@ -2890,18 +2890,18 @@ namespace CommonKernelFunctors {
if(linf_ab > linf_ac) {
if(linf_ab > linf_bc) {
// ab is the maximal segment
- return this->operator()(origin, seg(a, b), k);
+ return this->operator()(seg(a, b), origin, k);
} else {
// ab > ac, bc >= ab, use bc
- return this->operator()(origin, seg(b, c), k);
+ return this->operator()(seg(b, c), origin, k);
}
} else { // ab <= ac
if(linf_ac > linf_bc) {
// ac is the maximal segment
- return this->operator()(origin, seg(a, c), k);
+ return this->operator()(seg(a, c), origin, k);
} else {
// ab <= ac, ac <= bc, use bc
- return this->operator()(origin, seg(b, c), k);
+ return this->operator()(seg(b, c), origin, k);
}
}
} // degenerate plane
@@ -2923,8 +2923,8 @@ namespace CommonKernelFunctors {
}
typename K::Point_3
- operator()(const typename K::Point_3& query,
- const typename K::Segment_3& segment,
+ operator()(const typename K::Segment_3& segment,
+ const typename K::Point_3& query,
const K& k)
{
@@ -2945,8 +2945,8 @@ namespace CommonKernelFunctors {
}
typename K::Point_3
- operator()(const typename K::Point_3& query,
- const typename K::Ray_3& ray,
+ operator()(const typename K::Ray_3& ray,
+ const typename K::Point_3& query,
const K& k)
{
if ( ray.to_vector() * (query-ray.source()) <= 0)
@@ -2957,6 +2957,14 @@ namespace CommonKernelFunctors {
}
}
+ const typename K::Point_3&
+ operator()(const typename K::Point_3& point,
+ const typename K::Point_3&,
+ const K&)
+ {
+ return point;
+ }
+
// code for operator for plane and point is defined in
// CGAL/Cartesian/function_objects.h and CGAL/Homogeneous/function_objects.h
};
@@ -3005,7 +3013,6 @@ namespace CommonKernelFunctors {
public:
typedef typename K::Boolean result_type;
- // There are 36 combinaisons, so I use a template.
template
result_type
operator()(const T1& t1, const T2& t2) const
@@ -3018,7 +3025,6 @@ namespace CommonKernelFunctors {
public:
typedef typename K::Boolean result_type;
- // There are x combinaisons, so I use a template.
template
result_type
operator()(const T1& t1, const T2& t2) const
diff --git a/Kernel_23/test/Kernel_23/include/CGAL/_test_fct_constructions_3.h b/Kernel_23/test/Kernel_23/include/CGAL/_test_fct_constructions_3.h
index e45abb683e9..1931c2ae7e2 100644
--- a/Kernel_23/test/Kernel_23/include/CGAL/_test_fct_constructions_3.h
+++ b/Kernel_23/test/Kernel_23/include/CGAL/_test_fct_constructions_3.h
@@ -131,6 +131,8 @@ _test_fct_constructions_3(const R& r)
assert( r.construct_projected_point_3_object()(ray, Point(-1,0,0)) == Point(0,0,0));
assert( r.construct_projected_point_3_object()(s, Point(-1,0,0)) == Point(0,0,0));
assert( r.construct_projected_point_3_object()(s, Point(2,0,0)) == Point(1,1,0));
+ assert( r.construct_projected_point_3_object()(Point(0,0,0), Point(2,0,0)) == Point(0,0,0));
+
return true;
}
diff --git a/Kernel_d/include/CGAL/Kernel_d/Segment_d.h b/Kernel_d/include/CGAL/Kernel_d/Segment_d.h
index 5a399babf4d..bd30d04f3a7 100644
--- a/Kernel_d/include/CGAL/Kernel_d/Segment_d.h
+++ b/Kernel_d/include/CGAL/Kernel_d/Segment_d.h
@@ -19,7 +19,6 @@
#include
#include
-#include
#include
#include
#include
diff --git a/Maintenance/test_handling/testsuite_comparison/diff_testsuites.html b/Maintenance/test_handling/testsuite_comparison/diff_testsuites.html
index 6cb41ecb451..4ec2720540f 100644
--- a/Maintenance/test_handling/testsuite_comparison/diff_testsuites.html
+++ b/Maintenance/test_handling/testsuite_comparison/diff_testsuites.html
@@ -18,6 +18,9 @@
+
+Note that the diff should be done from left to right, as red or yellow squares in the left testsuite that become green in the right testsuite will be ignored.
+