Struct libreda_db::layout::prelude::SimpleTransform[][src]

pub struct SimpleTransform<T> where
    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> SimpleTransform<T> where
    T: CoordinateType
[src]

pub fn new(
    mirror: bool,
    rotation: Angle,
    magnification: T,
    displacement: Vector<T>
) -> SimpleTransform<T>
[src]

Create a new transformation.

pub fn identity() -> SimpleTransform<T>[src]

Get the identity transform.

pub fn translate<V>(v: V) -> SimpleTransform<T> where
    V: Into<Vector<T>>, 
[src]

Create a translation by a vector.

pub fn rotate90(angle: Angle) -> SimpleTransform<T>[src]

Create a rotation by an integer multiple of 90 degrees.

pub fn scale(factor: T) -> SimpleTransform<T>[src]

Create a scaling by a factor.

pub fn mirror_x() -> SimpleTransform<T>[src]

Create a transformation that mirrors at the x-axis.

pub fn mirror_y() -> SimpleTransform<T>[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: &SimpleTransform<T>) -> SimpleTransform<T>[src]

Return a new transformation that is equal to applying first self then t.

Trait Implementations

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

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

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

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

impl<T> StructuralPartialEq for SimpleTransform<T> where
    T: CoordinateType
[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.