mirror of https://codeberg.org/topola/topola.git
drawing: rename drawing groupings to zones
A zone is a narrower concept than a grouping, as it cannot hold any bends.
This commit is contained in:
parent
31189a9f5e
commit
1f9b04215a
|
|
@ -20,12 +20,12 @@ use crate::drawing::{
|
|||
bend::{FixedBendIndex, LooseBendIndex, LooseBendWeight},
|
||||
dot::{DotIndex, FixedDotIndex, FixedDotWeight, LooseDotIndex, LooseDotWeight},
|
||||
graph::{MakePrimitive, PrimitiveIndex, PrimitiveWeight},
|
||||
grouping::{GroupingIndex, GroupingWeight},
|
||||
primitive::{GenericPrimitive, GetCore, GetInnerOuter, GetJoints, GetOtherJoint, MakeShape},
|
||||
seg::{
|
||||
FixedSegIndex, FixedSegWeight, LoneLooseSegIndex, LoneLooseSegWeight, SegIndex,
|
||||
SeqLooseSegIndex, SeqLooseSegWeight,
|
||||
},
|
||||
zone::{ZoneIndex, ZoneWeight},
|
||||
};
|
||||
use crate::geometry::Node;
|
||||
use crate::geometry::{
|
||||
|
|
@ -74,7 +74,7 @@ pub struct Drawing<R: RulesTrait> {
|
|||
DotWeight,
|
||||
SegWeight,
|
||||
BendWeight,
|
||||
GroupingWeight,
|
||||
ZoneWeight,
|
||||
PrimitiveIndex,
|
||||
DotIndex,
|
||||
SegIndex,
|
||||
|
|
@ -820,7 +820,7 @@ impl<R: RulesTrait> Drawing<R> {
|
|||
DotWeight,
|
||||
SegWeight,
|
||||
BendWeight,
|
||||
GroupingWeight,
|
||||
ZoneWeight,
|
||||
PrimitiveIndex,
|
||||
DotIndex,
|
||||
SegIndex,
|
||||
|
|
|
|||
|
|
@ -4,12 +4,12 @@ pub mod bend;
|
|||
pub mod collect;
|
||||
pub mod dot;
|
||||
mod drawing;
|
||||
pub mod grouping;
|
||||
pub mod guide;
|
||||
pub mod loose;
|
||||
pub mod primitive;
|
||||
pub mod rules;
|
||||
pub mod seg;
|
||||
pub mod segbend;
|
||||
pub mod zone;
|
||||
|
||||
pub use drawing::*;
|
||||
|
|
|
|||
|
|
@ -14,54 +14,54 @@ use crate::{
|
|||
|
||||
#[enum_dispatch(GetNodeIndex)]
|
||||
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||
pub enum GroupingIndex {
|
||||
Solid(SolidGroupingIndex),
|
||||
Pour(PourGroupingIndex),
|
||||
pub enum ZoneIndex {
|
||||
Solid(SolidZoneIndex),
|
||||
Pour(PourZoneIndex),
|
||||
}
|
||||
|
||||
#[enum_dispatch(GetLayer)]
|
||||
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||
pub enum GroupingWeight {
|
||||
Solid(SolidGroupingWeight),
|
||||
Pour(PourGroupingWeight),
|
||||
pub enum ZoneWeight {
|
||||
Solid(SolidZoneWeight),
|
||||
Pour(PourZoneWeight),
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||
pub struct SolidGroupingWeight {
|
||||
pub struct SolidZoneWeight {
|
||||
pub layer: u64,
|
||||
pub maybe_net: Option<usize>,
|
||||
}
|
||||
|
||||
impl<'a> GetLayer for SolidGroupingWeight {
|
||||
impl<'a> GetLayer for SolidZoneWeight {
|
||||
fn layer(&self) -> u64 {
|
||||
self.layer
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> GetMaybeNet for SolidGroupingWeight {
|
||||
impl<'a> GetMaybeNet for SolidZoneWeight {
|
||||
fn maybe_net(&self) -> Option<usize> {
|
||||
self.maybe_net
|
||||
}
|
||||
}
|
||||
|
||||
pub type SolidGroupingIndex = GenericIndex<SolidGroupingWeight>;
|
||||
pub type SolidZoneIndex = GenericIndex<SolidZoneWeight>;
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||
pub struct PourGroupingWeight {
|
||||
pub struct PourZoneWeight {
|
||||
pub layer: u64,
|
||||
pub maybe_net: Option<usize>,
|
||||
}
|
||||
|
||||
impl<'a> GetLayer for PourGroupingWeight {
|
||||
impl<'a> GetLayer for PourZoneWeight {
|
||||
fn layer(&self) -> u64 {
|
||||
self.layer
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> GetMaybeNet for PourGroupingWeight {
|
||||
impl<'a> GetMaybeNet for PourZoneWeight {
|
||||
fn maybe_net(&self) -> Option<usize> {
|
||||
self.maybe_net
|
||||
}
|
||||
}
|
||||
|
||||
pub type PourGroupingIndex = GenericIndex<PourGroupingWeight>;
|
||||
pub type PourZoneIndex = GenericIndex<PourZoneWeight>;
|
||||
Loading…
Reference in New Issue