diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 50cc028a9..6ffd0b621 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -1609,7 +1609,7 @@ void GLCanvas3D::Selection::rotate(const Vec3d& rotation, bool local) else if (is_single_volume() || is_single_modifier()) #if ENABLE_WORLD_ROTATIONS { - if (requires_local_axes()) + if (local) (*m_volumes)[i]->set_volume_rotation(rotation); else { diff --git a/src/slic3r/GUI/GUI_ObjectManipulation.cpp b/src/slic3r/GUI/GUI_ObjectManipulation.cpp index 7c6ac111a..3e6fe228c 100644 --- a/src/slic3r/GUI/GUI_ObjectManipulation.cpp +++ b/src/slic3r/GUI/GUI_ObjectManipulation.cpp @@ -497,7 +497,11 @@ void ObjectManipulation::change_rotation_value(const Vec3d& rotation) } canvas->get_selection().start_dragging(); +#if ENABLE_IMPROVED_SIDEBAR_OBJECTS_MANIPULATION + canvas->get_selection().rotate(rad_rotation, selection.is_single_full_instance() || selection.requires_local_axes()); +#else canvas->get_selection().rotate(rad_rotation, selection.is_single_full_instance()); +#endif // ENABLE_IMPROVED_SIDEBAR_OBJECTS_MANIPULATION canvas->do_rotate(); #if ENABLE_IMPROVED_SIDEBAR_OBJECTS_MANIPULATION diff --git a/src/slic3r/GUI/GUI_ObjectSettings.hpp b/src/slic3r/GUI/GUI_ObjectSettings.hpp index 19140efe3..3e72713bf 100644 --- a/src/slic3r/GUI/GUI_ObjectSettings.hpp +++ b/src/slic3r/GUI/GUI_ObjectSettings.hpp @@ -24,7 +24,7 @@ public: virtual void Hide(); virtual void UpdateAndShow(const bool show); - wxSizer* get_sizer(); + virtual wxSizer* get_sizer(); ConfigOptionsGroup* get_og() { return m_og.get(); } }; diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 7015084cd..a6ad715d5 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -286,12 +286,17 @@ class FreqChangedParams : public OG_Settings { double m_brim_width = 0.0; wxButton* m_wiping_dialog_button{ nullptr }; + wxSizer* m_sizer {nullptr}; + + std::shared_ptr m_og_sla; public: FreqChangedParams(wxWindow* parent, const int label_width); ~FreqChangedParams() {} wxButton* get_wiping_dialog_button() { return m_wiping_dialog_button; } - void Show(const bool show); + wxSizer* get_sizer() override; + ConfigOptionsGroup* get_og(const bool is_fff); + void Show(const bool is_fff); }; FreqChangedParams::FreqChangedParams(wxWindow* parent, const int label_width) : @@ -299,22 +304,13 @@ FreqChangedParams::FreqChangedParams(wxWindow* parent, const int label_width) : { DynamicPrintConfig* config = &wxGetApp().preset_bundle->prints.get_edited_preset().config; + // Frequently changed parameters for FFF_technology m_og->set_config(config); m_og->label_width = label_width; m_og->m_on_change = [config, this](t_config_option_key opt_key, boost::any value) { - TabPrint* tab_print = nullptr; - for (size_t i = 0; i < wxGetApp().tab_panel()->GetPageCount(); ++i) { - Tab *tab = dynamic_cast(wxGetApp().tab_panel()->GetPage(i)); - if (!tab) - continue; - if (tab->name() == "print") { - tab_print = static_cast(tab); - break; - } - } - if (tab_print == nullptr) - return; + Tab* tab_print = wxGetApp().get_tab(Preset::TYPE_PRINT); + if (!tab_print) return; if (opt_key == "fill_density") { value = m_og->get_config_value(*config, opt_key); @@ -413,19 +409,56 @@ FreqChangedParams::FreqChangedParams(wxWindow* parent, const int label_width) : return sizer; }; m_og->append_line(line); + + + // Frequently changed parameters for SLA_technology + m_og_sla = std::make_shared(parent, ""); + DynamicPrintConfig* config_sla = &wxGetApp().preset_bundle->sla_prints.get_edited_preset().config; + m_og_sla->set_config(config_sla); + m_og_sla->label_width = label_width*2; + + m_og_sla->m_on_change = [config_sla, this](t_config_option_key opt_key, boost::any value) { + Tab* tab = wxGetApp().get_tab(Preset::TYPE_SLA_PRINT); + if (!tab) return; + + tab->set_value(opt_key, value); + + DynamicPrintConfig new_conf = *config_sla; + new_conf.set_key_value(opt_key, new ConfigOptionBool(boost::any_cast(value))); + tab->load_config(new_conf); + tab->update_dirty(); + }; + + m_og_sla->append_single_option_line("supports_enable"); + m_og_sla->append_single_option_line("pad_enable"); + + m_sizer = new wxBoxSizer(wxVERTICAL); + m_sizer->Add(m_og->sizer, 0, wxEXPAND); + m_sizer->Add(m_og_sla->sizer, 0, wxEXPAND | wxTOP, 5); } -void FreqChangedParams::Show(const bool show) +wxSizer* FreqChangedParams::get_sizer() { - bool is_wdb_shown = m_wiping_dialog_button->IsShown(); - m_og->Show(show); + return m_sizer; +} + +void FreqChangedParams::Show(const bool is_fff) +{ + const bool is_wdb_shown = m_wiping_dialog_button->IsShown(); + m_og->Show(is_fff); + m_og_sla->Show(!is_fff); // correct showing of the FreqChangedParams sizer when m_wiping_dialog_button is hidden - if (show && !is_wdb_shown) + if (is_fff && !is_wdb_shown) m_wiping_dialog_button->Hide(); } +ConfigOptionsGroup* FreqChangedParams::get_og(const bool is_fff) +{ + return is_fff ? m_og.get() : m_og_sla.get(); +} + // Sidebar / private struct Sidebar::priv @@ -703,9 +736,9 @@ wxScrolledWindow* Sidebar::scrolled_panel() return p->scrolled; } -ConfigOptionsGroup* Sidebar::og_freq_chng_params() +ConfigOptionsGroup* Sidebar::og_freq_chng_params(const bool is_fff) { - return p->frequently_changed_parameters->get_og(); + return p->frequently_changed_parameters->get_og(is_fff); } wxButton* Sidebar::get_wiping_dialog_button() diff --git a/src/slic3r/GUI/Plater.hpp b/src/slic3r/GUI/Plater.hpp index 373d7dc28..7b19d6f31 100644 --- a/src/slic3r/GUI/Plater.hpp +++ b/src/slic3r/GUI/Plater.hpp @@ -76,7 +76,7 @@ public: ObjectSettings* obj_settings(); wxScrolledWindow* scrolled_panel(); - ConfigOptionsGroup* og_freq_chng_params(); + ConfigOptionsGroup* og_freq_chng_params(const bool is_fff); wxButton* get_wiping_dialog_button(); void update_objects_list_extruder_column(int extruders_count); void show_info_sizer(); diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index d78e9c695..452e3bf20 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -751,8 +751,8 @@ void Tab::on_value_change(const std::string& opt_key, const boost::any& value) wxPostEvent(this, event); - auto og_freq_chng_params = wxGetApp().sidebar().og_freq_chng_params(); - if (opt_key == "fill_density") + ConfigOptionsGroup* og_freq_chng_params = wxGetApp().sidebar().og_freq_chng_params(supports_printer_technology(ptFFF)); + if (opt_key == "fill_density" || opt_key == "supports_enable" || opt_key == "pad_enable") { boost::any val = og_freq_chng_params->get_config_value(*m_config, opt_key); og_freq_chng_params->set_value(opt_key, val); @@ -881,8 +881,20 @@ void Tab::update_preset_description_line() void Tab::update_frequently_changed_parameters() { - auto og_freq_chng_params = wxGetApp().sidebar().og_freq_chng_params(); + auto og_freq_chng_params = wxGetApp().sidebar().og_freq_chng_params(supports_printer_technology(ptFFF)); if (!og_freq_chng_params) return; + + if (m_type == Preset::TYPE_SLA_PRINT) + { + for (auto opt_key : { "supports_enable", "pad_enable" }) + { + boost::any val = og_freq_chng_params->get_config_value(*m_config, opt_key); + og_freq_chng_params->set_value(opt_key, val); + } + return; + } + + // for m_type == Preset::TYPE_PRINT boost::any value = og_freq_chng_params->get_config_value(*m_config, "fill_density"); og_freq_chng_params->set_value("fill_density", value); @@ -2370,7 +2382,7 @@ void Tab::load_current_preset() } else { on_presets_changed(); - if (m_name == "print") + if (m_type == Preset::TYPE_SLA_PRINT || m_type == Preset::TYPE_PRINT)// if (m_name == "print") update_frequently_changed_parameters(); }