Skip to main content

Module document

Module document 

Source
Expand description

Open documents and their active tab. Each document owns an engine, store identity, and clean baseline for dirty tracking. Keeping engine access on Documents allows separate mutable borrows of other app fields.

Every engine has its own history runner and resident kernel state. All open documents are pumped each frame, so switching tabs cannot redirect a pending result to another document. Each open document retains its runner and scene.

Display settings are shared across tabs by carry_settings; workbench selection belongs to each document. A new engine initially inherits the current workbench, which a loaded document can override.

Modules§

cam
The document’s cam block on the shared CAM model (brep_cam::model): the user’s setups, tools, operations and NC programs, read from and written to the raw JSON block the history keeps (brep_render::history::History::cam_block).
ecad
The eCAD workbenches’ documents, kept inside the BREP document.
live_link
LIVE LINKS between open documents (owner, 2026-10-20): a part edited in its own tab — saved or not — and the same part edited inside an assembly are one part. Every open document that holds a source (a tab named by it, or an assembly embedding a copy of it at any depth) sees the newest state of that source when the user switches to it.
owned_save
Save an assembly INTO the documents it owns (NX “Save” in an assembly).
work_part
Work part: edit one part occurrence’s own history in the context of its assembly, at any depth of the product structure (NX “Make Work Part”).

Structs§

Document
ONE open model: the engine that owns it plus the identity the file lane needs — the store name it was opened from / saved to, and the clean baseline.
Documents
Every open document + which one is active. Always holds AT LEAST ONE document: closing the last tab leaves a fresh untitled one in its place, so Documents::engine_mut is infallible and the shell never has to render a “no document” state that would be an empty viewport with extra steps.

Enums§

Access
Whether a document may be edited. Every file-based document is Access::Editable. PLM permissions apply to Document::save_access, independently of editing the session copy.

Constants§

EMPTY_DOCUMENT
Empty history for loading fixtures and creating nonpart documents.

Functions§

seed_new_part_datum
Seed only a feature-empty part when explicitly creating a new part. PLM adoption uses this too, preserving the source’s expressions and document blocks.

Type Aliases§

EngineFactory
Builds a fresh engine for a new document — the platform runner, the viewcube, and the persisted display settings, all applied before anything is loaded into it. Injected by the shell so tests (which need the SYNCHRONOUS inline runner) can construct documents without a background thread.