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 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.
Auto Trait Implementations§
impl !Freeze for SceneGraph
impl !RefUnwindSafe for SceneGraph
impl !Send for SceneGraph
impl !Sync for SceneGraph
impl !UnwindSafe for SceneGraph
impl Unpin for SceneGraph
impl UnsafeUnpin for SceneGraph
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more