OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::GUI::PlaterDropTarget Class Reference
Inheritance diagram for Slic3r::GUI::PlaterDropTarget:
Collaboration diagram for Slic3r::GUI::PlaterDropTarget:

Public Member Functions

 PlaterDropTarget (MainFrame &mainframe, Plater &plater)
virtual bool OnDropFiles (wxCoord x, wxCoord y, const wxArrayString &filenames)

Private Attributes

MainFrame & m_mainframe
Plater & m_plater

Detailed Description

Constructor & Destructor Documentation

◆ PlaterDropTarget()

Slic3r::GUI::PlaterDropTarget::PlaterDropTarget ( MainFrame & mainframe,
Plater & plater )
inline
7129 : m_mainframe(mainframe), m_plater(plater) {
7130 this->SetDefaultAction(wxDragCopy);
7131 }
Plater & m_plater
Definition Plater.cpp:7137
MainFrame & m_mainframe
Definition Plater.cpp:7136
static Plater * plater()
Definition GUI_Factories.cpp:400

References m_mainframe, m_plater, and Slic3r::GUI::plater().

Here is the call graph for this function:

Member Function Documentation

◆ OnDropFiles()

bool Slic3r::GUI::PlaterDropTarget::OnDropFiles ( wxCoord x,
wxCoord y,
const wxArrayString & filenames )
virtual
7803{
7804#ifdef WIN32
7805 // hides the system icon
7806 this->MSWUpdateDragImageOnLeave();
7807#endif // WIN32
7808
7809 m_mainframe.Raise();
7810 m_mainframe.select_tab(TAB_ID_PREPARE);
7811 if (wxGetApp().is_editor())
7812 m_plater.select_view_3D("3D");
7813
7814 // When only one .svg file is dropped on scene
7815 if (filenames.size() == 1) {
7816 const wxString &filename = filenames.Last();
7817 const wxString file_extension = filename.substr(filename.length() - 4);
7818 if (file_extension.CmpNoCase(".svg") == 0) {
7819 // BBS: GUI refactor: move sidebar to the left
7820 const wxPoint offset = m_plater.GetPosition() + m_plater.p->current_panel->GetPosition();
7821 Vec2d mouse_position(x - offset.x, y - offset.y);
7822 // Scale for retina displays
7823 const GLCanvas3D *canvas = m_plater.canvas3D();
7824 canvas->apply_retina_scale(mouse_position);
7825 return emboss_svg(m_plater, filename, mouse_position);
7826 }
7827 }
7828 bool res = m_plater.load_files(filenames);
7829 m_mainframe.update_title();
7830 return res;
7831}
#define TAB_ID_PREPARE
Definition MainFrame.hpp:60
bool emboss_svg(Plater &plater, const wxString &svg_file, const Vec2d &mouse_drop_position)
Definition Plater.cpp:7141
Slic3r::Polygons offset(const Slic3r::Polygon &polygon, const float delta, JoinType joinType, double miterLimit)
Definition ClipperUtils.cpp:582
Eigen::Matrix< double, 2, 1, Eigen::DontAlign > Vec2d
Definition Point.hpp:67
Vec2d mouse_position(const wxMouseEvent &mouse_event)
Extract position of mouse from mouse event.
Definition SurfaceDrag.cpp:502

References Slic3r::GUI::GLCanvas3D::apply_retina_scale(), m_mainframe, m_plater, Slic3r::offset(), and TAB_ID_PREPARE.

Here is the call graph for this function:

Member Data Documentation

◆ m_mainframe

MainFrame& Slic3r::GUI::PlaterDropTarget::m_mainframe
private

Referenced by PlaterDropTarget(), and OnDropFiles().

◆ m_plater

Plater& Slic3r::GUI::PlaterDropTarget::m_plater
private

Referenced by PlaterDropTarget(), and OnDropFiles().


The documentation for this class was generated from the following file:
  • /home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/Plater.cpp