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
						17bba23dba
					
				
					 9 changed files with 60 additions and 7 deletions
				
			
		|  | @ -3,6 +3,7 @@ | |||
| #include <boost/algorithm/string/split.hpp> | ||||
| #include <fstream> | ||||
| #include <iostream> | ||||
| #include <iomanip> | ||||
| 
 | ||||
| #include <Shiny/Shiny.h> | ||||
| 
 | ||||
|  |  | |||
|  | @ -270,9 +270,9 @@ namespace client | |||
|         { | ||||
|             std::string out; | ||||
|             switch (type) { | ||||
|             case TYPE_BOOL:   out = boost::to_string(data.b); break; | ||||
|             case TYPE_INT:    out = boost::to_string(data.i); break; | ||||
|             case TYPE_DOUBLE: out = boost::to_string(data.d); break; | ||||
|             case TYPE_BOOL:   out = boost::lexical_cast<std::string>(data.b); break; | ||||
|             case TYPE_INT:    out = boost::lexical_cast<std::string>(data.i); break; | ||||
|             case TYPE_DOUBLE: out = boost::lexical_cast<std::string>(data.d); break; | ||||
|             case TYPE_STRING: out = *data.s; break; | ||||
|             default:          break; | ||||
|             } | ||||
|  |  | |||
|  | @ -5,6 +5,7 @@ | |||
| 
 | ||||
| #include <set> | ||||
| #include <vector> | ||||
| #include <map> | ||||
| 
 | ||||
| #include "libslic3r.h" | ||||
| namespace Slic3r | ||||
|  |  | |||
|  | @ -60,3 +60,5 @@ | |||
| #define ENABLE_MOVE_MIN_THRESHOLD (1 && ENABLE_1_42_0_ALPHA4) | ||||
| // Modified initial default placement of generic subparts
 | ||||
| #define ENABLE_GENERIC_SUBPARTS_PLACEMENT (1 && ENABLE_1_42_0_ALPHA4) | ||||
| // Reworked management of bed shape changes
 | ||||
| #define ENABLE_REWORKED_BED_SHAPE_CHANGE (1 && ENABLE_1_42_0_ALPHA4) | ||||
|  |  | |||
|  | @ -3718,7 +3718,11 @@ GLCanvas3D::GLCanvas3D(wxGLCanvas* canvas) | |||
|     , m_dirty(true) | ||||
|     , m_initialized(false) | ||||
|     , m_use_VBOs(false) | ||||
| #if ENABLE_REWORKED_BED_SHAPE_CHANGE | ||||
|     , m_requires_zoom_to_bed(false) | ||||
| #else | ||||
|     , m_force_zoom_to_bed_enabled(false) | ||||
| #endif // ENABLE_REWORKED_BED_SHAPE_CHANGE
 | ||||
|     , m_apply_zoom_to_volumes_filter(false) | ||||
|     , m_hover_volume_id(-1) | ||||
|     , m_toolbar_action_running(false) | ||||
|  | @ -3937,7 +3941,11 @@ void GLCanvas3D::set_bed_shape(const Pointfs& shape) | |||
|     set_bed_axes_length(0.1 * m_bed.get_bounding_box().max_size()); | ||||
| 
 | ||||
|     if (new_shape) | ||||
| #if ENABLE_REWORKED_BED_SHAPE_CHANGE | ||||
|         m_requires_zoom_to_bed = true; | ||||
| #else | ||||
|         zoom_to_bed(); | ||||
| #endif // ENABLE_REWORKED_BED_SHAPE_CHANGE
 | ||||
| 
 | ||||
|     m_dirty = true; | ||||
| } | ||||
|  | @ -4032,10 +4040,12 @@ void GLCanvas3D::enable_toolbar(bool enable) | |||
|     m_toolbar.set_enabled(enable); | ||||
| } | ||||
| 
 | ||||
| #if !ENABLE_REWORKED_BED_SHAPE_CHANGE | ||||
| void GLCanvas3D::enable_force_zoom_to_bed(bool enable) | ||||
| { | ||||
|     m_force_zoom_to_bed_enabled = enable; | ||||
| } | ||||
| #endif // !ENABLE_REWORKED_BED_SHAPE_CHANGE
 | ||||
| 
 | ||||
| void GLCanvas3D::enable_dynamic_background(bool enable) | ||||
| { | ||||
|  | @ -4116,6 +4126,9 @@ void GLCanvas3D::set_viewport_from_scene(const GLCanvas3D& other) | |||
|     m_camera.set_scene_box(other.m_camera.get_scene_box(), *this); | ||||
|     m_camera.set_target(other.m_camera.get_target(), *this); | ||||
|     m_camera.zoom = other.m_camera.zoom; | ||||
| #if ENABLE_REWORKED_BED_SHAPE_CHANGE | ||||
|     m_requires_zoom_to_bed = false; | ||||
| #endif // ENABLE_REWORKED_BED_SHAPE_CHANGE
 | ||||
|     m_dirty = true; | ||||
| } | ||||
| 
 | ||||
|  | @ -4168,8 +4181,18 @@ void GLCanvas3D::render() | |||
| #endif // ENABLE_USE_UNIQUE_GLCONTEXT
 | ||||
|         return; | ||||
| 
 | ||||
| #if ENABLE_REWORKED_BED_SHAPE_CHANGE | ||||
|     if (m_requires_zoom_to_bed) | ||||
|     { | ||||
|         zoom_to_bed(); | ||||
|         const Size& cnv_size = get_canvas_size(); | ||||
|         _resize((unsigned int)cnv_size.get_width(), (unsigned int)cnv_size.get_height()); | ||||
|         m_requires_zoom_to_bed = false; | ||||
|     } | ||||
| #else | ||||
|     if (m_force_zoom_to_bed_enabled) | ||||
|         _force_zoom_to_bed(); | ||||
| #endif // ENABLE_REWORKED_BED_SHAPE_CHANGE
 | ||||
| 
 | ||||
|     _camera_tranform(); | ||||
| 
 | ||||
|  | @ -5738,11 +5761,13 @@ bool GLCanvas3D::_is_shown_on_screen() const | |||
|     return (m_canvas != nullptr) ? m_canvas->IsShownOnScreen() : false; | ||||
| } | ||||
| 
 | ||||
| #if !ENABLE_REWORKED_BED_SHAPE_CHANGE | ||||
| void GLCanvas3D::_force_zoom_to_bed() | ||||
| { | ||||
|     zoom_to_bed(); | ||||
|     m_force_zoom_to_bed_enabled = false; | ||||
| } | ||||
| #endif //  !ENABLE_REWORKED_BED_SHAPE_CHANGE
 | ||||
| 
 | ||||
| bool GLCanvas3D::_init_toolbar() | ||||
| { | ||||
|  | @ -5974,7 +5999,11 @@ void GLCanvas3D::_zoom_to_bounding_box(const BoundingBoxf3& bbox) | |||
| 
 | ||||
|         viewport_changed(); | ||||
| 
 | ||||
| #if ENABLE_REWORKED_BED_SHAPE_CHANGE | ||||
|         m_dirty = true; | ||||
| #else | ||||
|         _refresh_if_shown_on_screen(); | ||||
| #endif // ENABLE_REWORKED_BED_SHAPE_CHANGE
 | ||||
|     } | ||||
| } | ||||
| 
 | ||||
|  | @ -6076,11 +6105,15 @@ void GLCanvas3D::_refresh_if_shown_on_screen() | |||
| 
 | ||||
|         // Because of performance problems on macOS, where PaintEvents are not delivered
 | ||||
|         // frequently enough, we call render() here directly when we can.
 | ||||
| #if ENABLE_REWORKED_BED_SHAPE_CHANGE | ||||
|         render(); | ||||
| #else | ||||
|         // We can't do that when m_force_zoom_to_bed_enabled == true, because then render()
 | ||||
|         // ends up calling back here via _force_zoom_to_bed(), causing a stack overflow.
 | ||||
|         if (m_canvas != nullptr) { | ||||
|             m_force_zoom_to_bed_enabled ? m_canvas->Refresh() : render(); | ||||
|         } | ||||
| #endif // ENABLE_REWORKED_BED_SHAPE_CHANGE
 | ||||
|     } | ||||
| } | ||||
| 
 | ||||
|  |  | |||
|  | @ -829,7 +829,11 @@ private: | |||
|     bool m_dirty; | ||||
|     bool m_initialized; | ||||
|     bool m_use_VBOs; | ||||
| #if ENABLE_REWORKED_BED_SHAPE_CHANGE | ||||
|     bool m_requires_zoom_to_bed; | ||||
| #else | ||||
|     bool m_force_zoom_to_bed_enabled; | ||||
| #endif // ENABLE_REWORKED_BED_SHAPE_CHANGE
 | ||||
|     bool m_apply_zoom_to_volumes_filter; | ||||
|     mutable int m_hover_volume_id; | ||||
|     bool m_toolbar_action_running; | ||||
|  | @ -920,7 +924,9 @@ public: | |||
|     void enable_moving(bool enable); | ||||
|     void enable_gizmos(bool enable); | ||||
|     void enable_toolbar(bool enable); | ||||
| #if !ENABLE_REWORKED_BED_SHAPE_CHANGE | ||||
|     void enable_force_zoom_to_bed(bool enable); | ||||
| #endif // !ENABLE_REWORKED_BED_SHAPE_CHANGE
 | ||||
|     void enable_dynamic_background(bool enable); | ||||
|     void allow_multisample(bool allow); | ||||
| 
 | ||||
|  | @ -1001,7 +1007,9 @@ public: | |||
| 
 | ||||
| private: | ||||
|     bool _is_shown_on_screen() const; | ||||
| #if !ENABLE_REWORKED_BED_SHAPE_CHANGE | ||||
|     void _force_zoom_to_bed(); | ||||
| #endif // !ENABLE_REWORKED_BED_SHAPE_CHANGE
 | ||||
| 
 | ||||
|     bool _init_toolbar(); | ||||
| 
 | ||||
|  |  | |||
|  | @ -69,7 +69,9 @@ bool View3D::init(wxWindow* parent, Model* model, DynamicPrintConfig* config, Ba | |||
|     m_canvas->set_config(config); | ||||
|     m_canvas->enable_gizmos(true); | ||||
|     m_canvas->enable_toolbar(true); | ||||
| #if !ENABLE_REWORKED_BED_SHAPE_CHANGE | ||||
|     m_canvas->enable_force_zoom_to_bed(true); | ||||
| #endif // !ENABLE_REWORKED_BED_SHAPE_CHANGE
 | ||||
| 
 | ||||
| #if !ENABLE_IMGUI | ||||
|     m_gizmo_widget = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize); | ||||
|  | @ -107,7 +109,9 @@ void View3D::set_bed_shape(const Pointfs& shape) | |||
|     if (m_canvas != nullptr) | ||||
|     { | ||||
|         m_canvas->set_bed_shape(shape); | ||||
| #if !ENABLE_REWORKED_BED_SHAPE_CHANGE | ||||
|         m_canvas->zoom_to_bed(); | ||||
| #endif // !ENABLE_REWORKED_BED_SHAPE_CHANGE
 | ||||
|     } | ||||
| } | ||||
| 
 | ||||
|  |  | |||
|  | @ -1125,9 +1125,11 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame) | |||
|     this->background_process_timer.SetOwner(this->q, 0); | ||||
|     this->q->Bind(wxEVT_TIMER, [this](wxTimerEvent &evt) { this->update_restart_background_process(false, false); }); | ||||
| 
 | ||||
| #if !ENABLE_REWORKED_BED_SHAPE_CHANGE | ||||
|     auto *bed_shape = config->opt<ConfigOptionPoints>("bed_shape"); | ||||
|     view3D->set_bed_shape(bed_shape->values); | ||||
|     preview->set_bed_shape(bed_shape->values); | ||||
| #endif // !ENABLE_REWORKED_BED_SHAPE_CHANGE
 | ||||
| 
 | ||||
|     update(); | ||||
| 
 | ||||
|  | @ -2965,7 +2967,7 @@ void Plater::on_config_change(const DynamicPrintConfig &config) | |||
|         p->config->set_key_value(opt_key, config.option(opt_key)->clone()); | ||||
|         if (opt_key == "printer_technology") | ||||
|             this->set_printer_technology(config.opt_enum<PrinterTechnology>(opt_key)); | ||||
|         else if (opt_key  == "bed_shape") { | ||||
|         else if (opt_key == "bed_shape") { | ||||
|             if (p->view3D) p->view3D->set_bed_shape(p->config->option<ConfigOptionPoints>(opt_key)->values); | ||||
|             if (p->preview) p->preview->set_bed_shape(p->config->option<ConfigOptionPoints>(opt_key)->values); | ||||
|             update_scheduled = true; | ||||
|  | @ -2990,12 +2992,14 @@ void Plater::on_config_change(const DynamicPrintConfig &config) | |||
|             p->preview->set_number_extruders(p->config->option<ConfigOptionStrings>(opt_key)->values.size()); | ||||
|         } else if(opt_key == "max_print_height") { | ||||
|             update_scheduled = true; | ||||
|         } else if(opt_key == "printer_model") { | ||||
|         } | ||||
|         else if (opt_key == "printer_model") { | ||||
|             // update to force bed selection(for texturing)
 | ||||
|             if (p->view3D) p->view3D->set_bed_shape(p->config->option<ConfigOptionPoints>("bed_shape")->values); | ||||
|             if (p->preview) p->preview->set_bed_shape(p->config->option<ConfigOptionPoints>("bed_shape")->values); | ||||
|             update_scheduled = true; | ||||
|         } else if (opt_key == "host_type" && this->p->printer_technology == ptSLA) { | ||||
|         } | ||||
|         else if (opt_key == "host_type" && this->p->printer_technology == ptSLA) { | ||||
|             p->config->option<ConfigOptionEnum<PrintHostType>>(opt_key)->value = htSL1; | ||||
|         } | ||||
|     } | ||||
|  |  | |||
|  | @ -288,7 +288,7 @@ bool PrusaCollapsiblePaneMSW::Create(wxWindow *parent, wxWindowID id, const wxSt | |||
| { | ||||
| 	if (!wxControl::Create(parent, id, pos, size, style, val, name)) | ||||
| 		return false; | ||||
| 	m_pStaticLine = NULL; | ||||
| 	// m_pStaticLine = NULL;
 | ||||
| 	m_strLabel = label; | ||||
| 
 | ||||
| 	// sizer containing the expand button and possibly a static line
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 tamasmeszaros
						tamasmeszaros