Merge branch 'dev' into fs_mouse
# Conflicts: # src/slic3r/GUI/Gizmos/GLGizmoBase.cpp # src/slic3r/GUI/Gizmos/GLGizmoBase.hpp # src/slic3r/GUI/Gizmos/GLGizmoPainterBase.hpp # src/slic3r/GUI/Gizmos/GLGizmoRotate.cpp # src/slic3r/GUI/Gizmos/GLGizmoRotate.hpp
This commit is contained in:
commit
03d0e36f2f
100 changed files with 220574 additions and 136879 deletions
|
@ -20,7 +20,6 @@ namespace GUI {
|
|||
GLGizmoHollow::GLGizmoHollow(GLCanvas3D& parent, const std::string& icon_filename, unsigned int sprite_id)
|
||||
: GLGizmoBase(parent, icon_filename, sprite_id)
|
||||
{
|
||||
m_vbo_cylinder.init_from(its_make_cylinder(1., 1.));
|
||||
}
|
||||
|
||||
|
||||
|
@ -63,6 +62,9 @@ void GLGizmoHollow::data_changed()
|
|||
|
||||
void GLGizmoHollow::on_render()
|
||||
{
|
||||
if (!m_cylinder.is_initialized())
|
||||
m_cylinder.init_from(its_make_cylinder(1.0, 1.0));
|
||||
|
||||
const Selection& selection = m_parent.get_selection();
|
||||
const CommonGizmosDataObjects::SelectionInfo* sel_info = m_c->selection_info();
|
||||
|
||||
|
@ -148,11 +150,11 @@ void GLGizmoHollow::render_points(const Selection& selection, bool picking) cons
|
|||
}
|
||||
}
|
||||
|
||||
const_cast<GLModel*>(&m_vbo_cylinder)->set_color(-1, render_color);
|
||||
const_cast<GLModel*>(&m_cylinder)->set_color(-1, render_color);
|
||||
|
||||
// Inverse matrix of the instance scaling is applied so that the mark does not scale with the object.
|
||||
glsafe(::glPushMatrix());
|
||||
glsafe(::glTranslatef(drain_hole.pos(0), drain_hole.pos(1), drain_hole.pos(2)));
|
||||
glsafe(::glTranslatef(drain_hole.pos.x(), drain_hole.pos.y(), drain_hole.pos.z()));
|
||||
glsafe(::glMultMatrixd(instance_scaling_matrix_inverse.data()));
|
||||
|
||||
if (vol->is_left_handed())
|
||||
|
@ -166,7 +168,7 @@ void GLGizmoHollow::render_points(const Selection& selection, bool picking) cons
|
|||
glsafe(::glPushMatrix());
|
||||
glsafe(::glTranslated(0., 0., -drain_hole.height));
|
||||
glsafe(::glScaled(drain_hole.radius, drain_hole.radius, drain_hole.height + sla::HoleStickOutLength));
|
||||
m_vbo_cylinder.render();
|
||||
m_cylinder.render();
|
||||
glsafe(::glPopMatrix());
|
||||
|
||||
if (vol->is_left_handed())
|
||||
|
@ -563,38 +565,50 @@ RENDER_AGAIN:
|
|||
m_imgui->text(m_desc.at("offset"));
|
||||
ImGui::SameLine(settings_sliders_left, m_imgui->get_item_spacing().x);
|
||||
ImGui::PushItemWidth(window_width - settings_sliders_left);
|
||||
#if ENABLE_ENHANCED_IMGUI_SLIDER_FLOAT
|
||||
m_imgui->slider_float("##offset", &offset, offset_min, offset_max, "%.1f mm", 1.0f, true, _L(opts[0].second->tooltip));
|
||||
#else
|
||||
m_imgui->slider_float("##offset", &offset, offset_min, offset_max, "%.1f mm");
|
||||
if (ImGui::IsItemHovered())
|
||||
if (m_imgui->get_last_slider_status().hovered)
|
||||
m_imgui->tooltip((_utf8(opts[0].second->tooltip)).c_str(), max_tooltip_width);
|
||||
#endif // ENABLE_ENHANCED_IMGUI_SLIDER_FLOAT
|
||||
|
||||
bool slider_clicked = ImGui::IsItemClicked(); // someone clicked the slider
|
||||
bool slider_edited = ImGui::IsItemEdited(); // someone is dragging the slider
|
||||
bool slider_released = ImGui::IsItemDeactivatedAfterEdit(); // someone has just released the slider
|
||||
bool slider_clicked = m_imgui->get_last_slider_status().clicked; // someone clicked the slider
|
||||
bool slider_edited =m_imgui->get_last_slider_status().edited; // someone is dragging the slider
|
||||
bool slider_released =m_imgui->get_last_slider_status().deactivated_after_edit; // someone has just released the slider
|
||||
|
||||
if (current_mode >= quality_mode) {
|
||||
ImGui::AlignTextToFramePadding();
|
||||
m_imgui->text(m_desc.at("quality"));
|
||||
ImGui::SameLine(settings_sliders_left, m_imgui->get_item_spacing().x);
|
||||
#if ENABLE_ENHANCED_IMGUI_SLIDER_FLOAT
|
||||
m_imgui->slider_float("##quality", &quality, quality_min, quality_max, "%.1f", 1.0f, true, _L(opts[1].second->tooltip));
|
||||
#else
|
||||
m_imgui->slider_float("##quality", &quality, quality_min, quality_max, "%.1f");
|
||||
if (ImGui::IsItemHovered())
|
||||
if (m_imgui->get_last_slider_status().hovered)
|
||||
m_imgui->tooltip((_utf8(opts[1].second->tooltip)).c_str(), max_tooltip_width);
|
||||
#endif // ENABLE_ENHANCED_IMGUI_SLIDER_FLOAT
|
||||
|
||||
slider_clicked |= ImGui::IsItemClicked();
|
||||
slider_edited |= ImGui::IsItemEdited();
|
||||
slider_released |= ImGui::IsItemDeactivatedAfterEdit();
|
||||
slider_clicked |= m_imgui->get_last_slider_status().clicked;
|
||||
slider_edited |= m_imgui->get_last_slider_status().edited;
|
||||
slider_released |= m_imgui->get_last_slider_status().deactivated_after_edit;
|
||||
}
|
||||
|
||||
if (current_mode >= closing_d_mode) {
|
||||
ImGui::AlignTextToFramePadding();
|
||||
m_imgui->text(m_desc.at("closing_distance"));
|
||||
ImGui::SameLine(settings_sliders_left, m_imgui->get_item_spacing().x);
|
||||
#if ENABLE_ENHANCED_IMGUI_SLIDER_FLOAT
|
||||
m_imgui->slider_float("##closing_distance", &closing_d, closing_d_min, closing_d_max, "%.1f mm", 1.0f, true, _L(opts[2].second->tooltip));
|
||||
#else
|
||||
m_imgui->slider_float("##closing_distance", &closing_d, closing_d_min, closing_d_max, "%.1f mm");
|
||||
if (ImGui::IsItemHovered())
|
||||
if (m_imgui->get_last_slider_status().hovered)
|
||||
m_imgui->tooltip((_utf8(opts[2].second->tooltip)).c_str(), max_tooltip_width);
|
||||
#endif // ENABLE_ENHANCED_IMGUI_SLIDER_FLOAT
|
||||
|
||||
slider_clicked |= ImGui::IsItemClicked();
|
||||
slider_edited |= ImGui::IsItemEdited();
|
||||
slider_released |= ImGui::IsItemDeactivatedAfterEdit();
|
||||
slider_clicked |= m_imgui->get_last_slider_status().clicked;
|
||||
slider_edited |= m_imgui->get_last_slider_status().edited;
|
||||
slider_released |= m_imgui->get_last_slider_status().deactivated_after_edit;
|
||||
}
|
||||
|
||||
if (slider_clicked) {
|
||||
|
@ -641,9 +655,9 @@ RENDER_AGAIN:
|
|||
//complete non-sense.
|
||||
diam = std::clamp(diam, 0.1f, diameter_upper_cap);
|
||||
m_new_hole_radius = diam / 2.f;
|
||||
bool clicked = ImGui::IsItemClicked();
|
||||
bool edited = ImGui::IsItemEdited();
|
||||
bool deactivated = ImGui::IsItemDeactivatedAfterEdit();
|
||||
bool clicked = m_imgui->get_last_slider_status().clicked;
|
||||
bool edited = m_imgui->get_last_slider_status().edited;
|
||||
bool deactivated = m_imgui->get_last_slider_status().deactivated_after_edit;
|
||||
|
||||
ImGui::AlignTextToFramePadding();
|
||||
m_imgui->text(m_desc["hole_depth"]);
|
||||
|
@ -652,9 +666,9 @@ RENDER_AGAIN:
|
|||
// Same as above:
|
||||
m_new_hole_height = std::clamp(m_new_hole_height, 0.f, 100.f);
|
||||
|
||||
clicked |= ImGui::IsItemClicked();
|
||||
edited |= ImGui::IsItemEdited();
|
||||
deactivated |= ImGui::IsItemDeactivatedAfterEdit();
|
||||
clicked |= m_imgui->get_last_slider_status().clicked;
|
||||
edited |= m_imgui->get_last_slider_status().edited;
|
||||
deactivated |= m_imgui->get_last_slider_status().deactivated_after_edit;;
|
||||
|
||||
// Following is a nasty way to:
|
||||
// - save the initial value of the slider before one starts messing with it
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue