Skip to content

fix: make shape selection mode depend on current editing mode#121

Merged
trailcode merged 3 commits into
mainfrom
fix/shape-selection-mode-behavior
Jun 7, 2026
Merged

fix: make shape selection mode depend on current editing mode#121
trailcode merged 3 commits into
mainfrom
fix/shape-selection-mode-behavior

Conversation

@trailcode

Copy link
Copy Markdown
Owner

This PR addresses inconsistent shape selection mode behavior across different editing modes in EzyCad.

Problem

The global m_shp_selection_mode didn't adapt when switching modes (e.g., Move/Rotate/Scale should prefer whole-shape/compound selection; returning to a previous mode should restore its last-used filter).

Sketch-related modes had ad-hoc handling but no per-mode memory.

Changes

  • occt_view.h/cpp:
    • Add std::map<Mode, TopAbs_ShapeEnum> m_modes_selection_mode_map to persist selection mode per editing mode.
    • Refactor set_shp_selection_mode to update the map for the current mode.
    • Update on_mode() to restore mode-specific selection (with explicit cases for Move/Rotate/Scale -> TopAbs_COMPOUND and sketch modes).
  • gui_mode.cpp: Added assertions and parent-mode mappings for Normal mode consistency.
  • gui.cpp: Minor addition in sketch properties dialog.

Testing

  • Manual: Switch between Normal, Move, Rotate, Scale, various sketch modes; verify selection filter updates and restores correctly.
  • Existing unit tests (sketch_tests) and build pass.

Closes #120

This improves usability for precise modeling workflows.

Trailcode Agent added 3 commits June 7, 2026 16:20
…ations

- New RemotePythonServer with PythonExecutionQueue for thread-safe execution on main thread (OCCT/GUI safety).
- TCP listener (port configurable via --listen [host:]port), accepts Python code snippets, executes in embedded interpreter with existing ezy/view/Shp bindings.
- CLI support in main: --listen, --headless (parsed).
- Early Python init when server enabled for remote use.
- Extended Python bindings (fit_all, screenshot, get_shape, get_camera, set_camera, etc.) and help text.
- Added fit_all() to Occt_view.
- Reference client script.
- Updated agents/dev.md with usage and testing instructions.
- Debug prints and error handling for socket issues.
- Fixes for build (socket types, const error, etc.).

This allows external Python scripts to control the running EzyCad instance (GUI or headless) for automation, remote control, etc.

Refs: conversation on dual app+server mode.
@trailcode trailcode merged commit 9f6d816 into main Jun 7, 2026
4 checks passed
@trailcode trailcode deleted the fix/shape-selection-mode-behavior branch June 7, 2026 23:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Shape selection mode behavior should depend on the current editing mode

1 participant