diff --git a/Classification/include/CGAL/Classification/Point_set_feature_generator.h b/Classification/include/CGAL/Classification/Point_set_feature_generator.h index 04c476d6548..b74ef1d16f6 100644 --- a/Classification/include/CGAL/Classification/Point_set_feature_generator.h +++ b/Classification/include/CGAL/Classification/Point_set_feature_generator.h @@ -496,7 +496,7 @@ private: launch_feature_computation (new Feature_adder_verticality (this, normal_map, 0)); } - void generate_normal_based_features(const CGAL::Default_property_map&) + void generate_normal_based_features(const CGAL::Constant_property_map&) { generate_multiscale_feature_variant_0 (); } @@ -544,7 +544,7 @@ private: 2, 25.f * float(i), 12.5f)); } - void generate_color_based_features(const CGAL::Default_property_map&) + void generate_color_based_features(const CGAL::Constant_property_map&) { } @@ -581,7 +581,7 @@ private: launch_feature_computation (new Feature_adder_echo (this, echo_map, i)); } - void generate_echo_based_features(const CGAL::Default_property_map&) + void generate_echo_based_features(const CGAL::Constant_property_map&) { } @@ -615,10 +615,10 @@ private: } template - Default_property_map + Constant_property_map get_parameter (const Default&) { - return Default_property_map(); + return Constant_property_map(); } template diff --git a/Property_map/include/CGAL/property_map.h b/Property_map/include/CGAL/property_map.h index e8612db429c..6280b0c653f 100644 --- a/Property_map/include/CGAL/property_map.h +++ b/Property_map/include/CGAL/property_map.h @@ -440,20 +440,29 @@ make_property_map(const std::vector& v) } /// \ingroup PkgProperty_map -/// Property map that only returns the default value type -/// \cgalModels `ReadablePropertyMap` -template -struct Default_property_map{ +/// Property map that returns a fixed value. +/// Note that this value is chosen when the map is constructed and cannot +/// be changed afterwards. Specifically, the free function `put()` does nothing. +/// +/// \cgalModels `ReadWritePropertyMap` +template +struct Constant_property_map +{ const ValueType default_value; - - typedef typename InputIterator::value_type key_type; - typedef boost::readable_property_map_tag category; - Default_property_map(const ValueType& default_value = ValueType()) : default_value (default_value) { } - - /// Free function to use a get the value from an iterator using Input_iterator_property_map. - inline friend ValueType - get (const Default_property_map&, const key_type&){ return ValueType(); } + typedef KeyType key_type; + typedef ValueType value_type; + typedef boost::read_write_property_map_tag category; + + Constant_property_map(const value_type& default_value = value_type()) : default_value (default_value) { } + + /// Free function that returns `pm.default_value`. + inline friend value_type + get (const Constant_property_map& pm, const key_type&){ return pm.default_value; } + + /// Free function that does nothing. + inline friend void + put (const Constant_property_map&, const key_type&, const value_type&) { } }; /// \ingroup PkgProperty_map