mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-30 20:21:12 -06:00 
			
		
		
		
	Merge branch 'master' of https://github.com/prusa3d/PrusaSlicer
This commit is contained in:
		
						commit
						f991017a3f
					
				
					 5 changed files with 55 additions and 16 deletions
				
			
		|  | @ -198,6 +198,29 @@ private: | ||||||
|     void make_expolygons(std::vector<IntersectionLine> &lines, const float closing_radius, ExPolygons* slices) const; |     void make_expolygons(std::vector<IntersectionLine> &lines, const float closing_radius, ExPolygons* slices) const; | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
|  | inline void slice_mesh( | ||||||
|  |     const TriangleMesh &                              mesh, | ||||||
|  |     const std::vector<float> &                        z, | ||||||
|  |     std::vector<Polygons> &                           layers, | ||||||
|  |     TriangleMeshSlicer::throw_on_cancel_callback_type thr = nullptr) | ||||||
|  | { | ||||||
|  |     if (mesh.empty()) return; | ||||||
|  |     TriangleMeshSlicer slicer(&mesh); | ||||||
|  |     slicer.slice(z, &layers, thr); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | inline void slice_mesh( | ||||||
|  |     const TriangleMesh &                              mesh, | ||||||
|  |     const std::vector<float> &                        z, | ||||||
|  |     std::vector<ExPolygons> &                         layers, | ||||||
|  |     float                                             closing_radius, | ||||||
|  |     TriangleMeshSlicer::throw_on_cancel_callback_type thr = nullptr) | ||||||
|  | { | ||||||
|  |     if (mesh.empty()) return; | ||||||
|  |     TriangleMeshSlicer slicer(&mesh); | ||||||
|  |     slicer.slice(z, closing_radius, &layers, thr); | ||||||
|  | } | ||||||
|  | 
 | ||||||
| TriangleMesh make_cube(double x, double y, double z); | TriangleMesh make_cube(double x, double y, double z); | ||||||
| 
 | 
 | ||||||
| // Generate a TriangleMesh of a cylinder
 | // Generate a TriangleMesh of a cylinder
 | ||||||
|  |  | ||||||
|  | @ -655,14 +655,6 @@ void PageMaterials::update_lists(int sel1, int sel2) | ||||||
| 
 | 
 | ||||||
|         sel2_prev = sel2; |         sel2_prev = sel2; | ||||||
|     } |     } | ||||||
| 
 |  | ||||||
|     // for the very begining
 |  | ||||||
|     if ((wizard_p()->run_reason == ConfigWizard::RR_DATA_EMPTY || wizard_p()->run_reason == ConfigWizard::RR_DATA_LEGACY) |  | ||||||
|         && list_l3->size() > 0 ) |  | ||||||
|     { |  | ||||||
|         list_l3->Check(0, true); |  | ||||||
|         wizard_p()->update_presets_in_config(materials->appconfig_section(), list_l3->get_data(0), true); |  | ||||||
|     } |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void PageMaterials::select_material(int i) | void PageMaterials::select_material(int i) | ||||||
|  | @ -1254,7 +1246,7 @@ const std::string Materials::UNKNOWN = "(Unknown)"; | ||||||
| 
 | 
 | ||||||
| void Materials::push(const Preset *preset) | void Materials::push(const Preset *preset) | ||||||
| { | { | ||||||
|     presets.insert(preset); |     presets.push_back(preset); | ||||||
|     types.insert(technology & T_FFF |     types.insert(technology & T_FFF | ||||||
|         ? Materials::get_filament_type(preset) |         ? Materials::get_filament_type(preset) | ||||||
|         : Materials::get_material_type(preset)); |         : Materials::get_material_type(preset)); | ||||||
|  | @ -1527,6 +1519,10 @@ void ConfigWizard::priv::update_materials(Technology technology) | ||||||
|                         } |                         } | ||||||
| 
 | 
 | ||||||
|                         if (filament.is_compatible_with_printer(printer)) { |                         if (filament.is_compatible_with_printer(printer)) { | ||||||
|  |                             // Check if filament is already added
 | ||||||
|  |                             if (filaments.containts(&filament))  | ||||||
|  |                                 continue; | ||||||
|  | 
 | ||||||
|                             filaments.push(&filament); |                             filaments.push(&filament); | ||||||
|                             if (!filament.alias.empty()) |                             if (!filament.alias.empty()) | ||||||
|                                 aliases_fff[filament.alias].insert(filament.name); |                                 aliases_fff[filament.alias].insert(filament.name); | ||||||
|  | @ -1556,6 +1552,10 @@ void ConfigWizard::priv::update_materials(Technology technology) | ||||||
|                         } |                         } | ||||||
| 
 | 
 | ||||||
|                         if (material.is_compatible_with_printer(printer)) { |                         if (material.is_compatible_with_printer(printer)) { | ||||||
|  |                             // Check if material is already added
 | ||||||
|  |                             if (sla_materials.containts(&material)) | ||||||
|  |                                 continue; | ||||||
|  | 
 | ||||||
|                             sla_materials.push(&material); |                             sla_materials.push(&material); | ||||||
|                             if (!material.alias.empty()) |                             if (!material.alias.empty()) | ||||||
|                                 aliases_sla[material.alias].insert(material.name); |                                 aliases_sla[material.alias].insert(material.name); | ||||||
|  | @ -1905,14 +1905,23 @@ ConfigWizard::ConfigWizard(wxWindow *parent) | ||||||
|     }); |     }); | ||||||
| 
 | 
 | ||||||
|     p->btn_prev->Bind(wxEVT_BUTTON, [this](const wxCommandEvent &) { this->p->index->go_prev(); }); |     p->btn_prev->Bind(wxEVT_BUTTON, [this](const wxCommandEvent &) { this->p->index->go_prev(); }); | ||||||
|     p->btn_next->Bind(wxEVT_BUTTON, [this](const wxCommandEvent &) { this->p->index->go_next(); }); | 
 | ||||||
|  |     p->btn_next->Bind(wxEVT_BUTTON, [this](const wxCommandEvent &) | ||||||
|  |     { | ||||||
|  |         // check, that there is selected at least one filament/material
 | ||||||
|  |         ConfigWizardPage* active_page = this->p->index->active_page(); | ||||||
|  |         if ( (active_page == p->page_filaments || active_page == p->page_sla_materials) | ||||||
|  |             && !p->check_material_config()) | ||||||
|  |             return; | ||||||
|  |         this->p->index->go_next(); | ||||||
|  |     }); | ||||||
|  | 
 | ||||||
|     p->btn_finish->Bind(wxEVT_BUTTON, [this](const wxCommandEvent &) |     p->btn_finish->Bind(wxEVT_BUTTON, [this](const wxCommandEvent &) | ||||||
|     { |     { | ||||||
|         if (!p->check_material_config()) |         if (!p->check_material_config()) | ||||||
|             return; |             return; | ||||||
|         this->EndModal(wxID_OK); |         this->EndModal(wxID_OK); | ||||||
|     }); |     }); | ||||||
| //    p->btn_finish->Hide();
 |  | ||||||
| 
 | 
 | ||||||
|     p->btn_sel_all->Bind(wxEVT_BUTTON, [this](const wxCommandEvent &) { |     p->btn_sel_all->Bind(wxEVT_BUTTON, [this](const wxCommandEvent &) { | ||||||
|         p->any_sla_selected = true; |         p->any_sla_selected = true; | ||||||
|  | @ -1925,7 +1934,6 @@ ConfigWizard::ConfigWizard(wxWindow *parent) | ||||||
|     p->index->Bind(EVT_INDEX_PAGE, [this](const wxCommandEvent &) { |     p->index->Bind(EVT_INDEX_PAGE, [this](const wxCommandEvent &) { | ||||||
|         const bool is_last = p->index->active_is_last(); |         const bool is_last = p->index->active_is_last(); | ||||||
|         p->btn_next->Show(! is_last); |         p->btn_next->Show(! is_last); | ||||||
| //        p->btn_finish->Show(is_last);
 |  | ||||||
|         if (is_last) |         if (is_last) | ||||||
|             p->btn_finish->SetFocus(); |             p->btn_finish->SetFocus(); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -58,15 +58,16 @@ enum Technology { | ||||||
| struct Materials | struct Materials | ||||||
| { | { | ||||||
|     Technology technology; |     Technology technology; | ||||||
|     std::set<const Preset*> presets; |     // use vector for the presets to purpose of save of presets sorting in the bundle
 | ||||||
|  |     std::vector<const Preset*> presets; | ||||||
|     std::set<std::string> types; |     std::set<std::string> types; | ||||||
| 
 | 
 | ||||||
|     Materials(Technology technology) : technology(technology) {} |     Materials(Technology technology) : technology(technology) {} | ||||||
| 
 | 
 | ||||||
|     void push(const Preset *preset); |     void push(const Preset *preset); | ||||||
|     void clear(); |     void clear(); | ||||||
|     bool containts(const Preset *preset) { |     bool containts(const Preset *preset) const { | ||||||
|         return presets.find(preset) != presets.end();  |         return std::find(presets.begin(), presets.end(), preset) != presets.end();  | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     const std::string& appconfig_section() const; |     const std::string& appconfig_section() const; | ||||||
|  |  | ||||||
|  | @ -2929,7 +2929,13 @@ void Tab::OnTreeSelChange(wxTreeEvent& event) | ||||||
| #ifdef __linux__ | #ifdef __linux__ | ||||||
|     std::unique_ptr<wxWindowUpdateLocker> no_updates(new wxWindowUpdateLocker(this)); |     std::unique_ptr<wxWindowUpdateLocker> no_updates(new wxWindowUpdateLocker(this)); | ||||||
| #else | #else | ||||||
| //	wxWindowUpdateLocker noUpdates(this);
 |     /* On Windows we use DoubleBuffering during rendering,
 | ||||||
|  |      * so on Window is no needed to call a Freeze/Thaw functions. | ||||||
|  |      * But under OSX (builds compiled with MacOSX10.14.sdk) wxStaticBitmap rendering is broken without Freeze/Thaw call. | ||||||
|  |      */ | ||||||
|  | #ifdef __WXOSX__ | ||||||
|  | 	wxWindowUpdateLocker noUpdates(this); | ||||||
|  | #endif | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
|     if (m_pages.empty()) |     if (m_pages.empty()) | ||||||
|  |  | ||||||
|  | @ -11,6 +11,7 @@ namespace Slic3r { | ||||||
| 
 | 
 | ||||||
| class AppConfig; | class AppConfig; | ||||||
| class PresetBundle; | class PresetBundle; | ||||||
|  | class Semver; | ||||||
| 
 | 
 | ||||||
| class PresetUpdater | class PresetUpdater | ||||||
| { | { | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Enrico Turri
						Enrico Turri