mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-20 21:27:52 -06:00
Update the codes to 01.01.00.10 for the formal release
1. first formal version of macos 2. add the bambu networking plugin install logic 3. auto compute the wipe volume when filament change 4. add the logic of wiping into support 5. refine the GUI layout and icons, improve the gui apperance in lots of small places 6. serveral improve to support 7. support AMS auto-mapping 8. disable lots of unstable features: such as params table, media file download, HMS 9. fix serveral kinds of bugs 10. update the document of building 11. ...
This commit is contained in:
parent
e1528e4299
commit
e9e4d75877
267 changed files with 10326 additions and 32228 deletions
|
@ -246,7 +246,7 @@ void GLGizmoBase::GizmoImguiEnd()
|
|||
m_imgui->end();
|
||||
}
|
||||
|
||||
void GLGizmoBase::GizmoImguiSetNextWIndowPos(float x, float y, int flag, float pivot_x, float pivot_y)
|
||||
void GLGizmoBase::GizmoImguiSetNextWIndowPos(float &x, float y, int flag, float pivot_x, float pivot_y)
|
||||
{
|
||||
if (abs(last_input_window_width) > 0.01f) {
|
||||
if (x + last_input_window_width > m_parent.get_canvas_size().get_width()) {
|
||||
|
|
|
@ -206,7 +206,7 @@ protected:
|
|||
|
||||
bool GizmoImguiBegin(const std::string& name, int flags);
|
||||
void GizmoImguiEnd();
|
||||
void GizmoImguiSetNextWIndowPos(float x, float y, int flag, float pivot_x = 0.0f, float pivot_y = 0.0f);
|
||||
void GizmoImguiSetNextWIndowPos(float &x, float y, int flag, float pivot_x = 0.0f, float pivot_y = 0.0f);
|
||||
// Returns the picking color for the given id, based on the BASE_ID constant
|
||||
// No check is made for clashing with other picking color (i.e. GLVolumes)
|
||||
std::array<float, 4> picking_color_component(unsigned int id) const;
|
||||
|
|
|
@ -88,7 +88,7 @@ bool GLGizmoFdmSupports::on_init()
|
|||
m_desc["remove"] = _L("Erase painting");
|
||||
m_desc["remove_all"] = _L("Erase all painting");
|
||||
m_desc["highlight_by_angle"] = _L("Highlight overhang areas") + ": ";
|
||||
m_desc["fragment_filter"] = _L("Fragment filter");
|
||||
m_desc["fragment_filter"] = _L("Gap fill");
|
||||
m_desc["perform_filter"] = _L("Perform");
|
||||
m_desc["fragment_area"] = _L("Fragment area");
|
||||
m_desc["brush_size"] = _L("Set pen size");
|
||||
|
@ -246,7 +246,7 @@ void GLGizmoFdmSupports::on_render_input_window(float x, float y, float bottom_l
|
|||
ImGui::AlignTextToFramePadding();
|
||||
m_imgui->text(m_desc.at("tool_type"));
|
||||
std::array<wchar_t, 4> tool_icons = { ImGui::CircleButtonIcon, ImGui::SphereButtonIcon, ImGui::FillButtonIcon, ImGui::FragmentFilterIcon };
|
||||
std::array<wxString, 4> tool_tips = { _L("Circle"), _L("Sphere"), _L("Fill"), _L("Fragment Filter") };
|
||||
std::array<wxString, 4> tool_tips = { _L("Circle"), _L("Sphere"), _L("Fill"), _L("Gap Fill") };
|
||||
for (int i = 0; i < tool_icons.size(); i++) {
|
||||
std::string str_label = std::string("##");
|
||||
std::wstring btn_name = tool_icons[i] + boost::nowide::widen(str_label);
|
||||
|
|
|
@ -337,12 +337,12 @@ void GLGizmoMmuSegmentation::on_render_input_window(float x, float y, float bott
|
|||
GizmoImguiBegin(get_name(), ImGuiWindowFlags_NoMove | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoTitleBar);
|
||||
|
||||
// First calculate width of all the texts that are could possibly be shown. We will decide set the dialog width based on that:
|
||||
const float clipping_slider_left = m_imgui->calc_text_size(m_desc.at("clipping_of_view")).x + m_imgui->scaled(1.5f);
|
||||
const float clipping_slider_left = m_imgui->calc_text_size(m_desc.at("clipping_of_view")).x + m_imgui->scaled(1.f);
|
||||
const float cursor_slider_left = m_imgui->calc_text_size(m_desc.at("cursor_size")).x + m_imgui->scaled(1.f);
|
||||
const float smart_fill_slider_left = m_imgui->calc_text_size(m_desc.at("smart_fill_angle")).x + m_imgui->scaled(1.5f);
|
||||
const float edge_detect_slider_left = m_imgui->calc_text_size(m_desc.at("edge_detection")).x + m_imgui->scaled(1.f);
|
||||
const float fragment_area_slider_left = m_imgui->calc_text_size(m_desc.at("fragment_area")).x + m_imgui->scaled(1.f);
|
||||
const float height_range_slider_left = m_imgui->calc_text_size(m_desc.at("height_range")).x + m_imgui->scaled(1.f);
|
||||
const float fragment_area_slider_left = m_imgui->calc_text_size(m_desc.at("fragment_area")).x + m_imgui->scaled(1.5f);
|
||||
const float height_range_slider_left = m_imgui->calc_text_size(m_desc.at("height_range")).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.f);
|
||||
const float filter_btn_width = m_imgui->calc_text_size(m_desc.at("perform_filter")).x + m_imgui->scaled(1.f);
|
||||
|
@ -359,6 +359,8 @@ void GLGizmoMmuSegmentation::on_render_input_window(float x, float y, float bott
|
|||
total_text_max += caption_max + m_imgui->scaled(1.f);
|
||||
caption_max += m_imgui->scaled(1.f);
|
||||
|
||||
const float circle_max_width = std::max(clipping_slider_left,cursor_slider_left);
|
||||
const float height_max_width = std::max(clipping_slider_left,height_range_slider_left);
|
||||
const float sliders_left_width = std::max(smart_fill_slider_left,
|
||||
std::max(cursor_slider_left, std::max(edge_detect_slider_left, std::max(fragment_area_slider_left, std::max(height_range_slider_left,
|
||||
clipping_slider_left)))));
|
||||
|
@ -404,7 +406,15 @@ void GLGizmoMmuSegmentation::on_render_input_window(float x, float y, float bott
|
|||
// draw filament background
|
||||
ImGuiColorEditFlags flags = ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_NoInputs | ImGuiColorEditFlags_NoLabel | ImGuiColorEditFlags_NoPicker | ImGuiColorEditFlags_NoTooltip;
|
||||
if (m_selected_extruder_idx != extruder_idx) flags |= ImGuiColorEditFlags_NoBorder;
|
||||
bool color_picked = ImGui::ColorButton(color_label.c_str(), color_vec, flags, button_size);
|
||||
#ifdef __APPLE__
|
||||
ImGui::PushStyleColor(ImGuiCol_FrameBg, ImVec4(0.4f, 0.4f, 0.4f, 1.0f));
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 0.0f);
|
||||
bool color_picked = ImGui::ColorButton(color_label.c_str(), color_vec, flags, button_size);
|
||||
ImGui::PopStyleVar(1);
|
||||
ImGui::PopStyleColor(1);
|
||||
#else
|
||||
bool color_picked = ImGui::ColorButton(color_label.c_str(), color_vec, flags, button_size);
|
||||
#endif
|
||||
color_button_high = ImGui::GetCursorPos().y - color_button - 2.0;
|
||||
if (color_picked) { m_selected_extruder_idx = extruder_idx; }
|
||||
|
||||
|
@ -425,7 +435,7 @@ void GLGizmoMmuSegmentation::on_render_input_window(float x, float y, float bott
|
|||
m_imgui->text(m_desc.at("tool_type"));
|
||||
|
||||
std::array<wchar_t, 6> tool_icons = { ImGui::CircleButtonIcon,ImGui::SphereButtonIcon, ImGui::TriangleButtonIcon, ImGui::HeightRangeIcon, ImGui::FillButtonIcon, ImGui::FragmentFilterIcon };
|
||||
std::array<wxString, 6> tool_tips = { _L("Circle"), _L("Sphere"), _L("Triangle"), _L("Height Range"), _L("Fill"), _L("Fragment Filter") };
|
||||
std::array<wxString, 6> tool_tips = { _L("Circle"), _L("Sphere"), _L("Triangle"), _L("Height Range"), _L("Fill"), _L("Gap Fill") };
|
||||
for (int i = 0; i < tool_icons.size(); i++) {
|
||||
std::string str_label = std::string("##");
|
||||
std::wstring btn_name = tool_icons[i] + boost::nowide::widen(str_label);
|
||||
|
@ -460,33 +470,54 @@ void GLGizmoMmuSegmentation::on_render_input_window(float x, float y, float bott
|
|||
if (m_current_tool != old_tool)
|
||||
this->tool_changed(old_tool, m_current_tool);
|
||||
|
||||
if (m_current_tool == ImGui::CircleButtonIcon) {
|
||||
m_cursor_type = TriangleSelector::CursorType::CIRCLE;
|
||||
if (m_current_tool == ImGui::CircleButtonIcon || m_current_tool == ImGui::SphereButtonIcon) {
|
||||
if (m_current_tool == ImGui::CircleButtonIcon)
|
||||
m_cursor_type = TriangleSelector::CursorType::CIRCLE;
|
||||
else
|
||||
m_cursor_type = TriangleSelector::CursorType::SPHERE;
|
||||
m_tool_type = ToolType::BRUSH;
|
||||
|
||||
ImGui::AlignTextToFramePadding();
|
||||
m_imgui->text(m_desc.at("cursor_size"));
|
||||
ImGui::SameLine(sliders_left_width);
|
||||
ImGui::PushItemWidth(window_width - sliders_left_width - slider_width_times * slider_icon_width);
|
||||
ImGui::SameLine(circle_max_width);
|
||||
ImGui::PushItemWidth(window_width - circle_max_width - slider_width_times * slider_icon_width);
|
||||
m_imgui->bbl_slider_float_style("##cursor_radius", &m_cursor_radius, CursorRadiusMin, CursorRadiusMax, "%.2f", 1.0f, true);
|
||||
ImGui::SameLine(window_width - slider_icon_width);
|
||||
ImGui::PushItemWidth(1.5 * slider_icon_width);
|
||||
ImGui::BBLDragFloat("##cursor_radius_input", &m_cursor_radius, 0.05f, 0.0f, 0.0f, "%.2f");
|
||||
} else if (m_current_tool == ImGui::SphereButtonIcon){
|
||||
m_cursor_type = TriangleSelector::CursorType::SPHERE;
|
||||
m_tool_type = ToolType::BRUSH;
|
||||
|
||||
ImGui::Separator();
|
||||
|
||||
ImGui::AlignTextToFramePadding();
|
||||
m_imgui->text(m_desc.at("cursor_size"));
|
||||
ImGui::SameLine(sliders_left_width);
|
||||
ImGui::PushItemWidth(window_width - sliders_left_width - slider_width_times * slider_icon_width);
|
||||
m_imgui->bbl_slider_float_style("##cursor_radius", &m_cursor_radius, CursorRadiusMin, CursorRadiusMax, "%.2f", 1.0f, true);
|
||||
m_imgui->text(m_desc.at("clipping_of_view"));
|
||||
|
||||
auto clp_dist = float(m_c->object_clipper()->get_position());
|
||||
ImGui::SameLine(circle_max_width);
|
||||
ImGui::PushItemWidth(window_width - circle_max_width - slider_width_times * slider_icon_width);
|
||||
bool slider_clp_dist = m_imgui->bbl_slider_float_style("##clp_dist", &clp_dist, 0.f, 1.f, "%.2f", 1.0f, true);
|
||||
ImGui::SameLine(window_width - slider_icon_width);
|
||||
ImGui::PushItemWidth(1.5 * slider_icon_width);
|
||||
ImGui::BBLDragFloat("##cursor_radius_input", &m_cursor_radius, 0.05f, 0.0f, 0.0f, "%.2f");
|
||||
bool b_clp_dist_input = ImGui::BBLDragFloat("##clp_dist_input", &clp_dist, 0.05f, 0.0f, 0.0f, "%.2f");
|
||||
|
||||
if (slider_clp_dist || b_clp_dist_input) { m_c->object_clipper()->set_position(clp_dist, true); }
|
||||
|
||||
} else if (m_current_tool == ImGui::TriangleButtonIcon) {
|
||||
m_cursor_type = TriangleSelector::CursorType::POINTER;
|
||||
m_tool_type = ToolType::BRUSH;
|
||||
|
||||
ImGui::AlignTextToFramePadding();
|
||||
m_imgui->text(m_desc.at("clipping_of_view"));
|
||||
|
||||
auto clp_dist = float(m_c->object_clipper()->get_position());
|
||||
ImGui::SameLine(clipping_slider_left);
|
||||
ImGui::PushItemWidth(window_width - clipping_slider_left - slider_width_times * slider_icon_width);
|
||||
bool slider_clp_dist = m_imgui->bbl_slider_float_style("##clp_dist", &clp_dist, 0.f, 1.f, "%.2f", 1.0f, true);
|
||||
ImGui::SameLine(window_width - slider_icon_width);
|
||||
ImGui::PushItemWidth(1.5 * slider_icon_width);
|
||||
bool b_clp_dist_input = ImGui::BBLDragFloat("##clp_dist_input", &clp_dist, 0.05f, 0.0f, 0.0f, "%.2f");
|
||||
|
||||
if (slider_clp_dist || b_clp_dist_input) { m_c->object_clipper()->set_position(clp_dist, true); }
|
||||
|
||||
} else if (m_current_tool == ImGui::FillButtonIcon) {
|
||||
m_cursor_type = TriangleSelector::CursorType::POINTER;
|
||||
m_imgui->bbl_checkbox(m_desc["edge_detection"], m_detect_geometry_edge);
|
||||
|
@ -511,34 +542,6 @@ void GLGizmoMmuSegmentation::on_render_input_window(float x, float y, float bott
|
|||
// set to negative value to disable edge detection
|
||||
m_smart_fill_angle = -1.f;
|
||||
}
|
||||
} else if (m_current_tool == ImGui::HeightRangeIcon) {
|
||||
m_tool_type = ToolType::BRUSH;
|
||||
m_cursor_type = TriangleSelector::CursorType::HEIGHT_RANGE;
|
||||
ImGui::AlignTextToFramePadding();
|
||||
m_imgui->text(m_desc["height_range"] + ":");
|
||||
ImGui::SameLine(sliders_left_width);
|
||||
ImGui::PushItemWidth(window_width - sliders_left_width - slider_width_times * slider_icon_width);
|
||||
std::string format_str = std::string("%.2f") + I18N::translate_utf8("mm", "Heigh range," "Facet in [cursor z, cursor z + height] will be selected.");
|
||||
m_imgui->bbl_slider_float_style("##cursor_height", &m_cursor_height, CursorHeightMin, CursorHeightMax, format_str.data(), 1.0f, true);
|
||||
ImGui::SameLine(window_width - slider_icon_width);
|
||||
ImGui::PushItemWidth(1.5 * slider_icon_width);
|
||||
ImGui::BBLDragFloat("##cursor_height_input", &m_cursor_height, 0.05f, 0.0f, 0.0f, "%.2f");
|
||||
}
|
||||
else if (m_current_tool == ImGui::FragmentFilterIcon) {
|
||||
m_tool_type = ToolType::FRAGMENT_FILTER;
|
||||
m_cursor_type = TriangleSelector::CursorType::POINTER;
|
||||
ImGui::AlignTextToFramePadding();
|
||||
m_imgui->text(m_desc["fragment_area"] + ":");
|
||||
ImGui::SameLine(sliders_left_width);
|
||||
ImGui::PushItemWidth(window_width - sliders_left_width - slider_width_times * slider_icon_width);
|
||||
std::string format_str = std::string("%.2f") + I18N::translate_utf8("", "Triangle patch area threshold,""triangle patch will be merged to neighbor if its area is less than threshold");
|
||||
m_imgui->bbl_slider_float_style("##fragment_area", &TriangleSelectorPatch::fragment_area, TriangleSelectorPatch::FragmentAreaMin, TriangleSelectorPatch::FragmentAreaMax, format_str.data(), 1.0f, true);
|
||||
ImGui::SameLine(window_width - slider_icon_width);
|
||||
ImGui::PushItemWidth(1.5 * slider_icon_width);
|
||||
ImGui::BBLDragFloat("##fragment_area_input", &TriangleSelectorPatch::fragment_area, 0.05f, 0.0f, 0.0f, "%.2f");
|
||||
}
|
||||
|
||||
if (m_current_tool != ImGui::FragmentFilterIcon) {
|
||||
ImGui::Separator();
|
||||
|
||||
ImGui::AlignTextToFramePadding();
|
||||
|
@ -552,8 +555,49 @@ void GLGizmoMmuSegmentation::on_render_input_window(float x, float y, float bott
|
|||
ImGui::PushItemWidth(1.5 * slider_icon_width);
|
||||
bool b_clp_dist_input = ImGui::BBLDragFloat("##clp_dist_input", &clp_dist, 0.05f, 0.0f, 0.0f, "%.2f");
|
||||
|
||||
if (slider_clp_dist || b_clp_dist_input) { m_c->object_clipper()->set_position(clp_dist, true);}
|
||||
|
||||
} else if (m_current_tool == ImGui::HeightRangeIcon) {
|
||||
m_tool_type = ToolType::BRUSH;
|
||||
m_cursor_type = TriangleSelector::CursorType::HEIGHT_RANGE;
|
||||
ImGui::AlignTextToFramePadding();
|
||||
m_imgui->text(m_desc["height_range"] + ":");
|
||||
ImGui::SameLine(height_max_width);
|
||||
ImGui::PushItemWidth(window_width - height_max_width - slider_width_times * slider_icon_width);
|
||||
std::string format_str = std::string("%.2f") + I18N::translate_utf8("mm", "Heigh range," "Facet in [cursor z, cursor z + height] will be selected.");
|
||||
m_imgui->bbl_slider_float_style("##cursor_height", &m_cursor_height, CursorHeightMin, CursorHeightMax, format_str.data(), 1.0f, true);
|
||||
ImGui::SameLine(window_width - slider_icon_width);
|
||||
ImGui::PushItemWidth(1.5 * slider_icon_width);
|
||||
ImGui::BBLDragFloat("##cursor_height_input", &m_cursor_height, 0.05f, 0.0f, 0.0f, "%.2f");
|
||||
|
||||
ImGui::Separator();
|
||||
|
||||
ImGui::AlignTextToFramePadding();
|
||||
m_imgui->text(m_desc.at("clipping_of_view"));
|
||||
|
||||
auto clp_dist = float(m_c->object_clipper()->get_position());
|
||||
ImGui::SameLine(height_max_width);
|
||||
ImGui::PushItemWidth(window_width - height_max_width - slider_width_times * slider_icon_width);
|
||||
bool slider_clp_dist = m_imgui->bbl_slider_float_style("##clp_dist", &clp_dist, 0.f, 1.f, "%.2f", 1.0f, true);
|
||||
ImGui::SameLine(window_width - slider_icon_width);
|
||||
ImGui::PushItemWidth(1.5 * slider_icon_width);
|
||||
bool b_clp_dist_input = ImGui::BBLDragFloat("##clp_dist_input", &clp_dist, 0.05f, 0.0f, 0.0f, "%.2f");
|
||||
|
||||
if (slider_clp_dist || b_clp_dist_input) { m_c->object_clipper()->set_position(clp_dist, true); }
|
||||
}
|
||||
else if (m_current_tool == ImGui::FragmentFilterIcon) {
|
||||
m_tool_type = ToolType::FRAGMENT_FILTER;
|
||||
m_cursor_type = TriangleSelector::CursorType::POINTER;
|
||||
ImGui::AlignTextToFramePadding();
|
||||
m_imgui->text(m_desc["fragment_area"] + ":");
|
||||
ImGui::SameLine(fragment_area_slider_left);
|
||||
ImGui::PushItemWidth(window_width - fragment_area_slider_left - slider_width_times * slider_icon_width);
|
||||
std::string format_str = std::string("%.2f") + I18N::translate_utf8("", "Triangle patch area threshold,""triangle patch will be merged to neighbor if its area is less than threshold");
|
||||
m_imgui->bbl_slider_float_style("##fragment_area", &TriangleSelectorPatch::fragment_area, TriangleSelectorPatch::FragmentAreaMin, TriangleSelectorPatch::FragmentAreaMax, format_str.data(), 1.0f, true);
|
||||
ImGui::SameLine(window_width - slider_icon_width);
|
||||
ImGui::PushItemWidth(1.5 * slider_icon_width);
|
||||
ImGui::BBLDragFloat("##fragment_area_input", &TriangleSelectorPatch::fragment_area, 0.05f, 0.0f, 0.0f, "%.2f");
|
||||
}
|
||||
|
||||
ImGui::Separator();
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(6.0f, 10.0f));
|
||||
|
|
|
@ -85,7 +85,7 @@ size_t GLGizmosManager::get_gizmo_idx_from_mouse(const Vec2d& mouse_pos) const
|
|||
//if ((border <= (float)mouse_pos(0) && ((float)mouse_pos(0) <= border + icons_size))) {
|
||||
if (((top_y + border) <= (float)mouse_pos(1)) && ((float)mouse_pos(1) <= (top_y + border + icons_size))) {
|
||||
// which icon is it on?
|
||||
size_t from_left = (size_t)((float)mouse_pos(0) - top_x) / stride_x;
|
||||
int from_left = (float) mouse_pos(0) - top_x < 0 ? -1 : (int) ((float) mouse_pos(0) - top_x) / stride_x;
|
||||
if (from_left < 0)
|
||||
return Undefined;
|
||||
// is it really on the icon or already past the border?
|
||||
|
|
|
@ -18,6 +18,9 @@
|
|||
|
||||
#include <boost/algorithm/string.hpp>
|
||||
|
||||
#define MAX_NUM 9999.99
|
||||
#define MAX_SIZE "9999.99"
|
||||
|
||||
namespace Slic3r
|
||||
{
|
||||
namespace GUI
|
||||
|
@ -25,6 +28,8 @@ namespace GUI
|
|||
|
||||
const double GizmoObjectManipulation::in_to_mm = 25.4;
|
||||
const double GizmoObjectManipulation::mm_to_in = 0.0393700787;
|
||||
const double GizmoObjectManipulation::oz_to_g = 28.34952;
|
||||
const double GizmoObjectManipulation::g_to_oz = 0.035274;
|
||||
|
||||
// Helper function to be used by drop to bed button. Returns lowest point of this
|
||||
// volume in world coordinate system.
|
||||
|
@ -576,9 +581,10 @@ void GizmoObjectManipulation::do_render_move_window(ImGuiWrapper *imgui_wrapper,
|
|||
else
|
||||
original_position = this->m_new_position;
|
||||
Vec3d display_position = m_buffered_position;
|
||||
|
||||
// Rotation
|
||||
Vec3d rotation = this->m_buffered_rotation;
|
||||
float unit_size = max_unit_size(2, display_position, display_position, "move") + space_size;;
|
||||
float unit_size = imgui_wrapper->calc_text_size(MAX_SIZE).x + space_size;
|
||||
int index = 1;
|
||||
int index_unit = 1;
|
||||
|
||||
|
@ -611,6 +617,12 @@ void GizmoObjectManipulation::do_render_move_window(ImGuiWrapper *imgui_wrapper,
|
|||
ImGui::BBLInputDouble(label_values[0][2], &display_position[2], 0.0f, 0.0f, "%.2f");
|
||||
ImGui::SameLine(caption_max + (++index_unit) * unit_size + (++index) * space_size);
|
||||
imgui_wrapper->text(this->m_new_unit_string);
|
||||
|
||||
for (int i = 0;i<display_position.size();i++)
|
||||
{
|
||||
if (display_position[i] > MAX_NUM)display_position[i] = MAX_NUM;
|
||||
}
|
||||
|
||||
m_buffered_position = display_position;
|
||||
update(current_active_id, "position", original_position, m_buffered_position);
|
||||
// the init position values are not zero, won't add reset button
|
||||
|
@ -671,7 +683,7 @@ void GizmoObjectManipulation::do_render_rotate_window(ImGuiWrapper *imgui_wrappe
|
|||
};
|
||||
|
||||
float space_size = imgui_wrapper->get_style_scaling() * 8;
|
||||
float position_size = imgui_wrapper->calc_text_size(_L("Position")).x + space_size;
|
||||
float position_size = imgui_wrapper->calc_text_size(_L("Rotation")).x + space_size;
|
||||
float World_size = imgui_wrapper->calc_text_size(_L("World coordinates")).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;
|
||||
|
@ -685,7 +697,8 @@ void GizmoObjectManipulation::do_render_rotate_window(ImGuiWrapper *imgui_wrappe
|
|||
Vec3d display_position = m_buffered_position;
|
||||
// Rotation
|
||||
Vec3d rotation = this->m_buffered_rotation;
|
||||
float unit_size = max_unit_size(2, rotation, rotation, "rotate") + space_size * 2;
|
||||
|
||||
float unit_size = imgui_wrapper->calc_text_size(MAX_SIZE).x + space_size;
|
||||
int index = 1;
|
||||
int index_unit = 1;
|
||||
|
||||
|
@ -792,7 +805,9 @@ void GizmoObjectManipulation::do_render_scale_input_window(ImGuiWrapper* imgui_w
|
|||
};
|
||||
|
||||
float space_size = imgui_wrapper->get_style_scaling() * 8;
|
||||
float caption_max = imgui_wrapper->calc_text_size(_L("Position:")).x + space_size;
|
||||
float scale_size = imgui_wrapper->calc_text_size(_L("Scale")).x + space_size;
|
||||
float size_len = imgui_wrapper->calc_text_size(_L("Size")).x + space_size;
|
||||
float caption_max = std::max(scale_size, size_len) + 2 * space_size;
|
||||
float end_text_size = imgui_wrapper->calc_text_size(this->m_new_unit_string).x;
|
||||
ImGui::AlignTextToFramePadding();
|
||||
unsigned int current_active_id = ImGui::GetActiveID();
|
||||
|
@ -802,12 +817,12 @@ void GizmoObjectManipulation::do_render_scale_input_window(ImGuiWrapper* imgui_w
|
|||
|
||||
Vec3d display_position = m_buffered_position;
|
||||
|
||||
float unit_size = max_unit_size(2, scale, display_size, "scale") + space_size;
|
||||
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;
|
||||
|
||||
|
||||
ImGui::PushItemWidth(caption_max);
|
||||
ImGui::Dummy(ImVec2(caption_max, -1));
|
||||
//imgui_wrapper->text(_L(" "));
|
||||
|
@ -839,8 +854,6 @@ void GizmoObjectManipulation::do_render_scale_input_window(ImGuiWrapper* imgui_w
|
|||
ImGui::BBLInputDouble(label_scale_values[0][2], &scale[2], 0.0f, 0.0f, "%.2f");
|
||||
ImGui::SameLine(caption_max + (++index_unit) *unit_size + (++index) * space_size);
|
||||
imgui_wrapper->text(_L("%"));
|
||||
m_buffered_scale = scale;
|
||||
|
||||
|
||||
if (m_show_clear_scale) {
|
||||
ImGui::SameLine(caption_max + 3 * unit_size + 4 * space_size + end_text_size);
|
||||
|
@ -851,7 +864,6 @@ void GizmoObjectManipulation::do_render_scale_input_window(ImGuiWrapper* imgui_w
|
|||
ImGui::InvisibleButton("", ImVec2(ImGui::GetFontSize(), ImGui::GetFontSize()));
|
||||
}
|
||||
|
||||
|
||||
//Size
|
||||
Vec3d original_size;
|
||||
if (this->m_imperial_units)
|
||||
|
@ -875,6 +887,12 @@ void GizmoObjectManipulation::do_render_scale_input_window(ImGuiWrapper* imgui_w
|
|||
ImGui::BBLInputDouble(label_scale_values[1][2], &display_size[2], 0.0f, 0.0f, "%.2f");
|
||||
ImGui::SameLine(caption_max + (++index_unit) *unit_size + (++index) * space_size);
|
||||
imgui_wrapper->text(this->m_new_unit_string);
|
||||
|
||||
for (int i = 0;i<display_size.size();i++)
|
||||
{
|
||||
if (display_size[i] > MAX_NUM || scale[i]> MAX_NUM)display_size[i] = MAX_NUM;
|
||||
}
|
||||
m_buffered_scale = scale;
|
||||
m_buffered_size = display_size;
|
||||
int size_sel = update(current_active_id, "size", original_size, m_buffered_size);
|
||||
ImGui::PopStyleVar(1);
|
||||
|
|
|
@ -19,6 +19,8 @@ class GizmoObjectManipulation
|
|||
public:
|
||||
static const double in_to_mm;
|
||||
static const double mm_to_in;
|
||||
static const double g_to_oz;
|
||||
static const double oz_to_g;
|
||||
|
||||
struct Cache
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue