mirror of https://github.com/CGAL/cgal
Merge pull request #5629 from sgiraudot/PSP-Fix_clustering_warning-GF
PSP: Fix conversion warnings in clustering
This commit is contained in:
commit
e935a3d99b
|
|
@ -139,6 +139,7 @@ std::size_t cluster_point_set (PointRange& points,
|
||||||
// basic geometric types
|
// basic geometric types
|
||||||
typedef typename PointRange::iterator iterator;
|
typedef typename PointRange::iterator iterator;
|
||||||
typedef typename iterator::value_type value_type;
|
typedef typename iterator::value_type value_type;
|
||||||
|
typedef typename boost::property_traits<ClusterMap>::value_type Cluster_index_t;
|
||||||
typedef typename CGAL::GetPointMap<PointRange, NamedParameters>::type PointMap;
|
typedef typename CGAL::GetPointMap<PointRange, NamedParameters>::type PointMap;
|
||||||
typedef typename Point_set_processing_3::GetK<PointRange, NamedParameters>::Kernel Kernel;
|
typedef typename Point_set_processing_3::GetK<PointRange, NamedParameters>::Kernel Kernel;
|
||||||
typedef typename Point_set_processing_3::GetAdjacencies<PointRange, NamedParameters>::type Adjacencies;
|
typedef typename Point_set_processing_3::GetAdjacencies<PointRange, NamedParameters>::type Adjacencies;
|
||||||
|
|
@ -175,7 +176,7 @@ std::size_t cluster_point_set (PointRange& points,
|
||||||
|
|
||||||
// Init cluster map with -1
|
// Init cluster map with -1
|
||||||
for (const value_type& p : points)
|
for (const value_type& p : points)
|
||||||
put (cluster_map, p, -1);
|
put (cluster_map, p, Cluster_index_t(-1));
|
||||||
|
|
||||||
Neighbor_query neighbor_query (points, point_map);
|
Neighbor_query neighbor_query (points, point_map);
|
||||||
|
|
||||||
|
|
@ -190,7 +191,7 @@ std::size_t cluster_point_set (PointRange& points,
|
||||||
{
|
{
|
||||||
const value_type& p = *it;
|
const value_type& p = *it;
|
||||||
|
|
||||||
if (int(get (cluster_map, p)) != -1)
|
if (get (cluster_map, p) != Cluster_index_t(-1))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
todo.push (it);
|
todo.push (it);
|
||||||
|
|
@ -200,10 +201,10 @@ std::size_t cluster_point_set (PointRange& points,
|
||||||
iterator current = todo.front();
|
iterator current = todo.front();
|
||||||
todo.pop();
|
todo.pop();
|
||||||
|
|
||||||
if (int(get (cluster_map, *current)) != -1)
|
if (get (cluster_map, *current) != Cluster_index_t(-1))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
put (cluster_map, *current, nb_clusters);
|
put (cluster_map, *current, Cluster_index_t(nb_clusters));
|
||||||
++ done;
|
++ done;
|
||||||
|
|
||||||
if (callback && !callback (callback_factor * (done + 1) / double(size)))
|
if (callback && !callback (callback_factor * (done + 1) / double(size)))
|
||||||
|
|
@ -230,7 +231,7 @@ std::size_t cluster_point_set (PointRange& points,
|
||||||
done = 0;
|
done = 0;
|
||||||
for (const value_type& p : points)
|
for (const value_type& p : points)
|
||||||
{
|
{
|
||||||
std::size_t c0 = get (cluster_map, p);
|
std::size_t c0 = std::size_t(get (cluster_map, p));
|
||||||
|
|
||||||
neighbors.clear();
|
neighbors.clear();
|
||||||
neighbor_query.get_iterators (get (point_map, p), 0, neighbor_radius,
|
neighbor_query.get_iterators (get (point_map, p), 0, neighbor_radius,
|
||||||
|
|
@ -238,7 +239,7 @@ std::size_t cluster_point_set (PointRange& points,
|
||||||
|
|
||||||
for (const iterator& it : neighbors)
|
for (const iterator& it : neighbors)
|
||||||
{
|
{
|
||||||
std::size_t c1 = get (cluster_map, *it);
|
std::size_t c1 = std::size_t(get (cluster_map, *it));
|
||||||
if (c0 < c1)
|
if (c0 < c1)
|
||||||
adj.push_back (std::make_pair (c0, c1));
|
adj.push_back (std::make_pair (c0, c1));
|
||||||
else if (c0 > c1)
|
else if (c0 > c1)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue