pub struct Reshape { /* private fields */ }Expand description
A batch of substitutions, applied in one rebuild.
Implementations§
Source§impl Reshape
impl Reshape
Sourcepub fn split(&mut self, old: &Shape, pieces: Vec<Shape>)
pub fn split(&mut self, old: &Shape, pieces: Vec<Shape>)
Replace every occurrence of old with pieces, in order: an edge
cut in a wire, a face cut in a shell. A reversed occurrence takes
the pieces reversed, in reverse order.
Sourcepub fn apply(&self, model: &mut Model, shape: &Shape) -> OgeomResult<Built>
pub fn apply(&self, model: &mut Model, shape: &Shape) -> OgeomResult<Built>
Apply the batch over shape, rebuilding what the substitutions
touch and sharing everything they do not.
§Errors
OgeomError::Construction if
a rebuilt container ends up empty where the model forbids it, or a
substitution’s kind does not fit its slot.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Reshape
impl RefUnwindSafe for Reshape
impl Send for Reshape
impl Sync for Reshape
impl Unpin for Reshape
impl UnsafeUnpin for Reshape
impl UnwindSafe for Reshape
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
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.