pub struct RenderScene { /* private fields */ }Expand description
The scene: insertion-ordered solids + an exact name index (R8 — the
getObjectByName heuristic-scoring lookup is replaced by this map).
Implementations§
Source§impl RenderScene
impl RenderScene
pub fn new() -> Self
Sourcepub fn insert_solid(&mut self, solid: SolidDisplay)
pub fn insert_solid(&mut self, solid: SolidDisplay)
Insert or replace a solid by name (replacement keeps insertion order — a boolean result reusing its target’s name stays in place).
Sourcepub fn drain(&mut self) -> Vec<SolidDisplay>
pub fn drain(&mut self) -> Vec<SolidDisplay>
Empty the scene, RETURNING every solid by value (the name index is cleared
and the vec is mem::take-n out). The history-apply seam MOVES existing
displays out this way to reinsert the reused ones without cloning their
meshes — a scene-free crate::pipeline::SceneRunner delta is applied by
draining then reinserting in snapshot order.
Sourcepub fn set_color_override(
&mut self,
name: &str,
color: Option<[f32; 3]>,
) -> bool
pub fn set_color_override( &mut self, name: &str, color: Option<[f32; 3]>, ) -> bool
Set (or clear) a solid’s metadata color override, bumping its revision so the renderer re-derives the base style. Returns false if unknown.
Sourcepub fn set_visible(&mut self, name: &str, visible: bool) -> bool
pub fn set_visible(&mut self, name: &str, visible: bool) -> bool
Set a solid’s visibility (R11). Returns false if unknown.
Sourcepub fn listing_json(&self) -> String
pub fn listing_json(&self) -> String
Scene enumeration for the host scene-tree panel (R11): names, kind, visibility, child face/edge/vertex counts — as JSON.
Sourcepub fn remove_solid(&mut self, name: &str) -> bool
pub fn remove_solid(&mut self, name: &str) -> bool
Remove a solid by exact name.
pub fn solid(&self, name: &str) -> Option<&SolidDisplay>
pub fn solid_mut(&mut self, name: &str) -> Option<&mut SolidDisplay>
Sourcepub fn solids(&self) -> &[SolidDisplay]
pub fn solids(&self) -> &[SolidDisplay]
Insertion-ordered iteration (deterministic — drives draw order).
Sourcepub fn edge_polyline_world(&self, name: &str) -> Option<Vec<[f64; 3]>>
pub fn edge_polyline_world(&self, name: &str) -> Option<Vec<[f64; 3]>>
The world-space polyline of the first display edge named name across all
solids (widened to f64), or None when no edge carries that exact name.
The engine-native sketch pickEdges tool (S6b-2) uses this to fetch a picked
scene edge’s geometry for projection into the sketch plane. There is no name
index for edges (only solids), so this is a linear scan — fine for the
interactive per-click use.
Sourcepub fn edge_solid_name(&self, name: &str) -> Option<&str>
pub fn edge_solid_name(&self, name: &str) -> Option<&str>
The name of the solid owning the first display edge named name, or None
(the companion of edge_polyline_world — the
pickEdges tool stores it as external-ref metadata).
pub fn is_empty(&self) -> bool
Source§impl RenderScene
impl RenderScene
Sourcepub fn set_entity_visible(
&mut self,
solid: &str,
kind: EntityKind,
index: usize,
visible: bool,
) -> bool
pub fn set_entity_visible( &mut self, solid: &str, kind: EntityKind, index: usize, visible: bool, ) -> bool
Show/hide ONE face/edge/vertex of a solid. False if the solid is unknown.
Sourcepub fn set_group_visible(
&mut self,
solid: &str,
kind: EntityKind,
visible: bool,
) -> bool
pub fn set_group_visible( &mut self, solid: &str, kind: EntityKind, visible: bool, ) -> bool
Show/hide a whole group (all faces / all edges / all vertices) of a solid. False if the solid is unknown.
Sourcepub fn entity_visible(
&self,
solid: &str,
kind: EntityKind,
index: usize,
) -> Option<bool>
pub fn entity_visible( &self, solid: &str, kind: EntityKind, index: usize, ) -> Option<bool>
Whether entity index of kind on solid is shown (None if unknown).
Sourcepub fn group_visibility(
&self,
solid: &str,
kind: EntityKind,
) -> Option<GroupState>
pub fn group_visibility( &self, solid: &str, kind: EntityKind, ) -> Option<GroupState>
The group tristate for solid’s kind (None if the solid is unknown).
Trait Implementations§
Source§impl Debug for RenderScene
impl Debug for RenderScene
Source§impl Default for RenderScene
impl Default for RenderScene
Source§fn default() -> RenderScene
fn default() -> RenderScene
Auto Trait Implementations§
impl Freeze for RenderScene
impl RefUnwindSafe for RenderScene
impl Send for RenderScene
impl Sync for RenderScene
impl Unpin for RenderScene
impl UnsafeUnpin for RenderScene
impl UnwindSafe for RenderScene
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more