pub struct SceneGraph { /* private fields */ }Expand description
Arena-based scene graph with generational indices.
Implementations§
Source§impl SceneGraph
impl SceneGraph
Sourcepub fn remove(&mut self, id: NodeId) -> Option<Node>
pub fn remove(&mut self, id: NodeId) -> Option<Node>
Remove a node by ID. Returns the node if it existed.
Sourcepub fn insert_child(&mut self, parent: NodeId, node: Node) -> NodeId
pub fn insert_child(&mut self, parent: NodeId, node: Node) -> NodeId
Insert a node as a child of parent.
Sourcepub fn iter(&self) -> impl Iterator<Item = (NodeId, &Node)>
pub fn iter(&self) -> impl Iterator<Item = (NodeId, &Node)>
Iterate over all live (NodeId, &Node) pairs.
Sourcepub fn world_transform(&self, id: NodeId) -> Affine2D
pub fn world_transform(&self, id: NodeId) -> Affine2D
Compute the world transform for a node by walking up the parent chain.
Sourcepub fn collect_marks(&self) -> Vec<(NodeId, Affine2D)>
pub fn collect_marks(&self) -> Vec<(NodeId, Affine2D)>
Collect all leaf marks in z-order (depth-first, sorted by z_order within siblings).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SceneGraph
impl RefUnwindSafe for SceneGraph
impl Send for SceneGraph
impl Sync for SceneGraph
impl Unpin for SceneGraph
impl UnsafeUnpin for SceneGraph
impl UnwindSafe 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