long/int -> size_t

This commit is contained in:
Andreas Fabri 2013-02-27 11:44:55 +01:00
parent e5a1756076
commit cfd69b1490
15 changed files with 36 additions and 29 deletions

View File

@ -181,7 +181,7 @@ public:
int number_of_points() const
{
return points.size();
return static_cast<int>(points.size());
}
int number_of_support_points() const

View File

@ -158,7 +158,7 @@ jet_estimate_normals(
// precondition: at least 2 nearest neighbors
CGAL_point_set_processing_precondition(k >= 2);
long memory = CGAL::Memory_sizer().virtual_size(); CGAL_TRACE(" %ld Mb allocated\n", memory>>20);
std::size_t memory = CGAL::Memory_sizer().virtual_size(); CGAL_TRACE(" %ld Mb allocated\n", memory>>20);
CGAL_TRACE(" Creates KD-tree\n");
InputIterator it;
@ -173,7 +173,7 @@ jet_estimate_normals(
}
Tree tree(kd_tree_points.begin(), kd_tree_points.end());
/*long*/ memory = CGAL::Memory_sizer().virtual_size(); CGAL_TRACE(" %ld Mb allocated\n", memory>>20);
memory = CGAL::Memory_sizer().virtual_size(); CGAL_TRACE(" %ld Mb allocated\n", memory>>20);
CGAL_TRACE(" Computes normals\n");
// iterate over input points, compute and output normal
@ -184,7 +184,7 @@ jet_estimate_normals(
put(normal_pmap, it, normal); // normal_pmap[it] = normal
}
/*long*/ memory = CGAL::Memory_sizer().virtual_size(); CGAL_TRACE(" %ld Mb allocated\n", memory>>20);
memory = CGAL::Memory_sizer().virtual_size(); CGAL_TRACE(" %ld Mb allocated\n", memory>>20);
CGAL_TRACE("End of jet_estimate_normals()\n");
}

View File

