pub struct Scene { /* private fields */ }
Expand description
A Carnelian scene is responsible for turning a collection of facets and groups into rendered pixels.
Implementations§
source§impl Scene
impl Scene
sourcepub fn round_scene_corners(&mut self, round_scene_corners: bool)
pub fn round_scene_corners(&mut self, round_scene_corners: bool)
Set the option to round scene corners.
sourcepub fn add_facet(&mut self, facet: FacetPtr) -> FacetId
pub fn add_facet(&mut self, facet: FacetPtr) -> FacetId
Add a facet to the scene, returning its ID.
sourcepub fn remove_facet(&mut self, facet_id: FacetId) -> Result<(), Error>
pub fn remove_facet(&mut self, facet_id: FacetId) -> Result<(), Error>
Remove a particular facet from the scene.
sourcepub fn move_facet_forward(&mut self, facet_id: FacetId) -> Result<(), Error>
pub fn move_facet_forward(&mut self, facet_id: FacetId) -> Result<(), Error>
Move a facet forward in the facet order list.
sourcepub fn move_facet_backward(&mut self, facet_id: FacetId) -> Result<(), Error>
pub fn move_facet_backward(&mut self, facet_id: FacetId) -> Result<(), Error>
Move a facet backwards in the facet order list.
sourcepub fn add_facet_to_group(
&mut self,
facet_id: FacetId,
group_id: GroupId,
member_data: Option<GroupMemberData>
)
pub fn add_facet_to_group( &mut self, facet_id: FacetId, group_id: GroupId, member_data: Option<GroupMemberData> )
Add a facet to a group, removing it from any group it might already belong to.
sourcepub fn remove_facet_from_group(&mut self, facet_id: FacetId, group_id: GroupId)
pub fn remove_facet_from_group(&mut self, facet_id: FacetId, group_id: GroupId)
Remove a facet from a group.
sourcepub fn set_group_arranger(&mut self, group_id: GroupId, arranger: ArrangerPtr)
pub fn set_group_arranger(&mut self, group_id: GroupId, arranger: ArrangerPtr)
Set the arranger for a group. No change in facet position will occur until layout is called.
sourcepub fn render(
&mut self,
render_context: &mut RenderContext,
ready_event: Event,
context: &ViewAssistantContext
) -> Result<(), Error>
pub fn render( &mut self, render_context: &mut RenderContext, ready_event: Event, context: &ViewAssistantContext ) -> Result<(), Error>
Render the scene. Expected to be called from the view assistant’s render method.
sourcepub fn send_message(&mut self, target: &FacetId, msg: Box<dyn Any>)
pub fn send_message(&mut self, target: &FacetId, msg: Box<dyn Any>)
Send a message to a facet.
sourcepub fn set_facet_location(&mut self, target: &FacetId, location: Point)
pub fn set_facet_location(&mut self, target: &FacetId, location: Point)
Set the absolute position of a facet.
sourcepub fn set_facet_size(&mut self, target: &FacetId, size: Size)
pub fn set_facet_size(&mut self, target: &FacetId, size: Size)
Set the size of a facet.
sourcepub fn get_facet_location(&self, target: &FacetId) -> Point
pub fn get_facet_location(&self, target: &FacetId) -> Point
Get the absolute position of a facet.
sourcepub fn get_facet_size(&self, target: &FacetId) -> Size
pub fn get_facet_size(&self, target: &FacetId) -> Size
Get the size of a facet.
sourcepub fn get_facet_bounds(&self, target: &FacetId) -> Rect
pub fn get_facet_bounds(&self, target: &FacetId) -> Rect
Get a rectangle created from the absolute position and size of a facet.
sourcepub fn layout(&mut self, target_size: Size)
pub fn layout(&mut self, target_size: Size)
Run the layout process, positioning groups and facets.
sourcepub fn all_facet_bounds(&self) -> Vec<Rect>
pub fn all_facet_bounds(&self) -> Vec<Rect>
Return the bounds of all facets.