mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 09:12:09 +10:00
Apply z-order to highlight connected areas feature
This commit is contained in:
@@ -20,6 +20,7 @@ package org.diylc.netlist;
|
|||||||
|
|
||||||
import java.awt.geom.Area;
|
import java.awt.geom.Area;
|
||||||
import java.awt.geom.Point2D;
|
import java.awt.geom.Point2D;
|
||||||
|
import java.util.Comparator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
@@ -45,14 +46,19 @@ public class ContinuityGraph {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public List<Area> findAreasFor(Point2D point) {
|
public List<Area> findAreasFor(Point2D point) {
|
||||||
Optional<ContinuityNode> first = groupTree.search(point, NetlistBuilder.eps).stream()
|
List<ContinuityNode> matchingNodes = groupTree.search(point, NetlistBuilder.eps)
|
||||||
.filter(node -> node.getArea().getArea().contains(point)).findFirst();
|
.stream()
|
||||||
|
.filter(node -> node.getArea().getArea().contains(point))
|
||||||
|
.sorted(Comparator.comparing(x -> x.getArea().getZIndex(), Comparator.reverseOrder()))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
return first.map(node ->
|
if (matchingNodes.isEmpty())
|
||||||
areaGroupMap.get(node.getGroupId())
|
return null;
|
||||||
|
|
||||||
|
return areaGroupMap.get(matchingNodes.get(0).getGroupId())
|
||||||
.stream()
|
.stream()
|
||||||
.map(x -> x.getArea())
|
.map(x -> x.getArea())
|
||||||
.collect(Collectors.toList())).orElse(null);
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class ContinuityNode {
|
public static class ContinuityNode {
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ AWG
|
|||||||
Alternate
|
Alternate
|
||||||
And
|
And
|
||||||
Angle Offset
|
Angle Offset
|
||||||
|
Apply Model
|
||||||
B-C-E BJT
|
B-C-E BJT
|
||||||
Background
|
Background
|
||||||
Box
|
Box
|
||||||
@@ -93,6 +94,7 @@ G-D-S MOSFET
|
|||||||
G-O-I REGULATOR
|
G-O-I REGULATOR
|
||||||
G-S-D JFET
|
G-S-D JFET
|
||||||
G-S-D MOSFET
|
G-S-D MOSFET
|
||||||
|
GF1
|
||||||
Generate DIYLC Netlist (excl. Switches)
|
Generate DIYLC Netlist (excl. Switches)
|
||||||
Generate DIYLC Netlist (incl. Switches)
|
Generate DIYLC Netlist (incl. Switches)
|
||||||
Gray
|
Gray
|
||||||
|
|||||||
Reference in New Issue
Block a user