Skip to main content

Crate sim_lib_scene

Crate sim_lib_scene 

Source
Expand description

Scene value model and codec:scene for the SIM Web-UI.

A Scene is a portable graphical intermediate representation that is itself a SIM value: a tree of scene nodes built on kernel Value/Expr using open maps with a kind tag, never a closed kernel enum. The browser is the only thing that turns a Scene into pixels; everything upstream just produces Scene values. Because a Scene is a value it round-trips through codec:scene, can be snapshotted, diffed, golden-tested, sent over the wire, or read by an agent.

This crate provides:

  • the scene node kinds (open metadata, not a closed enum);
  • a model of builders, accessors, and fail-closed validation;
  • a lossless canonical text form for the scene-data subset of Expr;
  • the codec codec:scene (a domain codec) plus scene node shapes;
  • a diff()/apply pair over scenes (scene diffs are themselves values).

A scene/heatmap carries caller-supplied grid, mask, detector, footprint, and advisory data. Scene validates and transports those fields; it does not perform detector integration, interpret detail, or promote view metadata into scientific evidence. Domain views keep evidence attached to their source value and place only the exact projection certificate on the Scene.

Re-exports§

pub use build::Anchor;
pub use build::AnchorSpace;
pub use build::RESERVED_DATA_KEYS;
pub use build::Transform3;
pub use build::anchor;
pub use build::badge;
pub use build::badge_cluster;
pub use build::box_;
pub use build::data_map;
pub use build::gaze_cursor;
pub use build::hand_ray;
pub use build::panel;
pub use build::spatial;
pub use build::stack;
pub use build::stereo;
pub use build::text_node;
pub use build::world_plane;
pub use codec::SceneCodec;
pub use codec::SceneCodecLib;
pub use codec::scene_codec_symbol;
pub use cookbook::text_node_demo;
pub use diff::apply;
pub use diff::diff;
pub use glance::GLANCE_KIND;
pub use glance::GlanceAction;
pub use glance::GlanceCard;
pub use glance::GlanceMetric;
pub use glance::glance_card;
pub use kinds::SCENE_KINDS;
pub use kinds::SCENE_NAMESPACE;
pub use kinds::is_known_kind;
pub use kinds::scene_kind;
pub use model::HEATMAP_BYTES_PER_CELL;
pub use model::HEATMAP_PALETTES;
pub use model::SceneBudget;
pub use model::SceneBudgetExhausted;
pub use model::SceneBudgetState;
pub use model::SceneError;
pub use model::heatmap_payload_bytes;
pub use model::node;
pub use model::node_kind;
pub use model::validate_scene;
pub use shapes::scene_shape_specs;
pub use shapes::scene_shape_symbol;

Modules§

build
Scene construction helpers.
codec
codec:scene: the domain codec for Scene values.
cookbook
Deterministic cookbook builders for Scene recipes.
diff
Scene diff and patch application.
glance
One-card Scene helpers for tiny glance surfaces.
kinds
Scene node kinds.
model
Scene value model: builders, accessors, and fail-closed validation.
shapes
Shapes for scene node kinds.
text
Lossless canonical text for the scene-data subset of Expr.

Structs§

SceneDescriptor
A validated Scene wrapped as a runtime Citizen object.

Statics§

RECIPES
Embedded cookbook recipe books shipped with this library.

Functions§

map
Build a plain data map from string-keyed entries (keys become core-less symbols). Use node to build a tagged scene node. A map value from string-keyed entries (keys become unqualified symbols).
scene_descriptor_class_symbol
Returns the class symbol for the Scene descriptor Citizen.
sym
An unqualified symbol value: Expr::Symbol(Symbol::new(name)).