Struct iron_shapes::transform::SimpleTransform[][src]

pub struct SimpleTransform<T: CoordinateType> {
    pub mirror: bool,
    pub rotation: Angle,
    pub magnification: T,
    pub displacement: Vector<T>,
}

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]

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]

impl<T: Debug + CoordinateType> Debug for SimpleTransform<T>[src]

impl<T: Default + CoordinateType> Default for SimpleTransform<T>[src]

impl<T: PartialEq + CoordinateType> PartialEq<SimpleTransform<T>> for SimpleTransform<T>[src]

impl<T: CoordinateType> StructuralPartialEq for SimpleTransform<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for SimpleTransform<T> where
    T: RefUnwindSafe

impl<T> Send for SimpleTransform<T> where
    T: Send

impl<T> Sync for SimpleTransform<T> where
    T: Sync

impl<T> Unpin for SimpleTransform<T> where
    T: Unpin

impl<T> UnwindSafe for SimpleTransform<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.