mirror of https://codeberg.org/topola/topola.git
refactor(layout/layout): Add method to retrieve fixed dot's via (not used yet)
This commit is contained in:
parent
3856319dc9
commit
10dc1a86aa
|
|
@ -389,12 +389,23 @@ impl<R: AccessRules> Layout<R> {
|
||||||
.compounds(GenericIndex::<()>::new(primitive.index()))
|
.compounds(GenericIndex::<()>::new(primitive.index()))
|
||||||
.find_map(|(_, compound)| {
|
.find_map(|(_, compound)| {
|
||||||
if let CompoundWeight::Poly(_) = self.drawing().compound_weight(compound) {
|
if let CompoundWeight::Poly(_) = self.drawing().compound_weight(compound) {
|
||||||
Some(compound)
|
Some(GenericIndex::<PolyWeight>::new(compound.index()))
|
||||||
|
} else {
|
||||||
|
None
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn fixed_dot_via(&self, dot: FixedDotIndex) -> Option<GenericIndex<ViaWeight>> {
|
||||||
|
self.drawing()
|
||||||
|
.compounds(GenericIndex::<()>::new(dot.index()))
|
||||||
|
.find_map(|(_, compound)| {
|
||||||
|
if let CompoundWeight::Via(_) = self.drawing().compound_weight(compound) {
|
||||||
|
Some(GenericIndex::<ViaWeight>::new(compound.index()))
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.map(|compound| GenericIndex::<PolyWeight>::new(compound.index()))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Checks if a node is not a primitive part of a compound, and if yes, returns its apex and center
|
/// Checks if a node is not a primitive part of a compound, and if yes, returns its apex and center
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue