Merge branch 'master' into fs_emboss

# Conflicts:
#	src/libslic3r/Geometry.cpp
#	src/slic3r/GUI/Gizmos/GLGizmoBase.cpp
#	src/slic3r/GUI/Gizmos/GLGizmoMove.cpp
#	src/slic3r/GUI/Gizmos/GLGizmoMove.hpp
#	src/slic3r/GUI/Gizmos/GLGizmoRotate.cpp
#	src/slic3r/GUI/Gizmos/GLGizmoRotate.hpp
#	src/slic3r/GUI/Gizmos/GLGizmoScale.cpp
#	src/slic3r/GUI/Gizmos/GLGizmoScale.hpp
#	src/slic3r/GUI/Gizmos/GLGizmoSimplify.cpp
#	src/slic3r/GUI/ImGuiWrapper.cpp
#	src/slic3r/GUI/ImGuiWrapper.hpp
#	src/slic3r/GUI/Selection.cpp
#	tests/slic3rutils/slic3r_jobs_tests.cpp
This commit is contained in:
Filip Sykala 2022-02-02 15:27:25 +01:00
commit a50d93cd66
327 changed files with 781602 additions and 153573 deletions
src/slic3r/GUI

View file

@ -240,6 +240,8 @@ ObjectList::ObjectList(wxWindow* parent) :
ObjectList::~ObjectList()
{
if (m_objects_model)
m_objects_model->DecRef();
}
void ObjectList::set_min_height()
@ -1413,19 +1415,31 @@ void ObjectList::load_subobject(ModelVolumeType type, bool from_galery/* = false
if (m_objects_model->GetItemType(item)&itInstance)
item = m_objects_model->GetItemById(obj_idx);
wxArrayString input_files;
if (from_galery) {
GalleryDialog dlg(this);
if (dlg.ShowModal() != wxID_CLOSE)
dlg.get_input_files(input_files);
}
else
wxGetApp().import_model(wxGetApp().tab_panel()->GetPage(0), input_files);
if (input_files.IsEmpty())
return;
take_snapshot((type == ModelVolumeType::MODEL_PART) ? _L("Load Part") : _L("Load Modifier"));
std::vector<ModelVolume*> volumes;
// ! ysFIXME - delete commented code after testing and rename "load_modifier" to something common
/*
if (type == ModelVolumeType::MODEL_PART)
load_part(*(*m_objects)[obj_idx], volumes, type, from_galery);
else*/
load_modifier(*(*m_objects)[obj_idx], volumes, type, from_galery);
load_modifier(input_files, *(*m_objects)[obj_idx], volumes, type, from_galery);
if (volumes.empty())
return;
take_snapshot((type == ModelVolumeType::MODEL_PART) ? _L("Load Part") : _L("Load Modifier"));
wxDataViewItemArray items = reorder_volumes_and_get_selection(obj_idx, [volumes](const ModelVolume* volume) {
return std::find(volumes.begin(), volumes.end(), volume) != volumes.end(); });
@ -1501,7 +1515,7 @@ void ObjectList::load_part(ModelObject& model_object, std::vector<ModelVolume*>&
}
}
*/
void ObjectList::load_modifier(ModelObject& model_object, std::vector<ModelVolume*>& added_volumes, ModelVolumeType type, bool from_galery)
void ObjectList::load_modifier(const wxArrayString& input_files, ModelObject& model_object, std::vector<ModelVolume*>& added_volumes, ModelVolumeType type, bool from_galery)
{
// ! ysFIXME - delete commented code after testing and rename "load_modifier" to something common
//if (type == ModelVolumeType::MODEL_PART)
@ -1509,19 +1523,6 @@ void ObjectList::load_modifier(ModelObject& model_object, std::vector<ModelVolum
wxWindow* parent = wxGetApp().tab_panel()->GetPage(0);
wxArrayString input_files;
if (from_galery) {
GalleryDialog dlg(this);
if (dlg.ShowModal() == wxID_CLOSE)
return;
dlg.get_input_files(input_files);
if (input_files.IsEmpty())
return;
}
else
wxGetApp().import_model(parent, input_files);
wxProgressDialog dlg(_L("Loading") + dots, "", 100, wxGetApp().mainframe, wxPD_AUTO_HIDE);
wxBusyCursor busy;
@ -1959,9 +1960,15 @@ void ObjectList::del_layers_from_object(const int obj_idx)
bool ObjectList::del_subobject_from_object(const int obj_idx, const int idx, const int type)
{
assert(idx >= 0);
if (obj_idx == 1000 || idx<0)
#if ENABLE_WIPETOWER_OBJECTID_1000_REMOVAL
if (m_objects->empty() || int(m_objects->size()) <= obj_idx)
// Cannot delete a wipe tower
return false;
#else
if (obj_idx == 1000 || idx<0)
// Cannot delete a wipe tower or volume with negative id
return false;
#endif // ENABLE_WIPETOWER_OBJECTID_1000_REMOVAL
ModelObject* object = (*m_objects)[obj_idx];