Expand `layout.rs` into new module directory

This commit is contained in:
Mikolaj Wielgus 2026-05-19 23:24:43 +02:00
parent 692ec68ec2
commit 2ed6e13a50
8 changed files with 18 additions and 11 deletions

View File

@ -11,12 +11,14 @@ use undoredo::{ApplyDelta, Delta, FlushDelta};
use crate::{ use crate::{
compounds::{ComponentId, NetId, PinId}, compounds::{ComponentId, NetId, PinId},
layout::{Layout, LayoutHalfDelta}, layout::{
math::Vector2, Layout, LayoutHalfDelta,
primitives::{ primitives::{
JointId, JointSpec, Polygon, PolygonId, Segment, SegmentId, SegmentSpec, Via, ViaId, JointId, JointSpec, Polygon, PolygonId, Segment, SegmentId, SegmentSpec, Via, ViaId,
ViaSpec, ViaSpec,
},
}, },
math::Vector2,
}; };
#[derive(Clone, Debug, Getters)] #[derive(Clone, Debug, Getters)]

View File

@ -2,6 +2,8 @@
// //
// SPDX-License-Identifier: MIT OR Apache-2.0 // SPDX-License-Identifier: MIT OR Apache-2.0
pub mod primitives;
use derive_getters::Getters; use derive_getters::Getters;
use rstar::{ use rstar::{
AABB, RTree, AABB, RTree,
@ -13,11 +15,11 @@ use undoredo::{Delta, Recorder};
use crate::{ use crate::{
compounds::{Component, ComponentId, Pin, PinId}, compounds::{Component, ComponentId, Pin, PinId},
math::Vector2, layout::primitives::{
primitives::{
Joint, JointId, JointSpec, Polygon, PolygonId, Segment, SegmentId, SegmentSpec, Via, ViaId, Joint, JointId, JointSpec, Polygon, PolygonId, Segment, SegmentId, SegmentSpec, Via, ViaId,
ViaSpec, ViaSpec,
}, },
math::Vector2,
}; };
#[derive(Clone, Debug, Delta, Getters)] #[derive(Clone, Debug, Delta, Getters)]

View File

@ -8,7 +8,8 @@ use serde::{Deserialize, Serialize};
use crate::compounds::{ComponentId, NetId, PinId}; use crate::compounds::{ComponentId, NetId, PinId};
use crate::math::Vector2; use crate::math::Vector2;
use crate::primitives::{SegmentId, ViaId};
use super::{SegmentId, ViaId};
#[derive( #[derive(
Clone, Constructor, Copy, Debug, Deserialize, Eq, Ord, PartialEq, PartialOrd, Serialize, Clone, Constructor, Copy, Debug, Deserialize, Eq, Ord, PartialEq, PartialOrd, Serialize,

View File

@ -8,7 +8,8 @@ use serde::{Deserialize, Serialize};
use crate::compounds::{ComponentId, NetId, PinId}; use crate::compounds::{ComponentId, NetId, PinId};
use crate::math::Vector2; use crate::math::Vector2;
use crate::primitives::JointId;
use super::JointId;
#[derive( #[derive(
Clone, Constructor, Copy, Debug, Deserialize, Eq, Ord, PartialEq, PartialOrd, Serialize, Clone, Constructor, Copy, Debug, Deserialize, Eq, Ord, PartialEq, PartialOrd, Serialize,

View File

@ -8,7 +8,8 @@ use serde::{Deserialize, Serialize};
use crate::compounds::{ComponentId, NetId, PinId}; use crate::compounds::{ComponentId, NetId, PinId};
use crate::math::Vector2; use crate::math::Vector2;
use crate::primitives::JointId;
use super::JointId;
#[derive( #[derive(
Clone, Constructor, Copy, Debug, Deserialize, Eq, Ord, PartialEq, PartialOrd, Serialize, Clone, Constructor, Copy, Debug, Deserialize, Eq, Ord, PartialEq, PartialOrd, Serialize,

View File

@ -10,7 +10,6 @@ mod layout;
mod math; mod math;
mod navmesher; mod navmesher;
mod pathfinder; mod pathfinder;
pub mod primitives;
mod ratsnest; mod ratsnest;
mod router; mod router;
mod specctra; mod specctra;
@ -20,5 +19,6 @@ pub use crate::board::Board;
pub use crate::board::selections; pub use crate::board::selections;
pub use crate::compounds::{Pin, PinId}; pub use crate::compounds::{Pin, PinId};
pub use crate::layout::Layout; pub use crate::layout::Layout;
pub use crate::layout::primitives;
pub use crate::math::Vector2; pub use crate::math::Vector2;
pub use crate::ratsnest::{Ratline, Ratsnest}; pub use crate::ratsnest::{Ratline, Ratsnest};