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

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

Inheritance diagram for Slic3r::GUI::AMSextruderImage:
Collaboration diagram for Slic3r::GUI::AMSextruderImage:

Public Member Functions

void OnAmsLoading (bool load, wxColour col)
void TurnOff ()
void setShowState (bool show_state)
void msw_rescale ()
void paintEvent (wxPaintEvent &evt)
void render (wxDC &dc)
void doRender (wxDC &dc)
 AMSextruderImage (wxWindow *parent, wxWindowID id, std::string file_name, const wxSize &size, const wxPoint &pos=wxDefaultPosition)
 ~AMSextruderImage ()

Public Attributes

bool m_show_state = {false}
wxColour m_colour
ScalableBitmap m_ams_extruder
std::string m_file_name
bool m_ams_loading { false }

Detailed Description

Constructor & Destructor Documentation

◆ AMSextruderImage()

Slic3r::GUI::AMSextruderImage::AMSextruderImage ( wxWindow * parent,
wxWindowID id,
std::string file_name,
const wxSize & size,
const wxPoint & pos = wxDefaultPosition )
640{
641 wxWindow::Create(parent, id, pos, size);
642 SetBackgroundColour(StateColor::darkModeColorFor(*wxWHITE));
643
644 m_ams_extruder = ScalableBitmap(this, file_name,36);
645 m_file_name = file_name;
646 SetSize(size);
647 SetMinSize(size);
648 SetMaxSize(size);
649
650
651 Bind(wxEVT_PAINT, &AMSextruderImage::paintEvent, this);
652}
std::string m_file_name
Definition AMSItem.hpp:396
ScalableBitmap m_ams_extruder
Definition AMSItem.hpp:395
void paintEvent(wxPaintEvent &evt)
Definition AMSItem.cpp:592
static wxColour darkModeColorFor(wxColour const &color)
Definition StateColor.cpp:219

References StateColor::darkModeColorFor(), m_ams_extruder, m_file_name, and paintEvent().

Here is the call graph for this function:

◆ ~AMSextruderImage()

Slic3r::GUI::AMSextruderImage::~AMSextruderImage ( )
654{}

Member Function Documentation

◆ doRender()

void Slic3r::GUI::AMSextruderImage::doRender ( wxDC & dc)
620{
621 auto size = GetSize();
622 //dc.DrawRectangle(0, FromDIP(5), size.x, size.y - FromDIP(5) - FromDIP(2));
623 if (m_show_state){
624 if (m_ams_loading) {
625 dc.SetPen(*wxTRANSPARENT_PEN);
626 dc.SetBrush(m_colour);
627 dc.DrawRectangle(FromDIP(2), FromDIP(10), size.x - FromDIP(3), size.y - FromDIP(20));
628 }
629 else{
630 dc.SetPen(*wxTRANSPARENT_PEN);
631 dc.SetBrush(*wxWHITE);
632 dc.DrawRectangle(FromDIP(3), FromDIP(10), size.x - FromDIP(6), size.y - FromDIP(20));
633 }
634 dc.DrawBitmap(m_ams_extruder.bmp(), wxPoint((size.x - m_ams_extruder.GetBmpSize().x) / 2, 0));
635 }
636}
bool m_show_state
Definition AMSItem.hpp:393
bool m_ams_loading
Definition AMSItem.hpp:397
wxColour m_colour
Definition AMSItem.hpp:394

References m_ams_extruder, m_ams_loading, m_colour, and m_show_state.

Referenced by render().

Here is the caller graph for this function:

◆ msw_rescale()

void Slic3r::GUI::AMSextruderImage::msw_rescale ( )
584{
585 //m_ams_extruder.SetSize(AMS_EXTRUDER_BITMAP_SIZE);
586 //auto image = m_ams_extruder.ConvertToImage();
587 m_ams_extruder = ScalableBitmap(this, m_file_name, 36);
588 Layout();
589 Refresh();
590}

References m_ams_extruder, and m_file_name.

◆ OnAmsLoading()

void Slic3r::GUI::AMSextruderImage::OnAmsLoading ( bool load,
wxColour col )
569{
570 if (m_ams_loading != load || m_colour != col) {
572 m_colour = col;
573 Refresh();
574 }
575}
void load(Archive &archive, wxString &d)
Definition GLGizmoEmboss.cpp:3405

References load(), m_ams_loading, and m_colour.

Here is the call graph for this function:

◆ paintEvent()

void Slic3r::GUI::AMSextruderImage::paintEvent ( wxPaintEvent & evt)
593{
594 wxPaintDC dc(this);
595 render(dc);
596}
void render(wxDC &dc)
Definition AMSItem.cpp:598

References render().

Referenced by AMSextruderImage().

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

◆ render()

void Slic3r::GUI::AMSextruderImage::render ( wxDC & dc)
599{
600#ifdef __WXMSW__
601 wxSize size = GetSize();
602 wxMemoryDC memdc;
603 wxBitmap bmp(size.x, size.y);
604 memdc.SelectObject(bmp);
605 memdc.Blit({0, 0}, size, &dc, {0, 0});
606
607 {
608 wxGCDC dc2(memdc);
609 doRender(dc2);
610 }
611
612 memdc.SelectObject(wxNullBitmap);
613 dc.DrawBitmap(bmp, 0, 0);
614#else
615 doRender(dc);
616#endif
617}
void doRender(wxDC &dc)
Definition AMSItem.cpp:619

References doRender().

Referenced by paintEvent().

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

◆ setShowState()

void Slic3r::GUI::AMSextruderImage::setShowState ( bool show_state)
inline
388{ m_show_state = show_state; };

References m_show_state.

◆ TurnOff()

void Slic3r::GUI::AMSextruderImage::TurnOff ( )
578{
580 Refresh();
581}
#define AMS_EXTRUDER_DEF_COLOUR
Definition AMSItem.hpp:46

References AMS_EXTRUDER_DEF_COLOUR, and m_colour.

Member Data Documentation

◆ m_ams_extruder

ScalableBitmap Slic3r::GUI::AMSextruderImage::m_ams_extruder

◆ m_ams_loading

bool Slic3r::GUI::AMSextruderImage::m_ams_loading { false }
397{ false };

Referenced by doRender(), and OnAmsLoading().

◆ m_colour

wxColour Slic3r::GUI::AMSextruderImage::m_colour

Referenced by doRender(), OnAmsLoading(), and TurnOff().

◆ m_file_name

std::string Slic3r::GUI::AMSextruderImage::m_file_name

Referenced by AMSextruderImage(), and msw_rescale().

◆ m_show_state

bool Slic3r::GUI::AMSextruderImage::m_show_state = {false}
393{false};

Referenced by doRender(), and setShowState().


The documentation for this class was generated from the following files:
  • /home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/Widgets/AMSItem.hpp
  • /home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/Widgets/AMSItem.cpp