mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-30 20:21:12 -06:00 
			
		
		
		
	Merge remote-tracking branch 'origin/master' into tm_colldetection_upgr
This commit is contained in:
		
						commit
						203ed3724f
					
				
					 16 changed files with 78 additions and 69 deletions
				
			
		|  | @ -88,8 +88,8 @@ add_library(libslic3r STATIC | |||
|     GCode.hpp | ||||
|     GCodeReader.cpp | ||||
|     GCodeReader.hpp | ||||
|     GCodeSender.cpp | ||||
|     GCodeSender.hpp | ||||
|     # GCodeSender.cpp | ||||
|     # GCodeSender.hpp | ||||
|     GCodeTimeEstimator.cpp | ||||
|     GCodeTimeEstimator.hpp | ||||
|     GCodeWriter.cpp | ||||
|  |  | |||
|  | @ -4,6 +4,8 @@ | |||
| #include "libslic3r_version.h" | ||||
| 
 | ||||
| // this needs to be included early for MSVC (listing it in Build.PL is not enough)
 | ||||
| #include <memory> | ||||
| #include <algorithm> | ||||
| #include <ostream> | ||||
| #include <iostream> | ||||
| #include <math.h> | ||||
|  | @ -13,7 +15,7 @@ | |||
| #include <stdint.h> | ||||
| #include <stdarg.h> | ||||
| #include <vector> | ||||
| #include <boost/thread.hpp> | ||||
| #include <cassert> | ||||
| 
 | ||||
| #include "Technologies.hpp" | ||||
| 
 | ||||
|  |  | |||
|  | @ -696,7 +696,6 @@ void GLVolumeCollection::load_object_auxiliary( | |||
|     mesh.transform(mesh_trafo_inv); | ||||
| 	// Convex hull is required for out of print bed detection.
 | ||||
| 	TriangleMesh convex_hull = mesh.convex_hull_3d(); | ||||
|     convex_hull.transform(mesh_trafo_inv); | ||||
|     for (const std::pair<size_t, size_t> &instance_idx : instances) { | ||||
|         const ModelInstance            &model_instance = *print_object->model_object()->instances[instance_idx.first]; | ||||
|         const SLAPrintObject::Instance &print_instance = print_object->instances()[instance_idx.second]; | ||||
|  |  | |||
|  | @ -2800,13 +2800,13 @@ std::string GLCanvas3D::Gizmos::update_hover_state(const GLCanvas3D& canvas, con | |||
| 
 | ||||
|         float icon_size = (float)it->second->get_textures_size() * OverlayIconsScale; | ||||
| 
 | ||||
|         bool inside = (OverlayBorder <= (float)mouse_pos(0)) && ((float)mouse_pos(0) <= OverlayBorder + icon_size) && (top_y <= (float)mouse_pos(1)) && ((float)mouse_pos(1) <= top_y + icon_size); | ||||
|         if (inside) | ||||
|             name = it->second->get_name(); | ||||
| 
 | ||||
|         if (it->second->is_activable(selection) && (it->second->get_state() != GLGizmoBase::On)) | ||||
|         { | ||||
|             bool inside = (OverlayBorder <= (float)mouse_pos(0)) && ((float)mouse_pos(0) <= OverlayBorder + icon_size) && (top_y <= (float)mouse_pos(1)) && ((float)mouse_pos(1) <= top_y + icon_size); | ||||
|             it->second->set_state(inside ? GLGizmoBase::Hover : GLGizmoBase::Off); | ||||
|             if (inside) | ||||
|                 name = it->second->get_name(); | ||||
|         } | ||||
| 
 | ||||
|         top_y += (icon_size + OverlayGapY); | ||||
|     } | ||||
| 
 | ||||
|  | @ -5365,9 +5365,8 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt) | |||
|         std::string tooltip = ""; | ||||
| 
 | ||||
|         // updates gizmos overlay
 | ||||
|         if (!m_selection.is_empty()) | ||||
|             tooltip = m_gizmos.update_hover_state(*this, m_mouse.position, m_selection); | ||||
|         else | ||||
|         tooltip = m_gizmos.update_hover_state(*this, m_mouse.position, m_selection); | ||||
|         if (m_selection.is_empty()) | ||||
|             m_gizmos.reset_all_states(); | ||||
| 
 | ||||
|         // updates toolbar overlay
 | ||||
|  | @ -5452,7 +5451,9 @@ void GLCanvas3D::set_tooltip(const std::string& tooltip) const | |||
|         wxToolTip* t = m_canvas->GetToolTip(); | ||||
|         if (t != nullptr) | ||||
|         { | ||||
|             if (t->GetTip() != tooltip) | ||||
|             if (tooltip.empty()) | ||||
|                 m_canvas->UnsetToolTip(); | ||||
|             else | ||||
|                 t->SetTip(tooltip); | ||||
|         } | ||||
|         else | ||||
|  | @ -5783,7 +5784,7 @@ bool GLCanvas3D::_init_toolbar() | |||
|     GLToolbarItem::Data item; | ||||
| 
 | ||||
|     item.name = "add"; | ||||
|     item.tooltip = GUI::L_str("Add..."); | ||||
|     item.tooltip = GUI::L_str("Add... [Ctrl+I]"); | ||||
|     item.sprite_id = 0; | ||||
|     item.is_toggable = false; | ||||
|     item.action_event = EVT_GLTOOLBAR_ADD; | ||||
|  | @ -5791,7 +5792,7 @@ bool GLCanvas3D::_init_toolbar() | |||
|         return false; | ||||
| 
 | ||||
|     item.name = "delete"; | ||||
|     item.tooltip = GUI::L_str("Delete"); | ||||
|     item.tooltip = GUI::L_str("Delete [Del]"); | ||||
|     item.sprite_id = 1; | ||||
|     item.is_toggable = false; | ||||
|     item.action_event = EVT_GLTOOLBAR_DELETE; | ||||
|  | @ -5799,7 +5800,7 @@ bool GLCanvas3D::_init_toolbar() | |||
|         return false; | ||||
| 
 | ||||
|     item.name = "deleteall"; | ||||
|     item.tooltip = GUI::L_str("Delete all"); | ||||
|     item.tooltip = GUI::L_str("Delete all [Ctrl+Del]"); | ||||
|     item.sprite_id = 2; | ||||
|     item.is_toggable = false; | ||||
|     item.action_event = EVT_GLTOOLBAR_DELETE_ALL; | ||||
|  | @ -5807,7 +5808,7 @@ bool GLCanvas3D::_init_toolbar() | |||
|         return false; | ||||
| 
 | ||||
|     item.name = "arrange"; | ||||
|     item.tooltip = GUI::L_str("Arrange"); | ||||
|     item.tooltip = GUI::L_str("Arrange [A]"); | ||||
|     item.sprite_id = 3; | ||||
|     item.is_toggable = false; | ||||
|     item.action_event = EVT_GLTOOLBAR_ARRANGE; | ||||
|  | @ -5818,7 +5819,7 @@ bool GLCanvas3D::_init_toolbar() | |||
|         return false; | ||||
| 
 | ||||
|     item.name = "more"; | ||||
|     item.tooltip = GUI::L_str("Add instance"); | ||||
|     item.tooltip = GUI::L_str("Add instance [+]"); | ||||
|     item.sprite_id = 4; | ||||
|     item.is_toggable = false; | ||||
|     item.action_event = EVT_GLTOOLBAR_MORE; | ||||
|  | @ -5826,7 +5827,7 @@ bool GLCanvas3D::_init_toolbar() | |||
|         return false; | ||||
| 
 | ||||
|     item.name = "fewer"; | ||||
|     item.tooltip = GUI::L_str("Remove instance"); | ||||
|     item.tooltip = GUI::L_str("Remove instance [-]"); | ||||
|     item.sprite_id = 5; | ||||
|     item.is_toggable = false; | ||||
|     item.action_event = EVT_GLTOOLBAR_FEWER; | ||||
|  |  | |||
|  | @ -748,7 +748,7 @@ bool GLGizmoRotate3D::on_init() | |||
| 
 | ||||
| std::string GLGizmoRotate3D::on_get_name() const | ||||
| {     | ||||
|     return L("Rotate"); | ||||
|     return L("Rotate [R]"); | ||||
| } | ||||
| 
 | ||||
| void GLGizmoRotate3D::on_start_dragging(const GLCanvas3D::Selection& selection) | ||||
|  | @ -838,7 +838,7 @@ bool GLGizmoScale3D::on_init() | |||
| 
 | ||||
| std::string GLGizmoScale3D::on_get_name() const | ||||
| { | ||||
|     return L("Scale"); | ||||
|     return L("Scale [S]"); | ||||
| } | ||||
| 
 | ||||
| void GLGizmoScale3D::on_start_dragging(const GLCanvas3D::Selection& selection) | ||||
|  | @ -1197,7 +1197,7 @@ bool GLGizmoMove3D::on_init() | |||
| 
 | ||||
| std::string GLGizmoMove3D::on_get_name() const | ||||
| { | ||||
|     return L("Move"); | ||||
|     return L("Move [M]"); | ||||
| } | ||||
| 
 | ||||
| void GLGizmoMove3D::on_start_dragging(const GLCanvas3D::Selection& selection) | ||||
|  | @ -1427,7 +1427,7 @@ bool GLGizmoFlatten::on_init() | |||
| 
 | ||||
| std::string GLGizmoFlatten::on_get_name() const | ||||
| { | ||||
|     return L("Place on face"); | ||||
|     return L("Place on face [F]"); | ||||
| } | ||||
| 
 | ||||
| bool GLGizmoFlatten::on_is_activable(const GLCanvas3D::Selection& selection) const | ||||
|  | @ -1559,7 +1559,7 @@ void GLGizmoFlatten::update_planes() | |||
|         while (facet_queue_cnt > 0) { | ||||
|             int facet_idx = facet_queue[-- facet_queue_cnt]; | ||||
|             const stl_normal& this_normal = ch.stl.facet_start[facet_idx].normal; | ||||
|             if (this_normal.isApprox(*normal_ptr)) { | ||||
|             if (std::abs(this_normal(0) - (*normal_ptr)(0)) < 0.001 && std::abs(this_normal(1) - (*normal_ptr)(1)) < 0.001 && std::abs(this_normal(2) - (*normal_ptr)(2)) < 0.001) { | ||||
|                 stl_vertex* first_vertex = ch.stl.facet_start[facet_idx].vertex; | ||||
|                 for (int j=0; j<3; ++j) | ||||
|                     m_planes.back().vertices.emplace_back((double)first_vertex[j](0), (double)first_vertex[j](1), (double)first_vertex[j](2)); | ||||
|  | @ -2240,9 +2240,8 @@ bool GLGizmoSlaSupports::on_is_selectable() const | |||
| } | ||||
| 
 | ||||
| std::string GLGizmoSlaSupports::on_get_name() const | ||||
| 
 | ||||
| { | ||||
|     return L("SLA Support Points"); | ||||
|     return L("SLA Support Points [L]"); | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
|  | @ -2353,7 +2352,7 @@ bool GLGizmoCut::on_init() | |||
| 
 | ||||
| std::string GLGizmoCut::on_get_name() const | ||||
| { | ||||
|     return L("Cut"); | ||||
|     return L("Cut [C]"); | ||||
| } | ||||
| 
 | ||||
| void GLGizmoCut::on_set_state() | ||||
|  |  | |||
|  | @ -530,6 +530,8 @@ std::string GLToolbar::update_hover_state_horizontal(const Vec2d& mouse_pos, GLC | |||
| 
 | ||||
|             GLToolbarItem::EState state = item->get_state(); | ||||
|             bool inside = (left <= (float)scaled_mouse_pos(0)) && ((float)scaled_mouse_pos(0) <= right) && (bottom <= (float)scaled_mouse_pos(1)) && ((float)scaled_mouse_pos(1) <= top); | ||||
|             if (inside) | ||||
|                 tooltip = item->get_tooltip(); | ||||
| 
 | ||||
|             switch (state) | ||||
|             { | ||||
|  | @ -545,9 +547,7 @@ std::string GLToolbar::update_hover_state_horizontal(const Vec2d& mouse_pos, GLC | |||
|             } | ||||
|             case GLToolbarItem::Hover: | ||||
|             { | ||||
|                 if (inside) | ||||
|                     tooltip = item->get_tooltip(); | ||||
|                 else | ||||
|                 if (!inside) | ||||
|                 { | ||||
|                     item->set_state(GLToolbarItem::Normal); | ||||
|                     parent.set_as_dirty(); | ||||
|  | @ -567,9 +567,7 @@ std::string GLToolbar::update_hover_state_horizontal(const Vec2d& mouse_pos, GLC | |||
|             } | ||||
|             case GLToolbarItem::HoverPressed: | ||||
|             { | ||||
|                 if (inside) | ||||
|                     tooltip = item->get_tooltip(); | ||||
|                 else | ||||
|                 if (!inside) | ||||
|                 { | ||||
|                     item->set_state(GLToolbarItem::Pressed); | ||||
|                     parent.set_as_dirty(); | ||||
|  | @ -623,6 +621,8 @@ std::string GLToolbar::update_hover_state_vertical(const Vec2d& mouse_pos, GLCan | |||
| 
 | ||||
|             GLToolbarItem::EState state = item->get_state(); | ||||
|             bool inside = (left <= (float)scaled_mouse_pos(0)) && ((float)scaled_mouse_pos(0) <= right) && (bottom <= (float)scaled_mouse_pos(1)) && ((float)scaled_mouse_pos(1) <= top); | ||||
|             if (inside) | ||||
|                 tooltip = item->get_tooltip(); | ||||
| 
 | ||||
|             switch (state) | ||||
|             { | ||||
|  | @ -638,9 +638,7 @@ std::string GLToolbar::update_hover_state_vertical(const Vec2d& mouse_pos, GLCan | |||
|             } | ||||
|             case GLToolbarItem::Hover: | ||||
|             { | ||||
|                 if (inside) | ||||
|                     tooltip = item->get_tooltip(); | ||||
|                 else | ||||
|                 if (!inside) | ||||
|                 { | ||||
|                     item->set_state(GLToolbarItem::Normal); | ||||
|                     parent.set_as_dirty(); | ||||
|  | @ -660,9 +658,7 @@ std::string GLToolbar::update_hover_state_vertical(const Vec2d& mouse_pos, GLCan | |||
|             } | ||||
|             case GLToolbarItem::HoverPressed: | ||||
|             { | ||||
|                 if (inside) | ||||
|                     tooltip = item->get_tooltip(); | ||||
|                 else | ||||
|                 if (!inside) | ||||
|                 { | ||||
|                     item->set_state(GLToolbarItem::Pressed); | ||||
|                     parent.set_as_dirty(); | ||||
|  |  | |||
|  | @ -120,8 +120,7 @@ void KBShortcutsDialog::fill_shortcuts() | |||
|     main_shortcuts.push_back(Shortcut("+"               ,L("Add Instance to selected object "))); | ||||
|     main_shortcuts.push_back(Shortcut("-"               ,L("Remove Instance from selected object"))); | ||||
|     main_shortcuts.push_back(Shortcut("?"               ,L("Show keyboard shortcuts list"))); | ||||
|     main_shortcuts.push_back(Shortcut("PgUp/PgDn"       ,L("Switch between 3D and Preview"))); | ||||
|     main_shortcuts.push_back(Shortcut("Shift+LeftMouse" ,L("Select multiple object/Move multiple object"))); | ||||
|     main_shortcuts.push_back(Shortcut("Shift+LeftMouse", L("Select multiple object/Move multiple object"))); | ||||
| 
 | ||||
|     m_full_shortcuts.emplace(_(L("Main Shortcuts")),    main_shortcuts); | ||||
| 
 | ||||
|  |  | |||
|  | @ -655,18 +655,24 @@ void Sidebar::update_presets(Preset::Type preset_type) | |||
| 	PresetBundle &preset_bundle = *wxGetApp().preset_bundle; | ||||
| 
 | ||||
|     switch (preset_type) { | ||||
|     case Preset::TYPE_FILAMENT: | ||||
|         if (p->combos_filament.size() == 1) { | ||||
|     case Preset::TYPE_FILAMENT:  | ||||
|     { | ||||
|         const int extruder_cnt = p->plater->printer_technology() != ptFFF ? 1 : | ||||
|                                 dynamic_cast<ConfigOptionFloats*>(preset_bundle.printers.get_edited_preset().config.option("nozzle_diameter"))->values.size(); | ||||
|         const int filament_cnt = p->combos_filament.size() > extruder_cnt ? extruder_cnt : p->combos_filament.size(); | ||||
| 
 | ||||
|         if (filament_cnt == 1) { | ||||
|             // Single filament printer, synchronize the filament presets.
 | ||||
| 			const std::string &name = preset_bundle.filaments.get_selected_preset().name; | ||||
| 			preset_bundle.set_filament_preset(0, name); | ||||
|             const std::string &name = preset_bundle.filaments.get_selected_preset().name; | ||||
|             preset_bundle.set_filament_preset(0, name); | ||||
|         } | ||||
| 
 | ||||
|         for (size_t i = 0; i < p->combos_filament.size(); i++) { | ||||
| 			preset_bundle.update_platter_filament_ui(i, p->combos_filament[i]); | ||||
|         for (size_t i = 0; i < filament_cnt; i++) { | ||||
|             preset_bundle.update_platter_filament_ui(i, p->combos_filament[i]); | ||||
|         } | ||||
| 
 | ||||
|         break; | ||||
|     } | ||||
| 
 | ||||
|     case Preset::TYPE_PRINT: | ||||
| 		preset_bundle.prints.update_platter_ui(p->combo_print); | ||||
|  | @ -1356,14 +1362,14 @@ std::vector<size_t> Plater::priv::load_files(const std::vector<fs::path>& input_ | |||
|             // The model should now be initialized
 | ||||
| 
 | ||||
|             if (model.looks_like_multipart_object()) { | ||||
|                 wxMessageDialog dlg(q, _(L( | ||||
|                         "This file contains several objects positioned at multiple heights. " | ||||
|                         "Instead of considering them as multiple objects, should I consider\n" | ||||
|                         "this file as a single object having multiple parts?\n" | ||||
|                     )), _(L("Multi-part object detected")), wxICON_WARNING | wxYES | wxNO); | ||||
|                 if (dlg.ShowModal() == wxID_YES) { | ||||
| //                 wxMessageDialog dlg(q, _(L(
 | ||||
| //                         "This file contains several objects positioned at multiple heights. "
 | ||||
| //                         "Instead of considering them as multiple objects, should I consider\n"
 | ||||
| //                         "this file as a single object having multiple parts?\n"
 | ||||
| //                     )), _(L("Multi-part object detected")), wxICON_WARNING | wxYES | wxNO);
 | ||||
| //                 if (dlg.ShowModal() == wxID_YES) {
 | ||||
|                     model.convert_multipart_object(nozzle_dmrs->values.size()); | ||||
|                 } | ||||
| //                 }
 | ||||
|             } | ||||
| 
 | ||||
|             if (type_3mf || type_any_amf) { | ||||
|  | @ -2484,7 +2490,7 @@ void Plater::priv::init_view_toolbar() | |||
|     GLToolbarItem::Data item; | ||||
| 
 | ||||
|     item.name = "3D"; | ||||
|     item.tooltip = GUI::L_str("3D editor view"); | ||||
|     item.tooltip = GUI::L_str("3D editor view [Ctrl+5]"); | ||||
|     item.sprite_id = 0; | ||||
|     item.action_event = EVT_GLVIEWTOOLBAR_3D; | ||||
|     item.is_toggable = false; | ||||
|  | @ -2492,7 +2498,7 @@ void Plater::priv::init_view_toolbar() | |||
|         return; | ||||
| 
 | ||||
|     item.name = "Preview"; | ||||
|     item.tooltip = GUI::L_str("Preview"); | ||||
|     item.tooltip = GUI::L_str("Preview [Ctrl+6]"); | ||||
|     item.sprite_id = 1; | ||||
|     item.action_event = EVT_GLVIEWTOOLBAR_PREVIEW; | ||||
|     item.is_toggable = false; | ||||
|  |  | |||
|  | @ -1,4 +1,4 @@ | |||
| #include "libslic3r/GCodeSender.hpp" | ||||
| // #include "libslic3r/GCodeSender.hpp"
 | ||||
| #include "Tab.hpp" | ||||
| #include "PresetBundle.hpp" | ||||
| #include "PresetHints.hpp" | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 tamasmeszaros
						tamasmeszaros