geometry: move shape to geometry module

This commit is contained in:
Mikolaj Wielgus 2024-01-30 02:05:53 +00:00
parent 8b1d95491d
commit 410b029eb3
11 changed files with 17 additions and 17 deletions

View File

@ -2,18 +2,18 @@ use enum_dispatch::enum_dispatch;
use geo::Line;
use crate::{
layout::Layout,
layout::{
bend::BendIndex,
connectivity::BandIndex,
dot::{DotIndex, FixedDotIndex, LooseDotIndex},
geometry::shape::{Shape, ShapeTrait},
graph::{GetBandIndex, MakePrimitive},
primitive::{GetCore, GetInnerOuter, GetOtherJoint, GetWeight, MakeShape},
Layout,
},
math::{self, Circle, NoTangents},
rules::{Conditions, Rules},
segbend::Segbend,
shape::{Shape, ShapeTrait},
};
#[enum_dispatch]

View File

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

View File

@ -13,10 +13,10 @@ use crate::{
layout::{
bend::{BendWeight, FixedBendWeight, LooseBendWeight},
dot::{DotWeight, FixedDotWeight, LooseDotWeight},
geometry::shape::{BendShape, DotShape, SegShape, Shape},
graph::{GeometryWeight, Retag},
},
math::Circle,
shape::{BendShape, DotShape, SegShape, Shape},
};
#[enum_dispatch]

View File

@ -1,3 +1,5 @@
#[macro_use]
mod geometry;
pub mod shape;
pub use geometry::*;

View File

@ -23,6 +23,7 @@ use crate::layout::geometry::{
use crate::layout::{
bend::{FixedBendIndex, LooseBendIndex, LooseBendWeight},
dot::{DotIndex, FixedDotIndex, FixedDotWeight, LooseDotIndex, LooseDotWeight},
geometry::shape::{Shape, ShapeTrait},
graph::{GeometryIndex, GeometryWeight, GetComponentIndex, MakePrimitive, Retag},
primitive::{
GenericPrimitive, GetConnectable, GetCore, GetInnerOuter, GetJoints, GetLimbs,
@ -35,7 +36,6 @@ use crate::layout::{
};
use crate::math::NoTangents;
use crate::segbend::Segbend;
use crate::shape::{Shape, ShapeTrait};
use crate::wraparoundable::{GetWraparound, Wraparoundable, WraparoundableIndex};
use super::bend::BendWeight;

View File

@ -5,9 +5,9 @@ pub mod bend;
pub mod connectivity;
pub mod dot;
pub mod geometry;
mod layout;
pub mod loose;
pub mod primitive;
pub mod seg;
mod layout;
pub use layout::*;

View File

@ -11,14 +11,15 @@ use crate::layout::{
bend::{BendIndex, FixedBendWeight, LooseBendIndex, LooseBendWeight},
connectivity::{BandIndex, ComponentIndex, GetNet},
dot::{DotIndex, FixedDotIndex, FixedDotWeight, LooseDotIndex, LooseDotWeight},
geometry::{GetOffset, GetWidth},
geometry::{
shape::{Shape, ShapeTrait},
GetOffset, GetWidth,
},
graph::{GeometryIndex, GeometryWeight, GetBandIndex, GetComponentIndex, MakePrimitive, Retag},
loose::{Loose, LooseIndex},
Layout,
};
use crate::shape::{Shape, ShapeTrait};
#[enum_dispatch]
pub trait GetLayout {
fn layout(&self) -> &Layout;

View File

@ -19,7 +19,6 @@ mod mesh;
mod router;
mod rules;
mod segbend;
mod shape;
mod tracer;
mod triangulation;
mod wraparoundable;
@ -28,6 +27,7 @@ use draw::DrawException;
use geo::point;
use layout::connectivity::BandIndex;
use layout::dot::FixedDotWeight;
use layout::geometry::shape::{Shape, ShapeTrait};
use layout::graph::{GeometryIndex, MakePrimitive};
use layout::primitive::MakeShape;
use layout::seg::FixedSegWeight;
@ -40,7 +40,6 @@ use sdl2::event::Event;
use sdl2::keyboard::Keycode;
use sdl2::video::{GLProfile, Window};
use sdl2::EventPump;
use shape::{Shape, ShapeTrait};
use pathfinder_canvas::{ArcDirection, CanvasRenderingContext2D, ColorU, FillRule};
use pathfinder_canvas::{Canvas, CanvasFontContext, Path2D};

View File

@ -14,10 +14,10 @@ use crate::{
layout::{
bend::{FixedBendIndex, LooseBendIndex},
dot::FixedDotIndex,
geometry::shape::ShapeTrait,
graph::{GeometryIndex, MakePrimitive},
primitive::{GetCore, MakeShape, Primitive},
},
shape::ShapeTrait,
triangulation::{GetVertexIndex, Triangulation},
};

View File

@ -11,6 +11,7 @@ use crate::layout::Layout;
use crate::layout::{
connectivity::BandIndex,
dot::FixedDotIndex,
geometry::shape::ShapeTrait,
graph::{GeometryIndex, MakePrimitive},
primitive::MakeShape,
};
@ -18,7 +19,6 @@ use crate::layout::{
use crate::mesh::{Mesh, MeshEdgeReference, VertexIndex};
use crate::rules::Rules;
use crate::shape::ShapeTrait;
use crate::tracer::{Trace, Tracer};
#[derive(Error, Debug, Clone, Copy)]