From 3df99c16bec967e81ec685cc888a8e18627a0e0c Mon Sep 17 00:00:00 2001 From: Filip Sykala - NTB T15p Date: Tue, 29 Oct 2024 14:30:52 +0100 Subject: [PATCH] =?UTF-8?q?Fix=20warnings:=20=E2=9A=A0=EF=B8=8F=20../src/l?= =?UTF-8?q?ibslic3r/SLA/SupportIslands/SampleIslandUtils.cpp:1495:68:=20wa?= =?UTF-8?q?rning:=20lambda=20capture=20'tiny=5Fdone'=20is=20not=20used=20[?= =?UTF-8?q?-Wunused-lambda-capture]=20=E2=9A=A0=EF=B8=8F=20../src/libslic3?= =?UTF-8?q?r/SLA/SupportIslands/SampleIslandUtils.cpp:1830:23:=20warning:?= =?UTF-8?q?=20unused=20variable=20'line'=20[-Wunused-variable]=20=E2=9A=A0?= =?UTF-8?q?=EF=B8=8F=20../src/libslic3r/SLA/SupportIslands/SampleIslandUti?= =?UTF-8?q?ls.cpp:624:6:=20warning:=20unused=20function=20'is=5Fpoints=5Fi?= =?UTF-8?q?n=5Fdistance'=20[-Wunused-function]=20=E2=9A=A0=EF=B8=8F=20../s?= =?UTF-8?q?rc/libslic3r/SLA/SupportIslands/VoronoiDiagramCGAL.cpp:37:7:=20?= =?UTF-8?q?warning:=20unused=20function=20'to=5Fpoint=5Fd'=20[-Wunused-fun?= =?UTF-8?q?ction]=20=E2=9A=A0=EF=B8=8F=20../src/libslic3r/SLA/SupportPoint?= =?UTF-8?q?Generator.cpp:359:6:=20warning:=20unused=20function=20'exist=5F?= =?UTF-8?q?same=5Fpoints'=20[-Wunused-function]=20=E2=9A=A0=EF=B8=8F=20../?= =?UTF-8?q?src/slic3r/GUI/Gizmos/GLGizmoSlaSupports.cpp:813:27:=20warning:?= =?UTF-8?q?=20using=20the=20result=20of=20an=20assignment=20as=20a=20condi?= =?UTF-8?q?tion=20without=20parentheses=20[-Wparentheses]=20=E2=9A=A0?= =?UTF-8?q?=EF=B8=8F=20../src/slic3r/GUI/Gizmos/GLGizmoSlaSupports.cpp:892?= =?UTF-8?q?:146:=20warning:=20format=20specifies=20type=20'int'=20but=20th?= =?UTF-8?q?e=20argument=20has=20type=20'size=5Ft'=20(aka=20'unsigned=20lon?= =?UTF-8?q?g')=20[-Wformat]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/libslic3r/SLA/SupportIslands/SampleIslandUtils.cpp | 5 +++-- src/libslic3r/SLA/SupportIslands/SupportIslandPoint.hpp | 4 ++-- src/libslic3r/SLA/SupportIslands/VoronoiDiagramCGAL.cpp | 7 ++----- src/libslic3r/SLA/SupportPointGenerator.cpp | 2 ++ src/slic3r/GUI/Gizmos/GLGizmoSlaSupports.cpp | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/libslic3r/SLA/SupportIslands/SampleIslandUtils.cpp b/src/libslic3r/SLA/SupportIslands/SampleIslandUtils.cpp index 99de7a2659..7e6b77b271 100644 --- a/src/libslic3r/SLA/SupportIslands/SampleIslandUtils.cpp +++ b/src/libslic3r/SLA/SupportIslands/SampleIslandUtils.cpp @@ -620,6 +620,7 @@ void SampleIslandUtils::align_samples(SupportIslandPoints &samples, } +#ifndef NDEBUG namespace { bool is_points_in_distance(const Slic3r::Point & p, const Slic3r::Points &points, @@ -633,6 +634,7 @@ bool is_points_in_distance(const Slic3r::Point & p, return true; } } // namespace +#endif // NDEBUG coord_t SampleIslandUtils::align_once( SupportIslandPoints &samples, @@ -1492,7 +1494,7 @@ SampleIslandUtils::Field SampleIslandUtils::create_field( // Prepare data for field outline, // when field transit into tiny part of island - auto add_wide_tiny_change_only = [&wide_tiny_changes, &lines, &tiny_done] + auto add_wide_tiny_change_only = [&wide_tiny_changes, &lines] (const VoronoiGraph::Position &position){ Point p1, p2; std::tie(p1, p2) = VoronoiGraphUtils::point_on_lines(position, lines); @@ -1827,7 +1829,6 @@ SupportIslandPoints SampleIslandUtils::sample_outline( using RestrictionPtr = std::shared_ptr; auto add_sample = [&](size_t index, const RestrictionPtr& restriction, coord_t &last_support) { using Position = SupportOutlineIslandPoint::Position; - const Line & line = restriction->lines[index]; const double &line_length_double = restriction->lengths[index]; coord_t line_length = static_cast(std::round(line_length_double)); if (last_support + line_length > sample_distance) { diff --git a/src/libslic3r/SLA/SupportIslands/SupportIslandPoint.hpp b/src/libslic3r/SLA/SupportIslands/SupportIslandPoint.hpp index 2348b84b5f..56ea11e244 100644 --- a/src/libslic3r/SLA/SupportIslands/SupportIslandPoint.hpp +++ b/src/libslic3r/SLA/SupportIslands/SupportIslandPoint.hpp @@ -100,7 +100,7 @@ public: /// Can move? /// /// FALSE - virtual bool can_move() const override { return false; } + bool can_move() const override { return false; } /// /// No move! @@ -108,7 +108,7 @@ public: /// /// Wanted position /// No move means zero distance - virtual coord_t move(const Point &destination) { return 0; } + coord_t move(const Point &destination) override { return 0; } }; /// diff --git a/src/libslic3r/SLA/SupportIslands/VoronoiDiagramCGAL.cpp b/src/libslic3r/SLA/SupportIslands/VoronoiDiagramCGAL.cpp index 20ab3761d3..69203ddeab 100644 --- a/src/libslic3r/SLA/SupportIslands/VoronoiDiagramCGAL.cpp +++ b/src/libslic3r/SLA/SupportIslands/VoronoiDiagramCGAL.cpp @@ -34,11 +34,8 @@ using Halfedge_handle = VD::Halfedge_handle; using Ccb_halfedge_circulator = VD::Ccb_halfedge_circulator; namespace{ -Vec2d to_point_d(const Site_2 &s) { return {s.x(), s.y()}; } -Slic3r::Point to_point(const Site_2 &s) { - // conversion from double to coor_t - return Slic3r::Point(s.x(), s.y()); -} +// conversion from double to coor_t +Slic3r::Point to_point(const Site_2 &s) { return Slic3r::Point(s.x(), s.y()); } /// /// Create line segment lay between given points with distance limited by maximal_distance diff --git a/src/libslic3r/SLA/SupportPointGenerator.cpp b/src/libslic3r/SLA/SupportPointGenerator.cpp index 5f3f3746dd..ba05a4497f 100644 --- a/src/libslic3r/SLA/SupportPointGenerator.cpp +++ b/src/libslic3r/SLA/SupportPointGenerator.cpp @@ -356,6 +356,7 @@ bool contain_point(const Point &p, const Points &sorted_points) { return it->x() == p.x() && it->y() == p.y(); }; +#ifndef NDEBUG bool exist_same_points(const ExPolygon &shape, const Points& prev_points) { auto shape_points = to_points(shape); return shape_points.end() != @@ -363,6 +364,7 @@ bool exist_same_points(const ExPolygon &shape, const Points& prev_points) { return contain_point(p, prev_points); }); } +#endif // NDEBUG Points sample_overhangs(const LayerPart& part, double dist2) { const ExPolygon &shape = *part.shape; diff --git a/src/slic3r/GUI/Gizmos/GLGizmoSlaSupports.cpp b/src/slic3r/GUI/Gizmos/GLGizmoSlaSupports.cpp index cb258b18e7..cf8640a9a1 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoSlaSupports.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoSlaSupports.cpp @@ -817,7 +817,7 @@ void GLGizmoSlaSupports::draw_island_config() { #ifdef OPTION_TO_STORE_ISLAND bool store_islands = !sample_config.path.empty(); if (ImGui::Checkbox("StoreIslands", &store_islands)) { - if (store_islands = true) + if (store_islands == true) sample_config.path = "C:/data/temp/island<>.svg"; } else if (ImGui::IsItemHovered()) ImGui::SetTooltip("Store islands in file\n<> is replaced by island order number"); @@ -896,7 +896,7 @@ void GLGizmoSlaSupports::draw_island_config() { ImGui::SetTooltip("Minimal width to be supported by outline\nMust be smaller or equal to thin max width(to make hysteresis)"); ImGui::Text("head radius is set to %.2f", unscale(sample_config.head_radius)); - ImGui::Text("Alignment stop criteria: min_move(%.0f um), iter(%d x), max_VD_move(%.2f mm)", unscale(sample_config.minimal_move)*1000, sample_config.count_iteration, + ImGui::Text("Alignment stop criteria: min_move(%.0f um), iter(%d x), max_VD_move(%.2f mm)", unscale(sample_config.minimal_move)*1000, (int)sample_config.count_iteration, unscale(sample_config.max_align_distance) );