Struct iron_shapes::transform::SimpleTransform [−][src]
Describes a geometric transformation that consists of a optional mirroring along the x-axis followed by a rotation by a multiple of 90 degrees followed by a displacement.
Fields
mirror: bool
Mirror on the x-axis?
rotation: Angle
Rotation by a multiple of 90 degrees.
magnification: T
Enlargement.
displacement: Vector<T>
Translation.
Implementations
impl<T: CoordinateType> SimpleTransform<T>
[src]
pub fn new(
mirror: bool,
rotation: Angle,
magnification: T,
displacement: Vector<T>
) -> Self
[src]
mirror: bool,
rotation: Angle,
magnification: T,
displacement: Vector<T>
) -> Self
Create a new transformation.
pub fn identity() -> Self
[src]
Get the identity transform.
pub fn translate<V: Into<Vector<T>>>(v: V) -> Self
[src]
Create a translation by a vector.
pub fn rotate90(angle: Angle) -> Self
[src]
Create a rotation by an integer multiple of 90 degrees.
pub fn scale(factor: T) -> Self
[src]
Create a scaling by a factor.
pub fn mirror_x() -> Self
[src]
Create a transformation that mirrors at the x-axis.
pub fn mirror_y() -> Self
[src]
Create a transformation that mirrors at the y-axis.
pub fn transform_distance(&self, d: T) -> T
[src]
Transform a distance.
pub fn transform_point(&self, p: Point<T>) -> Point<T>
[src]
Transform a single point.
pub fn to_matrix_transform(&self) -> Matrix3dTransform<T>
[src]
Convert to a matrix transformation.
pub fn then(&self, t: &Self) -> Self
[src]
Return a new transformation that is equal to applying
first self
then t
.
Trait Implementations
impl<T: Clone + CoordinateType> Clone for SimpleTransform<T>
[src]
fn clone(&self) -> SimpleTransform<T>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T: Debug + CoordinateType> Debug for SimpleTransform<T>
[src]
impl<T: Default + CoordinateType> Default for SimpleTransform<T>
[src]
fn default() -> SimpleTransform<T>
[src]
impl<T: PartialEq + CoordinateType> PartialEq<SimpleTransform<T>> for SimpleTransform<T>
[src]
fn eq(&self, other: &SimpleTransform<T>) -> bool
[src]
fn ne(&self, other: &SimpleTransform<T>) -> bool
[src]
impl<T: CoordinateType> StructuralPartialEq for SimpleTransform<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for SimpleTransform<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for SimpleTransform<T> where
T: Send,
T: Send,
impl<T> Sync for SimpleTransform<T> where
T: Sync,
T: Sync,
impl<T> Unpin for SimpleTransform<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for SimpleTransform<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,