public class PathMerger
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private edu.umd.cs.piccolo.PNode |
borderRoot |
private edu.umd.cs.piccolo.PNode |
circlesRoot |
private edu.umd.cs.piccolo.PNode |
connsRoot |
private boolean |
debug |
private java.util.List<edu.umd.cs.piccolo.PNode> |
drawedStuff |
private MapPNode |
map |
private edu.umd.cs.piccolo.PNode |
root |
Constructor and Description |
---|
PathMerger(MapPNode map) |
PathMerger(MapPNode map,
boolean debug) |
Modifier and Type | Method and Description |
---|---|
void |
concatPaths(edu.umd.cs.piccolo.PNode[] paths) |
private java.util.List<GeneralUnitPNode> |
convertPathToUnits(edu.umd.cs.piccolo.PNode node) |
private edu.umd.cs.piccolo.nodes.PPath |
createCircle(java.awt.geom.Point2D center,
float radius)
Create a circle
PNode |
void |
deleteAllDrawnStuff() |
private double |
dist(double[] d1,
double[] d2) |
private double |
distSq(double[] d1,
double[] d2) |
private void |
findBorder(edu.umd.cs.piccolox.nodes.PLine l1,
edu.umd.cs.piccolox.nodes.PLine l2,
java.awt.Color c,
edu.umd.cs.piccolox.nodes.PLine border)
Find the border between two lines.
|
private <A extends edu.umd.cs.piccolo.PNode> |
findClosest(A unit,
java.util.List<A> candidates) |
private java.awt.geom.Point2D |
findClosest(java.awt.geom.Point2D point,
java.util.List<java.awt.geom.Point2D> candidates) |
private java.awt.geom.Point2D |
findClosest(java.awt.geom.Point2D point,
edu.umd.cs.piccolox.nodes.PLine candidates) |
edu.umd.cs.piccolox.nodes.PLine |
getBorderLine() |
private double[] |
getMiddlePoint(double[] d1,
double[] d2) |
private java.awt.geom.Point2D |
getMiddlePoint(java.awt.geom.Point2D p1,
java.awt.geom.Point2D p2)
Get the middle point between the Points.
|
void |
highlightIntersectingUnits(edu.umd.cs.piccolo.PNode node,
boolean target) |
void |
lineBasedMerge(edu.umd.cs.piccolo.PNode[] paths) |
void |
newIntermediateInputSpaceMerge(edu.umd.cs.piccolo.PNode[] paths) |
void |
newIntermediateMapMerge(edu.umd.cs.piccolo.PNode[] paths) |
private java.lang.String |
printNode(edu.umd.cs.piccolo.PNode node) |
void |
setDebug(boolean debug) |
void |
unitBasedMerge(edu.umd.cs.piccolo.PNode[] paths) |
private final MapPNode map
private edu.umd.cs.piccolo.PNode root
private edu.umd.cs.piccolo.PNode borderRoot
private edu.umd.cs.piccolo.PNode connsRoot
private edu.umd.cs.piccolo.PNode circlesRoot
private java.util.List<edu.umd.cs.piccolo.PNode> drawedStuff
private boolean debug
public PathMerger(MapPNode map)
public PathMerger(MapPNode map, boolean debug)
public void setDebug(boolean debug)
public void unitBasedMerge(edu.umd.cs.piccolo.PNode[] paths)
public void deleteAllDrawnStuff()
public void newIntermediateMapMerge(edu.umd.cs.piccolo.PNode[] paths)
public void newIntermediateInputSpaceMerge(edu.umd.cs.piccolo.PNode[] paths)
private double dist(double[] d1, double[] d2)
private double distSq(double[] d1, double[] d2)
private double[] getMiddlePoint(double[] d1, double[] d2)
public void lineBasedMerge(edu.umd.cs.piccolo.PNode[] paths)
private void findBorder(edu.umd.cs.piccolox.nodes.PLine l1, edu.umd.cs.piccolox.nodes.PLine l2, java.awt.Color c, edu.umd.cs.piccolox.nodes.PLine border)
l1
- first Linel2
- second Linec
- Color
of the borderborder
- where to add the borderprivate edu.umd.cs.piccolo.nodes.PPath createCircle(java.awt.geom.Point2D center, float radius)
PNode
center
- the center of the circleradius
- the radius (size) of the circlePNode
private java.awt.geom.Point2D getMiddlePoint(java.awt.geom.Point2D p1, java.awt.geom.Point2D p2)
p1
- first Pointp2
- second Pointprivate java.awt.geom.Point2D findClosest(java.awt.geom.Point2D point, edu.umd.cs.piccolox.nodes.PLine candidates)
private java.awt.geom.Point2D findClosest(java.awt.geom.Point2D point, java.util.List<java.awt.geom.Point2D> candidates)
private <A extends edu.umd.cs.piccolo.PNode> A findClosest(A unit, java.util.List<A> candidates)
private java.util.List<GeneralUnitPNode> convertPathToUnits(edu.umd.cs.piccolo.PNode node)
private java.lang.String printNode(edu.umd.cs.piccolo.PNode node)
public void highlightIntersectingUnits(edu.umd.cs.piccolo.PNode node, boolean target)
public void concatPaths(edu.umd.cs.piccolo.PNode[] paths)
public edu.umd.cs.piccolox.nodes.PLine getBorderLine()