refactor(autorouter/invoker): Merge debug overlay data traits into one trait

The name of this new trait shall be `GetDebugOverlayData`.
This commit is contained in:
Mikolaj Wielgus 2025-07-04 14:57:47 +02:00
parent 8c92a9b8ec
commit b25ad863ba
11 changed files with 88 additions and 264 deletions

View File

@ -9,10 +9,7 @@ use petgraph::{
}; };
use rstar::{Envelope, AABB}; use rstar::{Envelope, AABB};
use topola::{ use topola::{
autorouter::invoker::{ autorouter::invoker::GetDebugOverlayData,
GetActivePolygons, GetGhosts, GetMaybeNavcord, GetMaybeThetastarStepper,
GetMaybeTopoNavmesh, GetNavmeshDebugTexts, GetObstacles, GetPolygonalBlockers,
},
board::AccessMesadata, board::AccessMesadata,
drawing::{ drawing::{
graph::{MakePrimitive, PrimitiveIndex}, graph::{MakePrimitive, PrimitiveIndex},
@ -26,8 +23,7 @@ use topola::{
}, },
layout::poly::MakePolygon, layout::poly::MakePolygon,
math::{Circle, RotationSense}, math::{Circle, RotationSense},
router::navmesh::NavnodeIndex, router::{navmesh::NavnodeIndex, ng::pie},
router::ng::pie,
}; };
use crate::{ use crate::{

View File

@ -20,13 +20,7 @@ use crate::{
stepper::Step, stepper::Step,
}; };
use super::{ use super::{invoker::GetDebugOverlayData, Autorouter, AutorouterError, AutorouterOptions};
invoker::{
GetGhosts, GetMaybeNavcord, GetMaybeThetastarStepper, GetNavmeshDebugTexts, GetObstacles,
GetPolygonalBlockers,
},
Autorouter, AutorouterError, AutorouterOptions,
};
/// Represents the current status of the autoroute operation. /// Represents the current status of the autoroute operation.
pub enum AutorouteContinueStatus { pub enum AutorouteContinueStatus {
@ -170,30 +164,20 @@ impl<M: AccessMesadata> Step<Autorouter<M>, Option<LayoutEdit>, AutorouteContinu
} }
} }
impl GetMaybeThetastarStepper for AutorouteExecutionStepper { impl GetDebugOverlayData for AutorouteExecutionStepper {
fn maybe_thetastar(&self) -> Option<&ThetastarStepper<Navmesh, f64>> { fn maybe_thetastar(&self) -> Option<&ThetastarStepper<Navmesh, f64>> {
self.route.as_ref().map(|route| route.thetastar()) self.route.as_ref().map(|route| route.thetastar())
} }
}
impl GetMaybeNavcord for AutorouteExecutionStepper {
fn maybe_navcord(&self) -> Option<&Navcord> { fn maybe_navcord(&self) -> Option<&Navcord> {
self.route.as_ref().map(|route| route.navcord()) self.route.as_ref().map(|route| route.navcord())
} }
}
impl GetGhosts for AutorouteExecutionStepper {
fn ghosts(&self) -> &[PrimitiveShape] { fn ghosts(&self) -> &[PrimitiveShape] {
self.route.as_ref().map_or(&[], |route| route.ghosts()) self.route.as_ref().map_or(&[], |route| route.ghosts())
} }
}
impl GetPolygonalBlockers for AutorouteExecutionStepper {}
impl GetObstacles for AutorouteExecutionStepper {
fn obstacles(&self) -> &[PrimitiveIndex] { fn obstacles(&self) -> &[PrimitiveIndex] {
self.route.as_ref().map_or(&[], |route| route.obstacles()) self.route.as_ref().map_or(&[], |route| route.obstacles())
} }
} }
impl GetNavmeshDebugTexts for AutorouteExecutionStepper {}

View File

