Skip to main content

Module engine_state

Module engine_state 

Source
Expand description

EngineState — the windowing-agnostic viewer state machine the host UI programs against (R3): scene + camera + controls + settings + emphasis, plus the whole event/command/query surface (run-history feed, pointer/wheel ingestion, camera commands, picking, world→screen, visibility). No GPU, no canvas — the wasm Engine and the winit desktop shell both wrap this; it is fully unit-testable on native.

Everything crosses the R3 boundary as plain JSON/scalars: the host never holds a renderer object, only names, ids, and JSON.

Structs§

ComponentInfo
One assembly component instance as the APP sees it: the owning ACOMP feature id, the parts-library part name, the authored rigid pose (inputParams. transform{translate, rotateEulerDeg}, intrinsic-XYZ degrees), the grounded flag, and the member solid names currently in the display scene.
ComponentMoveArm
The component-Move controller state (one per engine, like TransformArm).
ConnectionPatch
A patch the panel applies to one connection: every field optional, only the present ones change.
ConstraintDrag
A live constraint-handle drag: which constraint + which inputParams field (distance / angle), the params snapshot the commit mutates, and the live preview value the overlay/label show while dragging.
EmbeddedOnly
The sink that stores nothing: every entry stays embedded-only. The default for headless callers and tests, which have no store to write to.
EngineState
InterferencePair
One INTERFERING component pair: the two owning ACOMP feature ids, their summed intersection volume (mm³, over all member-solid cross pairs), and whether either participant is currently hidden (it still participates — the window notes it).
InterferenceReport
The result of one interference run — everything the results window shows. pairs empty + skipped/unverified empty = the green all-clear.
PmiModelingSnapshot
The modeling state remembered while the PMI workbench is active.
PmiViewPatch
A patch the panel applies to one view’s name / display state.
RefSelectState
The modal state of the reference-selection widget while it is ACTIVE: which feature-dialog field is being filled, what it accepts, and the running list of picked kernel names (the source of truth — added by picking in the view, removed via the per-line X). See the ref-select methods below.
SelectionFilter
Which entity KINDS a plain viewport click may select.
SketchConstraintAction
One applicable-constraint palette entry: the glyph passed back to EngineState::sketch_add_constraint plus a human tooltip and a dimensional tag (whether it opens a value the solver seeds from the current measurement).
SketchDrag
One in-flight sketch drag (S2): the grabbed points and the anchor uv. A single entry for a point grab; all of a geometry’s (deduped) points for a geometry grab (a rigid translate). Each point tracks the cursor by an ABSOLUTE orig + (uv - anchor) (never incremental — the solver moves points between frames, so incremental deltas would drift).
SketchEdit
The active engine-native sketch edit — the live session plus the state to restore when sketch mode exits.
SketchEntityRow
One row in a sketch entity-LIST panel (Points / Curves / Constraints) — the display label plus the (kind, id) needed to select / hover / delete it, and its current selected/construction state for row styling. Built by EngineState::sketch_point_rows / sketch_geometry_rows / sketch_constraint_rows; the panel renders them and routes clicks back through EngineState::sketch_select_entity / sketch_hover_entity.
SplineAnchorRow
One anchor as the editor lists it.
StepAssemblyImport
The choices the import dialog collects.
StepAssemblyProbe
What the import dialog needs to describe a STEP file’s structure — counts only, so the probe can answer without building anything.
StepAssemblyReport
What an import did — the numbers the status line and notice report.
TransformArm
The transform-controls gizmo controller state (see the impl block below).

Enums§

ComponentInsert
What a component-insert names: an EXISTING parts-library entry (skip the store read — just add an instance) or a NEW part payload to hand to add_part_to_library (which dedups by sourceKey+signature and returns the EFFECTIVE entry name the instance must reference).
GizmoMode
Which of the two gizmos is currently armed for the feature. Transform shows the move/rotate gizmo; Dimension shows the on-canvas draggable dimension annotations (feature-dimensions FD-1). Expanding a feature arms Dimension; the viewport sphere/center toggle flips to Transform and back. The two modes are EXCLUSIVE — the transform gizmo never renders in Dimension mode and vice-versa.
RefSelectTarget
WHO a finished reference-selection commits to: a history FEATURE’s params (the original widget) or an ASSEMBLY CONSTRAINT’s inputParams (same modal, different commit lane — see assembly_ops::begin_ref_select_for_constraint).
StepProbeOutcome
What a STEP probe found, as the file panel consumes it (see EngineState::submit_step_probe).

Constants§

PART_ATTRIBUTES
The part document’s attribute-record key (see the module’s BOM-attributes block). A top-level document key, so it rides save/open untouched.

Traits§

PartSink
Where an imported assembly’s unique parts are written, so each becomes a document in its own right rather than a payload embedded in one assembly.

Functions§

document_signature
A STABLE content signature of a document: a sorted-key JSON walk hashed with the (fixed-key, cross-process-deterministic) std SipHash. The ONE signature fn, at the ENGINE altitude so app-side and engine-side writers share one copy: the app’s insert flow (panels::file), the edit-in-place Finish (panels::assembly_edit::refresh_library_entry) and the update-components comparison (panels::update_components) all write/compare a parts-library sourceSignature with THIS function — a freshly inserted, unchanged part must always compare up-to-date, which a second copy would break the moment either drifted. Uses the kernel’s shared sorted-key hash, also used for in-memory library fingerprints. Invalid JSON retains the raw-text hashing fallback.
world_vertex_ref
{solid}@x,y,z in WORLD coordinates (the PMI vertex-ref convention).