Printbed axes renderable on demand
This commit is contained in:
parent
a3ff1b4282
commit
3537f74936
@ -171,6 +171,7 @@ void Bed3D::Axes::render() const
|
|||||||
glsafe(::glPopMatrix());
|
glsafe(::glPopMatrix());
|
||||||
|
|
||||||
glsafe(::glDisable(GL_LIGHTING));
|
glsafe(::glDisable(GL_LIGHTING));
|
||||||
|
glsafe(::glDisable(GL_DEPTH_TEST));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Bed3D::Axes::render_axis(double length) const
|
void Bed3D::Axes::render_axis(double length) const
|
||||||
@ -264,12 +265,15 @@ Point Bed3D::point_projection(const Point& point) const
|
|||||||
return m_polygon.point_projection(point);
|
return m_polygon.point_projection(point);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Bed3D::render(GLCanvas3D& canvas, float theta, float scale_factor) const
|
void Bed3D::render(GLCanvas3D& canvas, float theta, float scale_factor, bool show_axes) const
|
||||||
{
|
{
|
||||||
m_scale_factor = scale_factor;
|
m_scale_factor = scale_factor;
|
||||||
|
|
||||||
|
if (show_axes)
|
||||||
render_axes();
|
render_axes();
|
||||||
|
|
||||||
|
glsafe(::glEnable(GL_DEPTH_TEST));
|
||||||
|
|
||||||
switch (m_type)
|
switch (m_type)
|
||||||
{
|
{
|
||||||
case MK2: { render_prusa(canvas, "mk2", theta > 90.0f); break; }
|
case MK2: { render_prusa(canvas, "mk2", theta > 90.0f); break; }
|
||||||
@ -280,6 +284,8 @@ void Bed3D::render(GLCanvas3D& canvas, float theta, float scale_factor) const
|
|||||||
default:
|
default:
|
||||||
case Custom: { render_custom(canvas, theta > 90.0f); break; }
|
case Custom: { render_custom(canvas, theta > 90.0f); break; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
glsafe(::glDisable(GL_DEPTH_TEST));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Bed3D::calc_bounding_boxes() const
|
void Bed3D::calc_bounding_boxes() const
|
||||||
|
@ -112,7 +112,7 @@ public:
|
|||||||
bool contains(const Point& point) const;
|
bool contains(const Point& point) const;
|
||||||
Point point_projection(const Point& point) const;
|
Point point_projection(const Point& point) const;
|
||||||
|
|
||||||
void render(GLCanvas3D& canvas, float theta, float scale_factor) const;
|
void render(GLCanvas3D& canvas, float theta, float scale_factor, bool show_axes) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void calc_bounding_boxes() const;
|
void calc_bounding_boxes() const;
|
||||||
|
@ -1861,7 +1861,7 @@ void GLCanvas3D::render()
|
|||||||
_render_objects();
|
_render_objects();
|
||||||
_render_sla_slices();
|
_render_sla_slices();
|
||||||
_render_selection();
|
_render_selection();
|
||||||
_render_bed(theta);
|
_render_bed(theta, true);
|
||||||
|
|
||||||
#if ENABLE_RENDER_SELECTION_CENTER
|
#if ENABLE_RENDER_SELECTION_CENTER
|
||||||
_render_selection_center();
|
_render_selection_center();
|
||||||
@ -4707,13 +4707,13 @@ void GLCanvas3D::_render_background() const
|
|||||||
glsafe(::glPopMatrix());
|
glsafe(::glPopMatrix());
|
||||||
}
|
}
|
||||||
|
|
||||||
void GLCanvas3D::_render_bed(float theta) const
|
void GLCanvas3D::_render_bed(float theta, bool show_axes) const
|
||||||
{
|
{
|
||||||
float scale_factor = 1.0;
|
float scale_factor = 1.0;
|
||||||
#if ENABLE_RETINA_GL
|
#if ENABLE_RETINA_GL
|
||||||
scale_factor = m_retina_helper->get_scale_factor();
|
scale_factor = m_retina_helper->get_scale_factor();
|
||||||
#endif // ENABLE_RETINA_GL
|
#endif // ENABLE_RETINA_GL
|
||||||
m_bed.render(const_cast<GLCanvas3D&>(*this), theta, scale_factor);
|
m_bed.render(const_cast<GLCanvas3D&>(*this), theta, scale_factor, show_axes);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GLCanvas3D::_render_objects() const
|
void GLCanvas3D::_render_objects() const
|
||||||
|
@ -703,7 +703,7 @@ private:
|
|||||||
void _picking_pass() const;
|
void _picking_pass() const;
|
||||||
void _rectangular_selection_picking_pass() const;
|
void _rectangular_selection_picking_pass() const;
|
||||||
void _render_background() const;
|
void _render_background() const;
|
||||||
void _render_bed(float theta) const;
|
void _render_bed(float theta, bool show_axes) const;
|
||||||
void _render_objects() const;
|
void _render_objects() const;
|
||||||
void _render_selection() const;
|
void _render_selection() const;
|
||||||
#if ENABLE_RENDER_SELECTION_CENTER
|
#if ENABLE_RENDER_SELECTION_CENTER
|
||||||
|
Loading…
Reference in New Issue
Block a user