@ -20,10 +20,7 @@ use crate::{
use super::{ use super::{
autoroute::{AutorouteContinueStatus, AutorouteExecutionStepper}, autoroute::{AutorouteContinueStatus, AutorouteExecutionStepper},
invoker::{ invoker::GetDebugOverlayData,
GetGhosts, GetMaybeNavcord, GetMaybeThetastarStepper, GetNavmeshDebugTexts, GetObstacles,
GetPolygonalBlockers,
},
Autorouter, AutorouterError, AutorouterOptions, Autorouter, AutorouterError, AutorouterOptions,
}; };
@ -103,30 +100,20 @@ impl<M: AccessMesadata> Step<Autorouter<M>, (f64, f64)> for CompareDetoursExecut
} }
} }
impl GetMaybeThetastarStepper for CompareDetoursExecutionStepper { impl GetDebugOverlayData for CompareDetoursExecutionStepper {
fn maybe_thetastar(&self) -> Option<&ThetastarStepper<Navmesh, f64>> { fn maybe_thetastar(&self) -> Option<&ThetastarStepper<Navmesh, f64>> {
self.autoroute.maybe_thetastar() self.autoroute.maybe_thetastar()
} }
}
impl GetMaybeNavcord for CompareDetoursExecutionStepper {
fn maybe_navcord(&self) -> Option<&Navcord> { fn maybe_navcord(&self) -> Option<&Navcord> {
self.autoroute.maybe_navcord() self.autoroute.maybe_navcord()
} }
}
impl GetGhosts for CompareDetoursExecutionStepper {
fn ghosts(&self) -> &[PrimitiveShape] { fn ghosts(&self) -> &[PrimitiveShape] {
self.autoroute.ghosts() self.autoroute.ghosts()
} }
}
impl GetPolygonalBlockers for CompareDetoursExecutionStepper {}
impl GetObstacles for CompareDetoursExecutionStepper {
fn obstacles(&self) -> &[PrimitiveIndex] { fn obstacles(&self) -> &[PrimitiveIndex] {
self.autoroute.obstacles() self.autoroute.obstacles()
} }
} }
impl GetNavmeshDebugTexts for CompareDetoursExecutionStepper {}

View File

@ -9,8 +9,7 @@ use serde::{Deserialize, Serialize};
use crate::{ use crate::{
board::AccessMesadata, board::AccessMesadata,
graph::GenericIndex, layout::{via::ViaWeight, LayoutEdit},
layout::{poly::PolyWeight, via::ViaWeight, LayoutEdit},
router::ng, router::ng,
stepper::{Abort, Step}, stepper::{Abort, Step},
}; };
@ -18,7 +17,7 @@ use crate::{
use super::{ use super::{
autoroute::AutorouteExecutionStepper, autoroute::AutorouteExecutionStepper,
compare_detours::CompareDetoursExecutionStepper, compare_detours::CompareDetoursExecutionStepper,
invoker::{GetActivePolygons, GetMaybeTopoNavmesh, Invoker, InvokerError}, invoker::{GetDebugOverlayData, Invoker, InvokerError},
measure_length::MeasureLengthExecutionStepper, measure_length::MeasureLengthExecutionStepper,
place_via::PlaceViaExecutionStepper, place_via::PlaceViaExecutionStepper,
remove_bands::RemoveBandsExecutionStepper, remove_bands::RemoveBandsExecutionStepper,
@ -44,14 +43,7 @@ pub enum Command {
MeasureLength(BandSelection), MeasureLength(BandSelection),
} }
#[enum_dispatch( #[enum_dispatch(GetDebugOverlayData)]
GetMaybeThetastarStepper,
GetMaybeNavcord,
GetGhosts,
GetPolygonalBlockers,
GetObstacles,
GetNavmeshDebugTexts
)]
pub enum ExecutionStepper<M> { pub enum ExecutionStepper<M> {
Autoroute(AutorouteExecutionStepper), Autoroute(AutorouteExecutionStepper),
TopoAutoroute(ng::AutorouteExecutionStepper<M>), TopoAutoroute(ng::AutorouteExecutionStepper<M>),
@ -173,21 +165,3 @@ impl<M: AccessMesadata + Clone> Abort<Invoker<M>> for ExecutionStepper<M> {
} }
} }
} }
impl<M> GetActivePolygons for ExecutionStepper<M> {
fn active_polygons(&self) -> &[GenericIndex<PolyWeight>] {
match self {
ExecutionStepper::TopoAutoroute(autoroute) => autoroute.active_polygons(),
_ => &[],
}
}
}
impl<M> GetMaybeTopoNavmesh for ExecutionStepper<M> {
fn maybe_topo_navmesh(&self) -> Option<ng::pie::navmesh::NavmeshRef<'_, ng::PieNavmeshBase>> {
match self {
ExecutionStepper::TopoAutoroute(autoroute) => autoroute.maybe_topo_navmesh(),
_ => None,
}
}
}

View File

@ -38,76 +38,58 @@ use super::{
Autorouter, AutorouterError, Autorouter, AutorouterError,
}; };
/// Trait for getting the A* stepper to display its data on the debug overlay, /// Trait for getting the information to display on the debug overlay,
/// most importantly the navmesh which is owned by the A* stepper.
#[enum_dispatch] #[enum_dispatch]
pub trait GetMaybeThetastarStepper { pub trait GetDebugOverlayData {
/// Get the Theta* stepper. Most importantly, this gives us the access to
/// the navmesh.
fn maybe_thetastar(&self) -> Option<&ThetastarStepper<Navmesh, f64>> { fn maybe_thetastar(&self) -> Option<&ThetastarStepper<Navmesh, f64>> {
None None
} }
}
/// Trait for getting the navcord to display it on the debug overlay. /// Obtain Topological/Planar Navigation Mesh, if present.
#[enum_dispatch]
pub trait GetMaybeNavcord {
fn maybe_navcord(&self) -> Option<&Navcord> {
None
}
}
/// Trait for getting ghosts to display on the debug overlay. Ghosts are the
/// shapes that Topola attempted to create but failed due to them infringing on
/// other shapes.
#[enum_dispatch]
pub trait GetGhosts {
fn ghosts(&self) -> &[PrimitiveShape] {
&[]
}
}
/// Getter for the polygonal blockers (polygonal regions which block routing)
#[enum_dispatch]
pub trait GetPolygonalBlockers {
fn polygonal_blockers(&self) -> &[LineString] {
&[]
}
}
/// Getter for the polygons around which some routing happens
#[enum_dispatch]
pub trait GetActivePolygons {
fn active_polygons(&self) -> &[GenericIndex<PolyWeight>] {
&[]
}
}
/// Getter trait to obtain Topological/Planar Navigation Mesh
#[enum_dispatch]
pub trait GetMaybeTopoNavmesh {
fn maybe_topo_navmesh(&self) -> Option<ng::pie::navmesh::NavmeshRef<'_, ng::PieNavmeshBase>> { fn maybe_topo_navmesh(&self) -> Option<ng::pie::navmesh::NavmeshRef<'_, ng::PieNavmeshBase>> {
None None
} }
/// Get the navcord. This is useful for coloring the currently visited path
/// on the navmesh.
fn maybe_navcord(&self) -> Option<&Navcord> {
None
} }
/// Trait for getting the obstacles that prevented Topola from creating fn active_polygons(&self) -> &[GenericIndex<PolyWeight>] {
/// new objects (the shapes of these objects can be obtained with the above &[]
/// `GetGhosts` trait), for the purpose of displaying these obstacles on the }
/// debug overlay.
#[enum_dispatch] /// Get ghosts. Ghosts are the shapes that Topola attempted to create but
pub trait GetObstacles { /// failed due to them infringing on other shapes.
fn ghosts(&self) -> &[PrimitiveShape] {
&[]
}
/// Get the obstacles that prevented Topola from creating new objects (the
/// shapes of these objects can be obtained from the above `.ghosts(...)`)
/// method. This allows to highlight what prevented Topola's algorithm from
/// going some way.
fn obstacles(&self) -> &[PrimitiveIndex] { fn obstacles(&self) -> &[PrimitiveIndex] {
&[] &[]
} }
fn polygonal_blockers(&self) -> &[LineString] {
&[]
} }
/// Trait for getting text strings with debug information attached to navmesh /// Get a text string to show on the debug overlay near to a navnode.
/// edges and vertices. /// Usually returns None, this method exists only for quick and dirty
#[enum_dispatch] /// debugging.
pub trait GetNavmeshDebugTexts {
fn navnode_debug_text(&self, _navnode: NavnodeIndex) -> Option<&str> { fn navnode_debug_text(&self, _navnode: NavnodeIndex) -> Option<&str> {
None None
} }
/// Get a text string to show on the debug overlay near to a navedge.
/// Usually returns None, this method exists only for quick and dirty
/// debugging.
fn navedge_debug_text(&self, _navedge: (NavnodeIndex, NavnodeIndex)) -> Option<&str> { fn navedge_debug_text(&self, _navedge: (NavnodeIndex, NavnodeIndex)) -> Option<&str> {
None None
} }

View File

@ -10,14 +10,7 @@ use crate::{
board::AccessMesadata, geometry::shape::MeasureLength as MeasureLengthTrait, graph::MakeRef, board::AccessMesadata, geometry::shape::MeasureLength as MeasureLengthTrait, graph::MakeRef,
}; };
use super::{ use super::{invoker::GetDebugOverlayData, selection::BandSelection, Autorouter, AutorouterError};
invoker::{
GetGhosts, GetMaybeNavcord, GetMaybeThetastarStepper, GetNavmeshDebugTexts, GetObstacles,
GetPolygonalBlockers,
},
selection::BandSelection,
Autorouter, AutorouterError,
};
pub struct MeasureLengthExecutionStepper { pub struct MeasureLengthExecutionStepper {
selection: BandSelection, selection: BandSelection,
@ -54,9 +47,4 @@ impl MeasureLengthExecutionStepper {
} }
} }
impl GetGhosts for MeasureLengthExecutionStepper {} impl GetDebugOverlayData for MeasureLengthExecutionStepper {}
impl GetMaybeNavcord for MeasureLengthExecutionStepper {}
impl GetMaybeThetastarStepper for MeasureLengthExecutionStepper {}
impl GetNavmeshDebugTexts for MeasureLengthExecutionStepper {}
impl GetObstacles for MeasureLengthExecutionStepper {}
impl GetPolygonalBlockers for MeasureLengthExecutionStepper {}

