pub struct SceneGraph { /* private fields */ }Expand description
Arena of nodes for one scene run. Node 0 is the view (root).
Implementations§
Source§impl SceneGraph
impl SceneGraph
Sourcepub fn new(width: u32, height: u32) -> Rc<Self>
pub fn new(width: u32, height: u32) -> Rc<Self>
An empty scene of the given size in pixels, with only the root.
Sourcepub fn measure(&self, id: NodeId) -> (f64, f64)
pub fn measure(&self, id: NodeId) -> (f64, f64)
Size of a node’s box in its own (unscaled) coordinates.
Sourcepub fn pick(&self, p: Point) -> Option<NodeId>
pub fn pick(&self, p: Point) -> Option<NodeId>
Topmost node under p (scene coordinates), excluding the view.
Sourcepub fn world_transform(&self, id: NodeId) -> Option<Affine>
pub fn world_transform(&self, id: NodeId) -> Option<Affine>
World transform of a node (including layout offsets).
Sourcepub fn box_in(&self, id: NodeId, frame: NodeId) -> Option<Rect>
pub fn box_in(&self, id: NodeId, frame: NodeId) -> Option<Rect>
The box of id (its size around its origin) in the coordinate frame
of frame’s children: for a camera, where the node sits in the
world the camera looks at. Axis-aligned.
Sourcepub fn frame_size(&self) -> (f64, f64)
pub fn frame_size(&self) -> (f64, f64)
Frame size in pixels.
Sourcepub fn tree(
&self,
) -> Vec<(NodeId, Option<NodeId>, &'static str, Option<String>)>
pub fn tree( &self, ) -> Vec<(NodeId, Option<NodeId>, &'static str, Option<String>)>
(id, parent, kind, name) of every attached node, depth-first.
Sourcepub fn describe(&self, id: NodeId) -> Vec<(String, String)>
pub fn describe(&self, id: NodeId) -> Vec<(String, String)>
Current signal values of a node, for the inspector.
Sourcepub fn inspect_nodes(&self) -> Vec<InspectNode>
pub fn inspect_nodes(&self) -> Vec<InspectNode>
One record per attached node, in tree order, with scene-space bounds.
order is paint order (0 is the back). Nodes that are not drawn
(fully transparent) get u32::MAX.