Rename smsOrganic to smsTreeOrganic

This commit is contained in:
Noisyfox 2025-01-27 17:09:32 +08:00
parent 1c498664a5
commit cc9f29c463
9 changed files with 12 additions and 12 deletions

View file

@ -1166,7 +1166,7 @@ StringObjectException Print::validate(StringObjectException *warning, Polygons*
// Custom layering is not allowed for tree supports as of now.
for (size_t print_object_idx = 0; print_object_idx < m_objects.size(); ++ print_object_idx)
if (const PrintObject &print_object = *m_objects[print_object_idx];
print_object.has_support_material() && is_tree(print_object.config().support_type.value) && (print_object.config().support_style.value == smsOrganic ||
print_object.has_support_material() && is_tree(print_object.config().support_type.value) && (print_object.config().support_style.value == smsTreeOrganic ||
// Orca: use organic as default
print_object.config().support_style.value == smsDefault) &&
print_object.model_object()->has_custom_layering()) {
@ -1339,7 +1339,7 @@ StringObjectException Print::validate(StringObjectException *warning, Polygons*
// Prusa: Fixing crashes with invalid tip diameter or branch diameter
// https://github.com/prusa3d/PrusaSlicer/commit/96b3ae85013ac363cd1c3e98ec6b7938aeacf46d
if (is_tree(object->config().support_type.value) && (object->config().support_style == smsOrganic ||
if (is_tree(object->config().support_type.value) && (object->config().support_style == smsTreeOrganic ||
// Orca: use organic as default
object->config().support_style == smsDefault)) {
float extrusion_width = std::min(

View file

@ -230,7 +230,7 @@ static t_config_enum_values s_keys_map_SupportMaterialStyle {
{ "tree_slim", smsTreeSlim },
{ "tree_strong", smsTreeStrong },
{ "tree_hybrid", smsTreeHybrid },
{ "organic", smsOrganic }
{ "organic", smsTreeOrganic }
};
CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(SupportMaterialStyle)

View file

@ -132,7 +132,7 @@ enum SupportMaterialPattern {
};
enum SupportMaterialStyle {
smsDefault, smsGrid, smsSnug, smsTreeSlim, smsTreeStrong, smsTreeHybrid, smsOrganic,
smsDefault, smsGrid, smsSnug, smsTreeSlim, smsTreeStrong, smsTreeHybrid, smsTreeOrganic,
};
enum LongRectrationLevel

View file

@ -1808,7 +1808,7 @@ void generate_support_toolpaths(
filler->link_max_length = coord_t(scale_(filler->spacing * link_max_length_factor / density));
sheath = true;
no_sort = true;
} else if (support_params.support_style == SupportMaterialStyle::smsOrganic) {
} else if (support_params.support_style == SupportMaterialStyle::smsTreeOrganic) {
tree_supports_generate_paths(base_layer.extrusions, base_layer.polygons_to_extrude(), flow, support_params);
done = true;
}

View file

@ -678,7 +678,7 @@ public:
m_support_material_closing_radius(params.support_closing_radius)
{
if (m_style == smsDefault) m_style = smsGrid;
if (std::set<SupportMaterialStyle>{smsTreeSlim, smsTreeStrong, smsTreeHybrid, smsOrganic}.count(m_style))
if (std::set<SupportMaterialStyle>{smsTreeSlim, smsTreeStrong, smsTreeHybrid, smsTreeOrganic}.count(m_style))
m_style = smsGrid;
switch (m_style) {
case smsGrid:
@ -774,7 +774,7 @@ public:
case smsTreeSlim:
case smsTreeStrong:
case smsTreeHybrid:
case smsOrganic:
case smsTreeOrganic:
assert(false);
//[[fallthrough]];
return Polygons();

View file

@ -161,7 +161,7 @@ struct SupportParameters {
if (support_style == smsDefault) {
if (is_tree(object_config.support_type)) {
// Orca: use organic as default
support_style = smsOrganic;
support_style = smsTreeOrganic;
} else {
support_style = smsGrid;
}

View file

@ -1631,7 +1631,7 @@ void TreeSupport::generate_toolpaths()
void TreeSupport::generate()
{
if (m_support_params.support_style == smsOrganic) {
if (m_support_params.support_style == smsTreeOrganic) {
generate_tree_support_3D(*m_object, this, this->throw_on_cancel);
return;
}

View file

@ -426,7 +426,7 @@ void ConfigManipulation::update_print_fff_config(DynamicPrintConfig* config, con
auto support_type = config->opt_enum<SupportType>("support_type");
auto support_style = config->opt_enum<SupportMaterialStyle>("support_style");
std::set<int> enum_set_normal = { smsDefault, smsGrid, smsSnug };
std::set<int> enum_set_tree = { smsDefault, smsTreeSlim, smsTreeStrong, smsTreeHybrid, smsOrganic };
std::set<int> enum_set_tree = { smsDefault, smsTreeSlim, smsTreeStrong, smsTreeHybrid, smsTreeOrganic };
auto & set = is_tree(support_type) ? enum_set_tree : enum_set_normal;
if (set.find(support_style) == set.end()) {
DynamicPrintConfig new_conf = *config;
@ -603,7 +603,7 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co
//toggle_field("support_closing_radius", have_support_material && support_style == smsSnug);
bool support_is_tree = config->opt_bool("enable_support") && is_tree(support_type);
bool support_is_normal_tree = support_is_tree && support_style != smsOrganic &&
bool support_is_normal_tree = support_is_tree && support_style != smsTreeOrganic &&
// Orca: use organic as default
support_style != smsDefault;
bool support_is_organic = support_is_tree && !support_is_normal_tree;

View file

@ -2441,7 +2441,7 @@ void TabPrint::toggle_options()
if (auto choice = dynamic_cast<Choice*>(field)) {
auto def = print_config_def.get("support_style");
std::vector<int> enum_set_normal = {smsDefault, smsGrid, smsSnug };
std::vector<int> enum_set_tree = { smsDefault, smsTreeSlim, smsTreeStrong, smsTreeHybrid, smsOrganic };
std::vector<int> enum_set_tree = { smsDefault, smsTreeSlim, smsTreeStrong, smsTreeHybrid, smsTreeOrganic };
auto & set = is_tree(support_type) ? enum_set_tree : enum_set_normal;
auto & opt = const_cast<ConfigOptionDef &>(field->m_opt);
auto cb = dynamic_cast<ComboBox *>(choice->window);