Design tab: keyboard shortcuts, plane/axis toggles, section view

- Keyboard shortcuts (Onshape-style, three scoped layers): feature tools on
  Shift+letter, 2D sketch tools on single letters (in-sketch), view/nav on
  single letters (out-of-sketch). Dispatched via the DesignPanel CHAR_HOOK.
- View toggles: P = origin planes, A = world axis triad (render_view_helpers).
- Section view (non-destructive): a single horizontal clip that hides half the
  model to inspect inside, showing only the solid remaining half (no ghost).
  Left-panel "Section View" button or X toggles it; PageUp/PageDown move the
  plane; "Flip Section" button or F shows the opposite half. Never a body/Cut.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BVzKmX6Y1aEteit1HTXG4Q
This commit is contained in:
Tommaso Bianchi
2026-07-01 23:19:18 +02:00
co-authored by Claude Opus 4.8
parent de16d566b2
commit 1673c2c760
6 changed files with 324 additions and 20 deletions
+11
View File
@@ -98,10 +98,18 @@ public:
bool has_display() const { return m_active || !m_display_sketches.empty()
|| (m_solid_bodies != nullptr && !m_solid_bodies->empty())
|| !m_datum_planes.empty()
|| m_show_planes || m_show_axes
|| m_ex_active || m_mv_active || m_fl_active
|| m_hl_active || m_th_active || m_sh_active
|| m_dr_active || m_ct_active || m_dz_active || m_dbp_active; }
// View helpers: the 3 world origin planes (XY/XZ/YZ) and the world axis triad, each
// shown/hidden by a toggle (keys P / A). Off by default so the idle scene stays clean.
void set_show_planes(bool s) { m_show_planes = s; }
void set_show_axes(bool s) { m_show_axes = s; }
bool toggle_show_planes() { m_show_planes = !m_show_planes; return m_show_planes; }
bool toggle_show_axes() { m_show_axes = !m_show_axes; return m_show_axes; }
// Solid topology selection on the committed bodies: clicking a solid cycles
// whole-solid -> face -> edge (Onshape-style) to target fillet/chamfer/extrude. With
// multiple bodies the pick resolves WHICH body was hit (per-triangle body id).
@@ -891,6 +899,9 @@ private:
bool handle_solid_click(GLCanvas3D& canvas, const wxMouseEvent& evt); // cycle + notify
void render_solid_highlight();
void render_datum_planes(); // translucent rectangles for datum/reference planes
void render_view_helpers(); // world origin planes + axis triad (P / A toggles)
bool m_show_planes{false};
bool m_show_axes{false};
std::vector<SketchPlane> m_datum_planes;
std::vector<Vec2d> m_datum_sizes; // per-plane (u,v) full extent; empty -> default
GLModel m_solid_face_model;