Fixed some more compilation warnings.

This commit is contained in:
Vojtech Bubnik 2023-05-25 18:22:34 +02:00
parent 2079fed0ca
commit 60e13272bd
9 changed files with 15 additions and 17 deletions

View File

@ -106,15 +106,15 @@ ThickPolylines make_fill_polylines(
coord_t length_filter = scale_(4); coord_t length_filter = scale_(4);
size_t skips_allowed = 2; size_t skips_allowed = 2;
size_t min_removal_conut = 5; size_t min_removal_conut = 5;
for (int section_idx = 0; section_idx < polygon_sections.size(); section_idx++) { for (int section_idx = 0; section_idx < int(polygon_sections.size()); ++ section_idx) {
for (int line_idx = 0; line_idx < polygon_sections[section_idx].size(); line_idx++) { for (int line_idx = 0; line_idx < int(polygon_sections[section_idx].size()); ++ line_idx) {
if (const Line &line = polygon_sections[section_idx][line_idx]; line.a != line.b && line.length() < length_filter) { if (const Line &line = polygon_sections[section_idx][line_idx]; line.a != line.b && line.length() < length_filter) {
std::set<std::pair<int, int>> to_remove{{section_idx, line_idx}}; std::set<std::pair<int, int>> to_remove{{section_idx, line_idx}};
std::vector<Node> to_visit{{section_idx, line_idx}}; std::vector<Node> to_visit{{section_idx, line_idx}};
bool initial_touches_long_lines = false; bool initial_touches_long_lines = false;
if (section_idx > 0) { if (section_idx > 0) {
for (int prev_line_idx = 0; prev_line_idx < polygon_sections[section_idx - 1].size(); prev_line_idx++) { for (int prev_line_idx = 0; prev_line_idx < int(polygon_sections[section_idx - 1].size()); ++ prev_line_idx) {
if (const Line &nl = polygon_sections[section_idx - 1][prev_line_idx]; if (const Line &nl = polygon_sections[section_idx - 1][prev_line_idx];
nl.a != nl.b && segments_overlap(line.a.y(), line.b.y(), nl.a.y(), nl.b.y())) { nl.a != nl.b && segments_overlap(line.a.y(), line.b.y(), nl.a.y(), nl.b.y())) {
initial_touches_long_lines = true; initial_touches_long_lines = true;
@ -127,7 +127,7 @@ ThickPolylines make_fill_polylines(
const Line &curr_l = polygon_sections[curr.section_idx][curr.line_idx]; const Line &curr_l = polygon_sections[curr.section_idx][curr.line_idx];
if (curr.neighbours_explored) { if (curr.neighbours_explored) {
bool is_valid_for_removal = (curr_l.length() < length_filter) && bool is_valid_for_removal = (curr_l.length() < length_filter) &&
((int(to_remove.size()) - curr.skips_taken > min_removal_conut) || ((int(to_remove.size()) - curr.skips_taken > int(min_removal_conut)) ||
(curr.neighbours.empty() && !initial_touches_long_lines)); (curr.neighbours.empty() && !initial_touches_long_lines));
if (!is_valid_for_removal) { if (!is_valid_for_removal) {
for (const auto &n : curr.neighbours) { for (const auto &n : curr.neighbours) {
@ -144,9 +144,9 @@ ThickPolylines make_fill_polylines(
} else { } else {
to_visit.back().neighbours_explored = true; to_visit.back().neighbours_explored = true;
int curr_index = to_visit.size() - 1; int curr_index = to_visit.size() - 1;
bool can_use_skip = curr_l.length() <= length_filter && curr.skips_taken < skips_allowed; bool can_use_skip = curr_l.length() <= length_filter && curr.skips_taken < int(skips_allowed);
if (curr.section_idx + 1 < polygon_sections.size()) { if (curr.section_idx + 1 < int(polygon_sections.size())) {
for (int lidx = 0; lidx < polygon_sections[curr.section_idx + 1].size(); lidx++) { for (int lidx = 0; lidx < int(polygon_sections[curr.section_idx + 1].size()); ++ lidx) {
if (const Line &nl = polygon_sections[curr.section_idx + 1][lidx]; if (const Line &nl = polygon_sections[curr.section_idx + 1][lidx];
nl.a != nl.b && segments_overlap(curr_l.a.y(), curr_l.b.y(), nl.a.y(), nl.b.y()) && nl.a != nl.b && segments_overlap(curr_l.a.y(), curr_l.b.y(), nl.a.y(), nl.b.y()) &&
(nl.length() < length_filter || can_use_skip)) { (nl.length() < length_filter || can_use_skip)) {

View File

@ -819,7 +819,7 @@ static void organic_smooth_branches_avoid_collisions(
collision_sphere.prev_position = collision_sphere.position; collision_sphere.prev_position = collision_sphere.position;
std::atomic<size_t> num_moved{ 0 }; std::atomic<size_t> num_moved{ 0 };
tbb::parallel_for(tbb::blocked_range<size_t>(0, collision_spheres.size()), tbb::parallel_for(tbb::blocked_range<size_t>(0, collision_spheres.size()),
[&collision_spheres, &layer_collision_cache, &slicing_params, &config, &move_bounds, &linear_data_layers, &num_moved, &throw_on_cancel](const tbb::blocked_range<size_t> range) { [&collision_spheres, &layer_collision_cache, &slicing_params, &config, &linear_data_layers, &num_moved, &throw_on_cancel](const tbb::blocked_range<size_t> range) {
for (size_t collision_sphere_id = range.begin(); collision_sphere_id < range.end(); ++ collision_sphere_id) for (size_t collision_sphere_id = range.begin(); collision_sphere_id < range.end(); ++ collision_sphere_id)
if (CollisionSphere &collision_sphere = collision_spheres[collision_sphere_id]; ! collision_sphere.locked) { if (CollisionSphere &collision_sphere = collision_spheres[collision_sphere_id]; ! collision_sphere.locked) {
// Calculate collision of multiple 2D layers against a collision sphere. // Calculate collision of multiple 2D layers against a collision sphere.
@ -1187,7 +1187,7 @@ void organic_draw_branches(
mesh_slicing_params.mode = MeshSlicingParams::SlicingMode::Positive; mesh_slicing_params.mode = MeshSlicingParams::SlicingMode::Positive;
tbb::parallel_for(tbb::blocked_range<size_t>(0, trees.size(), 1), tbb::parallel_for(tbb::blocked_range<size_t>(0, trees.size(), 1),
[&trees, &volumes, &config, &slicing_params, &move_bounds, &interface_placer, &mesh_slicing_params, &throw_on_cancel](const tbb::blocked_range<size_t> &range) { [&trees, &volumes, &config, &slicing_params, &move_bounds, &mesh_slicing_params, &throw_on_cancel](const tbb::blocked_range<size_t> &range) {
indexed_triangle_set partial_mesh; indexed_triangle_set partial_mesh;
std::vector<float> slice_z; std::vector<float> slice_z;
std::vector<Polygons> bottom_contacts; std::vector<Polygons> bottom_contacts;

View File

@ -1303,7 +1303,7 @@ void GLCanvas3D::SLAView::render_switch_button()
imgui.begin(std::string("SLAViewSwitch"), ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoDecoration); imgui.begin(std::string("SLAViewSwitch"), ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoDecoration);
const float icon_size = 1.5 * ImGui::GetTextLineHeight(); const float icon_size = 1.5 * ImGui::GetTextLineHeight();
if (imgui.draw_radio_button(_u8L("SLA view"), 1.5f * icon_size, true, if (imgui.draw_radio_button(_u8L("SLA view"), 1.5f * icon_size, true,
[this, &imgui, sel_instance](ImGuiWindow& window, const ImVec2& pos, float size) { [&imgui, sel_instance](ImGuiWindow& window, const ImVec2& pos, float size) {
const wchar_t icon_id = (sel_instance->second == ESLAViewType::Original) ? ImGui::SlaViewProcessed : ImGui::SlaViewOriginal; const wchar_t icon_id = (sel_instance->second == ESLAViewType::Original) ? ImGui::SlaViewProcessed : ImGui::SlaViewOriginal;
imgui.draw_icon(window, pos, size, icon_id); imgui.draw_icon(window, pos, size, icon_id);
})) { })) {

View File

@ -502,7 +502,7 @@ bool GLGizmoCut3D::render_slider_double_input(const std::string& label, float& v
constexpr float UndefMinVal = -0.1f; constexpr float UndefMinVal = -0.1f;
const float f_mm_to_in = static_cast<float>(ObjectManipulation::mm_to_in); const float f_mm_to_in = static_cast<float>(ObjectManipulation::mm_to_in);
auto render_slider = [this, UndefMinVal, f_mm_to_in] auto render_slider = [this, f_mm_to_in]
(const std::string& label, float& val, float def_val, float max_val, const wxString& tooltip) { (const std::string& label, float& val, float def_val, float max_val, const wxString& tooltip) {
float min_val = val < 0.f ? UndefMinVal : def_val; float min_val = val < 0.f ? UndefMinVal : def_val;
float value = val; float value = val;
@ -1575,7 +1575,7 @@ void GLGizmoCut3D::PartSelection::toggle_selection(const Vec2d& mouse_pos)
std::vector<std::pair<size_t, double>> hits_id_and_sqdist; std::vector<std::pair<size_t, double>> hits_id_and_sqdist;
for (size_t id=0; id<m_parts.size(); ++id) { for (size_t id=0; id<m_parts.size(); ++id) {
const Vec3d volume_offset = model_object()->volumes[id]->get_offset(); // const Vec3d volume_offset = model_object()->volumes[id]->get_offset();
Transform3d tr = translation_transform(model_object()->instances[m_instance_idx]->get_offset()) * translation_transform(model_object()->volumes[id]->get_offset()); Transform3d tr = translation_transform(model_object()->instances[m_instance_idx]->get_offset()) * translation_transform(model_object()->volumes[id]->get_offset());
if (m_parts[id].raycaster.unproject_on_mesh(mouse_pos, tr, camera, pos, normal)) { if (m_parts[id].raycaster.unproject_on_mesh(mouse_pos, tr, camera, pos, normal)) {
hits_id_and_sqdist.emplace_back(id, (camera_pos - tr*(pos.cast<double>())).squaredNorm()); hits_id_and_sqdist.emplace_back(id, (camera_pos - tr*(pos.cast<double>())).squaredNorm());

View File

@ -2218,7 +2218,6 @@ void NotificationManager::push_version_notification(NotificationType type, Notif
for (std::unique_ptr<PopNotification>& notification : m_pop_notifications) { for (std::unique_ptr<PopNotification>& notification : m_pop_notifications) {
// NoNewReleaseAvailable must not show if alfa / beta is on. // NoNewReleaseAvailable must not show if alfa / beta is on.
NotificationType nttype = notification->get_type();
if (type == NotificationType::NoNewReleaseAvailable if (type == NotificationType::NoNewReleaseAvailable
&& (notification->get_type() == NotificationType::NewAlphaAvailable && (notification->get_type() == NotificationType::NewAlphaAvailable
|| notification->get_type() == NotificationType::NewBetaAvailable)) { || notification->get_type() == NotificationType::NewBetaAvailable)) {

View File

@ -7041,7 +7041,6 @@ void Plater::force_filament_colors_update()
if (extruders_filaments.size() > 1 && if (extruders_filaments.size() > 1 &&
p->config->option<ConfigOptionStrings>("filament_colour")->values.size() == extruders_filaments.size()) p->config->option<ConfigOptionStrings>("filament_colour")->values.size() == extruders_filaments.size())
{ {
const PresetCollection& filaments = wxGetApp().preset_bundle->filaments;
std::vector<std::string> filament_colors; std::vector<std::string> filament_colors;
filament_colors.reserve(extruders_filaments.size()); filament_colors.reserve(extruders_filaments.size());

View File

@ -2983,7 +2983,7 @@ void TabPrinter::build_extruder_pages(size_t n_before_extruders)
update(); update();
}); });
auto has_changes = [this, extruder_idx]() { auto has_changes = [this]() {
auto dirty_options = m_presets->current_dirty_options(true); auto dirty_options = m_presets->current_dirty_options(true);
#if 1 #if 1
dirty_options.erase(std::remove_if(dirty_options.begin(), dirty_options.end(), dirty_options.erase(std::remove_if(dirty_options.begin(), dirty_options.end(),

View File

@ -104,7 +104,7 @@ bool Mainsail::test(wxString& msg) const
res = false; res = false;
msg = format_error(body, error, status); msg = format_error(body, error, status);
}) })
.on_complete([&, this](std::string body, unsigned) { .on_complete([&](std::string body, unsigned) {
BOOST_LOG_TRIVIAL(debug) << boost::format("%1%: Got server/info: %2%") % name % body; BOOST_LOG_TRIVIAL(debug) << boost::format("%1%: Got server/info: %2%") % name % body;
try { try {

View File

@ -49,7 +49,7 @@ using Slic3r::GUI::Config::SnapshotDB;
namespace Slic3r { namespace Slic3r {
static const char *INDEX_FILENAME = "index.idx"; //static const char *INDEX_FILENAME = "index.idx";
static const char *TMP_EXTENSION = ".download"; static const char *TMP_EXTENSION = ".download";
namespace { namespace {