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

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

Inheritance diagram for Slic3r::GUI::MaterialSyncItem:
Collaboration diagram for Slic3r::GUI::MaterialSyncItem:

Public Member Functions

 MaterialSyncItem (wxWindow *parent, wxColour mcolour, wxString mname, std::string filament_id=std::string())
 ~MaterialSyncItem ()
int get_real_offset ()
void render (wxDC &dc) override
void doRender (wxDC &dc) override
void set_material_index_str (std::string str)
const std::string & get_material_index_str ()
void allow_paint_dropdown (bool flag)
void set_ams_text (const wxString &txt)
void set_ams_info (wxColour col, wxString txt, int ctype=0, std::vector< wxColour > cols=std::vector< wxColour >(), bool record_back_info=false)
void set_material_cols (int ctype, const std::vector< wxColour > &cols)
void reset_ams_info ()
virtual void reset_valid_info ()
void set_nozzle_info (const wxString &mapped_nozzle_str)
void disable ()
void enable ()
void on_normal ()
void on_selected ()
void on_warning ()
bool is_selected () const
bool is_warning () const
void msw_rescale ()
void paintEvent (wxPaintEvent &evt)
void match (bool mat)

Public Attributes

std::string m_filament_id
wxColour m_material_coloul
int m_material_ctype = 0
std::vector< wxColour > m_material_cols
wxString m_material_name
wxString m_mapped_nozzle_str
wxColour m_ams_coloul
wxString m_ams_name
int m_ams_ctype = 0
std::vector< wxColour > m_ams_cols = std::vector<wxColour>()
wxColour m_back_ams_coloul
wxString m_back_ams_name
int m_back_ams_ctype = 0
std::vector< wxColour > m_back_ams_cols = std::vector<wxColour>()
ScalableBitmap m_arraw_bitmap_gray
ScalableBitmap m_arraw_bitmap_white
ScalableBitmap m_transparent_mitem
ScalableBitmap m_filament_wheel_transparent
ScalableBitmap m_ams_wheel_mitem
ScalableBitmap m_ams_not_match
ScalableBitmap m_rack_nozzle_bitmap
bool m_selected {false}
bool m_warning {false}
bool m_match {true}
bool m_enable {true}

Protected Member Functions

void messure_size ()

Protected Attributes

int m_text_pos_y = -1
bool m_dropdown_allow_painted = true
wxString m_mapping_text

Private Attributes

std::string m_material_index

Detailed Description

Constructor & Destructor Documentation

◆ MaterialSyncItem()

Slic3r::GUI::MaterialSyncItem::MaterialSyncItem ( wxWindow * parent,
wxColour mcolour,
wxString mname,
std::string filament_id = std::string() )
604 : MaterialItem(parent, mcolour, mname, filament_id)
605{
606
607}
MaterialItem(wxWindow *parent, wxColour mcolour, wxString mname, std::string filament_id=std::string())
Definition AmsMappingPopup.cpp:83

References Slic3r::GUI::MaterialItem::MaterialItem().

Here is the call graph for this function:

◆ ~MaterialSyncItem()

Slic3r::GUI::MaterialSyncItem::~MaterialSyncItem ( )
609{}

Member Function Documentation

◆ allow_paint_dropdown()

void Slic3r::GUI::MaterialItem::allow_paint_dropdown ( bool flag)
inherited
121 {
122 if (m_dropdown_allow_painted != flag) {
124 }
125}
bool m_dropdown_allow_painted
Definition AmsMappingPopup.hpp:103

References m_dropdown_allow_painted.

Referenced by Slic3r::GUI::SyncAmsInfoDialog::generate_override_fix_ams_list().

Here is the caller graph for this function:

◆ disable()

void Slic3r::GUI::MaterialItem::disable ( )
inherited
184{
185 if (IsEnabled()) {
186 m_enable = false;
187 }
188}
bool m_enable
Definition AmsMappingPopup.hpp:172
bool IsEnabled()
Definition dark_mode.cpp:32

References m_enable.

◆ doRender()

void Slic3r::GUI::MaterialSyncItem::doRender ( wxDC & dc)
overridevirtual

Reimplemented from Slic3r::GUI::MaterialItem.

703{
704 wxSize size = GetSize();
705 auto mcolor = m_material_coloul;
706 auto acolor = m_ams_coloul;
707 change_the_opacity(acolor);
708
709 if (mcolor.Alpha() == 0) {
710 dc.DrawBitmap(m_transparent_mitem.bmp(), FromDIP(0), FromDIP(0));
711 }
712
713 if (!IsEnabled()) {
714 mcolor = wxColour(0x90, 0x90, 0x90);
715 acolor = wxColour(0x90, 0x90, 0x90);
716 }
717
718 // top
719 dc.SetPen(*wxTRANSPARENT_PEN);
720 dc.SetBrush(wxBrush(mcolor));
721 dc.DrawRoundedRectangle(0, 0, size.x, FromDIP(20), 5);
722
723 dc.SetPen(*wxTRANSPARENT_PEN);
724 dc.SetBrush(wxBrush(mcolor));
725 dc.DrawRectangle(0, FromDIP(10), size.x, FromDIP(10));
726
727 dc.SetPen(wxColour(0xAC, 0xAC, 0xAC));
728 dc.DrawLine(FromDIP(1), FromDIP(20), FromDIP(size.x), FromDIP(20));
729 // bottom rectangle in wheel bitmap, size is MATERIAL_REC_WHEEL_SIZE(22)
730 auto left = (size.x / 2 - MATERIAL_REC_WHEEL_SIZE.x) / 2 + FromDIP(3);
731 auto up = (size.y * 0.4 + (size.y * 0.6 - MATERIAL_REC_WHEEL_SIZE.y) / 2);
732 auto right = left + MATERIAL_REC_WHEEL_SIZE.x - FromDIP(3);
733 dc.SetPen(*wxTRANSPARENT_PEN);
734 int real_left_offset = get_real_offset();
735 // bottom
736 if (m_match) {
737 if (m_ams_cols.size() > 1) {
738 int gwidth = std::round(MATERIAL_REC_WHEEL_SIZE.x / (m_ams_cols.size() - 1));
739 // gradient
740 if (m_ams_ctype == 0) {
742 left += FromDIP(5);
743 right += FromDIP(5);
744 }
745 for (int i = 0; i < m_ams_cols.size() - 1; i++) {
746 auto rect = wxRect(left, up, right - left, MATERIAL_REC_WHEEL_SIZE.y);
747 fill_gradient_rect_east(dc, rect, m_ams_cols[i], m_ams_cols[i + 1]);
748 left += gwidth;
749 }
750 } else {
752 left += FromDIP(5);
753 }
754 int cols_size = m_ams_cols.size();
755 for (int i = 0; i < cols_size; i++) {
756 dc.SetBrush(wxBrush(m_ams_cols[i]));
757 float x = left + ((float) MATERIAL_REC_WHEEL_SIZE.x) * i / cols_size;
758 if (i != cols_size - 1) {
759 dc.DrawRoundedRectangle(x - FromDIP(real_left_offset), up, ((float) MATERIAL_REC_WHEEL_SIZE.x) / cols_size + FromDIP(3), MATERIAL_REC_WHEEL_SIZE.y, 3);
760 } else {
761 dc.DrawRoundedRectangle(x - FromDIP(real_left_offset), up, ((float) MATERIAL_REC_WHEEL_SIZE.x) / cols_size - FromDIP(1), MATERIAL_REC_WHEEL_SIZE.y, 3);
762 }
763 }
764 }
765 } else {
766 dc.SetPen(*wxTRANSPARENT_PEN);
767 dc.SetBrush(wxBrush(wxColour(acolor)));
768 dc.DrawRectangle((size.x / 2 - MATERIAL_REC_WHEEL_SIZE.x) / 2 + FromDIP(3) - FromDIP(real_left_offset), up, MATERIAL_REC_WHEEL_SIZE.x - FromDIP(1),
770 }
771 }
772 else {
773 dc.SetPen(*wxTRANSPARENT_PEN);
774 dc.SetBrush(wxBrush(mcolor));
775 dc.DrawRoundedRectangle(0, FromDIP(21), size.x, size.y - FromDIP(21), 5);
776
777 dc.DrawRectangle(0, FromDIP(21), size.x, FromDIP(10));
778 }
779
781#if __APPLE__
782 dc.SetPen(wxColour(0xAC, 0xAC, 0xAC));
783 dc.SetBrush(*wxTRANSPARENT_BRUSH);
784 dc.DrawRoundedRectangle(1, 1, size.x - 1, size.y - 1, 5);
785
786 if (m_selected) {
787 dc.SetPen(wxColour("#009688")); // ORCA selected item border color (Orca accent)
788 dc.SetBrush(*wxTRANSPARENT_BRUSH);
789 dc.DrawRoundedRectangle(1, 1, size.x - 1, size.y - 1, 5);
790 }
791#else
792
793 dc.SetPen(wxPen(wxGetApp().dark_mode() ? wxColour(107, 107, 107) : wxColour(0xAC, 0xAC, 0xAC), FromDIP(1)));
794 dc.SetBrush(*wxTRANSPARENT_BRUSH);
795 dc.DrawRoundedRectangle(0, 0, size.x, size.y, 5);
796
797 if (m_selected) {
798 dc.SetPen(wxPen(wxColour("#009688"), FromDIP(2))); // ORCA selected item border color (Orca accent)
799 dc.SetBrush(*wxTRANSPARENT_BRUSH);
800 dc.DrawRoundedRectangle(FromDIP(1), FromDIP(1), size.x - FromDIP(1), size.y - FromDIP(1), 5);
801 }
802#endif
803
805 // arrow (remove arrow)
806 if ((acolor.Red() > 160 && acolor.Green() > 160 && acolor.Blue() > 160) && (acolor.Red() < 180 && acolor.Green() < 180 && acolor.Blue() < 180)) {
807 dc.DrawBitmap(m_arraw_bitmap_white.bmp(), size.x - m_arraw_bitmap_white.GetBmpSize().x - FromDIP(4) - FromDIP(real_left_offset), m_text_pos_y + FromDIP(3));
808 } else {
809 dc.DrawBitmap(m_arraw_bitmap_gray.bmp(), size.x - m_arraw_bitmap_gray.GetBmpSize().x - FromDIP(4) - FromDIP(real_left_offset), m_text_pos_y + FromDIP(3));
810 }
811 }
812 auto wheel_left = (GetSize().x / 2 - m_ams_wheel_mitem.GetBmpSize().x) / 2 + FromDIP(2);
813 auto wheel_top = ((float) GetSize().y * 0.6 - m_ams_wheel_mitem.GetBmpSize().y) / 2 + (float) GetSize().y * 0.4;
814 if (m_match) {// different with parent
815 if (acolor.Alpha() == 0) {
816 dc.DrawBitmap(m_filament_wheel_transparent.bmp(), wheel_left - FromDIP(real_left_offset), wheel_top);
817 } else {
818 dc.DrawBitmap(m_ams_wheel_mitem.bmp(), wheel_left - FromDIP(real_left_offset), wheel_top);
819 }
820 }
821 //not draw m_ams_not_match
822}
#define MATERIAL_REC_WHEEL_SIZE
Definition AmsMappingPopup.cpp:76
ScalableBitmap m_filament_wheel_transparent
Definition AmsMappingPopup.hpp:164
std::vector< wxColour > m_ams_cols
Definition AmsMappingPopup.hpp:153
bool m_selected
Definition AmsMappingPopup.hpp:169
ScalableBitmap m_ams_wheel_mitem
Definition AmsMappingPopup.hpp:165
ScalableBitmap m_transparent_mitem
Definition AmsMappingPopup.hpp:163
wxColour m_ams_coloul
Definition AmsMappingPopup.hpp:150
int m_ams_ctype
Definition AmsMappingPopup.hpp:152
wxColour m_material_coloul
Definition AmsMappingPopup.hpp:143
bool m_match
Definition AmsMappingPopup.hpp:171
ScalableBitmap m_arraw_bitmap_white
Definition AmsMappingPopup.hpp:162
int m_text_pos_y
Definition AmsMappingPopup.hpp:102
ScalableBitmap m_arraw_bitmap_gray
Definition AmsMappingPopup.hpp:161
int get_real_offset()
Definition AmsMappingPopup.cpp:611
void fill_gradient_rect_east(wxDC &dc, const wxRect &rect, const wxColour &from, const wxColour &to)
Definition FilamentBitmapUtils.cpp:76
void change_the_opacity(wxColour &colour)
Definition DeviceManager.cpp:6154
@ up
Definition MarchingSquares.hpp:192
@ right
Definition MarchingSquares.hpp:190
@ left
Definition MarchingSquares.hpp:188

