Fixed build when ENABLE_GCODE_VIEWER is disabled

This commit is contained in:
enricoturri1966 2020-07-08 14:43:14 +02:00
parent 73b885fc37
commit 6fbb3db79c
3 changed files with 12 additions and 3 deletions

View File

@ -369,7 +369,6 @@ void Bed3D::calc_bounding_boxes() const
m_extended_bounding_box.merge(model_bb);
}
#else
m_extended_bounding_box.merge(m_axes.get_total_length() * Vec3d::Ones());
m_extended_bounding_box.merge(m_axes.length + Axes::ArrowLength * Vec3d::Ones());
// extend to contain model, if any
if (!m_model.get_filename().empty())
@ -694,11 +693,11 @@ void Bed3D::render_default(bool bottom) const
{
// draw background
glsafe(::glDepthMask(GL_FALSE));
#if ENABLE_LAYOUT_NO_RESTART
#if ENABLE_GCODE_VIEWER
glsafe(::glColor4fv(m_model_color.data()));
#else
glsafe(::glColor4f(0.35f, 0.35f, 0.35f, 0.4f));
#endif // ENABLE_LAYOUT_NO_RESTART
#endif // ENABLE_GCODE_VIEWER
glsafe(::glNormal3d(0.0f, 0.0f, 1.0f));
glsafe(::glVertexPointer(3, GL_FLOAT, m_triangles.get_vertex_data_size(), (GLvoid*)m_triangles.get_vertices_data()));
glsafe(::glDrawArrays(GL_TRIANGLES, 0, (GLsizei)triangles_vcount));

View File

@ -482,9 +482,11 @@ void MainFrame::shutdown()
#endif // ENABLE_LAYOUT_NO_RESTART
if (m_plater != nullptr) {
#if ENABLE_GCODE_VIEWER_AS_STATE
// restore sidebar if it was hidden when switching to gcode viewer mode
if (m_restore_from_gcode_viewer.collapsed_sidebar)
m_plater->collapse_sidebar(false);
#endif // ENABLE_GCODE_VIEWER_AS_STATE
// Stop the background thread (Windows and Linux).
// Disconnect from a 3DConnextion driver (OSX).
m_plater->get_mouse3d_controller().shutdown();

View File

@ -2039,11 +2039,19 @@ void Selection::render_sidebar_scale_hints(const std::string& sidebar_field) con
shader->set_uniform("uniform_color", uniform_scale ? UNIFORM_SCALE_COLOR : AXES_COLOR[axis], 4);
glsafe(::glTranslated(0.0, 5.0, 0.0));
#if ENABLE_GCODE_VIEWER
m_arrow.render();
#else
m_arrow->render();
#endif // ENABLE_GCODE_VIEWER
glsafe(::glTranslated(0.0, -10.0, 0.0));
glsafe(::glRotated(180.0, 0.0, 0.0, 1.0));
#if ENABLE_GCODE_VIEWER
m_arrow.render();
#else
m_arrow->render();
#endif // ENABLE_GCODE_VIEWER
};
if (boost::ends_with(sidebar_field, "x") || uniform_scale)