Struct iron_shapes::transform::SimpleTransform
source · [−]pub struct SimpleTransform<T> {
pub mirror: bool,
pub rotation: Angle,
pub magnification: T,
pub displacement: Vector<T>,
}
Expand description
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
sourceimpl<T: CoordinateType> SimpleTransform<T>
impl<T: CoordinateType> SimpleTransform<T>
sourcepub fn new(
mirror: bool,
rotation: Angle,
magnification: T,
displacement: Vector<T>
) -> Self
pub fn new(
mirror: bool,
rotation: Angle,
magnification: T,
displacement: Vector<T>
) -> Self
Create a new transformation.
sourcepub fn rotate90(angle: Angle) -> Self
pub fn rotate90(angle: Angle) -> Self
Create a rotation by an integer multiple of 90 degrees. Rotation center is (0, 0).
sourcepub fn rotate90_around(angle: Angle, rotation_center: Point<T>) -> Self
pub fn rotate90_around(angle: Angle, rotation_center: Point<T>) -> Self
Create a rotation arount rotation_center
by an integer multiple of 90 degrees.
sourcepub fn rotate_ccw90() -> Self
pub fn rotate_ccw90() -> Self
Rotate 90 degrees counter-clock wise.
sourcepub fn rotate_cw90() -> Self
pub fn rotate_cw90() -> Self
Rotate 90 degrees counter-clock wise.
sourcepub fn transform_distance(&self, d: T) -> T
pub fn transform_distance(&self, d: T) -> T
Transform a distance.
sourcepub fn transform_point(&self, p: Point<T>) -> Point<T>
pub fn transform_point(&self, p: Point<T>) -> Point<T>
Transform a single point.
sourcepub fn to_matrix_transform(&self) -> Matrix3dTransform<T>
pub fn to_matrix_transform(&self) -> Matrix3dTransform<T>
Convert to a matrix transformation.
Trait Implementations
sourceimpl<T: Clone> Clone for SimpleTransform<T>
impl<T: Clone> Clone for SimpleTransform<T>
sourcefn clone(&self) -> SimpleTransform<T>
fn clone(&self) -> SimpleTransform<T>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<T: Debug> Debug for SimpleTransform<T>
impl<T: Debug> Debug for SimpleTransform<T>
sourceimpl<T: CoordinateType> Default for SimpleTransform<T>
impl<T: CoordinateType> Default for SimpleTransform<T>
sourceimpl<T: PartialEq> PartialEq<SimpleTransform<T>> for SimpleTransform<T>
impl<T: PartialEq> PartialEq<SimpleTransform<T>> for SimpleTransform<T>
sourcefn eq(&self, other: &SimpleTransform<T>) -> bool
fn eq(&self, other: &SimpleTransform<T>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &SimpleTransform<T>) -> bool
fn ne(&self, other: &SimpleTransform<T>) -> bool
This method tests for !=
.
sourceimpl<T: CoordinateType + NumCast, Dst: CoordinateType + NumCast> TryCastCoord<T, Dst> for SimpleTransform<T>
impl<T: CoordinateType + NumCast, Dst: CoordinateType + NumCast> TryCastCoord<T, Dst> for SimpleTransform<T>
type Output = SimpleTransform<Dst>
type Output = SimpleTransform<Dst>
Output type of the cast. This is likely the same geometrical type just with other coordinate types. Read more
impl<T: Copy> Copy for SimpleTransform<T>
impl<T> StructuralPartialEq for SimpleTransform<T>
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more