diff --git a/Point_set_processing_3/include/CGAL/improved_jet_smooth_point_set.h b/Point_set_processing_3/include/CGAL/improved_jet_smooth_point_set.h index b4a1fb07ee6..5332c56664f 100644 --- a/Point_set_processing_3/include/CGAL/improved_jet_smooth_point_set.h +++ b/Point_set_processing_3/include/CGAL/improved_jet_smooth_point_set.h @@ -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. +/// @tparam PointPMap is a model of `ReadWritePropertyMap` with a value_type = Point_3. /// It can be omitted if ForwardIterator value_type is convertible to Point_3. /// @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(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 } }