Skip to main content

SceneState

Struct SceneState 

Source
pub struct SceneState {
    pub part: Rc<PartView>,
    pub hidden: Option<Vec<String>>,
    pub instances: Vec<ViewInstance>,
    pub all: bool,
    pub removed: Vec<String>,
    pub components: BTreeMap<String, Rc<PartView>>,
    pub forgotten: Vec<String>,
    pub meshes: BTreeMap<String, Rc<FaceMesh>>,
    pub forgotten_meshes: Vec<String>,
    pub structure: Option<Vec<StructureItem>>,
}
Expand description

What is drawn: a part, and which of its sketches and datums not to.

Its faces’ triangles are sent by key, each mesh once (see SceneState::meshes).

The parts placed in it — however many, however deep — are sent as what changed since the last scene: a viewer keeps them by name, and the views of their components by key, each sent once. So moving one placed part sends where that one is, and placing a screw a hundred times sends what a screw looks like once.

Fields§

§part: Rc<PartView>

The part, without the parts placed in it: those are instances.

§hidden: Option<Vec<String>>

The sketches and datums the steps shown have used: what was made from them shows them now. None of a kind while it is being picked. Not sent — None — where it is as the last scene sent it: a drag moving one placed part does not send every name again.

§instances: Vec<ViewInstance>

The parts placed in the part drawn, however deep, that are new or moved or drawn from another component since the last scene — every one, if all.

§all: bool

Whether the scene is all there is: a viewer forgets any other placed parts, and every component and mesh it kept.

§removed: Vec<String>

The names of the placed parts drawn last time and gone now.

§components: BTreeMap<String, Rc<PartView>>

The views of the components the placed parts are drawn from, by key (see ViewInstance::component), that the viewer does not have: each is sent once, and kept until it is forgotten.

§forgotten: Vec<String>

The components the viewer forgets now: none of its placed parts has used them for longest. One is sent again once a placed part uses it. Those of a part that leaves the scene for a while are kept, so that editing a step before a large part placed after it does not send that part again when it shows again.

§meshes: BTreeMap<String, Rc<FaceMesh>>

The meshes of the faces drawn — of the part, and of the components sent — that the viewer does not have, by key (see crate::view::FaceMesh): a face is sent by the key of its mesh, and each mesh once, kept until it is forgotten_meshes. So showing a part again with other sketches, or with one face changed, sends the faces of none, or of that one.

§forgotten_meshes: Vec<String>

The meshes the viewer forgets now: no face drawn has used them for longest.

§structure: Option<Vec<StructureItem>>

What the part has beyond its faces, to list and show or hide (see crate::registry::Drawer::structure). Not sent — None — where it is as the last scene sent it.

Trait Implementations§

Source§

impl Clone for SceneState

Source§

fn clone(&self) -> SceneState

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SceneState

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Serialize for SceneState

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.