ENABLE_SLOPE_RENDERING set as default

Slope rendering active only when using Gizmo FDM supports
This commit is contained in:
enricoturri1966 2020-10-02 15:43:39 +02:00
parent 38ddc5fdc4
commit 0f44caa99c
14 changed files with 30 additions and 221 deletions

View File

@ -9,8 +9,7 @@ const float EPSILON = 0.0001;
struct SlopeDetection
{
bool actived;
// x = yellow, y = red
vec2 z_range;
float normal_z;
mat3 volume_world_normal_matrix;
};
@ -33,8 +32,7 @@ varying vec3 eye_normal;
vec3 slope_color()
{
float gradient_range = slope.z_range.x - slope.z_range.y;
return (world_normal_z > slope.z_range.x - EPSILON) ? GREEN : ((gradient_range == 0.0) ? RED : mix(RED, YELLOW, clamp((world_normal_z - slope.z_range.y) / gradient_range, 0.0, 1.0)));
return (world_normal_z > slope.normal_z - EPSILON) ? GREEN : RED;
}
void main()

View File

@ -29,8 +29,7 @@ struct PrintBoxDetection
struct SlopeDetection
{
bool actived;
// x = yellow, y = red
vec2 z_range;
float normal_z;
mat3 volume_world_normal_matrix;
};

View File

@ -39,9 +39,6 @@
//===================
#define ENABLE_2_3_0_ALPHA1 1
// Enable rendering of objects colored by facets' slope
#define ENABLE_SLOPE_RENDERING (1 && ENABLE_2_3_0_ALPHA1)
// Enable rendering of objects using environment map
#define ENABLE_ENVIRONMENT_MAP (1 && ENABLE_2_3_0_ALPHA1)

View File