View File

@ -11,13 +11,7 @@ use crate::{
layout::{via::ViaWeight, LayoutEdit}, layout::{via::ViaWeight, LayoutEdit},
}; };
use super::{ use super::{invoker::GetDebugOverlayData, Autorouter, AutorouterError};
invoker::{
GetGhosts, GetMaybeNavcord, GetMaybeThetastarStepper, GetNavmeshDebugTexts, GetObstacles,
GetPolygonalBlockers,
},
Autorouter, AutorouterError,
};
#[derive(Debug)] #[derive(Debug)]
pub struct PlaceViaExecutionStepper { pub struct PlaceViaExecutionStepper {
@ -52,9 +46,4 @@ impl PlaceViaExecutionStepper {
} }
} }
impl GetGhosts for PlaceViaExecutionStepper {} impl GetDebugOverlayData for PlaceViaExecutionStepper {}
impl GetMaybeNavcord for PlaceViaExecutionStepper {}
impl GetMaybeThetastarStepper for PlaceViaExecutionStepper {}
impl GetNavmeshDebugTexts for PlaceViaExecutionStepper {}
impl GetObstacles for PlaceViaExecutionStepper {}
impl GetPolygonalBlockers for PlaceViaExecutionStepper {}

View File

@ -6,14 +6,7 @@
use crate::{board::AccessMesadata, layout::LayoutEdit}; use crate::{board::AccessMesadata, layout::LayoutEdit};
use super::{ use super::{invoker::GetDebugOverlayData, selection::BandSelection, Autorouter, AutorouterError};
invoker::{
GetGhosts, GetMaybeNavcord, GetMaybeThetastarStepper, GetNavmeshDebugTexts, GetObstacles,
GetPolygonalBlockers,
},
selection::BandSelection,
Autorouter, AutorouterError,
};
#[derive(Debug)] #[derive(Debug)]
pub struct RemoveBandsExecutionStepper { pub struct RemoveBandsExecutionStepper {
@ -51,9 +44,4 @@ impl RemoveBandsExecutionStepper {
} }
} }
impl GetGhosts for RemoveBandsExecutionStepper {} impl GetDebugOverlayData for RemoveBandsExecutionStepper {}
impl GetMaybeNavcord for RemoveBandsExecutionStepper {}
impl GetMaybeThetastarStepper for RemoveBandsExecutionStepper {}
impl GetNavmeshDebugTexts for RemoveBandsExecutionStepper {}
impl GetObstacles for RemoveBandsExecutionStepper {}
impl GetPolygonalBlockers for RemoveBandsExecutionStepper {}

View File

@ -11,11 +11,7 @@ use thiserror::Error;
use crate::{ use crate::{
autorouter::{ autorouter::{
execution::ExecutionStepper, execution::ExecutionStepper,
invoker::{ invoker::{GetDebugOverlayData, Invoker, InvokerError},
GetActivePolygons, GetGhosts, GetMaybeNavcord, GetMaybeThetastarStepper,
GetMaybeTopoNavmesh, GetNavmeshDebugTexts, GetObstacles, GetPolygonalBlockers, Invoker,
InvokerError,
},
}, },
board::AccessMesadata, board::AccessMesadata,
drawing::graph::PrimitiveIndex, drawing::graph::PrimitiveIndex,
@ -32,7 +28,7 @@ use crate::{
stepper::{Abort, OnEvent, Step}, stepper::{Abort, OnEvent, Step},
}; };
/// Stores the interactive input data from the user /// Stores the interactive input data from the user.
pub struct InteractiveInput { pub struct InteractiveInput {
pub active_layer: Option<usize>, pub active_layer: Option<usize>,
pub pointer_pos: Point, pub pointer_pos: Point,
@ -47,18 +43,18 @@ pub enum InteractiveEventKind {
PointerSecondaryButtonClicked, PointerSecondaryButtonClicked,
} }
/// An event received from the user /// An event received from the user.
pub struct InteractiveEvent { pub struct InteractiveEvent {
pub kind: InteractiveEventKind, pub kind: InteractiveEventKind,
/// `true` if the `Ctrl` key pressed during the event /// `true` if the `Ctrl` key is pressed during the event
pub ctrl: bool, pub ctrl: bool,
/// `true` if the `Shift` key pressed during the event /// `true` if the `Shift` key is pressed during the event
pub shift: bool, pub shift: bool,
} }
/// This is the execution context passed to the stepper on each step /// This is the execution context passed to the stepper on each step.
pub struct ActivityContext<'a, M> { pub struct ActivityContext<'a, M> {
pub interactive_input: &'a InteractiveInput, pub interactive_input: &'a InteractiveInput,
pub invoker: &'a mut Invoker<M>, pub invoker: &'a mut Invoker<M>,
@ -72,17 +68,8 @@ pub enum ActivityError {
Invoker(#[from] InvokerError), Invoker(#[from] InvokerError),
} }
/// An activity is either an interaction or an execution /// An activity is either an interaction or an execution.
#[enum_dispatch( #[enum_dispatch(GetDebugOverlayData)]
GetActivePolygons,
GetGhosts,
GetMaybeNavcord,
GetMaybeThetastarStepper,
GetMaybeTopoNavmesh,
GetNavmeshDebugTexts,
GetObstacles,
GetPolygonalBlockers
)]
pub enum ActivityStepper<M> { pub enum ActivityStepper<M> {
Interaction(InteractionStepper), Interaction(InteractionStepper),
Execution(ExecutionStepper<M>), Execution(ExecutionStepper<M>),
@ -192,49 +179,35 @@ impl<M: AccessMesadata + Clone> OnEvent<ActivityContext<'_, M>, InteractiveEvent
} }
} }
impl<M> GetActivePolygons for ActivityStepperWithStatus<M> { impl<M> GetDebugOverlayData for ActivityStepperWithStatus<M> {
fn active_polygons(&self) -> &[GenericIndex<PolyWeight>] {
self.activity.active_polygons()
}
}
impl<M> GetMaybeThetastarStepper for ActivityStepperWithStatus<M> {
fn maybe_thetastar(&self) -> Option<&ThetastarStepper<Navmesh, f64>> { fn maybe_thetastar(&self) -> Option<&ThetastarStepper<Navmesh, f64>> {
self.activity.maybe_thetastar() self.activity.maybe_thetastar()
} }
}
impl<M> GetMaybeTopoNavmesh for ActivityStepperWithStatus<M> {
fn maybe_topo_navmesh(&self) -> Option<ng::pie::navmesh::NavmeshRef<'_, ng::PieNavmeshBase>> { fn maybe_topo_navmesh(&self) -> Option<ng::pie::navmesh::NavmeshRef<'_, ng::PieNavmeshBase>> {
self.activity.maybe_topo_navmesh() self.activity.maybe_topo_navmesh()
} }
}
impl<M> GetMaybeNavcord for ActivityStepperWithStatus<M> {
fn maybe_navcord(&self) -> Option<&Navcord> { fn maybe_navcord(&self) -> Option<&Navcord> {
self.activity.maybe_navcord() self.activity.maybe_navcord()
} }
fn active_polygons(&self) -> &[GenericIndex<PolyWeight>] {
self.activity.active_polygons()
} }
impl<M> GetGhosts for ActivityStepperWithStatus<M> {
fn ghosts(&self) -> &[PrimitiveShape] { fn ghosts(&self) -> &[PrimitiveShape] {
self.activity.ghosts() self.activity.ghosts()
} }
}
impl<M> GetPolygonalBlockers for ActivityStepperWithStatus<M> {
fn polygonal_blockers(&self) -> &[LineString] {
self.activity.polygonal_blockers()
}
}
impl<M> GetObstacles for ActivityStepperWithStatus<M> {
fn obstacles(&self) -> &[PrimitiveIndex] { fn obstacles(&self) -> &[PrimitiveIndex] {
self.activity.obstacles() self.activity.obstacles()
} }
fn polygonal_blockers(&self) -> &[LineString] {
self.activity.polygonal_blockers()
} }
impl<M> GetNavmeshDebugTexts for ActivityStepperWithStatus<M> {
fn navnode_debug_text(&self, navnode: NavnodeIndex) -> Option<&str> { fn navnode_debug_text(&self, navnode: NavnodeIndex) -> Option<&str> {
self.activity.navnode_debug_text(navnode) self.activity.navnode_debug_text(navnode)
} }

View File

@ -6,10 +6,7 @@ use core::ops::ControlFlow;
use thiserror::Error; use thiserror::Error;
use crate::{ use crate::{
autorouter::invoker::{ autorouter::invoker::{GetDebugOverlayData, Invoker},
GetActivePolygons, GetGhosts, GetMaybeNavcord, GetMaybeThetastarStepper,
GetMaybeTopoNavmesh, GetNavmeshDebugTexts, GetObstacles, GetPolygonalBlockers, Invoker,
},
board::AccessMesadata, board::AccessMesadata,
stepper::{Abort, OnEvent, Step}, stepper::{Abort, OnEvent, Step},
}; };
@ -67,11 +64,4 @@ impl<M: AccessMesadata> OnEvent<ActivityContext<'_, M>, InteractiveEvent> for In
} }
} }
impl GetActivePolygons for InteractionStepper {} impl GetDebugOverlayData for InteractionStepper {}
impl GetGhosts for InteractionStepper {}
impl GetMaybeNavcord for InteractionStepper {}
impl GetMaybeThetastarStepper for InteractionStepper {}
impl GetMaybeTopoNavmesh for InteractionStepper {}
impl GetNavmeshDebugTexts for InteractionStepper {}
impl GetObstacles for InteractionStepper {}
impl GetPolygonalBlockers for InteractionStepper {}

View File

@ -10,10 +10,7 @@ use std::{
}; };
use crate::{ use crate::{
autorouter::invoker::{ autorouter::invoker::GetDebugOverlayData,
GetActivePolygons, GetGhosts, GetMaybeNavcord, GetMaybeThetastarStepper,
GetMaybeTopoNavmesh, GetNavmeshDebugTexts, GetObstacles, GetPolygonalBlockers,
},
drawing::{band::BandUid, dot::FixedDotIndex, graph::PrimitiveIndex, rules::AccessRules}, drawing::{band::BandUid, dot::FixedDotIndex, graph::PrimitiveIndex, rules::AccessRules},
geometry::primitive::PrimitiveShape, geometry::primitive::PrimitiveShape,
graph::GenericIndex, graph::GenericIndex,
@ -235,23 +232,7 @@ impl<R: AccessRules + Clone + std::panic::RefUnwindSafe> AutorouteExecutionStepp
} }
} }
impl<M> GetActivePolygons for AutorouteExecutionStepper<M> { impl<M> GetDebugOverlayData for AutorouteExecutionStepper<M> {
fn active_polygons(&self) -> &[GenericIndex<PolyWeight>] {
&self.active_polygons[..]
}
}
impl<M> GetGhosts for AutorouteExecutionStepper<M> {
fn ghosts(&self) -> &[PrimitiveShape] {
&self.ghosts[..]
}
}
impl<M> GetMaybeThetastarStepper for AutorouteExecutionStepper<M> {}
impl<M> GetMaybeNavcord for AutorouteExecutionStepper<M> {}
impl<M> GetNavmeshDebugTexts for AutorouteExecutionStepper<M> {}
impl<M> GetMaybeTopoNavmesh for AutorouteExecutionStepper<M> {
fn maybe_topo_navmesh(&self) -> Option<pie::navmesh::NavmeshRef<'_, super::PieNavmeshBase>> { fn maybe_topo_navmesh(&self) -> Option<pie::navmesh::NavmeshRef<'_, super::PieNavmeshBase>> {
Some(pie::navmesh::NavmeshRef { Some(pie::navmesh::NavmeshRef {
nodes: &self.pmg_astar.nodes, nodes: &self.pmg_astar.nodes,
@ -259,15 +240,19 @@ impl<M> GetMaybeTopoNavmesh for AutorouteExecutionStepper<M> {
edge_paths: &self.last_edge_paths, edge_paths: &self.last_edge_paths,
}) })
} }
fn active_polygons(&self) -> &[GenericIndex<PolyWeight>] {
&self.active_polygons[..]
}
fn ghosts(&self) -> &[PrimitiveShape] {
&self.ghosts[..]
} }
impl<M> GetObstacles for AutorouteExecutionStepper<M> {
fn obstacles(&self) -> &[PrimitiveIndex] { fn obstacles(&self) -> &[PrimitiveIndex] {
&self.obstacles[..] &self.obstacles[..]
} }
}
impl<M> GetPolygonalBlockers for AutorouteExecutionStepper<M> {
fn polygonal_blockers(&self) -> &[LineString] { fn polygonal_blockers(&self) -> &[LineString] {
&self.polygonal_blockers[..] &self.polygonal_blockers[..]
} }
@ -534,23 +519,7 @@ impl<R: AccessRules + Clone + std::panic::RefUnwindSafe> ManualrouteExecutionSte
} }
} }
impl<M> GetActivePolygons for ManualrouteExecutionStepper<M> { impl<M> GetDebugOverlayData for ManualrouteExecutionStepper<M> {
fn active_polygons(&self) -> &[GenericIndex<PolyWeight>] {
&self.active_polygons[..]
}
}
impl<M> GetGhosts for ManualrouteExecutionStepper<M> {
fn ghosts(&self) -> &[PrimitiveShape] {
&self.ghosts[..]
}
}
impl<M> GetMaybeThetastarStepper for ManualrouteExecutionStepper<M> {}
impl<M> GetMaybeNavcord for ManualrouteExecutionStepper<M> {}
impl<M> GetNavmeshDebugTexts for ManualrouteExecutionStepper<M> {}
impl<M> GetMaybeTopoNavmesh for ManualrouteExecutionStepper<M> {
fn maybe_topo_navmesh(&self) -> Option<pie::navmesh::NavmeshRef<'_, super::PieNavmeshBase>> { fn maybe_topo_navmesh(&self) -> Option<pie::navmesh::NavmeshRef<'_, super::PieNavmeshBase>> {
Some(pie::navmesh::NavmeshRef { Some(pie::navmesh::NavmeshRef {
nodes: &self.nodes, nodes: &self.nodes,
@ -558,15 +527,19 @@ impl<M> GetMaybeTopoNavmesh for ManualrouteExecutionStepper<M> {
edge_paths: &self.last_edge_paths(), edge_paths: &self.last_edge_paths(),
}) })
} }
fn active_polygons(&self) -> &[GenericIndex<PolyWeight>] {
&self.active_polygons[..]
}
fn ghosts(&self) -> &[PrimitiveShape] {
&self.ghosts[..]
} }
impl<M> GetObstacles for ManualrouteExecutionStepper<M> {
fn obstacles(&self) -> &[PrimitiveIndex] { fn obstacles(&self) -> &[PrimitiveIndex] {
&self.obstacles[..] &self.obstacles[..]
} }
}
impl<M> GetPolygonalBlockers for ManualrouteExecutionStepper<M> {
fn polygonal_blockers(&self) -> &[LineString] { fn polygonal_blockers(&self) -> &[LineString] {
&self.polygonal_blockers[..] &self.polygonal_blockers[..]
} }