mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-08 18:09:04 +08:00
Fix warnings in tests caused by integer conversions
This commit is contained in:
parent
621ec86dbe
commit
e44524f1cd
@ -134,7 +134,7 @@ struct CellGridTracer2D_AllDirs {
|
|||||||
template<class Fn>
|
template<class Fn>
|
||||||
void foreach_reachable(const Vec2i &src, Fn &&fn) const
|
void foreach_reachable(const Vec2i &src, Fn &&fn) const
|
||||||
{
|
{
|
||||||
auto is_inside = [](const Vec2i& v) { return v.x() >= 0 && v.x() < Cols && v.y() >= 0 && v.y() < Rows; };
|
auto is_inside = [](const Vec2i& v) { return v.x() >= 0 && v.x() < int(Cols) && v.y() >= 0 && v.y() < int(Rows); };
|
||||||
if (Vec2i crd = src + Vec2i{0, 1}; is_inside(crd) && grid[crd.y()] [crd.x()] == ON) fn(crd);
|
if (Vec2i crd = src + Vec2i{0, 1}; is_inside(crd) && grid[crd.y()] [crd.x()] == ON) fn(crd);
|
||||||
if (Vec2i crd = src + Vec2i{1, 0}; is_inside(crd) && grid[crd.y()] [crd.x()] == ON) fn(crd);
|
if (Vec2i crd = src + Vec2i{1, 0}; is_inside(crd) && grid[crd.y()] [crd.x()] == ON) fn(crd);
|
||||||
if (Vec2i crd = src + Vec2i{1, 1}; is_inside(crd) && grid[crd.y()] [crd.x()] == ON) fn(crd);
|
if (Vec2i crd = src + Vec2i{1, 1}; is_inside(crd) && grid[crd.y()] [crd.x()] == ON) fn(crd);
|
||||||
@ -171,7 +171,7 @@ struct CellGridTracer2D_Axis {
|
|||||||
template<class Fn>
|
template<class Fn>
|
||||||
void foreach_reachable(const Vec2i &src, Fn &&fn) const
|
void foreach_reachable(const Vec2i &src, Fn &&fn) const
|
||||||
{
|
{
|
||||||
auto is_inside = [](const Vec2i& v) { return v.x() >= 0 && v.x() < Cols && v.y() >= 0 && v.y() < Rows; };
|
auto is_inside = [](const Vec2i& v) { return v.x() >= 0 && v.x() < int(Cols) && v.y() >= 0 && v.y() < int(Rows); };
|
||||||
if (Vec2i crd = src + Vec2i{0, 1}; is_inside(crd) && grid[crd.y()] [crd.x()] == ON) fn(crd);
|
if (Vec2i crd = src + Vec2i{0, 1}; is_inside(crd) && grid[crd.y()] [crd.x()] == ON) fn(crd);
|
||||||
if (Vec2i crd = src + Vec2i{0, -1}; is_inside(crd) && grid[crd.y()] [crd.x()] == ON) fn(crd);
|
if (Vec2i crd = src + Vec2i{0, -1}; is_inside(crd) && grid[crd.y()] [crd.x()] == ON) fn(crd);
|
||||||
if (Vec2i crd = src + Vec2i{1, 0}; is_inside(crd) && grid[crd.y()] [crd.x()] == ON) fn(crd);
|
if (Vec2i crd = src + Vec2i{1, 0}; is_inside(crd) && grid[crd.y()] [crd.x()] == ON) fn(crd);
|
||||||
|
@ -31,11 +31,6 @@ static double volume(const BoundingBox3Base<Vec3f> &box)
|
|||||||
return sz.x() * sz.y() * sz.z();
|
return sz.x() * sz.y() * sz.z();
|
||||||
}
|
}
|
||||||
|
|
||||||
static double volume(const Eigen::AlignedBox<float, 3> &box)
|
|
||||||
{
|
|
||||||
return box.volume();
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST_CASE("Test kdtree query for a Box", "[KDTreeIndirect]")
|
TEST_CASE("Test kdtree query for a Box", "[KDTreeIndirect]")
|
||||||
{
|
{
|
||||||
auto vol = BoundingBox3Base<Vec3f>{{0.f, 0.f, 0.f}, {10.f, 10.f, 10.f}};
|
auto vol = BoundingBox3Base<Vec3f>{{0.f, 0.f, 0.f}, {10.f, 10.f, 10.f}};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user