@ -506,24 +506,6 @@ void GLVolume::render() const
glFrontFace(GL_CCW);
}
#if !ENABLE_SLOPE_RENDERING
void GLVolume::render(int color_id, int detection_id, int worldmatrix_id) const
{
if (color_id >= 0)
glsafe(::glUniform4fv(color_id, 1, (const GLfloat*)render_color));
else
glsafe(::glColor4fv(render_color));
if (detection_id != -1)
glsafe(::glUniform1i(detection_id, shader_outside_printer_detection_enabled ? 1 : 0));
if (worldmatrix_id != -1)
glsafe(::glUniformMatrix4fv(worldmatrix_id, 1, GL_FALSE, (const GLfloat*)world_matrix().cast<float>().data()));
render();
}
#endif // !ENABLE_SLOPE_RENDERING
bool GLVolume::is_sla_support() const { return this->composite_id.volume_id == -int(slaposSupportTree); }
bool GLVolume::is_sla_pad() const { return this->composite_id.volume_id == -int(slaposPad); }
@ -775,9 +757,7 @@ void GLVolumeCollection::render(GLVolumeCollection::ERenderType type, bool disab
shader->set_uniform("print_box.max", m_print_box_max, 3);
shader->set_uniform("z_range", m_z_range, 2);
shader->set_uniform("clipping_plane", m_clipping_plane, 4);
#if ENABLE_SLOPE_RENDERING
shader->set_uniform("slope.z_range", m_slope.z_range);
#endif // ENABLE_SLOPE_RENDERING
shader->set_uniform("slope.normal_z", m_slope.normal_z);
#if ENABLE_ENVIRONMENT_MAP
unsigned int environment_texture_id = GUI::wxGetApp().plater()->get_environment_texture_id();
@ -791,7 +771,6 @@ void GLVolumeCollection::render(GLVolumeCollection::ERenderType type, bool disab
GLVolumeWithIdAndZList to_render = volumes_to_render(this->volumes, type, view_matrix, filter_func);
for (GLVolumeWithIdAndZ& volume : to_render) {
volume.first->set_render_color();
#if ENABLE_SLOPE_RENDERING
shader->set_uniform("uniform_color", volume.first->render_color, 4);
shader->set_uniform("print_box.actived", volume.first->shader_outside_printer_detection_enabled);
shader->set_uniform("print_box.volume_world_matrix", volume.first->world_matrix());
@ -799,9 +778,6 @@ void GLVolumeCollection::render(GLVolumeCollection::ERenderType type, bool disab
shader->set_uniform("slope.volume_world_normal_matrix", static_cast<Matrix3f>(volume.first->world_matrix().matrix().block(0, 0, 3, 3).inverse().transpose().cast<float>()));
volume.first->render();
#else
volume.first->render(color_id, print_box_detection_id, print_box_worldmatrix_id);
#endif // ENABLE_SLOPE_RENDERING
}
#if ENABLE_ENVIRONMENT_MAP
@ -2020,12 +1996,8 @@ void GLModel::render() const
glsafe(::glEnableClientState(GL_VERTEX_ARRAY));
glsafe(::glEnableClientState(GL_NORMAL_ARRAY));
#if ENABLE_SLOPE_RENDERING
shader->set_uniform("uniform_color", m_volume.render_color, 4);
m_volume.render();
#else
m_volume.render(color_id, -1, -1);
#endif // ENABLE_SLOPE_RENDERING
glsafe(::glBindBuffer(GL_ARRAY_BUFFER, 0));
glsafe(::glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0));

View File

@ -447,9 +447,6 @@ public:
void set_range(double low, double high);
void render() const;
#if !ENABLE_SLOPE_RENDERING
void render(int color_id, int detection_id, int worldmatrix_id) const;
#endif // !ENABLE_SLOPE_RENDERING
void finalize_geometry(bool opengl_initialized) { this->indexed_vertex_array.finalize_geometry(opengl_initialized); }
void release_geometry() { this->indexed_vertex_array.release_geometry(); }
@ -494,26 +491,19 @@ private:
// plane coeffs for clipping in shaders
float m_clipping_plane[4];
#if ENABLE_SLOPE_RENDERING
struct Slope
{
// toggle for slope rendering
bool active{ false };
// [0] = yellow, [1] = red
std::array<float, 2> z_range;
float normal_z;
};
Slope m_slope;
#endif // ENABLE_SLOPE_RENDERING
public:
GLVolumePtrs volumes;
#if ENABLE_SLOPE_RENDERING
GLVolumeCollection() { set_default_slope_z_range(); }
#else
GLVolumeCollection() = default;
#endif // ENABLE_SLOPE_RENDERING
GLVolumeCollection() { set_default_slope_normal_z(); }
~GLVolumeCollection() { clear(); }
std::vector<int> load_object(
@ -572,14 +562,12 @@ public:
void set_z_range(float min_z, float max_z) { m_z_range[0] = min_z; m_z_range[1] = max_z; }
void set_clipping_plane(const double* coeffs) { m_clipping_plane[0] = coeffs[0]; m_clipping_plane[1] = coeffs[1]; m_clipping_plane[2] = coeffs[2]; m_clipping_plane[3] = coeffs[3]; }
#if ENABLE_SLOPE_RENDERING
bool is_slope_active() const { return m_slope.active; }
void set_slope_active(bool active) { m_slope.active = active; }
const std::array<float, 2>& get_slope_z_range() const { return m_slope.z_range; }
void set_slope_z_range(const std::array<float, 2>& range) { m_slope.z_range = range; }
void set_default_slope_z_range() { m_slope.z_range = { -::cos(Geometry::deg2rad(90.0f - 45.0f)), -::cos(Geometry::deg2rad(90.0f - 70.0f)) }; }
#endif // ENABLE_SLOPE_RENDERING
float get_slope_normal_z() const { return m_slope.normal_z; }
void set_slope_normal_z(float normal_z) { m_slope.normal_z = normal_z; }
void set_default_slope_normal_z() { m_slope.normal_z = -::cos(Geometry::deg2rad(90.0f - 45.0f)); }
// returns true if all the volumes are completely contained in the print volume
// returns the containment state in the given out_state, if non-null

View File

@ -1414,7 +1414,7 @@ void GLCanvas3D::Tooltip::render(const Vec2d& mouse_position, GLCanvas3D& canvas
ImGui::PushStyleVar(ImGuiStyleVar_Alpha, alpha);
imgui.set_next_window_pos(position(0), position(1), ImGuiCond_Always, 0.0f, 0.0f);
imgui.begin(_(L("canvas_tooltip")), ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoMouseInputs | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoFocusOnAppearing);
imgui.begin(_L("canvas_tooltip"), ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoMouseInputs | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoFocusOnAppearing);
ImGui::BringWindowToDisplayFront(ImGui::GetCurrentWindow());
ImGui::TextUnformatted(m_text.c_str());
@ -1428,83 +1428,8 @@ void GLCanvas3D::Tooltip::render(const Vec2d& mouse_position, GLCanvas3D& canvas
ImGui::PopStyleVar(2);
}
#if ENABLE_SLOPE_RENDERING
float GLCanvas3D::Slope::s_window_width;
void GLCanvas3D::Slope::show_dialog(bool show) {
if (show && is_used())
return; use(show);
m_dialog_shown = show;
wxGetApp().plater()->get_notification_manager()->set_move_from_slope(show);
}
void GLCanvas3D::Slope::render() const
{
if (m_dialog_shown) {
const std::array<float, 2>& z_range = m_volumes.get_slope_z_range();
std::array<float, 2> angle_range = { Geometry::rad2deg(::acos(z_range[0])) - 90.0f, Geometry::rad2deg(::acos(z_range[1])) - 90.0f };
bool modified = false;
ImGuiWrapper& imgui = *wxGetApp().imgui();
const Size& cnv_size = m_canvas.get_canvas_size();
imgui.set_next_window_pos((float)cnv_size.get_width(), (float)cnv_size.get_height(), ImGuiCond_Always, 1.0f, 1.0f);
imgui.begin(_L("Slope visualization"), nullptr, ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoCollapse);
imgui.text(_L("Facets' slope range (degrees)") + ":");
ImGui::PushStyleColor(ImGuiCol_FrameBg, ImVec4(0.75f, 0.0f, 0.0f, 0.5f));
ImGui::PushStyleColor(ImGuiCol_FrameBgHovered, ImVec4(1.0f, 0.0f, 0.0f, 0.5f));
ImGui::PushStyleColor(ImGuiCol_FrameBgActive, ImVec4(0.85f, 0.0f, 0.0f, 0.5f));
ImGui::PushStyleColor(ImGuiCol_SliderGrab, ImVec4(0.25f, 0.0f, 0.0f, 1.0f));
// angle_range is range of normal angle, GUI should
// show facet slope angle
float slope_bound = 90.f - angle_range[1];
bool mod = ImGui::SliderFloat("##red", &slope_bound, 0.0f, 90.0f, "%.1f");
angle_range[1] = 90.f - slope_bound;
if (mod) {
modified = true;
if (angle_range[0] > angle_range[1])
angle_range[0] = angle_range[1];
}
ImGui::PopStyleColor(4);
ImGui::PushStyleColor(ImGuiCol_FrameBg, ImVec4(0.75f, 0.75f, 0.0f, 0.5f));
ImGui::PushStyleColor(ImGuiCol_FrameBgHovered, ImVec4(1.0f, 1.0f, 0.0f, 0.5f));
ImGui::PushStyleColor(ImGuiCol_FrameBgActive, ImVec4(0.85f, 0.85f, 0.0f, 0.5f));
ImGui::PushStyleColor(ImGuiCol_SliderGrab, ImVec4(0.25f, 0.25f, 0.0f, 1.0f));
slope_bound = 90.f - angle_range[0];
mod = ImGui::SliderFloat("##yellow", &slope_bound, 0.0f, 90.0f, "%.1f");
angle_range[0] = 90.f - slope_bound;
if (mod) {
modified = true;
if (angle_range[1] < angle_range[0])
angle_range[1] = angle_range[0];
}
ImGui::PopStyleColor(4);
ImGui::Separator();
if (imgui.button(_(L("Default"))))
m_volumes.set_default_slope_z_range();
// to let the dialog immediately showup without waiting for a mouse move
if (ImGui::GetWindowContentRegionWidth() + 2.0f * ImGui::GetStyle().WindowPadding.x != ImGui::CalcWindowExpectedSize(ImGui::GetCurrentWindow()).x)
m_canvas.request_extra_frame();
s_window_width = ImGui::GetWindowSize().x;
imgui.end();
if (modified)
set_range(angle_range);
}
}
#endif // ENABLE_SLOPE_RENDERING
wxDEFINE_EVENT(EVT_GLCANVAS_SCHEDULE_BACKGROUND_PROCESS, SimpleEvent);
wxDEFINE_EVENT(EVT_GLCANVAS_OBJECT_SELECT, SimpleEvent);
wxDEFINE_EVENT(EVT_GLCANVAS_RIGHT_CLICK, RBtnEvent);
@ -1577,9 +1502,7 @@ GLCanvas3D::GLCanvas3D(wxGLCanvas* canvas)
#endif // ENABLE_RENDER_PICKING_PASS
, m_render_sla_auxiliaries(true)
, m_labels(*this)
#if ENABLE_SLOPE_RENDERING
, m_slope(*this, m_volumes)
#endif // ENABLE_SLOPE_RENDERING
{
if (m_canvas != nullptr) {
m_timer.SetOwner(m_canvas);
@ -1887,11 +1810,6 @@ bool GLCanvas3D::is_reload_delayed() const
void GLCanvas3D::enable_layers_editing(bool enable)
{
#if ENABLE_SLOPE_RENDERING
if (enable && m_slope.is_dialog_shown())
m_slope.show_dialog(false);
#endif // ENABLE_SLOPE_RENDERING
m_layers_editing.set_enabled(enable);
const Selection::IndicesList& idxs = m_selection.get_volume_idxs();
for (unsigned int idx : idxs)
@ -3105,17 +3023,6 @@ void GLCanvas3D::on_char(wxKeyEvent& evt)
case 'a': { post_event(SimpleEvent(EVT_GLCANVAS_ARRANGE)); break; }
case 'B':
case 'b': { zoom_to_bed(); break; }
#if ENABLE_SLOPE_RENDERING
case 'D':
case 'd': {
if (!is_layers_editing_enabled())
{
m_slope.show_dialog(!m_slope.is_dialog_shown());
m_dirty = true;
}
break;
}
#endif // ENABLE_SLOPE_RENDERING
case 'E':
case 'e': { m_labels.show(!m_labels.is_shown()); m_dirty = true; break; }
case 'I':
@ -5684,10 +5591,6 @@ void GLCanvas3D::_render_overlays() const
}
m_labels.render(sorted_instances);
#if ENABLE_SLOPE_RENDERING
m_slope.render();
#endif // ENABLE_SLOPE_RENDERING
glsafe(::glPopMatrix());
}

View File

@ -422,7 +422,6 @@ private:
bool is_in_imgui() const { return m_in_imgui; }
};
#if ENABLE_SLOPE_RENDERING
class Slope
{
bool m_enabled{ false };
@ -437,15 +436,11 @@ private:
bool is_enabled() const { return m_enabled; }
void use(bool use) { m_volumes.set_slope_active(m_enabled ? use : false); }
bool is_used() const { return m_volumes.is_slope_active(); }
void show_dialog(bool show);
bool is_dialog_shown() const { return m_dialog_shown; }
void render() const;
void set_range(const std::array<float, 2>& range) const {
m_volumes.set_slope_z_range({ -::cos(Geometry::deg2rad(90.0f - range[0])), -::cos(Geometry::deg2rad(90.0f - range[1])) });
void set_normal_angle(float angle_in_deg) const {
m_volumes.set_slope_normal_z(-::cos(Geometry::deg2rad(90.0f - angle_in_deg)));
}
static float get_window_width() { return s_window_width; };
};
#endif // ENABLE_SLOPE_RENDERING
public:
enum ECursorType : unsigned char
@ -534,9 +529,7 @@ private:
Labels m_labels;
mutable Tooltip m_tooltip;
mutable bool m_tooltip_enabled{ true };
#if ENABLE_SLOPE_RENDERING
Slope m_slope;
#endif // ENABLE_SLOPE_RENDERING
public:
explicit GLCanvas3D(wxGLCanvas* canvas);
@ -621,9 +614,7 @@ public:
void enable_undoredo_toolbar(bool enable);
void enable_dynamic_background(bool enable);
void enable_labels(bool enable) { m_labels.enable(enable); }
#if ENABLE_SLOPE_RENDERING
void enable_slope(bool enable) { m_slope.enable(enable); }
#endif // ENABLE_SLOPE_RENDERING
void allow_multisample(bool allow);
void zoom_to_bed();
@ -770,14 +761,9 @@ public:
bool are_labels_shown() const { return m_labels.is_shown(); }
void show_labels(bool show) { m_labels.show(show); }
#if ENABLE_SLOPE_RENDERING
bool is_slope_shown() const { return m_slope.is_dialog_shown(); }
bool is_using_slope() const { return m_slope.is_used(); }
void use_slope(bool use) { m_slope.use(use); }
void show_slope(bool show) { m_slope.show_dialog(show); }
void set_slope_range(const std::array<float, 2>& range) { m_slope.set_range(range); }
#endif // ENABLE_SLOPE_RENDERING
void set_slope_normal_angle(float angle_in_deg) { m_slope.set_normal_angle(angle_in_deg); }
private:
bool _is_shown_on_screen() const;
@ -900,13 +886,7 @@ private:
bool _deactivate_collapse_toolbar_items();
float get_overelay_window_width() { return LayersEditing::get_overelay_window_width(); }
float get_slope_window_width() {
#if ENABLE_SLOPE_RENDERING
return Slope::get_window_width();
#else
return 0.0f;
#endif
}
float get_slope_window_width() { return Slope::get_window_width(); }
static std::vector<float> _parse_colors(const std::vector<std::string>& colors);

View File

@ -74,9 +74,7 @@ bool View3D::init(wxWindow* parent, Model* model, DynamicPrintConfig* config, Ba
m_canvas->enable_main_toolbar(true);
m_canvas->enable_undoredo_toolbar(true);
m_canvas->enable_labels(true);
#if ENABLE_SLOPE_RENDERING
m_canvas->enable_slope(true);
#endif // ENABLE_SLOPE_RENDERING
wxBoxSizer* main_sizer = new wxBoxSizer(wxVERTICAL);
main_sizer->Add(m_canvas_widget, 1, wxALL | wxEXPAND, 0);

View File

@ -150,6 +150,7 @@ void GLGizmoFdmSupports::on_render_input_window(float x, float y, float bottom_l
const float max_tooltip_width = ImGui::GetFontSize() * 20.0f;
ImGui::AlignTextToFramePadding();
m_imgui->text(m_desc.at("cursor_size"));
ImGui::SameLine(cursor_slider_left);
ImGui::PushItemWidth(window_width - cursor_slider_left);
@ -163,6 +164,7 @@ void GLGizmoFdmSupports::on_render_input_window(float x, float y, float bottom_l
}
ImGui::AlignTextToFramePadding();
m_imgui->text(m_desc.at("cursor_type"));
ImGui::SameLine(window_width - cursor_type_combo_width - m_imgui->scaled(0.5f));
ImGui::PushItemWidth(cursor_type_combo_width);
@ -180,8 +182,10 @@ void GLGizmoFdmSupports::on_render_input_window(float x, float y, float bottom_l
ImGui::Separator();
if (m_c->object_clipper()->get_position() == 0.f)
if (m_c->object_clipper()->get_position() == 0.f) {
ImGui::AlignTextToFramePadding();
m_imgui->text(m_desc.at("clipping_of_view"));
}
else {
if (m_imgui->button(m_desc.at("reset_direction"))) {
wxGetApp().CallAfter([this](){
@ -206,23 +210,24 @@ void GLGizmoFdmSupports::on_render_input_window(float x, float y, float bottom_l
m_imgui->end();
}
else {
std::string name = "Autoset custom supports";
m_imgui->begin(wxString(name), ImGuiWindowFlags_NoMove | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoCollapse);
m_imgui->text("Threshold:");
m_imgui->begin(_L("Autoset custom supports"), ImGuiWindowFlags_NoMove | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoCollapse);
ImGui::AlignTextToFramePadding();
m_imgui->text(_L("Threshold:") + " " + _L("deg"));
ImGui::SameLine();
if (m_imgui->slider_float("", &m_angle_threshold_deg, 0.f, 90.f, "%.f"))
m_parent.set_slope_range({90.f - m_angle_threshold_deg, 90.f - m_angle_threshold_deg});
if (m_imgui->button("Enforce"))
m_parent.set_slope_normal_angle(90.f - m_angle_threshold_deg);
if (m_imgui->button(_L("Enforce")))
select_facets_by_angle(m_angle_threshold_deg, false);
ImGui::SameLine();
if (m_imgui->button("Block"))
if (m_imgui->button(_L("Block")))
select_facets_by_angle(m_angle_threshold_deg, true);
ImGui::SameLine();
if (m_imgui->button("Cancel"))
if (m_imgui->button(_L("Cancel")))
m_setting_angle = false;
m_imgui->end();
if (! m_setting_angle) {
m_parent.use_slope(false);
bool needs_update = !(m_setting_angle && m_parent.is_using_slope());
if (needs_update) {
m_parent.use_slope(m_setting_angle);
m_parent.set_as_dirty();
}
}

View File

@ -140,9 +140,6 @@ void KBShortcutsDialog::fill_shortcuts()
// View
{ "0-6", L("Camera view") },
{ "E", L("Show/Hide object/instance labels") },
#if ENABLE_SLOPE_RENDERING
{ "D", L("Turn On/Off facets' slope rendering") },
#endif // ENABLE_SLOPE_RENDERING
// Configuration
{ ctrl + "P", L("Preferences") },
// Help

View File

@ -1278,20 +1278,9 @@ void MainFrame::init_menubar()
"", nullptr, [this](){return can_change_view(); }, this);
#endif // ENABLE_GCODE_VIEWER
viewMenu->AppendSeparator();
#if ENABLE_SLOPE_RENDERING
wxMenu* options_menu = new wxMenu();
append_menu_check_item(options_menu, wxID_ANY, _L("Show &labels") + sep + "E", _L("Show object/instance labels in 3D scene"),
[this](wxCommandEvent&) { m_plater->show_view3D_labels(!m_plater->are_view3D_labels_shown()); }, this,
[this]() { return m_plater->is_view3D_shown(); }, [this]() { return m_plater->are_view3D_labels_shown(); }, this);
append_menu_check_item(options_menu, wxID_ANY, _L("Show &slope") + sep + "D", _L("Objects coloring using faces' slope"),
[this](wxCommandEvent&) { m_plater->show_view3D_slope(!m_plater->is_view3D_slope_shown()); }, this,
[this]() { return m_plater->is_view3D_shown() && !m_plater->is_view3D_layers_editing_enabled(); }, [this]() { return m_plater->is_view3D_slope_shown(); }, this);
append_submenu(viewMenu, options_menu, wxID_ANY, _L("&Options"), "");
#else
append_menu_check_item(viewMenu, wxID_ANY, _L("Show &labels") + sep + "E", _L("Show object/instance labels in 3D scene"),
[this](wxCommandEvent&) { m_plater->show_view3D_labels(!m_plater->are_view3D_labels_shown()); }, this,
[this]() { return m_plater->is_view3D_shown(); }, [this]() { return m_plater->are_view3D_labels_shown(); }, this);
#endif // ENABLE_SLOPE_RENDERING
append_menu_check_item(viewMenu, wxID_ANY, _L("&Collapse sidebar"), _L("Collapse sidebar"),
[this](wxCommandEvent&) { m_plater->collapse_sidebar(!m_plater->is_sidebar_collapsed()); }, this,
[this]() { return true; }, [this]() { return m_plater->is_sidebar_collapsed(); }, this);

View File

@ -236,8 +236,6 @@ public:
void set_in_preview(bool preview);
// Move to left to avoid colision with variable layer height gizmo
void set_move_from_overlay(bool move) { m_move_from_overlay = move; }
// or slope visualization gizmo
void set_move_from_slope (bool move) { m_move_from_slope = move; }
private:
//pushes notification into the queue of notifications that are rendered
//can be used to create custom notification

View File

@ -1590,12 +1590,7 @@ struct Plater::priv
bool is_sidebar_collapsed() const { return sidebar->is_collapsed(); }
void collapse_sidebar(bool show) { sidebar->collapse(show); }
#if ENABLE_SLOPE_RENDERING
bool is_view3D_slope_shown() const { return (current_panel == view3D) && view3D->get_canvas3d()->is_slope_shown(); }
void show_view3D_slope(bool show) { if (current_panel == view3D) view3D->get_canvas3d()->show_slope(show); }
bool is_view3D_layers_editing_enabled() const { return (current_panel == view3D) && view3D->get_canvas3d()->is_layers_editing_enabled(); }
#endif // ENABLE_SLOPE_RENDERING
void set_current_canvas_as_dirty();
GLCanvas3D* get_current_canvas3D();
@ -4698,12 +4693,7 @@ void Plater::show_view3D_labels(bool show) { p->show_view3D_labels(show); }
bool Plater::is_sidebar_collapsed() const { return p->is_sidebar_collapsed(); }
void Plater::collapse_sidebar(bool show) { p->collapse_sidebar(show); }
#if ENABLE_SLOPE_RENDERING
bool Plater::is_view3D_slope_shown() const { return p->is_view3D_slope_shown(); }
void Plater::show_view3D_slope(bool show) { p->show_view3D_slope(show); }
bool Plater::is_view3D_layers_editing_enabled() const { return p->is_view3D_layers_editing_enabled(); }
#endif // ENABLE_SLOPE_RENDERING
void Plater::select_all() { p->select_all(); }
void Plater::deselect_all() { p->deselect_all(); }

View File

@ -164,12 +164,7 @@ public:
bool is_sidebar_collapsed() const;
void collapse_sidebar(bool show);
#if ENABLE_SLOPE_RENDERING
bool is_view3D_slope_shown() const;
void show_view3D_slope(bool show);
bool is_view3D_layers_editing_enabled() const;
#endif // ENABLE_SLOPE_RENDERING
// Called after the Preferences dialog is closed and the program settings are saved.
// Update the UI based on the current preferences.