diff --git a/src/slic3r/GUI/3DBed.cpp b/src/slic3r/GUI/3DBed.cpp index 742941b845..2cc9de38cb 100644 --- a/src/slic3r/GUI/3DBed.cpp +++ b/src/slic3r/GUI/3DBed.cpp @@ -259,7 +259,8 @@ Point Bed3D::point_projection(const Point& point) const return m_polygon.point_projection(point); } -void Bed3D::render(GLCanvas3D& canvas, bool bottom, float scale_factor, bool show_axes) const +void Bed3D::render(GLCanvas3D& canvas, bool bottom, float scale_factor, + bool show_axes, bool show_texture) const { m_scale_factor = scale_factor; @@ -270,9 +271,9 @@ void Bed3D::render(GLCanvas3D& canvas, bool bottom, float scale_factor, bool sho switch (m_type) { - case System: { render_system(canvas, bottom); break; } + case System: { render_system(canvas, bottom, show_texture); break; } default: - case Custom: { render_custom(canvas, bottom); break; } + case Custom: { render_custom(canvas, bottom, show_texture); break; } } glsafe(::glDisable(GL_DEPTH_TEST)); @@ -384,12 +385,13 @@ void Bed3D::render_axes() const m_axes.render(); } -void Bed3D::render_system(GLCanvas3D& canvas, bool bottom) const +void Bed3D::render_system(GLCanvas3D& canvas, bool bottom, bool show_texture) const { if (!bottom) render_model(); - render_texture(bottom, canvas); + if (show_texture) + render_texture(bottom, canvas); } void Bed3D::render_texture(bool bottom, GLCanvas3D& canvas) const @@ -564,7 +566,7 @@ void Bed3D::render_model() const } } -void Bed3D::render_custom(GLCanvas3D& canvas, bool bottom) const +void Bed3D::render_custom(GLCanvas3D& canvas, bool bottom, bool show_texture) const { if (m_texture_filename.empty() && m_model_filename.empty()) { @@ -575,7 +577,8 @@ void Bed3D::render_custom(GLCanvas3D& canvas, bool bottom) const if (!bottom) render_model(); - render_texture(bottom, canvas); + if (show_texture) + render_texture(bottom, canvas); } void Bed3D::render_default(bool bottom) const diff --git a/src/slic3r/GUI/3DBed.hpp b/src/slic3r/GUI/3DBed.hpp index 3a5f959788..abdfca1fe0 100644 --- a/src/slic3r/GUI/3DBed.hpp +++ b/src/slic3r/GUI/3DBed.hpp @@ -103,11 +103,15 @@ public: // Return true if the bed shape changed, so the calee will update the UI. bool set_shape(const Pointfs& shape, const std::string& custom_texture, const std::string& custom_model); - const BoundingBoxf3& get_bounding_box(bool extended) const { return extended ? m_extended_bounding_box : m_bounding_box; } + const BoundingBoxf3& get_bounding_box(bool extended) const { + return extended ? m_extended_bounding_box : m_bounding_box; + } + bool contains(const Point& point) const; Point point_projection(const Point& point) const; - void render(GLCanvas3D& canvas, bool bottom, float scale_factor, bool show_axes) const; + void render(GLCanvas3D& canvas, bool bottom, float scale_factor, + bool show_axes, bool show_texture) const; private: void calc_bounding_boxes() const; @@ -115,10 +119,10 @@ private: void calc_gridlines(const ExPolygon& poly, const BoundingBox& bed_bbox); std::tuple detect_type(const Pointfs& shape) const; void render_axes() const; - void render_system(GLCanvas3D& canvas, bool bottom) const; + void render_system(GLCanvas3D& canvas, bool bottom, bool show_texture) const; void render_texture(bool bottom, GLCanvas3D& canvas) const; void render_model() const; - void render_custom(GLCanvas3D& canvas, bool bottom) const; + void render_custom(GLCanvas3D& canvas, bool bottom, bool show_texture) const; void render_default(bool bottom) const; void reset(); }; diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 9127fcaf4a..48243857ec 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -5339,14 +5339,19 @@ void GLCanvas3D::_render_background() const glsafe(::glPopMatrix()); } -void GLCanvas3D::_render_bed(float theta, bool show_axes) const +void GLCanvas3D::_render_bed(bool bottom, bool show_axes) const { float scale_factor = 1.0; #if ENABLE_RETINA_GL scale_factor = m_retina_helper->get_scale_factor(); #endif // ENABLE_RETINA_GL + + bool show_texture = ! bottom || + (m_gizmos.get_current_type() != GLGizmosManager::FdmSupports + && m_gizmos.get_current_type() != GLGizmosManager::SlaSupports); + #if ENABLE_NON_STATIC_CANVAS_MANAGER - wxGetApp().plater()->get_bed().render(const_cast(*this), theta, scale_factor, show_axes); + wxGetApp().plater()->get_bed().render(const_cast(*this), bottom, scale_factor, show_axes, show_texture); #else m_bed.render(const_cast(*this), theta, scale_factor, show_axes); #endif // ENABLE_NON_STATIC_CANVAS_MANAGER diff --git a/src/slic3r/GUI/GLCanvas3D.hpp b/src/slic3r/GUI/GLCanvas3D.hpp index 07fa00b9d9..c7d4f4a064 100644 --- a/src/slic3r/GUI/GLCanvas3D.hpp +++ b/src/slic3r/GUI/GLCanvas3D.hpp @@ -755,7 +755,7 @@ private: void _picking_pass() const; void _rectangular_selection_picking_pass() const; void _render_background() const; - void _render_bed(float theta, bool show_axes) const; + void _render_bed(bool bottom, bool show_axes) const; void _render_objects() const; void _render_selection() const; #if ENABLE_RENDER_SELECTION_CENTER