Struct libreda_db::layout::prelude::SimpleTransform [−][src]
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
Create a new transformation.
Get the identity transform.
Create a translation by a vector.
Create a rotation by an integer multiple of 90 degrees. Rotation center is (0, 0).
Create a rotation arount rotation_center
by an integer multiple of 90 degrees.
Rotate 90 degrees counter-clock wise.
Rotate 90 degrees counter-clock wise.
Create a scaling by a factor.
Create a transformation that mirrors at the x-axis.
Create a transformation that mirrors at the y-axis.
Transform a distance.
Transform a single point.
Convert to a matrix transformation.
Return a new transformation that is equal to applying
first self
then t
.
Trait Implementations
Returns the “default value” for a type. Read more
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<SimpleTransform<T>, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<SimpleTransform<T>, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<T, Dst> TryCastCoord<T, Dst> for SimpleTransform<T> where
T: CoordinateType + NumCast,
Dst: CoordinateType + NumCast,
impl<T, Dst> TryCastCoord<T, Dst> for SimpleTransform<T> where
T: CoordinateType + NumCast,
Dst: CoordinateType + NumCast,
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
Try to cast to target data type. Read more
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
Mutably borrows from an owned value. Read more