OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::GUI::ColorDecomposeDialog Class Reference

#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/ColorDecomposeDialog.hpp>

Inheritance diagram for Slic3r::GUI::ColorDecomposeDialog:
Collaboration diagram for Slic3r::GUI::ColorDecomposeDialog:

Classes

struct  ModeCardControls

Public Member Functions

 ColorDecomposeDialog (wxWindow *parent, int filament_idx, const wxColour &target_color, const std::vector< std::string > &physical_colors, const std::vector< std::string > &filament_names, const std::vector< std::string > &filament_types, size_t current_filament_count=0, size_t max_filament_count=32, std::vector< size_t > physical_config_indices={})
ColorDecomposeResult get_result () const
void set_missing_physical_calculator (std::function< size_t(const ColorDecomposeResult &)> fn)
void EndModal (int retCode) override
float scale_factor () const
float prev_scale_factor () const
void set_scale_factor (float v)
void set_prev_scale_factor (float v)
void set_em_unit (int v)
bool force_rescale () const
int em_unit () const
const wxFont & normal_font () const
void enable_force_rescale ()
int ShowModal ()

Protected Member Functions

void on_dpi_changed (const wxRect &suggested_rect) override
virtual void on_sys_color_changed ()

Private Member Functions

void build_ui ()
wxBoxSizer * create_filament_selector ()
wxBoxSizer * create_target_color_section ()
wxBoxSizer * create_mode_selection_section ()
wxPanel * create_mode_card (wxWindow *parent, DecomposeMode mode, const wxString &title)
wxBoxSizer * create_button_panel ()
void select_mode (DecomposeMode mode)
void update_card_styles ()
void update_card_visibility ()
void update_mode_card_content (DecomposeMode mode)
void update_mode_card_contents ()
void update_matched_color_display ()
void update_ok_button_state ()
void update_filament_limit_warning ()
void compute_decomposition ()
bool try_build_single_base_result (DecomposeMode mode, ColorDecomposeResult &out) const
void update_em_unit ()
bool is_new_scale_factor () const
void rescale (const wxRect &suggested_rect)

Private Attributes

ColorDecomposeResult m_result
std::array< ColorDecomposeResult, 3 > m_mode_results
std::array< ModeCardControls, 3 > m_mode_cards
int m_filament_idx {-1}
wxColour m_target_color
std::vector< std::string > m_physical_colors
std::vector< std::string > m_filament_names
std::vector< std::string > m_filament_types
std::vector< std::string > m_project_types
std::string m_preferred_type
std::vector< std::string > m_combo_item_types
size_t m_current_filament_count {0}
size_t m_max_filament_count {32}
std::vector< size_t > m_physical_config_indices
std::function< size_t(const ColorDecomposeResult &)> m_missing_calculator
ComboBox * m_type_combo {nullptr}
wxPanel * m_target_swatch {nullptr}
wxStaticText * m_target_rgb_text {nullptr}
wxPanel * m_matched_swatch {nullptr}
wxStaticText * m_matched_rgb_text {nullptr}
wxPanel * m_card_material_list {nullptr}
wxPanel * m_card_cmyw {nullptr}
wxPanel * m_card_rybw {nullptr}
wxPanel * m_arb_column_panel {nullptr}
CheckBox * m_chk_material_list {nullptr}
CheckBox * m_chk_cmyw {nullptr}
CheckBox * m_chk_rybw {nullptr}
DecomposeMode m_selected_mode {DecomposeMode::MaterialList}
wxStaticText * m_no_card_hint {nullptr}
wxPanel * m_limit_warning_panel {nullptr}
wxStaticText * m_limit_warning_text {nullptr}
Button * m_btn_ok {nullptr}
Button * m_btn_cancel {nullptr}
float m_scale_factor
int m_em_unit
wxFont m_normal_font
float m_prev_scale_factor
bool m_can_rescale
bool m_force_rescale
int m_new_font_point_size

Detailed Description


Class Documentation

◆ Slic3r::GUI::ColorDecomposeDialog::ModeCardControls

struct Slic3r::GUI::ColorDecomposeDialog::ModeCardControls
Class Members
wxPanel * card {nullptr}
wxBoxSizer * components_sizer {nullptr}

Constructor & Destructor Documentation

◆ ColorDecomposeDialog()

Slic3r::GUI::ColorDecomposeDialog::ColorDecomposeDialog ( wxWindow * parent,
int filament_idx,
const wxColour & target_color,
const std::vector< std::string > & physical_colors,
const std::vector< std::string > & filament_names,
const std::vector< std::string > & filament_types,
size_t current_filament_count = 0,
size_t max_filament_count = 32,
std::vector< size_t > physical_config_indices = {} )
189 : DPIDialog(parent, wxID_ANY, _L("Decompose Color"), wxDefaultPosition,
190 wxDefaultSize, wxCAPTION | wxCLOSE_BOX)
191 , m_filament_idx(filament_idx)
192 , m_target_color(target_color)
193 , m_physical_colors(physical_colors)
194 , m_filament_names(filament_names)
196 , m_current_filament_count(current_filament_count)
197 , m_max_filament_count(max_filament_count)
198 , m_physical_config_indices(std::move(physical_config_indices))
199{
200 for (const auto& t : m_filament_types) {
201 if (std::find(m_project_types.begin(), m_project_types.end(), t) == m_project_types.end())
202 m_project_types.push_back(t);
203 }
204
205 if (m_filament_idx >= 0 && static_cast<size_t>(m_filament_idx) < m_filament_types.size())
207 else if (!m_project_types.empty())
209
210 build_ui();
211 wxGetApp().UpdateDlgDarkUI(this);
212 // Restore target swatch after dark mode color remapping
213 if (m_target_swatch) {
214 m_target_swatch->SetBackgroundColour(m_target_color);
215 m_target_swatch->Refresh();
216 }
217
219 Fit();
223}
#define _L(s)
Definition OBJ.cpp:34
wxPanel * m_target_swatch
Definition ColorDecomposeDialog.hpp:126
int m_filament_idx
Definition ColorDecomposeDialog.hpp:110
void build_ui()
Definition ColorDecomposeDialog.cpp:232
void update_ok_button_state()
Definition ColorDecomposeDialog.cpp:717
std::vector< std::string > m_physical_colors
Definition ColorDecomposeDialog.hpp:112
void compute_decomposition()
Definition ColorDecomposeDialog.cpp:870
std::vector< size_t > m_physical_config_indices
Definition ColorDecomposeDialog.hpp:121
std::vector< std::string > m_filament_types
Definition ColorDecomposeDialog.hpp:114
size_t m_current_filament_count
Definition ColorDecomposeDialog.hpp:119
size_t m_max_filament_count
Definition ColorDecomposeDialog.hpp:120
void update_card_visibility()
Definition ColorDecomposeDialog.cpp:608
std::string m_preferred_type
Definition ColorDecomposeDialog.hpp:116
std::vector< std::string > m_filament_names
Definition ColorDecomposeDialog.hpp:113
wxColour m_target_color
Definition ColorDecomposeDialog.hpp:111
std::vector< std::string > m_project_types
Definition ColorDecomposeDialog.hpp:115
void update_matched_color_display()
Definition ColorDecomposeDialog.cpp:808
static const std::vector< std::string > filament_types
Definition CreatePresetsDialog.cpp:123

References _L, build_ui(), compute_decomposition(), Slic3r::GUI::filament_types, m_current_filament_count, m_filament_idx, m_filament_names, m_filament_types, m_max_filament_count, m_physical_colors, m_physical_config_indices, m_preferred_type, m_project_types, m_target_color, m_target_swatch, update_card_visibility(), update_matched_color_display(), and update_ok_button_state().

Here is the call graph for this function:

Member Function Documentation

◆ build_ui()

void Slic3r::GUI::ColorDecomposeDialog::build_ui ( )
private
233{
234 SetBackgroundColour(StateColor::darkModeColorFor(*wxWHITE));
235
236 auto* main_sizer = new wxBoxSizer(wxVERTICAL);
237
238 const int selector_side_margin = FromDIP(26);
239 const int selector_top_gap = FromDIP(22);
240 const int content_side_margin = FromDIP(30);
241 const int target_section_top_gap = FromDIP(18);
242
243 main_sizer->AddSpacer(selector_top_gap);
244 main_sizer->Add(create_filament_selector(), 0, wxEXPAND | wxLEFT | wxRIGHT, selector_side_margin);
245 main_sizer->AddSpacer(target_section_top_gap);
246 main_sizer->Add(create_target_color_section(), 0, wxEXPAND | wxLEFT | wxRIGHT, content_side_margin);
247 main_sizer->AddSpacer(FromDIP(16));
248 main_sizer->Add(create_h_divider(this), 0, wxEXPAND | wxLEFT | wxRIGHT, content_side_margin);
249 main_sizer->AddSpacer(FromDIP(16));
250 main_sizer->Add(create_mode_selection_section(), 0, wxEXPAND | wxLEFT | wxRIGHT, content_side_margin);
251 main_sizer->AddSpacer(FromDIP(16));
252 main_sizer->Add(create_button_panel(), 0, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, content_side_margin);
253
254 SetSizer(main_sizer);
255 SetMinSize(wxSize(FromDIP(477), FromDIP(380)));
256 Fit();
257 CenterOnParent();
258}
wxBoxSizer * create_target_color_section()
Definition ColorDecomposeDialog.cpp:364
wxBoxSizer * create_button_panel()
Definition ColorDecomposeDialog.cpp:564
wxBoxSizer * create_filament_selector()
Definition ColorDecomposeDialog.cpp:260
wxBoxSizer * create_mode_selection_section()
Definition ColorDecomposeDialog.cpp:485
static wxColour darkModeColorFor(wxColour const &color)
Definition StateColor.cpp:219
static wxPanel * create_h_divider(wxWindow *parent, int fixed_width=-1)
Definition ColorDecomposeDialog.cpp:147

References create_button_panel(), create_filament_selector(), Slic3r::GUI::create_h_divider(), create_mode_selection_section(), create_target_color_section(), and StateColor::darkModeColorFor().

Referenced by ColorDecomposeDialog().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ compute_decomposition()

void Slic3r::GUI::ColorDecomposeDialog::compute_decomposition ( )
private
871{
872 auto fallback_result = [this](DecomposeMode mode, const std::vector<DecomposeComponent>& components) {
873 ColorDecomposeResult result;
874 result.mode = mode;
875 result.components = components;
876 int total = 0;
877 double r = 0.0, g = 0.0, b = 0.0;
878 for (const auto& comp : result.components)
879 total += comp.ratio;
880 if (total <= 0)
881 total = 100;
882 for (const auto& comp : result.components) {
883 const double w = static_cast<double>(comp.ratio) / total;
884 r += comp.colour.Red() * w;
885 g += comp.colour.Green() * w;
886 b += comp.colour.Blue() * w;
887 }
888 result.matched_color = result.components.empty()
890 : wxColour(static_cast<unsigned char>(std::clamp(r, 0.0, 255.0)),
891 static_cast<unsigned char>(std::clamp(g, 0.0, 255.0)),
892 static_cast<unsigned char>(std::clamp(b, 0.0, 255.0)));
893 return result;
894 };
895
896 std::vector<ColorDecomposePhysicalFilament> physical_filaments;
897 physical_filaments.reserve(m_physical_colors.size());
898 for (size_t i = 0; i < m_physical_colors.size(); ++i) {
899 if (m_filament_idx >= 0 && i == static_cast<size_t>(m_filament_idx))
900 continue;
901 ColorDecomposePhysicalFilament filament;
902 filament.color_hex = m_physical_colors[i];
903 filament.name = i < m_filament_names.size() ? m_filament_names[i] : "";
904 filament.type = i < m_filament_types.size() ? m_filament_types[i] : "";
905 filament.filament_index = static_cast<unsigned int>(i + 1);
906 physical_filaments.push_back(std::move(filament));
907 }
908
909 const ColorDecomposeRgb target_rgb = wx_colour_to_recipe_rgb(m_target_color);
910
911 auto material_recipe = recommend_from_physical_filaments(target_rgb, physical_filaments, m_preferred_type);
912 if (material_recipe.valid) {
913 m_mode_results[mode_index(DecomposeMode::MaterialList)] =
914 to_dialog_result(material_recipe, m_target_color);
915 } else {
916 std::vector<DecomposeComponent> components;
917 for (size_t i = 0; i < std::min<size_t>(2, physical_filaments.size()); ++i) {
918 DecomposeComponent comp;
919 comp.colour = wxColour(physical_filaments[i].color_hex);
920 comp.ratio = 50;
921 comp.filament_index = static_cast<int>(physical_filaments[i].filament_index);
922 components.push_back(comp);
923 }
924 if (components.empty()) {
925 components.push_back({m_target_color, 100, -1});
926 } else if (components.size() == 1) {
927 components.front().ratio = 100;
928 }
929 m_mode_results[mode_index(DecomposeMode::MaterialList)] =
930 fallback_result(DecomposeMode::MaterialList, components);
931 }
932
933 ColorDecomposeResult single_base;
934 if (try_build_single_base_result(DecomposeMode::CMYW, single_base)) {
935 m_mode_results[mode_index(DecomposeMode::CMYW)] = single_base;
936 } else {
938 m_mode_results[mode_index(DecomposeMode::CMYW)] = cmyw_recipe.valid
939 ? to_dialog_result(cmyw_recipe, m_target_color)
940 : fallback_result(DecomposeMode::CMYW, {
943 });
944 }
945
946 if (try_build_single_base_result(DecomposeMode::RYBW, single_base)) {
947 m_mode_results[mode_index(DecomposeMode::RYBW)] = single_base;
948 } else {
950 m_mode_results[mode_index(DecomposeMode::RYBW)] = rybw_recipe.valid
951 ? to_dialog_result(rybw_recipe, m_target_color)
952 : fallback_result(DecomposeMode::RYBW, {
955 });
956 }
957
961}
DecomposeMode m_selected_mode
Definition ColorDecomposeDialog.hpp:139
bool try_build_single_base_result(DecomposeMode mode, ColorDecomposeResult &out) const
Definition ColorDecomposeDialog.cpp:823
ColorDecomposeResult m_result
Definition ColorDecomposeDialog.hpp:107
std::array< ColorDecomposeResult, 3 > m_mode_results
Definition ColorDecomposeDialog.hpp:108
void update_mode_card_contents()
Definition ColorDecomposeDialog.cpp:799
static ColorDecomposeRgb wx_colour_to_recipe_rgb(const wxColour &color)
Definition ColorDecomposeDialog.cpp:67
ColorDecomposeRecipeMode DecomposeMode
Definition ColorDecomposeDialog.hpp:27
@ RYBW
Definition TextureImportDialog.hpp:51
@ CMYW
Definition TextureImportDialog.hpp:50
static const wxColour CMYW_YELLOW(255, 255, 0)
static const wxColour RYBW_YELLOW(255, 255, 0)
@ Cyan
Definition ColorDecomposeDialog.hpp:31
@ Yellow
Definition ColorDecomposeDialog.hpp:33
@ Blue
Definition ColorDecomposeDialog.hpp:37
static const wxColour RYBW_BLUE(0, 0, 255)
static size_t mode_index(DecomposeMode mode)
Definition ColorDecomposeDialog.cpp:62
static const wxColour CMYW_CYAN(0, 255, 255)
static ColorDecomposeResult to_dialog_result(const ColorDecomposeRecipeResult &recipe, const wxColour &fallback)
Definition ColorDecomposeDialog.cpp:128
ColorDecomposeRecipeResult lookup_standard_recipe(const ColorDecomposeRgb &target, ColorDecomposeRecipeMode mode, const std::string &preferred_material_type)
Definition ColorDecomposeRecipe.cpp:333
@ RYBW
Definition ColorDecomposeRecipe.hpp:12
@ CMYW
Definition ColorDecomposeRecipe.hpp:11
ColorDecomposeRecipeResult recommend_from_physical_filaments(const ColorDecomposeRgb &target, const std::vector< ColorDecomposePhysicalFilament > &physical_filaments, const std::string &preferred_material_type)
Definition ColorDecomposeRecipe.cpp:250

References Slic3r::GUI::Blue, Slic3r::CMYW, Slic3r::GUI::CMYW_CYAN(), Slic3r::GUI::CMYW_YELLOW(), Slic3r::ColorDecomposePhysicalFilament::color_hex, Slic3r::GUI::DecomposeComponent::colour, Slic3r::GUI::ColorDecomposeResult::components, Slic3r::GUI::Cyan, Slic3r::ColorDecomposePhysicalFilament::filament_index, Slic3r::GUI::DecomposeComponent::filament_index, Slic3r::lookup_standard_recipe(), m_filament_idx, m_filament_names, m_filament_types, m_mode_results, m_physical_colors, m_preferred_type, m_result, m_selected_mode, m_target_color, Slic3r::GUI::ColorDecomposeResult::matched_color, Slic3r::GUI::ColorDecomposeResult::mode, Slic3r::GUI::mode_index(), Slic3r::ColorDecomposePhysicalFilament::name, Slic3r::GUI::DecomposeComponent::ratio, Slic3r::recommend_from_physical_filaments(), Slic3r::RYBW, Slic3r::GUI::RYBW_BLUE(), Slic3r::GUI::RYBW_YELLOW(), Slic3r::GUI::to_dialog_result(), try_build_single_base_result(), Slic3r::ColorDecomposePhysicalFilament::type, update_mode_card_contents(), update_ok_button_state(), Slic3r::GUI::wx_colour_to_recipe_rgb(), and Slic3r::GUI::Yellow.

Referenced by ColorDecomposeDialog(), and create_filament_selector().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_button_panel()

wxBoxSizer * Slic3r::GUI::ColorDecomposeDialog::create_button_panel ( )
private
565{
566 auto* sizer = new wxBoxSizer(wxHORIZONTAL);
567 sizer->AddStretchSpacer();
568
569 m_btn_cancel = new Button(this, _L("Cancel"));
571 m_btn_cancel->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { EndModal(wxID_CANCEL); });
572
573 m_btn_ok = new Button(this, _L("OK"));
575 m_btn_ok->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) {
576 EndModal(wxID_OK);
577 });
578
579 sizer->Add(m_btn_cancel, 0, wxRIGHT, FromDIP(12));
580 sizer->Add(m_btn_ok, 0);
581
582 return sizer;
583}
@ Confirm
Definition Button.hpp:25
@ Regular
Definition Button.hpp:24
@ Choice
Definition Button.hpp:33
Button * m_btn_cancel
Definition ColorDecomposeDialog.hpp:149
Button * m_btn_ok
Definition ColorDecomposeDialog.hpp:148
void EndModal(int retCode) override
Definition GUI_Utils.hpp:305

References _L, Choice, Confirm, Slic3r::GUI::DPIDialog::EndModal(), m_btn_cancel, m_btn_ok, and Regular.

Referenced by build_ui().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_filament_selector()

