mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-06 07:51:47 +00:00
ad672d0edb
The MEP one-shot operators (join, unjoin variants, terminal removal, path-select, obstruction add/remove) had no viewport surface. This commit adds GizmoMEPActions — the icon-action gizmo group that surfaces them as billboarded icons around selected MEP elements. Three anchor regions: a horizontal row above the bbox top (selection-cardinality icons), per-port endpoints for the three-state lock / unjoin icons (open lock for PORT_FREE, closed for PORT_TERMINAL, unjoin for PORT_JOINED — resolved per-frame from port_connection_state), and the predicted join location (compute_mep_join_location, shared with the bend preview) for the join / unjoin_pair pair. Unjoin icons render at full DEFAULT_BILLBOARD_SCALE with warning-red hover; endpoint lock icons shrink so the lock row stays subordinate to the row icons. The group hides itself entirely while a bend preview is active. MEPAddObstruction grew a position enum (CURSOR / START / END) and a mode enum (ADD / REMOVE / TOGGLE) so the gizmo can target a specific port without touching the cursor and dispatch ADD or REMOVE based on the click target — the lock_open icons drive ADD with position pinned, the lock_closed icons drive bim.mep_remove_terminal_fitting. Without the new fields the gizmo wiring (op_props.position = ...) crashed at setup() with AttributeError on the obstruction operator. validate_bend_preconditions extracts the type-match and profile-kind checks MEPAddBend enforces so EnableBendPreview surfaces the rejection immediately — the user no longer tunes a preview only to learn at commit time that the segments use an unsupported profile (e.g. IfcArbitraryClosedProfileDef). Generated with the assistance of an AI coding tool.