Merge 'cgal/releases/CGAL-4.13-branch'

This commit is contained in:
Sébastien Loriot 2019-08-27 06:36:39 +02:00
commit f0fb56233a
3 changed files with 13 additions and 10 deletions

View File

@ -722,8 +722,8 @@ namespace internal {
/// \endcond /// \endcond
/* /**
\ingroup PkgPointSetProcessing3IOPly \ingroup PkgPointSetProcessingIOPly
Reads user-selected points properties from a .ply stream (ASCII or Reads user-selected points properties from a .ply stream (ASCII or
binary). binary).

View File

@ -355,7 +355,8 @@ namespace internal {
\cgalRequiresCPP11 \cgalRequiresCPP11
\tparam PointRange is a model of `ConstRange`. The value type of \tparam PointRange is a model of `ConstRange`. The value type of
its iterator is the key type of the named parameter `point_map`. its iterator is the key type of the `PropertyMap` objects provided
within the `PropertyHandler` parameter.
\tparam PropertyHandler handlers to recover properties. \tparam PropertyHandler handlers to recover properties.
\return `true` on success. \return `true` on success.

View File

@ -81,17 +81,19 @@ triangle_grid_sampling( const typename Kernel::Point_3& p0,
} }
#if defined(CGAL_LINKED_WITH_TBB) #if defined(CGAL_LINKED_WITH_TBB)
template <class AABB_tree, class Point_3> template <class AABB_tree, class PointRange>
struct Distance_computation{ struct Distance_computation{
typedef typename PointRange::const_iterator::value_type Point_3;
const AABB_tree& tree; const AABB_tree& tree;
const std::vector<Point_3>& sample_points; const PointRange& sample_points;
Point_3 initial_hint; Point_3 initial_hint;
tbb::atomic<double>* distance; tbb::atomic<double>* distance;
Distance_computation( Distance_computation(
const AABB_tree& tree, const AABB_tree& tree,
const Point_3& p, const Point_3& p,
const std::vector<Point_3>& sample_points, const PointRange& sample_points,
tbb::atomic<double>* d) tbb::atomic<double>* d)
: tree(tree) : tree(tree)
, sample_points(sample_points) , sample_points(sample_points)
@ -106,9 +108,9 @@ struct Distance_computation{
double hdist = 0; double hdist = 0;
for( std::size_t i = range.begin(); i != range.end(); ++i) for( std::size_t i = range.begin(); i != range.end(); ++i)
{ {
hint = tree.closest_point(sample_points[i], hint); hint = tree.closest_point(*(sample_points.begin() + i), hint);
typename Kernel_traits<Point_3>::Kernel::Compute_squared_distance_3 squared_distance; typename Kernel_traits<Point_3>::Kernel::Compute_squared_distance_3 squared_distance;
double d = to_double(CGAL::approximate_sqrt( squared_distance(hint,sample_points[i]) )); double d = to_double(CGAL::approximate_sqrt( squared_distance(hint,*(sample_points.begin() + i)) ));
if (d>hdist) hdist=d; if (d>hdist) hdist=d;
} }
@ -139,7 +141,7 @@ double approximate_Hausdorff_distance_impl(
{ {
tbb::atomic<double> distance; tbb::atomic<double> distance;
distance=0; distance=0;
Distance_computation<AABBTree, typename Kernel::Point_3> f(tree, hint, sample_points, &distance); Distance_computation<AABBTree, PointRange> f(tree, hint, sample_points, &distance);
tbb::parallel_for(tbb::blocked_range<std::size_t>(0, sample_points.size()), f); tbb::parallel_for(tbb::blocked_range<std::size_t>(0, sample_points.size()), f);
return distance; return distance;
} }
@ -661,7 +663,7 @@ double approximate_symmetric_Hausdorff_distance(
* \ingroup PMP_distance_grp * \ingroup PMP_distance_grp
* returns the distance to `tm` of the point from `points` * returns the distance to `tm` of the point from `points`
* that is the furthest from `tm`. * that is the furthest from `tm`.
* @tparam PointRange a range of `Point_3`, model of `Range`. * @tparam PointRange a range of `Point_3`, model of `Range`. Its iterator type is `RandomAccessIterator`.
* @tparam TriangleMesh a model of the concept `FaceListGraph` * @tparam TriangleMesh a model of the concept `FaceListGraph`
* @tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters" * @tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters"
* @param points the range of points of interest * @param points the range of points of interest