From dce942dd7ef9120f649a6ef2a1a9f41090b83f8c Mon Sep 17 00:00:00 2001 From: Simon Giraudot Date: Thu, 5 Oct 2017 14:38:11 +0200 Subject: [PATCH] Bugfix: sort features by name after generation --- .../include/CGAL/Classification/Feature_set.h | 14 ++++++++++++++ .../Classification/Point_set_feature_generator.h | 2 ++ 2 files changed, 16 insertions(+) diff --git a/Classification/include/CGAL/Classification/Feature_set.h b/Classification/include/CGAL/Classification/Feature_set.h index a620c64bff0..2c68d4112d0 100644 --- a/Classification/include/CGAL/Classification/Feature_set.h +++ b/Classification/include/CGAL/Classification/Feature_set.h @@ -47,6 +47,14 @@ class Feature_set { typedef std::vector Base; Base m_features; + + struct Compare_name + { + bool operator() (const Feature_handle& a, const Feature_handle& b) const + { + return a->name() < b->name(); + } + }; #ifdef CGAL_LINKED_WITH_TBB tbb::mutex m_mutex; @@ -136,6 +144,12 @@ public: { m_features[i] = Feature_handle(); } + + void sort_features_by_name() + { + std::sort (m_features.begin(), m_features.end(), + Compare_name()); + } /// \endcond }; diff --git a/Classification/include/CGAL/Classification/Point_set_feature_generator.h b/Classification/include/CGAL/Classification/Point_set_feature_generator.h index ced5fa9b39e..006a4885edc 100644 --- a/Classification/include/CGAL/Classification/Point_set_feature_generator.h +++ b/Classification/include/CGAL/Classification/Point_set_feature_generator.h @@ -343,6 +343,8 @@ public: get_parameter(normal_map), get_parameter(color_map), get_parameter(echo_map)); + + m_features->sort_features_by_name(); }