layout: move connectivity, band, loose to layout module

This commit is contained in:
Mikolaj Wielgus 2024-01-30 00:43:56 +00:00
parent ca23d45673
commit 43df065120
13 changed files with 39 additions and 29 deletions

View File

@ -2,10 +2,10 @@ use enum_dispatch::enum_dispatch;
use geo::Line; use geo::Line;
use crate::{ use crate::{
connectivity::BandIndex,
layout::Layout, layout::Layout,
layout::{ layout::{
bend::BendIndex, bend::BendIndex,
connectivity::BandIndex,
dot::{DotIndex, FixedDotIndex, LooseDotIndex}, dot::{DotIndex, FixedDotIndex, LooseDotIndex},
geometry::{GetBandIndex, MakePrimitive}, geometry::{GetBandIndex, MakePrimitive},
}, },

View File

@ -1,12 +1,14 @@
use crate::{ use super::{
connectivity::{BandIndex, BandWeight, ConnectivityWeight, GetNet}, connectivity::{BandIndex, BandWeight, ConnectivityWeight, GetNet},
loose::{GetNextLoose, LooseIndex},
};
use crate::{
graph::GetNodeIndex, graph::GetNodeIndex,
layout::Layout, layout::Layout,
layout::{ layout::{
dot::{DotIndex, FixedDotIndex}, dot::{DotIndex, FixedDotIndex},
geometry::{GeometryIndex, MakePrimitive}, geometry::{GeometryIndex, MakePrimitive},
}, },
loose::{GetNextLoose, LooseIndex},
primitive::{GetJoints, GetOtherJoint, MakeShape}, primitive::{GetJoints, GetOtherJoint, MakeShape},
shape::ShapeTrait, shape::ShapeTrait,
}; };

View File

@ -1,9 +1,11 @@
use enum_dispatch::enum_dispatch; use enum_dispatch::enum_dispatch;
use crate::{ use crate::{
connectivity::{BandIndex, ComponentIndex},
graph::{GenericIndex, GetNodeIndex}, graph::{GenericIndex, GetNodeIndex},
layout::Layout, layout::{
connectivity::{BandIndex, ComponentIndex},
Layout,
},
primitive::{GenericPrimitive, Primitive}, primitive::{GenericPrimitive, Primitive},
}; };

View File

@ -2,9 +2,11 @@ use enum_dispatch::enum_dispatch;
use geo::Point; use geo::Point;
use crate::{ use crate::{
connectivity::{BandIndex, ComponentIndex},
graph::{GenericIndex, GetNodeIndex}, graph::{GenericIndex, GetNodeIndex},
layout::Layout, layout::{
connectivity::{BandIndex, ComponentIndex},
Layout,
},
math::Circle, math::Circle,
primitive::{GenericPrimitive, Primitive}, primitive::{GenericPrimitive, Primitive},
}; };

View File

@ -9,9 +9,11 @@ use petgraph::{
}; };
use crate::{ use crate::{
connectivity::{BandIndex, ComponentIndex},
graph::{GenericIndex, GetNodeIndex}, graph::{GenericIndex, GetNodeIndex},
layout::Layout, layout::{
connectivity::{BandIndex, ComponentIndex},
Layout,
},
math::Circle, math::Circle,
primitive::Primitive, primitive::Primitive,
shape::{BendShape, DotShape, SegShape, Shape}, shape::{BendShape, DotShape, SegShape, Shape},

View File

@ -3,16 +3,16 @@ use enum_dispatch::enum_dispatch;
use geo::Point; use geo::Point;
use petgraph::stable_graph::StableDiGraph; use petgraph::stable_graph::StableDiGraph;
use petgraph::visit::EdgeRef; use petgraph::visit::EdgeRef;
use petgraph::Direction::Incoming;
use rstar::primitives::GeomWithData; use rstar::primitives::GeomWithData;
use rstar::{RTree, RTreeObject}; use rstar::{RTree, RTreeObject};
use thiserror::Error; use thiserror::Error;
use crate::band::Band; use super::band::Band;
use crate::connectivity::{ use super::connectivity::{
BandIndex, BandWeight, ComponentIndex, ComponentWeight, ConnectivityGraph, ConnectivityLabel, BandIndex, BandWeight, ComponentIndex, ComponentWeight, ConnectivityGraph, ConnectivityLabel,
ConnectivityWeight, GetNet, ConnectivityWeight, GetNet,
}; };
use super::loose::{GetNextLoose, Loose, LooseIndex};
use crate::graph::{GenericIndex, GetNodeIndex}; use crate::graph::{GenericIndex, GetNodeIndex};
use crate::guide::Guide; use crate::guide::Guide;
use crate::layout::bend::BendIndex; use crate::layout::bend::BendIndex;
@ -27,7 +27,6 @@ use crate::layout::{
}, },
seg::{FixedSegIndex, FixedSegWeight, LoneLooseSegIndex, LoneLooseSegWeight, SeqLooseSegIndex}, seg::{FixedSegIndex, FixedSegWeight, LoneLooseSegIndex, LoneLooseSegWeight, SeqLooseSegIndex},
}; };
use crate::loose::{GetNextLoose, Loose, LooseIndex};
use crate::math::NoTangents; use crate::math::NoTangents;
use crate::primitive::{ use crate::primitive::{
GenericPrimitive, GetConnectable, GetCore, GetInnerOuter, GetJoints, GetLimbs, GetOtherJoint, GenericPrimitive, GetConnectable, GetCore, GetInnerOuter, GetJoints, GetLimbs, GetOtherJoint,

View File

@ -1,7 +1,10 @@
#[macro_use] #[macro_use]
pub mod geometry; pub mod geometry;
pub mod band;
pub mod bend; pub mod bend;
pub mod connectivity;
pub mod dot; pub mod dot;
pub mod loose;
pub mod seg; pub mod seg;
mod layout; mod layout;

View File

@ -1,9 +1,11 @@
use enum_dispatch::enum_dispatch; use enum_dispatch::enum_dispatch;
use crate::{ use crate::{
connectivity::{BandIndex, ComponentIndex},
graph::{GenericIndex, GetNodeIndex}, graph::{GenericIndex, GetNodeIndex},
layout::Layout, layout::{
connectivity::{BandIndex, ComponentIndex},
Layout,
},
primitive::{GenericPrimitive, Primitive}, primitive::{GenericPrimitive, Primitive},
}; };

View File

@ -9,13 +9,10 @@ macro_rules! dbg_dot {
} }
mod astar; mod astar;
mod band;
mod connectivity;
mod draw; mod draw;
mod graph; mod graph;
mod guide; mod guide;
mod layout; mod layout;
mod loose;
mod math; mod math;
mod mesh; mod mesh;
mod primitive; mod primitive;
@ -27,9 +24,9 @@ mod tracer;
mod triangulation; mod triangulation;
mod wraparoundable; mod wraparoundable;
use connectivity::BandIndex;
use draw::DrawException; use draw::DrawException;
use geo::point; use geo::point;
use layout::connectivity::BandIndex;
use layout::dot::FixedDotWeight; use layout::dot::FixedDotWeight;
use layout::geometry::{GeometryIndex, MakePrimitive}; use layout::geometry::{GeometryIndex, MakePrimitive};
use layout::seg::FixedSegWeight; use layout::seg::FixedSegWeight;

View File

@ -1,24 +1,25 @@
use enum_dispatch::enum_dispatch; use enum_dispatch::enum_dispatch;
use petgraph::stable_graph::NodeIndex; use petgraph::stable_graph::NodeIndex;
use petgraph::Direction::{Incoming, Outgoing};
use crate::connectivity::{BandIndex, ComponentIndex, GetNet};
use crate::graph::{GenericIndex, GetNodeIndex}; use crate::graph::{GenericIndex, GetNodeIndex};
use crate::layout::dot::DotWeight; use crate::layout::dot::DotWeight;
use crate::layout::seg::{ use crate::layout::seg::{
FixedSegIndex, FixedSegWeight, LoneLooseSegIndex, LoneLooseSegWeight, SegIndex, FixedSegWeight, LoneLooseSegIndex, LoneLooseSegWeight, SegIndex, SeqLooseSegIndex,
SeqLooseSegIndex, SeqLooseSegWeight, SeqLooseSegWeight,
}; };
use crate::layout::Layout;
use crate::layout::{ use crate::layout::{
bend::{BendIndex, FixedBendIndex, FixedBendWeight, LooseBendIndex, LooseBendWeight}, bend::{BendIndex, FixedBendWeight, LooseBendIndex, LooseBendWeight},
dot::{DotIndex, FixedDotIndex, FixedDotWeight, LooseDotIndex, LooseDotWeight}, dot::{DotIndex, FixedDotIndex, FixedDotWeight, LooseDotIndex, LooseDotWeight},
geometry::{ geometry::{
GeometryIndex, GeometryLabel, GeometryWeight, GetBandIndex, GetComponentIndex, GetOffset, GeometryIndex, GeometryWeight, GetBandIndex, GetComponentIndex, GetOffset, GetWidth,
GetWidth, MakePrimitive, Retag, MakePrimitive, Retag,
}, },
}; };
use crate::loose::{Loose, LooseIndex}; use crate::layout::{
connectivity::{BandIndex, ComponentIndex, GetNet},
loose::{Loose, LooseIndex},
Layout,
};
use crate::shape::{Shape, ShapeTrait}; use crate::shape::{Shape, ShapeTrait};

View File

@ -5,11 +5,11 @@ use spade::InsertionError;
use thiserror::Error; use thiserror::Error;
use crate::astar::{astar, AstarStrategy, PathTracker}; use crate::astar::{astar, AstarStrategy, PathTracker};
use crate::connectivity::BandIndex;
use crate::draw::DrawException; use crate::draw::DrawException;
use crate::guide::HeadTrait; use crate::guide::HeadTrait;
use crate::layout::Layout; use crate::layout::Layout;
use crate::layout::{ use crate::layout::{
connectivity::BandIndex,
dot::FixedDotIndex, dot::FixedDotIndex,
geometry::{GeometryIndex, MakePrimitive}, geometry::{GeometryIndex, MakePrimitive},
}; };