Bugfix: sort features by name after generation

This commit is contained in:
Simon Giraudot 2017-10-05 14:38:11 +02:00
parent b74b1fd226
commit dce942dd7e
2 changed files with 16 additions and 0 deletions

View File

@ -48,6 +48,14 @@ class Feature_set
typedef std::vector<Feature_handle> Base; typedef std::vector<Feature_handle> Base;
Base m_features; 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 #ifdef CGAL_LINKED_WITH_TBB
tbb::mutex m_mutex; tbb::mutex m_mutex;
void mutex_lock() { m_mutex.lock(); } void mutex_lock() { m_mutex.lock(); }
@ -136,6 +144,12 @@ public:
{ {
m_features[i] = Feature_handle(); m_features[i] = Feature_handle();
} }
void sort_features_by_name()
{
std::sort (m_features.begin(), m_features.end(),
Compare_name());
}
/// \endcond /// \endcond
}; };

View File

@ -343,6 +343,8 @@ public:
get_parameter<Vmap>(normal_map), get_parameter<Vmap>(normal_map),
get_parameter<Cmap>(color_map), get_parameter<Cmap>(color_map),
get_parameter<Emap>(echo_map)); get_parameter<Emap>(echo_map));
m_features->sort_features_by_name();
} }