pub struct Reshape { /* private fields */ }Expand description
A batch of substitutions, applied in one rebuild.
Implementations§
Source§impl Reshape
impl Reshape
Sourcepub fn replace(&mut self, old: &Shape, new: Shape)
pub fn replace(&mut self, old: &Shape, new: Shape)
Replace every occurrence of old’s node with new, stated in the
frame old is given in: an occurrence placed elsewhere takes new
carried by the placement taking old onto it.
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’s node 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. The pieces are stated
in old’s frame, as in Reshape::replace.
Sourcepub fn replace_at(&mut self, occurrence: &Shape, new: Shape)
pub fn replace_at(&mut self, occurrence: &Shape, new: Shape)
Replace occurrence alone, at the placement it has in the shape
the batch is applied to, with new, stated in that shape’s frame.
Other occurrences of the node keep it. Takes precedence over a
request on the node.
Sourcepub fn remove_at(&mut self, occurrence: &Shape)
pub fn remove_at(&mut self, occurrence: &Shape)
Remove occurrence alone, as Reshape::replace_at names it.
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
§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>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
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
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.