wxBoxSizer * Slic3r::GUI::ColorDecomposeDialog::create_filament_selector ( )
private
261{
262 auto* sizer = new wxBoxSizer(wxHORIZONTAL);
263
264 m_type_combo = new ComboBox(this, wxID_ANY, wxEmptyString, wxDefaultPosition,
265 wxSize(-1, FromDIP(36)), 0, nullptr, wxCB_READONLY);
267
268 m_combo_item_types.clear();
269 int default_sel = -1;
270
271 // --- Group 1: Project filament list (deduplicated by type) ---
272 m_type_combo->Append(_L("Project Filament List"), wxNullBitmap, DD_ITEM_STYLE_SPLIT_ITEM | DD_ITEM_STYLE_DISABLED);
273 m_combo_item_types.push_back(std::string());
274
275 std::set<std::string> seen_types;
276 for (size_t i = 0; i < m_filament_names.size(); ++i) {
277 const std::string& type = (i < m_filament_types.size()) ? m_filament_types[i] : "PLA";
278 if (!seen_types.insert(type).second)
279 continue;
280 int idx = m_type_combo->Append(wxString::FromUTF8(m_filament_names[i]));
281 m_combo_item_types.push_back(type);
282 if (type == m_preferred_type && default_sel < 0)
283 default_sel = idx;
284 }
285
286 // --- Group 2: Standard mode material recommendations ---
287 static const char* kStandardTypes[] = {
289 };
290
291 m_type_combo->Append(_L("Standard Mode Recommendations"), wxNullBitmap, DD_ITEM_STYLE_SPLIT_ITEM | DD_ITEM_STYLE_DISABLED);
292 m_combo_item_types.push_back(std::string());
293
294 for (size_t s = 0; s < sizeof(kStandardTypes) / sizeof(kStandardTypes[0]); ++s) {
295 // Always show standard recommendations, even if the same type already
296 // appears in the project filament list above.
297 const std::string label = std::string(kDecomposeBambuPresetPrefix) + kStandardTypes[s];
298 int idx = m_type_combo->Append(wxString::FromUTF8(label));
299 m_combo_item_types.push_back(kStandardTypes[s]);
300 if (kStandardTypes[s] == m_preferred_type && default_sel < 0)
301 default_sel = idx;
302 }
303
304 if (default_sel < 0) {
305 for (int i = 0; i < static_cast<int>(m_combo_item_types.size()); ++i) {
306 if (!m_combo_item_types[i].empty()) {
307 default_sel = i;
308 break;
309 }
310 }
311 }
312
313 if (default_sel >= 0) {
314 m_type_combo->SetSelection(default_sel);
315 if (!m_combo_item_types[default_sel].empty())
317 }
318
319 m_type_combo->Bind(wxEVT_COMBOBOX, [this](wxCommandEvent& evt) {
320 evt.StopPropagation();
321 int sel = m_type_combo->GetSelection();
322 if (sel >= 0 && static_cast<size_t>(sel) < m_combo_item_types.size()
323 && !m_combo_item_types[sel].empty()) {
325 }
330 });
331
332 sizer->Add(m_type_combo, 1, wxEXPAND);
333 return sizer;
334}
#define DD_ITEM_STYLE_SPLIT_ITEM
Definition DropDown.hpp:26
#define DD_ITEM_STYLE_DISABLED
Definition DropDown.hpp:27
static wxFont Body_13
Definition Label.hpp:54
ComboBox * m_type_combo
Definition ColorDecomposeDialog.hpp:125
std::vector< std::string > m_combo_item_types
Definition ColorDecomposeDialog.hpp:118
constexpr const char * kDecomposePlaBasicType
Definition ColorDecomposeSupport.hpp:19
constexpr const char * kDecomposeBambuPresetPrefix
Definition ColorDecomposeSupport.hpp:25
bool empty(const BoundingBoxBase< PointType, PointsType > &bb)
Definition BoundingBox.hpp:273

References _L, Label::Body_13, compute_decomposition(), DD_ITEM_STYLE_DISABLED, DD_ITEM_STYLE_SPLIT_ITEM, Slic3r::empty(), Slic3r::GUI::kDecomposeBambuPresetPrefix, Slic3r::GUI::kDecomposePlaBasicType, m_combo_item_types, m_filament_names, m_filament_types, m_preferred_type, m_type_combo, update_card_visibility(), update_matched_color_display(), and update_ok_button_state().

Referenced by build_ui().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_mode_card()

wxPanel * Slic3r::GUI::ColorDecomposeDialog::create_mode_card ( wxWindow * parent,
DecomposeMode mode,
const wxString & title )
private
400{
401 const int pad = FromDIP(12);
402
403 auto* card = new wxPanel(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE);
404 card->SetBackgroundStyle(wxBG_STYLE_PAINT);
405
406 auto* card_sizer = new wxBoxSizer(wxVERTICAL);
407
408 auto* title_sizer = new wxBoxSizer(wxHORIZONTAL);
409 auto* title_label = new wxStaticText(card, wxID_ANY, title);
410 title_label->SetFont(Label::Body_14);
411 title_label->SetForegroundColour(StateColor::darkModeColorFor(wxColour("#6B6A6A")));
413 title_sizer->Add(title_label, 1, wxALIGN_CENTER_VERTICAL);
414
415 auto* chk = new ::CheckBox(card);
416 chk->SetValue(mode == m_selected_mode);
418 switch (mode) {
419 case DecomposeMode::MaterialList: m_chk_material_list = chk; break;
420 case DecomposeMode::CMYW: m_chk_cmyw = chk; break;
421 case DecomposeMode::RYBW: m_chk_rybw = chk; break;
422 }
423 chk->Bind(wxEVT_TOGGLEBUTTON, [this, mode](wxCommandEvent& e) {
424 select_mode(mode);
425 e.Skip(); // let CheckBox::update() re-sync its bitmap to GetValue()
426 });
427 title_sizer->Add(chk, 0, wxALIGN_CENTER_VERTICAL);
428
429 card_sizer->Add(title_sizer, 0, wxEXPAND | wxLEFT | wxRIGHT | wxTOP, pad);
430
431 card_sizer->Add(create_h_divider(card), 0, wxEXPAND | wxLEFT | wxRIGHT | wxTOP, FromDIP(8));
432
433 auto* colors_sizer = new wxBoxSizer(wxHORIZONTAL);
434 card_sizer->Add(colors_sizer, 0, wxEXPAND | wxLEFT | wxRIGHT | wxTOP | wxBOTTOM, pad);
435
436 auto& controls = m_mode_cards[mode_index(mode)];
437 controls.card = card;
438 controls.components_sizer = colors_sizer;
439
440 card->SetSizer(card_sizer);
441 card->SetMinSize(wxSize(FromDIP(128), FromDIP(111)));
442 card->SetMaxSize(wxSize(FromDIP(128), FromDIP(111)));
443
444 card->Bind(wxEVT_PAINT, [this, card, mode](wxPaintEvent&) {
445 wxBufferedPaintDC dc(card);
446 wxSize sz = card->GetClientSize();
447 dc.SetBackground(wxBrush(StateColor::darkModeColorFor(*wxWHITE)));
448 dc.Clear();
449
450 bool selected = (m_selected_mode == mode);
451 wxColour border_col = selected
453 : StateColor::darkModeColorFor(COLOR_BORDER_NORMAL);
454 const int border_width = FromDIP(selected ? 2 : 1);
455 const double inset = border_width / 2.0;
456 std::unique_ptr<wxGraphicsContext> gc(wxGraphicsContext::Create(dc));
457 if (gc) {
458 gc->SetPen(wxPen(border_col, border_width));
459 gc->SetBrush(wxBrush(StateColor::darkModeColorFor(COLOR_BG_CARD)));
460 gc->DrawRoundedRectangle(inset, inset, sz.x - 2 * inset, sz.y - 2 * inset, FromDIP(8));
461 } else {
462 const int fallback_inset = (border_width + 1) / 2;
463 dc.SetPen(wxPen(border_col, border_width));
464 dc.SetBrush(wxBrush(StateColor::darkModeColorFor(COLOR_BG_CARD)));
465 dc.DrawRoundedRectangle(fallback_inset, fallback_inset, sz.x - 2 * fallback_inset, sz.y - 2 * fallback_inset, FromDIP(8));
466 }
467 });
468
469 std::function<void(wxWindow*)> bind_click;
470 bind_click = [this, mode, chk, &bind_click](wxWindow* w) {
471 if (w == chk || dynamic_cast<::CheckBox*>(w))
472 return;
473 w->Bind(wxEVT_LEFT_UP, [this, mode](wxMouseEvent&) {
474 select_mode(mode);
475 });
476 w->SetCursor(wxCursor(wxCURSOR_HAND));
477 for (auto* child : w->GetChildren())
478 bind_click(child);
479 };
480 bind_click(card);
481
482 return card;
483}
class WXDLLIMPEXP_FWD_CORE wxStaticText
Definition ProgressDialog.hpp:30
static wxFont Body_14
Definition Label.hpp:53
CheckBox * m_chk_rybw
Definition ColorDecomposeDialog.hpp:138
CheckBox * m_chk_material_list
Definition ColorDecomposeDialog.hpp:136
CheckBox * m_chk_cmyw
Definition ColorDecomposeDialog.hpp:137
void select_mode(DecomposeMode mode)
Definition ColorDecomposeDialog.cpp:585
std::array< ModeCardControls, 3 > m_mode_cards
Definition ColorDecomposeDialog.hpp:109
wxMouseEvent
Definition CameraPopup.cpp:47
static const wxColour COLOR_BG_CARD("#F8F8F8")
static const wxColour COLOR_BRAND("#009688")
static const wxColour COLOR_BORDER_NORMAL("#EEEEEE")
static void match_parent_bg(wxWindow *w, const wxColour &bg)
Definition ColorDecomposeDialog.cpp:167
BoundingBox inset(BoundingBox box, const Point &by)
Definition IMEXArrange.cpp:38

References Label::Body_14, Slic3r::GUI::COLOR_BG_CARD(), Slic3r::GUI::COLOR_BORDER_NORMAL(), Slic3r::GUI::COLOR_BRAND(), Slic3r::GUI::create_h_divider(), StateColor::darkModeColorFor(), m_chk_cmyw, m_chk_material_list, m_chk_rybw, m_mode_cards, m_selected_mode, Slic3r::GUI::match_parent_bg(), Slic3r::GUI::mode_index(), select_mode(), Slic3r::GUI::wxMouseEvent, and wxStaticText.

Referenced by create_mode_selection_section().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_mode_selection_section()

wxBoxSizer * Slic3r::GUI::ColorDecomposeDialog::create_mode_selection_section ( )
private
486{
487 auto* sizer = new wxBoxSizer(wxVERTICAL);
488
489 auto* section_label = new wxStaticText(this, wxID_ANY, _L("Select Color Decomposition"));
490 section_label->SetFont(Label::Head_14);
491 section_label->SetForegroundColour(StateColor::darkModeColorFor(COLOR_TEXT_DARK));
492 sizer->Add(section_label, 0, wxBOTTOM, FromDIP(4));
493
494 auto* modes_sizer = new wxBoxSizer(wxHORIZONTAL);
495
496 // --- Arbitrary mode column (wrapped in a panel so the whole column hides together) ---
497 m_arb_column_panel = new wxPanel(this, wxID_ANY);
498 m_arb_column_panel->SetBackgroundColour(StateColor::darkModeColorFor(*wxWHITE));
499 auto* arb_col = new wxBoxSizer(wxVERTICAL);
500 {
501 auto* arb_header_sizer = new wxBoxSizer(wxHORIZONTAL);
502 arb_header_sizer->Add(create_mode_group_label(m_arb_column_panel, _L("Arbitrary Mode")),
503 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, FromDIP(5));
504 arb_header_sizer->Add(create_h_divider(m_arb_column_panel, FromDIP(88)), 0, wxALIGN_CENTER_VERTICAL);
505 arb_col->Add(arb_header_sizer, 0, wxEXPAND | wxBOTTOM, FromDIP(8));
506
507 m_card_material_list = create_mode_card(m_arb_column_panel, DecomposeMode::MaterialList,
508 _L("Material List"));
509 arb_col->Add(m_card_material_list, 0, wxEXPAND);
510 }
511 m_arb_column_panel->SetSizer(arb_col);
512 modes_sizer->Add(m_arb_column_panel, 0, wxEXPAND | wxRIGHT, FromDIP(16));
513
514 // --- Standard mode column ---
515 auto* std_col = new wxBoxSizer(wxVERTICAL);
516 {
517 auto* std_header_sizer = new wxBoxSizer(wxHORIZONTAL);
518 std_header_sizer->Add(create_mode_group_label(this, _L("Standard Mode")),
519 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, FromDIP(5));
520 std_header_sizer->Add(create_h_divider(this), 1, wxALIGN_CENTER_VERTICAL);
521 std_col->Add(std_header_sizer, 0, wxEXPAND | wxBOTTOM, FromDIP(8));
522
523 auto* cards_sizer = new wxBoxSizer(wxHORIZONTAL);
524
525 m_card_cmyw = create_mode_card(this, DecomposeMode::CMYW, "CMYW");
526 cards_sizer->Add(m_card_cmyw, 0, wxRIGHT, FromDIP(12));
527
528 m_card_rybw = create_mode_card(this, DecomposeMode::RYBW, "RYBW");
529 cards_sizer->Add(m_card_rybw, 0);
530
531 std_col->Add(cards_sizer, 0, wxEXPAND);
532 }
533 modes_sizer->Add(std_col, 0, wxEXPAND);
534
535 sizer->Add(modes_sizer, 0, wxEXPAND);
536
537 m_no_card_hint = new wxStaticText(this, wxID_ANY,
538 _L("At least two filaments of the same material type are required for decomposition"));
540 m_no_card_hint->SetForegroundColour(StateColor::darkModeColorFor(wxColour("#6B6A6A")));
541 m_no_card_hint->Wrap(FromDIP(400));
542 m_no_card_hint->Hide();
543 sizer->Add(m_no_card_hint, 0, wxTOP, FromDIP(8));
544
545 m_limit_warning_panel = new wxPanel(this, wxID_ANY);
546 m_limit_warning_panel->SetBackgroundColour(StateColor::darkModeColorFor(*wxWHITE));
547 auto* warning_sizer = new wxBoxSizer(wxHORIZONTAL);
548 auto* warn_bmp = new wxStaticBitmap(m_limit_warning_panel, wxID_ANY,
550 wxDefaultPosition, wxSize(FromDIP(16), FromDIP(16)));
551 m_limit_warning_text = new wxStaticText(m_limit_warning_panel, wxID_ANY, wxEmptyString);
553 m_limit_warning_text->SetForegroundColour(StateColor::darkModeColorFor(wxColour("#D01B1B")));
554 m_limit_warning_text->Wrap(FromDIP(400));
555 warning_sizer->Add(warn_bmp, 0, wxALIGN_TOP | wxRIGHT, FromDIP(6));
556 warning_sizer->Add(m_limit_warning_text, 1, wxEXPAND);
557 m_limit_warning_panel->SetSizer(warning_sizer);
558 m_limit_warning_panel->Hide();
559 sizer->Add(m_limit_warning_panel, 0, wxEXPAND | wxTOP, FromDIP(8));
560
561 return sizer;
562}
static wxFont Head_14
Definition Label.hpp:45
wxStaticText * m_limit_warning_text
Definition ColorDecomposeDialog.hpp:146
wxPanel * create_mode_card(wxWindow *parent, DecomposeMode mode, const wxString &title)
Definition ColorDecomposeDialog.cpp:398
wxPanel * m_arb_column_panel
Definition ColorDecomposeDialog.hpp:135
wxPanel * m_card_material_list
Definition ColorDecomposeDialog.hpp:132
wxStaticText * m_no_card_hint
Definition ColorDecomposeDialog.hpp:142
wxPanel * m_card_rybw
Definition ColorDecomposeDialog.hpp:134
wxPanel * m_limit_warning_panel
Definition ColorDecomposeDialog.hpp:145
wxPanel * m_card_cmyw
Definition ColorDecomposeDialog.hpp:133
static wxStaticText * create_mode_group_label(wxWindow *parent, const wxString &text)
Definition ColorDecomposeDialog.cpp:159
static const wxColour COLOR_TEXT_DARK("#262E30")
wxBitmap create_scaled_bitmap(const std::string &bmp_name_in, wxWindow *win, const int px_cnt, const bool grayscale, const std::string &new_color, const bool menu_bitmap, const bool resize, const bool bitmap2, const std::vector< std::string > &array_new_color)
Definition wxExtensions.cpp:448

References _L, Label::Body_13, Slic3r::GUI::COLOR_TEXT_DARK(), Slic3r::GUI::create_h_divider(), create_mode_card(), Slic3r::GUI::create_mode_group_label(), create_scaled_bitmap(), StateColor::darkModeColorFor(), Label::Head_14, m_arb_column_panel, m_card_cmyw, m_card_material_list, m_card_rybw, m_limit_warning_panel, m_limit_warning_text, m_no_card_hint, and wxStaticText.

Referenced by build_ui().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_target_color_section()

wxBoxSizer * Slic3r::GUI::ColorDecomposeDialog::create_target_color_section ( )
private
365{
366 auto* sizer = new wxBoxSizer(wxHORIZONTAL);
367
368 auto* label = new wxStaticText(this, wxID_ANY, _L("Target Color"));
369 label->SetFont(Label::Head_14);
370 label->SetForegroundColour(StateColor::darkModeColorFor(COLOR_TEXT_DARK));
371 sizer->Add(label, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, FromDIP(19));
372
374 sizer->Add(m_target_swatch, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, FromDIP(12));
375
376 m_target_rgb_text = new wxStaticText(this, wxID_ANY,
377 wxString::Format("RGB: %d, %d, %d", m_target_color.Red(), m_target_color.Green(), m_target_color.Blue()));
380 sizer->Add(m_target_rgb_text, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, FromDIP(12));
381
382 auto* arrow_text = new wxStaticText(this, wxID_ANY, wxString::FromUTF8("\xe2\x86\x92"));
383 arrow_text->SetForegroundColour(StateColor::darkModeColorFor(COLOR_TEXT_DARK));
384 sizer->Add(arrow_text, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, FromDIP(12));
385
387 sizer->Add(m_matched_swatch, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, FromDIP(12));
388
389 m_matched_rgb_text = new wxStaticText(this, wxID_ANY,
390 wxString::Format("RGB: %d, %d, %d", m_target_color.Red(), m_target_color.Green(), m_target_color.Blue()));
393 sizer->Add(m_matched_rgb_text, 0, wxALIGN_CENTER_VERTICAL);
394
395 return sizer;
396}
static wxFont Head_13
Definition Label.hpp:46
wxStaticText * m_matched_rgb_text
Definition ColorDecomposeDialog.hpp:129
wxStaticText * m_target_rgb_text
Definition ColorDecomposeDialog.hpp:127
wxPanel * m_matched_swatch
Definition ColorDecomposeDialog.hpp:128
static wxPanel * create_color_swatch(wxWindow *parent, const wxColour &color, int size)
Definition ColorDecomposeDialog.cpp:336

References _L, Label::Body_13, Slic3r::GUI::COLOR_TEXT_DARK(), Slic3r::GUI::create_color_swatch(), StateColor::darkModeColorFor(), Label::Head_13, Label::Head_14, m_matched_rgb_text, m_matched_swatch, m_target_color, m_target_rgb_text, m_target_swatch, and wxStaticText.

Referenced by build_ui().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ em_unit()

int Slic3r::GUI::DPIAware< wxDialog >::em_unit ( ) const
inlineinherited
203{ return m_em_unit; }
Definition GUI_Utils.hpp:107

