mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-30 12:11:15 -06:00 
			
		
		
		
	Code cleanup
This commit is contained in:
		
							parent
							
								
									e0a97ce019
								
							
						
					
					
						commit
						e43e89d495
					
				
					 4 changed files with 0 additions and 85 deletions
				
			
		|  | @ -366,15 +366,11 @@ const Pointfs& GLCanvas3D::Bed::get_shape() const | |||
| 
 | ||||
| bool GLCanvas3D::Bed::set_shape(const Pointfs& shape) | ||||
| { | ||||
| //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||
| #if ENABLE_REWORKED_BED_SHAPE_CHANGE | ||||
|     EType new_type = _detect_type(shape); | ||||
| #else | ||||
| //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||
|     EType new_type = _detect_type(); | ||||
| //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||
| #endif // ENABLE_REWORKED_BED_SHAPE_CHANGE
 | ||||
| //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||
|     if (m_shape == shape && m_type == new_type) | ||||
|         // No change, no need to update the UI.
 | ||||
|         return false; | ||||
|  | @ -524,15 +520,11 @@ void GLCanvas3D::Bed::_calc_gridlines(const ExPolygon& poly, const BoundingBox& | |||
|         printf("Unable to create bed grid lines\n"); | ||||
| } | ||||
| 
 | ||||
| //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||
| #if ENABLE_REWORKED_BED_SHAPE_CHANGE | ||||
| GLCanvas3D::Bed::EType GLCanvas3D::Bed::_detect_type(const Pointfs& shape) const | ||||
| #else | ||||
| //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||
| GLCanvas3D::Bed::EType GLCanvas3D::Bed::_detect_type() const | ||||
| //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||
| #endif // ENABLE_REWORKED_BED_SHAPE_CHANGE
 | ||||
| //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||
| { | ||||
|     EType type = Custom; | ||||
| 
 | ||||
|  | @ -544,7 +536,6 @@ GLCanvas3D::Bed::EType GLCanvas3D::Bed::_detect_type() const | |||
|         { | ||||
| 			if (curr->config.has("bed_shape")) | ||||
| 			{ | ||||
| //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||
| #if ENABLE_REWORKED_BED_SHAPE_CHANGE | ||||
|                 if ((curr->vendor != nullptr) && (curr->vendor->name == "Prusa Research") && (shape == dynamic_cast<const ConfigOptionPoints*>(curr->config.option("bed_shape"))->values)) | ||||
|                 { | ||||
|  | @ -565,7 +556,6 @@ GLCanvas3D::Bed::EType GLCanvas3D::Bed::_detect_type() const | |||
|                     } | ||||
|                 } | ||||
| #else | ||||
| //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||
|                 if (boost::contains(curr->name, "SL1")) | ||||
| 				{ | ||||
| 					//FIXME add a condition on the size of the print bed?
 | ||||
|  | @ -587,9 +577,7 @@ GLCanvas3D::Bed::EType GLCanvas3D::Bed::_detect_type() const | |||
| 						} | ||||
| 					} | ||||
| 				} | ||||
| //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||
| #endif // ENABLE_REWORKED_BED_SHAPE_CHANGE
 | ||||
| //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||
|             } | ||||
| 
 | ||||
|             curr = bundle->printers.get_preset_parent(*curr); | ||||
|  | @ -656,9 +644,6 @@ void GLCanvas3D::Bed::_render_prusa(const std::string &key, float theta) const | |||
|     { | ||||
|         filename = model_path + "_bed.stl"; | ||||
|         if ((m_model.get_filename() != filename) && m_model.init_from_file(filename, useVBOs)) { | ||||
| //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||
|             std::cout << "bed model: " << filename << std::endl; | ||||
| //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||
|             Vec3d offset = m_bounding_box.center() - Vec3d(0.0, 0.0, 0.1 + 0.5 * m_model.get_bounding_box().size()(2)); | ||||
|             if (key == "mk2") | ||||
|                 offset.y() += 15. / 2.; | ||||
|  | @ -751,9 +736,7 @@ void GLCanvas3D::Bed::_render_custom() const | |||
|     } | ||||
| } | ||||
| 
 | ||||
| //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||
| #if !ENABLE_REWORKED_BED_SHAPE_CHANGE | ||||
| //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||
| bool GLCanvas3D::Bed::_are_equal(const Pointfs& bed_1, const Pointfs& bed_2) | ||||
| { | ||||
|     if (bed_1.size() != bed_2.size()) | ||||
|  | @ -767,9 +750,7 @@ bool GLCanvas3D::Bed::_are_equal(const Pointfs& bed_1, const Pointfs& bed_2) | |||
| 
 | ||||
|     return true; | ||||
| } | ||||
| //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||
| #endif // !ENABLE_REWORKED_BED_SHAPE_CHANGE
 | ||||
| //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||
| 
 | ||||
| const double GLCanvas3D::Axes::Radius = 0.5; | ||||
| const double GLCanvas3D::Axes::ArrowBaseRadius = 2.5 * GLCanvas3D::Axes::Radius; | ||||
|  | @ -4267,38 +4248,9 @@ void GLCanvas3D::set_bed_shape(const Pointfs& shape) | |||
| { | ||||
|     bool new_shape = m_bed.set_shape(shape); | ||||
| 
 | ||||
| //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||
| #if ENABLE_REWORKED_BED_SHAPE_CHANGE | ||||
|     if (new_shape) | ||||
|     { | ||||
|         Bed::EType type = m_bed.get_type(); | ||||
| 
 | ||||
|         std::cout << "set_bed_shape: (" << (void*)this << ")"; | ||||
|         switch (type) | ||||
|         { | ||||
|         case Bed::MK2: | ||||
|         { | ||||
|             std::cout << " [MK2]"; | ||||
|             break; | ||||
|         } | ||||
|         case Bed::MK3: | ||||
|         { | ||||
|             std::cout << " [MK3]"; | ||||
|             break; | ||||
|         } | ||||
|         case Bed::SL1: | ||||
|         { | ||||
|             std::cout << " [SL1]"; | ||||
|             break; | ||||
|         } | ||||
|         case Bed::Custom: | ||||
|         { | ||||
|             std::cout << " [Custom]"; | ||||
|             break; | ||||
|         } | ||||
|         } | ||||
|         std::cout << std::endl; | ||||
| 
 | ||||
|         // Set the origin and size for painting of the coordinate system axes.
 | ||||
|         m_axes.origin = Vec3d(0.0, 0.0, (double)GROUND_Z); | ||||
|         set_bed_axes_length(0.1 * m_bed.get_bounding_box().max_size()); | ||||
|  | @ -4307,7 +4259,6 @@ void GLCanvas3D::set_bed_shape(const Pointfs& shape) | |||
|         m_dirty = true; | ||||
|     } | ||||
| #else | ||||
| //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||
|     // Set the origin and size for painting of the coordinate system axes.
 | ||||
|     m_axes.origin = Vec3d(0.0, 0.0, (double)GROUND_Z); | ||||
|     set_bed_axes_length(0.1 * m_bed.get_bounding_box().max_size()); | ||||
|  | @ -4316,9 +4267,7 @@ void GLCanvas3D::set_bed_shape(const Pointfs& shape) | |||
|         zoom_to_bed(); | ||||
| 
 | ||||
|     m_dirty = true; | ||||
| //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||
| #endif // ENABLE_REWORKED_BED_SHAPE_CHANGE
 | ||||
| //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||
| } | ||||
| 
 | ||||
| void GLCanvas3D::set_bed_axes_length(double length) | ||||
|  | @ -4566,9 +4515,6 @@ void GLCanvas3D::render() | |||
| #if ENABLE_REWORKED_BED_SHAPE_CHANGE | ||||
|     if (m_requires_zoom_to_bed) | ||||
|     { | ||||
| //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||
|         std::cout << "zooming to bed" << std::endl; | ||||
| //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||
|         zoom_to_bed(); | ||||
|         const Size& cnv_size = get_canvas_size(); | ||||
|         _resize((unsigned int)cnv_size.get_width(), (unsigned int)cnv_size.get_height()); | ||||
|  | @ -4872,13 +4818,9 @@ void GLCanvas3D::reload_scene(bool refresh_immediately, bool force_full_scene_re | |||
|     if (m_reload_delayed) | ||||
|         return; | ||||
| 
 | ||||
| //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||
| #if !ENABLE_REWORKED_BED_SHAPE_CHANGE | ||||
| //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||
|     set_bed_shape(dynamic_cast<const ConfigOptionPoints*>(m_config->option("bed_shape"))->values); | ||||
| //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||
| #endif // !ENABLE_REWORKED_BED_SHAPE_CHANGE
 | ||||
| //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||
| 
 | ||||
|     if (m_regenerate_volumes) | ||||
|     { | ||||
|  |  | |||
|  | @ -226,11 +226,9 @@ class GLCanvas3D | |||
|     public: | ||||
|         Bed(); | ||||
| 
 | ||||
| //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||
| #if ENABLE_REWORKED_BED_SHAPE_CHANGE | ||||
|         EType get_type() const { return m_type; } | ||||
| #endif // ENABLE_REWORKED_BED_SHAPE_CHANGE
 | ||||
| //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||
| 
 | ||||
|         bool is_prusa() const; | ||||
|         bool is_custom() const; | ||||
|  | @ -253,28 +251,20 @@ class GLCanvas3D | |||
|         void _calc_bounding_box(); | ||||
|         void _calc_triangles(const ExPolygon& poly); | ||||
|         void _calc_gridlines(const ExPolygon& poly, const BoundingBox& bed_bbox); | ||||
| //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||
| #if ENABLE_REWORKED_BED_SHAPE_CHANGE | ||||
|         EType _detect_type(const Pointfs& shape) const; | ||||
| #else | ||||
| //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||
|         EType _detect_type() const; | ||||
| //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||
| #endif // ENABLE_REWORKED_BED_SHAPE_CHANGE
 | ||||
| //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||
| #if ENABLE_PRINT_BED_MODELS | ||||
|         void _render_prusa(const std::string &key, float theta, bool useVBOs) const; | ||||
| #else | ||||
|         void _render_prusa(const std::string &key, float theta) const; | ||||
| #endif // ENABLE_PRINT_BED_MODELS
 | ||||
|         void _render_custom() const; | ||||
| //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||
| #if !ENABLE_REWORKED_BED_SHAPE_CHANGE | ||||
| //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||
|         static bool _are_equal(const Pointfs& bed_1, const Pointfs& bed_2); | ||||
| //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||
| #endif // !ENABLE_REWORKED_BED_SHAPE_CHANGE
 | ||||
| //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||
|     }; | ||||
| 
 | ||||
|     struct Axes | ||||
|  |  | |||
|  | @ -419,11 +419,9 @@ void Preview::reload_print(bool force) | |||
|     m_canvas->reset_legend_texture(); | ||||
|     m_loaded = false; | ||||
| 
 | ||||
| //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||
| #if ENABLE_REWORKED_BED_SHAPE_CHANGE | ||||
|     m_canvas->set_bed_shape(dynamic_cast<const ConfigOptionPoints*>(m_config->option("bed_shape"))->values); | ||||
| #endif // ENABLE_REWORKED_BED_SHAPE_CHANGE
 | ||||
| //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||
| 
 | ||||
|     if (!IsShown() && !force) | ||||
|         return; | ||||
|  |  | |||
|  | @ -3017,27 +3017,20 @@ void Plater::on_extruders_change(int num_extruders) | |||
| void Plater::on_config_change(const DynamicPrintConfig &config) | ||||
| { | ||||
|     bool update_scheduled = false; | ||||
| //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||
| #if ENABLE_REWORKED_BED_SHAPE_CHANGE | ||||
|     bool bed_shape_changed = false; | ||||
| #endif // ENABLE_REWORKED_BED_SHAPE_CHANGE
 | ||||
| //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||
|     for (auto opt_key : p->config->diff(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") { | ||||
| //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||
| #if ENABLE_REWORKED_BED_SHAPE_CHANGE | ||||
|             bed_shape_changed = true; | ||||
|             std::cout << "changed bed shape" << std::endl; | ||||
| #else | ||||
| //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||
|             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); | ||||
| //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||
| #endif // ENABLE_REWORKED_BED_SHAPE_CHANGE
 | ||||
| //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||
|             update_scheduled = true; | ||||
|         }  | ||||
|         else if (boost::starts_with(opt_key, "wipe_tower") || | ||||
|  | @ -3063,17 +3056,12 @@ void Plater::on_config_change(const DynamicPrintConfig &config) | |||
|         } | ||||
|         else if (opt_key == "printer_model") { | ||||
|             // update to force bed selection(for texturing)
 | ||||
| //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||
| #if ENABLE_REWORKED_BED_SHAPE_CHANGE | ||||
|             bed_shape_changed = true; | ||||
|             std::cout << "changed printer model" << std::endl; | ||||
| #else | ||||
| //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||
|             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); | ||||
| //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||
| #endif // ENABLE_REWORKED_BED_SHAPE_CHANGE
 | ||||
| //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||
|             update_scheduled = true; | ||||
|         } | ||||
|         else if (opt_key == "host_type" && this->p->printer_technology == ptSLA) { | ||||
|  | @ -3086,16 +3074,13 @@ void Plater::on_config_change(const DynamicPrintConfig &config) | |||
|         p->sidebar->show_send(prin_host_opt != nullptr && !prin_host_opt->value.empty()); | ||||
|     } | ||||
| 
 | ||||
| //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||
| #if ENABLE_REWORKED_BED_SHAPE_CHANGE | ||||
|     if (bed_shape_changed) | ||||
|     { | ||||
|         std::cout << "calling bed shape updater on views" << std::endl; | ||||
|         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); | ||||
|     } | ||||
| #endif // ENABLE_REWORKED_BED_SHAPE_CHANGE
 | ||||
| //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||
| 
 | ||||
|     if (update_scheduled)  | ||||
|         update(); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Enrico Turri
						Enrico Turri