From bc56a321ad6efc4eae6faa3b47346b809f3dcf11 Mon Sep 17 00:00:00 2001 From: "zhou.xu" Date: Fri, 18 Oct 2024 10:37:58 +0800 Subject: [PATCH] ENH:fix warning jira: none Change-Id: I889983f87cbeabcaff6475e2b40d35e90e774e20 (cherry picked from commit 447c2d1f4081bf3f2fb784ec06ec05672748446b) --- src/admesh/stlinit.cpp | 18 ++-- src/imgui/imgui_widgets.cpp | 6 +- src/slic3r/GUI/3DScene.hpp | 6 ++ src/slic3r/GUI/GLCanvas3D.cpp | 6 +- src/slic3r/GUI/GLTexture.cpp | 1 - src/slic3r/GUI/GUI_Factories.cpp | 7 +- src/slic3r/GUI/GUI_ObjectList.cpp | 3 +- src/slic3r/GUI/GUI_ObjectTable.cpp | 92 +++++++++---------- src/slic3r/GUI/GUI_ObjectTable.hpp | 2 +- src/slic3r/GUI/Gizmos/GLGizmoAdvancedCut.cpp | 2 +- src/slic3r/GUI/Gizmos/GLGizmoMove.cpp | 1 + src/slic3r/GUI/Gizmos/GLGizmoText.cpp | 2 +- .../GUI/Gizmos/GizmoObjectManipulation.cpp | 2 +- src/slic3r/GUI/HintNotification.cpp | 22 ++--- src/slic3r/GUI/Plater.cpp | 20 ++-- 15 files changed, 96 insertions(+), 94 deletions(-) diff --git a/src/admesh/stlinit.cpp b/src/admesh/stlinit.cpp index 96532e248..c16fad86a 100644 --- a/src/admesh/stlinit.cpp +++ b/src/admesh/stlinit.cpp @@ -121,7 +121,7 @@ static FILE *stl_open_count_facets(stl_file *stl, const char *file, unsigned int fclose(fp); return nullptr; } - + // Find the number of facets. char linebuf[100]; int num_lines = 1; @@ -136,9 +136,9 @@ static FILE *stl_open_count_facets(stl_file *stl, const char *file, unsigned int } rewind(fp); - + // Get the header. - int i = 0; + unsigned int i = 0; for (; i < custom_header_length && (stl->stats.header[i] = getc(fp)) != '\n'; ++ i) ; stl->stats.header[i] = '\0'; // Lose the '\n' stl->stats.header[custom_header_length] = '\0'; @@ -225,10 +225,10 @@ static bool stl_read(stl_file *stl, FILE *fp, int first_facet, bool first, Impor } catch (...){ } - + rewind(fp); } - + char normal_buf[3][32]; @@ -247,7 +247,7 @@ static bool stl_read(stl_file *stl, FILE *fp, int first_facet, bool first, Impor stl_facet facet; if (stl->stats.type == binary) { - + // Read a single facet from a binary .STL file. We assume little-endian architecture! if (fread(&facet, 1, SIZEOF_STL_FACET, fp) != SIZEOF_STL_FACET) @@ -319,9 +319,9 @@ static bool stl_read(stl_file *stl, FILE *fp, int first_facet, bool first, Impor // Write the facet into memory if none of facet vertices is NAN. bool someone_is_nan = false; for (size_t j = 0; j < 3; ++j) { - if (isnan(facet.vertex[j](0)) || isnan(facet.vertex[j](1)) || isnan(facet.vertex[j](2))) { + if (isnan(facet.vertex[j](0)) || isnan(facet.vertex[j](1)) || isnan(facet.vertex[j](2))) { someone_is_nan = true; - break; + break; } } if(someone_is_nan) @@ -338,7 +338,7 @@ static bool stl_read(stl_file *stl, FILE *fp, int first_facet, bool first, Impor bool stl_open(stl_file *stl, const char *file, ImportstlProgressFn stlFn, int custom_header_length) { - if (custom_header_length < LABEL_SIZE) { + if (custom_header_length < LABEL_SIZE) { custom_header_length = LABEL_SIZE; } Slic3r::CNumericLocalesSetter locales_setter; diff --git a/src/imgui/imgui_widgets.cpp b/src/imgui/imgui_widgets.cpp index 4c418437c..8159e0125 100644 --- a/src/imgui/imgui_widgets.cpp +++ b/src/imgui/imgui_widgets.cpp @@ -2134,7 +2134,7 @@ bool ImGui::BBLBeginCombo(const char *label, const char *preview_value, ImGuiCom bool hovered, held; bool pressed = ButtonBehavior(frame_bb, id, &hovered, &held); - bool push_color_count = 0; + unsigned int push_color_count = 0; if (hovered || g.ActiveId == id) { ImGui::PushStyleColor(ImGuiCol_Border, GetColorU32(ImGuiCol_BorderActive)); push_color_count = 1; @@ -2168,7 +2168,7 @@ bool ImGui::BBLBeginCombo(const char *label, const char *preview_value, ImGuiCom OpenPopupEx(popup_id, ImGuiPopupFlags_None); popup_open = true; } - if (push_color_count > 0) { ImGui::PopStyleColor(push_color_count); } + if (push_color_count > 0) { ImGui::PopStyleColor(push_color_count); } if (!popup_open) return false; if (has_window_size_constraint) { @@ -4170,7 +4170,7 @@ bool ImGui::BBLInputScalar(const char *label, ImGuiDataType data_type, void *p_d // We are only allowed to access the state if we are already the active widget. ImGuiInputTextState *state = GetInputTextState(id); - bool push_color_count = 0; + unsigned int push_color_count = 0; if (hovered || g.ActiveId == id) { ImGui::PushStyleColor(ImGuiCol_Border, GetColorU32(ImGuiCol_BorderActive)); push_color_count = 1; diff --git a/src/slic3r/GUI/3DScene.hpp b/src/slic3r/GUI/3DScene.hpp index 6d8042b81..d4fa7ef22 100644 --- a/src/slic3r/GUI/3DScene.hpp +++ b/src/slic3r/GUI/3DScene.hpp @@ -754,6 +754,12 @@ public: void set_z_range(float min_z, float max_z) { m_z_range[0] = min_z; m_z_range[1] = max_z; } void set_clipping_plane(const double* coeffs) { m_clipping_plane[0] = coeffs[0]; m_clipping_plane[1] = coeffs[1]; m_clipping_plane[2] = coeffs[2]; m_clipping_plane[3] = coeffs[3]; } + void set_clipping_plane(double coeffs[4]){ + m_clipping_plane[0] = coeffs[0]; + m_clipping_plane[1] = coeffs[1]; + m_clipping_plane[2] = coeffs[2]; + m_clipping_plane[3] = coeffs[3]; + } bool is_slope_GlobalActive() const { return m_slope.isGlobalActive; } bool is_slope_active() const { return m_slope.active; } diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index aa676e565..e4fd540c8 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -4302,8 +4302,9 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt) while (p->GetParent()) p = p->GetParent(); auto *top_level_wnd = dynamic_cast(p); - if (top_level_wnd && top_level_wnd->IsActive() && !wxGetApp().get_side_menu_popup_status()) - ;// m_canvas->SetFocus(); + if (top_level_wnd && top_level_wnd->IsActive() && !wxGetApp().get_side_menu_popup_status()) { + // m_canvas->SetFocus(); + } m_mouse.position = pos.cast(); m_tooltip_enabled = false; // 1) forces a frame render to ensure that m_hover_volume_idxs is updated even when the user right clicks while @@ -8840,7 +8841,6 @@ void GLCanvas3D::_render_assemble_info() const auto canvas_h = float(get_canvas_size().get_height()); float space_size = imgui->get_style_scaling() * 8.0f; float caption_max = imgui->calc_text_size(_L("Total Volume:")).x + 3 * space_size; - char buf[3][64]; ImGuiIO& io = ImGui::GetIO(); ImFont* font = io.Fonts->Fonts[0]; diff --git a/src/slic3r/GUI/GLTexture.cpp b/src/slic3r/GUI/GLTexture.cpp index 75ec59ee8..e144f78e2 100644 --- a/src/slic3r/GUI/GLTexture.cpp +++ b/src/slic3r/GUI/GLTexture.cpp @@ -473,7 +473,6 @@ void GLTexture::reset() bool GLTexture::generate_from_text_string(const std::string& text_str, wxFont &font, wxColor background, wxColor foreground) { - int w,h,hl; return generate_from_text(text_str, font, background, foreground); } diff --git a/src/slic3r/GUI/GUI_Factories.cpp b/src/slic3r/GUI/GUI_Factories.cpp index 8d399b7d6..5a01ba24e 100644 --- a/src/slic3r/GUI/GUI_Factories.cpp +++ b/src/slic3r/GUI/GUI_Factories.cpp @@ -688,9 +688,9 @@ wxMenuItem* MenuFactory::append_menu_item_settings(wxMenu* menu_) // Create new items for settings popupmenu - if (printer_technology() == ptFFF || - (menu->GetMenuItems().size() > 0 && !menu->GetMenuItems().back()->IsSeparator())) - ;// menu->SetFirstSeparator(); + if (printer_technology() == ptFFF || (menu->GetMenuItems().size() > 0 && !menu->GetMenuItems().back()->IsSeparator())) { + // menu->SetFirstSeparator(); + } // detect itemm for adding of the setting ObjectList* object_list = obj_list(); @@ -1920,7 +1920,6 @@ void MenuFactory::append_menu_item_set_printable(wxMenu* menu) for (wxDataViewItem item : sels) { ItemType type = list->GetModel()->GetItemType(item); - bool check; if (type != itInstance && type != itObject) continue; else { diff --git a/src/slic3r/GUI/GUI_ObjectList.cpp b/src/slic3r/GUI/GUI_ObjectList.cpp index 7f6f6c8e0..c5d9a4e12 100644 --- a/src/slic3r/GUI/GUI_ObjectList.cpp +++ b/src/slic3r/GUI/GUI_ObjectList.cpp @@ -2166,8 +2166,7 @@ void ObjectList::load_modifier(const wxArrayString& input_files, ModelObject& mo model = Model::read_from_file(input_file, nullptr, nullptr, LoadStrategy::LoadModel); } catch (std::exception& e) { - // auto msg = _L("Error!") + " " + input_file + " : " + e.what() + "."; - auto msg = _L("Error!") + " " + _L("Failed to get the model data in the current file."); + auto msg = _L("Error!") + " " + _L("Failed to get the model data in the current file.") + e.what(); show_error(parent, msg); return; } diff --git a/src/slic3r/GUI/GUI_ObjectTable.cpp b/src/slic3r/GUI/GUI_ObjectTable.cpp index a20c85416..d548e939e 100644 --- a/src/slic3r/GUI/GUI_ObjectTable.cpp +++ b/src/slic3r/GUI/GUI_ObjectTable.cpp @@ -83,7 +83,7 @@ void GridCellIconRenderer::Draw(wxGrid& grid, int bitmap_height = bitmap.GetHeight(); int offset_x = (table->m_icon_col_width - bitmap_width)/2; int offset_y = (table->m_icon_row_height - bitmap_height)/2; - + #ifdef __WXOSX_COCOA__ auto lock_pos = wxPoint(rect.x + offset_x, rect.y + offset_y); auto left = (28 - 12) / 2; @@ -563,12 +563,12 @@ void GridCellSupportEditor::DoActivate(int row, int col, wxGrid* grid) { ObjectGrid* local_table = dynamic_cast(grid); wxGridBlocks cell_array = grid->GetSelectedBlocks(); - + auto left_col = cell_array.begin()->GetLeftCol(); auto right_col = cell_array.begin()->GetRightCol(); auto top_row = cell_array.begin()->GetTopRow(); auto bottom_row = cell_array.begin()->GetBottomRow(); - + if ((left_col == right_col) && (top_row == bottom_row)) { wxGridCellBoolEditor::DoActivate(row, col, grid); @@ -687,14 +687,14 @@ void GridCellSupportRenderer::Draw(wxGrid& grid, wxRendererNative::Get().DrawCheckBox( &grid, dc, text_rect, flags ); }*/ - + //wxGridCellBoolRenderer::Draw(grid, attr, dc, rect, row, col, isSelected); ObjectGridTable * table = dynamic_cast(grid.GetTable()); ObjectGridTable::ObjectGridCol *grid_col = table->get_grid_col(col); ObjectGridTable::ObjectGridRow *grid_row = table->get_grid_row(row - 1); ConfigOptionBool & cur_option = dynamic_cast((*grid_row)[(ObjectGridTable::GridColType) col]); - + auto height = grid.GetRowSize(row); auto width = grid.GetColSize(col); @@ -736,7 +736,7 @@ void GridCellSupportRenderer::Draw(wxGrid& grid, dc.DrawBitmap(check_off, rect.x + offsetx, rect.y + offsety); } } - + } wxSize GridCellSupportRenderer::GetBestSize(wxGrid& grid, @@ -1087,7 +1087,7 @@ void ObjectGrid::paste_data( wxTextDataObject& text_data ) } } } - + } else { wxLogWarning(_L("multiple cells copy is not supported")); @@ -1118,7 +1118,7 @@ void ObjectGrid::OnKeyUp( wxKeyEvent& event ) event.Skip(); } -void ObjectGrid::OnChar( wxKeyEvent& event ) { +void ObjectGrid::OnChar( wxKeyEvent& event ) { auto keycode = event.GetKeyCode(); if (keycode >= 0x20 && keycode <= 0x7F) { input_string = event.GetUnicodeKey(); @@ -1398,7 +1398,7 @@ wxString ObjectGridTable::GetValue (int row, int col) if (grid_row->row_type == row_volume){ ConfigOptionString& option_value = dynamic_cast(option); return GUI::from_u8(std::string(" ") + option_value.value); - } + } else { if (option.type() == coInt) { ConfigOptionInt& option_value = dynamic_cast(option); @@ -1901,7 +1901,7 @@ void ObjectGridTable::init_cols(ObjectGrid *object_grid) col = new ObjectGridCol(coEnum, "brim_type_reset", L("Support"), true, true, false, false, wxALIGN_LEFT); m_col_data.push_back(col); - // todo mutli_extruders: + // todo mutli_extruders: //object/volume speed col = new ObjectGridCol(coFloat, "outer_wall_speed", L("Speed"), false, false, true, true, wxALIGN_LEFT); col->size = object_grid->GetTextExtent(L("Outer wall speed")).x; @@ -2256,7 +2256,7 @@ void ObjectGridTable::update_row_properties() grid_table->SetCellEditor(row, col, combo_editor); grid_table->SetCellRenderer(row, col, new wxGridCellChoiceRenderer()); //new wxGridCellChoiceEditor(grid_col->choice_count, grid_col->choices)); - } + } break; case coFloat: { grid_table->SetCellEditor(row, col, new GridCellTextEditor()); @@ -2266,7 +2266,7 @@ void ObjectGridTable::update_row_properties() else { grid_table->SetCellRenderer(row, col, new wxGridCellFloatRenderer(6, 2)); } - + break; } case coPercent: @@ -2713,7 +2713,7 @@ ObjectTablePanel::ObjectTablePanel( wxWindow* parent, wxWindowID id, const wxPoi SetSize(wxSize(-1, FromDIP(450))); SetMinSize(wxSize(-1, FromDIP(450))); //SetMaxSize(wxSize(-1, FromDIP(450))); - + //m_search_line = new wxTextCtrl(this, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER); @@ -3028,7 +3028,7 @@ void ObjectTablePanel::load_data() } } } - + for (int i = 0; i < ObjectGridTable::col_max; i++) { ObjectGridTable::ObjectGridCol *grid_col = m_object_grid_table->get_grid_col(i); @@ -3050,29 +3050,29 @@ void ObjectTablePanel::load_data() m_object_grid->SetColSize(i, FromDIP(0)); break; - case ObjectGridTable::col_name: - m_object_grid->SetColSize(i, FromDIP(140)); + case ObjectGridTable::col_name: + m_object_grid->SetColSize(i, FromDIP(140)); break; - /* case ObjectGridTable::col_filaments: + /* case ObjectGridTable::col_filaments: m_object_grid->SetColSize(i, FromDIP(55)); break;*/ - case ObjectGridTable::col_filaments_reset: - m_object_grid->SetColSize(i, FromDIP(0)); + case ObjectGridTable::col_filaments_reset: + m_object_grid->SetColSize(i, FromDIP(0)); break; case ObjectGridTable::col_layer_height: { auto width = m_object_grid->GetColSize(i) - FromDIP(28); - if (width < m_object_grid->GetTextExtent(("000.00")).x) { - width = m_object_grid->GetTextExtent(("000.00")).x; + if (width < m_object_grid->GetTextExtent(("000.00")).x) { + width = m_object_grid->GetTextExtent(("000.00")).x; } m_object_grid->SetColSize(i, width); break; } case ObjectGridTable::col_layer_height_reset: - m_object_grid->SetColSize(i, FromDIP(28)); + m_object_grid->SetColSize(i, FromDIP(28)); break; case ObjectGridTable::col_wall_loops: { @@ -3083,32 +3083,32 @@ void ObjectTablePanel::load_data() m_object_grid->SetColSize(i, width); break; } - case ObjectGridTable::col_wall_loops_reset: - m_object_grid->SetColSize(i, FromDIP(28)); - break; - - case ObjectGridTable::col_fill_density: - m_object_grid->SetColSize(i, m_object_grid->GetColSize(i) - FromDIP(28)); - break; - - case ObjectGridTable::col_fill_density_reset: + case ObjectGridTable::col_wall_loops_reset: m_object_grid->SetColSize(i, FromDIP(28)); break; - case ObjectGridTable::col_enable_support: - m_object_grid->SetColSize(i, m_object_grid->GetColSize(i) - FromDIP(28)); + case ObjectGridTable::col_fill_density: + m_object_grid->SetColSize(i, m_object_grid->GetColSize(i) - FromDIP(28)); break; - case ObjectGridTable::col_enable_support_reset: - m_object_grid->SetColSize(i, FromDIP(28)); - break; - - case ObjectGridTable::col_brim_type: - m_object_grid->SetColSize(i, FromDIP(56)); + case ObjectGridTable::col_fill_density_reset: + m_object_grid->SetColSize(i, FromDIP(28)); break; - case ObjectGridTable::col_brim_type_reset: - m_object_grid->SetColSize(i, FromDIP(28)); + case ObjectGridTable::col_enable_support: + m_object_grid->SetColSize(i, m_object_grid->GetColSize(i) - FromDIP(28)); + break; + + case ObjectGridTable::col_enable_support_reset: + m_object_grid->SetColSize(i, FromDIP(28)); + break; + + case ObjectGridTable::col_brim_type: + m_object_grid->SetColSize(i, FromDIP(56)); + break; + + case ObjectGridTable::col_brim_type_reset: + m_object_grid->SetColSize(i, FromDIP(28)); break; case ObjectGridTable::col_speed_perimeter: { auto width = m_object_grid->GetColSize(i) - FromDIP(28); @@ -3116,7 +3116,7 @@ void ObjectTablePanel::load_data() m_object_grid->SetColSize(i, width); break; } - case ObjectGridTable::col_speed_perimeter_reset: + case ObjectGridTable::col_speed_perimeter_reset: m_object_grid->SetColSize(i, FromDIP(28)); break; } @@ -3274,7 +3274,7 @@ void ObjectTablePanel::resetAllValuesInSideWindow(int row, bool is_object, Model m_object_settings->resetAllValues(row, is_object, object, config, category); } -void ObjectTablePanel::msw_rescale() { +void ObjectTablePanel::msw_rescale() { m_object_grid->HideRowLabels(); } @@ -3389,7 +3389,7 @@ void ObjectTableDialog::on_dpi_changed(const wxRect& suggested_rect) const wxSize& size = wxSize(40 * em, 30 * em); SetMinSize(size); m_obj_panel->msw_rescale(); - + Fit(); Refresh(); @@ -3469,7 +3469,7 @@ void GridCellTextEditor::StartingKey(wxKeyEvent &event) {} void GridCellTextEditor::SetSize(const wxRect &rect) { wxGridCellTextEditor::SetSize(rect); } -void GridCellTextEditor::BeginEdit(int row, int col, wxGrid *grid) +void GridCellTextEditor::BeginEdit(int row, int col, wxGrid *grid) { ObjectGridTable * table = dynamic_cast(grid->GetTable()); ObjectGridTable::ObjectGridCol *grid_col = table->get_grid_col(col); @@ -3488,7 +3488,7 @@ void GridCellTextEditor::BeginEdit(int row, int col, wxGrid *grid) } Text()->SetFocus(); Text()->GetTextCtrl()->SetInsertionPointEnd(); - + m_control->Bind(wxEVT_TEXT_ENTER, [this, row, col, grid](wxCommandEvent &e) { grid->HideCellEditControl(); diff --git a/src/slic3r/GUI/GUI_ObjectTable.hpp b/src/slic3r/GUI/GUI_ObjectTable.hpp index a21436fe0..47572d45f 100644 --- a/src/slic3r/GUI/GUI_ObjectTable.hpp +++ b/src/slic3r/GUI/GUI_ObjectTable.hpp @@ -578,7 +578,7 @@ public: std::vector m_filaments_name; std::vector m_filaments_colors; - int m_filaments_count{ 1 }; + unsigned int m_filaments_count{ 1 }; void set_default_filaments_and_colors() { m_filaments_count = 1; diff --git a/src/slic3r/GUI/Gizmos/GLGizmoAdvancedCut.cpp b/src/slic3r/GUI/Gizmos/GLGizmoAdvancedCut.cpp index a0c7efb2f..c9fecb0ea 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoAdvancedCut.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoAdvancedCut.cpp @@ -1965,7 +1965,7 @@ void GLGizmoAdvancedCut::render_cut_plane_input_window(float x, float y, float b m_imgui->text(_L("Rotation") + " "); ImGui::SameLine(caption_size + 1 * space_size); ImGui::PushItemWidth(unit_size); - for (size_t i = 0; i < m_buffered_rotation.size(); i++) { + for (int i = 0; i < m_buffered_rotation.size(); i++) { if (abs(m_buffered_rotation[i]) < 1e-3) { m_buffered_rotation[i] = 0; } diff --git a/src/slic3r/GUI/Gizmos/GLGizmoMove.cpp b/src/slic3r/GUI/Gizmos/GLGizmoMove.cpp index 95d73a7b8..871b39c2f 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoMove.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoMove.cpp @@ -36,6 +36,7 @@ GLGizmoMove3D::GLGizmoMove3D(GLCanvas3D& parent, const std::string& icon_filenam float value = std::stof(wxGetApp().app_config->get("grabber_size_factor")); GLGizmoBase::Grabber::GrabberSizeFactor = value; } catch (const std::invalid_argument &e) { + BOOST_LOG_TRIVIAL(trace) << __FUNCTION__ << e.what(); GLGizmoBase::Grabber::GrabberSizeFactor = 1.0f; } } diff --git a/src/slic3r/GUI/Gizmos/GLGizmoText.cpp b/src/slic3r/GUI/Gizmos/GLGizmoText.cpp index 2235b57b0..80a679fa3 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoText.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoText.cpp @@ -14,7 +14,7 @@ #include "libslic3r/Shape/TextShape.hpp" #include - +#include #include #include diff --git a/src/slic3r/GUI/Gizmos/GizmoObjectManipulation.cpp b/src/slic3r/GUI/Gizmos/GizmoObjectManipulation.cpp index cce69f162..ce676e870 100644 --- a/src/slic3r/GUI/Gizmos/GizmoObjectManipulation.cpp +++ b/src/slic3r/GUI/Gizmos/GizmoObjectManipulation.cpp @@ -468,7 +468,7 @@ void GizmoObjectManipulation::do_scale(int axis, const Vec3d &scale) const void GizmoObjectManipulation::limit_scaling_ratio(Vec3d &scaling_factor) const{ - for (size_t i = 0; i < scaling_factor.size(); i++) { // range protect //scaling_factor too big has problem + for (unsigned int i = 0; i < scaling_factor.size(); i++) { // range protect //scaling_factor too big has problem if (scaling_factor[i] * m_unscale_size[i] > MAX_NUM) { scaling_factor[i] = MAX_NUM / m_unscale_size[i]; } diff --git a/src/slic3r/GUI/HintNotification.cpp b/src/slic3r/GUI/HintNotification.cpp index c431e0faf..e9026c481 100644 --- a/src/slic3r/GUI/HintNotification.cpp +++ b/src/slic3r/GUI/HintNotification.cpp @@ -146,21 +146,21 @@ namespace { if (tag == "Windows") #ifdef WIN32 return TagCheckAffirmative; -#else +#else return TagCheckNegative; #endif // WIN32 if (tag == "Linux") #ifdef __linux__ return TagCheckAffirmative; -#else +#else return TagCheckNegative; #endif // __linux__ if (tag == "OSX") #ifdef __APPLE__ return TagCheckAffirmative; -#else +#else return TagCheckNegative; #endif // __apple__ } @@ -334,7 +334,7 @@ void HintDatabase::load_hints_from_file(const boost::filesystem::path& path) for (const auto& section : tree) { if (boost::starts_with(section.first, "hint:")) { - // create std::map with tree data + // create std::map with tree data std::map dict; for (const auto& data : section.second) { dict.emplace(data.first, data.second.data()); @@ -342,7 +342,7 @@ void HintDatabase::load_hints_from_file(const boost::filesystem::path& path) // unique id string [hint:id] (trim "hint:") std::string id_string = section.first.substr(5); id_string = std::to_string(std::hash{}(id_string)); - // unescaping and translating all texts and saving all data common for all hint types + // unescaping and translating all texts and saving all data common for all hint types std::string fulltext; std::string text1; std::string hypertext_text; @@ -499,8 +499,8 @@ HintData* HintDatabase::get_hint(HintDataNavigation nav) m_hint_id = get_next_hint_id(); if(nav == HintDataNavigation::Prev) m_hint_id = get_prev_hint_id(); - if (nav == HintDataNavigation::Curr) - ; + if (nav == HintDataNavigation::Curr) { + } if (nav == HintDataNavigation::Random) init_random_hint_id(); } @@ -600,7 +600,7 @@ void HintDatabase::clear_used() void NotificationManager::HintNotification::count_spaces() { - //determine line width + //determine line width m_line_height = ImGui::CalcTextSize("A").y; @@ -820,7 +820,7 @@ void NotificationManager::HintNotification::count_lines() } if (size_of_last_line == 0) // if first line is continuation of previous text, do not add to line count. m_lines_count++; - size_of_last_line = 0; // should countain value only for first line (with hypertext) + size_of_last_line = 0; // should countain value only for first line (with hypertext) } } @@ -1161,5 +1161,5 @@ void NotificationManager::HintNotification::retrieve_data(bool new_hint/* = true update(nd); } } -} //namespace Slic3r -} //namespace GUI +} //namespace Slic3r +} //namespace GUI diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 58262bdde..4c572ae46 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -712,13 +712,13 @@ static struct DynamicFilamentList : DynamicList if (items.empty()) update(true); auto cb = dynamic_cast(c->window); - auto n = cb->GetSelection(); + int n = cb->GetSelection(); cb->Clear(); cb->Append(_L("Default")); for (auto i : items) { cb->Append(i.first, *i.second); } - if (n < cb->GetCount()) + if ((unsigned int)n < cb->GetCount()) cb->SetSelection(n); } wxString get_value(int index) override @@ -10475,9 +10475,8 @@ void Plater::import_model_id(wxString download_info) } } - catch (const std::exception& error) - { - //wxString sError = error.what(); + catch (const std::exception& error){ + BOOST_LOG_TRIVIAL(trace) << __FUNCTION__ << error.what(); } bool download_ok = false; @@ -10516,7 +10515,7 @@ void Plater::import_model_id(wxString download_info) if (!m_agent) return; int res = 0; - unsigned int http_code; + //unsigned int http_code; std::string http_body; msg = _L("prepare 3mf file..."); @@ -10555,9 +10554,8 @@ void Plater::import_model_id(wxString download_info) if (sFile == filename) is_already_exist = true; } } - catch (const std::exception& error) - { - //wxString sError = error.what(); + catch (const std::exception& error) { + BOOST_LOG_TRIVIAL(trace) << __FUNCTION__ << error.what(); } //update filename @@ -13986,7 +13984,7 @@ int Plater::send_gcode(int plate_idx, Export3mfProgressFn proFn) p->m_print_job_data._3mf_path.replace_extension("3mf"); } catch (std::exception& e) { - BOOST_LOG_TRIVIAL(error) << "generate 3mf path failed"; + BOOST_LOG_TRIVIAL(error) << "generate 3mf path failed"<< e.what(); return -1; } @@ -14019,7 +14017,7 @@ int Plater::export_config_3mf(int plate_idx, Export3mfProgressFn proFn) p->m_print_job_data._3mf_config_path = fs::path(plate->get_temp_config_3mf_path()); } catch (std::exception& e) { - BOOST_LOG_TRIVIAL(error) << "generate 3mf path failed"; + BOOST_LOG_TRIVIAL(error) << "generate 3mf path failed" << e.what(); return -1; }