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 crate::drawing::{
use super::{
bend::LooseBendIndex, bend::LooseBendIndex,
graph::PrimitiveIndex, graph::PrimitiveIndex,
primitive::{GetInnerOuter, GetJoints}, primitive::{GetInnerOuter, GetJoints},
rules::RulesTrait, rules::RulesTrait,
wraparoundable::{GetWraparound, WraparoundableIndex},
Drawing, Drawing,
}; };

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -8,7 +8,6 @@ use petgraph::{stable_graph::NodeIndex, visit::EdgeRef};
use spade::{HasPosition, InsertionError, Point2}; use spade::{HasPosition, InsertionError, Point2};
use crate::drawing::rules::RulesTrait; use crate::drawing::rules::RulesTrait;
use crate::triangulation::TriangulationEdgeReference;
use crate::{ use crate::{
drawing::{ drawing::{
bend::{FixedBendIndex, LooseBendIndex}, bend::{FixedBendIndex, LooseBendIndex},
@ -19,7 +18,7 @@ use crate::{
}, },
geometry::primitive::PrimitiveShapeTrait, geometry::primitive::PrimitiveShapeTrait,
graph::GetNodeIndex, graph::GetNodeIndex,
triangulation::{GetVertexIndex, Triangulation}, router::triangulation::{GetVertexIndex, Triangulation, TriangulationEdgeReference},
}; };
#[enum_dispatch(GetNodeIndex, MakePrimitive)] #[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 spade::InsertionError;
use thiserror::Error; use thiserror::Error;
use crate::astar::{astar, AstarStrategy, PathTracker};
use crate::draw::DrawException;
use crate::drawing::{ use crate::drawing::{
dot::FixedDotIndex, dot::FixedDotIndex,
graph::{MakePrimitive, PrimitiveIndex}, graph::{MakePrimitive, PrimitiveIndex},
@ -16,9 +14,12 @@ use crate::geometry::primitive::PrimitiveShapeTrait;
use crate::layout::connectivity::BandIndex; use crate::layout::connectivity::BandIndex;
use crate::layout::Layout; use crate::layout::Layout;
use crate::mesh::{Mesh, MeshEdgeReference, VertexIndex}; use crate::router::{
astar::{astar, AstarStrategy, PathTracker},
use crate::tracer::{Trace, Tracer}; draw::DrawException,
mesh::{Mesh, MeshEdgeReference, VertexIndex},
tracer::{Trace, Tracer},
};
#[derive(Error, Debug, Clone, Copy)] #[derive(Error, Debug, Clone, Copy)]
#[error("failed to route from {from:?} to {to:?}")] // this should eventually use Display #[error("failed to route from {from:?} to {to:?}")] // this should eventually use Display

View File

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