Enum geometry::orientation::NamedOrientation
source · #[non_exhaustive]pub enum NamedOrientation {
R0,
ReflectVert,
ReflectHoriz,
R90,
R180,
R270,
R90Cw,
R180Cw,
R270Cw,
FlipYx,
FlipMinusYx,
}
Expand description
A named orientation.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
R0
No rotations or reflections.
ReflectVert
Reflect vertically (ie. about the x-axis).
ReflectHoriz
Reflect horizontally (ie. about the y-axis).
R90
Rotate 90 degrees counter-clockwise.
R180
Rotate 180 degrees counter-clockwise.
R270
Rotate 270 degrees counter-clockwise.
R90Cw
Rotate 90 degrees clockwise.
R180Cw
Rotate 180 degrees clockwise.
R270Cw
Rotate 270 degrees clockwise.
FlipYx
Flip across the line y = x.
FlipMinusYx
Flip across the line y = -x.
Implementations§
source§impl NamedOrientation
impl NamedOrientation
sourcepub fn all_rectangular() -> [Self; 8]
pub fn all_rectangular() -> [Self; 8]
Returns a slice of all 8 possible named rectangular orientations.
Users should not rely upon the order of the orientations returned.
sourcepub fn into_orientation(self) -> Orientation
pub fn into_orientation(self) -> Orientation
Converts this named orientation into a regular Orientation
.
sourcepub fn from_orientation(orientation: Orientation) -> Option<Self>
pub fn from_orientation(orientation: Orientation) -> Option<Self>
Attempts to convert the given orientation to a named orientation.
The conversion is based on approximate equality.
If no named orientation is approximately equal to orientation
,
returns None
.
Trait Implementations§
source§impl Clone for NamedOrientation
impl Clone for NamedOrientation
source§fn clone(&self) -> NamedOrientation
fn clone(&self) -> NamedOrientation
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for NamedOrientation
impl Debug for NamedOrientation
source§impl Default for NamedOrientation
impl Default for NamedOrientation
source§fn default() -> NamedOrientation
fn default() -> NamedOrientation
source§impl<'de> Deserialize<'de> for NamedOrientation
impl<'de> Deserialize<'de> for NamedOrientation
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl From<NamedOrientation> for Orientation
impl From<NamedOrientation> for Orientation
source§fn from(value: NamedOrientation) -> Self
fn from(value: NamedOrientation) -> Self
source§impl Hash for NamedOrientation
impl Hash for NamedOrientation
source§impl PartialEq for NamedOrientation
impl PartialEq for NamedOrientation
source§fn eq(&self, other: &NamedOrientation) -> bool
fn eq(&self, other: &NamedOrientation) -> bool
self
and other
values to be equal, and is used
by ==
.