9.3
55 Scene states
Scene-state values are immutable. Their raw constructor and fields are not part of the public API.
procedure
(scene-state? value) → boolean?
value : any/c
Returns #t when value is a scene-state value.
value
An empty scene state with no top-level Visuals, no named semantic values, and an empty drawing order.
procedure
(scene-state-count state) → exact-nonnegative-integer?
state : scene-state?
Returns the number of top-level Visuals in state. A group counts as
one top-level Visual regardless of the number of descendants it contains. A
derived definition likewise counts as one top-level Visual.
procedure
(scene-state-has? state target) → boolean?
state : scene-state? target : (or/c visual? symbol? visual-path?)
Returns #t when state contains the addressed Visual. A Visual
argument is resolved through visual-id; a visual-path? follows
built-in group children. Frame-space Visuals are not valid camera-follow
targets.
procedure
(scene-state-ref state target) → visual?
state : scene-state? target : (or/c visual? symbol? visual-path?)
Returns the stored Visual identified by target. A nested path returns
its locally stored child, without inheriting parent transforms. Raises an
exception when the identity is not present. For a derived Visual this returns the persistent
derived-visual? definition rather than evaluating its resolver; use
scene-state-resolved-ref when concrete geometry is required.
procedure
(scene-state-visuals-in-drawing-order state) → (listof visual?)
state : scene-state?
Returns the stored top-level Visuals in back-to-front drawing order. The first
Visual is painted first. The last Visual is painted on top. A group’s separate
child order is available through group-visual-children. Derived entries
remain persistent derived-visual? definitions in this raw list; use
scene-state-resolved-visuals-in-drawing-order for concrete rendering
values.
procedure
(scene-state-resolved-ref state target) → visual?
state : scene-state? target : (or/c visual? symbol? visual-path?)
Returns the concrete addressed Visual for target in state.
Ordinary Visuals are returned unchanged. A derived-visual? is evaluated
against a read-only context built from this exact immutable state. The resolver may recursively request other top-level Visuals. Dependency
cycles are rejected, and each result is validated for concrete-Visual type and
identity preservation.
procedure
→ (listof visual?) state : scene-state?
Returns concrete top-level Visuals in significant back-to-front order,
resolving every derived definition against state. All entries share one
local dependency-resolution traversal, so shared dependencies resolve
consistently even when the dependent appears before its dependency in drawing
order. The Pict scene adapter uses this operation without mutating stored state.
procedure
(scene-state-value-has? state id) → boolean?
state : scene-state? id : (or/c symbol? scene-parameter?)
Returns #t when state contains the named semantic value
identified by id. Named values are semantic state and are not rendered.
Value and Visual identifiers share one global scene namespace.
procedure
(scene-state-value-ref state id) → any/c
state : scene-state? id : (or/c symbol? scene-parameter?)
Returns the named interpolable semantic value identified by id. Raises an exception
when the value is absent.