@author Peter Karich
| 31 | * @author Peter Karich |
| 32 | */ |
| 33 | public class DebugAStar extends AStar implements DebugAlgo { |
| 34 | private final GraphicsWrapper mg; |
| 35 | private Graphics2D g2; |
| 36 | private NodeAccess na; |
| 37 | |
| 38 | public DebugAStar(Graph graph, Weighting type, TraversalMode tMode, GraphicsWrapper mg) { |
| 39 | super(graph, type, tMode); |
| 40 | this.mg = mg; |
| 41 | na = graph.getNodeAccess(); |
| 42 | } |
| 43 | |
| 44 | @Override |
| 45 | public void setGraphics2D(Graphics2D g2) { |
| 46 | this.g2 = g2; |
| 47 | } |
| 48 | |
| 49 | @Override |
| 50 | public void updateBestPath(EdgeIteratorState es, SPTEntry bestEE, int currLoc) { |
| 51 | if (g2 != null) { |
| 52 | mg.plotEdge(g2, na.getLat(bestEE.parent.adjNode), na.getLon(bestEE.parent.adjNode), na.getLat(currLoc), na.getLon(currLoc), .8f); |
| 53 | } |
| 54 | super.updateBestPath(es, bestEE, currLoc); |
| 55 | } |
| 56 | } |
nothing calls this directly
no outgoing calls
no test coverage detected