Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorYuSanka <yusanka@gmail.com>2021-05-24 18:30:07 +0300
committerYuSanka <yusanka@gmail.com>2021-05-24 18:32:40 +0300
commitcf76b5c2642e513d46efa2472f337816e48d1db1 (patch)
tree63ea26798fffc26bf7aeefe250133a899877f152 /src
parent72d1faa03ea545ba19fb09049e75c067e72737c2 (diff)
Added "Negative volume" type item to the ObjectList
Diffstat (limited to 'src')
-rw-r--r--src/slic3r/GUI/GUI_Factories.cpp3
-rw-r--r--src/slic3r/GUI/GUI_ObjectList.cpp9
2 files changed, 6 insertions, 6 deletions
diff --git a/src/slic3r/GUI/GUI_Factories.cpp b/src/slic3r/GUI/GUI_Factories.cpp
index 01ea53ad3..a67589dd7 100644
--- a/src/slic3r/GUI/GUI_Factories.cpp
+++ b/src/slic3r/GUI/GUI_Factories.cpp
@@ -154,6 +154,7 @@ wxBitmap SettingsFactory::get_category_bitmap(const std::string& category_name)
std::vector<std::pair<std::string, std::string>> MenuFactory::ADD_VOLUME_MENU_ITEMS = {
// menu_item Name menu_item bitmap name
{L("Add part"), "add_part" }, // ~ModelVolumeType::MODEL_PART
+ {L("Add negative volume"), "add_negative" }, // ~ModelVolumeType::NEGATIVE_VOLUME
{L("Add modifier"), "add_modifier"}, // ~ModelVolumeType::PARAMETER_MODIFIER
{L("Add support enforcer"), "support_enforcer"}, // ~ModelVolumeType::SUPPORT_ENFORCER
{L("Add support blocker"), "support_blocker"} // ~ModelVolumeType::SUPPORT_BLOCKER
@@ -500,7 +501,7 @@ wxMenuItem* MenuFactory::append_menu_item_settings(wxMenu* menu_)
return nullptr;
const auto sel_vol = obj_list()->get_selected_model_volume();
- if (sel_vol && sel_vol->type() >= ModelVolumeType::SUPPORT_ENFORCER)
+ if (sel_vol && sel_vol->type() != ModelVolumeType::MODEL_PART && sel_vol->type() != ModelVolumeType::PARAMETER_MODIFIER )
return nullptr;
const ConfigOptionMode mode = wxGetApp().get_mode();
diff --git a/src/slic3r/GUI/GUI_ObjectList.cpp b/src/slic3r/GUI/GUI_ObjectList.cpp
index c371da2a7..58f94a289 100644
--- a/src/slic3r/GUI/GUI_ObjectList.cpp
+++ b/src/slic3r/GUI/GUI_ObjectList.cpp
@@ -2271,7 +2271,7 @@ wxDataViewItem ObjectList::add_settings_item(wxDataViewItem parent_item, const D
const bool is_object_settings = m_objects_model->GetItemType(parent_item) == itObject;
if (!is_object_settings) {
ModelVolumeType volume_type = m_objects_model->GetVolumeType(parent_item);
- if (volume_type == ModelVolumeType::SUPPORT_BLOCKER || volume_type == ModelVolumeType::SUPPORT_ENFORCER)
+ if (volume_type == ModelVolumeType::NEGATIVE_VOLUME || volume_type == ModelVolumeType::SUPPORT_BLOCKER || volume_type == ModelVolumeType::SUPPORT_ENFORCER)
return ret;
}
@@ -3437,9 +3437,8 @@ void ObjectList::change_part_type()
}
}
- const wxString names[] = { _(L("Part")), _(L("Modifier")), _(L("Support Enforcer")), _(L("Support Blocker")) };
-
- auto new_type = ModelVolumeType(wxGetSingleChoiceIndex(_(L("Type:")), _(L("Select type of part")), wxArrayString(4, names), int(type)));
+ const wxString names[] = { _L("Part"), _L("Negative Volume"), _L("Modifier"), _L("Support Enforcer"), _L("Support Blocker") };
+ auto new_type = ModelVolumeType(wxGetSingleChoiceIndex(_L("Type:"), _L("Select type of part"), wxArrayString(5, names), int(type)));
if (new_type == type || new_type == ModelVolumeType::INVALID)
return;
@@ -3458,7 +3457,7 @@ void ObjectList::change_part_type()
//(we show additional settings for Part and Modifier and hide it for Support Blocker/Enforcer)
const auto settings_item = m_objects_model->GetSettingsItem(item);
if (settings_item &&
- (new_type == ModelVolumeType::SUPPORT_ENFORCER || new_type == ModelVolumeType::SUPPORT_BLOCKER)) {
+ (new_type == ModelVolumeType::SUPPORT_ENFORCER || new_type == ModelVolumeType::SUPPORT_BLOCKER || new_type == ModelVolumeType::NEGATIVE_VOLUME)) {
m_objects_model->Delete(settings_item);
}
else if (!settings_item &&