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},
|
bend::{FixedBendIndex, LooseBendIndex, LooseBendWeight},
|
||||||
dot::{DotIndex, FixedDotIndex, FixedDotWeight, LooseDotIndex, LooseDotWeight},
|
dot::{DotIndex, FixedDotIndex, FixedDotWeight, LooseDotIndex, LooseDotWeight},
|
||||||
graph::{MakePrimitive, PrimitiveIndex, PrimitiveWeight},
|
graph::{MakePrimitive, PrimitiveIndex, PrimitiveWeight},
|
||||||
grouping::{GroupingIndex, GroupingWeight},
|
|
||||||
primitive::{GenericPrimitive, GetCore, GetInnerOuter, GetJoints, GetOtherJoint, MakeShape},
|
primitive::{GenericPrimitive, GetCore, GetInnerOuter, GetJoints, GetOtherJoint, MakeShape},
|
||||||
seg::{
|
seg::{
|
||||||
FixedSegIndex, FixedSegWeight, LoneLooseSegIndex, LoneLooseSegWeight, SegIndex,
|
FixedSegIndex, FixedSegWeight, LoneLooseSegIndex, LoneLooseSegWeight, SegIndex,
|
||||||
SeqLooseSegIndex, SeqLooseSegWeight,
|
SeqLooseSegIndex, SeqLooseSegWeight,
|
||||||
},
|
},
|
||||||
|
zone::{ZoneIndex, ZoneWeight},
|
||||||
};
|
};
|
||||||
use crate::geometry::Node;
|
use crate::geometry::Node;
|
||||||
use crate::geometry::{
|
use crate::geometry::{
|
||||||
|
|
@ -74,7 +74,7 @@ pub struct Drawing<R: RulesTrait> {
|
||||||
DotWeight,
|
DotWeight,
|
||||||
SegWeight,
|
SegWeight,
|
||||||
BendWeight,
|
BendWeight,
|
||||||
GroupingWeight,
|
ZoneWeight,
|
||||||
PrimitiveIndex,
|
PrimitiveIndex,
|
||||||
DotIndex,
|
DotIndex,
|
||||||
SegIndex,
|
SegIndex,
|
||||||
|
|
@ -820,7 +820,7 @@ impl<R: RulesTrait> Drawing<R> {
|
||||||
DotWeight,
|
DotWeight,
|
||||||
SegWeight,
|
SegWeight,
|
||||||
BendWeight,
|
BendWeight,
|
||||||
GroupingWeight,
|
ZoneWeight,
|
||||||
PrimitiveIndex,
|
PrimitiveIndex,
|
||||||
DotIndex,
|
DotIndex,
|
||||||
SegIndex,
|
SegIndex,
|
||||||
|
|
|
||||||
|
|
@ -4,12 +4,12 @@ pub mod bend;
|
||||||
pub mod collect;
|
pub mod collect;
|
||||||
pub mod dot;
|
pub mod dot;
|
||||||
mod drawing;
|
mod drawing;
|
||||||
pub mod grouping;
|
|
||||||
pub mod guide;
|
pub mod guide;
|
||||||
pub mod loose;
|
pub mod loose;
|
||||||
pub mod primitive;
|
pub mod primitive;
|
||||||
pub mod rules;
|
pub mod rules;
|
||||||
pub mod seg;
|
pub mod seg;
|
||||||
pub mod segbend;
|
pub mod segbend;
|
||||||
|
pub mod zone;
|
||||||
|
|
||||||
pub use drawing::*;
|
pub use drawing::*;
|
||||||
|
|
|
||||||
|
|
@ -14,54 +14,54 @@ use crate::{
|
||||||
|
|
||||||
#[enum_dispatch(GetNodeIndex)]
|
#[enum_dispatch(GetNodeIndex)]
|
||||||
#[derive(Debug, Clone, Copy, PartialEq)]
|
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||||
pub enum GroupingIndex {
|
pub enum ZoneIndex {
|
||||||
Solid(SolidGroupingIndex),
|
Solid(SolidZoneIndex),
|
||||||
Pour(PourGroupingIndex),
|
Pour(PourZoneIndex),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[enum_dispatch(GetLayer)]
|
#[enum_dispatch(GetLayer)]
|
||||||
#[derive(Debug, Clone, Copy, PartialEq)]
|
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||||
pub enum GroupingWeight {
|
pub enum ZoneWeight {
|
||||||
Solid(SolidGroupingWeight),
|
Solid(SolidZoneWeight),
|
||||||
Pour(PourGroupingWeight),
|
Pour(PourZoneWeight),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, PartialEq)]
|
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||||
pub struct SolidGroupingWeight {
|
pub struct SolidZoneWeight {
|
||||||
pub layer: u64,
|
pub layer: u64,
|
||||||
pub maybe_net: Option<usize>,
|
pub maybe_net: Option<usize>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> GetLayer for SolidGroupingWeight {
|
impl<'a> GetLayer for SolidZoneWeight {
|
||||||
fn layer(&self) -> u64 {
|
fn layer(&self) -> u64 {
|
||||||
self.layer
|
self.layer
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> GetMaybeNet for SolidGroupingWeight {
|
impl<'a> GetMaybeNet for SolidZoneWeight {
|
||||||
fn maybe_net(&self) -> Option<usize> {
|
fn maybe_net(&self) -> Option<usize> {
|
||||||
self.maybe_net
|
self.maybe_net
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub type SolidGroupingIndex = GenericIndex<SolidGroupingWeight>;
|
pub type SolidZoneIndex = GenericIndex<SolidZoneWeight>;
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, PartialEq)]
|
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||||
pub struct PourGroupingWeight {
|
pub struct PourZoneWeight {
|
||||||
pub layer: u64,
|
pub layer: u64,
|
||||||
pub maybe_net: Option<usize>,
|
pub maybe_net: Option<usize>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> GetLayer for PourGroupingWeight {
|
impl<'a> GetLayer for PourZoneWeight {
|
||||||
fn layer(&self) -> u64 {
|
fn layer(&self) -> u64 {
|
||||||
self.layer
|
self.layer
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> GetMaybeNet for PourGroupingWeight {
|
impl<'a> GetMaybeNet for PourZoneWeight {
|
||||||
fn maybe_net(&self) -> Option<usize> {
|
fn maybe_net(&self) -> Option<usize> {
|
||||||
self.maybe_net
|
self.maybe_net
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub type PourGroupingIndex = GenericIndex<PourGroupingWeight>;
|
pub type PourZoneIndex = GenericIndex<PourZoneWeight>;
|
||||||
Loading…
Reference in New Issue