diff --git a/Installation/changes.html b/Installation/changes.html
index 64efc488274..52588eff107 100644
--- a/Installation/changes.html
+++ b/Installation/changes.html
@@ -244,6 +244,15 @@ and src/ directories).
The generator ipelet now generates point in a selected zone
Hilbert sort ipelet implements two policies
+
+ dD Spatial Searching
+
+ - Fix a documentation bug: The property map passed as template parameter to the classes
+
Search_traits_adapter and Distance_adapter must be a
+ lvalue property map. To avoid incorrect usage, a static assertion has been added
+ in the CGAL code to prevent the user from instantiating these classes with an
+ incorrect property map type.
+
Release 4.3
diff --git a/Spatial_searching/doc/Spatial_searching/CGAL/Search_traits_adapter.h b/Spatial_searching/doc/Spatial_searching/CGAL/Search_traits_adapter.h
index c1c8a693d8f..983275e70c5 100644
--- a/Spatial_searching/doc/Spatial_searching/CGAL/Search_traits_adapter.h
+++ b/Spatial_searching/doc/Spatial_searching/CGAL/Search_traits_adapter.h
@@ -12,7 +12,7 @@ in a nearest neighbor search algorithm, this class must be used as distance.
`Key` is a type that is associated to a point of type `Base_distance::Point_d`.
-`PointPropertyMap` is a model of `ReadablePropertyMap`
+`PointPropertyMap` is a model of `LvaluePropertyMap`
with `Key` as `key_type` and `Base_distance::Point_d` as `value_type`.
`Base_distance` is a model of either `GeneralDistance` or `OrthogonalDistance`.
@@ -84,7 +84,7 @@ must be used as distance.
`Key` is a type that is associated to a point of type `Base_distance::Point_d`.
-`PointPropertyMap` is a model of `ReadablePropertyMap`
+`PointPropertyMap` is a model of `LvaluePropertyMap`
with `Key` as `key_type` and `Base_distance::Point_d` as `value_type`.
`BaseTraits` is a model of either `SearchTraits` or `RangeSearchTraits`.
diff --git a/Spatial_searching/doc/Spatial_searching/PackageDescription.txt b/Spatial_searching/doc/Spatial_searching/PackageDescription.txt
index 204472d6842..195a698b5bf 100644
--- a/Spatial_searching/doc/Spatial_searching/PackageDescription.txt
+++ b/Spatial_searching/doc/Spatial_searching/PackageDescription.txt
@@ -79,7 +79,7 @@ classes that are described in the reference pages.
- `CGAL::Euclidean_distance_sphere_point`
- `CGAL::Manhattan_distance_iso_box_point`
- `CGAL::Weighted_Minkowski_distance`
-- `CGAL::Distance_for_point_adapter`
+- `CGAL::Distance_adapter`
## %Splitter Classes ##
- `CGAL::Sliding_midpoint`
diff --git a/Spatial_searching/examples/Spatial_searching/searching_with_point_with_info_inplace.cpp b/Spatial_searching/examples/Spatial_searching/searching_with_point_with_info_inplace.cpp
index 07ba0a23e9c..8df35e84ea1 100644
--- a/Spatial_searching/examples/Spatial_searching/searching_with_point_with_info_inplace.cpp
+++ b/Spatial_searching/examples/Spatial_searching/searching_with_point_with_info_inplace.cpp
@@ -12,21 +12,23 @@ typedef Kernel::Point_3 Point_3;
typedef std::size_t Point;
-//definition of the property map and get
-//function as friend function to have access to
-//private member
+//definition of a non-mutable lvalue property map,
+//with the get function as a friend function to give it
+//access to the private member
class My_point_property_map{
const std::vector& points;
public:
typedef Point_3 value_type;
typedef const value_type& reference;
typedef Point key_type;
- typedef boost::readable_property_map_tag category;
+ typedef boost::lvalue_property_map_tag category;
My_point_property_map(const std::vector& pts):points(pts){}
+ reference operator[](key_type k) const {return points[k];}
+
friend reference get(const My_point_property_map& ppmap,key_type i)
- {return ppmap.points[i];}
+ {return ppmap[i];}
};
diff --git a/Spatial_searching/include/CGAL/Search_traits_adapter.h b/Spatial_searching/include/CGAL/Search_traits_adapter.h
index 8c4560eec86..1526c084885 100644
--- a/Spatial_searching/include/CGAL/Search_traits_adapter.h
+++ b/Spatial_searching/include/CGAL/Search_traits_adapter.h
@@ -22,15 +22,12 @@
#define CGAL_SEARCH_TRAITS_WITH_INFO
#include
-#include
#include //for default distance specialization
+#include
-#include
-#if BOOST_VERSION >= 104000
- #include
-#else
- #include
-#endif
+#include
+#include
+#include
namespace CGAL{
@@ -74,6 +71,10 @@ struct Get_iso_box_d
template
class Search_traits_adapter : public Base_traits{
PointPropertyMap ppmap;
+
+ BOOST_STATIC_ASSERT( ( boost::is_same< boost::lvalue_property_map_tag,
+ typename boost::property_traits::category
+ >::value ) );
public:
typedef Base_traits Base;
typedef typename internal::Get_iso_box_d::type Iso_box_d;
@@ -126,6 +127,10 @@ template
class Distance_adapter : public Base_distance {
PointPropertyMap ppmap;
typedef typename Base_distance::FT FT;
+
+ BOOST_STATIC_ASSERT( ( boost::is_same< boost::lvalue_property_map_tag,
+ typename boost::property_traits::category
+ >::value ) );
public:
Distance_adapter( const PointPropertyMap& ppmap_=PointPropertyMap(),
diff --git a/Spatial_searching/test/Spatial_searching/Building_kd_tree_with_ddim_points.cpp b/Spatial_searching/test/Spatial_searching/Building_kd_tree_with_ddim_points.cpp
index dd3dbcd5871..b55e59e8b38 100644
--- a/Spatial_searching/test/Spatial_searching/Building_kd_tree_with_ddim_points.cpp
+++ b/Spatial_searching/test/Spatial_searching/Building_kd_tree_with_ddim_points.cpp
@@ -27,8 +27,9 @@ typedef CGAL::K_neighbor_search K_neighbor_searc
typedef Orthogonal_k_neighbor_search::Distance Distance;
//typdefs for Point_with_info
typedef Point_with_info_helper::type Point_with_info;
-typedef CGAL::Search_traits_adapter Traits_with_info;
-typedef CGAL::Distance_adapter Distance_adapter;
+typedef Point_property_map Ppmap;
+typedef CGAL::Search_traits_adapter Traits_with_info;
+typedef CGAL::Distance_adapter Distance_adapter;
typedef CGAL::Orthogonal_k_neighbor_search Orthogonal_k_neighbor_search_with_info;
typedef CGAL::K_neighbor_search K_neighbor_search_with_info;
diff --git a/Spatial_searching/test/Spatial_searching/Building_kd_tree_with_own_pointtype.cpp b/Spatial_searching/test/Spatial_searching/Building_kd_tree_with_own_pointtype.cpp
index 3e3a756162a..37cfcd109fd 100644
--- a/Spatial_searching/test/Spatial_searching/Building_kd_tree_with_own_pointtype.cpp
+++ b/Spatial_searching/test/Spatial_searching/Building_kd_tree_with_own_pointtype.cpp
@@ -16,8 +16,9 @@ typedef CGAL::Search_traits K_neighbor_search;
//typdefs for Point_with_info
typedef Point_with_info_helper::type Point_with_info;
-typedef CGAL::Search_traits_adapter Traits_with_info;
-typedef CGAL::Distance_adapter Distance_adapter;
+typedef Point_property_map Ppmap;
+typedef CGAL::Search_traits_adapter Traits_with_info;
+typedef CGAL::Distance_adapter Distance_adapter;
typedef CGAL::Orthogonal_k_neighbor_search K_neighbor_search_with_info;
const unsigned int N = 1000;
diff --git a/Spatial_searching/test/Spatial_searching/Circular_query.cpp b/Spatial_searching/test/Spatial_searching/Circular_query.cpp
index 9edb6c89a5b..1a58a38c59b 100644
--- a/Spatial_searching/test/Spatial_searching/Circular_query.cpp
+++ b/Spatial_searching/test/Spatial_searching/Circular_query.cpp
@@ -23,7 +23,8 @@ typedef CGAL::Counting_iterator N_Random_points_iterator
typedef CGAL::Search_traits_2 Traits;
//for Point_with_info
typedef Point_with_info_helper::type Point_with_info;
-typedef CGAL::Search_traits_adapter Traits_with_info;
+typedef Point_property_map Ppmap;
+typedef CGAL::Search_traits_adapter Traits_with_info;
template
diff --git a/Spatial_searching/test/Spatial_searching/Iso_rectangle_2_query.cpp b/Spatial_searching/test/Spatial_searching/Iso_rectangle_2_query.cpp
index 37480e692bf..1261dc3dc36 100644
--- a/Spatial_searching/test/Spatial_searching/Iso_rectangle_2_query.cpp
+++ b/Spatial_searching/test/Spatial_searching/Iso_rectangle_2_query.cpp
@@ -21,7 +21,8 @@ typedef CGAL::Random_points_in_square_2 Random_points_iterator;
typedef CGAL::Counting_iterator N_Random_points_iterator;
typedef CGAL::Search_traits_2 Traits;
typedef Point_with_info_helper::type Point_with_info;
-typedef CGAL::Search_traits_adapter Traits_with_info;
+typedef Point_property_map Ppmap;
+typedef CGAL::Search_traits_adapter Traits_with_info;
template
void run(std::list all_points)
diff --git a/Spatial_searching/test/Spatial_searching/K_neighbor_search_manhattan_distance_isobox_point.cpp b/Spatial_searching/test/Spatial_searching/K_neighbor_search_manhattan_distance_isobox_point.cpp
index 425be051905..b7d24c1beb7 100644
--- a/Spatial_searching/test/Spatial_searching/K_neighbor_search_manhattan_distance_isobox_point.cpp
+++ b/Spatial_searching/test/Spatial_searching/K_neighbor_search_manhattan_distance_isobox_point.cpp
@@ -16,8 +16,9 @@ typedef CGAL::Manhattan_distance_iso_box_point Distance;
typedef CGAL::K_neighbor_search Neighbor_search;
//typdefs for Point_with_info
typedef Point_with_info_helper::type Point_with_info;
-typedef CGAL::Search_traits_adapter Traits_with_info;
-typedef CGAL::Distance_adapter Distance_adapter;
+typedef Point_property_map Ppmap;
+typedef CGAL::Search_traits_adapter Traits_with_info;
+typedef CGAL::Distance_adapter Distance_adapter;
typedef CGAL::K_neighbor_search Neighbor_search_with_info;
const unsigned int K = 8;
diff --git a/Spatial_searching/test/Spatial_searching/K_neighbor_search_with_circle.cpp b/Spatial_searching/test/Spatial_searching/K_neighbor_search_with_circle.cpp
index 1498d333bf6..23183173313 100644
--- a/Spatial_searching/test/Spatial_searching/K_neighbor_search_with_circle.cpp
+++ b/Spatial_searching/test/Spatial_searching/K_neighbor_search_with_circle.cpp
@@ -21,8 +21,9 @@ typedef CGAL::K_neighbor_search Neighbor_search;
typedef CGAL::Random_points_in_square_2 Random_points_iterator;
//typdefs for Point_with_info
typedef Point_with_info_helper::type Point_with_info;
-typedef CGAL::Search_traits_adapter Traits_with_info;
-typedef CGAL::Distance_adapter Distance_adapter;
+typedef Point_property_map Ppmap;
+typedef CGAL::Search_traits_adapter Traits_with_info;
+typedef CGAL::Distance_adapter Distance_adapter;
typedef CGAL::K_neighbor_search Neighbor_search_with_info;
diff --git a/Spatial_searching/test/Spatial_searching/Orthogonal_incremental_neighbor_search.cpp b/Spatial_searching/test/Spatial_searching/Orthogonal_incremental_neighbor_search.cpp
index fcbd73c898f..da57a550836 100644
--- a/Spatial_searching/test/Spatial_searching/Orthogonal_incremental_neighbor_search.cpp
+++ b/Spatial_searching/test/Spatial_searching/Orthogonal_incremental_neighbor_search.cpp
@@ -39,8 +39,9 @@ typedef Orthogonal_incremental_neighbor_search::iterator NN_iterator;
typedef Orthogonal_incremental_neighbor_search::Point_with_transformed_distance Point_with_transformed_distance;
//typdefs for Point_with_info
typedef Point_with_info_helper::type Point_with_info;
-typedef CGAL::Search_traits_adapter Traits_with_info;
-typedef CGAL::Distance_adapter Distance_adapter;
+typedef Point_property_map Ppmap;
+typedef CGAL::Search_traits_adapter Traits_with_info;
+typedef CGAL::Distance_adapter Distance_adapter;
typedef CGAL::Incremental_neighbor_search Orthogonal_incremental_neighbor_search_with_info;
diff --git a/Spatial_searching/test/Spatial_searching/Orthogonal_k_neighbor_search.cpp b/Spatial_searching/test/Spatial_searching/Orthogonal_k_neighbor_search.cpp
index 31ddd170746..bbfed61ef41 100644
--- a/Spatial_searching/test/Spatial_searching/Orthogonal_k_neighbor_search.cpp
+++ b/Spatial_searching/test/Spatial_searching/Orthogonal_k_neighbor_search.cpp
@@ -16,8 +16,9 @@ typedef CGAL::Search_traits_2 TreeTrai
typedef CGAL::Orthogonal_k_neighbor_search Neighbor_search;
//typdefs fo Point_with_info
typedef Point_with_info_helper::type Point_with_info;
-typedef CGAL::Search_traits_adapter Traits_with_info;
-typedef CGAL::Distance_adapter Distance_adapter;
+typedef Point_property_map Ppmap;
+typedef CGAL::Search_traits_adapter Traits_with_info;
+typedef CGAL::Distance_adapter Distance_adapter;
typedef CGAL::Orthogonal_k_neighbor_search Neighbor_search_with_info;
template
diff --git a/Spatial_searching/test/Spatial_searching/Point_with_info.h b/Spatial_searching/test/Spatial_searching/Point_with_info.h
index f8446c31870..933417462d8 100644
--- a/Spatial_searching/test/Spatial_searching/Point_with_info.h
+++ b/Spatial_searching/test/Spatial_searching/Point_with_info.h
@@ -16,17 +16,24 @@ struct Point_with_info_helper{
typedef My_point_with_info type;
};
-
+template
struct Point_property_map{
- template
- friend const Point& get(Point_property_map,const My_point_with_info& p) {return p.point();}
+ typedef Point value_type;
+ typedef const value_type& reference;
+ typedef const My_point_with_info& key_type;
+ typedef boost::lvalue_property_map_tag category;
+
+ reference operator[](key_type k) const {return k.point();}
+
+ friend reference get(const Point_property_map& ppmap, key_type i)
+ {return ppmap[i];}
};
template
const Point& get_point(const Point& p) {return p;}
template
-const Point& get_point(const My_point_with_info& p) {return get(Point_property_map(),p);}
+const Point& get_point(const My_point_with_info& p) {return get(Point_property_map(),p);}
template
struct Create_point_with_info : public std::unary_function{
diff --git a/Spatial_searching/test/Spatial_searching/Range_searching.cpp b/Spatial_searching/test/Spatial_searching/Range_searching.cpp
index 14b4d861cd3..938b5b9d70e 100644
--- a/Spatial_searching/test/Spatial_searching/Range_searching.cpp
+++ b/Spatial_searching/test/Spatial_searching/Range_searching.cpp
@@ -19,7 +19,8 @@ typedef CGAL::Counting_iterator N_Random_points_iterator
typedef CGAL::Search_traits_3 Traits;
//for Point_with_info
typedef Point_with_info_helper::type Point_with_info;
-typedef CGAL::Search_traits_adapter Traits_with_info;
+typedef Point_property_map Ppmap;
+typedef CGAL::Search_traits_adapter Traits_with_info;
const int N=10000;
diff --git a/Spatial_searching/test/Spatial_searching/Splitters.cpp b/Spatial_searching/test/Spatial_searching/Splitters.cpp
index 319527a897b..af28a273992 100644
--- a/Spatial_searching/test/Spatial_searching/Splitters.cpp
+++ b/Spatial_searching/test/Spatial_searching/Splitters.cpp
@@ -29,8 +29,9 @@ typedef CGAL::Search_traits_3 TreeTraits;
typedef CGAL::Euclidean_distance Distance;
#endif
typedef Point_with_info_helper::type Point_with_info;
-typedef CGAL::Search_traits_adapter Traits_with_info;
-typedef CGAL::Distance_adapter Distance_adapter;
+typedef Point_property_map Ppmap;
+typedef CGAL::Search_traits_adapter Traits_with_info;
+typedef CGAL::Distance_adapter Distance_adapter;
typedef std::vector Vector;