pub struct Scene { /* private fields */ }Expand description
The records a window draws together with the hit targets built from them.
Implementations§
Source§impl Scene
impl Scene
Sourcepub fn diagnostics(&self) -> &RenderDiagnostics
pub fn diagnostics(&self) -> &RenderDiagnostics
The diagnostics shared by the scene and its hit targets.
Sourcepub fn store(&self) -> &SceneStore
pub fn store(&self) -> &SceneStore
The records the scene draws.
Sourcepub fn follow(&mut self, events: RecordEvents)
pub fn follow(&mut self, events: RecordEvents)
Keeps the changes of the kinds in events for the scene’s readers
from the next update on, beside the leaves the scene reads itself;
see SceneStore::follow.
Sourcepub fn root_layer(&self) -> Option<LayerRef<'_>>
pub fn root_layer(&self) -> Option<LayerRef<'_>>
The root record, None while the scene is empty.
Sourcepub fn edit_store(&mut self, edit: impl FnOnce(&mut SceneStore))
pub fn edit_store(&mut self, edit: impl FnOnce(&mut SceneStore))
Runs edit on the scene’s records in a new update. The hit targets
follow them.
Sourcepub fn rebuild_from_applier(&mut self, applier: &MemoryApplier, root: NodeId)
pub fn rebuild_from_applier(&mut self, applier: &MemoryApplier, root: NodeId)
Lowers the layout tree below root again from the applier, its records
reusing the scene’s storage. The hit targets follow it.
Sourcepub fn hit_targets(&self) -> Vec<HitRegion>
pub fn hit_targets(&self) -> Vec<HitRegion>
The hit targets in draw order, the last drawn at the end.
Sourcepub fn hit_storage(&self) -> HitStorage
pub fn hit_storage(&self) -> HitStorage
How much storage the hit targets take.
Sourcepub fn update_from_applier(
&mut self,
applier: &MemoryApplier,
root: NodeId,
updates: &[(NodeId, NodeUpdate)],
) -> bool
pub fn update_from_applier( &mut self, applier: &MemoryApplier, root: NodeId, updates: &[(NodeId, NodeUpdate)], ) -> bool
Applies content and layer-property changes to the scene’s records
in place and returns true, or rebuilds the scene and returns
false: for empty updates, an empty scene or an update that cannot
be applied in place. The hit targets follow the records when the
update changed a hit target or the geometry above one: each updated
layer compares its hit state, and the layers beneath one built again,
before and after.
Trait Implementations§
Source§impl HitGraphSink for Scene
impl HitGraphSink for Scene
Source§fn push_hit(
&mut self,
node_id: NodeId,
capture_path: &[NodeId],
geometry: HitGeometry<'_>,
hit: &HitTestNode,
)
fn push_hit( &mut self, node_id: NodeId, capture_path: &[NodeId], geometry: HitGeometry<'_>, hit: &HitTestNode, )
capture_path lists the node first and then its pointer-input
ancestors from the nearest outward, and geometry is in window space.Source§fn surface_holds(&self) -> Option<&SurfaceHolds>
fn surface_holds(&self) -> Option<&SurfaceHolds>
None for a sink that
sends no gestures, where each scene’s pick keeps its own.Source§impl RenderScene for Scene
impl RenderScene for Scene
Source§fn trim(&mut self) -> bool
fn trim(&mut self) -> bool
Source§fn hit_test(&self, x: f32, y: f32) -> Vec<<Scene as RenderScene>::HitTarget>
fn hit_test(&self, x: f32, y: f32) -> Vec<<Scene as RenderScene>::HitTarget>
Source§fn hit_test_near(
&self,
x: f32,
y: f32,
) -> Option<<Scene as RenderScene>::HitTarget>
fn hit_test_near( &self, x: f32, y: f32, ) -> Option<<Scene as RenderScene>::HitTarget>
Source§fn find_target(
&self,
node_id: NodeId,
) -> Option<<Scene as RenderScene>::HitTarget>
fn find_target( &self, node_id: NodeId, ) -> Option<<Scene as RenderScene>::HitTarget>
Source§fn hit_test_ray(
&self,
scene: NodeId,
ray: Ray,
) -> Vec<<Scene as RenderScene>::HitTarget>
fn hit_test_ray( &self, scene: NodeId, ray: Ray, ) -> Vec<<Scene as RenderScene>::HitTarget>
scene
shows that ray reaches, in the space the scene’s eye stands in,
ordered by z-index (top-to-bottom): a controller’s, a hand’s or a
gaze’s, which need not start at the eye.Source§fn surface_windows(&self, visit: &mut dyn FnMut(NodeId, ProjectiveTransform))
fn surface_windows(&self, visit: &mut dyn FnMut(NodeId, ProjectiveTransform))
Source§fn surface_window_bounds(&self, node_id: NodeId) -> Option<Rect>
fn surface_window_bounds(&self, node_id: NodeId) -> Option<Rect>
node_id shows in the window when it lies on
a mesh surface of a 3D scene: its bounds as the scene’s camera shows
them, also through a doorway and for an eye that walked through one.
None for a flat target, a target behind the eye or no target.Source§fn node_window_bounds(&self, visit: &mut dyn FnMut(NodeId, Rect))
fn node_window_bounds(&self, visit: &mut dyn FnMut(NodeId, Rect))
Source§fn layer_moves(&self) -> u64
fn layer_moves(&self) -> u64
offset_with does: what read Self::node_window_bounds
reads them again when it changes.Source§fn draws(&self, node: NodeId) -> bool
fn draws(&self, node: NodeId) -> bool
node. A scene that keeps no record of the nodes it draws says
it does.Source§fn drawn_parent(&self, node: NodeId) -> Option<NodeId>
fn drawn_parent(&self, node: NodeId) -> Option<NodeId>
node: the node the scene draws
again for node to leave it. None when the scene draws no record for node, or that
record is its root.Source§fn read_left_nodes(&mut self, left: &mut Vec<NodeId>) -> bool
fn read_left_nodes(&mut self, left: &mut Vec<NodeId>) -> bool
left the layout nodes whose records the scene dropped since the last call; a
node may draw through another record since, as Self::draws tells. Returns whether the
scene can tell: a scene handed a store built from scratch since cannot, and the caller
asks Self::draws of every node instead.