From 63804a029767ed5cff0a9bd1a23fdbaf94e320b4 Mon Sep 17 00:00:00 2001 From: hakki Date: Sun, 10 Nov 2024 19:23:55 +0100 Subject: [PATCH] invoker: added trait description --- src/autorouter/invoker.rs | 23 ++++++++++++++++++----- src/drawing/cane.rs | 4 ++++ src/drawing/head.rs | 10 ++++++++++ src/router/navcord.rs | 8 ++++++++ 4 files changed, 40 insertions(+), 5 deletions(-) diff --git a/src/autorouter/invoker.rs b/src/autorouter/invoker.rs index 5a04804..80ffbc0 100644 --- a/src/autorouter/invoker.rs +++ b/src/autorouter/invoker.rs @@ -28,28 +28,41 @@ use super::{ #[enum_dispatch] /// Getter trait to obtain Navigation Mesh +/// +/// Navigation Mesh is possible routes between +/// two points pub trait GetMaybeNavmesh { - /// Returns navigation mesh if possible + /// Returns Navigation Mesh if possible fn maybe_navmesh(&self) -> Option<&Navmesh>; } #[enum_dispatch] -/// TODO: Trait to require Navigation Cord implementation details +/// Getter for Navigation Cord +/// +/// Navigation Cord is the possible path of +/// ongoing autorouting process pub trait GetMaybeNavcord { + /// Gets the Navigation Cord if possible fn maybe_navcord(&self) -> Option<&NavcordStepper>; } #[enum_dispatch] -/// TODO: Requires Ghosts implementations +/// Requires Ghosts implementations +/// +/// Ghosts are possible shapes of routing +/// bands pub trait GetGhosts { /// Retrieves the ghosts associated with the execution. fn ghosts(&self) -> &[PrimitiveShape]; } #[enum_dispatch] -/// TODO: Defines Obstacles getter implementation +/// Getter for the Obstacles +/// +/// Obstacles are shapes of existing bands +/// to be avoided by the new band pub trait GetObstacles { - /// Returns possible obstacles + /// Returns possible Obstacles fn obstacles(&self) -> &[PrimitiveIndex]; } diff --git a/src/drawing/cane.rs b/src/drawing/cane.rs index 587ef96..dff077c 100644 --- a/src/drawing/cane.rs +++ b/src/drawing/cane.rs @@ -10,9 +10,13 @@ use crate::drawing::{ use super::rules::AccessRules; #[derive(Debug, Clone, Copy)] +/// Geometrical structure to define Navigation Cord Head pub struct Cane { + /// Loose segment of the Cane pub seg: SeqLooseSegIndex, + /// Loose dot of the Cane structure pub dot: LooseDotIndex, + /// Bend of the Cane pub bend: LooseBendIndex, } diff --git a/src/drawing/head.rs b/src/drawing/head.rs index 41d2a46..ffe2531 100644 --- a/src/drawing/head.rs +++ b/src/drawing/head.rs @@ -17,6 +17,11 @@ pub trait GetFace { #[enum_dispatch(GetFace)] #[derive(Debug, Clone, Copy)] +/// Defines possible Head objects +/// +/// Head is the working end of routed band, which can be +/// either Bare when nothing has been routed yet, or Cane +/// when routed process has been started pub enum Head { Bare(BareHead), Cane(CaneHead), @@ -29,7 +34,9 @@ impl<'a, CW: Copy, R: AccessRules> MakeRef<'a, HeadRef<'a, CW, R>, Drawing, + /// Type of Navigaction Cord head pub head: Head, + /// Width of the cord pub width: f64, } impl NavcordStepper { + /// Create new Navigation Cord instance pub fn new( source: FixedDotIndex, source_navvertex: NavvertexIndex,