From af7230e496686364dceb492ef791ecc47dadeb59 Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Tue, 3 Oct 2023 15:13:46 +0200 Subject: [PATCH] Rename 'NetFabb' to 'Windows repair algorithm' (related to #11199) --- CMakeLists.txt | 8 ++++---- src/slic3r/GUI/GUI_Factories.cpp | 16 +++++++-------- src/slic3r/GUI/GUI_Factories.hpp | 2 +- src/slic3r/GUI/GUI_ObjectList.cpp | 24 +++++++++++------------ src/slic3r/GUI/GUI_ObjectList.hpp | 4 ++-- src/slic3r/GUI/GUI_ObjectManipulation.cpp | 22 ++++++++++----------- src/slic3r/GUI/GUI_ObjectManipulation.hpp | 2 +- src/slic3r/GUI/NotificationManager.hpp | 4 ++-- src/slic3r/GUI/Plater.cpp | 12 ++++++------ src/slic3r/GUI/Plater.hpp | 2 +- src/slic3r/Utils/FixModelByWin10.cpp | 4 ++-- tests/libslic3r/test_emboss.cpp | 2 +- 12 files changed, 51 insertions(+), 51 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0ad89937b2..7cc8cb577e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -185,7 +185,7 @@ if(WIN32) else() message("WIN10SDK_PATH is invalid: ${WIN10SDK_PATH}") message("${WIN10SDK_PATH}/include/winrt/windows.graphics.printing3d.h was not found") - message("STL fixing by the Netfabb service will not be compiled") + message("STL fixing by WinSDK will not be compiled") unset(WIN10SDK_PATH) endif() else() @@ -193,16 +193,16 @@ if(WIN32) set(WIN10SDK_INCLUDE_PATH "$ENV{WindowsSdkDir}/Include/$ENV{WindowsSDKVersion}") if (NOT EXISTS "${WIN10SDK_INCLUDE_PATH}/winrt/windows.graphics.printing3d.h") message("${WIN10SDK_INCLUDE_PATH}/winrt/windows.graphics.printing3d.h was not found") - message("STL fixing by the Netfabb service will not be compiled") + message("STL fixing by WinSDK will not be compiled") unset(WIN10SDK_INCLUDE_PATH) endif() endif() if(WIN10SDK_INCLUDE_PATH) - message("Building with Win10 Netfabb STL fixing service support") + message("Building with Win10 STL fixing service support") add_definitions(-DHAS_WIN10SDK) include_directories("${WIN10SDK_INCLUDE_PATH}") else() - message("Building without Win10 Netfabb STL fixing service support") + message("Building without Win10 STL fixing service support") endif() endif() diff --git a/src/slic3r/GUI/GUI_Factories.cpp b/src/slic3r/GUI/GUI_Factories.cpp index 77f3152921..5e8c121100 100644 --- a/src/slic3r/GUI/GUI_Factories.cpp +++ b/src/slic3r/GUI/GUI_Factories.cpp @@ -785,13 +785,13 @@ void MenuFactory::append_menu_items_osx(wxMenu* menu) menu->AppendSeparator(); } -wxMenuItem* MenuFactory::append_menu_item_fix_through_netfabb(wxMenu* menu) +wxMenuItem* MenuFactory::append_menu_item_fix_through_winsdk(wxMenu* menu) { if (!is_windows10()) return nullptr; - wxMenuItem* menu_item = append_menu_item(menu, wxID_ANY, _L("Fix through the Netfabb"), "", - [](wxCommandEvent&) { obj_list()->fix_through_netfabb(); }, "", menu, - []() {return plater()->can_fix_through_netfabb(); }, m_parent); + wxMenuItem* menu_item = append_menu_item(menu, wxID_ANY, _L("Fix by Windows repair algorithm"), "", + [](wxCommandEvent&) { obj_list()->fix_through_winsdk(); }, "", menu, + []() {return plater()->can_fix_through_winsdk(); }, m_parent); return menu_item; } @@ -1055,7 +1055,7 @@ void MenuFactory::create_common_object_menu(wxMenu* menu) // "Scale to print volume" makes a sense just for whole object append_menu_item_scale_selection_to_fit_print_volume(menu); - append_menu_item_fix_through_netfabb(menu); + append_menu_item_fix_through_winsdk(menu); append_menu_item_simplify(menu); append_menu_items_mirror(menu); @@ -1104,7 +1104,7 @@ void MenuFactory::create_part_menu() append_menu_item_reload_from_disk(menu); append_menu_item_replace_with_stl(menu); append_menu_item_export_stl(menu); - append_menu_item_fix_through_netfabb(menu); + append_menu_item_fix_through_winsdk(menu); append_menu_item_simplify(menu); append_menu_item(menu, wxID_ANY, _L("Split"), _L("Split the selected object into individual parts"), @@ -1120,7 +1120,7 @@ void MenuFactory::create_text_part_menu() append_menu_item_delete(menu); append_menu_item_edit_text(menu); - append_menu_item_fix_through_netfabb(menu); + append_menu_item_fix_through_winsdk(menu); append_menu_item_simplify(menu); append_immutable_part_menu_items(menu); @@ -1224,7 +1224,7 @@ wxMenu* MenuFactory::multi_selection_menu() wxMenu* menu = new MenuWithSeparators(); - append_menu_item_fix_through_netfabb(menu); + append_menu_item_fix_through_winsdk(menu); append_menu_item_reload_from_disk(menu); append_menu_items_convert_unit(menu); if (obj_list()->can_merge_to_multipart_object()) diff --git a/src/slic3r/GUI/GUI_Factories.hpp b/src/slic3r/GUI/GUI_Factories.hpp index 17878e186a..b92b608bfd 100644 --- a/src/slic3r/GUI/GUI_Factories.hpp +++ b/src/slic3r/GUI/GUI_Factories.hpp @@ -99,7 +99,7 @@ private: wxMenuItem* append_menu_item_printable(wxMenu* menu); void append_menu_item_invalidate_cut_info(wxMenu *menu); void append_menu_items_osx(wxMenu* menu); - wxMenuItem* append_menu_item_fix_through_netfabb(wxMenu* menu); + wxMenuItem* append_menu_item_fix_through_winsdk(wxMenu* menu); wxMenuItem* append_menu_item_simplify(wxMenu* menu); void append_menu_item_export_stl(wxMenu* menu); void append_menu_item_reload_from_disk(wxMenu* menu); diff --git a/src/slic3r/GUI/GUI_ObjectList.cpp b/src/slic3r/GUI/GUI_ObjectList.cpp index 79135f619b..6e185a1a0d 100644 --- a/src/slic3r/GUI/GUI_ObjectList.cpp +++ b/src/slic3r/GUI/GUI_ObjectList.cpp @@ -483,7 +483,7 @@ MeshErrorsInfo ObjectList::get_mesh_errors_info(const int obj_idx, const int vol *sidebar_info = stats.manifold() ? auto_repaired_info : (remaining_info + (stats.repaired() ? ("\n" + auto_repaired_info) : "")); if (is_windows10() && !sidebar_info) - tooltip += "\n" + _L("Right button click the icon to fix STL through Netfabb"); + tooltip += "\n" + _L("Right button click the icon to fix STL by Windows repair algorithm"); return { tooltip, get_warning_icon_name(stats) }; } @@ -1002,7 +1002,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()) - fix_through_netfabb(); + fix_through_winsdk(); else if (evt_context_menu) show_context_menu(evt_context_menu); // show context menu for "Name" column too } @@ -4567,7 +4567,7 @@ void ObjectList::rename_item() update_name_in_model(item); } -void ObjectList::fix_through_netfabb() +void ObjectList::fix_through_winsdk() { // 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. @@ -4587,21 +4587,21 @@ void ObjectList::fix_through_netfabb() // clear selections from the non-broken models if any exists // and than fill names of models to repairing if (vol_idxs.empty()) { -#if !FIX_THROUGH_NETFABB_ALWAYS +#if !FIX_THROUGH_WINSDK_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_THROUGH_NETFABB_ALWAYS +#endif // FIX_THROUGH_WINSDK_ALWAYS for (int obj_idx : obj_idxs) model_names.push_back(object(obj_idx)->name); } else { ModelObject* obj = object(obj_idxs.front()); -#if !FIX_THROUGH_NETFABB_ALWAYS +#if !FIX_THROUGH_WINSDK_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_THROUGH_NETFABB_ALWAYS +#endif // FIX_THROUGH_WINSDK_ALWAYS for (int vol_idx : vol_idxs) model_names.push_back(obj->volumes[vol_idx]->name); } @@ -4645,19 +4645,19 @@ void ObjectList::fix_through_netfabb() return true; }; - Plater::TakeSnapshot snapshot(plater, _L("Fix through NetFabb")); + Plater::TakeSnapshot snapshot(plater, _L("Fix by Windows repair algorithm")); // Open a progress dialog. - wxProgressDialog progress_dlg(_L("Fixing through NetFabb"), "", 100, find_toplevel_parent(plater), + wxProgressDialog progress_dlg(_L("Fixing by Windows repair algorithm"), "", 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_THROUGH_NETFABB_ALWAYS +#if !FIX_THROUGH_WINSDK_ALWAYS if (object(obj_idx)->get_repaired_errors_count(vol_idx) == 0) continue; -#endif // FIX_THROUGH_NETFABB_ALWAYS +#endif // FIX_THROUGH_WINSDK_ALWAYS if (!fix_and_update_progress(obj_idx, vol_idx, model_idx, progress_dlg, succes_models, failed_models)) break; model_idx++; @@ -4690,7 +4690,7 @@ void ObjectList::fix_through_netfabb() } if (msg.IsEmpty()) msg = _L("Repairing was canceled"); - plater->get_notification_manager()->push_notification(NotificationType::NetfabbFinished, NotificationManager::NotificationLevel::PrintInfoShortNotificationLevel, boost::nowide::narrow(msg)); + plater->get_notification_manager()->push_notification(NotificationType::RepairFinished, NotificationManager::NotificationLevel::PrintInfoShortNotificationLevel, boost::nowide::narrow(msg)); } void ObjectList::simplify() diff --git a/src/slic3r/GUI/GUI_ObjectList.hpp b/src/slic3r/GUI/GUI_ObjectList.hpp index f45d0e9e84..ae1f142dc4 100644 --- a/src/slic3r/GUI/GUI_ObjectList.hpp +++ b/src/slic3r/GUI/GUI_ObjectList.hpp @@ -42,7 +42,7 @@ typedef std::pair t_layer_height_range; typedef std::map t_layer_config_ranges; // Manifold mesh may contain self-intersections, so we want to always allow fixing the mesh. -#define FIX_THROUGH_NETFABB_ALWAYS 1 +#define FIX_THROUGH_WINSDK_ALWAYS 1 namespace GUI { @@ -387,7 +387,7 @@ public: void instances_to_separated_objects(const int obj_idx); void split_instances(); void rename_item(); - void fix_through_netfabb(); + void fix_through_winsdk(); void simplify(); void update_item_error_icon(const int obj_idx, int vol_idx) const ; diff --git a/src/slic3r/GUI/GUI_ObjectManipulation.cpp b/src/slic3r/GUI/GUI_ObjectManipulation.cpp index 6a0472c4dc..0b7534b1d6 100644 --- a/src/slic3r/GUI/GUI_ObjectManipulation.cpp +++ b/src/slic3r/GUI/GUI_ObjectManipulation.cpp @@ -162,19 +162,19 @@ ObjectManipulation::ObjectManipulation(wxWindow* parent) : // Add "Name" label with warning icon auto sizer = new wxBoxSizer(wxHORIZONTAL); - m_fix_throught_netfab_bitmap = new wxStaticBitmap(parent, wxID_ANY, wxNullBitmap); + m_fix_by_winsdk_bitmap = new wxStaticBitmap(parent, wxID_ANY, wxNullBitmap); if (is_windows10()) - m_fix_throught_netfab_bitmap->Bind(wxEVT_CONTEXT_MENU, [this](wxCommandEvent& e) + m_fix_by_winsdk_bitmap->Bind(wxEVT_CONTEXT_MENU, [this](wxCommandEvent& e) { // if object/sub-object has no errors - if (m_fix_throught_netfab_bitmap->GetBitmap().GetRefData() == wxNullBitmap.GetRefData()) + if (m_fix_by_winsdk_bitmap->GetBitmap().GetRefData() == wxNullBitmap.GetRefData()) return; - wxGetApp().obj_list()->fix_through_netfabb(); + wxGetApp().obj_list()->fix_through_winsdk(); update_warning_icon_state(wxGetApp().obj_list()->get_mesh_errors_info()); }); - sizer->Add(m_fix_throught_netfab_bitmap); + sizer->Add(m_fix_by_winsdk_bitmap); auto name_label = new wxStaticText(m_parent, wxID_ANY, _L("Name")+":"); set_font_and_background_style(name_label, wxGetApp().normal_font()); @@ -895,9 +895,9 @@ void ObjectManipulation::update_warning_icon_state(const MeshErrorsInfo& warning !warning_icon_name.empty()) m_manifold_warning_bmp = ScalableBitmap(m_parent, warning_icon_name); const wxString& tooltip = warning.tooltip; - m_fix_throught_netfab_bitmap->SetBitmap(tooltip.IsEmpty() ? wxNullBitmap : m_manifold_warning_bmp.bmp()); - m_fix_throught_netfab_bitmap->SetMinSize(tooltip.IsEmpty() ? wxSize(0,0) : m_manifold_warning_bmp.GetSize()); - m_fix_throught_netfab_bitmap->SetToolTip(tooltip); + m_fix_by_winsdk_bitmap->SetBitmap(tooltip.IsEmpty() ? wxNullBitmap : m_manifold_warning_bmp.bmp()); + m_fix_by_winsdk_bitmap->SetMinSize(tooltip.IsEmpty() ? wxSize(0,0) : m_manifold_warning_bmp.GetSize()); + m_fix_by_winsdk_bitmap->SetToolTip(tooltip); } wxString ObjectManipulation::coordinate_type_str(ECoordinatesType type) @@ -1171,9 +1171,9 @@ void ObjectManipulation::msw_rescale() msw_rescale_word_local_combo(m_word_local_combo); m_word_local_combo_sizer->SetMinSize(wxSize(-1, m_word_local_combo->GetBestHeight(-1))); - const wxString& tooltip = m_fix_throught_netfab_bitmap->GetToolTipText(); - m_fix_throught_netfab_bitmap->SetBitmap(tooltip.IsEmpty() ? wxNullBitmap : m_manifold_warning_bmp.bmp()); - m_fix_throught_netfab_bitmap->SetMinSize(tooltip.IsEmpty() ? wxSize(0, 0) : m_manifold_warning_bmp.GetSize()); + const wxString& tooltip = m_fix_by_winsdk_bitmap->GetToolTipText(); + m_fix_by_winsdk_bitmap->SetBitmap(tooltip.IsEmpty() ? wxNullBitmap : m_manifold_warning_bmp.bmp()); + m_fix_by_winsdk_bitmap->SetMinSize(tooltip.IsEmpty() ? wxSize(0, 0) : m_manifold_warning_bmp.GetSize()); // rescale label-heights // Text trick to grid sizer layout: diff --git a/src/slic3r/GUI/GUI_ObjectManipulation.hpp b/src/slic3r/GUI/GUI_ObjectManipulation.hpp index 5fe6d19c0c..8952f7248d 100644 --- a/src/slic3r/GUI/GUI_ObjectManipulation.hpp +++ b/src/slic3r/GUI/GUI_ObjectManipulation.hpp @@ -152,7 +152,7 @@ private: choice_ctrl* m_word_local_combo { nullptr }; ScalableBitmap m_manifold_warning_bmp; - wxStaticBitmap* m_fix_throught_netfab_bitmap{ nullptr }; + wxStaticBitmap* m_fix_by_winsdk_bitmap{ nullptr }; wxStaticBitmap* m_mirror_warning_bitmap{ nullptr }; // Currently focused editor (nullptr if none) diff --git a/src/slic3r/GUI/NotificationManager.hpp b/src/slic3r/GUI/NotificationManager.hpp index b410621d53..01caaf391b 100644 --- a/src/slic3r/GUI/NotificationManager.hpp +++ b/src/slic3r/GUI/NotificationManager.hpp @@ -119,8 +119,8 @@ enum class NotificationType SimplifySuggestion, // Change of text will change font to similar one on. UnknownFont, - // information about netfabb is finished repairing model (blocking proccess) - NetfabbFinished, + // information that repairing model finished (blocking proccess) + RepairFinished, // Short meesage to fill space between start and finish of export ExportOngoing, // Progressbar of download from prusaslicer:// url diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index b3ad1c9261..dacbc22df4 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -1965,7 +1965,7 @@ struct Plater::priv bool can_split_to_volumes() const; bool can_arrange() const; bool can_layers_editing() const; - bool can_fix_through_netfabb() const; + bool can_fix_through_winsdk() const; bool can_simplify() const; bool can_set_instance_to_object() const; bool can_mirror() const; @@ -4815,15 +4815,15 @@ bool Plater::priv::can_delete_all() const return !model.objects.empty() && !sidebar->obj_list()->is_editing(); } -bool Plater::priv::can_fix_through_netfabb() const +bool Plater::priv::can_fix_through_winsdk() const { std::vector obj_idxs, vol_idxs; sidebar->obj_list()->get_selection_indexes(obj_idxs, vol_idxs); -#if FIX_THROUGH_NETFABB_ALWAYS +#if FIX_THROUGH_WINSDK_ALWAYS // Fixing always. return ! obj_idxs.empty() || ! vol_idxs.empty(); -#else // FIX_THROUGH_NETFABB_ALWAYS +#else // FIX_THROUGH_WINSDK_ALWAYS // Fixing only if the model is not manifold. if (vol_idxs.empty()) { for (auto obj_idx : obj_idxs) @@ -4837,7 +4837,7 @@ bool Plater::priv::can_fix_through_netfabb() const if (model.objects[obj_idx]->get_repaired_errors_count(vol_idx) > 0) return true; return false; -#endif // FIX_THROUGH_NETFABB_ALWAYS +#endif // FIX_THROUGH_WINSDK_ALWAYS } bool Plater::priv::can_simplify() const @@ -7833,7 +7833,7 @@ bool Plater::can_delete_all() const { return p->can_delete_all(); } bool Plater::can_increase_instances() const { return p->can_increase_instances(); } bool Plater::can_decrease_instances(int obj_idx/* = -1*/) const { return p->can_decrease_instances(obj_idx); } bool Plater::can_set_instance_to_object() const { return p->can_set_instance_to_object(); } -bool Plater::can_fix_through_netfabb() const { return p->can_fix_through_netfabb(); } +bool Plater::can_fix_through_winsdk() const { return p->can_fix_through_winsdk(); } bool Plater::can_simplify() const { return p->can_simplify(); } bool Plater::can_split_to_objects() const { return p->can_split_to_objects(); } bool Plater::can_split_to_volumes() const { return p->can_split_to_volumes(); } diff --git a/src/slic3r/GUI/Plater.hpp b/src/slic3r/GUI/Plater.hpp index 6ded1c4a2f..8b3e105626 100644 --- a/src/slic3r/GUI/Plater.hpp +++ b/src/slic3r/GUI/Plater.hpp @@ -375,7 +375,7 @@ public: bool can_increase_instances() const; bool can_decrease_instances(int obj_idx = -1) const; bool can_set_instance_to_object() const; - bool can_fix_through_netfabb() const; + bool can_fix_through_winsdk() const; bool can_simplify() const; bool can_split_to_objects() const; bool can_split_to_volumes() const; diff --git a/src/slic3r/Utils/FixModelByWin10.cpp b/src/slic3r/Utils/FixModelByWin10.cpp index dea6bf2927..c42856e16b 100644 --- a/src/slic3r/Utils/FixModelByWin10.cpp +++ b/src/slic3r/Utils/FixModelByWin10.cpp @@ -245,7 +245,7 @@ void fix_model_by_win10_sdk(const std::string &path_src, const std::string &path unsigned num_meshes = 0; hr = meshes->get_Size(&num_meshes); - on_progress(L("Repairing model by the Netfabb service"), 40); + on_progress(L("Repairing model by Windows repair algorithm"), 40); Microsoft::WRL::ComPtr repairAsync; hr = model->RepairAsync(repairAsync.GetAddressOf()); @@ -369,7 +369,7 @@ bool fix_model_by_win10_sdk_gui(ModelObject &model_object, int volume_idx, wxPro ModelObject *mo = model.add_object(); mo->add_volume(*volumes[ivolume]); - // We are about to save a 3mf, fix it by netfabb and load the fixed 3mf back. + // We are about to save a 3mf, fix it by winsdk and load the fixed 3mf back. // store_3mf currently bakes the volume transformation into the mesh itself. // If we then loaded the repaired 3mf and pushed the mesh into the original ModelVolume // (which remembers the matrix the whole time), the transformation would be used twice. diff --git a/tests/libslic3r/test_emboss.cpp b/tests/libslic3r/test_emboss.cpp index fc548bb35a..ad03fd0960 100644 --- a/tests/libslic3r/test_emboss.cpp +++ b/tests/libslic3r/test_emboss.cpp @@ -782,7 +782,7 @@ using MyMesh = Slic3r::MeshBoolean::cgal2::CGALMesh; // Second Idea // Store original its inside of text configuration[optional] -// Cause problem with next editation of object -> cut, simplify, Netfabb, Hollow, ...(transform original vertices) +// Cause problem with next editation of object -> cut, simplify, repair by WinSDK, Hollow, ...(transform original vertices) TEST_CASE("Emboss extrude cut", "[Emboss-Cut]") { std::string font_path = get_font_filepath();