Skip to main content

ApplyTransform

Trait ApplyTransform 

Source
pub trait ApplyTransform<G> {
    // Required method
    fn apply(&mut self, transform: G) -> &mut Self;
}
Expand description

A group action of G on Self: baking a transform into the item’s data.

This is the single primitive trait of the transform system. A type declares its closure group by the bound it implements this trait for:

  • impl<G: Into<DAffine3>> ApplyTransform<G> for T — affine closure (point-data types: VItem, polygons, meshes, …),
  • impl<G: Into<Similarity>> ApplyTransform<G> for T — similarity closure (circles, spheres, squares, circular arcs, …).

The operation traits (ShiftTransform, RotateTransform, ScaleTransform, UniformScaleTransform) are blanket-derived from this trait, so implementing ApplyTransform<G> provides them automatically — and opts out of implementing them manually (the coherence conflict is intentional: it keeps one method name meaning one group action across all types).

Required Methods§

Source

fn apply(&mut self, transform: G) -> &mut Self

Bake transform (expressed in world coordinates) into the item’s data, in place.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<G, T> ApplyTransform<G> for Vec<T>
where G: Copy + Into<DAffine3>, T: ApplyTransform<G>,

Source§

fn apply(&mut self, transform: G) -> &mut Vec<T>

Source§

impl<G, T> ApplyTransform<G> for [T]
where G: Copy + Into<DAffine3>, T: ApplyTransform<G>,

Source§

fn apply(&mut self, transform: G) -> &mut [T]

Source§

impl<G> ApplyTransform<G> for ArcBetweenPoints
where G: Into<Similarity>,

Source§

fn apply(&mut self, transform: G) -> &mut ArcBetweenPoints

Source§

impl<G> ApplyTransform<G> for DVec3
where G: Into<DAffine3>,

Source§

fn apply(&mut self, transform: G) -> &mut DVec3

Source§

impl<G> ApplyTransform<G> for Line
where G: Into<DAffine3>,

Source§

fn apply(&mut self, transform: G) -> &mut Line

Source§

impl<G> ApplyTransform<G> for MeshItem
where G: Into<DAffine3>,

Source§

fn apply(&mut self, transform: G) -> &mut MeshItem

Source§

impl<G> ApplyTransform<G> for Parallelogram
where G: Into<DAffine3>,

Source§

fn apply(&mut self, transform: G) -> &mut Parallelogram

Source§

impl<G> ApplyTransform<G> for Polygon
where G: Into<DAffine3>,

Source§

fn apply(&mut self, transform: G) -> &mut Polygon

Source§

impl<G> ApplyTransform<G> for Surface
where G: Into<DAffine3>,

Source§

fn apply(&mut self, transform: G) -> &mut Surface

Source§

impl<G> ApplyTransform<G> for SvgItem
where G: Into<DAffine3>,

Source§

fn apply(&mut self, transform: G) -> &mut SvgItem

Source§

impl<G> ApplyTransform<G> for TypstText
where G: Into<DAffine3>,

Source§

fn apply(&mut self, transform: G) -> &mut TypstText

Source§

impl<G> ApplyTransform<G> for VItem
where G: Into<DAffine3>,

Source§

fn apply(&mut self, transform: G) -> &mut VItem

Implementors§

Source§

impl<G> ApplyTransform<G> for CameraFrame
where G: Into<DAffine3>,

Source§

impl<G> ApplyTransform<G> for VPointVec
where G: Into<DAffine3>,

Source§

impl<T, G, H> ApplyTransform<H> for Transformed<T, G>
where G: TransformGroup + From<H>,