Merge remote-tracking branch 'origin/master' into tm_colldetection_upgr
This commit is contained in:
commit
f876908c0e
5 changed files with 84 additions and 52 deletions
|
@ -587,8 +587,10 @@ namespace Slic3r {
|
||||||
object.second->layer_height_profile = obj_layer_heights_profile->second;
|
object.second->layer_height_profile = obj_layer_heights_profile->second;
|
||||||
|
|
||||||
IdToSlaSupportPointsMap::iterator obj_sla_support_points = m_sla_support_points.find(object.first);
|
IdToSlaSupportPointsMap::iterator obj_sla_support_points = m_sla_support_points.find(object.first);
|
||||||
if (obj_sla_support_points != m_sla_support_points.end() && !obj_sla_support_points->second.empty())
|
if (obj_sla_support_points != m_sla_support_points.end() && !obj_sla_support_points->second.empty()) {
|
||||||
object.second->sla_support_points = obj_sla_support_points->second;
|
object.second->sla_support_points = obj_sla_support_points->second;
|
||||||
|
object.second->sla_points_status = sla::PointsStatus::UserModified;
|
||||||
|
}
|
||||||
|
|
||||||
IdToMetadataMap::iterator obj_metadata = m_objects_metadata.find(object.first);
|
IdToMetadataMap::iterator obj_metadata = m_objects_metadata.find(object.first);
|
||||||
if (obj_metadata != m_objects_metadata.end())
|
if (obj_metadata != m_objects_metadata.end())
|
||||||
|
|
|
@ -600,6 +600,7 @@ void AMFParserContext::endElement(const char * /* name */)
|
||||||
break;
|
break;
|
||||||
p = end + 1;
|
p = end + 1;
|
||||||
}
|
}
|
||||||
|
m_object->sla_points_status = sla::PointsStatus::UserModified;
|
||||||
}
|
}
|
||||||
else if (m_path.size() == 5 && m_path[3] == NODE_TYPE_VOLUME && m_volume) {
|
else if (m_path.size() == 5 && m_path[3] == NODE_TYPE_VOLUME && m_volume) {
|
||||||
if (strcmp(opt_key, "modifier") == 0) {
|
if (strcmp(opt_key, "modifier") == 0) {
|
||||||
|
|
|
@ -1773,8 +1773,10 @@ void GLGizmoSlaSupports::set_sla_support_data(ModelObject* model_object, const G
|
||||||
|
|
||||||
if (model_object && selection.is_from_single_instance())
|
if (model_object && selection.is_from_single_instance())
|
||||||
{
|
{
|
||||||
if (is_mesh_update_necessary())
|
if (is_mesh_update_necessary()) {
|
||||||
update_mesh();
|
update_mesh();
|
||||||
|
editing_mode_reload_cache();
|
||||||
|
}
|
||||||
|
|
||||||
if (m_model_object != m_old_model_object)
|
if (m_model_object != m_old_model_object)
|
||||||
m_editing_mode = false;
|
m_editing_mode = false;
|
||||||
|
@ -1953,9 +1955,6 @@ void GLGizmoSlaSupports::update_mesh()
|
||||||
|
|
||||||
m_AABB = igl::AABB<Eigen::MatrixXf,3>();
|
m_AABB = igl::AABB<Eigen::MatrixXf,3>();
|
||||||
m_AABB.init(m_V, m_F);
|
m_AABB.init(m_V, m_F);
|
||||||
|
|
||||||
// we'll now reload support points (selection might have changed):
|
|
||||||
editing_mode_reload_cache();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Vec3f GLGizmoSlaSupports::unproject_on_mesh(const Vec2d& mouse_pos)
|
Vec3f GLGizmoSlaSupports::unproject_on_mesh(const Vec2d& mouse_pos)
|
||||||
|
@ -2441,17 +2440,19 @@ std::string GLGizmoSlaSupports::on_get_name() const
|
||||||
|
|
||||||
void GLGizmoSlaSupports::on_set_state()
|
void GLGizmoSlaSupports::on_set_state()
|
||||||
{
|
{
|
||||||
if (m_state == On) {
|
if (m_state == On && m_old_state != On) { // the gizmo was just turned on
|
||||||
if (is_mesh_update_necessary())
|
if (is_mesh_update_necessary())
|
||||||
update_mesh();
|
update_mesh();
|
||||||
|
|
||||||
|
// we'll now reload support points:
|
||||||
|
if (m_model_object)
|
||||||
|
editing_mode_reload_cache();
|
||||||
|
|
||||||
m_parent.toggle_model_objects_visibility(false);
|
m_parent.toggle_model_objects_visibility(false);
|
||||||
if (m_model_object)
|
if (m_model_object)
|
||||||
m_parent.toggle_model_objects_visibility(true, m_model_object, m_active_instance);
|
m_parent.toggle_model_objects_visibility(true, m_model_object, m_active_instance);
|
||||||
}
|
}
|
||||||
if (m_state == Off) {
|
if (m_state == Off && m_old_state != Off) { // the gizmo was just turned Off
|
||||||
if (m_old_state != Off) { // the gizmo was just turned Off
|
|
||||||
|
|
||||||
if (m_model_object) {
|
if (m_model_object) {
|
||||||
if (m_unsaved_changes) {
|
if (m_unsaved_changes) {
|
||||||
wxMessageDialog dlg(GUI::wxGetApp().plater(), _(L("Do you want to save your manually edited support points ?\n")),
|
wxMessageDialog dlg(GUI::wxGetApp().plater(), _(L("Do you want to save your manually edited support points ?\n")),
|
||||||
|
@ -2467,7 +2468,6 @@ void GLGizmoSlaSupports::on_set_state()
|
||||||
m_editing_mode = false; // so it is not active next time the gizmo opens
|
m_editing_mode = false; // so it is not active next time the gizmo opens
|
||||||
m_editing_mode_cache.clear();
|
m_editing_mode_cache.clear();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
m_old_state = m_state;
|
m_old_state = m_state;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -365,20 +365,20 @@ FreqChangedParams::FreqChangedParams(wxWindow* parent, const int label_width) :
|
||||||
|
|
||||||
Line line = Line { "", "" };
|
Line line = Line { "", "" };
|
||||||
|
|
||||||
ConfigOptionDef def;
|
ConfigOptionDef support_def;
|
||||||
def.label = L("Supports");
|
support_def.label = L("Supports");
|
||||||
def.type = coStrings;
|
support_def.type = coStrings;
|
||||||
def.gui_type = "select_open";
|
support_def.gui_type = "select_open";
|
||||||
def.tooltip = L("Select what kind of support do you need");
|
support_def.tooltip = L("Select what kind of support do you need");
|
||||||
def.enum_labels.push_back(L("None"));
|
support_def.enum_labels.push_back(L("None"));
|
||||||
def.enum_labels.push_back(L("Support on build plate only"));
|
support_def.enum_labels.push_back(L("Support on build plate only"));
|
||||||
def.enum_labels.push_back(L("Everywhere"));
|
support_def.enum_labels.push_back(L("Everywhere"));
|
||||||
const std::string selection = !config->opt_bool("support_material") ?
|
std::string selection = !config->opt_bool("support_material") ?
|
||||||
"None" : config->opt_bool("support_material_buildplate_only") ?
|
"None" : config->opt_bool("support_material_buildplate_only") ?
|
||||||
"Support on build plate only" :
|
"Support on build plate only" :
|
||||||
"Everywhere";
|
"Everywhere";
|
||||||
def.default_value = new ConfigOptionStrings{ selection };
|
support_def.default_value = new ConfigOptionStrings{ selection };
|
||||||
Option option = Option(def, "support");
|
Option option = Option(support_def, "support");
|
||||||
option.opt.full_width = true;
|
option.opt.full_width = true;
|
||||||
line.append_option(option);
|
line.append_option(option);
|
||||||
m_og->append_line(line);
|
m_og->append_line(line);
|
||||||
|
@ -393,6 +393,7 @@ FreqChangedParams::FreqChangedParams(wxWindow* parent, const int label_width) :
|
||||||
line.append_option(option);
|
line.append_option(option);
|
||||||
|
|
||||||
m_brim_width = config->opt_float("brim_width");
|
m_brim_width = config->opt_float("brim_width");
|
||||||
|
ConfigOptionDef def;
|
||||||
def.label = L("Brim");
|
def.label = L("Brim");
|
||||||
def.type = coBool;
|
def.type = coBool;
|
||||||
def.tooltip = L("This flag enables the brim that will be printed around each object on the first layer.");
|
def.tooltip = L("This flag enables the brim that will be printed around each object on the first layer.");
|
||||||
|
@ -428,6 +429,7 @@ FreqChangedParams::FreqChangedParams(wxWindow* parent, const int label_width) :
|
||||||
|
|
||||||
m_og->append_line(line);
|
m_og->append_line(line);
|
||||||
|
|
||||||
|
|
||||||
// Frequently changed parameters for SLA_technology
|
// Frequently changed parameters for SLA_technology
|
||||||
m_og_sla = std::make_shared<ConfigOptionsGroup>(parent, "");
|
m_og_sla = std::make_shared<ConfigOptionsGroup>(parent, "");
|
||||||
DynamicPrintConfig* config_sla = &wxGetApp().preset_bundle->sla_prints.get_edited_preset().config;
|
DynamicPrintConfig* config_sla = &wxGetApp().preset_bundle->sla_prints.get_edited_preset().config;
|
||||||
|
@ -438,20 +440,43 @@ FreqChangedParams::FreqChangedParams(wxWindow* parent, const int label_width) :
|
||||||
Tab* tab = wxGetApp().get_tab(Preset::TYPE_SLA_PRINT);
|
Tab* tab = wxGetApp().get_tab(Preset::TYPE_SLA_PRINT);
|
||||||
if (!tab) return;
|
if (!tab) return;
|
||||||
|
|
||||||
|
if (opt_key == "pad_enable") {
|
||||||
tab->set_value(opt_key, value);
|
tab->set_value(opt_key, value);
|
||||||
|
tab->update();
|
||||||
|
}
|
||||||
|
else //(opt_key == "support")
|
||||||
|
{
|
||||||
DynamicPrintConfig new_conf = *config_sla;
|
DynamicPrintConfig new_conf = *config_sla;
|
||||||
new_conf.set_key_value(opt_key, new ConfigOptionBool(boost::any_cast<bool>(value)));
|
const wxString& selection = boost::any_cast<wxString>(value);
|
||||||
|
|
||||||
|
const bool supports_enable = selection == _("None") ? false : true;
|
||||||
|
new_conf.set_key_value("supports_enable", new ConfigOptionBool(supports_enable));
|
||||||
|
|
||||||
|
if (selection == _("Everywhere"))
|
||||||
|
new_conf.set_key_value("support_buildplate_only", new ConfigOptionBool(false));
|
||||||
|
else if (selection == _("Support on build plate only"))
|
||||||
|
new_conf.set_key_value("support_buildplate_only", new ConfigOptionBool(true));
|
||||||
|
|
||||||
tab->load_config(new_conf);
|
tab->load_config(new_conf);
|
||||||
|
}
|
||||||
|
|
||||||
tab->update_dirty();
|
tab->update_dirty();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
line = Line{ "", "" };
|
line = Line{ "", "" };
|
||||||
|
|
||||||
option = m_og_sla->get_option("supports_enable");
|
selection = !config_sla->opt_bool("supports_enable") ?
|
||||||
option.opt.sidetext = " ";
|
"None" : config_sla->opt_bool("support_buildplate_only") ?
|
||||||
|
"Support on build plate only" :
|
||||||
|
"Everywhere";
|
||||||
|
support_def.default_value = new ConfigOptionStrings{ selection };
|
||||||
|
option = Option(support_def, "support");
|
||||||
|
option.opt.full_width = true;
|
||||||
line.append_option(option);
|
line.append_option(option);
|
||||||
|
m_og_sla->append_line(line);
|
||||||
|
|
||||||
|
|
||||||
|
line = Line{ "", "" };
|
||||||
|
|
||||||
option = m_og_sla->get_option("pad_enable");
|
option = m_og_sla->get_option("pad_enable");
|
||||||
option.opt.sidetext = " ";
|
option.opt.sidetext = " ";
|
||||||
|
|
|
@ -751,21 +751,25 @@ void Tab::load_key_value(const std::string& opt_key, const boost::any& value, bo
|
||||||
|
|
||||||
void Tab::on_value_change(const std::string& opt_key, const boost::any& value)
|
void Tab::on_value_change(const std::string& opt_key, const boost::any& value)
|
||||||
{
|
{
|
||||||
ConfigOptionsGroup* og_freq_chng_params = wxGetApp().sidebar().og_freq_chng_params(supports_printer_technology(ptFFF));
|
const bool is_fff = supports_printer_technology(ptFFF);
|
||||||
if (opt_key == "fill_density" || opt_key == "supports_enable" || opt_key == "pad_enable")
|
ConfigOptionsGroup* og_freq_chng_params = wxGetApp().sidebar().og_freq_chng_params(is_fff);
|
||||||
|
if (opt_key == "fill_density" || 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);
|
||||||
}
|
}
|
||||||
if (opt_key == "support_material" || opt_key == "support_material_buildplate_only")
|
|
||||||
|
if ( is_fff && (opt_key == "support_material" || opt_key == "support_material_buildplate_only") ||
|
||||||
|
!is_fff && (opt_key == "supports_enable" || opt_key == "support_buildplate_only"))
|
||||||
{
|
{
|
||||||
wxString new_selection = !m_config->opt_bool("support_material") ?
|
const std::string support = is_fff ? "support_material" : "supports_enable";
|
||||||
_("None") :
|
const std::string buildplate_only = is_fff ? "support_material_buildplate_only" : "support_buildplate_only";
|
||||||
m_config->opt_bool("support_material_buildplate_only") ?
|
wxString new_selection = !m_config->opt_bool(support) ? _("None") :
|
||||||
_("Support on build plate only") :
|
m_config->opt_bool(buildplate_only) ? _("Support on build plate only") :
|
||||||
_("Everywhere");
|
_("Everywhere");
|
||||||
og_freq_chng_params->set_value("support", new_selection);
|
og_freq_chng_params->set_value("support", new_selection);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (opt_key == "brim_width")
|
if (opt_key == "brim_width")
|
||||||
{
|
{
|
||||||
bool val = m_config->opt_float("brim_width") > 0.0 ? true : false;
|
bool val = m_config->opt_float("brim_width") > 0.0 ? true : false;
|
||||||
|
|
Loading…
Reference in a new issue