mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-08-05 21:14:01 -06:00
Revert "Fix Compile Warnings (#5963)"
This reverts commit b83e16dbdd
.
Found regressions like auto orientation didn't work anymore after this change, revert it
This commit is contained in:
parent
0286c36f42
commit
7082e945b1
184 changed files with 1091 additions and 461 deletions
|
@ -3057,7 +3057,7 @@ bool GLGizmoEmboss::choose_font_by_wxdialog()
|
|||
}
|
||||
#endif // ALLOW_ADD_FONT_BY_OS_SELECTOR
|
||||
|
||||
#if defined(ALLOW_ADD_FONT_BY_FILE) || defined(ALLOW_DEBUG_MODE)
|
||||
#if defined ALLOW_ADD_FONT_BY_FILE or defined ALLOW_DEBUG_MODE
|
||||
namespace priv {
|
||||
static std::string get_file_name(const std::string &file_path)
|
||||
{
|
||||
|
@ -3693,6 +3693,7 @@ GuiCfg create_gui_configuration()
|
|||
cfg.height_of_volume_type_selector = separator_height + line_height_with_spacing + input_height;
|
||||
|
||||
int max_style_image_width = static_cast<int>(std::round(cfg.max_style_name_width/2 - 2 * style.FramePadding.x));
|
||||
int max_style_image_height = static_cast<int>(std::round(input_height));
|
||||
cfg.max_style_image_size = Vec2i32(max_style_image_width, line_height);
|
||||
cfg.face_name_size = Vec2i32(cfg.input_width, line_height_with_spacing);
|
||||
cfg.face_name_texture_offset_x = cfg.face_name_size.x() + space;
|
||||
|
|
|
@ -245,10 +245,17 @@ void GLGizmoFdmSupports::on_render_input_window(float x, float y, float bottom_l
|
|||
const float gap_fill_slider_left = m_imgui->calc_text_size(m_desc.at("gap_fill")).x + m_imgui->scaled(1.5f);
|
||||
const float highlight_slider_left = m_imgui->calc_text_size(m_desc.at("highlight_by_angle")).x + m_imgui->scaled(1.5f);
|
||||
const float reset_button_slider_left = m_imgui->calc_text_size(m_desc.at("reset_direction")).x + m_imgui->scaled(1.5f) + ImGui::GetStyle().FramePadding.x * 2;
|
||||
const float on_overhangs_only_width = m_imgui->calc_text_size(m_desc["on_overhangs_only"]).x + m_imgui->scaled(1.5f);
|
||||
const float remove_btn_width = m_imgui->calc_text_size(m_desc.at("remove_all")).x + m_imgui->scaled(1.5f);
|
||||
const float filter_btn_width = m_imgui->calc_text_size(m_desc.at("perform")).x + m_imgui->scaled(1.5f);
|
||||
const float gap_area_txt_width = m_imgui->calc_text_size(m_desc.at("gap_area")).x + m_imgui->scaled(1.5f);
|
||||
const float smart_fill_angle_txt_width = m_imgui->calc_text_size(m_desc.at("smart_fill_angle")).x + m_imgui->scaled(1.5f);
|
||||
const float buttons_width = remove_btn_width + filter_btn_width + m_imgui->scaled(1.5f);
|
||||
const float empty_button_width = m_imgui->calc_button_size("").x;
|
||||
|
||||
const float tips_width = m_imgui->calc_text_size(_L("Auto support threshold angle: ") + " 90 ").x + m_imgui->scaled(1.5f);
|
||||
const float minimal_slider_width = m_imgui->scaled(4.f);
|
||||
|
||||
float caption_max = 0.f;
|
||||
float total_text_max = 0.f;
|
||||
for (const auto &t : std::array<std::string, 5>{"enforce", "block", "remove", "cursor_size", "clipping_of_view"}) {
|
||||
|
@ -265,6 +272,8 @@ void GLGizmoFdmSupports::on_render_input_window(float x, float y, float bottom_l
|
|||
const float sliders_width = m_imgui->scaled(7.0f);
|
||||
const float drag_left_width = ImGui::GetStyle().WindowPadding.x + sliders_left_width + sliders_width - space_size;
|
||||
|
||||
float drag_pos_times = 0.7;
|
||||
|
||||
ImGui::AlignTextToFramePadding();
|
||||
m_imgui->text(m_desc.at("tool_type"));
|
||||
std::array<wchar_t, 4> tool_ids = { ImGui::CircleButtonIcon, ImGui::SphereButtonIcon, ImGui::FillButtonIcon, ImGui::GapFillIcon };
|
||||
|
@ -688,6 +697,7 @@ wxString GLGizmoFdmSupports::handle_snapshot_action_name(bool shift_down, GLGizm
|
|||
void GLGizmoFdmSupports::init_print_instance()
|
||||
{
|
||||
const PrintObject* print_object = NULL;
|
||||
PrintInstance print_instance = { 0 };
|
||||
const Print *print = m_parent.fff_print();
|
||||
|
||||
if (!m_c->selection_info() || (m_print_instance.print_object))
|
||||
|
|
|
@ -138,6 +138,8 @@ void GLGizmoMeshBoolean::on_render()
|
|||
|
||||
BoundingBoxf3 src_bb;
|
||||
BoundingBoxf3 tool_bb;
|
||||
const ModelObject* mo = m_c->selection_info()->model_object();
|
||||
const ModelInstance* mi = mo->instances[m_parent.get_selection().get_instance_idx()];
|
||||
const Selection& selection = m_parent.get_selection();
|
||||
const Selection::IndicesList& idxs = selection.get_volume_idxs();
|
||||
for (unsigned int i : idxs) {
|
||||
|
@ -161,12 +163,16 @@ void GLGizmoMeshBoolean::on_set_state()
|
|||
if (m_state == EState::On) {
|
||||
m_src.reset();
|
||||
m_tool.reset();
|
||||
bool m_diff_delete_input = false;
|
||||
bool m_inter_delete_input = false;
|
||||
m_operation_mode = MeshBooleanOperation::Union;
|
||||
m_selecting_state = MeshBooleanSelectingState::SelectSource;
|
||||
}
|
||||
else if (m_state == EState::Off) {
|
||||
m_src.reset();
|
||||
m_tool.reset();
|
||||
bool m_diff_delete_input = false;
|
||||
bool m_inter_delete_input = false;
|
||||
m_operation_mode = MeshBooleanOperation::Undef;
|
||||
m_selecting_state = MeshBooleanSelectingState::Undef;
|
||||
wxGetApp().notification_manager()->close_plater_warning_notification(warning_text);
|
||||
|
|
|
@ -403,6 +403,7 @@ void GLGizmoMmuSegmentation::on_render_input_window(float x, float y, float bott
|
|||
const float filter_btn_width = m_imgui->calc_text_size(m_desc.at("perform")).x + m_imgui->scaled(1.f);
|
||||
const float buttons_width = remove_btn_width + filter_btn_width + m_imgui->scaled(1.f);
|
||||
const float minimal_slider_width = m_imgui->scaled(4.f);
|
||||
const float color_button_width = m_imgui->calc_text_size(std::string_view{""}).x + m_imgui->scaled(1.75f);
|
||||
|
||||
float caption_max = 0.f;
|
||||
float total_text_max = 0.f;
|
||||
|
@ -443,6 +444,7 @@ void GLGizmoMmuSegmentation::on_render_input_window(float x, float y, float bott
|
|||
|
||||
float start_pos_x = ImGui::GetCursorPos().x;
|
||||
const ImVec2 max_label_size = ImGui::CalcTextSize("99", NULL, true);
|
||||
const float item_spacing = m_imgui->scaled(0.8f);
|
||||
size_t n_extruder_colors = std::min((size_t)EnforcerBlockerType::ExtruderMax, m_extruders_colors.size());
|
||||
for (int extruder_idx = 0; extruder_idx < n_extruder_colors; extruder_idx++) {
|
||||
const ColorRGBA &extruder_color = m_extruders_colors[extruder_idx];
|
||||
|
|
|
@ -527,10 +527,21 @@ std::vector<GLGizmoPainterBase::ProjectedHeightRange> GLGizmoPainterBase::get_pr
|
|||
if (m_rr.mesh_id == -1)
|
||||
return hit_triangles_by_mesh;
|
||||
|
||||
ProjectedMousePosition mesh_hit_point = { m_rr.hit, m_rr.mesh_id, m_rr.facet };
|
||||
float z_bot_world= (trafo_matrices[m_rr.mesh_id] * Vec3d(m_rr.hit(0), m_rr.hit(1), m_rr.hit(2))).z();
|
||||
float z_top_world = z_bot_world+ m_cursor_height;
|
||||
hit_triangles_by_mesh.push_back({ z_bot_world, m_rr.mesh_id, size_t(m_rr.facet) });
|
||||
|
||||
const Selection& selection = m_parent.get_selection();
|
||||
const ModelObject* mo = m_c->selection_info()->model_object();
|
||||
const ModelInstance* mi = mo->instances[selection.get_instance_idx()];
|
||||
const Transform3d instance_trafo = m_parent.get_canvas_type() == GLCanvas3D::CanvasAssembleView ?
|
||||
mi->get_assemble_transformation().get_matrix() :
|
||||
mi->get_transformation().get_matrix();
|
||||
const Transform3d instance_trafo_not_translate = m_parent.get_canvas_type() == GLCanvas3D::CanvasAssembleView ?
|
||||
mi->get_assemble_transformation().get_matrix_no_offset() :
|
||||
mi->get_transformation().get_matrix_no_offset();
|
||||
|
||||
for (int mesh_idx = 0; mesh_idx < part_volumes.size(); mesh_idx++) {
|
||||
if (mesh_idx == m_rr.mesh_id)
|
||||
continue;
|
||||
|
@ -701,6 +712,7 @@ bool GLGizmoPainterBase::gizmo_event(SLAGizmoEventType action, const Vec2d& mous
|
|||
// The mouse button click detection is enabled when there is a valid hit.
|
||||
// Missing the object entirely
|
||||
// shall not capture the mouse.
|
||||
const bool dragging_while_painting = (action == SLAGizmoEventType::Dragging && m_button_down != Button::None);
|
||||
if (mesh_idx != -1 && m_button_down == Button::None)
|
||||
m_button_down = ((action == SLAGizmoEventType::LeftDown) ? Button::Left : Button::Right);
|
||||
|
||||
|
@ -1051,7 +1063,7 @@ void GLGizmoPainterBase::on_set_state()
|
|||
if (m_state == On && m_old_state != On) { // the gizmo was just turned on
|
||||
on_opening();
|
||||
|
||||
// const Selection& selection = m_parent.get_selection();
|
||||
const Selection& selection = m_parent.get_selection();
|
||||
//Camera& camera = wxGetApp().plater()->get_camera();
|
||||
//Vec3d rotate_target = selection.get_bounding_box().center();
|
||||
//rotate_target(2) = 0.f;
|
||||
|
|
|
@ -186,7 +186,7 @@ bool GLGizmosManager::init()
|
|||
// Order of gizmos in the vector must match order in EType!
|
||||
//BBS: GUI refactor: add obj manipulation
|
||||
m_gizmos.clear();
|
||||
// unsigned int sprite_id = 0;
|
||||
unsigned int sprite_id = 0;
|
||||
m_gizmos.emplace_back(new GLGizmoMove3D(m_parent, m_is_dark ? "toolbar_move_dark.svg" : "toolbar_move.svg", EType::Move, &m_object_manipulation));
|
||||
m_gizmos.emplace_back(new GLGizmoRotate3D(m_parent, m_is_dark ? "toolbar_rotate_dark.svg" : "toolbar_rotate.svg", EType::Rotate, &m_object_manipulation));
|
||||
m_gizmos.emplace_back(new GLGizmoScale3D(m_parent, m_is_dark ? "toolbar_scale_dark.svg" : "toolbar_scale.svg", EType::Scale, &m_object_manipulation));
|
||||
|
@ -1042,7 +1042,11 @@ void GLGizmosManager::render_arrow(const GLCanvas3D& parent, EType highlighted_t
|
|||
for (size_t idx : selectable_idxs)
|
||||
{
|
||||
if (idx == highlighted_type) {
|
||||
int tex_width = m_icons_texture.get_width();
|
||||
int tex_height = m_icons_texture.get_height();
|
||||
unsigned int tex_id = m_arrow_texture.get_id();
|
||||
float inv_tex_width = (tex_width != 0.0f) ? 1.0f / tex_width : 0.0f;
|
||||
float inv_tex_height = (tex_height != 0.0f) ? 1.0f / tex_height : 0.0f;
|
||||
|
||||
const float left_uv = 0.0f;
|
||||
const float right_uv = 1.0f;
|
||||
|
|
|
@ -591,6 +591,7 @@ void GizmoObjectManipulation::do_render_move_window(ImGuiWrapper *imgui_wrapper,
|
|||
|
||||
float World_size = imgui_wrapper->calc_text_size(position_title).x + space_size;
|
||||
float caption_max = std::max(position_size, World_size) + 2 * space_size;
|
||||
float end_text_size = imgui_wrapper->calc_text_size(this->m_new_unit_string).x;
|
||||
|
||||
// position
|
||||
Vec3d original_position;
|
||||
|
@ -600,6 +601,8 @@ void GizmoObjectManipulation::do_render_move_window(ImGuiWrapper *imgui_wrapper,
|
|||
original_position = this->m_new_position;
|
||||
Vec3d display_position = m_buffered_position;
|
||||
|
||||
// Rotation
|
||||
Vec3d rotation = this->m_buffered_rotation;
|
||||
float unit_size = imgui_wrapper->calc_text_size(MAX_SIZE).x + space_size;
|
||||
int index = 1;
|
||||
int index_unit = 1;
|
||||
|
@ -705,6 +708,13 @@ void GizmoObjectManipulation::do_render_rotate_window(ImGuiWrapper *imgui_wrappe
|
|||
float caption_max = std::max(position_size, World_size) + 2 * space_size;
|
||||
float end_text_size = imgui_wrapper->calc_text_size(this->m_new_unit_string).x;
|
||||
|
||||
// position
|
||||
Vec3d original_position;
|
||||
if (this->m_imperial_units)
|
||||
original_position = this->m_new_position * this->mm_to_in;
|
||||
else
|
||||
original_position = this->m_new_position;
|
||||
Vec3d display_position = m_buffered_position;
|
||||
// Rotation
|
||||
Vec3d rotation = this->m_buffered_rotation;
|
||||
|
||||
|
@ -825,7 +835,10 @@ void GizmoObjectManipulation::do_render_scale_input_window(ImGuiWrapper* imgui_w
|
|||
Vec3d scale = m_buffered_scale;
|
||||
Vec3d display_size = m_buffered_size;
|
||||
|
||||
Vec3d display_position = m_buffered_position;
|
||||
|
||||
float unit_size = imgui_wrapper->calc_text_size(MAX_SIZE).x + space_size;
|
||||
bool imperial_units = this->m_imperial_units;
|
||||
|
||||
int index = 2;
|
||||
int index_unit = 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue