#[non_exhaustive]pub struct StationOrientation {
pub axis: Option<DVec3>,
pub ref_direction: Option<DVec3>,
}Expand description
An explicit in-section orientation at a station (#246).
Both vectors are components in the station’s base frame, (tangent, lateral, up); see the module documentation for their meaning,
defaults and orthonormalisation. Both absent is the base frame itself,
the Default.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.axis: Option<DVec3>The oriented frame’s up (local Z), exact; None for (0, 0, 1).
ref_direction: Option<DVec3>The direction the oriented frame’s tangent role (local X) is
taken from, made perpendicular to the axis; None for (1, 0, 0).
Implementations§
Source§impl StationOrientation
impl StationOrientation
Sourcepub const fn new(
axis: Option<DVec3>,
ref_direction: Option<DVec3>,
) -> StationOrientation
pub const fn new( axis: Option<DVec3>, ref_direction: Option<DVec3>, ) -> StationOrientation
An orientation from an optional axis and reference direction, both in the base frame.
Sourcepub const fn is_base(&self) -> bool
pub const fn is_base(&self) -> bool
Whether neither vector is given, so the base frame is used as is.
Sourcepub fn unit_axes(&self) -> Result<(DVec3, DVec3), &'static str>
pub fn unit_axes(&self) -> Result<(DVec3, DVec3), &'static str>
The unit axis and unit reference direction, defaults filled in.
§Errors
Why there are none, worded for
GraphError::InvalidStation:
a zero or non-finite vector, or the two parallel or anti-parallel
within ORIENTATION_TOLERANCE.
Trait Implementations§
Source§impl Clone for StationOrientation
impl Clone for StationOrientation
Source§fn clone(&self) -> StationOrientation
fn clone(&self) -> StationOrientation
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for StationOrientation
Source§impl Debug for StationOrientation
impl Debug for StationOrientation
Source§impl Default for StationOrientation
impl Default for StationOrientation
Source§fn default() -> StationOrientation
fn default() -> StationOrientation
Source§impl<'de> Deserialize<'de> for StationOrientation
impl<'de> Deserialize<'de> for StationOrientation
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<StationOrientation, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<StationOrientation, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for StationOrientation
impl PartialEq for StationOrientation
Source§impl Serialize for StationOrientation
impl Serialize for StationOrientation
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for StationOrientation
Auto Trait Implementations§
impl Freeze for StationOrientation
impl RefUnwindSafe for StationOrientation
impl Send for StationOrientation
impl Sync for StationOrientation
impl Unpin for StationOrientation
impl UnsafeUnpin for StationOrientation
impl UnwindSafe for StationOrientation
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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> ⓘ
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> ⓘ
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