Skip to content

Refactor clear_all resets and file-local helper layout #244

Description

@trailcode

Summary

Tighten reset and helper conventions: extend clear_all for enums/aggregates, convert multi-field reset sites to clear_all, and align anonymous-namespace helpers with trailing _ names (declare near top / define at file bottom). Update the style guide so agents and humans share the same rule.

Problem

  • Multi-field reset blocks were hand-rolled and easy to leave incomplete.
  • clear_all already covered optionals/arithmetic/handles but not enums or plain aggregates.
  • File-local helpers were inconsistently named/placed vs private methods (name_) and the documented reader-first .cpp layout.

Implemented scope

Code:

  • src/utl.h / src/utl.inl: document and support enum + aggregate reset via T{}.
  • Shape/sketch/GUI reset call sites: shp_cyl_align, shp_move, shp_extrude, shp_cross_section, shp_rotate, skt_*, gui.cpp, hover clear in gui_occt_view.
  • File-local helpers: trailing _, forward decls + bottom defs across GUI (gui_add, gui_settings, gui.cpp, gui_occt_view), shape/sketch (shp_*, skt_*), utilities (utl_*), and main.cpp.
  • ImGui add-primitive dialogs: shared table_row_input_double_.

Documentation:

  • docs/ezycad_code_style.md — private methods and file-local helpers share trailing _; helper organization wording.
  • src/doc/utility.mdclear_all coverage.

Out of scope: scr_*.cpp Lua/Python bindings (different style; optional follow-up).

Acceptance criteria

  • clear_all resets enums and aggregates safely.
  • Touched reset sites use clear_all where sequencing allows.
  • Touched file-local helpers use name_ with bottom definitions.
  • Style / utility docs match behavior.
  • Release build and EzyCad_tests (127) pass.

Notes

  • AIS erase-then-Nullify sequences left explicit where order matters.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions