Skip to main content

PlanSpanService

Trait PlanSpanService 

Source
pub trait PlanSpanService:
    Send
    + Sync
    + 'static {
    // Required methods
    fn measure_diameter(
        &self,
        object: &ObjectId,
    ) -> Result<PlanLength, PlanSpanError>;
    fn measure_span(
        &self,
        first: &ObjectId,
        second: &ObjectId,
        between: PlanSpan,
    ) -> Result<PlanLength, PlanSpanError>;

    // Provided methods
    fn measure_centre(
        &self,
        object: &ObjectId,
    ) -> Result<PlanCentre, PlanSpanError> { ... }
    fn measure_rectangle(
        &self,
        object: &ObjectId,
    ) -> Result<PlanRectangle, PlanSpanError> { ... }
    fn measure_recesses(
        &self,
        object: &ObjectId,
    ) -> Result<PlanRecesses, PlanSpanError> { ... }
    fn measure_section(
        &self,
        objects: &[ObjectId],
    ) -> Result<PlanSection, PlanSpanError> { ... }
    fn measure_corridor_ends(
        &self,
        request: &CorridorEndRequest,
    ) -> Result<CorridorEnds, PlanSpanError> { ... }
    fn measure_side_distances(
        &self,
        request: &SideDistanceRequest,
    ) -> Result<SideDistances, PlanSpanError> { ... }
}
Expand description

Measures plan spans of model objects.

Required Methods§

Source

fn measure_diameter( &self, object: &ObjectId, ) -> Result<PlanLength, PlanSpanError>

The longest distance between two points of object’s footprint: its longest plan diagonal. A footprint with no point has none, and is refused, never zero.

Source

fn measure_span( &self, first: &ObjectId, second: &ObjectId, between: PlanSpan, ) -> Result<PlanLength, PlanSpanError>

The plan distance between the footprints of first and second, measured between their centres or their farthest points.

Provided Methods§

Source

fn measure_centre(&self, object: &ObjectId) -> Result<PlanCentre, PlanSpanError>

The centroid of object’s footprint, the same centre PlanSpan::Centres measures between, and whether it lies inside the footprint. A service that does not locate centres refuses by default, never answering with another point.

Source

fn measure_rectangle( &self, object: &ObjectId, ) -> Result<PlanRectangle, PlanSpanError>

The rectangle of least area enclosing object’s footprint. A service that does not orient footprints refuses by default, never answering with the footprint’s axis-aligned box.

Source

fn measure_recesses( &self, object: &ObjectId, ) -> Result<PlanRecesses, PlanSpanError>

The recesses of object’s footprint: the pockets between its outer boundary and its convex hull. A service that does not find recesses refuses by default, never answering that there are none.

Source

fn measure_section( &self, objects: &[ObjectId], ) -> Result<PlanSection, PlanSpanError>

The plan section objects share: the intersection of their footprints, its area and its minimum-area rectangle. A service that does not intersect footprints refuses by default.

Source

fn measure_corridor_ends( &self, request: &CorridorEndRequest, ) -> Result<CorridorEnds, PlanSpanError>

The ends of the paths through the request’s space footprint, the wall each runs into, and the request’s subjects measured against every decided wall (see CorridorEnds). A service that does not find corridor ends refuses by default, never answering with none.

Source

fn measure_side_distances( &self, request: &SideDistanceRequest, ) -> Result<SideDistances, PlanSpanError>

The request’s candidates beside each side of its object’s least-area rectangle, and how far from its centre lines (see SideDistances). A service that does not measure them refuses by default, never answering with none.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§