Referenced by Slic3r::GUI::AuxiliaryDialog::AuxiliaryDialog(), Slic3r::GUI::CopyrightsDialog::CopyrightsDialog(), Slic3r::GUI::DesignTextDialog::DesignTextDialog(), Slic3r::GUI::EditGCodeDialog::EditGCodeDialog(), Slic3r::GUI::FileArchiveDialog::FileArchiveDialog(), Slic3r::GUI::MsgNoUpdates::MsgNoUpdates(), Slic3r::GUI::MsgUpdateForced::MsgUpdateForced(), Slic3r::GUI::OAuthDialog::OAuthDialog(), Slic3r::GUI::ParamsDialog::ParamsDialog(), Slic3r::GUI::PhysicalPrinterDialog::PhysicalPrinterDialog(), Slic3r::GUI::SettingsDialog::SettingsDialog(), anonymous_namespace{3DPrinterOS.cpp}::TokenAuthDialog::TokenAuthDialog(), anonymous_namespace{3DPrinterOS.cpp}::UploadOptionsDialog::UploadOptionsDialog(), Slic3r::GUI::PublishSettingsDialog::add_row_ui(), Slic3r::GUI::DiffPresetDialog::complete_dialog_creation(), Slic3r::GUI::DiffPresetDialog::create_edit_sizer(), Slic3r::GUI::DiffPresetDialog::create_presets_sizer(), Slic3r::GUI::DiffPresetDialog::create_tree(), Slic3r::GUI::ElegooPrintHostSendDialog::init(), Slic3r::GUI::FlashforgePrintHostSendDialog::init(), Slic3r::GUI::PrintHostSendDialog::init(), Slic3r::GUI::AboutDialog::on_dpi_changed(), Slic3r::GUI::AuxiliaryDialog::on_dpi_changed(), Slic3r::GUI::BedShapeDialog::on_dpi_changed(), Slic3r::GUI::ConfigWizard::on_dpi_changed(), Slic3r::GUI::CopyrightsDialog::on_dpi_changed(), Slic3r::GUI::DiffPresetDialog::on_dpi_changed(), Slic3r::GUI::EditGCodeDialog::on_dpi_changed(), Slic3r::GUI::FileArchiveDialog::on_dpi_changed(), Slic3r::GUI::OAuthDialog::on_dpi_changed(), Slic3r::GUI::ObjectTableDialog::on_dpi_changed(), Slic3r::GUI::ParamsDialog::on_dpi_changed(), Slic3r::GUI::PhysicalPrinterDialog::on_dpi_changed(), Slic3r::GUI::PrintHostQueueDialog::on_dpi_changed(), Slic3r::GUI::PurgeModeDialog::on_dpi_changed(), Slic3r::GUI::SavePresetDialog::on_dpi_changed(), Slic3r::GUI::SendSystemInfoDialog::on_dpi_changed(), Slic3r::GUI::SettingsDialog::on_dpi_changed(), and Slic3r::GUI::UnsavedChangesDialog::on_dpi_changed().

Here is the caller graph for this function:

◆ enable_force_rescale()

void Slic3r::GUI::DPIAware< wxDialog >::enable_force_rescale ( )
inlineinherited
206{ m_force_rescale = true; }

◆ EndModal()

void Slic3r::GUI::DPIDialog::EndModal ( int retCode)
inlineoverrideinherited
306 {
307 if (!dialogStack.empty() && dialogStack.front() != this) {
308 // This is a bug in wxWidgets
309 // when the dialog is not top modal dialog, EndModal() just hide dialog without quit
310 // the modal event loop. And the modal event loop blocks us from bottom widgets.
311 // Solution: let user click it manually or close outside. FIXME
312 BOOST_LOG_TRIVIAL(warning) << "DPIAware::EndModal Error: dialogStack is not empty, but top dialog is not this one. retCode=" << retCode;
313 return;
314 }
315
316 return wxDialog::EndModal(retCode);
317 }
std::deque< wxDialog * > dialogStack
Definition GUI_Utils.cpp:549

References Slic3r::GUI::dialogStack.

Referenced by Slic3r::GUI::CloneDialog::CloneDialog(), Slic3r::GUI::ConfigWizard::ConfigWizard(), Slic3r::GUI::CreatePresetSuccessfulDialog::CreatePresetSuccessfulDialog(), Slic3r::GUI::DeleteConfirmDialog::DeleteConfirmDialog(), Slic3r::GUI::DesignVariableDialog::DesignVariableDialog(), Slic3r::GUI::anonymous_namespace{PrintHostDialogs.cpp}::FlashforgeSlotDialog::FlashforgeSlotDialog(), Slic3r::GUI::GuideFrame::GuideFrame(), Slic3r::GUI::InputIpAddressDialog::InputIpAddressDialog(), Slic3r::GUI::ManualNozzleCountDialog::ManualNozzleCountDialog(), Slic3r::GUI::MsgUpdateConfig::MsgUpdateConfig(), Slic3r::GUI::MsgUpdateForced::MsgUpdateForced(), Slic3r::GUI::MultiChoiceDialog::MultiChoiceDialog(), Slic3r::GUI::NetworkErrorDialog::NetworkErrorDialog(), Slic3r::GUI::NetworkPluginRestartDialog::NetworkPluginRestartDialog(), Slic3r::GUI::PartSkipConfirmDialog::PartSkipConfirmDialog(), Slic3r::GUI::PhysicalPrinterDialog::PhysicalPrinterDialog(), Slic3r::GUI::PlateNameEditDialog::PlateNameEditDialog(), Slic3r::GUI::PlateSettingsDialog::PlateSettingsDialog(), Slic3r::GUI::PublishSettingsDialog::PublishSettingsDialog(), Slic3r::GUI::SelectMachineDialog::SelectMachineDialog(), Slic3r::GUI::SendFailedConfirm::SendFailedConfirm(), Slic3r::GUI::SendSystemInfoDialog::SendSystemInfoDialog(), Slic3r::GUI::ShortcutCaptureDialog::ShortcutCaptureDialog(), Slic3r::GUI::SingleChoiceDialog::SingleChoiceDialog(), StepMeshDialog::StepMeshDialog(), Slic3r::GUI::SyncAmsInfoDialog::SyncAmsInfoDialog(), anonymous_namespace{3DPrinterOS.cpp}::TokenAuthDialog::TokenAuthDialog(), Slic3r::GUI::UpdatePluginDialog::UpdatePluginDialog(), Slic3r::GUI::UpdateVersionDialog::UpdateVersionDialog(), Slic3r::GUI::wgtDeviceNozzleRackUpgradeDlg::wgtDeviceNozzleRackUpgradeDlg(), Slic3r::GUI::SavePresetDialog::accept(), Slic3r::GUI::MsgDialog::add_button(), Slic3r::GUI::TipsDialog::add_button(), Slic3r::GUI::FilamentPickerDialog::BindEvents(), Slic3r::GUI::PluginPickerDialog::build_capability_ui(), Slic3r::GUI::BedShapeDialog::build_dialog(), Slic3r::GUI::PluginPickerDialog::build_ui(), Slic3r::GUI::UnsavedChangesDialog::close(), Slic3r::GUI::FileArchiveDialog::create_btn_sizer(), Slic3r::GUI::ColorDecomposeDialog::create_button_panel(), Slic3r::GUI::MixedFilamentDialog::create_button_panel(), Slic3r::GUI::CreateFilamentPresetDialog::create_dialog_buttons(), Slic3r::GUI::CreatePresetForPrinterDialog::create_dialog_buttons(), Slic3r::GUI::EditFilamentPresetDialog::create_dialog_buttons(), Slic3r::GUI::ExportConfigsDialog::create_dialog_buttons(), Slic3r::GUI::PreferencesDialog::create_item_language_combobox(), Slic3r::GUI::PreferencesDialog::create_item_region_combobox(), Slic3r::GUI::PreferencesDialog::create_items(), Slic3r::GUI::CreatePrinterPresetDialog::create_page1_dialog_buttons(), Slic3r::GUI::CreatePrinterPresetDialog::create_page2_dialog_buttons(), Slic3r::GUI::ExportConfigsDialog::data_init(), Slic3r::GUI::WebDialog::destroy_silently(), Slic3r::GUI::EditFilamentPresetDialog::edit_preset(), Slic3r::GUI::ConnectPrinterDialog::end_modal(), Slic3r::GUI::PrintHostSendDialog::EndModal(), Slic3r::GUI::ColorPickerDialog::finish(), Slic3r::GUI::WebDialog::finish(), Slic3r::GUI::Newer3mfVersionDialog::get_btn_sizer(), Slic3r::GUI::ScoreDialog::get_button_sizer(), Slic3r::GUI::WebViewHostDialog::handle_common_script_command(), Slic3r::GUI::ExportPresetBundleDialog::InitExportData(), Slic3r::GUI::SelectMachineDialog::navigate_to_timelapse_page(), Slic3r::GUI::BindMachineDialog::on_bind_success(), Slic3r::GUI::ConnectPrinterDialog::on_button_confirm(), Slic3r::GUI::RecenterDialog::on_button_confirm(), Slic3r::GUI::BindMachineDialog::on_cancel(), Slic3r::GUI::EditCalibrationHistoryDialog::on_cancel(), Slic3r::GUI::InputIpAddressDialog::on_cancel(), Slic3r::GUI::NewCalibrationHistoryDialog::on_cancel(), Slic3r::GUI::OAuthDialog::on_cancel(), Slic3r::GUI::PingCodeBindDialog::on_cancel(), Slic3r::GUI::SelectMachineDialog::on_cancel(), Slic3r::GUI::SendToPrinterDialog::on_cancel(), Slic3r::GUI::SyncAmsInfoDialog::on_cancel(), Slic3r::GUI::UnBindMachineDialog::on_cancel(), Slic3r::GUI::WebDialog::on_close_window(), Slic3r::GUI::NetworkPluginDownloadDialog::on_dont_ask(), Slic3r::GUI::NetworkPluginDownloadDialog::on_download(), Slic3r::GUI::EditDevNameDialog::on_edit_name(), Slic3r::GUI::ConfirmBeforeSendDialog::on_hide(), Slic3r::GUI::PrivacyUpdateDialog::on_hide(), Slic3r::GUI::ShortcutCaptureDialog::on_key(), Slic3r::GUI::TextureImportDialog::on_ok_clicked(), Slic3r::GUI::FileArchiveDialog::on_open_button(), Slic3r::GUI::NetworkPluginDownloadDialog::on_remind_later(), Slic3r::GUI::ProjectDropDialog::on_select_cancel(), Slic3r::GUI::SavePresetDialog::on_select_cancel(), Slic3r::GUI::ProjectDropDialog::on_select_ok(), Slic3r::GUI::SendMultiMachinePage::on_send(), Slic3r::GUI::NetworkPluginDownloadDialog::on_skip(), Slic3r::GUI::TextureImportDialog::on_skip_clicked(), Slic3r::GUI::NetworkPluginDownloadDialog::on_skip_version(), Slic3r::GUI::Cornering_Test_Dlg::on_start(), Slic3r::GUI::FlowRateCalibrationDialog::on_start(), Slic3r::GUI::Input_Shaping_Damp_Test_Dlg::on_start(), Slic3r::GUI::Input_Shaping_Freq_Test_Dlg::on_start(), Slic3r::GUI::MaxVolumetricSpeed_Test_Dlg::on_start(), Slic3r::GUI::PA_Calibration_Dlg::on_start(), Slic3r::GUI::Retraction_Test_Dlg::on_start(), Slic3r::GUI::Temp_Calibration_Dlg::on_start(), Slic3r::GUI::VFA_Test_Dlg::on_start(), Slic3r::GUI::CalibrationDialog::on_start_calibration(), Slic3r::GUI::UnBindMachineDialog::on_unbind_printer(), Slic3r::GUI::PartSkipDialog::OnApplyDialog(), anonymous_namespace{3DPrinterOS.cpp}::TokenAuthDialog::OnCancel(), Slic3r::GUI::AboutDialog::onCloseDialog(), Slic3r::GUI::CopyrightsDialog::onCloseDialog(), Slic3r::GUI::MultiNozzleSyncDialog::OnRackStatusReadingFinished(), Slic3r::GUI::GuideFrame::OnScriptMessage(), Slic3r::GUI::InputIpAddressDialog::OnTimer(), Slic3r::GUI::KBShortcutsDialog::open_mouse_preferences(), Slic3r::GUI::TroubleshootDialog::PackAll(), Slic3r::GUI::TroubleshootDialog::RebuildSystemProfiles(), Slic3r::GUI::SpeedDialWebDialog::run_action(), Slic3r::GUI::OAuthDialog::Show(), Slic3r::GUI::MultiNozzleSyncDialog::UpdateButton(), and Slic3r::GUI::CreatePrinterPresetDialog::validate_input_valid().

