Show the Design tab's reference planes as separate labelled squares around the origin

The XY, XZ and YZ planes no longer cross through the bed. Each is a small square in its axis
colour, set off from the axes into the corner that faces the default front view, with its name
written in the plane. Dash-dot axes run between the squares and replace the bed's axis triad
while they show. Hovering a plane greys it and selecting one makes it solid, and picking a
solid face now clears a previously picked plane.
This commit is contained in:
SoftFever
2026-10-06 16:32:36 +08:00
parent 0c2e26fa3d
commit 250fed8808
7 changed files with 463 additions and 242 deletions
+16 -2
View File
@@ -3717,8 +3717,13 @@ DesignPanel::DesignPanel(wxWindow* parent)
m_pick_face_body = (level >= 1) ? body : -1;
m_pick_face = (level >= 1) ? face : -1;
// Last pick wins: a leftover loop pick would block Extrude's face push/pull branch, so
// Extrude would extrude a sketch instead of push/pulling the clicked face.
if (level >= 1) m_viewport->clear_loop_pick();
// Extrude would extrude a sketch instead of push/pulling the clicked face. And a reference
// plane picked before stops being the one chosen, as a plane pick drops a face: otherwise it
// would come back as the sketch plane, and be drawn selected, once this pick is let go.
if (level >= 1) {
m_viewport->clear_loop_pick();
m_plane_picked = false;
}
// Say what got picked. Without this the ONLY feedback is the viewport highlight, so a
// pick that registers but draws faintly is indistinguishable from one that never
// happened — which is precisely how this failure was reported and why it resisted
@@ -4005,6 +4010,15 @@ DesignPanel::DesignPanel(wxWindow* parent)
m_status->Refresh();
}
});
// The reference plane drawn selected: the Plane card's base, or else the plane a sketch would go
// on — chosen, and not overridden by a picked face (sketch_plane_target's test, without its
// per-face OCCT lookup, as this is asked every frame).
m_viewport->set_selected_base([this] {
if (m_active == Tool::Plane)
return m_plane_base != nullptr && m_pl_faceA < 0 ? m_plane_base->GetSelection() : -1;
const bool face = (m_sel_solid_face >= 0 && m_sel_solid_body >= 0) || (m_pick_face >= 0 && m_pick_face_body >= 0);
return m_plane_picked && !face ? m_ref_plane : -1;
});
// Move-body gizmo (M5): each drag/edit reports the body's new translation. Store it as a
// display-only per-body transform and re-feed the moved meshes (the OCCT shape is untouched,