Skip to main content

PlanAreaService

Trait PlanAreaService 

Source
pub trait PlanAreaService:
    Send
    + Sync
    + 'static {
    // Required methods
    fn measure_footprint(
        &self,
        object: &ObjectId,
    ) -> Result<PlanArea, PlanAreaError>;
    fn measure_plan_overlap(
        &self,
        first: &ObjectId,
        second: &ObjectId,
    ) -> Result<PlanArea, PlanAreaError>;

    // Provided methods
    fn measure_uncovered_area(
        &self,
        object: &ObjectId,
        cover: &[ObjectId],
        growth_metres: f64,
    ) -> Result<PlanArea, PlanAreaError> { ... }
    fn measure_outside_bands(
        &self,
        object: &ObjectId,
        bands: &[PlanBand],
    ) -> Result<PlanArea, PlanAreaError> { ... }
    fn measure_coverage(
        &self,
        request: &CoverageRequest,
    ) -> Result<CoverageEvidence, PlanAreaError> { ... }
    fn measure_elevation_cover(
        &self,
        request: &ElevationRequest,
    ) -> Result<ElevationCover, PlanAreaError> { ... }
}
Expand description

Measures plan-projected areas of model objects.

Required Methods§

Source

fn measure_footprint( &self, object: &ObjectId, ) -> Result<PlanArea, PlanAreaError>

The area of object’s footprint: its geometry projected onto the horizontal plane, overlapping parts counted once.

Source

fn measure_plan_overlap( &self, first: &ObjectId, second: &ObjectId, ) -> Result<PlanArea, PlanAreaError>

The area where the footprints of first and second overlap.

Provided Methods§

Source

fn measure_uncovered_area( &self, object: &ObjectId, cover: &[ObjectId], growth_metres: f64, ) -> Result<PlanArea, PlanAreaError>

The area of object’s footprint outside the union of the footprints of cover, each grown by growth_metres in every plan direction (the set of points within that distance of it).

An empty cover leaves the whole footprint uncovered. A service that does not measure uncovered areas refuses; it never answers with the footprint or with zero.

Source

fn measure_outside_bands( &self, object: &ObjectId, bands: &[PlanBand], ) -> Result<PlanArea, PlanAreaError>

The area of object’s footprint outside the union of bands.

An empty set of bands leaves the whole footprint outside. A service that does not measure bands refuses; it never answers with the footprint or with zero.

Source

fn measure_coverage( &self, request: &CoverageRequest, ) -> Result<CoverageEvidence, PlanAreaError>

How much of the request’s subject footprint the union of its sources’ effect areas covers.

A service that does not measure coverage refuses; it never answers with an empty or a whole cover.

Source

fn measure_elevation_cover( &self, request: &ElevationRequest, ) -> Result<ElevationCover, PlanAreaError>

The elevation of the request’s object and the part of it the request’s cover and frame, grown, leave uncovered.

A service that does not measure elevations refuses; it never answers with the whole elevation or with zero.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§