mirror of https://codeberg.org/topola/topola.git
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:
parent
8c92a9b8ec
commit
b25ad863ba
|
|
@ -9,10 +9,7 @@ use petgraph::{
|
|||
};
|
||||
use rstar::{Envelope, AABB};
|
||||
use topola::{
|
||||
autorouter::invoker::{
|
||||
GetActivePolygons, GetGhosts, GetMaybeNavcord, GetMaybeThetastarStepper,
|
||||
GetMaybeTopoNavmesh, GetNavmeshDebugTexts, GetObstacles, GetPolygonalBlockers,
|
||||
},
|
||||
autorouter::invoker::GetDebugOverlayData,
|
||||
board::AccessMesadata,
|
||||
drawing::{
|
||||
graph::{MakePrimitive, PrimitiveIndex},
|
||||
|
|
@ -26,8 +23,7 @@ use topola::{
|
|||
},
|
||||
layout::poly::MakePolygon,
|
||||
math::{Circle, RotationSense},
|
||||
router::navmesh::NavnodeIndex,
|
||||
router::ng::pie,
|
||||
router::{navmesh::NavnodeIndex, ng::pie},
|
||||
};
|
||||
|
||||
use crate::{
|
||||
|
|
|
|||
|
|
@ -20,13 +20,7 @@ use crate::{
|
|||
stepper::Step,
|
||||
};
|
||||
|
||||
use super::{
|
||||
invoker::{
|
||||
GetGhosts, GetMaybeNavcord, GetMaybeThetastarStepper, GetNavmeshDebugTexts, GetObstacles,
|
||||
GetPolygonalBlockers,
|
||||
},
|
||||
Autorouter, AutorouterError, AutorouterOptions,
|
||||
};
|
||||
use super::{invoker::GetDebugOverlayData, Autorouter, AutorouterError, AutorouterOptions};
|
||||
|
||||
/// Represents the current status of the autoroute operation.
|
||||
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>> {
|
||||
self.route.as_ref().map(|route| route.thetastar())
|
||||
}
|
||||
}
|
||||
|
||||
impl GetMaybeNavcord for AutorouteExecutionStepper {
|
||||
fn maybe_navcord(&self) -> Option<&Navcord> {
|
||||
self.route.as_ref().map(|route| route.navcord())
|
||||
}
|
||||
}
|
||||
|
||||
impl GetGhosts for AutorouteExecutionStepper {
|
||||
fn ghosts(&self) -> &[PrimitiveShape] {
|
||||
self.route.as_ref().map_or(&[], |route| route.ghosts())
|
||||
}
|
||||
}
|
||||
|
||||
impl GetPolygonalBlockers for AutorouteExecutionStepper {}
|
||||
|
||||
impl GetObstacles for AutorouteExecutionStepper {
|
||||
fn obstacles(&self) -> &[PrimitiveIndex] {
|
||||
self.route.as_ref().map_or(&[], |route| route.obstacles())
|
||||
}
|
||||
}
|
||||
|
||||
impl GetNavmeshDebugTexts for AutorouteExecutionStepper {}
|
||||
|
|
|
|||
|
|
@ -20,10 +20,7 @@ use crate::{
|
|||
|
||||
use super::{
|
||||
autoroute::{AutorouteContinueStatus, AutorouteExecutionStepper},
|
||||
invoker::{
|
||||
GetGhosts, GetMaybeNavcord, GetMaybeThetastarStepper, GetNavmeshDebugTexts, GetObstacles,
|
||||
GetPolygonalBlockers,
|
||||
},
|
||||
invoker::GetDebugOverlayData,
|
||||
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>> {
|
||||
self.autoroute.maybe_thetastar()
|
||||
}
|
||||
}
|
||||
|
||||
impl GetMaybeNavcord for CompareDetoursExecutionStepper {
|
||||
fn maybe_navcord(&self) -> Option<&Navcord> {
|
||||
self.autoroute.maybe_navcord()
|
||||
}
|
||||
}
|
||||
|
||||
impl GetGhosts for CompareDetoursExecutionStepper {
|
||||
fn ghosts(&self) -> &[PrimitiveShape] {
|
||||
self.autoroute.ghosts()
|
||||
}
|
||||
}
|
||||
|
||||
impl GetPolygonalBlockers for CompareDetoursExecutionStepper {}
|
||||
|
||||
impl GetObstacles for CompareDetoursExecutionStepper {
|
||||
fn obstacles(&self) -> &[PrimitiveIndex] {
|
||||
self.autoroute.obstacles()
|
||||
}
|
||||
}
|
||||
|
||||
impl GetNavmeshDebugTexts for CompareDetoursExecutionStepper {}
|
||||
|
|
|
|||
|
|
@ -9,8 +9,7 @@ use serde::{Deserialize, Serialize};
|
|||
|
||||
use crate::{
|
||||
board::AccessMesadata,
|
||||
graph::GenericIndex,
|
||||
layout::{poly::PolyWeight, via::ViaWeight, LayoutEdit},
|
||||
layout::{via::ViaWeight, LayoutEdit},
|
||||
router::ng,
|
||||
stepper::{Abort, Step},
|
||||
};
|
||||
|
|
@ -18,7 +17,7 @@ use crate::{
|
|||
use super::{
|
||||
autoroute::AutorouteExecutionStepper,
|
||||
compare_detours::CompareDetoursExecutionStepper,
|
||||
invoker::{GetActivePolygons, GetMaybeTopoNavmesh, Invoker, InvokerError},
|
||||
invoker::{GetDebugOverlayData, Invoker, InvokerError},
|
||||
measure_length::MeasureLengthExecutionStepper,
|
||||
place_via::PlaceViaExecutionStepper,
|
||||
remove_bands::RemoveBandsExecutionStepper,
|
||||
|
|
@ -44,14 +43,7 @@ pub enum Command {
|
|||
MeasureLength(BandSelection),
|
||||
}
|
||||
|
||||
#[enum_dispatch(
|
||||
GetMaybeThetastarStepper,
|
||||
GetMaybeNavcord,
|
||||
GetGhosts,
|
||||
GetPolygonalBlockers,
|
||||
GetObstacles,
|
||||
GetNavmeshDebugTexts
|
||||
)]
|
||||
#[enum_dispatch(GetDebugOverlayData)]
|
||||
pub enum ExecutionStepper<M> {
|
||||
Autoroute(AutorouteExecutionStepper),
|
||||
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,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,76 +38,58 @@ use super::{
|
|||
Autorouter, AutorouterError,
|
||||
};
|
||||
|
||||
/// Trait for getting the A* stepper to display its data on the debug overlay,
|
||||
/// most importantly the navmesh which is owned by the A* stepper.
|
||||
/// Trait for getting the information to display on the debug overlay,
|
||||
#[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>> {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
/// Trait for getting the navcord to display it on the debug overlay.
|
||||
#[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 {
|
||||
/// Obtain Topological/Planar Navigation Mesh, if present.
|
||||
fn maybe_topo_navmesh(&self) -> Option<ng::pie::navmesh::NavmeshRef<'_, ng::PieNavmeshBase>> {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
/// Trait for getting the obstacles that prevented Topola from creating
|
||||
/// 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]
|
||||
pub trait GetObstacles {
|
||||
/// Get the navcord. This is useful for coloring the currently visited path
|
||||
/// on the navmesh.
|
||||
fn maybe_navcord(&self) -> Option<&Navcord> {
|
||||
None
|
||||
}
|
||||
|
||||
fn active_polygons(&self) -> &[GenericIndex<PolyWeight>] {
|
||||
&[]
|
||||
}
|
||||
|
||||
/// Get ghosts. Ghosts are the shapes that Topola attempted to create but
|
||||
/// 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] {
|
||||
&[]
|
||||
}
|
||||
}
|
||||
|
||||
/// Trait for getting text strings with debug information attached to navmesh
|
||||
/// edges and vertices.
|
||||
#[enum_dispatch]
|
||||
pub trait GetNavmeshDebugTexts {
|
||||
fn polygonal_blockers(&self) -> &[LineString] {
|
||||
&[]
|
||||
}
|
||||
|
||||
/// Get a text string to show on the debug overlay near to a navnode.
|
||||
/// Usually returns None, this method exists only for quick and dirty
|
||||
/// debugging.
|
||||
fn navnode_debug_text(&self, _navnode: NavnodeIndex) -> Option<&str> {
|
||||
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> {
|
||||
None
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,14 +10,7 @@ use crate::{
|
|||
board::AccessMesadata, geometry::shape::MeasureLength as MeasureLengthTrait, graph::MakeRef,
|
||||
};
|
||||
|
||||
use super::{
|
||||
invoker::{
|
||||
GetGhosts, GetMaybeNavcord, GetMaybeThetastarStepper, GetNavmeshDebugTexts, GetObstacles,
|
||||
GetPolygonalBlockers,
|
||||
},
|
||||
selection::BandSelection,
|
||||
Autorouter, AutorouterError,
|
||||
};
|
||||
use super::{invoker::GetDebugOverlayData, selection::BandSelection, Autorouter, AutorouterError};
|
||||
|
||||
pub struct MeasureLengthExecutionStepper {
|
||||
selection: BandSelection,
|
||||
|
|
@ -54,9 +47,4 @@ impl MeasureLengthExecutionStepper {
|
|||
}
|
||||
}
|
||||
|
||||
impl GetGhosts for MeasureLengthExecutionStepper {}
|
||||
impl GetMaybeNavcord for MeasureLengthExecutionStepper {}
|
||||
impl GetMaybeThetastarStepper for MeasureLengthExecutionStepper {}
|
||||
impl GetNavmeshDebugTexts for MeasureLengthExecutionStepper {}
|
||||
impl GetObstacles for MeasureLengthExecutionStepper {}
|
||||
impl GetPolygonalBlockers for MeasureLengthExecutionStepper {}
|
||||
impl GetDebugOverlayData for MeasureLengthExecutionStepper {}
|
||||
|
|
|
|||
|
|
@ -11,13 +11,7 @@ use crate::{
|
|||
layout::{via::ViaWeight, LayoutEdit},
|
||||
};
|
||||
|
||||
use super::{
|
||||
invoker::{
|
||||
GetGhosts, GetMaybeNavcord, GetMaybeThetastarStepper, GetNavmeshDebugTexts, GetObstacles,
|
||||
GetPolygonalBlockers,
|
||||
},
|
||||
Autorouter, AutorouterError,
|
||||
};
|
||||
use super::{invoker::GetDebugOverlayData, Autorouter, AutorouterError};
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct PlaceViaExecutionStepper {
|
||||
|
|
@ -52,9 +46,4 @@ impl PlaceViaExecutionStepper {
|
|||
}
|
||||
}
|
||||
|
||||
impl GetGhosts for PlaceViaExecutionStepper {}
|
||||
impl GetMaybeNavcord for PlaceViaExecutionStepper {}
|
||||
impl GetMaybeThetastarStepper for PlaceViaExecutionStepper {}
|
||||
impl GetNavmeshDebugTexts for PlaceViaExecutionStepper {}
|
||||
impl GetObstacles for PlaceViaExecutionStepper {}
|
||||
impl GetPolygonalBlockers for PlaceViaExecutionStepper {}
|
||||
impl GetDebugOverlayData for PlaceViaExecutionStepper {}
|
||||
|
|
|
|||
|
|
@ -6,14 +6,7 @@
|
|||
|
||||
use crate::{board::AccessMesadata, layout::LayoutEdit};
|
||||
|
||||
use super::{
|
||||
invoker::{
|
||||
GetGhosts, GetMaybeNavcord, GetMaybeThetastarStepper, GetNavmeshDebugTexts, GetObstacles,
|
||||
GetPolygonalBlockers,
|
||||
},
|
||||
selection::BandSelection,
|
||||
Autorouter, AutorouterError,
|
||||
};
|
||||
use super::{invoker::GetDebugOverlayData, selection::BandSelection, Autorouter, AutorouterError};
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct RemoveBandsExecutionStepper {
|
||||
|
|
@ -51,9 +44,4 @@ impl RemoveBandsExecutionStepper {
|
|||
}
|
||||
}
|
||||
|
||||
impl GetGhosts for RemoveBandsExecutionStepper {}
|
||||
impl GetMaybeNavcord for RemoveBandsExecutionStepper {}
|
||||
impl GetMaybeThetastarStepper for RemoveBandsExecutionStepper {}
|
||||
impl GetNavmeshDebugTexts for RemoveBandsExecutionStepper {}
|
||||
impl GetObstacles for RemoveBandsExecutionStepper {}
|
||||
impl GetPolygonalBlockers for RemoveBandsExecutionStepper {}
|
||||
impl GetDebugOverlayData for RemoveBandsExecutionStepper {}
|
||||
|
|
|
|||
|
|
@ -11,11 +11,7 @@ use thiserror::Error;
|
|||
use crate::{
|
||||
autorouter::{
|
||||
execution::ExecutionStepper,
|
||||
invoker::{
|
||||
GetActivePolygons, GetGhosts, GetMaybeNavcord, GetMaybeThetastarStepper,
|
||||
GetMaybeTopoNavmesh, GetNavmeshDebugTexts, GetObstacles, GetPolygonalBlockers, Invoker,
|
||||
InvokerError,
|
||||
},
|
||||
invoker::{GetDebugOverlayData, Invoker, InvokerError},
|
||||
},
|
||||
board::AccessMesadata,
|
||||
drawing::graph::PrimitiveIndex,
|
||||
|
|
@ -32,7 +28,7 @@ use crate::{
|
|||
stepper::{Abort, OnEvent, Step},
|
||||
};
|
||||
|
||||
/// Stores the interactive input data from the user
|
||||
/// Stores the interactive input data from the user.
|
||||
pub struct InteractiveInput {
|
||||
pub active_layer: Option<usize>,
|
||||
pub pointer_pos: Point,
|
||||
|
|
@ -47,18 +43,18 @@ pub enum InteractiveEventKind {
|
|||
PointerSecondaryButtonClicked,
|
||||
}
|
||||
|
||||
/// An event received from the user
|
||||
/// An event received from the user.
|
||||
pub struct InteractiveEvent {
|
||||
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,
|
||||
|
||||
/// `true` if the `Shift` key pressed during the event
|
||||
/// `true` if the `Shift` key is pressed during the event
|
||||
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 interactive_input: &'a InteractiveInput,
|
||||
pub invoker: &'a mut Invoker<M>,
|
||||
|
|
@ -72,17 +68,8 @@ pub enum ActivityError {
|
|||
Invoker(#[from] InvokerError),
|
||||
}
|
||||
|
||||
/// An activity is either an interaction or an execution
|
||||
#[enum_dispatch(
|
||||
GetActivePolygons,
|
||||
GetGhosts,
|
||||
GetMaybeNavcord,
|
||||
GetMaybeThetastarStepper,
|
||||
GetMaybeTopoNavmesh,
|
||||
GetNavmeshDebugTexts,
|
||||
GetObstacles,
|
||||
GetPolygonalBlockers
|
||||
)]
|
||||
/// An activity is either an interaction or an execution.
|
||||
#[enum_dispatch(GetDebugOverlayData)]
|
||||
pub enum ActivityStepper<M> {
|
||||
Interaction(InteractionStepper),
|
||||
Execution(ExecutionStepper<M>),
|
||||
|
|
@ -192,49 +179,35 @@ impl<M: AccessMesadata + Clone> OnEvent<ActivityContext<'_, M>, InteractiveEvent
|
|||
}
|
||||
}
|
||||
|
||||
impl<M> GetActivePolygons for ActivityStepperWithStatus<M> {
|
||||
fn active_polygons(&self) -> &[GenericIndex<PolyWeight>] {
|
||||
self.activity.active_polygons()
|
||||
}
|
||||
}
|
||||
|
||||
impl<M> GetMaybeThetastarStepper for ActivityStepperWithStatus<M> {
|
||||
impl<M> GetDebugOverlayData for ActivityStepperWithStatus<M> {
|
||||
fn maybe_thetastar(&self) -> Option<&ThetastarStepper<Navmesh, f64>> {
|
||||
self.activity.maybe_thetastar()
|
||||
}
|
||||
}
|
||||
|
||||
impl<M> GetMaybeTopoNavmesh for ActivityStepperWithStatus<M> {
|
||||
fn maybe_topo_navmesh(&self) -> Option<ng::pie::navmesh::NavmeshRef<'_, ng::PieNavmeshBase>> {
|
||||
self.activity.maybe_topo_navmesh()
|
||||
}
|
||||
}
|
||||
|
||||
impl<M> GetMaybeNavcord for ActivityStepperWithStatus<M> {
|
||||
fn maybe_navcord(&self) -> Option<&Navcord> {
|
||||
self.activity.maybe_navcord()
|
||||
}
|
||||
}
|
||||
|
||||
impl<M> GetGhosts for ActivityStepperWithStatus<M> {
|
||||
fn active_polygons(&self) -> &[GenericIndex<PolyWeight>] {
|
||||
self.activity.active_polygons()
|
||||
}
|
||||
|
||||
fn ghosts(&self) -> &[PrimitiveShape] {
|
||||
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] {
|
||||
self.activity.obstacles()
|
||||
}
|
||||
}
|
||||
|
||||
impl<M> GetNavmeshDebugTexts for ActivityStepperWithStatus<M> {
|
||||
fn polygonal_blockers(&self) -> &[LineString] {
|
||||
self.activity.polygonal_blockers()
|
||||
}
|
||||
|
||||
fn navnode_debug_text(&self, navnode: NavnodeIndex) -> Option<&str> {
|
||||
self.activity.navnode_debug_text(navnode)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,10 +6,7 @@ use core::ops::ControlFlow;
|
|||
use thiserror::Error;
|
||||
|
||||
use crate::{
|
||||
autorouter::invoker::{
|
||||
GetActivePolygons, GetGhosts, GetMaybeNavcord, GetMaybeThetastarStepper,
|
||||
GetMaybeTopoNavmesh, GetNavmeshDebugTexts, GetObstacles, GetPolygonalBlockers, Invoker,
|
||||
},
|
||||
autorouter::invoker::{GetDebugOverlayData, Invoker},
|
||||
board::AccessMesadata,
|
||||
stepper::{Abort, OnEvent, Step},
|
||||
};
|
||||
|
|
@ -67,11 +64,4 @@ impl<M: AccessMesadata> OnEvent<ActivityContext<'_, M>, InteractiveEvent> for In
|
|||
}
|
||||
}
|
||||
|
||||
impl GetActivePolygons 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 {}
|
||||
impl GetDebugOverlayData for InteractionStepper {}
|
||||
|
|
|
|||
|
|
@ -10,10 +10,7 @@ use std::{
|
|||
};
|
||||
|
||||
use crate::{
|
||||
autorouter::invoker::{
|
||||
GetActivePolygons, GetGhosts, GetMaybeNavcord, GetMaybeThetastarStepper,
|
||||
GetMaybeTopoNavmesh, GetNavmeshDebugTexts, GetObstacles, GetPolygonalBlockers,
|
||||
},
|
||||
autorouter::invoker::GetDebugOverlayData,
|
||||
drawing::{band::BandUid, dot::FixedDotIndex, graph::PrimitiveIndex, rules::AccessRules},
|
||||
geometry::primitive::PrimitiveShape,
|
||||
graph::GenericIndex,
|
||||
|
|
@ -235,23 +232,7 @@ impl<R: AccessRules + Clone + std::panic::RefUnwindSafe> AutorouteExecutionStepp
|
|||
}
|
||||
}
|
||||
|
||||
impl<M> GetActivePolygons 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> {
|
||||
impl<M> GetDebugOverlayData for AutorouteExecutionStepper<M> {
|
||||
fn maybe_topo_navmesh(&self) -> Option<pie::navmesh::NavmeshRef<'_, super::PieNavmeshBase>> {
|
||||
Some(pie::navmesh::NavmeshRef {
|
||||
nodes: &self.pmg_astar.nodes,
|
||||
|
|
@ -259,15 +240,19 @@ impl<M> GetMaybeTopoNavmesh for AutorouteExecutionStepper<M> {
|
|||
edge_paths: &self.last_edge_paths,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
impl<M> GetObstacles for AutorouteExecutionStepper<M> {
|
||||
fn active_polygons(&self) -> &[GenericIndex<PolyWeight>] {
|
||||
&self.active_polygons[..]
|
||||
}
|
||||
|
||||
fn ghosts(&self) -> &[PrimitiveShape] {
|
||||
&self.ghosts[..]
|
||||
}
|
||||
|
||||
fn obstacles(&self) -> &[PrimitiveIndex] {
|
||||
&self.obstacles[..]
|
||||
}
|
||||
}
|
||||
|
||||
impl<M> GetPolygonalBlockers for AutorouteExecutionStepper<M> {
|
||||
fn polygonal_blockers(&self) -> &[LineString] {
|
||||
&self.polygonal_blockers[..]
|
||||
}
|
||||
|
|
@ -534,23 +519,7 @@ impl<R: AccessRules + Clone + std::panic::RefUnwindSafe> ManualrouteExecutionSte
|
|||
}
|
||||
}
|
||||
|
||||
impl<M> GetActivePolygons 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> {
|
||||
impl<M> GetDebugOverlayData for ManualrouteExecutionStepper<M> {
|
||||
fn maybe_topo_navmesh(&self) -> Option<pie::navmesh::NavmeshRef<'_, super::PieNavmeshBase>> {
|
||||
Some(pie::navmesh::NavmeshRef {
|
||||
nodes: &self.nodes,
|
||||
|
|
@ -558,15 +527,19 @@ impl<M> GetMaybeTopoNavmesh for ManualrouteExecutionStepper<M> {
|
|||
edge_paths: &self.last_edge_paths(),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
impl<M> GetObstacles for ManualrouteExecutionStepper<M> {
|
||||
fn active_polygons(&self) -> &[GenericIndex<PolyWeight>] {
|
||||
&self.active_polygons[..]
|
||||
}
|
||||
|
||||
fn ghosts(&self) -> &[PrimitiveShape] {
|
||||
&self.ghosts[..]
|
||||
}
|
||||
|
||||
fn obstacles(&self) -> &[PrimitiveIndex] {
|
||||
&self.obstacles[..]
|
||||
}
|
||||
}
|
||||
|
||||
impl<M> GetPolygonalBlockers for ManualrouteExecutionStepper<M> {
|
||||
fn polygonal_blockers(&self) -> &[LineString] {
|
||||
&self.polygonal_blockers[..]
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue