Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLukas Matena <lukasmatena@seznam.cz>2020-04-14 14:18:08 +0300
committerLukas Matena <lukasmatena@seznam.cz>2020-04-14 14:18:08 +0300
commit46ade45ced5511cbee401ebd9266fcd5e4008a2c (patch)
tree762f3f16da3a585841b8c40b8f4f0c76856f9dcb /src
parentebcc8ef7c21eb04fbb9d935969485de58d9a11b8 (diff)
The bed texture is not shown when looking from below and FDM/SLA support gizmo is active
Diffstat (limited to 'src')
-rw-r--r--src/slic3r/GUI/3DBed.cpp17
-rw-r--r--src/slic3r/GUI/3DBed.hpp12
-rw-r--r--src/slic3r/GUI/GLCanvas3D.cpp9
-rw-r--r--src/slic3r/GUI/GLCanvas3D.hpp2
4 files changed, 26 insertions, 14 deletions
diff --git a/src/slic3r/GUI/3DBed.cpp b/src/slic3r/GUI/3DBed.cpp
index 742941b84..2cc9de38c 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 3a5f95978..abdfca1fe 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<EType, std::string, std::string> 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 9127fcaf4..48243857e 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<GLCanvas3D&>(*this), theta, scale_factor, show_axes);
+ wxGetApp().plater()->get_bed().render(const_cast<GLCanvas3D&>(*this), bottom, scale_factor, show_axes, show_texture);
#else
m_bed.render(const_cast<GLCanvas3D&>(*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 07fa00b9d..c7d4f4a06 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