Revert "Merge branch 'pm_stable_meshfix' into dev_250"

This reverts commit 71a8ead282, reversing
changes made to a1143ab26e.
This commit is contained in:
Lukas Matena 2022-06-17 16:13:18 +02:00
parent d59b11568e
commit 9aa104d080
52 changed files with 34 additions and 16936 deletions
src/slic3r/GUI

View file

@ -28,7 +28,6 @@
#include <wx/numformatter.h>
#include "slic3r/Utils/FixModelByWin10.hpp"
#include "slic3r/Utils/FixModelByMeshFix.hpp"
#ifdef __WXMSW__
#include "wx/uiaction.h"
@ -917,7 +916,7 @@ void ObjectList::list_manipulation(const wxPoint& mouse_pos, bool evt_context_me
{
if (is_windows10() && m_objects_model->HasWarningIcon(item) &&
mouse_pos.x > 2 * wxGetApp().em_unit() && mouse_pos.x < 4 * wxGetApp().em_unit())
repair_mesh(rmaNetfabb);
fix_through_netfabb();
else if (evt_context_menu)
show_context_menu(evt_context_menu); // show context menu for "Name" column too
}
@ -4032,7 +4031,7 @@ void ObjectList::rename_item()
update_name_in_model(item);
}
void ObjectList::repair_mesh(ObjectList::REPAIR_MESH_ALG alg)
void ObjectList::fix_through_netfabb()
{
// Do not fix anything when a gizmo is open. There might be issues with updates
// and what is worse, the snapshot time would refer to the internal stack.
@ -4052,28 +4051,28 @@ void ObjectList::repair_mesh(ObjectList::REPAIR_MESH_ALG alg)
// clear selections from the non-broken models if any exists
// and than fill names of models to repairing
if (vol_idxs.empty()) {
#if !FIX_MESH_ALWAYS
#if !FIX_THROUGH_NETFABB_ALWAYS
for (int i = int(obj_idxs.size())-1; i >= 0; --i)
if (object(obj_idxs[i])->get_repaired_errors_count() == 0)
obj_idxs.erase(obj_idxs.begin()+i);
#endif // FIX_MESH_ALWAYS
#endif // FIX_THROUGH_NETFABB_ALWAYS
for (int obj_idx : obj_idxs)
model_names.push_back(object(obj_idx)->name);
}
else {
ModelObject* obj = object(obj_idxs.front());
#if !FIX_MESH_ALWAYS
#if !FIX_THROUGH_NETFABB_ALWAYS
for (int i = int(vol_idxs.size()) - 1; i >= 0; --i)
if (obj->get_repaired_errors_count(vol_idxs[i]) == 0)
vol_idxs.erase(vol_idxs.begin() + i);
#endif // FIX_MESH_ALWAYS
#endif // FIX_THROUGH_NETFABB_ALWAYS
for (int vol_idx : vol_idxs)
model_names.push_back(obj->volumes[vol_idx]->name);
}
auto plater = wxGetApp().plater();
auto fix_and_update_progress = [this, plater, model_names, alg](const int obj_idx, const int vol_idx,
auto fix_and_update_progress = [this, plater, model_names](const int obj_idx, const int vol_idx,
int model_idx,
wxProgressDialog& progress_dlg,
std::vector<std::string>& succes_models,
@ -4092,19 +4091,8 @@ void ObjectList::repair_mesh(ObjectList::REPAIR_MESH_ALG alg)
plater->clear_before_change_mesh(obj_idx);
std::string res;
bool result = false;
switch (alg) {
case rmaNetfabb:
result = fix_model_by_win10_sdk_gui(*(object(obj_idx)), vol_idx, progress_dlg, msg, res);
break;
case rmaMeshfix:
result = fix_model_by_meshfix(*(object(obj_idx)), vol_idx, progress_dlg, msg, res);
break;
default:
break;
}
if (!result) return false;
if (!fix_model_by_win10_sdk_gui(*(object(obj_idx)), vol_idx, progress_dlg, msg, res))
return false;
wxGetApp().plater()->changed_mesh(obj_idx);
plater->changed_mesh(obj_idx);
@ -4120,19 +4108,19 @@ void ObjectList::repair_mesh(ObjectList::REPAIR_MESH_ALG alg)
return true;
};
Plater::TakeSnapshot snapshot(plater, _L("Repair model mesh"));
Plater::TakeSnapshot snapshot(plater, _L("Fix through NetFabb"));
// Open a progress dialog.
wxProgressDialog progress_dlg(_L("Repair model mesh"), "", 100, find_toplevel_parent(plater),
wxProgressDialog progress_dlg(_L("Fixing through NetFabb"), "", 100, find_toplevel_parent(plater),
wxPD_AUTO_HIDE | wxPD_APP_MODAL | wxPD_CAN_ABORT);
int model_idx{ 0 };
if (vol_idxs.empty()) {
int vol_idx{ -1 };
for (int obj_idx : obj_idxs) {
#if !FIX_MESH_ALWAYS
#if !FIX_THROUGH_NETFABB_ALWAYS
if (object(obj_idx)->get_repaired_errors_count(vol_idx) == 0)
continue;
#endif // FIX_MESH_ALWAYS
#endif // FIX_THROUGH_NETFABB_ALWAYS
if (!fix_and_update_progress(obj_idx, vol_idx, model_idx, progress_dlg, succes_models, failed_models))
break;
model_idx++;
@ -4165,7 +4153,7 @@ void ObjectList::repair_mesh(ObjectList::REPAIR_MESH_ALG alg)
}
if (msg.IsEmpty())
msg = _L("Repairing was canceled");
plater->get_notification_manager()->push_notification(NotificationType::RepairMeshFinished, NotificationManager::NotificationLevel::PrintInfoShortNotificationLevel, boost::nowide::narrow(msg));
plater->get_notification_manager()->push_notification(NotificationType::NetfabbFinished, NotificationManager::NotificationLevel::PrintInfoShortNotificationLevel, boost::nowide::narrow(msg));
}
void ObjectList::simplify()