Mesh_3: Fix other conversion warnings

This commit is contained in:
Laurent Rineau 2016-09-29 14:39:01 +02:00
parent a9840bf87c
commit 7dbc756d42
7 changed files with 20 additions and 20 deletions

View File

@ -1622,7 +1622,7 @@ float triLinInterp(const _image* image,
posz = static_cast<float>(posz /(image->vz)); posz = static_cast<float>(posz /(image->vz));
//patch suggested by J.Cugnoni to prevent integer overflow //patch suggested by J.Cugnoni to prevent integer overflow
if(posz >= dimz-1 || posy >= dimy-1 || posx >= dimx-1) if(posz >= float(dimz-1) || posy >= float(dimy-1) || posx >= float(dimx-1))
return value_outside; return value_outside;
const int i1 = (int)(posz); const int i1 = (int)(posz);

View File

@ -257,9 +257,9 @@ Image_3::trilinear_interpolation(const Coord_type& x,
if(lx < 0 || if(lx < 0 ||
ly < 0 || ly < 0 ||
lz < 0 || lz < 0 ||
lz >= dimz-1 || lz >= Coord_type(dimz-1) ||
ly >= dimy-1 || ly >= Coord_type(dimy-1) ||
lx >= dimx-1) lx >= Coord_type(dimx-1))
{ {
return value_outside; return value_outside;
} }
@ -448,9 +448,9 @@ Image_3::labellized_trilinear_interpolation
if( lx < 0 || if( lx < 0 ||
ly < 0 || ly < 0 ||
lz < 0 || lz < 0 ||
lz >= dimz-1 || lz >= Coord_type(dimz-1) ||
ly >= dimy-1 || ly >= Coord_type(dimy-1) ||
lx >= dimx-1) lx >= Coord_type(dimx-1))
{ {
return value_outside; return value_outside;
} }

View File

@ -46,49 +46,49 @@ struct VTK_type_generator {
template <> template <>
struct VTK_type_generator<double> { struct VTK_type_generator<double> {
static const vtkIdType type = VTK_DOUBLE; static const int type = VTK_DOUBLE;
typedef vtkDoubleArray ArrayType; typedef vtkDoubleArray ArrayType;
}; };
template <> template <>
struct VTK_type_generator<float> { struct VTK_type_generator<float> {
static const vtkIdType type = VTK_FLOAT; static const int type = VTK_FLOAT;
typedef vtkFloatArray ArrayType; typedef vtkFloatArray ArrayType;
}; };
template <> template <>
struct VTK_type_generator<char> { struct VTK_type_generator<char> {
static const vtkIdType type = VTK_CHAR; static const int type = VTK_CHAR;
typedef vtkCharArray ArrayType; typedef vtkCharArray ArrayType;
}; };
template <> template <>
struct VTK_type_generator<boost::uint8_t> { struct VTK_type_generator<boost::uint8_t> {
static const vtkIdType type = VTK_UNSIGNED_CHAR; static const int type = VTK_UNSIGNED_CHAR;
typedef vtkUnsignedCharArray ArrayType; typedef vtkUnsignedCharArray ArrayType;
}; };
template <> template <>
struct VTK_type_generator<boost::int16_t> { struct VTK_type_generator<boost::int16_t> {
static const vtkIdType type = VTK_SHORT; static const int type = VTK_SHORT;
typedef vtkShortArray ArrayType; typedef vtkShortArray ArrayType;
}; };
template <> template <>
struct VTK_type_generator<boost::uint16_t> { struct VTK_type_generator<boost::uint16_t> {
static const vtkIdType type = VTK_UNSIGNED_SHORT; static const int type = VTK_UNSIGNED_SHORT;
typedef vtkUnsignedShortArray ArrayType; typedef vtkUnsignedShortArray ArrayType;
}; };
template <> template <>
struct VTK_type_generator<boost::int32_t> { struct VTK_type_generator<boost::int32_t> {
static const vtkIdType type = VTK_INT; static const int type = VTK_INT;
typedef vtkIntArray ArrayType; typedef vtkIntArray ArrayType;
}; };
template <> template <>
struct VTK_type_generator<boost::uint32_t> { struct VTK_type_generator<boost::uint32_t> {
static const vtkIdType type = VTK_UNSIGNED_INT; static const int type = VTK_UNSIGNED_INT;
typedef vtkUnsignedIntArray ArrayType; typedef vtkUnsignedIntArray ArrayType;
}; };
@ -96,7 +96,7 @@ struct VTK_type_generator<boost::uint32_t> {
{ {
vtkImageData* vtk_image = vtkImageData::New(); vtkImageData* vtk_image = vtkImageData::New();
vtkDataArray* data_array = 0; vtkDataArray* data_array = 0;
vtkIdType type = 0; int type = 0;
_image* image_ptr = image.image(); _image* image_ptr = image.image();

View File

@ -733,7 +733,7 @@ operator()(int nb_iterations, Visitor visitor)
//Pb with Freeze : sometimes a few vertices continue moving indefinitely //Pb with Freeze : sometimes a few vertices continue moving indefinitely
//if the nb of moving vertices is < 1% of total nb AND does not decrease //if the nb of moving vertices is < 1% of total nb AND does not decrease
if(do_freeze_ if(do_freeze_
&& nb_vertices_moved < 0.005 * double(initial_vertices_nb) && double(nb_vertices_moved) < 0.005 * double(initial_vertices_nb)
&& nb_vertices_moved == moving_vertices.size()) && nb_vertices_moved == moving_vertices.size())
{ {
// we should stop because we are // we should stop because we are

View File

@ -342,7 +342,7 @@ public:
double time() const { return timer().time(); } double time() const { return timer().time(); }
int total_counter() const { return total_counter_ + counter(); } int total_counter() const { return total_counter_ + counter(); }
std::size_t total_time() const std::size_t total_time() const
{ return static_cast<std::size_t>(total_time_ + 1000*time()); } { return static_cast<std::size_t>(double(total_time_) + 1000*time()); }
virtual std::string perturbation_name() const = 0; virtual std::string perturbation_name() const = 0;
private: private:
CGAL::Timer &timer() const CGAL::Timer &timer() const

View File

@ -393,7 +393,7 @@ std::istream& operator>>( std::istream& in, File_header_OFF& h) {
// facets and we do not know the genus of the surface. // facets and we do not know the genus of the surface.
// So we add 12 and a factor of 5 percent. // So we add 12 and a factor of 5 percent.
if ( h.size_of_halfedges() == 0 if ( h.size_of_halfedges() == 0
|| h.size_of_halfedges() > double(h.size_of_vertices() || double(h.size_of_halfedges()) > double(h.size_of_vertices()
+ h.size_of_facets() - 2 + 12) * 2.1 + h.size_of_facets() - 2 + 12) * 2.1
|| h.size_of_halfedges() < (h.size_of_vertices() || h.size_of_halfedges() < (h.size_of_vertices()
+ h.size_of_facets() - 2) * 2 + h.size_of_facets() - 2) * 2

View File

@ -63,7 +63,7 @@ int File_header_extended_OFF::
is_CBPn() const { is_CBPn() const {
if ( is_POL() && triangulated() && non_empty_facets() && if ( is_POL() && triangulated() && non_empty_facets() &&
normalized_to_sphere() && rounded() && normalized_to_sphere() && rounded() &&
(radius() <= ( 1l << rounded_bits()))) (radius() <= double( 1l << rounded_bits())))
return rounded_bits(); return rounded_bits();
else else
return 0; return 0;