Struct libreda_db::layout::prelude::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> SimpleTransform<T> where
T: CoordinateType,
[src]
T: CoordinateType,
pub fn new(
mirror: bool,
rotation: Angle,
magnification: T,
displacement: Vector<T>
) -> SimpleTransform<T>
[src]
mirror: bool,
rotation: Angle,
magnification: T,
displacement: Vector<T>
) -> SimpleTransform<T>
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]
V: Into<Vector<T>>,
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]
T: CoordinateType + Clone,
pub fn clone(&self) -> SimpleTransform<T>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T> Debug for SimpleTransform<T> where
T: CoordinateType + Debug,
[src]
T: CoordinateType + Debug,
impl<T> Default for SimpleTransform<T> where
T: CoordinateType + Default,
[src]
T: CoordinateType + Default,
pub fn default() -> SimpleTransform<T>
[src]
impl<T> PartialEq<SimpleTransform<T>> for SimpleTransform<T> where
T: CoordinateType + PartialEq<T>,
[src]
T: CoordinateType + PartialEq<T>,
pub fn eq(&self, other: &SimpleTransform<T>) -> bool
[src]
pub fn ne(&self, other: &SimpleTransform<T>) -> bool
[src]
impl<T> StructuralPartialEq for SimpleTransform<T> where
T: CoordinateType,
[src]
T: CoordinateType,
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>,