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: Copy + Into<DAffine3>, T: ApplyTransform<G>> ApplyTransform<G> for Vec<T>

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Implementors§

Source§

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

Source§

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

Source§

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