Merge branch 'master' of https://github.com/Prusa3d/Slic3r
This commit is contained in:
commit
7cb90956ee
6 changed files with 75 additions and 26 deletions
|
@ -1609,7 +1609,7 @@ void GLCanvas3D::Selection::rotate(const Vec3d& rotation, bool local)
|
||||||
else if (is_single_volume() || is_single_modifier())
|
else if (is_single_volume() || is_single_modifier())
|
||||||
#if ENABLE_WORLD_ROTATIONS
|
#if ENABLE_WORLD_ROTATIONS
|
||||||
{
|
{
|
||||||
if (requires_local_axes())
|
if (local)
|
||||||
(*m_volumes)[i]->set_volume_rotation(rotation);
|
(*m_volumes)[i]->set_volume_rotation(rotation);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -497,7 +497,11 @@ void ObjectManipulation::change_rotation_value(const Vec3d& rotation)
|
||||||
}
|
}
|
||||||
|
|
||||||
canvas->get_selection().start_dragging();
|
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());
|
canvas->get_selection().rotate(rad_rotation, selection.is_single_full_instance());
|
||||||
|
#endif // ENABLE_IMPROVED_SIDEBAR_OBJECTS_MANIPULATION
|
||||||
canvas->do_rotate();
|
canvas->do_rotate();
|
||||||
|
|
||||||
#if ENABLE_IMPROVED_SIDEBAR_OBJECTS_MANIPULATION
|
#if ENABLE_IMPROVED_SIDEBAR_OBJECTS_MANIPULATION
|
||||||
|
|
|
@ -24,7 +24,7 @@ public:
|
||||||
virtual void Hide();
|
virtual void Hide();
|
||||||
virtual void UpdateAndShow(const bool show);
|
virtual void UpdateAndShow(const bool show);
|
||||||
|
|
||||||
wxSizer* get_sizer();
|
virtual wxSizer* get_sizer();
|
||||||
ConfigOptionsGroup* get_og() { return m_og.get(); }
|
ConfigOptionsGroup* get_og() { return m_og.get(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -286,12 +286,17 @@ class FreqChangedParams : public OG_Settings
|
||||||
{
|
{
|
||||||
double m_brim_width = 0.0;
|
double m_brim_width = 0.0;
|
||||||
wxButton* m_wiping_dialog_button{ nullptr };
|
wxButton* m_wiping_dialog_button{ nullptr };
|
||||||
|
wxSizer* m_sizer {nullptr};
|
||||||
|
|
||||||
|
std::shared_ptr<ConfigOptionsGroup> m_og_sla;
|
||||||
public:
|
public:
|
||||||
FreqChangedParams(wxWindow* parent, const int label_width);
|
FreqChangedParams(wxWindow* parent, const int label_width);
|
||||||
~FreqChangedParams() {}
|
~FreqChangedParams() {}
|
||||||
|
|
||||||
wxButton* get_wiping_dialog_button() { return m_wiping_dialog_button; }
|
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) :
|
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;
|
DynamicPrintConfig* config = &wxGetApp().preset_bundle->prints.get_edited_preset().config;
|
||||||
|
|
||||||
|
// Frequently changed parameters for FFF_technology
|
||||||
m_og->set_config(config);
|
m_og->set_config(config);
|
||||||
m_og->label_width = label_width;
|
m_og->label_width = label_width;
|
||||||
|
|
||||||
m_og->m_on_change = [config, this](t_config_option_key opt_key, boost::any value) {
|
m_og->m_on_change = [config, this](t_config_option_key opt_key, boost::any value) {
|
||||||
TabPrint* tab_print = nullptr;
|
Tab* tab_print = wxGetApp().get_tab(Preset::TYPE_PRINT);
|
||||||
for (size_t i = 0; i < wxGetApp().tab_panel()->GetPageCount(); ++i) {
|
if (!tab_print) return;
|
||||||
Tab *tab = dynamic_cast<Tab*>(wxGetApp().tab_panel()->GetPage(i));
|
|
||||||
if (!tab)
|
|
||||||
continue;
|
|
||||||
if (tab->name() == "print") {
|
|
||||||
tab_print = static_cast<TabPrint*>(tab);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (tab_print == nullptr)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (opt_key == "fill_density") {
|
if (opt_key == "fill_density") {
|
||||||
value = m_og->get_config_value(*config, opt_key);
|
value = m_og->get_config_value(*config, opt_key);
|
||||||
|
@ -413,19 +409,56 @@ FreqChangedParams::FreqChangedParams(wxWindow* parent, const int label_width) :
|
||||||
return sizer;
|
return sizer;
|
||||||
};
|
};
|
||||||
m_og->append_line(line);
|
m_og->append_line(line);
|
||||||
|
|
||||||
|
|
||||||
|
// Frequently changed parameters for SLA_technology
|
||||||
|
m_og_sla = std::make_shared<ConfigOptionsGroup>(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<bool>(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();
|
return m_sizer;
|
||||||
m_og->Show(show);
|
}
|
||||||
|
|
||||||
|
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
|
// 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();
|
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
|
// Sidebar / private
|
||||||
|
|
||||||
struct Sidebar::priv
|
struct Sidebar::priv
|
||||||
|
@ -703,9 +736,9 @@ wxScrolledWindow* Sidebar::scrolled_panel()
|
||||||
return p->scrolled;
|
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()
|
wxButton* Sidebar::get_wiping_dialog_button()
|
||||||
|
|
|
@ -76,7 +76,7 @@ public:
|
||||||
ObjectSettings* obj_settings();
|
ObjectSettings* obj_settings();
|
||||||
wxScrolledWindow* scrolled_panel();
|
wxScrolledWindow* scrolled_panel();
|
||||||
|
|
||||||
ConfigOptionsGroup* og_freq_chng_params();
|
ConfigOptionsGroup* og_freq_chng_params(const bool is_fff);
|
||||||
wxButton* get_wiping_dialog_button();
|
wxButton* get_wiping_dialog_button();
|
||||||
void update_objects_list_extruder_column(int extruders_count);
|
void update_objects_list_extruder_column(int extruders_count);
|
||||||
void show_info_sizer();
|
void show_info_sizer();
|
||||||
|
|
|
@ -751,8 +751,8 @@ void Tab::on_value_change(const std::string& opt_key, const boost::any& value)
|
||||||
wxPostEvent(this, event);
|
wxPostEvent(this, event);
|
||||||
|
|
||||||
|
|
||||||
auto og_freq_chng_params = wxGetApp().sidebar().og_freq_chng_params();
|
ConfigOptionsGroup* og_freq_chng_params = wxGetApp().sidebar().og_freq_chng_params(supports_printer_technology(ptFFF));
|
||||||
if (opt_key == "fill_density")
|
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);
|
boost::any val = og_freq_chng_params->get_config_value(*m_config, opt_key);
|
||||||
og_freq_chng_params->set_value(opt_key, val);
|
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()
|
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 (!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");
|
boost::any value = og_freq_chng_params->get_config_value(*m_config, "fill_density");
|
||||||
og_freq_chng_params->set_value("fill_density", value);
|
og_freq_chng_params->set_value("fill_density", value);
|
||||||
|
|
||||||
|
@ -2370,7 +2382,7 @@ void Tab::load_current_preset()
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
on_presets_changed();
|
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();
|
update_frequently_changed_parameters();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue