mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-28 03:11:47 +00:00
Merge main + clean up code + fix missing include
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include <vector>
|
||||
#include <boost/filesystem/path.hpp>
|
||||
|
||||
#include <wx/colour.h>
|
||||
#include <wx/panel.h>
|
||||
// BBS
|
||||
#include <wx/notebook.h>
|
||||
@@ -86,6 +87,10 @@ using t_optgroups = std::vector <std::shared_ptr<ConfigOptionsGroup>>;
|
||||
class Plater;
|
||||
enum class ActionButtonType : int;
|
||||
|
||||
// Sentinel filament id meaning "use the slot the sidebar context menu was opened on"
|
||||
// (Sidebar::priv::m_menu_filament_id) rather than an explicit index.
|
||||
inline constexpr int kSidebarContextMenuFilamentId = -2;
|
||||
|
||||
#define EVT_PUBLISHING_START 1
|
||||
#define EVT_PUBLISHING_STOP 2
|
||||
|
||||
@@ -188,7 +193,7 @@ public:
|
||||
void delete_filament(size_t filament_id = size_t(-1), int replace_filament_id = -1); // 0 base, -1 means default
|
||||
void change_filament(size_t from_id, size_t to_id); // 0 base
|
||||
void edit_filament();
|
||||
void add_custom_filament(wxColour new_col);
|
||||
void add_custom_filament(wxColour new_col, const std::string& preset_name = std::string(), bool skip_preset_validation = false);
|
||||
bool is_new_project_in_gcode3mf();
|
||||
// BBS
|
||||
void on_bed_type_change(BedType bed_type);
|
||||
@@ -262,6 +267,20 @@ public:
|
||||
std::vector<PlaterPresetComboBox*>& combos_filament();
|
||||
void clear_combos_filament_badge();
|
||||
void udpate_combos_filament_badge();
|
||||
|
||||
// Mixed-color filament sidebar section
|
||||
void add_mixed_filament();
|
||||
void edit_mixed_filament(size_t idx);
|
||||
void delete_mixed_filament_at(size_t idx);
|
||||
void decompose_filament_color(int filament_idx);
|
||||
void recalc_filament_scroll_sizes();
|
||||
void update_mixed_filament_list();
|
||||
bool has_broken_mixed_filament() const;
|
||||
bool has_broken_mixed_filament(const PartPlate* plate) const;
|
||||
void collect_physical_filament_info(std::vector<std::string>& color_strs,
|
||||
std::vector<std::string>& names,
|
||||
std::vector<std::string>& types,
|
||||
std::vector<size_t>* config_indices = nullptr);
|
||||
Search::OptionsSearcher& get_searcher();
|
||||
std::string& get_search_line();
|
||||
void update_printer_thumbnail();
|
||||
@@ -313,6 +332,11 @@ public:
|
||||
const SLAPrint& sla_print() const;
|
||||
SLAPrint& sla_print();
|
||||
|
||||
// Helper: returns config indices where filament_is_mixed == true
|
||||
std::vector<size_t> mixed_filament_config_indices() const;
|
||||
// Helper: returns config indices where filament_is_mixed == false
|
||||
std::vector<size_t> physical_filament_config_indices() const;
|
||||
|
||||
int new_project(bool skip_confirm = false, bool silent = false, const wxString& project_name = wxString());
|
||||
// BBS: save & backup
|
||||
void load_project(wxString const & filename = "", wxString const & originfile = "-");
|
||||
@@ -384,8 +408,6 @@ public:
|
||||
|
||||
// BBS: restore
|
||||
std::vector<size_t> load_files(const std::vector<boost::filesystem::path>& input_files, LoadStrategy strategy = LoadStrategy::LoadModel | LoadStrategy::LoadConfig, bool ask_multi = false, bool* published_out = nullptr);
|
||||
// To be called when providing a list of files to the GUI slic3r on command line.
|
||||
std::vector<size_t> load_files(const std::vector<std::string>& input_files, LoadStrategy strategy = LoadStrategy::LoadModel | LoadStrategy::LoadConfig, bool ask_multi = false);
|
||||
// to be called on drag and drop
|
||||
bool load_files(const wxArrayString& filenames);
|
||||
|
||||
@@ -571,7 +593,7 @@ public:
|
||||
|
||||
void on_filament_change(size_t filament_idx);
|
||||
void on_filament_count_change(size_t extruders_count);
|
||||
void on_filaments_delete(size_t extruders_count, size_t filament_id, int replace_filament_id = -1);
|
||||
void on_filaments_delete(size_t extruders_count, size_t filament_id, int replace_filament_id = -1, const std::vector<unsigned char>& is_mixed_before_delete = {});
|
||||
std::vector<Slic3r::ColorRGBA> get_extruders_colors();
|
||||
// BBS
|
||||
void on_bed_type_change(BedType bed_type);
|
||||
@@ -586,6 +608,12 @@ public:
|
||||
std::vector<std::string> get_extruder_colors_from_plater_config(const GCodeProcessorResult* const result = nullptr) const;
|
||||
std::vector<std::string> get_filament_colors_render_info() const;
|
||||
std::vector<std::string> get_filament_color_render_type() const;
|
||||
|
||||
// Per slot, the colours a gradient mixed filament actually prints, sampled bottom (index 0)
|
||||
// to top, so the sidebar, the paint gizmo and the extruder icons draw the same fade the
|
||||
// editor previews rather than a straight blend of two endpoints. A slot that is not a
|
||||
// gradient mixed filament gets an empty ramp. Cached; recomputed when the config changes.
|
||||
const std::vector<std::vector<wxColour>>& get_filament_gradient_ramps() const;
|
||||
std::vector<std::string> get_colors_for_color_print(const GCodeProcessorResult* const result = nullptr) const;
|
||||
|
||||
void set_global_filament_map_mode(FilamentMapMode mode);
|
||||
|
||||
Reference in New Issue
Block a user