diff --git a/src/drawing/dot.rs b/src/drawing/dot.rs index f48925d..4e7c393 100644 --- a/src/drawing/dot.rs +++ b/src/drawing/dot.rs @@ -14,7 +14,7 @@ use crate::{ rules::AccessRules, Drawing, }, - geometry::{AccessDotWeight, GetPos, GetWidth, SetPos}, + geometry::{AccessDotWeight, GetSetPos, GetWidth}, graph::{GenericIndex, GetPetgraphIndex}, math::Circle, }; @@ -47,7 +47,7 @@ impl TryFrom for DotIndex { } } -#[enum_dispatch(GetPos, SetPos, GetWidth, GetLayer)] +#[enum_dispatch(GetSetPos, GetWidth, GetLayer)] #[derive(Debug, Clone, Copy, PartialEq)] pub enum DotWeight { Fixed(FixedDotWeight), @@ -87,13 +87,11 @@ pub struct FixedDotWeight { impl_fixed_weight!(FixedDotWeight, FixedDot, FixedDotIndex); impl AccessDotWeight for FixedDotWeight {} -impl GetPos for FixedDotWeight { +impl GetSetPos for FixedDotWeight { fn pos(&self) -> Point { self.circle.pos } -} -impl SetPos for FixedDotWeight { fn set_pos(&mut self, pos: Point) { self.circle.pos = pos } @@ -115,13 +113,11 @@ pub struct LooseDotWeight { impl_loose_weight!(LooseDotWeight, LooseDot, LooseDotIndex); impl AccessDotWeight for LooseDotWeight {} -impl GetPos for LooseDotWeight { +impl GetSetPos for LooseDotWeight { fn pos(&self) -> Point { self.circle.pos } -} -impl SetPos for LooseDotWeight { fn set_pos(&mut self, pos: Point) { self.circle.pos = pos } diff --git a/src/drawing/drawing.rs b/src/drawing/drawing.rs index 2e11a00..e54985c 100644 --- a/src/drawing/drawing.rs +++ b/src/drawing/drawing.rs @@ -16,7 +16,7 @@ use crate::geometry::{ recording_with_rtree::RecordingGeometryWithRtree, with_rtree::BboxedIndex, AccessBendWeight, AccessDotWeight, AccessSegWeight, GenericNode, Geometry, GeometryLabel, - GetOffset, GetPos, GetWidth, + GetOffset, GetSetPos, GetWidth, }; use crate::graph::{GenericIndex, GetPetgraphIndex}; use crate::math::NoTangents; diff --git a/src/geometry/geometry.rs b/src/geometry/geometry.rs index 8bdda13..fe1f234 100644 --- a/src/geometry/geometry.rs +++ b/src/geometry/geometry.rs @@ -32,12 +32,8 @@ use crate::{ }; #[enum_dispatch] -pub trait GetPos { +pub trait GetSetPos { fn pos(&self) -> Point; -} - -#[enum_dispatch] -pub trait SetPos { fn set_pos(&mut self, pos: Point); } @@ -70,7 +66,7 @@ pub enum GenericNode { Compound(C), } -pub trait AccessDotWeight: GetPos + SetPos + GetWidth + Into + Copy {} +pub trait AccessDotWeight: GetSetPos + GetWidth + Into + Copy {} pub trait AccessSegWeight: GetWidth + Into + Copy {} pub trait AccessBendWeight: GetOffset + SetOffset + GetWidth + Into + Copy {} diff --git a/src/layout/poly.rs b/src/layout/poly.rs index b2c5457..89ea4a7 100644 --- a/src/layout/poly.rs +++ b/src/layout/poly.rs @@ -17,7 +17,7 @@ use crate::{ seg::SegIndex, Drawing, }, - geometry::GetPos, + geometry::GetSetPos, graph::{GenericIndex, GetPetgraphIndex}, layout::CompoundWeight, };