mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-14 02:07:54 -06:00
Fix Compile Warnings (#5963)
* Fix calls to depreciated wxPen constructor * Fix use of wxTimerEvent * Fix unrecognized character escape sequence * Fix signed/unsigned mismatch At least as much as possible without significantly altering parts of the application * Clean unreferenced variables * fix mistyped namespace selector * Update deprecated calls * Fix preprocessor statement * Remove empty switch statements * Change int vector used as bool to bool vector * Remove empty control statements and related unused code * Change multi character constant to string constant * Fix discarded return value json::parse was being called on the object, rather than statically like it should be. Also, the value was not being captured. * Rename ICON_SIZE def used by MultiMachine By having the definition in the header, it causes issues when other files define ICON_SIZE. By renaming it to MM_ICON_SIZE, this lessens the issue. It would probably be ideal to have the definitions in the respective .cpp that use them, but it would make it less convenient to update the values if needed in the future. * Remove unused includes * Fix linux/macOS compilation * Hide unused-function errors on non-Windows systems * Disable signed/unsigned comparison mismatch error * Remove/Disable more unused variables Still TODO: check double for loop in Print.cpp * Remove unused variable that was missed * Remove unused variables in libraries in the src folder * Apply temporary fix for subobject linkage error * Remove/Disable last set of unused variables reported by GCC * remove redundant for loop * fix misspelled ifdef check * Update message on dialog * Fix hard-coded platform specific modifier keys * Remove duplicate for loop * Disable -Wmisleading-indentation warning * disable -Wswitch warning * Remove unused local typedefs * Fix -Wunused-value * Fix pragma error on Windows from subobject linkage fix * Fix -Waddress * Fix null conversions (-Wconversion-null) --------- Co-authored-by: SoftFever <softfeverever@gmail.com>
This commit is contained in:
parent
b40853af94
commit
b83e16dbdd
187 changed files with 494 additions and 1101 deletions
|
@ -2773,7 +2773,7 @@ void GLCanvas3D::reload_scene(bool refresh_immediately, bool force_full_scene_re
|
|||
ModelInstanceEPrintVolumeState state;
|
||||
const bool contained_min_one = m_volumes.check_outside_state(m_bed.build_volume(), &state);
|
||||
const bool partlyOut = (state == ModelInstanceEPrintVolumeState::ModelInstancePVS_Partly_Outside);
|
||||
const bool fullyOut = (state == ModelInstanceEPrintVolumeState::ModelInstancePVS_Fully_Outside);
|
||||
// const bool fullyOut = (state == ModelInstanceEPrintVolumeState::ModelInstancePVS_Fully_Outside);
|
||||
|
||||
_set_warning_notification(EWarning::ObjectClashed, partlyOut);
|
||||
//BBS: turn off the warning when fully outside
|
||||
|
@ -4080,12 +4080,12 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt)
|
|||
// Set focus in order to remove it from sidebar fields
|
||||
if (m_canvas != nullptr) {
|
||||
// Only set focus, if the top level window of this canvas is active.
|
||||
auto p = dynamic_cast<wxWindow*>(evt.GetEventObject());
|
||||
while (p->GetParent())
|
||||
p = p->GetParent();
|
||||
auto *top_level_wnd = dynamic_cast<wxTopLevelWindow*>(p);
|
||||
if (top_level_wnd && top_level_wnd->IsActive() && !wxGetApp().get_side_menu_popup_status())
|
||||
;// m_canvas->SetFocus();
|
||||
// auto p = dynamic_cast<wxWindow*>(evt.GetEventObject());
|
||||
// while (p->GetParent())
|
||||
// p = p->GetParent();
|
||||
// auto *top_level_wnd = dynamic_cast<wxTopLevelWindow*>(p);
|
||||
// if (top_level_wnd && top_level_wnd->IsActive() && !wxGetApp().get_side_menu_popup_status())
|
||||
// m_canvas->SetFocus();
|
||||
m_mouse.position = pos.cast<double>();
|
||||
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
|
||||
|
@ -5085,7 +5085,6 @@ std::vector<Vec2f> GLCanvas3D::get_empty_cells(const Vec2f start_point, const Ve
|
|||
}
|
||||
for (size_t i = 0; i < m_model->objects.size(); ++i) {
|
||||
ModelObject* model_object = m_model->objects[i];
|
||||
auto id = model_object->id().id;
|
||||
ModelInstance* model_instance0 = model_object->instances.front();
|
||||
Polygon hull_2d = model_object->convex_hull_2d(Geometry::assemble_transform({ 0.0, 0.0, model_instance0->get_offset().z() }, model_instance0->get_rotation(),
|
||||
model_instance0->get_scaling_factor(), model_instance0->get_mirror()));
|
||||
|
@ -5356,7 +5355,6 @@ void GLCanvas3D::update_sequential_clearance()
|
|||
|
||||
for (int i = k+1; i < bounding_box_count; i++)
|
||||
{
|
||||
Polygon& next_convex = convex_and_bounding_boxes[i].hull_polygon;
|
||||
BoundingBox& next_bbox = convex_and_bounding_boxes[i].bounding_box;
|
||||
auto py1 = next_bbox.min.y();
|
||||
auto py2 = next_bbox.max.y();
|
||||
|
@ -5417,7 +5415,6 @@ bool GLCanvas3D::_render_orient_menu(float left, float right, float bottom, floa
|
|||
ImGuiWrapper* imgui = wxGetApp().imgui();
|
||||
|
||||
auto canvas_w = float(get_canvas_size().get_width());
|
||||
auto canvas_h = float(get_canvas_size().get_height());
|
||||
//BBS: GUI refactor: move main toolbar to the right
|
||||
//original use center as {0.0}, and top is (canvas_h/2), bottom is (-canvas_h/2), also plus inv_camera
|
||||
//now change to left_up as {0,0}, and top is 0, bottom is canvas_h
|
||||
|
@ -5426,6 +5423,7 @@ bool GLCanvas3D::_render_orient_menu(float left, float right, float bottom, floa
|
|||
ImGuiWrapper::push_toolbar_style(get_scale());
|
||||
imgui->set_next_window_pos(x, m_main_toolbar.get_height(), ImGuiCond_Always, 0.5f, 0.0f);
|
||||
#else
|
||||
auto canvas_h = float(get_canvas_size().get_height());
|
||||
const float x = canvas_w - m_main_toolbar.get_width();
|
||||
const float y = 0.5f * canvas_h - top * float(wxGetApp().plater()->get_camera().get_zoom());
|
||||
imgui->set_next_window_pos(x, y, ImGuiCond_Always, 1.0f, 0.0f);
|
||||
|
@ -5440,13 +5438,13 @@ bool GLCanvas3D::_render_orient_menu(float left, float right, float bottom, floa
|
|||
PrinterTechnology ptech = current_printer_technology();
|
||||
|
||||
bool settings_changed = false;
|
||||
float angle_min = 45.f;
|
||||
// float angle_min = 45.f;
|
||||
std::string angle_key = "overhang_angle", rot_key = "enable_rotation";
|
||||
std::string key_min_area = "min_area";
|
||||
std::string postfix = "_fff";
|
||||
|
||||
if (ptech == ptSLA) {
|
||||
angle_min = 45.f;
|
||||
// angle_min = 45.f;
|
||||
postfix = "_sla";
|
||||
}
|
||||
|
||||
|
@ -5502,7 +5500,6 @@ bool GLCanvas3D::_render_arrange_menu(float left, float right, float bottom, flo
|
|||
ImGuiWrapper *imgui = wxGetApp().imgui();
|
||||
|
||||
auto canvas_w = float(get_canvas_size().get_width());
|
||||
auto canvas_h = float(get_canvas_size().get_height());
|
||||
//BBS: GUI refactor: move main toolbar to the right
|
||||
//original use center as {0.0}, and top is (canvas_h/2), bottom is (-canvas_h/2), also plus inv_camera
|
||||
//now change to left_up as {0,0}, and top is 0, bottom is canvas_h
|
||||
|
@ -5510,8 +5507,8 @@ bool GLCanvas3D::_render_arrange_menu(float left, float right, float bottom, flo
|
|||
float left_pos = m_main_toolbar.get_item("arrange")->render_left_pos;
|
||||
const float x = (1 + left_pos) * canvas_w / 2;
|
||||
imgui->set_next_window_pos(x, m_main_toolbar.get_height(), ImGuiCond_Always, 0.0f, 0.0f);
|
||||
|
||||
#else
|
||||
auto canvas_h = float(get_canvas_size().get_height());
|
||||
const float x = canvas_w - m_main_toolbar.get_width();
|
||||
const float y = 0.5f * canvas_h - top * float(wxGetApp().plater()->get_camera().get_zoom());
|
||||
imgui->set_next_window_pos(x, y, ImGuiCond_Always, 1.0f, 0.0f);
|
||||
|
@ -8091,16 +8088,13 @@ void GLCanvas3D::_render_return_toolbar() const
|
|||
ImVec2 button_icon_size = ImVec2(font_size * 1.3, font_size * 1.3);
|
||||
|
||||
ImGuiWrapper& imgui = *wxGetApp().imgui();
|
||||
Size cnv_size = get_canvas_size();
|
||||
auto canvas_w = float(cnv_size.get_width());
|
||||
auto canvas_h = float(cnv_size.get_height());
|
||||
float window_width = real_size.x + button_icon_size.x + imgui.scaled(2.0f);
|
||||
float window_height = button_icon_size.y + imgui.scaled(2.0f);
|
||||
float window_pos_x = 30.0f + (is_collapse_toolbar_on_left() ? (get_collapse_toolbar_width() + 5.f) : 0);
|
||||
float window_pos_y = 14.0f;
|
||||
|
||||
imgui.set_next_window_pos(window_pos_x, window_pos_y, ImGuiCond_Always, 0, 0);
|
||||
#ifdef __WINDOWS__
|
||||
float window_width = real_size.x + button_icon_size.x + imgui.scaled(2.0f);
|
||||
float window_height = button_icon_size.y + imgui.scaled(2.0f);
|
||||
imgui.set_next_window_size(window_width, window_height, ImGuiCond_Always);
|
||||
#endif
|
||||
|
||||
|
@ -8114,9 +8108,6 @@ void GLCanvas3D::_render_return_toolbar() const
|
|||
imgui.begin(_L("Assembly Return"), ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoBackground
|
||||
| ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoCollapse);
|
||||
|
||||
float button_width = 20;
|
||||
float button_height = 20;
|
||||
ImVec2 size = ImVec2(button_width, button_height); // Size of the image we want to make visible
|
||||
ImVec2 uv0 = ImVec2(0.0f, 0.0f);
|
||||
ImVec2 uv1 = ImVec2(1.0f, 1.0f);
|
||||
|
||||
|
@ -8392,11 +8383,11 @@ void GLCanvas3D::_render_assemble_control() const
|
|||
|
||||
ImGui::SameLine(window_padding.x + 2 * text_size_x + slider_width + item_spacing * 7 + value_size);
|
||||
ImGui::PushItemWidth(slider_width);
|
||||
bool explosion_slider_changed = imgui->bbl_slider_float_style("##ratio_slider", &m_explosion_ratio, 1.0f, 3.0f, "%1.2f");
|
||||
imgui->bbl_slider_float_style("##ratio_slider", &m_explosion_ratio, 1.0f, 3.0f, "%1.2f");
|
||||
|
||||
ImGui::SameLine(window_padding.x + 2 * text_size_x + 2 * slider_width + item_spacing * 8 + value_size);
|
||||
ImGui::PushItemWidth(value_size);
|
||||
bool explosion_input_changed = ImGui::BBLDragFloat("##ratio_input", &m_explosion_ratio, 0.1f, 1.0f, 3.0f, "%1.2f");
|
||||
ImGui::BBLDragFloat("##ratio_input", &m_explosion_ratio, 0.1f, 1.0f, 3.0f, "%1.2f");
|
||||
}
|
||||
|
||||
imgui->end();
|
||||
|
@ -8426,7 +8417,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];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue