Skip to main content

Module style

Module style 

Source
Expand description

Render settings (R14 — the CADmaterials semantics: per-kind material variants, hover color, flat-shading toggle, user-persisted overrides) and the selection/hover emphasis state (R17/R24 — name-keyed, fed by the host’s SelectionFilter). Plain data, shared by the engine core and the wgpu renderer; JSON in/out at the R3 boundary.

Structs§

Emphasis
The emphasis state (selection + hover), name-keyed like SelectionFilter. Solid-level emphasis cascades to that solid’s faces/edges (the SelectionState._applyToSolid behavior).
FormField
The GENERAL form field — the schema element ONE form engine renders for BOTH the display-settings dialog AND the schema-driven feature dialogs. Unlike SettingsField (which uses &'static str because the settings schema is compile-time), this owns its strings so it can carry a per-feature schema pulled from the kernel catalogue at run time, and it carries a path (a chain of JSON object keys) so a field can bind to a NESTED value — ["transform","position"], ["boolean","operation"] — not just a top-level key. The settings form is path == [key].
RenderSettings
The viewer’s material palette + display toggles. Defaults are the CADmaterials values.
SettingsField
One field of the settings form: the camelCase apply_json/to_json key, a human label, a UI group, and the widget kind. The ordered list of these (see settings_schema) fully describes the form — a UI shell generates a widget per field with no per-field code.
SketchColors
The sketcher’s overlay palette as plain 0xRRGGBB hex — the ONE place the default color literals live. RenderSettings stores each of these as an editable Rgba field (defaults derived from here via [hex]) and hands the sketch tessellation/overlay builders a live SketchColors view via RenderSettings::sketch_colors, so the sketch renderer reads its colors from the display settings just like faces/edges/vertices do — no scattered constants.
VertexRef
A selected/hovered vertex reference: vertices have no kernel names, so they resolve by owning solid + position.

Enums§

EmphasisState
The visual state of one displayed face/edge (hover wins over selected, the SelectionState order).
FaceColorMode
How base face color is chosen per solid.
FieldKind
The kind of one settings field — the closed set of widget shapes the generic form renderer knows how to emit. Plain data, NO egui dependency: the schema lives in the engine, the renderer (brep-app / a later brep-ui) walks it.
MultiSelectMode
How a plain viewport click builds a MULTI-selection (the Settings “Multi-select” dropdown). Read by the app’s viewport click routing — the engine’s selection primitives (select_candidate replace / toggle_candidate toggle) are mode-agnostic; this only chooses which one a plain click drives.
ThemeMode
The GUI chrome theme (panels, windows, toolbar, text) — controls the egui look, NOT the 3D viewport background (that is the separate background setting). Auto follows the OS/system theme (prefers-color-scheme on web).

Constants§

RENDER_QUALITY
The “Render Quality” dropdown levels shown in Settings, each mapped to a display-tessellation LOD factor. Higher quality = finer mesh = SMALLER factor (chord tolerance = extent · 1.5e-3 · factor). Order is coarse→fine, the order the ComboBox lists them. lod_factor stays the internal representation the tessellation path reads; only the SETTINGS UI/serialization speaks in levels.

Functions§

parse_css_hex
Parse #rrggbb / #rgb / 0xrrggbb (returns None on anything else).
settings_form_fields
Lift the compile-time display-settings schema into general FormFields so the ONE field_input engine (which the feature dialogs also use) renders the settings panel too — a single schema-driven dialog engine, not two.
settings_schema
The Rust-owned settings schema: the ordered list of display-settings fields, grouped, analogous to the kernel feature schemas. Adding a field here (plus its apply_json/to_json handling) makes the whole UI grow a widget for it with ZERO renderer changes.

Type Aliases§

Rgba
sRGB color in 0..1 + alpha.