diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 4b335d5bcc..579362555a 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -2699,6 +2699,7 @@ void GLCanvas3D::LegendTexture::render(const GLCanvas3D& canvas) const } } +wxDEFINE_EVENT(EVT_GLCANVAS_SCHEDULE_BACKGROUND_PROCESS, SimpleEvent); #if ENABLE_EXTENDED_SELECTION wxDEFINE_EVENT(EVT_GLCANVAS_OBJECT_SELECT, SimpleEvent); #else @@ -6547,7 +6548,7 @@ void GLCanvas3D::_on_rotate() } } -// schedule_background_process + post_event(SimpleEvent(EVT_GLCANVAS_SCHEDULE_BACKGROUND_PROCESS)); } void GLCanvas3D::_on_scale() @@ -6581,7 +6582,7 @@ void GLCanvas3D::_on_scale() } } - // schedule_background_process + post_event(SimpleEvent(EVT_GLCANVAS_SCHEDULE_BACKGROUND_PROCESS)); } void GLCanvas3D::_on_flatten() @@ -6621,7 +6622,7 @@ void GLCanvas3D::_on_mirror() } } - // schedule_background_process + post_event(SimpleEvent(EVT_GLCANVAS_SCHEDULE_BACKGROUND_PROCESS)); } #endif // ENABLE_MIRROR #else diff --git a/src/slic3r/GUI/GLCanvas3D.hpp b/src/slic3r/GUI/GLCanvas3D.hpp index 8c889e2a22..c0f531919f 100644 --- a/src/slic3r/GUI/GLCanvas3D.hpp +++ b/src/slic3r/GUI/GLCanvas3D.hpp @@ -104,7 +104,7 @@ template using Vec2dsEvent = ArrayEvent; using Vec3dEvent = Event; template using Vec3dsEvent = ArrayEvent; - +wxDECLARE_EVENT(EVT_GLCANVAS_SCHEDULE_BACKGROUND_PROCESS, SimpleEvent); wxDECLARE_EVENT(EVT_GLCANVAS_VIEWPORT_CHANGED, SimpleEvent); #if !ENABLE_EXTENDED_SELECTION wxDECLARE_EVENT(EVT_GLCANVAS_DOUBLE_CLICK, SimpleEvent); @@ -732,6 +732,7 @@ private: void post_event(wxEvent &&event); void viewport_changed(); + public: GLCanvas3D(wxGLCanvas* canvas); ~GLCanvas3D(); diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 4106fa6350..c307bf2cf8 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -822,6 +822,8 @@ struct Plater::priv void on_process_completed(wxCommandEvent&); void on_layer_editing_toggled(bool enable); + void on_schedule_background_process(SimpleEvent&); + void on_action_add(SimpleEvent&); void on_action_split_objects(SimpleEvent&); void on_action_split_volumes(SimpleEvent&); @@ -946,6 +948,7 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame) : sidebar->Bind(wxEVT_COMBOBOX, &priv::on_select_preset, this); // 3DScene events: + canvas3D->Bind(EVT_GLCANVAS_SCHEDULE_BACKGROUND_PROCESS, &priv::on_schedule_background_process, this); canvas3D->Bind(EVT_GLCANVAS_OBJECT_SELECT, &priv::on_object_select, this); canvas3D->Bind(EVT_GLCANVAS_VIEWPORT_CHANGED, &priv::on_viewport_changed, this); #if !ENABLE_EXTENDED_SELECTION @@ -1867,6 +1870,11 @@ void Plater::priv::on_layer_editing_toggled(bool enable) canvas3D->Update(); } +void Plater::priv::on_schedule_background_process(SimpleEvent&) +{ + schedule_background_process(); +} + void Plater::priv::on_action_add(SimpleEvent&) { if (q != nullptr) diff --git a/src/slic3r/GUI/Plater.hpp b/src/slic3r/GUI/Plater.hpp index ab912f5e3a..7ea5b19643 100644 --- a/src/slic3r/GUI/Plater.hpp +++ b/src/slic3r/GUI/Plater.hpp @@ -89,7 +89,6 @@ private: std::unique_ptr p; }; - class Plater: public wxPanel { public: