changed improved_jet_smooth_point_set PointPMap requirement to ReadWritePropertyMap

which was ReadablePropertyMap (which was not OK since pmap is also subject to change inside the function)
This commit is contained in:
iyaz 2013-05-04 01:50:02 +03:00
parent db31047a13
commit f7d331ec22
1 changed files with 9 additions and 3 deletions

View File

@ -205,7 +205,7 @@ improved_jet_smooth_point(
/// \pre `k >= 2`
///
/// @tparam ForwardIterator iterator over input points.
/// @tparam PointPMap is a model of `ReadablePropertyMap` with a value_type = Point_3<Kernel>.
/// @tparam PointPMap is a model of `ReadWritePropertyMap` with a value_type = Point_3<Kernel>.
/// It can be omitted if ForwardIterator value_type is convertible to Point_3<Kernel>.
/// @tparam Kernel Geometric traits class.
/// It can be omitted and deduced automatically from PointPMap value_type.
@ -258,7 +258,8 @@ improved_jet_smooth_point_set(
#ifdef CGAL_USE_OLD_PAIR_PROPERTY_MAPS
Point& p0 = get(point_pmap,it);
#else
Point& p0 = get(point_pmap,*it);
// changed to const Point&
const Point& p0 = get(point_pmap,*it);
#endif
treeElements.push_back(KdTreeElement(p0,i));
}
@ -286,7 +287,8 @@ improved_jet_smooth_point_set(
#ifdef CGAL_USE_OLD_PAIR_PROPERTY_MAPS
Point& p0 = get(point_pmap,it);
#else
Point& p0 = get(point_pmap,*it);
// changed to const Point&
const Point& p0 = get(point_pmap,*it);
#endif
Point np = improved_jet_smoothing_i::jet_smooth_point<Kernel>(p0,tree,kk);
b[i] = alpha*(np - p0) + (1-alpha)*(np - p[i]);
@ -304,8 +306,12 @@ improved_jet_smooth_point_set(
// Implementation note: the cast to Point& allows to modify only the point's position.
for(it = first, i=0; it != beyond; it++, ++i)
{
#ifdef CGAL_USE_OLD_PAIR_PROPERTY_MAPS
Point& p0 = get(point_pmap,it);
p0 = p[i];
#else
put(point_pmap, *it, p[i]);
#endif
}
}