From ad8f27079687dfaed03b4da265a96c8b457d2642 Mon Sep 17 00:00:00 2001 From: YuSanka Date: Tue, 13 Nov 2018 13:34:31 +0100 Subject: [PATCH] Added delete_instance_from_list(obj_idx, inst_idx) function --- src/slic3r/GUI/GUI_ObjectList.cpp | 5 +++++ src/slic3r/GUI/GUI_ObjectList.hpp | 1 + 2 files changed, 6 insertions(+) diff --git a/src/slic3r/GUI/GUI_ObjectList.cpp b/src/slic3r/GUI/GUI_ObjectList.cpp index c52c3c7ba..11e261b5b 100644 --- a/src/slic3r/GUI/GUI_ObjectList.cpp +++ b/src/slic3r/GUI/GUI_ObjectList.cpp @@ -1155,6 +1155,11 @@ void ObjectList::delete_volume_from_list(const size_t obj_idx, const size_t vol_ select_item(m_objects_model->Delete(m_objects_model->GetItemByVolumeId(obj_idx, vol_idx))); } +void ObjectList::delete_instance_from_list(const size_t obj_idx, const size_t inst_idx) +{ + select_item(m_objects_model->Delete(m_objects_model->GetItemByInstanceId(obj_idx, inst_idx))); +} + void ObjectList::delete_all_objects_from_list() { m_objects_model->DeleteAll(); diff --git a/src/slic3r/GUI/GUI_ObjectList.hpp b/src/slic3r/GUI/GUI_ObjectList.hpp index 826eb9a7d..279f47f92 100644 --- a/src/slic3r/GUI/GUI_ObjectList.hpp +++ b/src/slic3r/GUI/GUI_ObjectList.hpp @@ -116,6 +116,7 @@ public: void delete_object_from_list(); void delete_object_from_list(const size_t obj_idx); void delete_volume_from_list(const size_t obj_idx, const size_t vol_idx); + void delete_instance_from_list(const size_t obj_idx, const size_t inst_idx); // Delete all objects from the list void delete_all_objects_from_list(); // Increase instances count