References Slic3r::change_the_opacity(), Slic3r::GUI::fill_gradient_rect_east(), get_real_offset(), Slic3r::GUI::MaterialItem::m_ams_coloul, Slic3r::GUI::MaterialItem::m_ams_cols, Slic3r::GUI::MaterialItem::m_ams_ctype, Slic3r::GUI::MaterialItem::m_ams_wheel_mitem, Slic3r::GUI::MaterialItem::m_arraw_bitmap_gray, Slic3r::GUI::MaterialItem::m_arraw_bitmap_white, Slic3r::GUI::MaterialItem::m_dropdown_allow_painted, Slic3r::GUI::MaterialItem::m_filament_wheel_transparent, Slic3r::GUI::MaterialItem::m_match, Slic3r::GUI::MaterialItem::m_material_coloul, Slic3r::GUI::MaterialItem::m_selected, Slic3r::GUI::MaterialItem::m_text_pos_y, Slic3r::GUI::MaterialItem::m_transparent_mitem, and MATERIAL_REC_WHEEL_SIZE.

Referenced by render().

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

◆ enable()

void Slic3r::GUI::MaterialItem::enable ( )
inherited
191{
192 if (!IsEnabled()) {
193 m_enable = true;
194 }
195}

References m_enable.

◆ get_material_index_str()

