From 20fd2f99a7b8467e0676fb176d59f130e9ae6ab8 Mon Sep 17 00:00:00 2001 From: Enrico Turri Date: Mon, 4 Mar 2019 10:44:40 +0100 Subject: [PATCH 1/6] Removed reset of gcode preview from schedule_background_process() --- src/slic3r/GUI/Plater.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 7a41e06e5fa..87b41c23855 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -1997,9 +1997,6 @@ void Plater::priv::schedule_background_process() this->background_process_timer.Start(500, wxTIMER_ONE_SHOT); // Notify the Canvas3D that something has changed, so it may invalidate some of the layer editing stuff. this->view3D->get_canvas3d()->set_config(this->config); - // Reset gcode preview - this->preview->get_canvas3d()->reset_volumes(); - this->preview->get_canvas3d()->reset_legend_texture(); } void Plater::priv::update_print_volume_state() From d14aa2174f36b21d71893b2f291541d7735a0ea3 Mon Sep 17 00:00:00 2001 From: Enrico Turri Date: Mon, 4 Mar 2019 11:00:52 +0100 Subject: [PATCH 2/6] Allow to drag object's subparts once selected using the sidebar table --- src/slic3r/GUI/GLCanvas3D.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index b51662325f3..29d72687b4b 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -896,7 +896,11 @@ void GLCanvas3D::Selection::add(unsigned int volume_idx, bool as_single_selectio if (needs_reset) clear(); - m_mode = volume->is_modifier ? Volume : Instance; + if (volume->is_modifier) + m_mode = Volume; + else if (!contains_volume(volume_idx)) + m_mode = Instance; + // else -> keep current mode switch (m_mode) { From 44d374c7d2592bf1f592f3482bac3d89dbf91ce5 Mon Sep 17 00:00:00 2001 From: Maeyanie Date: Sat, 2 Mar 2019 01:40:24 -0500 Subject: [PATCH 3/6] Fix compile error At least on my system (Fedora 28) gcc gave a compile error for std::vector being used here despite being undefined. Adding the appropriate include fixes the problem, and seems unlikely to cause any other problems. --- src/slic3r/GUI/KBShortcutsDialog.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/slic3r/GUI/KBShortcutsDialog.hpp b/src/slic3r/GUI/KBShortcutsDialog.hpp index c5f60f0b8f0..d8905e1ce48 100644 --- a/src/slic3r/GUI/KBShortcutsDialog.hpp +++ b/src/slic3r/GUI/KBShortcutsDialog.hpp @@ -3,6 +3,7 @@ #include #include +#include namespace Slic3r { namespace GUI { From ede684f8ab753c43e2f942f32b5c60627a1c8c14 Mon Sep 17 00:00:00 2001 From: Maeyanie Date: Sat, 2 Mar 2019 01:45:20 -0500 Subject: [PATCH 4/6] Fix compile error, part 2 Another undefined use of std::vector --- src/slic3r/GUI/GUI_ObjectSettings.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/slic3r/GUI/GUI_ObjectSettings.hpp b/src/slic3r/GUI/GUI_ObjectSettings.hpp index 3e72713bfb8..12115e2081a 100644 --- a/src/slic3r/GUI/GUI_ObjectSettings.hpp +++ b/src/slic3r/GUI/GUI_ObjectSettings.hpp @@ -2,6 +2,7 @@ #define slic3r_GUI_ObjectSettings_hpp_ #include +#include #include class wxBoxSizer; From 7d3e1abd4e4d2dc3873c408282eb5ba0d130b10b Mon Sep 17 00:00:00 2001 From: bubnikv Date: Mon, 4 Mar 2019 12:21:00 +0100 Subject: [PATCH 5/6] ImGUI wrapper text and combo methods shall accept std::string in UTF8 format. --- src/slic3r/GUI/ImGuiWrapper.cpp | 31 +++++++++++++++++++++++++++++-- src/slic3r/GUI/ImGuiWrapper.hpp | 3 +++ 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/ImGuiWrapper.cpp b/src/slic3r/GUI/ImGuiWrapper.cpp index 7f95b6c2851..78a3f9db878 100644 --- a/src/slic3r/GUI/ImGuiWrapper.cpp +++ b/src/slic3r/GUI/ImGuiWrapper.cpp @@ -239,10 +239,19 @@ bool ImGuiWrapper::checkbox(const wxString &label, bool &value) return ImGui::Checkbox(label_utf8.c_str(), &value); } +void ImGuiWrapper::text(const char *label) +{ + ImGui::Text(label, NULL); +} + +void ImGuiWrapper::text(const std::string &label) +{ + this->text(label.c_str()); +} + void ImGuiWrapper::text(const wxString &label) { - auto label_utf8 = into_u8(label); - ImGui::Text(label_utf8.c_str(), NULL); + this->text(into_u8(label).c_str()); } @@ -267,6 +276,24 @@ bool ImGuiWrapper::combo(const wxString& label, const std::vector& opt return false; } +bool ImGuiWrapper::combo(const wxString& label, const std::vector& options, std::string& selection) +{ + // this is to force the label to the left of the widget: + text(label); + ImGui::SameLine(); + + if (ImGui::BeginCombo("", selection.c_str())) { + for (const std::string& option : options) { + bool is_selected = (selection.empty()) ? false : (option == selection); + if (ImGui::Selectable(option.c_str(), is_selected)) + selection = option; + } + ImGui::EndCombo(); + return true; + } + return false; +} + void ImGuiWrapper::disabled_begin(bool disabled) { wxCHECK_RET(!m_disabled, "ImGUI: Unbalanced disabled_begin() call"); diff --git a/src/slic3r/GUI/ImGuiWrapper.hpp b/src/slic3r/GUI/ImGuiWrapper.hpp index 2cadc773cae..8698b480d52 100644 --- a/src/slic3r/GUI/ImGuiWrapper.hpp +++ b/src/slic3r/GUI/ImGuiWrapper.hpp @@ -57,7 +57,10 @@ public: bool input_double(const std::string &label, const double &value, const std::string &format = "%.3f"); bool input_vec3(const std::string &label, const Vec3d &value, float width, const std::string &format = "%.3f"); bool checkbox(const wxString &label, bool &value); + void text(const const char *label); + void text(const std::string &label); void text(const wxString &label); + bool combo(const wxString& label, const std::vector& options, std::string& current_selection); bool combo(const wxString& label, const std::vector& options, wxString& current_selection); void disabled_begin(bool disabled); From 9e1ce4fc54fa8c8e4ef915e2f16e6c981686f9fc Mon Sep 17 00:00:00 2001 From: bubnikv Date: Mon, 4 Mar 2019 12:59:20 +0100 Subject: [PATCH 6/6] Fixed a typo --- src/slic3r/GUI/ImGuiWrapper.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/slic3r/GUI/ImGuiWrapper.hpp b/src/slic3r/GUI/ImGuiWrapper.hpp index 8698b480d52..333b66ed440 100644 --- a/src/slic3r/GUI/ImGuiWrapper.hpp +++ b/src/slic3r/GUI/ImGuiWrapper.hpp @@ -57,7 +57,7 @@ public: bool input_double(const std::string &label, const double &value, const std::string &format = "%.3f"); bool input_vec3(const std::string &label, const Vec3d &value, float width, const std::string &format = "%.3f"); bool checkbox(const wxString &label, bool &value); - void text(const const char *label); + void text(const char *label); void text(const std::string &label); void text(const wxString &label); bool combo(const wxString& label, const std::vector& options, std::string& current_selection);