mirror of https://github.com/CGAL/cgal
WARNFIX: fix some warnings triggered by -Wconversion on g++
This commit is contained in:
parent
f33c9730c0
commit
a04891ff93
|
|
@ -501,7 +501,7 @@ check_convergence() const
|
|||
sum_moves_ = sum/big_moves_.size();
|
||||
#endif
|
||||
|
||||
return ( sum/big_moves_.size() < convergence_ratio_ );
|
||||
return ( sum/FT(big_moves_.size()) < convergence_ratio_ );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ namespace CGAL_MINIBALL_NAMESPACE {
|
|||
template<class Traits>
|
||||
void Min_sphere_of_spheres_d<Traits>::update(LP_algorithm) {
|
||||
using namespace Min_sphere_of_spheres_d_impl;
|
||||
const int n = l.size();
|
||||
const int n = (int)l.size();
|
||||
int i, k = n;
|
||||
do {
|
||||
CGAL_MINIBALL_ASSERT(k>=e && e>=0);
|
||||
|
|
@ -224,7 +224,7 @@ namespace CGAL_MINIBALL_NAMESPACE {
|
|||
|
||||
template<class Traits>
|
||||
void Min_sphere_of_spheres_d<Traits>::update(Farthest_first_heuristic) {
|
||||
const int n = l.size();
|
||||
const int n = (int)l.size();
|
||||
int i = e;
|
||||
CGAL_MINIBALL_ASSERT(e <= n);
|
||||
|
||||
|
|
|
|||
|
|
@ -228,7 +228,7 @@ public:
|
|||
|
||||
//! constructor of Residue, from long
|
||||
Residue(long n){
|
||||
x_= RES_reduce(n);
|
||||
x_= RES_reduce((double)n);
|
||||
}
|
||||
|
||||
//! Access operator for x, \c const
|
||||
|
|
|
|||
|
|
@ -178,10 +178,10 @@ namespace OGL {
|
|||
{ return static_cast<double*>(normal_); }
|
||||
|
||||
void new_facet_cycle()
|
||||
{ fc_ends_.push_back(coords_.size()); }
|
||||
{ fc_ends_.push_back((unsigned)coords_.size()); }
|
||||
|
||||
unsigned number_of_facet_cycles() const
|
||||
{ return fc_ends_.size(); }
|
||||
{ return (unsigned)fc_ends_.size(); }
|
||||
|
||||
Coord_iterator facet_cycle_begin(unsigned i)
|
||||
{ CGAL_assertion(i<number_of_facet_cycles());
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ write_off_points_and_normals(
|
|||
}
|
||||
|
||||
// Write header
|
||||
const int num_input_points = std::distance(first, beyond);
|
||||
const std::size_t num_input_points = std::distance(first, beyond);
|
||||
stream << "NOFF" << std::endl;
|
||||
stream << num_input_points << " 0 0" << std::endl;
|
||||
|
||||
|
|
@ -180,7 +180,7 @@ write_off_points(
|
|||
}
|
||||
|
||||
// Write header
|
||||
const int num_input_points = std::distance(first, beyond);
|
||||
const std::size_t num_input_points = std::distance(first, beyond);
|
||||
stream << "OFF" << std::endl;
|
||||
stream << num_input_points << " 0 0" << std::endl;
|
||||
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ class Index_property_map<Iter,
|
|||
public:
|
||||
// Property maps' required types
|
||||
typedef boost::readable_property_map_tag category;
|
||||
typedef unsigned int value_type;
|
||||
typedef std::size_t value_type;
|
||||
typedef value_type reference;
|
||||
typedef Iter key_type;
|
||||
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ namespace internal {
|
|||
|
||||
|
||||
/// Generalization of std::distance() to compute the distance between 2 integers
|
||||
inline int
|
||||
inline std::size_t
|
||||
distance(std::size_t _First, std::size_t _Last)
|
||||
{
|
||||
// return int difference
|
||||
|
|
@ -297,7 +297,7 @@ create_riemannian_graph(
|
|||
CGAL_point_set_processing_precondition(k >= 2);
|
||||
|
||||
// Number of input points
|
||||
const int num_input_points = distance(first, beyond);
|
||||
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);
|
||||
CGAL_TRACE(" Creates KD-tree\n");
|
||||
|
|
@ -339,7 +339,7 @@ create_riemannian_graph(
|
|||
Riemannian_graph_weight_map riemannian_graph_weight_map = get(boost::edge_weight, riemannian_graph);
|
||||
for (ForwardIterator it = first; it != beyond; it++)
|
||||
{
|
||||
unsigned int it_index = get(index_pmap,it);
|
||||
std::size_t it_index = get(index_pmap,it);
|
||||
Vector it_normal_vector = get(normal_pmap,it);
|
||||
|
||||
// Gather set of (k+1) neighboring points.
|
||||
|
|
@ -350,13 +350,13 @@ create_riemannian_graph(
|
|||
Point_vertex_handle_3 point_wrapper(point.x(), point.y(), point.z(), it);
|
||||
Neighbor_search search(*tree, point_wrapper, k+1);
|
||||
Search_iterator search_iterator = search.begin();
|
||||
for(unsigned int i=0;i<(k+1);i++)
|
||||
for(std::size_t i=0;i<(k+1);i++)
|
||||
{
|
||||
if(search_iterator == search.end())
|
||||
break; // premature ending
|
||||
|
||||
ForwardIterator neighbor = search_iterator->first;
|
||||
unsigned int neighbor_index = get(index_pmap,neighbor);
|
||||
std::size_t neighbor_index = get(index_pmap,neighbor);
|
||||
if (neighbor_index > it_index) // undirected graph
|
||||
{
|
||||
// Add edge
|
||||
|
|
@ -437,13 +437,13 @@ create_mst_graph(
|
|||
CGAL_point_set_processing_precondition(first != beyond);
|
||||
|
||||
// Number of input points
|
||||
const int num_input_points = boost::num_vertices(riemannian_graph);
|
||||
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);
|
||||
CGAL_TRACE(" Calls boost::prim_minimum_spanning_tree()\n");
|
||||
|
||||
// Computes Minimum Spanning Tree.
|
||||
unsigned int source_point_index = get(index_pmap, source_point);
|
||||
std::size_t source_point_index = get(index_pmap, source_point);
|
||||
Riemannian_graph_weight_map riemannian_graph_weight_map = get(boost::edge_weight, riemannian_graph);
|
||||
typedef std::vector<typename Riemannian_graph::vertex_descriptor> PredecessorMap;
|
||||
PredecessorMap predecessor(num_input_points);
|
||||
|
|
@ -469,7 +469,7 @@ create_mst_graph(
|
|||
mst_graph[v].is_oriented = (it == source_point);
|
||||
}
|
||||
// add edges
|
||||
for (unsigned int i=0; i < predecessor.size(); i++) // add edges
|
||||
for (std::size_t i=0; i < predecessor.size(); i++) // add edges
|
||||
{
|
||||
if (i != predecessor[i])
|
||||
{
|
||||
|
|
@ -592,7 +592,7 @@ mst_orient_normals(
|
|||
|
||||
// Traverse the point set along the MST to propagate source_point's orientation
|
||||
Propagate_normal_orientation<ForwardIterator, NormalPMap, Kernel> orienter;
|
||||
unsigned int source_point_index = get(index_pmap, source_point);
|
||||
std::size_t source_point_index = get(index_pmap, source_point);
|
||||
boost::breadth_first_search(mst_graph,
|
||||
boost::vertex(source_point_index, mst_graph), // source
|
||||
visitor(boost::make_bfs_visitor(orienter)));
|
||||
|
|
@ -601,7 +601,7 @@ mst_orient_normals(
|
|||
std::deque<Enriched_point> oriented_points, unoriented_points;
|
||||
for (ForwardIterator it = first; it != beyond; it++)
|
||||
{
|
||||
unsigned int it_index = get(index_pmap,it);
|
||||
std::size_t it_index = get(index_pmap,it);
|
||||
typename MST_graph::vertex_descriptor v = boost::vertex(it_index, mst_graph);
|
||||
if (mst_graph[v].is_oriented)
|
||||
oriented_points.push_back(*it);
|
||||
|
|
|
|||
|
|
@ -65,8 +65,8 @@ random_simplify_point_set(
|
|||
std::random_shuffle (first, beyond);
|
||||
|
||||
// Computes first iterator to remove
|
||||
int nb_points = std::distance(first, beyond);
|
||||
int first_index_to_remove = int(double(nb_points) * ((100.0-removed_percentage)/100.0));
|
||||
std::size_t nb_points = std::distance(first, beyond);
|
||||
std::size_t first_index_to_remove = (std::size_t)(double(nb_points) * ((100.0-removed_percentage)/100.0));
|
||||
ForwardIterator first_point_to_remove = first;
|
||||
std::advance(first_point_to_remove, first_index_to_remove);
|
||||
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ typedef Tr::Point Point_3;
|
|||
namespace {
|
||||
void CGALglcolor(QColor c)
|
||||
{
|
||||
::glColor4f(c.red()/255.0, c.green()/255.0, c.blue()/255.0, c.alpha()/255.0);
|
||||
::glColor4d(c.red()/255.0, c.green()/255.0, c.blue()/255.0, c.alpha()/255.0);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -318,9 +318,9 @@ Scene_item* cgal_code_mesh_3(const Polyhedron* pMesh,
|
|||
std::ofstream medit_out("out.mesh");
|
||||
new_item->c3t3().output_to_medit(medit_out);
|
||||
const Scene_item::Bbox& bbox = new_item->bbox();
|
||||
new_item->setPosition((bbox.xmin + bbox.xmax)/2.f,
|
||||
(bbox.ymin + bbox.ymax)/2.f,
|
||||
(bbox.zmin + bbox.zmax)/2.f);
|
||||
new_item->setPosition((float)(bbox.xmin + bbox.xmax)/2.f,
|
||||
(float)(bbox.ymin + bbox.ymax)/2.f,
|
||||
(float)(bbox.zmin + bbox.zmax)/2.f);
|
||||
return new_item;
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
|
|
@ -47,12 +47,12 @@ void Polyhedron_demo_mesh_simplification_plugin::on_actionSimplify_triggered()
|
|||
|
||||
// get option (#edges)
|
||||
bool ok;
|
||||
const unsigned int nb_edges =
|
||||
const int nb_edges =
|
||||
QInputDialog::getInteger(mw, tr("Stop condition"),
|
||||
tr("Number of edges:"),
|
||||
pMesh->size_of_halfedges () / 4, // default value: current #edges / 2
|
||||
(int)(pMesh->size_of_halfedges () / 4), // default value: current #edges / 2
|
||||
3, // min = one triangle
|
||||
pMesh->size_of_halfedges(), // max #edges
|
||||
(int)pMesh->size_of_halfedges(), // max #edges
|
||||
1, // step for the spinbox
|
||||
&ok);
|
||||
|
||||
|
|
|
|||
|
|
@ -169,7 +169,7 @@ void Polyhedron_demo_normal_estimation_plugin::on_actionNormalEstimation_trigger
|
|||
CGAL::make_normal_of_point_with_normal_pmap(points->begin()),
|
||||
dialog.orientationNbNeighbors());
|
||||
|
||||
int nb_unoriented_normals = std::distance(first_unoriented_point, points->end());
|
||||
std::size_t nb_unoriented_normals = std::distance(first_unoriented_point, points->end());
|
||||
long 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, "
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ void Polyhedron_demo_point_set_outliers_removal_plugin::on_actionOutlierRemoval_
|
|||
nb_neighbors,
|
||||
removed_percentage);
|
||||
|
||||
int nb_points_to_remove = std::distance(first_point_to_remove, points->end());
|
||||
std::size_t nb_points_to_remove = std::distance(first_point_to_remove, points->end());
|
||||
long memory = CGAL::Memory_sizer().virtual_size();
|
||||
std::cerr << "Simplification: " << nb_points_to_remove << " point(s) are selected ("
|
||||
<< task_timer.time() << " seconds, "
|
||||
|
|
|
|||
|
|
@ -57,8 +57,8 @@ class Point_set_demo_point_set_simplification_dialog : public QDialog, private U
|
|||
}
|
||||
|
||||
QString simplificationMethod() const { return m_simplificationMethod->currentText(); }
|
||||
float randomSimplificationPercentage() const { return m_randomSimplificationPercentage->value(); }
|
||||
float gridCellSize() const { return m_gridCellSize->value(); }
|
||||
double randomSimplificationPercentage() const { return m_randomSimplificationPercentage->value(); }
|
||||
double gridCellSize() const { return m_gridCellSize->value(); }
|
||||
};
|
||||
|
||||
void Polyhedron_demo_point_set_simplification_plugin::on_actionSimplify_triggered()
|
||||
|
|
@ -111,7 +111,7 @@ void Polyhedron_demo_point_set_simplification_plugin::on_actionSimplify_triggere
|
|||
dialog.gridCellSize()*average_spacing);
|
||||
}
|
||||
|
||||
int nb_points_to_remove = std::distance(first_point_to_remove, points->end());
|
||||
std::size_t nb_points_to_remove = std::distance(first_point_to_remove, points->end());
|
||||
long memory = CGAL::Memory_sizer().virtual_size();
|
||||
std::cerr << "Simplification: " << nb_points_to_remove << " point(s) are selected for removal ("
|
||||
<< task_timer.time() << " seconds, "
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ private:
|
|||
namespace {
|
||||
void CGALglcolor(QColor c)
|
||||
{
|
||||
::glColor4f(c.red()/255.0, c.green()/255.0, c.blue()/255.0, c.alpha()/255.0);
|
||||
::glColor4d(c.red()/255.0, c.green()/255.0, c.blue()/255.0, c.alpha()/255.0);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -311,7 +311,7 @@ Scene_item* cgal_code_remesh(QWidget* parent,
|
|||
triangulation.dimension() < 3 );
|
||||
n = triangulation.number_of_vertices())
|
||||
{
|
||||
const int pos = CGAL::default_random.get_int(0, polyhedron_points.size());
|
||||
const int pos = CGAL::default_random.get_int(0, (int)polyhedron_points.size());
|
||||
triangulation.insert(polyhedron_points[pos]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -88,14 +88,14 @@ void Scene_combinatorial_map_item::export_as_polyhedron(Predicate pred,const QSt
|
|||
struct Select_volume{
|
||||
static const bool only_one_run=true;
|
||||
static const bool swap_orientation=false;
|
||||
Select_volume(int i):volume_to_select(i),index(0){}
|
||||
Select_volume(std::size_t i):volume_to_select(i),index(0){}
|
||||
template <class Dart_handle>
|
||||
bool operator() (Dart_handle){
|
||||
return ++index==volume_to_select;
|
||||
}
|
||||
private:
|
||||
int volume_to_select;
|
||||
int index;
|
||||
std::size_t volume_to_select;
|
||||
std::size_t index;
|
||||
};
|
||||
|
||||
void Scene_combinatorial_map_item::export_current_volume_as_polyhedron() const {
|
||||
|
|
@ -227,7 +227,7 @@ void Scene_combinatorial_map_item::direct_draw() const {
|
|||
typedef Combinatorial_map_3::Dart_of_orbit_const_range<1> Dart_in_facet_range;
|
||||
Volume_dart_range dart_per_volume_range = combinatorial_map().one_dart_per_cell<3>();
|
||||
|
||||
int index = 0;
|
||||
std::size_t index = 0;
|
||||
for (Volume_dart_range::const_iterator vit=dart_per_volume_range.begin();vit!=dart_per_volume_range.end();++vit)
|
||||
{
|
||||
if (++index!=volume_to_display && volume_to_display!=0) continue;
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ public:
|
|||
private:
|
||||
Kernel::Vector_3 compute_face_normal(Combinatorial_map_3::Dart_const_handle adart) const;
|
||||
Scene_interface* last_known_scene;
|
||||
int volume_to_display;
|
||||
std::size_t volume_to_display;
|
||||
QAction* exportSelectedVolume;
|
||||
void* address_of_A;
|
||||
template <class Predicate> void export_as_polyhedron(Predicate,const QString&) const;
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ namespace {
|
|||
c = c.darker(dv);
|
||||
#undef darker
|
||||
}
|
||||
::glColor4f(c.red()/255.0, c.green()/255.0, c.blue()/255.0, c.alpha()/255.0);
|
||||
::glColor4d(c.red()/255.0, c.green()/255.0, c.blue()/255.0, c.alpha()/255.0);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ namespace {
|
|||
c = c.darker(dv);
|
||||
#undef darker
|
||||
}
|
||||
::glColor4f(c.red()/255.0, c.green()/255.0, c.blue()/255.0, c.alpha()/255.0);
|
||||
::glColor4d(c.red()/255.0, c.green()/255.0, c.blue()/255.0, c.alpha()/255.0);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ private:
|
|||
mutable Point m_barycenter; // point set's barycenter
|
||||
mutable FT m_diameter_standard_deviation; // point set's standard deviation
|
||||
|
||||
unsigned int m_nb_selected_points; // number of selected points
|
||||
std::size_t m_nb_selected_points; // number of selected points
|
||||
|
||||
bool m_radii_are_uptodate;
|
||||
|
||||
|
|
@ -108,7 +108,7 @@ public:
|
|||
/// @endcond
|
||||
|
||||
/// Gets the number of selected points.
|
||||
unsigned int nb_selected_points() const { return m_nb_selected_points; }
|
||||
std::size_t nb_selected_points() const { return m_nb_selected_points; }
|
||||
|
||||
/// Mark a point as selected/not selected.
|
||||
void select(UI_point* point, bool is_selected = true)
|
||||
|
|
@ -346,7 +346,7 @@ private:
|
|||
FT sq_radius = 0;
|
||||
for (Point_const_iterator it = begin(); it != end(); it++)
|
||||
sq_radius += sqd(*it, m_barycenter);
|
||||
sq_radius /= size();
|
||||
sq_radius /= FT(size());
|
||||
m_diameter_standard_deviation = CGAL::sqrt(sq_radius);
|
||||
|
||||
m_bounding_box_is_valid = true;
|
||||
|
|
|
|||
|
|
@ -570,7 +570,7 @@ begin_surface( std::size_t v, std::size_t f, std::size_t h, int mode) {
|
|||
// not know the number of facets that are holes and we do not
|
||||
// know the genus of the surface. So we add 12 and a factor of
|
||||
// 5 percent.
|
||||
h = int((v + f - 2 + 12) * 2.1);
|
||||
h = (std::size_t)((double)(v + f - 2 + 12) * 2.1);
|
||||
}
|
||||
hds.reserve( hds.size_of_vertices() + v,
|
||||
hds.size_of_halfedges() + h,
|
||||
|
|
|
|||
|
|
@ -274,7 +274,7 @@ std::istream &operator>>(std::istream &is, Color& col)
|
|||
std::cerr << "Stream must be in ascii or binary mode" << std::endl;
|
||||
break;
|
||||
}
|
||||
col = Color(r,g,b);
|
||||
col = Color((unsigned char)r,(unsigned char)g,(unsigned char)b);
|
||||
return is;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -237,9 +237,9 @@ public:
|
|||
if (n == 6) {
|
||||
pt = Point((10*S[0]+R[0])/16, (10*S[1]+R[1])/16, (10*S[2]+R[2])/16);
|
||||
} else {
|
||||
FT Cn = (FT) (5.0/8.0 - std::sqrt(3+2*std::cos(6.283/n))/64.0);
|
||||
FT Sw = n*(1-Cn)/Cn;
|
||||
FT W = n/Cn;
|
||||
FT Cn = (FT) (5.0/8.0 - std::sqrt(3+2*std::cos(6.283/(double)n))/64.0);
|
||||
FT Sw = (double)n*(1-Cn)/Cn;
|
||||
FT W = (double)n/Cn;
|
||||
pt = Point((Sw*S[0]+R[0])/W, (Sw*S[1]+R[1])/W, (Sw*S[2]+R[2])/W);
|
||||
}
|
||||
}
|
||||
|
|
@ -358,11 +358,11 @@ public:
|
|||
Halfedge_around_vertex_circulator vcir = vertex->vertex_begin();
|
||||
size_t n = circulator_size(vcir);
|
||||
|
||||
FT a = (FT) ((4.0-2.0*std::cos(2.0*CGAL_PI/n))/9.0);
|
||||
FT a = (FT) ((4.0-2.0*std::cos(2.0*CGAL_PI/(double)n))/9.0);
|
||||
|
||||
Vector cv = ((FT)(1.0-a)) * (vertex->point() - CGAL::ORIGIN);
|
||||
for (size_t i = 1; i <= n; ++i, --vcir) {
|
||||
cv = cv + (a/n)*(vcir->opposite()->vertex()->point()-CGAL::ORIGIN);
|
||||
cv = cv + (a/FT(n))*(vcir->opposite()->vertex()->point()-CGAL::ORIGIN);
|
||||
}
|
||||
|
||||
pt = CGAL::ORIGIN + cv;
|
||||
|
|
|
|||
Loading…
Reference in New Issue