diff --git a/topola/src/board/mod.rs b/topola/src/board/mod.rs index 37874bc..893f44e 100644 --- a/topola/src/board/mod.rs +++ b/topola/src/board/mod.rs @@ -12,10 +12,10 @@ use derive_getters::Getters; use undoredo::{Delta, Recorder}; use crate::{ - compounds::{ComponentId, NetId, PinId}, layout::LayerId, layout::{ Layout, LayoutHalfDelta, + compounds::{ComponentId, NetId, PinId}, primitives::{ JointId, JointSpec, Polygon, PolygonId, Segment, SegmentId, SegmentSpec, Via, ViaId, ViaSpec, diff --git a/topola/src/board/resolve.rs b/topola/src/board/resolve.rs index 417c199..8e4074a 100644 --- a/topola/src/board/resolve.rs +++ b/topola/src/board/resolve.rs @@ -4,7 +4,7 @@ use crate::{ board::{Board, selections::ComponentSelection}, - compounds::ComponentId, + layout::compounds::ComponentId, }; impl Board { diff --git a/topola/src/board/transforms/move_by.rs b/topola/src/board/transforms/move_by.rs index 4f10a72..ecaa573 100644 --- a/topola/src/board/transforms/move_by.rs +++ b/topola/src/board/transforms/move_by.rs @@ -2,7 +2,7 @@ // // SPDX-License-Identifier: MIT OR Apache-2.0 -use crate::{Board, Vector2, compounds::ComponentId, selections::ComponentSelection}; +use crate::{Board, Vector2, layout::compounds::ComponentId, selections::ComponentSelection}; impl Board { pub fn move_components_by( diff --git a/topola/src/compounds/component.rs b/topola/src/layout/compounds/component.rs similarity index 92% rename from topola/src/compounds/component.rs rename to topola/src/layout/compounds/component.rs index a0da44b..6012197 100644 --- a/topola/src/compounds/component.rs +++ b/topola/src/layout/compounds/component.rs @@ -5,7 +5,7 @@ use derive_more::{Constructor, From}; use serde::{Deserialize, Serialize}; -use crate::primitives::{JointId, PolygonId, SegmentId, ViaId}; +use crate::layout::primitives::{JointId, PolygonId, SegmentId, ViaId}; #[derive( Clone, diff --git a/topola/src/compounds/mod.rs b/topola/src/layout/compounds/mod.rs similarity index 100% rename from topola/src/compounds/mod.rs rename to topola/src/layout/compounds/mod.rs diff --git a/topola/src/compounds/net.rs b/topola/src/layout/compounds/net.rs similarity index 100% rename from topola/src/compounds/net.rs rename to topola/src/layout/compounds/net.rs diff --git a/topola/src/compounds/pin.rs b/topola/src/layout/compounds/pin.rs similarity index 92% rename from topola/src/compounds/pin.rs rename to topola/src/layout/compounds/pin.rs index 10f55df..6ae1e8e 100644 --- a/topola/src/compounds/pin.rs +++ b/topola/src/layout/compounds/pin.rs @@ -5,7 +5,7 @@ use derive_more::{Constructor, From}; use serde::{Deserialize, Serialize}; -use crate::primitives::{JointId, PolygonId, SegmentId, ViaId}; +use crate::layout::primitives::{JointId, PolygonId, SegmentId, ViaId}; #[derive( Clone, diff --git a/topola/src/layout/mod.rs b/topola/src/layout/mod.rs index 9b65e27..b62d137 100644 --- a/topola/src/layout/mod.rs +++ b/topola/src/layout/mod.rs @@ -2,6 +2,7 @@ // // SPDX-License-Identifier: MIT OR Apache-2.0 +pub mod compounds; pub mod primitives; mod transforms; @@ -17,7 +18,7 @@ use undoredo::aliases::RTreeHalfDelta; use undoredo::{Delta, Recorder}; use crate::{ - compounds::{Component, ComponentId, Pin, PinId}, + layout::compounds::{Component, ComponentId, Pin, PinId}, layout::primitives::{ Joint, JointId, JointSpec, Polygon, PolygonId, Segment, SegmentId, SegmentSpec, Via, ViaId, ViaSpec, diff --git a/topola/src/layout/primitives/joint.rs b/topola/src/layout/primitives/joint.rs index a51ece3..da7a6db 100644 --- a/topola/src/layout/primitives/joint.rs +++ b/topola/src/layout/primitives/joint.rs @@ -6,8 +6,8 @@ use derive_more::{Constructor, From}; use rstar::{AABB, primitives::Rectangle}; use serde::{Deserialize, Serialize}; -use crate::compounds::{ComponentId, NetId, PinId}; use crate::layout::LayerId; +use crate::layout::compounds::{ComponentId, NetId, PinId}; use crate::math::Vector2; use super::{SegmentId, ViaId}; diff --git a/topola/src/layout/primitives/polygon.rs b/topola/src/layout/primitives/polygon.rs index c9751e1..24f2512 100644 --- a/topola/src/layout/primitives/polygon.rs +++ b/topola/src/layout/primitives/polygon.rs @@ -6,8 +6,8 @@ use derive_more::{Constructor, From}; use rstar::{AABB, Envelope, primitives::Rectangle}; use serde::{Deserialize, Serialize}; -use crate::compounds::{ComponentId, NetId, PinId}; use crate::layout::LayerId; +use crate::layout::compounds::{ComponentId, NetId, PinId}; use crate::math::Vector2; #[derive( diff --git a/topola/src/layout/primitives/segment.rs b/topola/src/layout/primitives/segment.rs index 93c9897..04f7eee 100644 --- a/topola/src/layout/primitives/segment.rs +++ b/topola/src/layout/primitives/segment.rs @@ -6,8 +6,8 @@ use derive_more::{Constructor, From}; use rstar::primitives::Rectangle; use serde::{Deserialize, Serialize}; -use crate::compounds::{ComponentId, NetId, PinId}; use crate::layout::LayerId; +use crate::layout::compounds::{ComponentId, NetId, PinId}; use crate::math::Vector2; use super::JointId; diff --git a/topola/src/layout/primitives/via.rs b/topola/src/layout/primitives/via.rs index adc3e93..4239324 100644 --- a/topola/src/layout/primitives/via.rs +++ b/topola/src/layout/primitives/via.rs @@ -6,8 +6,8 @@ use derive_more::{Constructor, From}; use rstar::{AABB, primitives::Rectangle}; use serde::{Deserialize, Serialize}; -use crate::compounds::{ComponentId, NetId, PinId}; use crate::layout::LayerId; +use crate::layout::compounds::{ComponentId, NetId, PinId}; use crate::math::Vector2; use super::JointId; diff --git a/topola/src/layout/transforms/move_by.rs b/topola/src/layout/transforms/move_by.rs index fe68549..844e6b2 100644 --- a/topola/src/layout/transforms/move_by.rs +++ b/topola/src/layout/transforms/move_by.rs @@ -2,7 +2,7 @@ // // SPDX-License-Identifier: MIT OR Apache-2.0 -use crate::{Layout, compounds::ComponentId, math::Vector2}; +use crate::{Layout, layout::compounds::ComponentId, math::Vector2}; impl Layout { pub fn move_component_by(&mut self, id: ComponentId, translation: Vector2) { diff --git a/topola/src/lib.rs b/topola/src/lib.rs index 944eacf..7066266 100644 --- a/topola/src/lib.rs +++ b/topola/src/lib.rs @@ -4,7 +4,6 @@ mod autorouter; mod board; -mod compounds; mod drawer; mod layout; mod math; @@ -17,9 +16,9 @@ mod specctra; pub use crate::autorouter::Autorouter; pub use crate::board::Board; pub use crate::board::selections; -pub use crate::compounds::{Pin, PinId}; pub use crate::layout::LayerId; pub use crate::layout::Layout; +pub use crate::layout::compounds::{Pin, PinId}; pub use crate::layout::primitives; pub use crate::math::Vector2; pub use crate::ratsnest::{Ratline, Ratsnest}; diff --git a/topola/src/ratsnest.rs b/topola/src/ratsnest.rs index 24ad7a0..bafa509 100644 --- a/topola/src/ratsnest.rs +++ b/topola/src/ratsnest.rs @@ -10,8 +10,8 @@ use spade::{DelaunayTriangulation, HasPosition, Triangulation, handles::FixedVer use crate::{ Board, - compounds::NetId, layout::LayerId, + layout::compounds::NetId, math::Vector2, primitives::{JointId, PolygonId, PrimitiveId, SegmentId}, }; diff --git a/topola/src/specctra.rs b/topola/src/specctra.rs index cba4088..247d035 100644 --- a/topola/src/specctra.rs +++ b/topola/src/specctra.rs @@ -12,8 +12,8 @@ use specctra::{ use crate::{ board::Board, - compounds::{ComponentId, NetId, PinId}, layout::LayerId, + layout::compounds::{ComponentId, NetId, PinId}, math::Vector2, primitives::{JointSpec, Polygon, Segment, SegmentSpec}, };