Merge branch 'main' into dev/bbl-network-upd
|
|
@ -1 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="43" height="43" viewBox="0 0 43 43"><rect x="10" y="12" width="27" height="27" rx="3.115" style="fill:#e9e9e9"/><path d="M31.672,13.328a2.828,2.828,0,0,1,4,4L19.5,33.5h-4v-4Z" style="fill:none;stroke:#545454;stroke-linecap:round;stroke-linejoin:round"/><path d="M25.5,12.5h-13a2,2,0,0,0-2,2v22a2,2,0,0,0,2,2h22a2,2,0,0,0,2-2v-13" style="fill:none;stroke:#545454;stroke-linecap:round;stroke-linejoin:round"/></svg>
|
||||
<?xml version="1.0" encoding="UTF-8"?><svg id="a" xmlns="http://www.w3.org/2000/svg" width="43" height="43" viewBox="0 0 43 43"><rect x="10" y="4" width="29" height="29" rx="3.11" ry="3.11" style="fill:#e9e9e9;"/><path d="M33.67,5.33c1.1-1.1,2.9-1.1,4,0,1.1,1.1,1.1,2.9,0,4h0l-18.17,18.17h-4v-4L33.67,5.33Z" style="fill:none; stroke:#545454; stroke-linecap:round; stroke-linejoin:round;"/><path d="M25.5,4.5h-13c-1.1,0-2,.9-2,2v24c0,1.1.9,2,2,2h24c1.1,0,2-.9,2-2v-13" style="fill:none; stroke:#545454; stroke-linecap:round; stroke-linejoin:round;"/></svg>
|
||||
|
Before Width: | Height: | Size: 460 B After Width: | Height: | Size: 555 B |
|
|
@ -1 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="43" height="43" viewBox="0 0 43 43"><rect x="10" y="12" width="27" height="27" rx="3.115" style="fill:#54545a"/><path d="M31.672,13.328a2.828,2.828,0,0,1,4,4L19.5,33.5h-4v-4Z" style="fill:none;stroke:#c4c4c4;stroke-linecap:round;stroke-linejoin:round"/><path d="M25.5,12.5h-13a2,2,0,0,0-2,2v22a2,2,0,0,0,2,2h22a2,2,0,0,0,2-2v-13" style="fill:none;stroke:#c4c4c4;stroke-linecap:round;stroke-linejoin:round"/></svg>
|
||||
<?xml version="1.0" encoding="UTF-8"?><svg id="a" xmlns="http://www.w3.org/2000/svg" width="43" height="43" viewBox="0 0 43 43"><rect x="10" y="4" width="29" height="29" rx="3.11" ry="3.11" style="fill:#54545a;"/><path d="M33.67,5.33c1.1-1.1,2.9-1.1,4,0,1.1,1.1,1.1,2.9,0,4h0l-18.17,18.17h-4v-4L33.67,5.33Z" style="fill:none; stroke:#c4c4c4; stroke-linecap:round; stroke-linejoin:round;"/><path d="M25.5,4.5h-13c-1.1,0-2,.9-2,2v24c0,1.1.9,2,2,2h24c1.1,0,2-.9,2-2v-13" style="fill:none; stroke:#c4c4c4; stroke-linecap:round; stroke-linejoin:round;"/></svg>
|
||||
|
Before Width: | Height: | Size: 460 B After Width: | Height: | Size: 555 B |
|
|
@ -1 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="43" height="43" viewBox="0 0 43 43"><rect x="10" y="12" width="27" height="27" rx="3.115" style="fill:#e9e9e9"/><path d="M31.672,13.328a2.828,2.828,0,0,1,4,4L19.5,33.5h-4v-4Z" style="fill:none;stroke:#009688;stroke-linecap:round;stroke-linejoin:round"/><path d="M25.5,12.5h-13a2,2,0,0,0-2,2v22a2,2,0,0,0,2,2h22a2,2,0,0,0,2-2v-13" style="fill:none;stroke:#009688;stroke-linecap:round;stroke-linejoin:round"/></svg>
|
||||
<?xml version="1.0" encoding="UTF-8"?><svg id="a" xmlns="http://www.w3.org/2000/svg" width="43" height="43" viewBox="0 0 43 43"><rect x="10" y="4" width="29" height="29" rx="3.11" ry="3.11" style="fill:#e9e9e9;"/><path d="M33.67,5.33c1.1-1.1,2.9-1.1,4,0,1.1,1.1,1.1,2.9,0,4h0l-18.17,18.17h-4v-4L33.67,5.33Z" style="fill:none; stroke:#009688; stroke-linecap:round; stroke-linejoin:round;"/><path d="M25.5,4.5h-13c-1.1,0-2,.9-2,2v24c0,1.1.9,2,2,2h24c1.1,0,2-.9,2-2v-13" style="fill:none; stroke:#009688; stroke-linecap:round; stroke-linejoin:round;"/></svg>
|
||||
|
Before Width: | Height: | Size: 460 B After Width: | Height: | Size: 555 B |
|
|
@ -1 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="43" height="43" viewBox="0 0 43 43"><rect x="10" y="12" width="27" height="27" rx="3.115" style="fill:#54545a"/><path d="M31.672,13.328a2.828,2.828,0,0,1,4,4L19.5,33.5h-4v-4Z" style="fill:none;stroke:#009688;stroke-linecap:round;stroke-linejoin:round"/><path d="M25.5,12.5h-13a2,2,0,0,0-2,2v22a2,2,0,0,0,2,2h22a2,2,0,0,0,2-2v-13" style="fill:none;stroke:#009688;stroke-linecap:round;stroke-linejoin:round"/></svg>
|
||||
<?xml version="1.0" encoding="UTF-8"?><svg id="a" xmlns="http://www.w3.org/2000/svg" width="43" height="43" viewBox="0 0 43 43"><rect x="10" y="4" width="29" height="29" rx="3.11" ry="3.11" style="fill:#54545a;"/><path d="M33.67,5.33c1.1-1.1,2.9-1.1,4,0,1.1,1.1,1.1,2.9,0,4h0l-18.17,18.17h-4v-4L33.67,5.33Z" style="fill:none; stroke:#009688; stroke-linecap:round; stroke-linejoin:round;"/><path d="M25.5,4.5h-13c-1.1,0-2,.9-2,2v24c0,1.1.9,2,2,2h24c1.1,0,2-.9,2-2v-13" style="fill:none; stroke:#009688; stroke-linecap:round; stroke-linejoin:round;"/></svg>
|
||||
|
Before Width: | Height: | Size: 460 B After Width: | Height: | Size: 555 B |
|
|
@ -3029,11 +3029,12 @@ namespace IMGUIZMO_NAMESPACE
|
|||
|
||||
ImVec4 directionColorV = gContext.mStyle.Colors[DIRECTION_X + i];
|
||||
if (!visible) {
|
||||
directionColorV.w *= 0.3f;
|
||||
directionColorV.w *= 0.35f;
|
||||
}
|
||||
ImU32 directionColor = ImGui::ColorConvertFloat4ToU32(directionColorV) | IM_COL32(0x80, 0x80, 0x80, 0x00);
|
||||
ImU32 directionColor = ImGui::ColorConvertFloat4ToU32(directionColorV); // | IM_COL32(0x80, 0x80, 0x80, 0x00);
|
||||
drawList->AddLine(baseSSpace, worldDirSSpace, directionColor, gContext.mStyle.TranslationLineThickness);
|
||||
|
||||
/* ORCA Dont draw arrow heads
|
||||
// Arrow head begin
|
||||
ImVec2 dir(baseSSpace - worldDirSSpace);
|
||||
|
||||
|
|
@ -3045,9 +3046,10 @@ namespace IMGUIZMO_NAMESPACE
|
|||
ImVec2 a(worldDirSSpace + dir);
|
||||
drawList->AddTriangleFilled(worldDirSSpace - dir, a + ortogonalDir, a - ortogonalDir, directionColor);
|
||||
// Arrow head end
|
||||
*/
|
||||
|
||||
// Axis text
|
||||
ImVec2 labelSSpace = worldToPos(origin + dirAxis * 1.3f, res, position, size);
|
||||
ImVec2 labelSSpace = worldToPos(origin + dirAxis * 1.2f, res, position, size);
|
||||
ImVec2 labelSize = ImGui::CalcTextSize(gContext.mStyle.AxisLabels[i]);
|
||||
drawList->AddText(labelSSpace - labelSize * 0.5, directionColor, gContext.mStyle.AxisLabels[i]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,9 +69,9 @@ public:
|
|||
static const ColorRGB ORCA() { return {0.0f, 150.f / 255.0f, 136.0f / 255}; }
|
||||
static const ColorRGB WARNING() { return {241.0f / 255, 117.f / 255.0f, 78.0f / 255}; }
|
||||
|
||||
static const ColorRGB X() { return { 0.75f, 0.0f, 0.0f }; }
|
||||
static const ColorRGB Y() { return { 0.0f, 0.75f, 0.0f }; }
|
||||
static const ColorRGB Z() { return { 0.0f, 0.0f, 0.75f }; }
|
||||
static const ColorRGB X() { return { 255 / 255.f, 60 / 255.f, 91 / 255.f};}
|
||||
static const ColorRGB Y() { return { 100 / 255.f, 200 / 255.f, 24 / 255.f};}
|
||||
static const ColorRGB Z() { return { 47 / 255.f, 136 / 255.f, 233 / 255.f};}
|
||||
};
|
||||
|
||||
class ColorRGBA
|
||||
|
|
@ -140,9 +140,9 @@ public:
|
|||
static const ColorRGBA WHITE() { return { 1.0f, 1.0f, 1.0f, 1.0f }; }
|
||||
static const ColorRGBA ORCA() { return {0.0f, 150.f / 255.0f, 136.0f / 255, 1.0f}; }
|
||||
|
||||
static const ColorRGBA X() { return { 0.75f, 0.0f, 0.0f, 1.0f }; }
|
||||
static const ColorRGBA Y() { return { 0.0f, 0.75f, 0.0f, 1.0f }; }
|
||||
static const ColorRGBA Z() { return { 0.0f, 0.0f, 0.75f, 1.0f }; }
|
||||
static const ColorRGBA X() { return { ColorRGB::X().r(), ColorRGB::X().g(), ColorRGB::X().b(), 1.f };}
|
||||
static const ColorRGBA Y() { return { ColorRGB::Y().r(), ColorRGB::Y().g(), ColorRGB::Y().b(), 1.f };}
|
||||
static const ColorRGBA Z() { return { ColorRGB::Z().r(), ColorRGB::Z().g(), ColorRGB::Z().b(), 1.f };}
|
||||
};
|
||||
|
||||
ColorRGB operator * (float value, const ColorRGB& other);
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ static std::vector<unsigned int> solve_extruder_order(const std::vector<std::vec
|
|||
std::swap(*all_extruders.begin(), *start_iter);
|
||||
}
|
||||
else {
|
||||
*start_extruder_id = all_extruders.front();
|
||||
start_extruder_id = all_extruders.front();
|
||||
}
|
||||
|
||||
unsigned int iterations = (1 << all_extruders.size());
|
||||
|
|
|
|||
|
|
@ -189,25 +189,25 @@ void Bed_2D::repaint(const std::vector<Vec2d>& shape)
|
|||
auto axes_len = 5 * wxGetApp().em_unit(); // scale axis
|
||||
auto arrow_len = 6;
|
||||
auto arrow_angle = Geometry::deg2rad(45.0);
|
||||
dc.SetPen(wxPen(wxColour(255, 0, 0), 2, wxPENSTYLE_SOLID)); // red
|
||||
dc.SetPen(wxPen(wxColour(encode_color(ColorRGB::X())), 2, wxPENSTYLE_SOLID)); // red // ORCA match axis colors
|
||||
auto x_end = Vec2d(origin_px(0) + axes_len, origin_px(1));
|
||||
dc.DrawLine(wxPoint(origin_px(0), origin_px(1)), wxPoint(x_end(0), x_end(1)));
|
||||
for (auto angle : { -arrow_angle, arrow_angle }) {
|
||||
Vec2d end = Eigen::Translation2d(x_end) * Eigen::Rotation2Dd(angle) * Eigen::Translation2d(- x_end) * Eigen::Vector2d(x_end(0) - arrow_len, x_end(1));
|
||||
dc.DrawLine(wxPoint(x_end(0), x_end(1)), wxPoint(end(0), end(1)));
|
||||
}
|
||||
//for (auto angle : { -arrow_angle, arrow_angle }) { // ORCA dont draw arrows
|
||||
// Vec2d end = Eigen::Translation2d(x_end) * Eigen::Rotation2Dd(angle) * Eigen::Translation2d(- x_end) * Eigen::Vector2d(x_end(0) - arrow_len, x_end(1));
|
||||
// dc.DrawLine(wxPoint(x_end(0), x_end(1)), wxPoint(end(0), end(1)));
|
||||
//}
|
||||
|
||||
dc.SetPen(wxPen(wxColour(0, 255, 0), 2, wxPENSTYLE_SOLID)); // green
|
||||
dc.SetPen(wxPen(wxColour(encode_color(ColorRGB::Y())), 2, wxPENSTYLE_SOLID)); // green // ORCA match axis colors
|
||||
auto y_end = Vec2d(origin_px(0), origin_px(1) - axes_len);
|
||||
dc.DrawLine(wxPoint(origin_px(0), origin_px(1)), wxPoint(y_end(0), y_end(1)));
|
||||
for (auto angle : { -arrow_angle, arrow_angle }) {
|
||||
Vec2d end = Eigen::Translation2d(y_end) * Eigen::Rotation2Dd(angle) * Eigen::Translation2d(- y_end) * Eigen::Vector2d(y_end(0), y_end(1) + arrow_len);
|
||||
dc.DrawLine(wxPoint(y_end(0), y_end(1)), wxPoint(end(0), end(1)));
|
||||
}
|
||||
//for (auto angle : { -arrow_angle, arrow_angle }) { // ORCA dont draw arrows
|
||||
// Vec2d end = Eigen::Translation2d(y_end) * Eigen::Rotation2Dd(angle) * Eigen::Translation2d(- y_end) * Eigen::Vector2d(y_end(0), y_end(1) + arrow_len);
|
||||
// dc.DrawLine(wxPoint(y_end(0), y_end(1)), wxPoint(end(0), end(1)));
|
||||
//}
|
||||
|
||||
// draw origin
|
||||
dc.SetPen(wxPen(wxColour(0, 0, 0), 1, wxPENSTYLE_SOLID));
|
||||
dc.SetBrush(wxBrush(wxColour(0, 0, 0), wxBRUSHSTYLE_SOLID));
|
||||
dc.SetPen(wxPen(wxColour(encode_color(ColorRGB::Z())), 1, wxPENSTYLE_SOLID)); // ORCA match axis colors
|
||||
dc.SetBrush(wxBrush(wxColour(encode_color(ColorRGB::Z())), wxBRUSHSTYLE_SOLID)); // ORCA match axis colors
|
||||
dc.DrawCircle(origin_px(0), origin_px(1), 3);
|
||||
|
||||
static const auto origin_label = wxString("(0,0)");
|
||||
|
|
|
|||
|
|
@ -218,9 +218,10 @@ void Bed3D::Axes::render()
|
|||
};
|
||||
|
||||
if (!m_arrow.is_initialized())
|
||||
m_arrow.init_from(stilized_arrow(16, DefaultTipRadius, DefaultTipLength, DefaultStemRadius, m_stem_length));
|
||||
//m_arrow.init_from(stilized_arrow(16, DefaultTipRadius, DefaultTipLength, DefaultStemRadius, m_stem_length));
|
||||
m_arrow.init_from(smooth_cylinder(16, /*Radius*/ m_stem_length / 75.f, m_stem_length)); // ORCA use simple cylinder and scale thickness depends on length
|
||||
|
||||
GLShaderProgram* shader = wxGetApp().get_shader("gouraud_light");
|
||||
GLShaderProgram* shader = wxGetApp().get_shader("flat"); // ORCA dont use shading to get closer color tone
|
||||
if (shader == nullptr)
|
||||
return;
|
||||
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ public:
|
|||
m_stem_length = length;
|
||||
m_arrow.reset();
|
||||
}
|
||||
float get_total_length() const { return m_stem_length + DefaultTipLength; }
|
||||
float get_total_length() const { return m_stem_length; } // + DefaultTipLength; } // ORCA axis without arrow
|
||||
void render();
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ namespace GUI {
|
|||
//------------------------------------------
|
||||
|
||||
EditGCodeDialog::EditGCodeDialog(wxWindow* parent, const std::string& key, const std::string& value) :
|
||||
DPIDialog(parent, wxID_ANY, format_wxstr(_L("Edit Custom G-code (%1%)"), key), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE/* | wxRESIZE_BORDER*/)
|
||||
DPIDialog(parent, wxID_ANY, format_wxstr(_L("Edit Custom G-code (%1%)"), key), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
|
||||
{
|
||||
SetFont(wxGetApp().normal_font());
|
||||
SetBackgroundColour(*wxWHITE);
|
||||
|
|
@ -68,15 +68,15 @@ EditGCodeDialog::EditGCodeDialog(wxWindow* parent, const std::string& key, const
|
|||
|
||||
param_sizer->Add(m_search_bar, 0, wxEXPAND | wxALL, border);
|
||||
|
||||
m_params_list = new ParamsViewCtrl(this, wxSize(em * 45, em * 70));
|
||||
m_params_list = new ParamsViewCtrl(this, wxDefaultSize);
|
||||
m_params_list->SetFont(wxGetApp().code_font());
|
||||
wxGetApp().UpdateDarkUI(m_params_list);
|
||||
param_sizer->Add(m_params_list, 0, wxEXPAND | wxALL, border);
|
||||
param_sizer->Add(m_params_list, 1, wxEXPAND | wxALL, border);
|
||||
|
||||
m_add_btn = new ScalableButton(this, wxID_ANY, "add_copies");
|
||||
m_add_btn->SetToolTip(_L("Add selected placeholder to G-code"));
|
||||
|
||||
m_gcode_editor = new wxTextCtrl(this, wxID_ANY, value, wxDefaultPosition, wxSize(em * 75, em * 70), wxTE_MULTILINE
|
||||
m_gcode_editor = new wxTextCtrl(this, wxID_ANY, value, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE
|
||||
#ifdef _WIN32
|
||||
| wxBORDER_SIMPLE
|
||||
#endif
|
||||
|
|
@ -86,12 +86,12 @@ EditGCodeDialog::EditGCodeDialog(wxWindow* parent, const std::string& key, const
|
|||
wxGetApp().UpdateDarkUI(m_gcode_editor);
|
||||
|
||||
grid_sizer->Add(param_sizer, 1, wxEXPAND);
|
||||
grid_sizer->Add(m_add_btn, 0, wxTOP, m_params_list->GetSize().y/2);
|
||||
grid_sizer->Add(m_add_btn, 0, wxALIGN_CENTER_VERTICAL);
|
||||
grid_sizer->Add(m_gcode_editor, 2, wxEXPAND);
|
||||
|
||||
grid_sizer->AddGrowableRow(0, 1);
|
||||
grid_sizer->AddGrowableCol(0, 1);
|
||||
grid_sizer->AddGrowableCol(2, 1);
|
||||
grid_sizer->AddGrowableCol(2, 2);
|
||||
|
||||
m_param_label = new wxStaticText(this, wxID_ANY, _L("Select placeholder"));
|
||||
m_param_label->SetFont(wxGetApp().bold_font());
|
||||
|
|
@ -115,6 +115,9 @@ EditGCodeDialog::EditGCodeDialog(wxWindow* parent, const std::string& key, const
|
|||
topSizer->SetSizeHints(this);
|
||||
|
||||
this->Fit();
|
||||
|
||||
fit_in_display(*this, {100 * em, 70 * em});
|
||||
|
||||
this->Layout();
|
||||
|
||||
this->CenterOnScreen();
|
||||
|
|
|
|||
|
|
@ -5767,9 +5767,9 @@ void GLCanvas3D::_render_3d_navigator()
|
|||
style.Colors[ImGuizmo::COLOR::DIRECTION_Z] = ImGuiWrapper::to_ImVec4(ColorRGBA::X());
|
||||
style.Colors[ImGuizmo::COLOR::TEXT] = m_is_dark ? ImVec4(224 / 255.f, 224 / 255.f, 224 / 255.f, 1.f) : ImVec4(.2f, .2f, .2f, 1.0f);
|
||||
style.Colors[ImGuizmo::COLOR::FACE] = m_is_dark ? ImVec4(0.23f, 0.23f, 0.23f, 1.f) : ImVec4(0.77f, 0.77f, 0.77f, 1);
|
||||
strcpy(style.AxisLabels[ImGuizmo::Axis::Axis_X], "y");
|
||||
strcpy(style.AxisLabels[ImGuizmo::Axis::Axis_Y], "z");
|
||||
strcpy(style.AxisLabels[ImGuizmo::Axis::Axis_Z], "x");
|
||||
strcpy(style.AxisLabels[ImGuizmo::Axis::Axis_X], "Y"); // ORCA use uppercase to match text on tranform widgets
|
||||
strcpy(style.AxisLabels[ImGuizmo::Axis::Axis_Y], "Z"); // ORCA use uppercase to match text on tranform widgets
|
||||
strcpy(style.AxisLabels[ImGuizmo::Axis::Axis_Z], "X"); // ORCA use uppercase to match text on tranform widgets
|
||||
strcpy(style.FaceLabels[ImGuizmo::FACES::FACE_FRONT], _utf8("Front").c_str());
|
||||
strcpy(style.FaceLabels[ImGuizmo::FACES::FACE_BACK], _utf8("Back").c_str());
|
||||
strcpy(style.FaceLabels[ImGuizmo::FACES::FACE_TOP], _utf8("Top").c_str());
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@
|
|||
#include <wx/dcclient.h>
|
||||
#include <wx/font.h>
|
||||
#include <wx/fontutil.h>
|
||||
#include <wx/display.h>
|
||||
|
||||
#include "libslic3r/Config.hpp"
|
||||
|
||||
|
|
@ -481,5 +482,18 @@ bool generate_image(const std::string &filename, wxImage &image, wxSize img_size
|
|||
|
||||
std::deque<wxDialog*> dialogStack;
|
||||
|
||||
void fit_in_display(wxTopLevelWindow& window, wxSize desired_size)
|
||||
{
|
||||
const auto display_size = wxDisplay(window.GetParent()).GetClientArea();
|
||||
if (desired_size.GetWidth() > display_size.GetWidth()) {
|
||||
desired_size.SetWidth(display_size.GetWidth() * 4 / 5);
|
||||
}
|
||||
if (desired_size.GetHeight() > display_size.GetHeight()) {
|
||||
desired_size.SetHeight(display_size.GetHeight() * 4 / 5);
|
||||
}
|
||||
|
||||
window.SetSize(desired_size);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -498,6 +498,12 @@ int get_dpi_for_window(const wxWindow *window);
|
|||
void dataview_remove_insets(wxDataViewCtrl* dv);
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Make sure the given window fits inside current display
|
||||
/// </summary>
|
||||
void fit_in_display(wxTopLevelWindow& window, wxSize desired_size);
|
||||
|
||||
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -26,16 +26,16 @@ ColorRGBA GLGizmoBase::DEFAULT_BASE_COLOR = { 0.625f, 0.625f, 0.625f, 1.0f };
|
|||
ColorRGBA GLGizmoBase::DEFAULT_DRAG_COLOR = { 1.0f, 1.0f, 1.0f, 1.0f };
|
||||
ColorRGBA GLGizmoBase::DEFAULT_HIGHLIGHT_COLOR = {1.0f, 0.38f, 0.0f, 1.0f};
|
||||
std::array<ColorRGBA, 3> GLGizmoBase::AXES_HOVER_COLOR = {{
|
||||
{ 0.7f, 0.0f, 0.0f, 1.0f },
|
||||
{ 0.0f, 0.7f, 0.0f, 1.0f },
|
||||
{ 0.0f, 0.0f, 0.7f, 1.0f }
|
||||
}};
|
||||
{ColorRGBA::X().r() * 1.2f, ColorRGBA::X().g() * 1.4f, ColorRGBA::X().b() * 1.4f, 1.0f},
|
||||
{ColorRGBA::Y().r() * 1.2f, ColorRGBA::Y().g() * 1.2f, ColorRGBA::Y().b() * 1.2f, 1.0f},
|
||||
{ColorRGBA::Z().r() * 1.2f, ColorRGBA::Z().g() * 1.2f, ColorRGBA::Z().b() * 1.2f, 1.0f},
|
||||
}};
|
||||
|
||||
std::array<ColorRGBA, 3> GLGizmoBase::AXES_COLOR = {{
|
||||
{ 1.0, 0.0f, 0.0f, 1.0f },
|
||||
{ 0.0f, 1.0f, 0.0f, 1.0f },
|
||||
{ 0.0f, 0.0f, 1.0f, 1.0f }
|
||||
}};
|
||||
ColorRGBA::X(),
|
||||
ColorRGBA::Y(),
|
||||
ColorRGBA::Z()
|
||||
}};
|
||||
|
||||
ColorRGBA GLGizmoBase::CONSTRAINED_COLOR = {0.5f, 0.5f, 0.5f, 1.0f};
|
||||
ColorRGBA GLGizmoBase::FLATTEN_COLOR = {0.96f, 0.93f, 0.93f, 0.5f};
|
||||
|
|
@ -257,37 +257,37 @@ void GLGizmoBase::render_cross_mark(const Vec3f &target, bool is_single)
|
|||
render_line(
|
||||
{target(0) - half_length, target(1), target(2)},
|
||||
{target(0) + half_length, target(1), target(2)},
|
||||
ColorRGBA::RED());
|
||||
ColorRGBA::X()); // ORCA match axis colors
|
||||
}
|
||||
else {
|
||||
render_line(
|
||||
{target(0), target(1), target(2)},
|
||||
{target(0) + half_length, target(1), target(2)},
|
||||
ColorRGBA::RED());
|
||||
ColorRGBA::X()); // ORCA match axis colors
|
||||
}
|
||||
// draw line for y axis
|
||||
if (!is_single) {
|
||||
render_line(
|
||||
{target(0), target(1) - half_length, target(2)},
|
||||
{target(0), target(1) + half_length, target(2)},
|
||||
ColorRGBA::GREEN());
|
||||
ColorRGBA::Y()); // ORCA match axis colors
|
||||
} else {
|
||||
render_line(
|
||||
{target(0), target(1), target(2)},
|
||||
{target(0), target(1) + half_length, target(2)},
|
||||
ColorRGBA::GREEN());
|
||||
ColorRGBA::Y()); // ORCA match axis colors
|
||||
}
|
||||
// draw line for z axis
|
||||
if (!is_single) {
|
||||
render_line(
|
||||
{target(0), target(1), target(2) - half_length},
|
||||
{target(0), target(1), target(2) + half_length},
|
||||
ColorRGBA::BLUE());
|
||||
ColorRGBA::Z()); // ORCA match axis colors
|
||||
} else {
|
||||
render_line(
|
||||
{target(0), target(1), target(2)},
|
||||
{target(0), target(1), target(2) + half_length},
|
||||
ColorRGBA::BLUE());
|
||||
ColorRGBA::Z()); // ORCA match axis colors
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1046,8 +1046,8 @@ void GLGizmoCut3D::render_cut_plane_grabbers()
|
|||
|
||||
// render sphere grabber
|
||||
size = m_dragging ? get_dragging_half_size(mean_size) : get_half_size(mean_size);
|
||||
color = m_hover_id == Y ? complementary(ColorRGBA::GREEN()) :
|
||||
m_hover_id == X ? complementary(ColorRGBA::RED()) :
|
||||
color = m_hover_id == Y ? ColorRGBA::Y() : // ORCA match axis colors
|
||||
m_hover_id == X ? ColorRGBA::X() : // ORCA match axis colors
|
||||
m_hover_id == Z ? GRABBER_COLOR : ColorRGBA::GRAY();
|
||||
render_model(m_sphere.model, color, view_matrix * translation_transform(m_grabber_connection_len * Vec3d::UnitZ()) * scale_transform(size));
|
||||
}
|
||||
|
|
@ -1060,7 +1060,8 @@ void GLGizmoCut3D::render_cut_plane_grabbers()
|
|||
{
|
||||
size = m_dragging && m_hover_id == X ? get_dragging_half_size(mean_size) : get_half_size(mean_size);
|
||||
const Vec3d cone_scale = Vec3d(0.75 * size, 0.75 * size, 1.8 * size);
|
||||
color = m_hover_id == X ? complementary(ColorRGBA::RED()) : ColorRGBA::RED();
|
||||
//color = m_hover_id == X ? complementary(ColorRGBA::X()) : ColorRGBA::X();
|
||||
color = ColorRGBA::X(); // ORCA match axis colors
|
||||
|
||||
if (m_hover_id == X) {
|
||||
render_grabber_connection(color, view_matrix);
|
||||
|
|
@ -1079,7 +1080,8 @@ void GLGizmoCut3D::render_cut_plane_grabbers()
|
|||
{
|
||||
size = m_dragging && m_hover_id == Y ? get_dragging_half_size(mean_size) : get_half_size(mean_size);
|
||||
const Vec3d cone_scale = Vec3d(0.75 * size, 0.75 * size, 1.8 * size);
|
||||
color = m_hover_id == Y ? complementary(ColorRGBA::GREEN()) : ColorRGBA::GREEN();
|
||||
//color = m_hover_id == Y ? complementary(ColorRGBA::Y()) : ColorRGBA::Y();
|
||||
color = ColorRGBA::Y(); // ORCA match axis colors
|
||||
|
||||
if (m_hover_id == Y) {
|
||||
render_grabber_connection(color, view_matrix);
|
||||
|
|
@ -1099,7 +1101,7 @@ void GLGizmoCut3D::render_cut_plane_grabbers()
|
|||
if (no_xy_grabber_hovered || m_hover_id == CutPlaneZRotation)
|
||||
{
|
||||
size = 0.75 * (m_dragging ? get_dragging_half_size(mean_size) : get_half_size(mean_size));
|
||||
color = ColorRGBA::BLUE();
|
||||
color = ColorRGBA::Z(); // ORCA match axis colors
|
||||
const ColorRGBA cp_color = m_hover_id == CutPlaneZRotation ? color : m_plane.model.get_color();
|
||||
|
||||
const double grabber_shift = -1.75 * m_grabber_connection_len;
|
||||
|
|
@ -1126,7 +1128,7 @@ void GLGizmoCut3D::render_cut_plane_grabbers()
|
|||
if (no_xy_grabber_hovered || m_hover_id == CutPlaneXMove)
|
||||
{
|
||||
size = (m_dragging ? get_dragging_half_size(mean_size) : get_half_size(mean_size));
|
||||
color = m_hover_id == CutPlaneXMove ? ColorRGBA::RED() : m_plane.model.get_color();
|
||||
color = m_hover_id == CutPlaneXMove ? ColorRGBA::X() : m_plane.model.get_color(); // ORCA match axis colors
|
||||
|
||||
render_grabber_connection(GRABBER_COLOR, view_matrix * rotation_transform(0.5 * PI * Vec3d::UnitY()), 0.75);
|
||||
|
||||
|
|
@ -1144,7 +1146,7 @@ void GLGizmoCut3D::render_cut_plane_grabbers()
|
|||
if (m_groove.angle > 0.0f && (no_xy_grabber_hovered || m_hover_id == CutPlaneYMove))
|
||||
{
|
||||
size = (m_dragging ? get_dragging_half_size(mean_size) : get_half_size(mean_size));
|
||||
color = m_hover_id == CutPlaneYMove ? ColorRGBA::GREEN() : m_plane.model.get_color();
|
||||
color = m_hover_id == CutPlaneYMove ? ColorRGBA::Y() : m_plane.model.get_color(); // ORCA match axis colors
|
||||
|
||||
render_grabber_connection(GRABBER_COLOR, view_matrix * rotation_transform(-0.5 * PI * Vec3d::UnitX()), 0.75);
|
||||
|
||||
|
|
|
|||
|
|
@ -874,15 +874,14 @@ void GizmoObjectManipulation::do_render_move_window(ImGuiWrapper *imgui_wrapper,
|
|||
}
|
||||
ImGuiWrapper::pop_combo_style();
|
||||
caption_max = combox_content_size - 4 * space_size;
|
||||
ImGui::SameLine(caption_max + index * space_size);
|
||||
ImGui::PushItemWidth(unit_size);
|
||||
ImGui::TextAlignCenter("X");
|
||||
ImGui::SameLine(caption_max + unit_size + (++index) * space_size);
|
||||
ImGui::PushItemWidth(unit_size);
|
||||
ImGui::TextAlignCenter("Y");
|
||||
ImGui::SameLine(caption_max + (++index_unit) * unit_size + (++index) * space_size);
|
||||
ImGui::PushItemWidth(unit_size);
|
||||
ImGui::TextAlignCenter("Z");
|
||||
// ORCA use TextColored to match axes color
|
||||
float offset_to_center = (unit_size - ImGui::CalcTextSize("O").x) / 2;
|
||||
ImGui::SameLine(caption_max + index * space_size + offset_to_center);
|
||||
ImGui::TextColored(ImGuiWrapper::to_ImVec4(ColorRGBA::X()),"X");
|
||||
ImGui::SameLine(caption_max + unit_size + (++index) * space_size + offset_to_center);
|
||||
ImGui::TextColored(ImGuiWrapper::to_ImVec4(ColorRGBA::Y()),"Y");
|
||||
ImGui::SameLine(caption_max + (++index_unit) * unit_size + (++index) * space_size + offset_to_center);
|
||||
ImGui::TextColored(ImGuiWrapper::to_ImVec4(ColorRGBA::Z()),"Z");
|
||||
|
||||
index = 1;
|
||||
index_unit = 1;
|
||||
|
|
@ -1003,15 +1002,14 @@ void GizmoObjectManipulation::do_render_rotate_window(ImGuiWrapper *imgui_wrappe
|
|||
unsigned int current_active_id = ImGui::GetActiveID();
|
||||
ImGui::PushItemWidth(caption_max);
|
||||
imgui_wrapper->text(_L("World coordinates"));
|
||||
ImGui::SameLine(caption_max + index * space_size);
|
||||
ImGui::PushItemWidth(unit_size);
|
||||
ImGui::TextAlignCenter("X");
|
||||
ImGui::SameLine(caption_max + unit_size + (++index) * space_size);
|
||||
ImGui::PushItemWidth(unit_size);
|
||||
ImGui::TextAlignCenter("Y");
|
||||
ImGui::SameLine(caption_max + (++index_unit) * unit_size + (++index) * space_size);
|
||||
ImGui::PushItemWidth(unit_size);
|
||||
ImGui::TextAlignCenter("Z");
|
||||
// ORCA use TextColored to match axes color
|
||||
float offset_to_center = (unit_size - ImGui::CalcTextSize("O").x) / 2;
|
||||
ImGui::SameLine(caption_max + index * space_size + offset_to_center);
|
||||
ImGui::TextColored(ImGuiWrapper::to_ImVec4(ColorRGBA::X()),"X");
|
||||
ImGui::SameLine(caption_max + unit_size + (++index) * space_size + offset_to_center);
|
||||
ImGui::TextColored(ImGuiWrapper::to_ImVec4(ColorRGBA::Y()),"Y");
|
||||
ImGui::SameLine(caption_max + (++index_unit) * unit_size + (++index) * space_size + offset_to_center);
|
||||
ImGui::TextColored(ImGuiWrapper::to_ImVec4(ColorRGBA::Z()),"Z");
|
||||
|
||||
index = 1;
|
||||
index_unit = 1;
|
||||
|
|
@ -1224,15 +1222,14 @@ void GizmoObjectManipulation::do_render_scale_input_window(ImGuiWrapper* imgui_w
|
|||
ImGuiWrapper::pop_combo_style();
|
||||
caption_max = combox_content_size - 4 * space_size;
|
||||
//ImGui::Dummy(ImVec2(caption_max, -1));
|
||||
ImGui::SameLine(caption_max + space_size);
|
||||
ImGui::PushItemWidth(unit_size);
|
||||
ImGui::TextAlignCenter("X");
|
||||
ImGui::SameLine(caption_max + unit_size + index * space_size);
|
||||
ImGui::PushItemWidth(unit_size);
|
||||
ImGui::TextAlignCenter("Y");
|
||||
ImGui::SameLine(caption_max + (++index_unit) * unit_size + (++index) * space_size);
|
||||
ImGui::PushItemWidth(unit_size);
|
||||
ImGui::TextAlignCenter("Z");
|
||||
// ORCA use TextColored to match axes color
|
||||
float offset_to_center = (unit_size - ImGui::CalcTextSize("O").x) / 2;
|
||||
ImGui::SameLine(caption_max + space_size + offset_to_center);
|
||||
ImGui::TextColored(ImGuiWrapper::to_ImVec4(ColorRGBA::X()),"X");
|
||||
ImGui::SameLine(caption_max + unit_size + index * space_size + offset_to_center);
|
||||
ImGui::TextColored(ImGuiWrapper::to_ImVec4(ColorRGBA::Y()),"Y");
|
||||
ImGui::SameLine(caption_max + (++index_unit) * unit_size + (++index) * space_size + offset_to_center);
|
||||
ImGui::TextColored(ImGuiWrapper::to_ImVec4(ColorRGBA::Z()),"Z");
|
||||
|
||||
index = 2;
|
||||
index_unit = 1;
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ static const float HORIZONTAL_SLIDER_WINDOW_HEIGHT = 64.0f;
|
|||
static const float VERTICAL_SLIDER_WINDOW_WIDTH = 160.0f;
|
||||
static const float GROOVE_WIDTH = 12.0f;
|
||||
static const ImVec2 ONE_LAYER_MARGIN = ImVec2(20.0f, 20.0f);
|
||||
static const ImVec2 ONE_LAYER_BUTTON_SIZE = ImVec2(28.0f, 28.0f);
|
||||
static const ImVec2 ONE_LAYER_BUTTON_SIZE = ImVec2(56.0f, 56.0f);
|
||||
|
||||
static const ImU32 BACKGROUND_COLOR_DARK = IM_COL32(65, 65, 71, 255);
|
||||
static const ImU32 BACKGROUND_COLOR_LIGHT = IM_COL32(255, 255, 255, 255);
|
||||
|
|
@ -145,14 +145,14 @@ bool IMSlider::init_texture()
|
|||
bool result = true;
|
||||
if (!is_horizontal()) {
|
||||
// BBS init image texture id
|
||||
result &= IMTexture::load_from_svg_file(Slic3r::resources_dir() + "/images/one_layer_on.svg", 24, 24, m_one_layer_on_id);
|
||||
result &= IMTexture::load_from_svg_file(Slic3r::resources_dir() + "/images/one_layer_on_hover.svg", 28, 28, m_one_layer_on_hover_id);
|
||||
result &= IMTexture::load_from_svg_file(Slic3r::resources_dir() + "/images/one_layer_off.svg", 28, 28, m_one_layer_off_id);
|
||||
result &= IMTexture::load_from_svg_file(Slic3r::resources_dir() + "/images/one_layer_off_hover.svg", 28, 28, m_one_layer_off_hover_id);
|
||||
result &= IMTexture::load_from_svg_file(Slic3r::resources_dir() + "/images/one_layer_on_dark.svg", 24, 24, m_one_layer_on_dark_id);
|
||||
result &= IMTexture::load_from_svg_file(Slic3r::resources_dir() + "/images/one_layer_on_hover_dark.svg", 28, 28, m_one_layer_on_hover_dark_id);
|
||||
result &= IMTexture::load_from_svg_file(Slic3r::resources_dir() + "/images/one_layer_off_dark.svg", 28, 28, m_one_layer_off_dark_id);
|
||||
result &= IMTexture::load_from_svg_file(Slic3r::resources_dir() + "/images/one_layer_off_hover_dark.svg", 28, 28, m_one_layer_off_hover_dark_id);
|
||||
result &= IMTexture::load_from_svg_file(Slic3r::resources_dir() + "/images/one_layer_on.svg", 56, 56, m_one_layer_on_id);
|
||||
result &= IMTexture::load_from_svg_file(Slic3r::resources_dir() + "/images/one_layer_on_hover.svg", 56, 56, m_one_layer_on_hover_id);
|
||||
result &= IMTexture::load_from_svg_file(Slic3r::resources_dir() + "/images/one_layer_off.svg", 56, 56, m_one_layer_off_id);
|
||||
result &= IMTexture::load_from_svg_file(Slic3r::resources_dir() + "/images/one_layer_off_hover.svg", 56, 56, m_one_layer_off_hover_id);
|
||||
result &= IMTexture::load_from_svg_file(Slic3r::resources_dir() + "/images/one_layer_on_dark.svg", 56, 56, m_one_layer_on_dark_id);
|
||||
result &= IMTexture::load_from_svg_file(Slic3r::resources_dir() + "/images/one_layer_on_hover_dark.svg", 56, 56, m_one_layer_on_hover_dark_id);
|
||||
result &= IMTexture::load_from_svg_file(Slic3r::resources_dir() + "/images/one_layer_off_dark.svg", 56, 56, m_one_layer_off_dark_id);
|
||||
result &= IMTexture::load_from_svg_file(Slic3r::resources_dir() + "/images/one_layer_off_hover_dark.svg", 56, 56, m_one_layer_off_hover_dark_id);
|
||||
result &= IMTexture::load_from_svg_file(Slic3r::resources_dir() + "/images/im_gcode_pause.svg", 14, 14, m_pause_icon_id);
|
||||
result &= IMTexture::load_from_svg_file(Slic3r::resources_dir() + "/images/im_gcode_custom.svg", 14, 14, m_custom_icon_id);
|
||||
result &= IMTexture::load_from_svg_file(Slic3r::resources_dir() + "/images/im_slider_delete.svg", 14, 14, m_delete_icon_id);
|
||||
|
|
@ -492,7 +492,7 @@ bool IMSlider::horizontal_slider(const char* str_id, int* value, int v_min, int
|
|||
const ImU32 handle_border_clr = m_is_dark ? BACKGROUND_COLOR_DARK : BACKGROUND_COLOR_LIGHT;
|
||||
|
||||
// calculate groove size
|
||||
const ImVec2 groove_start = ImVec2(pos.x + handle_dummy_width, pos.y + size.y - ONE_LAYER_MARGIN.y * m_scale - ONE_LAYER_BUTTON_SIZE.y * m_scale * 0.5f - GROOVE_WIDTH * m_scale * 0.5f);
|
||||
const ImVec2 groove_start = ImVec2(pos.x + handle_dummy_width, pos.y + size.y - ONE_LAYER_MARGIN.y * m_scale - (ONE_LAYER_BUTTON_SIZE.y / 2) * m_scale * 0.5f - GROOVE_WIDTH * m_scale * 0.5f);
|
||||
const ImVec2 groove_size = ImVec2(size.x - 2 * handle_dummy_width - text_right_dummy, GROOVE_WIDTH * m_scale);
|
||||
const ImRect groove = ImRect(groove_start, groove_start + groove_size);
|
||||
const ImRect bg_rect = ImRect(groove.Min - ImVec2(6.0f, 6.0f) * m_scale, groove.Max + ImVec2(6.0f, 6.0f) * m_scale);
|
||||
|
|
@ -872,7 +872,7 @@ bool IMSlider::vertical_slider(const char* str_id, int* higher_value, int* lower
|
|||
const ImU32 handle_clr = BRAND_COLOR;
|
||||
const ImU32 handle_border_clr = m_is_dark ? BACKGROUND_COLOR_DARK : BACKGROUND_COLOR_LIGHT;
|
||||
// calculate slider groove size
|
||||
const ImVec2 groove_start = ImVec2(pos.x + size.x - ONE_LAYER_MARGIN.x * m_scale - ONE_LAYER_BUTTON_SIZE.x * m_scale * 0.5f - GROOVE_WIDTH * m_scale * 0.5f, pos.y + text_dummy_height);
|
||||
const ImVec2 groove_start = ImVec2(pos.x + size.x - ONE_LAYER_MARGIN.x * m_scale - (ONE_LAYER_BUTTON_SIZE.x / 2) * m_scale * 0.5f - GROOVE_WIDTH * m_scale * 0.5f, pos.y + text_dummy_height);
|
||||
const ImVec2 groove_size = ImVec2(GROOVE_WIDTH * m_scale, size.y - 2 * text_dummy_height);
|
||||
const ImRect groove = ImRect(groove_start, groove_start + groove_size);
|
||||
const ImRect bg_rect = ImRect(groove.Min - ImVec2(6.0f, 6.0f) * m_scale, groove.Max + ImVec2(6.0f, 6.0f) * m_scale);
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ static unsigned int GLOBAL_PLATE_INDEX = 0;
|
|||
|
||||
static const double LOGICAL_PART_PLATE_GAP = 1. / 5.;
|
||||
static const int PARTPLATE_ICON_SIZE = 16;
|
||||
static const int PARTPLATE_EDIT_PLATE_NAME_ICON_SIZE = 12;
|
||||
static const int PARTPLATE_EDIT_PLATE_NAME_ICON_SIZE = 9; // ORCA this also scales height of plate name
|
||||
static const int PARTPLATE_ICON_GAP_TOP = 3;
|
||||
static const int PARTPLATE_ICON_GAP_LEFT = 3;
|
||||
static const int PARTPLATE_ICON_GAP_Y = 5;
|
||||
|
|
@ -570,21 +570,25 @@ void PartPlate::calc_vertex_for_plate_name_edit_icon(GLTexture *texture, int ind
|
|||
ExPolygon poly;
|
||||
auto bed_ext = get_extents(m_shape);
|
||||
Vec2d p = bed_ext[3];
|
||||
auto factor = bed_ext.size()(1) / 200.0;
|
||||
float width = 0.f;
|
||||
float height = PARTPLATE_EDIT_PLATE_NAME_ICON_SIZE * factor;
|
||||
float offset_x = 1 * factor;
|
||||
float offset_y = PARTPLATE_TEXT_OFFSET_Y * factor;
|
||||
float factor = bed_ext.size()(1) / 200.0;
|
||||
float icon_sz = factor * PARTPLATE_EDIT_PLATE_NAME_ICON_SIZE;
|
||||
float width = icon_sz;
|
||||
float height = icon_sz;
|
||||
float offset_y = factor * PARTPLATE_TEXT_OFFSET_Y;
|
||||
|
||||
float name_width;
|
||||
if (texture && texture->get_width() > 0 && texture->get_height())
|
||||
width = int(factor * (texture->get_original_width() * 16) / texture->get_height());
|
||||
// original width give correct ratio in here since rendering width can be much higher because of next_highest_power_of_2 for rendering
|
||||
name_width = icon_sz * texture->m_original_width / texture->get_height();
|
||||
|
||||
p += Vec2d(width + offset_x, offset_y + height);
|
||||
//if (m_plater && m_plater->get_build_volume_type() == BuildVolume_Type::Circle)
|
||||
// px = scale_(bed_ext.center()(0)) + m_name_texture_width * 0.50 - height * 0.50;
|
||||
p += Vec2d(name_width, offset_y);
|
||||
|
||||
poly.contour.append({ scale_(p(0)) , scale_(p(1) - height) });
|
||||
poly.contour.append({ scale_(p(0) + height), scale_(p(1) - height) });
|
||||
poly.contour.append({ scale_(p(0) + height), scale_(p(1)) });
|
||||
poly.contour.append({ scale_(p(0)) , scale_(p(1)) });
|
||||
poly.contour.append({ scale_(p(0) ), scale_(p(1) ) });
|
||||
poly.contour.append({ scale_(p(0) + width), scale_(p(1) ) });
|
||||
poly.contour.append({ scale_(p(0) + width), scale_(p(1) + height) });
|
||||
poly.contour.append({ scale_(p(0) ), scale_(p(1) + height) });
|
||||
|
||||
if (!init_model_from_poly(model.model, poly, GROUND_Z))
|
||||
BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << "Unable to generate geometry buffers for icons\n";
|
||||
|
|
@ -1869,25 +1873,34 @@ void PartPlate::generate_plate_name_texture()
|
|||
// generate m_name_texture texture from m_name with generate_from_text_string
|
||||
m_name_texture.reset();
|
||||
auto text = m_name.empty()? _L("Untitled") : from_u8(m_name);
|
||||
wxCoord w, h;
|
||||
|
||||
auto* font = &Label::Head_32;
|
||||
// ORCA also scale font size to prevent low res texture
|
||||
int size = wxGetApp().em_unit() * PARTPLATE_EDIT_PLATE_NAME_ICON_SIZE;
|
||||
auto l = Label::sysFont(size, true);
|
||||
wxFont* font = &l;
|
||||
|
||||
wxColour foreground(0xf2, 0x75, 0x4e, 0xff);
|
||||
if (!m_name_texture.generate_from_text_string(text.ToUTF8().data(), *font, *wxBLACK, foreground))
|
||||
BOOST_LOG_TRIVIAL(error) << "PartPlate::generate_plate_name_texture(): generate_from_text_string() failed";
|
||||
auto bed_ext = get_extents(m_shape);
|
||||
auto factor = bed_ext.size()(1) / 200.0;
|
||||
ExPolygon poly;
|
||||
float offset_x = 1 * factor;
|
||||
float offset_y = PARTPLATE_TEXT_OFFSET_Y * factor;
|
||||
w = int(factor * (m_name_texture.get_width() * 16) / m_name_texture.get_height());
|
||||
h = int(factor * 16);
|
||||
Vec2d p = bed_ext[3] + Vec2d(0, 1 + h * m_name_texture.m_original_height / m_name_texture.get_height());
|
||||
poly.contour.append({ scale_(p(0) + offset_x) , scale_(p(1) - h + offset_y) });
|
||||
poly.contour.append({ scale_(p(0) + w - offset_x), scale_(p(1) - h + offset_y) });
|
||||
poly.contour.append({ scale_(p(0) + w - offset_x), scale_(p(1) - offset_y) });
|
||||
poly.contour.append({ scale_(p(0) + offset_x) , scale_(p(1) - offset_y) });
|
||||
|
||||
ExPolygon poly;
|
||||
auto bed_ext = get_extents(m_shape);
|
||||
Vec2d p = bed_ext[3];
|
||||
float factor = bed_ext.size()(1) / 200.0;
|
||||
float icon_sz = factor * PARTPLATE_EDIT_PLATE_NAME_ICON_SIZE;
|
||||
float width = icon_sz * m_name_texture.get_width() / m_name_texture.get_height(); // icon size * text_bb_ratio
|
||||
float height = icon_sz; // scale with icon size to preserve ratio while system scaling
|
||||
float offset_y = factor * PARTPLATE_TEXT_OFFSET_Y;
|
||||
|
||||
//if (m_plater && m_plater->get_build_volume_type() == BuildVolume_Type::Circle)
|
||||
// px = scale_(bed_ext.center()(0)) - (width + height) / 2.00;
|
||||
|
||||
p += Vec2d(0, offset_y);
|
||||
|
||||
poly.contour.append({ scale_(p(0) ), scale_(p(1) ) });
|
||||
poly.contour.append({ scale_(p(0) + width), scale_(p(1) ) });
|
||||
poly.contour.append({ scale_(p(0) + width), scale_(p(1) + height) });
|
||||
poly.contour.append({ scale_(p(0) ), scale_(p(1) + height) });
|
||||
|
||||
if (!init_model_from_poly(m_plate_name_icon, poly, GROUND_Z))
|
||||
BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << "Unable to generate geometry buffers for icons\n";
|
||||
|
|
@ -3367,7 +3380,10 @@ void PartPlateList::generate_icon_textures()
|
|||
}
|
||||
|
||||
std::string text_str = "01";
|
||||
wxFont* font = find_font(text_str,32);
|
||||
// ORCA also scale font size to prevent low res texture
|
||||
int size = wxGetApp().em_unit() * PARTPLATE_ICON_SIZE;
|
||||
auto l = Label::sysFont(int(size), true);
|
||||
wxFont* font = &l;
|
||||
|
||||
for (int i = 0; i < MAX_PLATE_COUNT; i++) {
|
||||
if (m_idx_textures[i].get_id() == 0) {
|
||||
|
|
|
|||
|
|
@ -6412,7 +6412,7 @@ void Plater::priv::set_current_panel(wxPanel* panel, bool no_slice)
|
|||
if (current_panel == view3D) {
|
||||
if (old_panel == preview)
|
||||
preview->get_canvas3d()->unbind_event_handlers();
|
||||
else if (old_panel == assemble_view)
|
||||
else if (old_panel == assemble_view) {
|
||||
assemble_view->get_canvas3d()->unbind_event_handlers();
|
||||
|
||||
GLCanvas3D* assemble_canvas = assemble_view->get_canvas3d();
|
||||
|
|
@ -6426,6 +6426,7 @@ void Plater::priv::set_current_panel(wxPanel* panel, bool no_slice)
|
|||
view3d_selection.add(real_idx, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
view3D->get_canvas3d()->bind_event_handlers();
|
||||
|
||||
|
|
@ -10881,12 +10882,13 @@ ProjectDropDialog::ProjectDropDialog(const std::string &filename)
|
|||
m_sizer_main->Add(0, 0, 0, wxEXPAND | wxTOP, 10);
|
||||
|
||||
wxBoxSizer *m_sizer_bottom = new wxBoxSizer(wxHORIZONTAL);
|
||||
wxBoxSizer *m_sizer_left = new wxBoxSizer(wxHORIZONTAL);
|
||||
|
||||
auto dont_show_again = create_remember_checkbox(_L("Remember my choice."), this, _L("This option can be changed later in preferences, under 'Load Behaviour'."));
|
||||
m_sizer_left->Add(dont_show_again, 0, wxALL, 5);
|
||||
|
||||
m_sizer_bottom->Add(m_sizer_left, 0, wxEXPAND, 5);
|
||||
// Orca: hide the "Don't show again" checkbox, people keeps accidentally checked this then forgot
|
||||
// wxBoxSizer *m_sizer_left = new wxBoxSizer(wxHORIZONTAL);
|
||||
//
|
||||
// auto dont_show_again = create_remember_checkbox(_L("Remember my choice."), this, _L("This option can be changed later in preferences, under 'Load Behaviour'."));
|
||||
// m_sizer_left->Add(dont_show_again, 0, wxALL, 5);
|
||||
//
|
||||
// m_sizer_bottom->Add(m_sizer_left, 0, wxEXPAND, 5);
|
||||
m_sizer_bottom->Add(0, 0, 1, wxEXPAND, 5);
|
||||
|
||||
wxBoxSizer *m_sizer_right = new wxBoxSizer(wxHORIZONTAL);
|
||||
|
|
|
|||
|
|
@ -3167,11 +3167,8 @@ void TabFilament::add_filament_overrides_page()
|
|||
line = optgroup->create_single_option_line(optgroup->get_option(opt_key));
|
||||
|
||||
line.near_label_widget = [this, optgroup_wk = ConfigOptionsGroupWkp(optgroup), opt_key, opt_index](wxWindow* parent) {
|
||||
wxCheckBox* check_box = new wxCheckBox(parent, wxID_ANY, "");
|
||||
|
||||
check_box->Bind(
|
||||
wxEVT_CHECKBOX,
|
||||
[this, optgroup_wk, opt_key, opt_index](wxCommandEvent& evt) {
|
||||
auto check_box = new ::CheckBox(parent); // ORCA modernize checkboxes
|
||||
check_box->Bind(wxEVT_TOGGLEBUTTON, [this, optgroup_wk, opt_key, opt_index](wxCommandEvent& evt) {
|
||||
const bool is_checked = evt.IsChecked();
|
||||
if (auto optgroup_sh = optgroup_wk.lock(); optgroup_sh) {
|
||||
if (Field *field = optgroup_sh->get_fieldc(opt_key, opt_index); field != nullptr) {
|
||||
|
|
@ -3311,10 +3308,7 @@ void TabFilament::build()
|
|||
auto page = add_options_page(L("Filament"), "custom-gcode_filament"); // ORCA: icon only visible on placeholders
|
||||
//BBS
|
||||
auto optgroup = page->new_optgroup(L("Basic information"), L"param_information");
|
||||
// Set size as all another fields for a better alignment
|
||||
Option option = optgroup->get_option("filament_type");
|
||||
option.opt.width = Field::def_width();
|
||||
optgroup->append_single_option_line(option);
|
||||
optgroup->append_single_option_line("filament_type"); // ORCA use same width with other elements
|
||||
optgroup->append_single_option_line("filament_vendor");
|
||||
optgroup->append_single_option_line("filament_soluble");
|
||||
// BBS
|
||||
|
|
@ -3359,7 +3353,7 @@ void TabFilament::build()
|
|||
optgroup->append_single_option_line("adaptive_pressure_advance_overhangs");
|
||||
optgroup->append_single_option_line("adaptive_pressure_advance_bridges");
|
||||
|
||||
option = optgroup->get_option("adaptive_pressure_advance_model");
|
||||
Option option = optgroup->get_option("adaptive_pressure_advance_model");
|
||||
option.opt.full_width = true;
|
||||
option.opt.is_code = true;
|
||||
option.opt.height = 15;
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@
|
|||
#include "ParamsPanel.hpp"
|
||||
#include "Widgets/RoundedRectangle.hpp"
|
||||
#include "Widgets/TextInput.hpp"
|
||||
#include "Widgets/CheckBox.hpp" // ORCA
|
||||
|
||||
class TabCtrl;
|
||||
|
||||
|
|
@ -557,7 +558,7 @@ private:
|
|||
void update_filament_overrides_page(const DynamicPrintConfig* printers_config);
|
||||
void update_volumetric_flow_preset_hints();
|
||||
|
||||
std::map<std::string, wxCheckBox*> m_overrides_options;
|
||||
std::map<std::string, ::CheckBox*> m_overrides_options;
|
||||
|
||||
public:
|
||||
//BBS: GUI refactor
|
||||
|
|
|
|||