Skip to main content

CirculationRequest

Struct CirculationRequest 

Source
pub struct CirculationRequest { /* private fields */ }
Expand description

A circulation map request for one space.

Entrances are never obstacles, and the scope is neither an entrance, a component nor an obstacle: the constructor removes them, as walkability does. The lists are sorted and deduplicated.

Implementations§

Source§

impl CirculationRequest

Source

pub fn try_new( scope: ObjectId, entrances: Vec<ObjectId>, components: Vec<ObjectId>, obstacles: Vec<ObjectId>, width_metres: f64, height_metres: f64, tolerance_metres: f64, ) -> Result<Self, FreeSpaceError>

A path width_metres wide, free height_metres above the scope’s floor, in scope; a subject is near a piece within half the width plus tolerance_metres.

§Errors

FreeSpaceError::InvalidClearanceShape for a width or height that is not positive and finite, or a tolerance that is negative or not finite.

Source

pub fn with_merged_scopes( self, merged: Vec<ObjectId>, ) -> Result<Self, FreeSpaceError>

Maps the union of the scope and merged scopes, such as the spaces of one room split by a virtual boundary, as one free area. Merged scopes stand on the scope’s floor and are never obstacles.

§Errors

FreeSpaceError::MergedScopeConflict when a merged scope is an entrance or a component.

Source

pub fn merged_scopes(&self) -> &[ObjectId]

The scopes mapped together with the scope, sorted.

Source

pub fn with_band_from(self, from_metres: f64) -> Result<Self, FreeSpaceError>

Counts obstacles only from from_metres above the floor up to the height, so a skirting or a low sill below it leaves the path free.

§Errors

FreeSpaceError::InvalidElevationBand for a start that is negative, not finite or not below the height.

Source

pub fn with_swept_doors( self, swept: Vec<SweptDoor>, ) -> Result<Self, FreeSpaceError>

Counts the sectors swept doors sweep as obstacles (see SweptDoor): a piece stays clear of their circumscribed polygons, a possible piece only of their inscribed ones. An entrance is walked through, so its own swing is dropped, as the entrance is from the obstacles.

§Errors

FreeSpaceError::ConflictingSweptDoors when one door is given twice with different sectors.

Source

pub fn swept_doors(&self) -> &[SweptDoor]

The doors whose swept sectors are obstacles, sorted by door.

Source

pub fn scope(&self) -> &ObjectId

The space the path runs in.

Source

pub fn entrances(&self) -> &[ObjectId]

The entrances the path starts from.

Source

pub fn components(&self) -> &[ObjectId]

The components the path must come near.

Source

pub fn obstacles(&self) -> &[ObjectId]

The objects that occupy floor, counted by what they occupy in the band.

Source

pub fn width_metres(&self) -> f64

The path’s width.

Source

pub fn height_metres(&self) -> f64

The height above the floor the path must be free to.

Source

pub fn tolerance_metres(&self) -> f64

How much farther than half the width a subject may be from a piece and still be near it.

Source

pub fn band(&self) -> ElevationBand

The band obstacles count in: from the band’s start (the floor by default) up to the height above the floor.

Source

pub fn subjects(&self) -> Vec<ObjectId>

The subjects a map reports contacts for: the entrances and the components, sorted and deduplicated.

Trait Implementations§

Source§

impl Clone for CirculationRequest

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 CirculationRequest

Source§

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

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

impl PartialEq for CirculationRequest

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 CirculationRequest

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