@ -294,7 +294,7 @@ create_riemannian_graph(
// Number of input points
const std::size_t num_input_points = distance(first, beyond);
long memory = CGAL::Memory_sizer().virtual_size(); CGAL_TRACE(" %ld Mb allocated\n", memory>>20);
std::size_t memory = CGAL::Memory_sizer().virtual_size(); CGAL_TRACE(" %ld Mb allocated\n", memory>>20);
CGAL_TRACE(" Creates KD-tree\n");
// Instanciate a KD-tree search.
@ -312,7 +312,7 @@ create_riemannian_graph(
// Recover RAM
kd_tree_points.clear();
/*long*/ memory = CGAL::Memory_sizer().virtual_size(); CGAL_TRACE(" %ld Mb allocated\n", memory>>20);
memory = CGAL::Memory_sizer().virtual_size(); CGAL_TRACE(" %ld Mb allocated\n", memory>>20);
CGAL_TRACE(" Creates Riemannian Graph\n");
// Iterates over input points and creates Riemannian Graph:
@ -432,7 +432,7 @@ create_mst_graph(
// Number of input points
const std::size_t num_input_points = boost::num_vertices(riemannian_graph);
long memory = CGAL::Memory_sizer().virtual_size(); CGAL_TRACE(" %ld Mb allocated\n", memory>>20);
std::size_t memory = CGAL::Memory_sizer().virtual_size(); CGAL_TRACE(" %ld Mb allocated\n", memory>>20);
CGAL_TRACE(" Calls boost::prim_minimum_spanning_tree()\n");
// Computes Minimum Spanning Tree.
@ -444,7 +444,7 @@ create_mst_graph(
weight_map( riemannian_graph_weight_map )
.root_vertex( boost::vertex(source_point_index, riemannian_graph) ));
/*long*/ memory = CGAL::Memory_sizer().virtual_size(); CGAL_TRACE(" %ld Mb allocated\n", memory>>20);
memory = CGAL::Memory_sizer().virtual_size(); CGAL_TRACE(" %ld Mb allocated\n", memory>>20);
CGAL_TRACE(" Creates MST Graph\n");
// Converts predecessor map to a MST graph:
@ -544,7 +544,7 @@ mst_orient_normals(
// Precondition: at least 2 nearest neighbors
CGAL_point_set_processing_precondition(k >= 2);
long memory = CGAL::Memory_sizer().virtual_size(); CGAL_TRACE(" %ld Mb allocated\n", memory>>20);
std::size_t memory = CGAL::Memory_sizer().virtual_size(); CGAL_TRACE(" %ld Mb allocated\n", memory>>20);
CGAL_TRACE(" Create Index_property_map\n");
// Create a property map Iterator -> index.
@ -579,7 +579,7 @@ mst_orient_normals(
riemannian_graph,
source_point);
/*long*/ memory = CGAL::Memory_sizer().virtual_size(); CGAL_TRACE(" %ld Mb allocated\n", memory>>20);
memory = CGAL::Memory_sizer().virtual_size(); CGAL_TRACE(" %ld Mb allocated\n", memory>>20);
CGAL_TRACE(" Calls boost::breadth_first_search()\n");
// Traverse the point set along the MST to propagate source_point's orientation
@ -609,7 +609,7 @@ mst_orient_normals(
// At this stage, we have typically 0 unoriented normals if k is large enough
CGAL_TRACE(" => %u normals are unoriented\n", unoriented_points.size());
/*long*/ memory = CGAL::Memory_sizer().virtual_size(); CGAL_TRACE(" %ld Mb allocated\n", memory>>20);
memory = CGAL::Memory_sizer().virtual_size(); CGAL_TRACE(" %ld Mb allocated\n", memory>>20);
CGAL_TRACE("End of mst_orient_normals()\n");
return first_unoriented_point;

View File

@ -152,7 +152,7 @@ pca_estimate_normals(
// precondition: at least 2 nearest neighbors
CGAL_point_set_processing_precondition(k >= 2);
long memory = CGAL::Memory_sizer().virtual_size(); CGAL_TRACE(" %ld Mb allocated\n", memory>>20);
std::size_t memory = CGAL::Memory_sizer().virtual_size(); CGAL_TRACE(" %ld Mb allocated\n", memory>>20);
CGAL_TRACE(" Creates KD-tree\n");
InputIterator it;
@ -167,7 +167,7 @@ pca_estimate_normals(
}
Tree tree(kd_tree_points.begin(), kd_tree_points.end());
/*long*/ memory = CGAL::Memory_sizer().virtual_size(); CGAL_TRACE(" %ld Mb allocated\n", memory>>20);
memory = CGAL::Memory_sizer().virtual_size(); CGAL_TRACE(" %ld Mb allocated\n", memory>>20);
CGAL_TRACE(" Computes normals\n");
// iterate over input points, compute and output normal
@ -178,7 +178,7 @@ pca_estimate_normals(
put(normal_pmap, it, normal); // normal_pmap[it] = normal
}
/*long*/ memory = CGAL::Memory_sizer().virtual_size(); CGAL_TRACE(" %ld Mb allocated\n", memory>>20);
memory = CGAL::Memory_sizer().virtual_size(); CGAL_TRACE(" %ld Mb allocated\n", memory>>20);
CGAL_TRACE("End of pca_estimate_normals()\n");
}

View File

@ -132,7 +132,7 @@ void Polyhedron_demo_normal_estimation_plugin::on_actionNormalEstimation_trigger
// Mark all normals as unoriented
first_unoriented_point = points->begin();
long memory = CGAL::Memory_sizer().virtual_size();
std::size_t memory = CGAL::Memory_sizer().virtual_size();
std::cerr << "Estimates normal direction: " << task_timer.time() << " seconds, "
<< (memory>>20) << " Mb allocated"
<< std::endl;
@ -150,7 +150,7 @@ void Polyhedron_demo_normal_estimation_plugin::on_actionNormalEstimation_trigger
// Mark all normals as unoriented
first_unoriented_point = points->begin();
long memory = CGAL::Memory_sizer().virtual_size();
std::size_t memory = CGAL::Memory_sizer().virtual_size();
std::cerr << "Estimates normal direction: " << task_timer.time() << " seconds, "
<< (memory>>20) << " Mb allocated"
<< std::endl;
@ -170,7 +170,7 @@ void Polyhedron_demo_normal_estimation_plugin::on_actionNormalEstimation_trigger
dialog.orientationNbNeighbors());
std::size_t nb_unoriented_normals = std::distance(first_unoriented_point, points->end());
long memory = CGAL::Memory_sizer().virtual_size();
std::size_t memory = CGAL::Memory_sizer().virtual_size();
std::cerr << "Orient normals: " << nb_unoriented_normals << " point(s) with an unoriented normal are selected ("
<< task_timer.time() << " seconds, "
<< (memory>>20) << " Mb allocated)"

View File

@ -88,7 +88,7 @@ void Polyhedron_demo_point_set_average_spacing_plugin::on_actionAverageSpacing_t
// Print result
Kernel::Sphere_3 bsphere = points->bounding_sphere();
double radius = std::sqrt(bsphere.squared_radius());
long memory = CGAL::Memory_sizer().virtual_size();
std::size_t memory = CGAL::Memory_sizer().virtual_size();
std::cerr << "Average spacing = " << average_spacing
<< " = " << average_spacing/radius << " * point set radius ("
<< task_timer.time() << " seconds, "

View File

@ -95,7 +95,7 @@ void Polyhedron_demo_point_set_outliers_removal_plugin::on_actionOutlierRemoval_
removed_percentage);
std::size_t nb_points_to_remove = std::distance(first_point_to_remove, points->end());
long memory = CGAL::Memory_sizer().virtual_size();
std::size_t memory = CGAL::Memory_sizer().virtual_size();
std::cerr << "Simplification: " << nb_points_to_remove << " point(s) are selected ("
<< task_timer.time() << " seconds, "
<< (memory>>20) << " Mb allocated)"

View File

@ -112,7 +112,7 @@ void Polyhedron_demo_point_set_simplification_plugin::on_actionSimplify_triggere
}
std::size_t nb_points_to_remove = std::distance(first_point_to_remove, points->end());
long memory = CGAL::Memory_sizer().virtual_size();
std::size_t memory = CGAL::Memory_sizer().virtual_size();
std::cerr << "Simplification: " << nb_points_to_remove << " point(s) are selected for removal ("
<< task_timer.time() << " seconds, "
<< (memory>>20) << " Mb allocated)"

View File

@ -1,3 +1,9 @@
#include <boost/config.hpp>
#if defined(BOOST_MSVC)
// avoid: warning C4996: 'CGAL::copy_n': was declared deprecated
# pragma warning(disable:4996)
#endif
#include <CGAL/array.h>
#include <CGAL/tuple.h>
#include <CGAL/algorithm.h>

View File

@ -32,6 +32,7 @@
# include <CGAL/Gmpq.h>
#endif
typedef CGAL::Simple_cartesian<double> K;
typedef K::Point_2 Point_2;

View File

@ -180,7 +180,7 @@ private:
while (add_border(tag_free,tag_done)) {}
// #borders
m_nb_borders = m_skeleton.size();
m_nb_borders = static_cast<int>(m_skeleton.size());
// put longest border first
if (m_nb_borders>1)
@ -249,7 +249,7 @@ private:
double max = 0.0;
// #borders
int nb = m_skeleton.size();
int nb = static_cast<int>(m_skeleton.size());
for(int i=0;i<nb;i++)
{

View File

@ -77,7 +77,7 @@ private:
public:
// Return the number of elements in the column
int size() const { return m_values.size(); }
int size() const { return static_cast<int>(m_values.size()); }
// return address of column{index}
// (NULL if coefficient does not exist).

View File

@ -819,7 +819,7 @@ private:
if(v->type() == Triangulation::INPUT)
values.push_back(v->f());
int size = values.size();
std::size_t size = values.size();
if(size == 0)
{
std::cerr << "Contouring: no input points\n";
@ -827,7 +827,7 @@ private:
}
std::sort(values.begin(),values.end());
int index = size/2;
std::size_t index = size/2;
// return values[size/2];
return 0.5 * (values[index] + values[index+1]); // avoids singular cases
}

View File

@ -386,7 +386,7 @@ public:
Point_with_normal pwn(get(point_pmap,it), get(normal_pmap,it));
points.push_back(pwn);
}
int n = points.size();
std::size_t n = points.size();
initialize_bounding_sphere();

View File

@ -229,7 +229,7 @@ unsigned int poisson_refine_triangulation(
typedef Poisson_mesher_level<Tr, Tets_criteria, Surface, Oracle, Null_mesher_level> Refiner;
int nb_vertices = tr.number_of_vertices(); // get former #vertices
std::size_t nb_vertices = tr.number_of_vertices(); // get former #vertices
// Delaunay refinement
Tets_criteria tets_criteria(radius_edge_ratio_bound*radius_edge_ratio_bound,
@ -241,10 +241,10 @@ unsigned int poisson_refine_triangulation(
refiner.scan_triangulation(); // Push bad cells to the queue
refiner.refine(Null_mesh_visitor()); // Refine triangulation until queue is empty
int nb_vertices_added = tr.number_of_vertices() - nb_vertices;
nb_vertices = tr.number_of_vertices() - nb_vertices;
return (unsigned int) nb_vertices_added;
return static_cast<unsigned int>(nb_vertices);
}
/// \endcond