Skip to main content

CantLayout

Struct CantLayout 

Source
#[non_exhaustive]
pub struct CantLayout { pub entity: EntityId, pub rail_head_distance: f64, /* private fields */ }
Expand description

One resolved, ordered, continuity-checked cant profile.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§entity: EntityId

The IfcAlignmentCant entity this layout was resolved from.

§rail_head_distance: f64

RailHeadDistance: track gauge used to convert cant to superelevation angle, in metres.

Implementations§

Source§

impl CantLayout

Source

pub fn frame_at_distance( &self, distance_along: f64, ) -> AlignmentResult<CantFrame>

The cant cross-section at an absolute distance along.

§Errors

Refuses a distance outside the profile’s span, a segment whose cant cannot be evaluated exactly, and a cant exceeding the RailHeadDistance (|D| > b, no real bank angle).

Source§

impl CantLayout

Source

pub fn resolve( model: &Model, entity: EntityId, units: AlignmentUnits, ) -> AlignmentResult<Self>

Resolve IfcAlignmentCant#entity’s nested IfcAlignmentSegment chain into an ordered, continuity-checked cant profile.

The zero-length segment IFC4.3 requires at the end of a layout is kept in Self::segments; its station and start cant are checked against the previous segment’s end like any seam. A zero-length segment anywhere else, or as the only segment, is refused (AlignmentError::SemanticViolation).

Source

pub fn for_alignment( model: &Model, alignment: EntityId, units: AlignmentUnits, ) -> AlignmentResult<Self>

The cant layout of IfcAlignment#alignment.

Unlike the gradient-curve composition, where a road without cant is ordinary, this is the call for work that NEEDS cant (the section frames, the IfcSegmentedReferenceCurve role), so its absence is a refusal rather than None.

§Errors

Refuses a model that is not IFC4X3, an entity that is not an IfcAlignment, an alignment nesting no IfcAlignmentCant or several of them (SemanticViolation: picking one would silently choose a track), and everything Self::resolve refuses.

Source

pub fn segments(&self) -> &[CantSegment]

Segments in authored (distance-along) order.

Source

pub fn length(&self) -> f64

Total distance-along span covered by this profile.

Source

pub fn cant_at_distance( &self, distance_along: f64, ) -> AlignmentResult<CantAtStation>

Cant at an absolute distance-along value within this profile’s span.

Trait Implementations§

Source§

impl Clone for CantLayout

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CantLayout

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for CantLayout

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for CantLayout

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.