const std::string & Slic3r::GUI::MaterialSyncItem::get_material_index_str ( )
inline
190{ return m_material_index; }
std::string m_material_index
Definition AmsMappingPopup.hpp:192

References m_material_index.

◆ get_real_offset()

int Slic3r::GUI::MaterialSyncItem::get_real_offset ( )
611 {
612 int real_left_offset = m_dropdown_allow_painted ? LEFT_OFFSET : -2;
613 return real_left_offset;
614}
const int LEFT_OFFSET
Definition AmsMappingPopup.cpp:81

References Slic3r::GUI::LEFT_OFFSET, and Slic3r::GUI::MaterialItem::m_dropdown_allow_painted.

Referenced by doRender(), and render().

Here is the caller graph for this function:

◆ is_selected()

bool Slic3r::GUI::MaterialItem::is_selected ( ) const
inlineinherited
132{ return m_selected;}

References m_selected.

◆ is_warning()

bool Slic3r::GUI::MaterialItem::is_warning ( ) const
inlineinherited
133{ return m_warning;}
bool m_warning
Definition AmsMappingPopup.hpp:170

References m_warning.

◆ match()

void Slic3r::GUI::MaterialItem::match ( bool mat)
inherited
261{
262 m_match = mat;
263 Refresh();
264}

References m_match.

◆ messure_size()

void Slic3r::GUI::MaterialItem::messure_size ( )
protectedinherited
590{
591 if (m_mapped_nozzle_str.empty()) {
592 SetSize(wxSize(FromDIP(65), FromDIP(50)));
593 SetMinSize(wxSize(FromDIP(65), FromDIP(50)));
594 SetMaxSize(wxSize(FromDIP(65), FromDIP(50)));
595 } else {
597 const int item_height = FromDIP(84 + std::max(0, line_count - 1) * 10);
598 SetSize(wxSize(FromDIP(65), item_height));
599 SetMinSize(wxSize(FromDIP(65), item_height));
600 SetMaxSize(wxSize(FromDIP(65), item_height));
601 }
602}
wxString m_mapped_nozzle_str
Definition AmsMappingPopup.hpp:147
static int s_get_mapped_nozzle_str_line_count(const wxString &text)
Definition AmsMappingPopup.cpp:310

References m_mapped_nozzle_str, and Slic3r::GUI::s_get_mapped_nozzle_str_line_count().

Referenced by MaterialItem(), reset_ams_info(), set_ams_info(), set_ams_text(), and set_nozzle_info().

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

◆ msw_rescale()

void Slic3r::GUI::MaterialItem::msw_rescale ( )
inherited
114 {
115 m_arraw_bitmap_gray.msw_rescale();
116 m_arraw_bitmap_white.msw_rescale();
117 m_transparent_mitem.msw_rescale();
118 m_ams_wheel_mitem.msw_rescale();
119}

References m_ams_wheel_mitem, m_arraw_bitmap_gray, m_arraw_bitmap_white, and m_transparent_mitem.

◆ on_normal()

void Slic3r::GUI::MaterialItem::on_normal ( )
inherited
214{
215 if (m_selected || m_warning) {
216 m_selected = false;
217 m_warning = false;
218 Refresh();
219 }
220}

References m_selected, and m_warning.

Referenced by Slic3r::GUI::SelectMachineDialog::reset_and_sync_ams_list(), Slic3r::GUI::SyncAmsInfoDialog::reset_and_sync_ams_list(), Slic3r::GUI::SelectMachineDialog::set_default_from_sdcard(), and Slic3r::GUI::SendMultiMachinePage::sync_ams_list().

Here is the caller graph for this function:

◆ on_selected()

void Slic3r::GUI::MaterialItem::on_selected ( )
inherited
198{
199 if (!m_selected) {
200 m_selected = true;
201 Refresh();
202 }
203}

References m_selected.

Referenced by Slic3r::GUI::SelectMachineDialog::reset_and_sync_ams_list(), Slic3r::GUI::SyncAmsInfoDialog::reset_and_sync_ams_list(), Slic3r::GUI::SelectMachineDialog::set_default_from_sdcard(), and Slic3r::GUI::SendMultiMachinePage::sync_ams_list().

Here is the caller graph for this function:

◆ on_warning()

void Slic3r::GUI::MaterialItem::on_warning ( )
inherited
206{
207 if (!m_warning) {
208 m_warning = true;
209 Refresh();
210 }
211}

References m_warning.

◆ paintEvent()

void Slic3r::GUI::MaterialItem::paintEvent ( wxPaintEvent & evt)
inherited
224{
225 wxPaintDC dc(this);
226 render(dc);
227}
virtual void render(wxDC &dc)
Definition AmsMappingPopup.cpp:229

References render().

Referenced by MaterialItem().

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

◆ render()

void Slic3r::GUI::MaterialSyncItem::render ( wxDC & dc)
overridevirtual

Reimplemented from Slic3r::GUI::MaterialItem.

617{
618 wxString mapping_txt = wxEmptyString;
619 if (m_ams_name.empty()) {
620 mapping_txt = "-";
621 } else {
622 mapping_txt = m_ams_name;
623 }
624
625 if (mapping_txt == "-") {
626 m_match = false;
627 mapping_txt = _L("Unmapped");
628 SetToolTip(_L("Upper half area: Original\nLower half area: The filament from original project will be used when unmapped.\nAnd you can click it to modify"));
629 } else {
630 m_match = true;
632 SetToolTip(_L("Upper half area: Original\nLower half area: Filament in AMS\nAnd you can click it to modify"));
633 } else {
634 SetToolTip(_L("Upper half area: Original\nLower half area: Filament in AMS\nAnd you cannot click it to modify"));
635 }
636 }
637 dc.SetFont(::Label::Body_12);
638 if (dc.GetTextExtent(m_material_name).x > GetSize().x - 10) {
639 dc.SetFont(::Label::Body_10);
640 }
641 auto mapping_txt_size = dc.GetTextExtent(mapping_txt);
642 m_text_pos_y = ((float) GetSize().y * 3 / 5 - mapping_txt_size.y) / 2 + (float) GetSize().y * 2 / 5;
643#ifdef __WXMSW__
644 wxSize size = GetSize();
645 wxMemoryDC memdc;
646 wxBitmap bmp(size.x, size.y);
647 memdc.SelectObject(bmp);
648 memdc.Blit({0, 0}, size, &dc, {0, 0});
649
650 {
651 wxGCDC dc2(memdc);
652 doRender(dc2);
653 }
654
655 memdc.SelectObject(wxNullBitmap);
656 dc.DrawBitmap(bmp, 0, 0);
657#else
658 doRender(dc);
659#endif
660
661 auto mcolor = m_material_coloul;
662 auto acolor = m_ams_coloul;
663 change_the_opacity(acolor);
664 if (!IsEnabled()) {
665 mcolor = wxColour(0x90, 0x90, 0x90);
666 acolor = wxColour(0x90, 0x90, 0x90);
667 }
668
669 // materials name
670 dc.SetFont(::Label::Body_12);
671
672 auto material_name_colour = mcolor.GetLuminance() < 0.6 ? *wxWHITE : wxColour(0x26, 0x2E, 0x30);
673 if (mcolor.Alpha() == 0) { material_name_colour = wxColour(0x26, 0x2E, 0x30); }
674 dc.SetTextForeground(material_name_colour);
675
676 auto full_text = m_material_index + " " + m_material_name;
677 if (dc.GetTextExtent(full_text).x > GetSize().x - 10) {
678 dc.SetFont(::Label::Body_10);
679 }
680
681 auto material_txt_size = dc.GetTextExtent(full_text);
682 dc.DrawText(full_text, wxPoint((GetSize().x - material_txt_size.x) / 2, ((float) GetSize().y * 2 / 5 - material_txt_size.y) / 2));
683 int real_left_offset = get_real_offset();
684 if (m_match) {
685 dc.SetTextForeground(StateColor::darkModeColorFor(wxColour(0x26, 0x2E, 0x30)));
686 dc.SetFont(::Label::Head_12);
687 dc.DrawText(mapping_txt, wxPoint(GetSize().x / 2 + (GetSize().x / 2 - mapping_txt_size.x) / 2 - FromDIP(8) - FromDIP(real_left_offset), m_text_pos_y));
688 }
689 else {
690 if (mcolor.Alpha() == 0) {//Because there is no unknown background color
691 material_name_colour = StateColor::darkModeColorFor(wxColour(0x26, 0x2E, 0x30));
692 }
693 dc.SetTextForeground(material_name_colour);
694 if (mapping_txt_size.x > GetSize().x - 10) {
695 dc.SetFont(::Label::Body_10);
696 mapping_txt_size = dc.GetTextExtent(mapping_txt);
697 }
698 dc.DrawText(mapping_txt, wxPoint(GetSize().x / 2 - mapping_txt_size.x / 2 , m_text_pos_y));
699 }
700}
#define _L(s)
Definition OBJ.cpp:34
static wxFont Head_12
Definition Label.hpp:47
static wxFont Body_12
Definition Label.hpp:55
static wxFont Body_10
Definition Label.hpp:56
wxString m_ams_name
Definition AmsMappingPopup.hpp:151
wxString m_material_name
Definition AmsMappingPopup.hpp:146
void doRender(wxDC &dc) override
Definition AmsMappingPopup.cpp:702
static wxColour darkModeColorFor(wxColour const &color)
Definition StateColor.cpp:219

References _L, Label::Body_10, Label::Body_12, Slic3r::change_the_opacity(), StateColor::darkModeColorFor(), doRender(), get_real_offset(), Label::Head_12, Slic3r::GUI::MaterialItem::m_ams_coloul, Slic3r::GUI::MaterialItem::m_ams_name, Slic3r::GUI::MaterialItem::m_dropdown_allow_painted, Slic3r::GUI::MaterialItem::m_match, Slic3r::GUI::MaterialItem::m_material_coloul, m_material_index, Slic3r::GUI::MaterialItem::m_material_name, and Slic3r::GUI::MaterialItem::m_text_pos_y.

Here is the call graph for this function:

◆ reset_ams_info()

void Slic3r::GUI::MaterialItem::reset_ams_info ( )
inherited
173 {
174 m_ams_name = "-";
175 m_ams_coloul = wxColour(0xCE, 0xCE, 0xCE);
176 m_ams_cols.clear();
177 m_ams_ctype = 0;
178 m_mapped_nozzle_str.Clear();
179 messure_size();
180 Refresh();
181}
void messure_size()
Definition AmsMappingPopup.cpp:589

References m_ams_coloul, m_ams_cols, m_ams_ctype, m_ams_name, m_mapped_nozzle_str, and messure_size().

Referenced by Slic3r::GUI::SyncAmsInfoDialog::reset_ams_material().

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

◆ reset_valid_info()

