mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-08-03 00:02:14 +00:00
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user