◆ force_rescale()

bool Slic3r::GUI::DPIAware< wxDialog >::force_rescale ( ) const
inlineinherited
201{ return m_force_rescale; }

◆ get_result()

ColorDecomposeResult Slic3r::GUI::ColorDecomposeDialog::get_result ( ) const
inline
66{ return m_result; }

References m_result.

Referenced by Slic3r::GUI::TextureImportDialog::add_decomposed_mixed_filament(), and Slic3r::GUI::Sidebar::decompose_filament_color().

Here is the caller graph for this function:

◆ is_new_scale_factor()

bool Slic3r::GUI::DPIAware< wxDialog >::is_new_scale_factor ( ) const
inlineprivateinherited
262{ return fabs(m_scale_factor - m_prev_scale_factor) > 0.001; }

◆ normal_font()

◆ on_dpi_changed()

void Slic3r::GUI::ColorDecomposeDialog::on_dpi_changed ( const wxRect & suggested_rect)
overrideprotectedvirtual

Implements Slic3r::GUI::DPIAware< wxDialog >.

226{
227 (void)suggested_rect;
228 Fit();
229 Refresh();
230}

◆ on_sys_color_changed()

◆ prev_scale_factor()

float Slic3r::GUI::DPIAware< wxDialog >::prev_scale_factor ( ) const
inlineinherited
196{ return m_prev_scale_factor; }

◆ rescale()

void Slic3r::GUI::DPIAware< wxDialog >::rescale ( const wxRect & suggested_rect)
inlineprivateinherited
265 {
266 this->Freeze();
267
268 m_force_rescale = false;
269
270 // set normal application font as a current window font
271 m_normal_font = this->GetFont();
272
274
275 // rescale missed controls sizes and images
277
278 this->Layout();
279 this->Thaw();
280
281 // reset previous scale factor from current scale factor value
283 }
virtual void on_dpi_changed(const wxRect &suggested_rect)=0
void update_em_unit()
Definition GUI_Utils.hpp:249

◆ scale_factor()

float Slic3r::GUI::DPIAware< wxDialog >::scale_factor ( ) const
inlineinherited
195{ return m_scale_factor; }

◆ select_mode()

void Slic3r::GUI::ColorDecomposeDialog::select_mode ( DecomposeMode mode)
private
586{
587 m_selected_mode = mode;
592}
void update_card_styles()
Definition ColorDecomposeDialog.cpp:594

References m_mode_results, m_result, m_selected_mode, Slic3r::GUI::mode_index(), update_card_styles(), update_matched_color_display(), and update_ok_button_state().

Referenced by create_mode_card(), update_card_visibility(), and update_mode_card_content().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_em_unit()

void Slic3r::GUI::DPIAware< wxDialog >::set_em_unit ( int v)
inlineinherited
200{ m_em_unit = v; }

◆ set_missing_physical_calculator()

void Slic3r::GUI::ColorDecomposeDialog::set_missing_physical_calculator ( std::function< size_t(const ColorDecomposeResult &)> fn)
712{
713 m_missing_calculator = std::move(fn);
715}
std::function< size_t(const ColorDecomposeResult &)> m_missing_calculator
Definition ColorDecomposeDialog.hpp:122

References m_missing_calculator, and update_ok_button_state().

Referenced by Slic3r::GUI::TextureImportDialog::add_decomposed_mixed_filament().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_prev_scale_factor()

void Slic3r::GUI::DPIAware< wxDialog >::set_prev_scale_factor ( float v)
inlineinherited

◆ set_scale_factor()

void Slic3r::GUI::DPIAware< wxDialog >::set_scale_factor ( float v)
inlineinherited
198{ m_scale_factor = v; }

◆ ShowModal()

◆ try_build_single_base_result()

bool Slic3r::GUI::ColorDecomposeDialog::try_build_single_base_result ( DecomposeMode mode,
ColorDecomposeResult & out ) const
private
824{
825 // Gate by preferred type, matching card visibility: CMYW and RYBW only for PLA Basic.
826 if (mode == DecomposeMode::CMYW || mode == DecomposeMode::RYBW) {
828 return false;
829 } else {
830 return false;
831 }
832
833 static const DecomposeBaseColor cmyw_bases[] = {
836 };
837 static const DecomposeBaseColor rybw_bases[] = {
840 };
841 const DecomposeBaseColor* bases = (mode == DecomposeMode::CMYW) ? cmyw_bases : rybw_bases;
842 const size_t base_count = (mode == DecomposeMode::CMYW)
843 ? sizeof(cmyw_bases) / sizeof(cmyw_bases[0])
844 : sizeof(rybw_bases) / sizeof(rybw_bases[0]);
845
846 const std::string target_hex = decompose_normalize_color_hex(
847 m_target_color.GetAsString(wxC2S_HTML_SYNTAX).ToStdString());
848
849 for (size_t i = 0; i < base_count; ++i) {
850 const DecomposeBaseColor base = bases[i];
851 DecomposeOfficialComponent official =
853 if (decompose_normalize_color_hex(official.color_hex) != target_hex)
854 continue;
855
856 out = ColorDecomposeResult{};
857 out.mode = mode;
858 out.matched_color = hex_to_wx_colour(official.color_hex, m_target_color);
859 DecomposeComponent comp;
860 comp.colour = out.matched_color;
861 comp.ratio = 100;
862 comp.filament_index = -1;
863 comp.base_color = base;
864 out.components.push_back(comp);
865 return true;
866 }
867 return false;
868}
static wxColour pure_color_for_base(DecomposeBaseColor base)
Definition ColorDecomposeDialog.cpp:99
DecomposeBaseColor
Definition ColorDecomposeDialog.hpp:29
@ White
Definition ColorDecomposeDialog.hpp:34
@ Magenta
Definition ColorDecomposeDialog.hpp:32
@ Red
Definition ColorDecomposeDialog.hpp:35
std::string decompose_normalize_color_hex(std::string color)
Definition ColorDecomposeSupport.cpp:34
static wxColour hex_to_wx_colour(const std::string &hex, const wxColour &fallback)
Definition ColorDecomposeDialog.cpp:76
DecomposeOfficialComponent lookup_decompose_official_component(const std::string &basic_type, DecomposeBaseColor base_color, const wxColour &fallback)
Definition ColorDecomposeSupport.cpp:140

References Slic3r::GUI::DecomposeComponent::base_color, Slic3r::GUI::Blue, Slic3r::GUI::DecomposeOfficialComponent::color_hex, Slic3r::GUI::DecomposeComponent::colour, Slic3r::GUI::ColorDecomposeResult::components, Slic3r::GUI::Cyan, Slic3r::GUI::decompose_normalize_color_hex(), Slic3r::GUI::DecomposeComponent::filament_index, Slic3r::GUI::hex_to_wx_colour(), Slic3r::GUI::kDecomposePlaBasicType, Slic3r::GUI::lookup_decompose_official_component(), m_preferred_type, m_target_color, Slic3r::GUI::Magenta, Slic3r::GUI::ColorDecomposeResult::matched_color, Slic3r::GUI::ColorDecomposeResult::mode, Slic3r::GUI::pure_color_for_base(), Slic3r::GUI::DecomposeComponent::ratio, Slic3r::GUI::Red, Slic3r::GUI::White, and Slic3r::GUI::Yellow.

Referenced by compute_decomposition().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_card_styles()

void Slic3r::GUI::ColorDecomposeDialog::update_card_styles ( )
private
595{
597 if (m_card_cmyw) m_card_cmyw->Refresh();
598 if (m_card_rybw) m_card_rybw->Refresh();
599
601 m_chk_material_list->SetValue(m_selected_mode == DecomposeMode::MaterialList);
602 if (m_chk_cmyw)
603 m_chk_cmyw->SetValue(m_selected_mode == DecomposeMode::CMYW);
604 if (m_chk_rybw)
605 m_chk_rybw->SetValue(m_selected_mode == DecomposeMode::RYBW);
606}

References m_card_cmyw, m_card_material_list, m_card_rybw, m_chk_cmyw, m_chk_material_list, m_chk_rybw, and m_selected_mode.

Referenced by select_mode().

Here is the caller graph for this function:

◆ update_card_visibility()

void Slic3r::GUI::ColorDecomposeDialog::update_card_visibility ( )
private
609{
610 // Count physical filaments of the same type (excluding the source filament)
611 int same_type_count = 0;
612 for (size_t i = 0; i < m_filament_types.size(); ++i) {
613 if (static_cast<int>(i) == m_filament_idx)
614 continue;
616 ++same_type_count;
617 }
618
619 bool show_arb = (same_type_count >= 2);
620 bool show_cmyw = (m_preferred_type == kDecomposePlaBasicType);
621 bool show_rybw = (m_preferred_type == kDecomposePlaBasicType);
622
623 if (m_arb_column_panel) m_arb_column_panel->Show(show_arb);
624 if (m_card_material_list) m_card_material_list->Show(show_arb);
625 if (m_card_cmyw) m_card_cmyw->Show(show_cmyw);
626 if (m_card_rybw) m_card_rybw->Show(show_rybw);
627
628 bool any_visible = show_arb || show_cmyw || show_rybw;
629 if (m_no_card_hint)
630 m_no_card_hint->Show(!any_visible);
631
632 // Auto-select a visible mode when current selection becomes hidden
633 if (any_visible) {
634 bool cur_visible = false;
635 if (m_selected_mode == DecomposeMode::MaterialList && show_arb) cur_visible = true;
636 if (m_selected_mode == DecomposeMode::CMYW && show_cmyw) cur_visible = true;
637 if (m_selected_mode == DecomposeMode::RYBW && show_rybw) cur_visible = true;
638 if (!cur_visible) {
639 if (show_arb) select_mode(DecomposeMode::MaterialList);
640 else if (show_cmyw) select_mode(DecomposeMode::CMYW);
641 else select_mode(DecomposeMode::RYBW);
642 }
643 }
644
645 Layout();
647}
static bool material_type_matches(const std::string &a, const std::string &b)
Definition ColorDecomposeDialog.cpp:172

References Slic3r::GUI::kDecomposePlaBasicType, m_arb_column_panel, m_card_cmyw, m_card_material_list, m_card_rybw, m_filament_idx, m_filament_types, m_no_card_hint, m_preferred_type, m_selected_mode, Slic3r::GUI::material_type_matches(), select_mode(), and update_ok_button_state().

Referenced by ColorDecomposeDialog(), and create_filament_selector().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_em_unit()

void Slic3r::GUI::DPIAware< wxDialog >::update_em_unit ( )
inlineprivateinherited
250 {
251 // Linux specific issue : get_dpi_for_window(this) still doesn't responce to the Display's scale in new wxWidgets(3.1.3).
252 // So, calculate the m_em_unit value from the font size, as before
253#if !defined(__WXGTK__)
255#else
256 // initialize default width_unit according to the width of the one symbol ("m") of the currently active font of this window.
257 m_em_unit = std::max<size_t>(10, this->GetTextExtent("m").x - 1);
258#endif // __WXGTK__
259 }

◆ update_filament_limit_warning()

void Slic3r::GUI::ColorDecomposeDialog::update_filament_limit_warning ( )
private
650{
652 return;
653
654 size_t missing_new = 0;
656 missing_new = m_missing_calculator(m_result);
657 } else {
658 const size_t source_physical_idx = m_filament_idx >= 0 ? static_cast<size_t>(m_filament_idx) : size_t(-1);
659 const std::vector<size_t>* indices =
662 m_result, m_physical_colors, m_filament_types, source_physical_idx, indices);
663 }
664 // A result with fewer than 2 components (e.g. target color is already a
665 // standard base color shown as "100%") creates no mixed filament and no new
666 // physical filament, so it can never exceed the limit.
667 const bool creates_mixed = m_result.components.size() >= 2;
668 // +1 for the mixed filament slot that will be created after decomposition.
669 const size_t needed = m_current_filament_count + missing_new + 1;
670 const bool blocked = creates_mixed && needed > m_max_filament_count;
671
672 const bool was_shown = m_limit_warning_panel->IsShown();
673
674 if (!blocked) {
675 if (was_shown) {
676 m_limit_warning_panel->Hide();
677 Layout();
678 Fit();
679 }
680 return;
681 }
682
683 const unsigned int max_count = static_cast<unsigned int>(m_max_filament_count);
684 const wxString warning_text = m_selected_mode == DecomposeMode::MaterialList ?
685 format_wxstr(_L_PLURAL("The material list supports at most %1% color. After Material List decomposition, the material count would exceed %1%. Please delete unused filaments on the main screen before decomposing.",
686 "The material list supports at most %1% colors. After Material List decomposition, the material count would exceed %1%. Please delete unused filaments on the main screen before decomposing.",
687 max_count), max_count) :
688 // TRN %2% is the decomposition mode name, "CMYW" or "RYBW"
689 format_wxstr(_L_PLURAL("The material list supports at most %1% color. After %2% decomposition, the material count would exceed %1%. Please delete unused filaments on the main screen before decomposing.",
690 "The material list supports at most %1% colors. After %2% decomposition, the material count would exceed %1%. Please delete unused filaments on the main screen before decomposing.",
691 max_count), max_count, m_selected_mode == DecomposeMode::CMYW ? "CMYW" : "RYBW");
692
693 // Show first so the panel is laid out and the text control gets its real
694 // width, then wrap to that width so the paragraph fills the content area.
695 m_limit_warning_panel->Show();
696 Layout();
697 const int avail = m_limit_warning_text->GetClientSize().x;
699 if (avail > FromDIP(50))
700 m_limit_warning_text->Wrap(avail);
701
702 Layout();
703 // Only resize when the warning panel actually toggled from hidden to shown.
704 // While already visible, switching modes must not re-Fit the dialog, which
705 // would make it jump on every card switch. Fit keeps the user-moved position.
706 if (!was_shown) {
707 Fit();
708 }
709}
wxString format_wxstr(const char *fmt, TArgs &&... args)
Definition format.hpp:22
static const std::string warning_text
Definition GLGizmoMeshBoolean.cpp:44
size_t count_decompose_new_physical_filaments(const ColorDecomposeResult &result, const std::vector< std::string > &physical_colors, const std::vector< std::string > &physical_types, size_t source_physical_idx, const std::vector< size_t > *physical_config_indices)
Definition ColorDecomposeSupport.cpp:355
#define _L_PLURAL(s, plural, n)
Definition I18N.hpp:96

References _L_PLURAL, Slic3r::GUI::count_decompose_new_physical_filaments(), Slic3r::GUI::format_wxstr(), m_current_filament_count, m_filament_idx, m_filament_types, m_limit_warning_panel, m_limit_warning_text, m_max_filament_count, m_missing_calculator, m_physical_colors, m_physical_config_indices, m_result, m_selected_mode, and Slic3r::GUI::warning_text.

Referenced by update_ok_button_state().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_matched_color_display()

void Slic3r::GUI::ColorDecomposeDialog::update_matched_color_display ( )
private
809{
810 if (!m_result.matched_color.IsOk())
811 m_result.matched_color = m_target_color;
812
813 if (m_matched_swatch) {
814 m_matched_swatch->SetBackgroundColour(m_result.matched_color);
815 m_matched_swatch->Refresh();
816 }
817 if (m_matched_rgb_text) {
818 m_matched_rgb_text->SetLabel(wxString::Format("RGB: %d, %d, %d",
819 m_result.matched_color.Red(), m_result.matched_color.Green(), m_result.matched_color.Blue()));
820 }
821}

References m_matched_rgb_text, m_matched_swatch, m_result, and m_target_color.

Referenced by ColorDecomposeDialog(), create_filament_selector(), and select_mode().

Here is the caller graph for this function:

◆ update_mode_card_content()

void Slic3r::GUI::ColorDecomposeDialog::update_mode_card_content ( DecomposeMode mode)
private
730{
731 auto& controls = m_mode_cards[mode_index(mode)];
732 auto* sizer = controls.components_sizer;
733 auto* card = controls.card;
734 if (!sizer || !card)
735 return;
736
737 sizer->Clear(true);
738 const auto& components = m_mode_results[mode_index(mode)].components;
739 const size_t count = components.size();
740 if (count == 0) {
741 card->Layout();
742 card->Refresh();
743 return;
744 }
745
746 const int swatch_sz = FromDIP(24);
747 const int plus_gap = FromDIP(24);
748 const wxFont& ratio_font = Label::Body_13;
749 auto bind_select = [this, mode](wxWindow* w) {
750 w->Bind(wxEVT_LEFT_UP, [this, mode](wxMouseEvent&) {
751 select_mode(mode);
752 });
753 w->SetCursor(wxCursor(wxCURSOR_HAND));
754 };
755
756 for (size_t i = 0; i < count; ++i) {
757 auto* col = new wxBoxSizer(wxVERTICAL);
758 auto* swatch = create_color_swatch(card, components[i].colour, swatch_sz);
759 bind_select(swatch);
760 col->Add(swatch, 0, wxALIGN_CENTER_HORIZONTAL);
761 auto* ratio_text = new wxStaticText(card, wxID_ANY, wxString::Format("%d%%", components[i].ratio));
762 ratio_text->SetFont(ratio_font);
763 ratio_text->SetForegroundColour(StateColor::darkModeColorFor(COLOR_TEXT_DARK));
765 bind_select(ratio_text);
766 col->Add(ratio_text, 0, wxALIGN_CENTER_HORIZONTAL | wxTOP, FromDIP(4));
767 sizer->Add(col, 0, wxALIGN_TOP);
768
769 if (i + 1 < count) {
770 sizer->AddStretchSpacer();
771 auto* plus_panel = new wxPanel(card, wxID_ANY, wxDefaultPosition, wxSize(plus_gap, swatch_sz));
772 plus_panel->SetMinSize(wxSize(plus_gap, swatch_sz));
773 plus_panel->SetMaxSize(wxSize(plus_gap, swatch_sz));
774 plus_panel->SetBackgroundColour(StateColor::darkModeColorFor(COLOR_BG_CARD));
775 auto* plus_sizer = new wxBoxSizer(wxVERTICAL);
776 auto* plus_label = new wxStaticText(plus_panel, wxID_ANY, "+");
777 plus_label->SetFont(Label::Body_13);
778 plus_label->SetForegroundColour(StateColor::darkModeColorFor(COLOR_TEXT_DARK));
780 bind_select(plus_panel);
781 bind_select(plus_label);
782 plus_sizer->AddStretchSpacer();
783 plus_sizer->Add(plus_label, 0, wxALIGN_CENTER_HORIZONTAL);
784 plus_sizer->AddStretchSpacer();
785 plus_panel->SetSizer(plus_sizer);
786 sizer->Add(plus_panel, 0, wxALIGN_TOP);
787 sizer->AddStretchSpacer();
788 }
789 }
790
791 const int card_width = FromDIP(128 + (count > 2 ? static_cast<int>(count - 2) * 31 : 0));
792 card->SetMinSize(wxSize(card_width, FromDIP(111)));
793 card->SetMaxSize(wxSize(card_width, FromDIP(111)));
794
795 card->Layout();
796 card->Refresh();
797}
static unsigned int count
Definition AuxiliaryDataViewModel.cpp:246

References Label::Body_13, Slic3r::GUI::COLOR_BG_CARD(), Slic3r::GUI::COLOR_TEXT_DARK(), count, Slic3r::GUI::create_color_swatch(), StateColor::darkModeColorFor(), m_mode_cards, m_mode_results, Slic3r::GUI::match_parent_bg(), Slic3r::GUI::mode_index(), select_mode(), Slic3r::GUI::wxMouseEvent, and wxStaticText.

Referenced by update_mode_card_contents().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_mode_card_contents()

void Slic3r::GUI::ColorDecomposeDialog::update_mode_card_contents ( )
private
800{
801 update_mode_card_content(DecomposeMode::MaterialList);
802 update_mode_card_content(DecomposeMode::CMYW);
803 update_mode_card_content(DecomposeMode::RYBW);
804 Layout();
805 Fit();
806}
void update_mode_card_content(DecomposeMode mode)
Definition ColorDecomposeDialog.cpp:729

References update_mode_card_content().

Referenced by compute_decomposition().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_ok_button_state()

void Slic3r::GUI::ColorDecomposeDialog::update_ok_button_state ( )
private
718{
719 if (!m_btn_ok) return;
721 bool any_card_visible = (m_card_material_list && m_card_material_list->IsShown())
722 || (m_card_cmyw && m_card_cmyw->IsShown())
723 || (m_card_rybw && m_card_rybw->IsShown());
724 const bool blocked = m_limit_warning_panel && m_limit_warning_panel->IsShown();
725 m_btn_ok->Enable(any_card_visible && !blocked);
726 Layout();
727}
void update_filament_limit_warning()
Definition ColorDecomposeDialog.cpp:649

References m_btn_ok, m_card_cmyw, m_card_material_list, m_card_rybw, m_limit_warning_panel, and update_filament_limit_warning().

Referenced by ColorDecomposeDialog(), compute_decomposition(), create_filament_selector(), select_mode(), set_missing_physical_calculator(), and update_card_visibility().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ m_arb_column_panel

wxPanel* Slic3r::GUI::ColorDecomposeDialog::m_arb_column_panel {nullptr}
private
135{nullptr};

Referenced by create_mode_selection_section(), and update_card_visibility().

◆ m_btn_cancel

Button* Slic3r::GUI::ColorDecomposeDialog::m_btn_cancel {nullptr}
private
149{nullptr};

Referenced by create_button_panel().

◆ m_btn_ok

Button* Slic3r::GUI::ColorDecomposeDialog::m_btn_ok {nullptr}
private
148{nullptr};

Referenced by create_button_panel(), and update_ok_button_state().

◆ m_can_rescale

bool Slic3r::GUI::DPIAware< wxDialog >::m_can_rescale
privateinherited
235{ true };

◆ m_card_cmyw

wxPanel* Slic3r::GUI::ColorDecomposeDialog::m_card_cmyw {nullptr}
private

◆ m_card_material_list

wxPanel* Slic3r::GUI::ColorDecomposeDialog::m_card_material_list {nullptr}
private

◆ m_card_rybw

wxPanel* Slic3r::GUI::ColorDecomposeDialog::m_card_rybw {nullptr}
private

◆ m_chk_cmyw

CheckBox* Slic3r::GUI::ColorDecomposeDialog::m_chk_cmyw {nullptr}
private
137{nullptr};

Referenced by create_mode_card(), and update_card_styles().

◆ m_chk_material_list

CheckBox* Slic3r::GUI::ColorDecomposeDialog::m_chk_material_list {nullptr}
private
136{nullptr};

Referenced by create_mode_card(), and update_card_styles().

◆ m_chk_rybw

CheckBox* Slic3r::GUI::ColorDecomposeDialog::m_chk_rybw {nullptr}
private
138{nullptr};

Referenced by create_mode_card(), and update_card_styles().

◆ m_combo_item_types

std::vector<std::string> Slic3r::GUI::ColorDecomposeDialog::m_combo_item_types
private

◆ m_current_filament_count

size_t Slic3r::GUI::ColorDecomposeDialog::m_current_filament_count {0}
private

◆ m_em_unit

int Slic3r::GUI::DPIAware< wxDialog >::m_em_unit
privateinherited

◆ m_filament_idx

int Slic3r::GUI::ColorDecomposeDialog::m_filament_idx {-1}
private

◆ m_filament_names

std::vector<std::string> Slic3r::GUI::ColorDecomposeDialog::m_filament_names
private

◆ m_filament_types

std::vector<std::string> Slic3r::GUI::ColorDecomposeDialog::m_filament_types
private

◆ m_force_rescale

bool Slic3r::GUI::DPIAware< wxDialog >::m_force_rescale
privateinherited
236{ false };

◆ m_limit_warning_panel

wxPanel* Slic3r::GUI::ColorDecomposeDialog::m_limit_warning_panel {nullptr}
private

◆ m_limit_warning_text

wxStaticText* Slic3r::GUI::ColorDecomposeDialog::m_limit_warning_text {nullptr}
private

◆ m_matched_rgb_text

wxStaticText* Slic3r::GUI::ColorDecomposeDialog::m_matched_rgb_text {nullptr}
private

◆ m_matched_swatch

wxPanel* Slic3r::GUI::ColorDecomposeDialog::m_matched_swatch {nullptr}
private

◆ m_max_filament_count

size_t Slic3r::GUI::ColorDecomposeDialog::m_max_filament_count {32}
private

◆ m_missing_calculator

std::function<size_t(const ColorDecomposeResult&)> Slic3r::GUI::ColorDecomposeDialog::m_missing_calculator
private

◆ m_mode_cards

std::array<ModeCardControls, 3> Slic3r::GUI::ColorDecomposeDialog::m_mode_cards
private

◆ m_mode_results

std::array<ColorDecomposeResult, 3> Slic3r::GUI::ColorDecomposeDialog::m_mode_results
private

◆ m_new_font_point_size

int Slic3r::GUI::DPIAware< wxDialog >::m_new_font_point_size
privateinherited

◆ m_no_card_hint

wxStaticText* Slic3r::GUI::ColorDecomposeDialog::m_no_card_hint {nullptr}
private
142{nullptr};

Referenced by create_mode_selection_section(), and update_card_visibility().

◆ m_normal_font

wxFont Slic3r::GUI::DPIAware< wxDialog >::m_normal_font
privateinherited

◆ m_physical_colors

std::vector<std::string> Slic3r::GUI::ColorDecomposeDialog::m_physical_colors
private

◆ m_physical_config_indices

std::vector<size_t> Slic3r::GUI::ColorDecomposeDialog::m_physical_config_indices
private

◆ m_preferred_type

std::string Slic3r::GUI::ColorDecomposeDialog::m_preferred_type
private

◆ m_prev_scale_factor

float Slic3r::GUI::DPIAware< wxDialog >::m_prev_scale_factor
privateinherited

◆ m_project_types

std::vector<std::string> Slic3r::GUI::ColorDecomposeDialog::m_project_types
private

Referenced by ColorDecomposeDialog().

◆ m_result

◆ m_scale_factor

float Slic3r::GUI::DPIAware< wxDialog >::m_scale_factor
privateinherited

◆ m_selected_mode

DecomposeMode Slic3r::GUI::ColorDecomposeDialog::m_selected_mode {DecomposeMode::MaterialList}
private

◆ m_target_color

wxColour Slic3r::GUI::ColorDecomposeDialog::m_target_color
private

◆ m_target_rgb_text

wxStaticText* Slic3r::GUI::ColorDecomposeDialog::m_target_rgb_text {nullptr}
private
127{nullptr};

Referenced by create_target_color_section().

◆ m_target_swatch

wxPanel* Slic3r::GUI::ColorDecomposeDialog::m_target_swatch {nullptr}
private
126{nullptr};

Referenced by ColorDecomposeDialog(), and create_target_color_section().

◆ m_type_combo

ComboBox* Slic3r::GUI::ColorDecomposeDialog::m_type_combo {nullptr}
private
125{nullptr};

Referenced by create_filament_selector().


The documentation for this class was generated from the following files: