router: move top-level files to own `router` module

This commit is contained in:
Mikolaj Wielgus 2024-04-14 20:22:20 +00:00
parent bad487f6af
commit df23ea8398
13 changed files with 26 additions and 23 deletions

View File

@ -1,10 +1,9 @@
use crate::wraparoundable::{GetWraparound, WraparoundableIndex};
use super::{
use crate::drawing::{
bend::LooseBendIndex,
graph::PrimitiveIndex,
primitive::{GetInnerOuter, GetJoints},
rules::RulesTrait,
wraparoundable::{GetWraparound, WraparoundableIndex},
Drawing,
};

View File

@ -16,6 +16,7 @@ use crate::drawing::graph::GetMaybeNet;
use crate::drawing::guide::Guide;
use crate::drawing::primitive::GetLimbs;
use crate::drawing::rules::GetConditions;
use crate::drawing::wraparoundable::{GetWraparound, Wraparoundable, WraparoundableIndex};
use crate::drawing::{
bend::{FixedBendIndex, LooseBendIndex, LooseBendWeight},
dot::{DotIndex, FixedDotIndex, FixedDotWeight, LooseDotIndex, LooseDotWeight},
@ -38,7 +39,6 @@ use crate::geometry::{
use crate::graph::{GenericIndex, GetNodeIndex};
use crate::layout::zone::{ZoneIndex, ZoneWeight};
use crate::math::NoTangents;
use crate::wraparoundable::{GetWraparound, Wraparoundable, WraparoundableIndex};
use super::bend::BendWeight;
use super::seg::SegWeight;

View File

@ -10,5 +10,6 @@ pub mod primitive;
pub mod rules;
pub mod seg;
pub mod segbend;
pub mod wraparoundable;
pub use drawing::*;

View File

@ -13,6 +13,7 @@ use crate::{
SeqLooseSegWeight,
},
segbend::Segbend,
wraparoundable::WraparoundableIndex,
Drawing, Infringement, LayoutException,
},
geometry::{
@ -26,7 +27,6 @@ use crate::{
},
zone::{PourZoneIndex, SolidZoneIndex, ZoneIndex, ZoneWeight},
},
wraparoundable::WraparoundableIndex,
};
pub struct Layout<R: RulesTrait> {

View File

@ -1,7 +1,5 @@
#![feature(try_blocks)]
pub mod astar;
pub mod draw;
pub mod graph;
#[macro_use]
pub mod drawing;
@ -9,8 +7,4 @@ pub mod dsn;
pub mod geometry;
pub mod layout;
pub mod math;
pub mod mesh;
pub mod router;
pub mod tracer;
pub mod triangulation;
pub mod wraparoundable;

View File

@ -11,11 +11,11 @@ use crate::{
primitive::GetOtherJoint,
rules::RulesTrait,
seg::{LoneLooseSegWeight, SeqLooseSegWeight},
wraparoundable::WraparoundableIndex,
Infringement, LayoutException,
},
layout::Layout,
math::{Circle, NoTangents},
wraparoundable::WraparoundableIndex,
};
#[derive(Error, Debug, Clone, Copy)]

View File

@ -8,7 +8,6 @@ use petgraph::{stable_graph::NodeIndex, visit::EdgeRef};
use spade::{HasPosition, InsertionError, Point2};
use crate::drawing::rules::RulesTrait;
use crate::triangulation::TriangulationEdgeReference;
use crate::{
drawing::{
bend::{FixedBendIndex, LooseBendIndex},
@ -19,7 +18,7 @@ use crate::{
},
geometry::primitive::PrimitiveShapeTrait,
graph::GetNodeIndex,
triangulation::{GetVertexIndex, Triangulation},
router::triangulation::{GetVertexIndex, Triangulation, TriangulationEdgeReference},
};
#[enum_dispatch(GetNodeIndex, MakePrimitive)]

8
src/router/mod.rs Normal file
View File

@ -0,0 +1,8 @@
pub mod astar;
pub mod draw;
pub mod mesh;
mod router;
pub mod tracer;
pub mod triangulation;
pub use router::*;

View File

@ -4,8 +4,6 @@ use petgraph::visit::EdgeRef;
use spade::InsertionError;
use thiserror::Error;
use crate::astar::{astar, AstarStrategy, PathTracker};
use crate::draw::DrawException;
use crate::drawing::{
dot::FixedDotIndex,
graph::{MakePrimitive, PrimitiveIndex},
@ -16,9 +14,12 @@ use crate::geometry::primitive::PrimitiveShapeTrait;
use crate::layout::connectivity::BandIndex;
use crate::layout::Layout;
use crate::mesh::{Mesh, MeshEdgeReference, VertexIndex};
use crate::tracer::{Trace, Tracer};
use crate::router::{
astar::{astar, AstarStrategy, PathTracker},
draw::DrawException,
mesh::{Mesh, MeshEdgeReference, VertexIndex},
tracer::{Trace, Tracer},
};
#[derive(Error, Debug, Clone, Copy)]
#[error("failed to route from {from:?} to {to:?}")] // this should eventually use Display

View File

@ -1,16 +1,17 @@
use contracts::debug_ensures;
use crate::{
draw::{Draw, DrawException},
drawing::{
bend::LooseBendIndex,
dot::FixedDotIndex,
graph::{GetMaybeNet, MakePrimitive},
guide::{BareHead, Head, HeadTrait, SegbendHead},
guide::{BareHead, Head, SegbendHead},
rules::RulesTrait,
},
layout::{connectivity::BandIndex, Layout},
router::{
draw::{Draw, DrawException},
mesh::{Mesh, VertexIndex},
},
};
#[derive(Debug)]