Struct libreda_pnr::db::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 a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

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 !=.

Serialize this value into the given Serde serializer. Read more

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

Cast to target data type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.