void Slic3r::GUI::MaterialItem::reset_valid_info ( )
virtualinherited
585 {
587}
void set_ams_info(wxColour col, wxString txt, int ctype=0, std::vector< wxColour > cols=std::vector< wxColour >(), bool record_back_info=false)
Definition AmsMappingPopup.cpp:136
std::vector< wxColour > m_back_ams_cols
Definition AmsMappingPopup.hpp:159
wxString m_back_ams_name
Definition AmsMappingPopup.hpp:157
wxColour m_back_ams_coloul
Definition AmsMappingPopup.hpp:156
int m_back_ams_ctype
Definition AmsMappingPopup.hpp:158

References m_back_ams_coloul, m_back_ams_cols, m_back_ams_ctype, m_back_ams_name, and set_ams_info().

Here is the call graph for this function:

◆ set_ams_info()

void Slic3r::GUI::MaterialItem::set_ams_info ( wxColour col,
wxString txt,
int ctype = 0,
std::vector< wxColour > cols = std::vector<wxColour>(),
bool record_back_info = false )
inherited
137{
138 auto need_refresh = false;
139 if (record_back_info) {
141 m_back_ams_ctype = ctype;
142 m_back_ams_coloul = col;
143 m_back_ams_name = txt;
144 }
145 if (m_ams_cols != cols) { m_ams_cols = cols; need_refresh = true; }
146 if (m_ams_ctype != ctype) { m_ams_ctype = ctype; need_refresh = true; }
147 if (m_ams_coloul != col) { m_ams_coloul = col; need_refresh = true;}
148 if (m_ams_name != txt) { m_ams_name = txt; need_refresh = true; }
149 if (need_refresh) {
150 messure_size();
151 Refresh();
152 }
153 BOOST_LOG_TRIVIAL(info) << "set_ams_info " << m_ams_name;
154}
size_t cols(const T &raster)
Definition MarchingSquares.hpp:173

References m_ams_coloul, m_ams_cols, m_ams_ctype, m_ams_name, m_back_ams_coloul, m_back_ams_cols, m_back_ams_ctype, m_back_ams_name, and messure_size().

Referenced by Slic3r::GUI::SelectMachineDialog::on_set_finish_mapping(), Slic3r::GUI::SendMultiMachinePage::on_set_finish_mapping(), Slic3r::GUI::SendMultiMachinePage::OnSelectRadio(), Slic3r::GUI::SelectMachineDialog::reset_ams_material(), reset_valid_info(), Slic3r::GUI::SendMultiMachinePage::sync_ams_list(), and Slic3r::GUI::SelectMachineDialog::sync_ams_mapping_result().

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

◆ set_ams_text()

void Slic3r::GUI::MaterialItem::set_ams_text ( const wxString & txt)
inherited
128{
129 if (m_ams_name != txt) {
130 m_ams_name = txt;
131 messure_size();
132 Refresh();
133 }
134}

References m_ams_name, and messure_size().

Here is the call graph for this function:

◆ set_material_cols()

void Slic3r::GUI::MaterialItem::set_material_cols ( int ctype,
const std::vector< wxColour > & cols )
inherited
165 {
166 if (m_material_ctype != ctype || m_material_cols != cols) {
167 m_material_ctype = ctype;
169 Refresh();
170 }
171}
int m_material_ctype
Definition AmsMappingPopup.hpp:144
std::vector< wxColour > m_material_cols
Definition AmsMappingPopup.hpp:145

References m_material_cols, and m_material_ctype.

◆ set_material_index_str()

void Slic3r::GUI::MaterialSyncItem::set_material_index_str ( std::string str)
824 {
825 m_material_index = str;
826}

References m_material_index.

Referenced by Slic3r::GUI::SyncAmsInfoDialog::generate_override_fix_ams_list(), and Slic3r::GUI::SyncAmsInfoDialog::reset_and_sync_ams_list().

Here is the caller graph for this function:

◆ set_nozzle_info()

void Slic3r::GUI::MaterialItem::set_nozzle_info ( const wxString & mapped_nozzle_str)
inherited
157{
158 if (m_mapped_nozzle_str != mapped_nozzle_str) {
159 m_mapped_nozzle_str = mapped_nozzle_str;
160 messure_size();
161 Refresh();
162 }
163}

References m_mapped_nozzle_str, and messure_size().

Referenced by Slic3r::GUI::SelectMachineDialog::on_set_finish_mapping(), Slic3r::GUI::SelectMachineDialog::reset_ams_material(), and Slic3r::GUI::SelectMachineDialog::sync_ams_mapping_result().

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

Member Data Documentation

◆ m_ams_coloul

◆ m_ams_cols

std::vector<wxColour> Slic3r::GUI::MaterialItem::m_ams_cols = std::vector<wxColour>()
inherited

◆ m_ams_ctype

int Slic3r::GUI::MaterialItem::m_ams_ctype = 0
inherited

◆ m_ams_name

◆ m_ams_not_match

ScalableBitmap Slic3r::GUI::MaterialItem::m_ams_not_match
inherited

Referenced by MaterialItem(), and doRender().

◆ m_ams_wheel_mitem

ScalableBitmap Slic3r::GUI::MaterialItem::m_ams_wheel_mitem
inherited

◆ m_arraw_bitmap_gray

ScalableBitmap Slic3r::GUI::MaterialItem::m_arraw_bitmap_gray
inherited

◆ m_arraw_bitmap_white

ScalableBitmap Slic3r::GUI::MaterialItem::m_arraw_bitmap_white
inherited

◆ m_back_ams_coloul

wxColour Slic3r::GUI::MaterialItem::m_back_ams_coloul
inherited

Referenced by reset_valid_info(), and set_ams_info().

◆ m_back_ams_cols

std::vector<wxColour> Slic3r::GUI::MaterialItem::m_back_ams_cols = std::vector<wxColour>()
inherited

Referenced by reset_valid_info(), and set_ams_info().

◆ m_back_ams_ctype

int Slic3r::GUI::MaterialItem::m_back_ams_ctype = 0
inherited

Referenced by reset_valid_info(), and set_ams_info().

◆ m_back_ams_name

wxString Slic3r::GUI::MaterialItem::m_back_ams_name
inherited

Referenced by reset_valid_info(), and set_ams_info().

◆ m_dropdown_allow_painted

bool Slic3r::GUI::MaterialItem::m_dropdown_allow_painted = true
protectedinherited

◆ m_enable

bool Slic3r::GUI::MaterialItem::m_enable {true}
inherited

◆ m_filament_id

std::string Slic3r::GUI::MaterialItem::m_filament_id
inherited

Referenced by MaterialItem().

◆ m_filament_wheel_transparent

ScalableBitmap Slic3r::GUI::MaterialItem::m_filament_wheel_transparent
inherited

◆ m_mapped_nozzle_str

wxString Slic3r::GUI::MaterialItem::m_mapped_nozzle_str
inherited

◆ m_mapping_text

wxString Slic3r::GUI::MaterialItem::m_mapping_text
protectedinherited

Referenced by doRender(), and render().

◆ m_match

◆ m_material_coloul

◆ m_material_cols

std::vector<wxColour> Slic3r::GUI::MaterialItem::m_material_cols
inherited

Referenced by doRender(), and set_material_cols().

◆ m_material_ctype

int Slic3r::GUI::MaterialItem::m_material_ctype = 0
inherited

Referenced by doRender(), and set_material_cols().

◆ m_material_index

std::string Slic3r::GUI::MaterialSyncItem::m_material_index
private

◆ m_material_name

wxString Slic3r::GUI::MaterialItem::m_material_name
inherited

◆ m_rack_nozzle_bitmap

ScalableBitmap Slic3r::GUI::MaterialItem::m_rack_nozzle_bitmap
inherited

Referenced by MaterialItem(), and doRender().

◆ m_selected

bool Slic3r::GUI::MaterialItem::m_selected {false}
inherited

◆ m_text_pos_y

int Slic3r::GUI::MaterialItem::m_text_pos_y = -1
protectedinherited

◆ m_transparent_mitem

ScalableBitmap Slic3r::GUI::MaterialItem::m_transparent_mitem
inherited

◆ m_warning

bool Slic3r::GUI::MaterialItem::m_warning {false}
inherited
170{false};

Referenced by doRender(), is_warning(), on_normal(), and on_warning().


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