710{
711 imgui->begin(
_L(
"Optimize orientation"), ImGuiWindowFlags_NoMove |
712 ImGuiWindowFlags_AlwaysAutoResize |
713 ImGuiWindowFlags_NoCollapse);
714
715
716 float win_h = ImGui::GetWindowHeight();
717 float x = alignment.x, y = alignment.y;
718 y = std::min(y, alignment.bottom_limit - win_h);
719 ImGui::SetWindowPos(ImVec2(x, y), ImGuiCond_Always);
720
721 float max_text_w = 0.;
722 auto padding = ImGui::GetStyle().FramePadding;
723 padding.x *= 2.f;
724 padding.y *= 2.f;
725
727 float w =
729 padding.x + ImGui::GetFrameHeight();
730 max_text_w = std::max(w, max_text_w);
731 }
732
733 ImGui::PushItemWidth(max_text_w);
734
738 state.method_id = i;
739#ifdef SUPPORT_SLA_AUTO_ROTATE
740 wxGetApp().app_config->set("sla_auto_rotate",
741 "method_id",
742 std::to_string(state.method_id));
743#endif
744 }
745
746 if (ImGui::IsItemHovered())
748 }
749
750 ImGui::EndCombo();
751 }
752
753 ImVec2 sz = ImGui::GetItemRectSize();
754
755 if (ImGui::IsItemHovered())
757
758 ImGui::Separator();
759
760 auto btn_txt =
_L(
"Apply");
761 auto btn_txt_sz = ImGui::CalcTextSize(btn_txt.c_str());
762 ImVec2 button_sz = {btn_txt_sz.x + padding.x, btn_txt_sz.y + padding.y};
763 ImGui::SetCursorPosX(padding.x + sz.x - button_sz.x);
764
765 if (!wxGetApp().
plater()->get_ui_job_worker().is_idle())
766 imgui->disabled_begin(true);
767
768 if ( imgui->button(btn_txt) ) {
770 std::make_unique<RotoptimizeJob>());
771 }
772
773 imgui->disabled_end();
774}
#define _L(s)
Definition OBJ.cpp:34
ImGuiWrapper * m_imgui
Definition GLGizmoRotate.hpp:191
static std::string get_method_description(size_t i)
Definition RotoptimizeJob.hpp:76
static std::string get_method_name(size_t i)
Definition RotoptimizeJob.hpp:71
static constexpr size_t get_methods_count()
Definition RotoptimizeJob.hpp:69
static Plater * plater()
Definition GUI_Factories.cpp:400
bool replace_job(Worker &w, Args &&...args)
Definition Worker.hpp:99