From f6a3421e2a77f61b3867b2474dce55b9cc3aa4b6 Mon Sep 17 00:00:00 2001 From: Filip Sykala Date: Thu, 19 Oct 2023 19:52:25 +0800 Subject: [PATCH] =?UTF-8?q?=EF=BB=BFremove=20GLModel=20from=20base=20class?= =?UTF-8?q?=20-=20only=202=20gizmo=20use=20cone?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit prusa3d/PrusaSlicer@3c7390e34e903514d6a15fb3a910d37287ed9855) (cherry picked from commit 4647fc49ef5b925432e087252f32a6601d0410da) --- src/slic3r/GUI/Gizmos/GLGizmoBase.cpp | 3 --- src/slic3r/GUI/Gizmos/GLGizmoBase.hpp | 3 --- src/slic3r/GUI/Gizmos/GLGizmoRotate.cpp | 1 + src/slic3r/GUI/Gizmos/GLGizmoRotate.hpp | 2 ++ src/slic3r/GUI/Gizmos/GLGizmoSlaSupports.cpp | 8 +++++--- src/slic3r/GUI/Gizmos/GLGizmoSlaSupports.hpp | 4 ++++ 6 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/slic3r/GUI/Gizmos/GLGizmoBase.cpp b/src/slic3r/GUI/Gizmos/GLGizmoBase.cpp index 75efc8902b..588e8ce58b 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoBase.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoBase.cpp @@ -161,9 +161,6 @@ GLGizmoBase::GLGizmoBase(GLCanvas3D& parent, const std::string& icon_filename, u m_base_color = DEFAULT_BASE_COLOR; m_drag_color = DEFAULT_DRAG_COLOR; m_highlight_color = DEFAULT_HIGHLIGHT_COLOR; - m_cone.init_from(its_make_cone(1., 1., 2 * PI / 24)); - m_sphere.init_from(its_make_sphere(1., (2 * M_PI) / 24.)); - m_cylinder.init_from(its_make_cylinder(1., 1., 2 * PI / 24.)); } void GLGizmoBase::set_icon_filename(const std::string &filename) { diff --git a/src/slic3r/GUI/Gizmos/GLGizmoBase.hpp b/src/slic3r/GUI/Gizmos/GLGizmoBase.hpp index 1dea8f08d4..a858954b47 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoBase.hpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoBase.hpp @@ -123,9 +123,6 @@ protected: bool m_first_input_window_render; mutable std::string m_tooltip; CommonGizmosDataPool* m_c; - GLModel m_cone; - GLModel m_cylinder; - GLModel m_sphere; bool m_is_dark_mode = false; diff --git a/src/slic3r/GUI/Gizmos/GLGizmoRotate.cpp b/src/slic3r/GUI/Gizmos/GLGizmoRotate.cpp index 124e370a36..4a142ba926 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoRotate.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoRotate.cpp @@ -76,6 +76,7 @@ std::string GLGizmoRotate::get_tooltip() const bool GLGizmoRotate::on_init() { + m_cone.init_from(its_make_cone(1., 1., 2 * PI / 24)); m_grabbers.push_back(Grabber()); return true; } diff --git a/src/slic3r/GUI/Gizmos/GLGizmoRotate.hpp b/src/slic3r/GUI/Gizmos/GLGizmoRotate.hpp index 9862ec2901..0f426f26f4 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoRotate.hpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoRotate.hpp @@ -43,6 +43,8 @@ private: mutable float m_snap_fine_in_radius; mutable float m_snap_fine_out_radius; + GLModel m_cone; + public: GLGizmoRotate(GLCanvas3D& parent, Axis axis); GLGizmoRotate(const GLGizmoRotate& other); diff --git a/src/slic3r/GUI/Gizmos/GLGizmoSlaSupports.cpp b/src/slic3r/GUI/Gizmos/GLGizmoSlaSupports.cpp index 94175aef9d..8cef43e595 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoSlaSupports.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoSlaSupports.cpp @@ -28,9 +28,7 @@ namespace GUI { GLGizmoSlaSupports::GLGizmoSlaSupports(GLCanvas3D& parent, const std::string& icon_filename, unsigned int sprite_id) : GLGizmoBase(parent, icon_filename, sprite_id) -{ -} - +{} bool GLGizmoSlaSupports::on_init() { @@ -48,6 +46,10 @@ bool GLGizmoSlaSupports::on_init() m_desc["manual_editing"] = _L("Manual editing"); m_desc["clipping_of_view"] = _L("Clipping of view")+ ": "; m_desc["reset_direction"] = _L("Reset direction"); + + m_cone.init_from(its_make_cone(1., 1., 2 * PI / 24)); + m_cylinder.init_from(its_make_cylinder(1., 1., 2 * PI / 24.)); + m_sphere.init_from(its_make_sphere(1., (2 * M_PI) / 24.)); return true; } diff --git a/src/slic3r/GUI/Gizmos/GLGizmoSlaSupports.hpp b/src/slic3r/GUI/Gizmos/GLGizmoSlaSupports.hpp index 8dd76336a3..08d4874bdb 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoSlaSupports.hpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoSlaSupports.hpp @@ -80,6 +80,10 @@ private: void render_points(const Selection& selection, bool picking = false) const; bool unsaved_changes() const; + GLModel m_cone; + GLModel m_cylinder; + GLModel m_sphere; + bool m_lock_unique_islands = false; bool m_editing_mode = false; // Is editing mode active? float m_new_point_head_diameter; // Size of a new point.