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: boolMirror on the x-axis?
rotation: AngleRotation by a multiple of 90 degrees.
magnification: TEnlargement.
displacement: Vector<T>Translation.
Implementations§
Source§impl<T> SimpleTransform<T>
impl<T> SimpleTransform<T>
Source§impl<T: Zero + One> SimpleTransform<T>
impl<T: Zero + One> SimpleTransform<T>
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 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.
Source§impl<T> SimpleTransform<T>
impl<T> SimpleTransform<T>
Sourcepub fn transform_distance(&self, d: T) -> T
pub fn transform_distance(&self, d: T) -> T
Transform a distance.
Source§impl<T: CoordinateType> SimpleTransform<T>
impl<T: CoordinateType> SimpleTransform<T>
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 transform_point(&self, p: Point<T>) -> Point<T>
pub fn transform_point(&self, p: Point<T>) -> Point<T>
Transform a single point.
Sourcepub fn inverse_transform_point(&self, p: Point<T>) -> Point<T>
pub fn inverse_transform_point(&self, p: Point<T>) -> Point<T>
Inverse-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§
Source§impl<T: Clone> Clone for SimpleTransform<T>
impl<T: Clone> Clone for SimpleTransform<T>
Source§fn clone(&self) -> SimpleTransform<T>
fn clone(&self) -> SimpleTransform<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Debug> Debug for SimpleTransform<T>
impl<T: Debug> Debug for SimpleTransform<T>
Source§impl<T: CoordinateType> Default for SimpleTransform<T>
impl<T: CoordinateType> Default for SimpleTransform<T>
Source§impl<T: PartialEq> PartialEq for SimpleTransform<T>
impl<T: PartialEq> PartialEq for SimpleTransform<T>
Source§impl<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>
Source§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.
impl<T: Copy> Copy for SimpleTransform<T>
impl<T: Eq> Eq for SimpleTransform<T>
impl<T> StructuralPartialEq for SimpleTransform<T>
Auto Trait Implementations§
impl<T> Freeze for SimpleTransform<T>where
T: Freeze,
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§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more