diff --git a/lib/Slic3r/GUI/Plater.pm b/lib/Slic3r/GUI/Plater.pm index 2c2cf086c..0de933c37 100644 --- a/lib/Slic3r/GUI/Plater.pm +++ b/lib/Slic3r/GUI/Plater.pm @@ -386,12 +386,12 @@ sub new { $self->{btn_print}->Hide; $self->{btn_send_gcode}->Hide; +# export_gcode cog_go.png my %icons = qw( add brick_add.png remove brick_delete.png reset cross.png arrange bricks.png - export_gcode cog_go.png print arrow_up.png send_gcode arrow_up.png reslice reslice.png @@ -648,6 +648,8 @@ sub new { $right_sizer->Add($expert_mode_part_sizer, 0, wxEXPAND | wxTOP, 10) if defined $expert_mode_part_sizer; $right_sizer->Add($buttons_sizer, 0, wxEXPAND | wxBOTTOM | wxTOP, 10); $right_sizer->Add($info_sizer, 0, wxEXPAND | wxLEFT, 20); + # Show the box initially, let it be shown after the slicing is finished. + $self->print_info_box_show(0); $right_sizer->Add($self->{btn_export_gcode}, 0, wxEXPAND | wxLEFT | wxTOP | wxBOTTOM, 20); my $hsizer = Wx::BoxSizer->new(wxHORIZONTAL); @@ -1727,7 +1729,7 @@ sub print_info_box_show { # return if (!$show && ($scrolled_window_sizer->IsShown(2) == $show)); my $panel = $self->{right_panel}; my $sizer = $self->{info_sizer}; - return if (!$show && ($sizer->IsShown(2) == $show)); + return if (!$sizer || !$show && ($sizer->IsShown(1) == $show)); Slic3r::GUI::set_show_print_info($show); return if (wxTheApp->{app_config}->get("view_mode") eq "simple"); @@ -1772,8 +1774,8 @@ sub print_info_box_show { # $scrolled_window_panel->Layout; $sizer->Show(1, $show); -#? $self->Layout; -#? $panel->Refresh; + $self->Layout; + $panel->Refresh; } sub do_print { diff --git a/xs/src/slic3r/GUI/Field.cpp b/xs/src/slic3r/GUI/Field.cpp index b9753fe93..4043a4457 100644 --- a/xs/src/slic3r/GUI/Field.cpp +++ b/xs/src/slic3r/GUI/Field.cpp @@ -718,7 +718,7 @@ void SliderCtrl::BUILD() auto temp = new wxBoxSizer(wxHORIZONTAL); - auto def_val = static_cast(m_opt.default_value)->value; + auto def_val = static_cast(m_opt.default_value)->value; auto min = m_opt.min == INT_MIN ? 0 : m_opt.min; auto max = m_opt.max == INT_MAX ? 100 : m_opt.max; diff --git a/xs/src/slic3r/GUI/GLCanvas3D.cpp b/xs/src/slic3r/GUI/GLCanvas3D.cpp index 2b548896d..dc867b767 100644 --- a/xs/src/slic3r/GUI/GLCanvas3D.cpp +++ b/xs/src/slic3r/GUI/GLCanvas3D.cpp @@ -2952,12 +2952,6 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt) #endif } else if (evt.Leaving()) - { - // to remove hover when mouse goes out of this canvas - m_mouse.position = Pointf((coordf_t)pos.x, (coordf_t)pos.y); - render(); - } - else if (evt.Leaving()) { // to remove hover on objects when the mouse goes out of this canvas m_mouse.position = Vec2d(-1.0, -1.0); diff --git a/xs/src/slic3r/GUI/GUI.cpp b/xs/src/slic3r/GUI/GUI.cpp index ed160b421..161da5267 100644 --- a/xs/src/slic3r/GUI/GUI.cpp +++ b/xs/src/slic3r/GUI/GUI.cpp @@ -803,10 +803,6 @@ PresetBundle* get_preset_bundle() return g_PresetBundle; } -wxNotebook* get_tab_panel() { - return g_wxTabPanel; -} - const wxColour& get_label_clr_modified() { return g_color_label_modified; } @@ -1116,7 +1112,7 @@ void show_buttons(bool show) if (!tab) continue; g_btn_print->Show(show && !tab->m_config->opt_string("serial_port").empty()); - g_btn_send_gcode->Show(show && !tab->m_config->opt_string("octoprint_host").empty()); + g_btn_send_gcode->Show(show && !tab->m_config->opt_string("print_host").empty()); break; } } diff --git a/xs/src/slic3r/GUI/GUI_ObjectParts.cpp b/xs/src/slic3r/GUI/GUI_ObjectParts.cpp index e9d08ede5..bb5a41423 100644 --- a/xs/src/slic3r/GUI/GUI_ObjectParts.cpp +++ b/xs/src/slic3r/GUI/GUI_ObjectParts.cpp @@ -35,8 +35,8 @@ wxSlider* m_mover_y = nullptr; wxSlider* m_mover_z = nullptr; wxButton* m_btn_move_up = nullptr; wxButton* m_btn_move_down = nullptr; -Point3 m_move_options; -Point3 m_last_coords; +Vec3d m_move_options; +Vec3d m_last_coords; int m_selected_object_id = -1; bool g_prevent_list_events = false; // We use this flag to avoid circular event handling Select() @@ -387,12 +387,12 @@ void update_after_moving() if (volume_id < 0) return; - Point3 m = m_move_options; - Point3 l = m_last_coords; + Vec3d m = m_move_options; + Vec3d l = m_last_coords; - auto d = Pointf3(m.x - l.x, m.y - l.y, m.z - l.z); + auto d = Vec3d(m(0) - l(0), m(1) - l(1), m(2) - l(2)); auto volume = (*m_objects)[m_selected_object_id]->volumes[volume_id]; - volume->mesh.translate(d.x,d.y,d.z); + volume->mesh.translate(d(0), d(1), d(2)); m_last_coords = m; m_parts_changed = true; @@ -407,17 +407,17 @@ wxSizer* object_movers(wxWindow *win) optgroup->m_on_change = [](t_config_option_key opt_key, boost::any value){ int val = boost::any_cast(value); bool update = false; - if (opt_key == "x" && m_move_options.x != val){ + if (opt_key == "x" && m_move_options(0) != val){ update = true; - m_move_options.x = val; + m_move_options(0) = val; } - else if (opt_key == "y" && m_move_options.y != val){ + else if (opt_key == "y" && m_move_options(1) != val){ update = true; - m_move_options.y = val; + m_move_options(1) = val; } - else if (opt_key == "z" && m_move_options.z != val){ + else if (opt_key == "z" && m_move_options(2) != val){ update = true; - m_move_options.z = val; + m_move_options(2) = val; } if (update) update_after_moving(); }; @@ -448,8 +448,8 @@ wxSizer* object_movers(wxWindow *win) m_sizer_object_movers = optgroup->sizer; m_sizer_object_movers->Show(false); - m_move_options = Point3(0, 0, 0); - m_last_coords = Point3(0, 0, 0); + m_move_options = Vec3d(0, 0, 0); + m_last_coords = Vec3d(0, 0, 0); return optgroup->sizer; } @@ -1122,9 +1122,9 @@ void load_part( wxWindow* parent, ModelObject* model_object, part_names.Add(new_volume->name); // apply the same translation we applied to the object - new_volume->mesh.translate( model_object->origin_translation.x, - model_object->origin_translation.y, - model_object->origin_translation.y ); + new_volume->mesh.translate( model_object->origin_translation(0), + model_object->origin_translation(1), + model_object->origin_translation(2) ); // set a default extruder value, since user can't add it manually new_volume->config.set_key_value("extruder", new ConfigOptionInt(0)); @@ -1162,9 +1162,9 @@ void load_lambda( wxWindow* parent, ModelObject* model_object, break;} case LambdaTypeSlab:{ const auto& size = model_object->bounding_box().size(); - mesh = make_cube(size.x*1.5, size.y*1.5, params.slab_h); + mesh = make_cube(size(0)*1.5, size(1)*1.5, params.slab_h); // box sets the base coordinate at 0, 0, move to center of plate and move it up to initial_z - mesh.translate(-size.x*1.5 / 2.0, -size.y*1.5 / 2.0, params.slab_z); + mesh.translate(-size(0)*1.5 / 2.0, -size(1)*1.5 / 2.0, params.slab_z); name += "Slab"; break; } default: @@ -1514,7 +1514,7 @@ void update_scale_values() (*m_objects)[m_selected_object_id]->instances[0]->scaling_factor); } -void update_scale_values(const Pointf3& size, float scaling_factor) +void update_scale_values(const Vec3d& size, float scaling_factor) { auto og = get_optgroup(ogFrequentlyObjectSettings); @@ -1525,9 +1525,9 @@ void update_scale_values(const Pointf3& size, float scaling_factor) og->set_value("scale_z", int(scale)); } else { - og->set_value("scale_x", int(size.x + 0.5)); - og->set_value("scale_y", int(size.y + 0.5)); - og->set_value("scale_z", int(size.z + 0.5)); + og->set_value("scale_x", int(size(0) + 0.5)); + og->set_value("scale_y", int(size(1) + 0.5)); + og->set_value("scale_z", int(size(2) + 0.5)); } } diff --git a/xs/src/slic3r/GUI/GUI_ObjectParts.hpp b/xs/src/slic3r/GUI/GUI_ObjectParts.hpp index 15be90bbf..8c6bd2ed0 100644 --- a/xs/src/slic3r/GUI/GUI_ObjectParts.hpp +++ b/xs/src/slic3r/GUI/GUI_ObjectParts.hpp @@ -108,7 +108,7 @@ void set_extruder_column_hidden(bool hide); void update_extruder_in_config(const wxString& selection); // update scale values after scale unit changing or "gizmos" void update_scale_values(); -void update_scale_values(const Pointf3& size, float scale); +void update_scale_values(const Vec3d& size, float scale); // update rotation values object selection changing void update_rotation_values(); // update rotation value after "gizmos"