Fix conversion warnings in the Surface_mesher testsuite

This commit is contained in:
Laurent Rineau 2019-09-04 10:36:17 +02:00
parent 64bc3bc96e
commit 084d534949
4 changed files with 10 additions and 10 deletions

View File

@ -72,9 +72,9 @@ read_vtk_image_data(vtkImageData* vtk_image, Image_3::Own owning = Image_3::OWN_
image->vx = spacing[0]; image->vx = spacing[0];
image->vy = spacing[1]; image->vy = spacing[1];
image->vz = spacing[2]; image->vz = spacing[2];
image->tx = offset[0]; image->tx = static_cast<float>(offset[0]);
image->ty = offset[1]; image->ty = static_cast<float>(offset[1]);
image->tz = offset[2]; image->tz = static_cast<float>(offset[2]);
image->endianness = ::_getEndianness(); image->endianness = ::_getEndianness();
int vtk_type = vtk_image->GetScalarType(); int vtk_type = vtk_image->GetScalarType();
if(vtk_type == VTK_SIGNED_CHAR) vtk_type = VTK_CHAR; if(vtk_type == VTK_SIGNED_CHAR) vtk_type = VTK_CHAR;

View File

@ -162,14 +162,14 @@ QString Values_list::name(const int i) const
bool Values_list::enabled(const int i) const bool Values_list::enabled(const int i) const
{ {
if(i < 0 || i > treeWidget->topLevelItemCount()) if(i < 0 || i > treeWidget->topLevelItemCount())
return 0.; return false;
else else
return treeWidget->topLevelItem(i)->data(Value, Qt::CheckStateRole).toDouble(); return treeWidget->topLevelItem(i)->data(Value, Qt::CheckStateRole).toInt() > 0;
} }
bool Values_list::enabled(const QTreeWidgetItem* item) const bool Values_list::enabled(const QTreeWidgetItem* item) const
{ {
return item->data(Value, Qt::CheckStateRole).toDouble(); return item->data(Value, Qt::CheckStateRole).toInt() > 0;
} }
const QTreeWidgetItem* Values_list::item(const int i) const const QTreeWidgetItem* Values_list::item(const int i) const

View File

@ -88,7 +88,7 @@ public:
} }
result_type result = 0; result_type result = 0;
// std::cerr << "isovalues: "; // std::cerr << "isovalues: ";
for(int i = 1, end = static_cast<int>(isovalues->size()); i <= end; ++i) for(result_type i = 1, end = static_cast<result_type>(isovalues->size()); i <= end; ++i)
{ {
// std::cerr << (*isovalues)[i-1] << ", "; // std::cerr << (*isovalues)[i-1] << ", ";
if(value >= (*isovalues)[i-1].first && if(value >= (*isovalues)[i-1].first &&
@ -479,7 +479,7 @@ bool Volume::open_xt(const QString& filename)
return false; return false;
} }
vtk_reader->SetHeaderSize(header_size); vtk_reader->SetHeaderSize(header_size);
vtk_reader->SetDataExtent(1, dimx, 1, dimy, 1, dimz); vtk_reader->SetDataExtent(1, int(dimx), 1, int(dimy), 1, int(dimz));
vtk_reader->SetDataSpacing(1., 1., 1.); vtk_reader->SetDataSpacing(1., 1., 1.);
vtk_reader->SetFileDimensionality(3); vtk_reader->SetFileDimensionality(3);
vtk_reader->Update(); vtk_reader->Update();
@ -1421,7 +1421,7 @@ void Volume::gl_draw_surface()
} }
else else
{ {
const unsigned char volume_index = values_list->value(i); const auto volume_index = static_cast<unsigned char>(values_list->value(i));
::glBegin(GL_TRIANGLES); ::glBegin(GL_TRIANGLES);
unsigned int counter = 0; unsigned int counter = 0;

View File

@ -287,7 +287,7 @@ void Volume::search_for_connected_components(PointsOutputIterator it,
* Second pass is a BFS initialized with all voxel of the border. * Second pass is a BFS initialized with all voxel of the border.
* The last voxel of that BFS is used as the seed. * The last voxel of that BFS is used as the seed.
*/ */
int pass = 1; // pass will be equal to 2 in second pass Marker pass = 1; // pass will be equal to 2 in second pass
Indices bbox_min = indices; Indices bbox_min = indices;
Indices bbox_max = indices; Indices bbox_max = indices;