Skip to main content

PolygonShortestPathMapBuilder

Trait PolygonShortestPathMapBuilder 

Source
pub trait PolygonShortestPathMapBuilder {
    type Map: PolygonShortestPathMap;

    // Required methods
    fn name(&self) -> &'static str;
    fn preprocess(
        &self,
        scene: &PolygonScene,
        source: Point2,
    ) -> Result<Self::Map, PolygonShortestPathMapBuildError>;
}
Expand description

Preprocesses a polygon scene into a source-rooted shortest-path map.

Implementations own the expensive visibility / distance work so that PolygonShortestPathMap::query stays cheap relative to online pair search.

Required Associated Types§

Source

type Map: PolygonShortestPathMap

Prepared map type produced by this builder.

Required Methods§

Source

fn name(&self) -> &'static str

Stable builder identity (usually matches the prepared map name).

Source

fn preprocess( &self, scene: &PolygonScene, source: Point2, ) -> Result<Self::Map, PolygonShortestPathMapBuildError>

Build a map rooted at source for repeated goal queries on scene.

§Errors

Returns PolygonShortestPathMapBuildError when static scene geometry or the source endpoint fails validation (including sealed-boundary sources).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§