public abstract class Router
extends java.lang.Object
A Route is a List of RouteElements. See RouteElement for details of the elements.
Author: Gainsley
Modifier and Type | Class and Description |
---|---|
protected static class |
Router.ContactSize
ContactSize class to determine the arc sizes and contact size between two
objects to be connected by the wirer.
|
protected static class |
Router.CreateRouteJob
Job to create the route.
|
Modifier and Type | Field and Description |
---|---|
protected Tool |
tool
the tool that is making routes
|
protected boolean |
verbose
set to tell user short info on what was done
|
Constructor and Description |
---|
Router() |
Modifier and Type | Method and Description |
---|---|
void |
createRoute(Route route,
Cell cell)
Create the route within a Job.
|
static boolean |
createRouteNoJob(Route route,
Cell cell,
java.util.Map<ArcProto,java.lang.Integer> arcsCreatedMap,
java.util.Map<NodeProto,java.lang.Integer> nodesCreatedMap,
EditingPreferences ep)
Method to create the route.
|
static ArcProto |
getArcToUse(PortProto port1,
PortProto port2)
Determine which arc type to use to connect two ports
NOTE: for safety, will NOT return a Generic.tech.universal_arc,
Generic.tech.invisible_arc, or Generic.tech.unrouted_arc,
unless it is the currently selected arc.
|
static double |
getArcWidthToUse(ElectricObject obj,
ArcProto ap,
int arcAngle,
boolean ignoreAngle,
EditingPreferences ep)
Get arc width to use to connect to a PortInst.
|
static void |
reportRoutingResults(java.lang.String prefix,
java.util.Map<ArcProto,java.lang.Integer> arcsCreatedMap,
java.util.Map<NodeProto,java.lang.Integer> nodesCreatedMap,
boolean beep) |
void |
setTool(Tool tool)
Method to set the tool associated with this router
|
protected boolean verbose
protected Tool tool
public void createRoute(Route route, Cell cell)
route
- the route to createcell
- the cell in which to create the routepublic static boolean createRouteNoJob(Route route, Cell cell, java.util.Map<ArcProto,java.lang.Integer> arcsCreatedMap, java.util.Map<NodeProto,java.lang.Integer> nodesCreatedMap, EditingPreferences ep)
route
- the route to createcell
- the cell in which to create the routearcsCreatedMap
- a map of arcs to integers which is updated to indicate the number of each arc type created.nodesCreatedMap
- a map of nodes to integers which is updated to indicate the number of each node type created.ep
- EditingPreferences with default sizespublic static void reportRoutingResults(java.lang.String prefix, java.util.Map<ArcProto,java.lang.Integer> arcsCreatedMap, java.util.Map<NodeProto,java.lang.Integer> nodesCreatedMap, boolean beep)
public void setTool(Tool tool)
public static ArcProto getArcToUse(PortProto port1, PortProto port2)
port1
- one end point of arc (ignored if null)port2
- other end point of arc (ignored if null)public static double getArcWidthToUse(ElectricObject obj, ArcProto ap, int arcAngle, boolean ignoreAngle, EditingPreferences ep)
You may specify the port as null, in which case it just returns the arc's default width.
obj
- the object to connect to, either a PortInst or an ArcInst.ap
- the Arc prototype to connect with.arcAngle
- the angle of the arc that will be drawn (in tenth-degrees).ignoreAngle
- false: only arcs whose angles match arcAngle will have their
sizes used to determine the arc width. 180 degrees out of phase also matches in this case.
True: any arcs will have their sizes used to determine the return arc size.ep
- EditingPreferences with default sizes