com.sun.electric.tool.routing
Class Router

java.lang.Object
  extended by com.sun.electric.tool.routing.Router
Direct Known Subclasses:
InteractiveRouter

public abstract class Router
extends java.lang.Object

Parent Class for all Routers. I really have no idea what this should look like because I've never written a real router, but I've started it off with a few basics.

A Route is a List of RouteElements. See RouteElement for details of the elements.

User: gainsley Date: Mar 1, 2004 Time: 2:48:46 PM


Nested Class Summary
protected static class Router.ContactSize
          ContactSize class to deterime 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.
 
Field Summary
protected  Tool tool
          the tool that is making routes
protected  boolean verbose
          set to tell user short info on what was done
 
Constructor Summary
Router()
           
 
Method Summary
 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)
          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)
          Get arc width to use to connect to PortInst pi.
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

verbose

protected boolean verbose
set to tell user short info on what was done


tool

protected Tool tool
the tool that is making routes

Constructor Detail

Router

public Router()
Method Detail

createRoute

public void createRoute(Route route,
                        Cell cell)
Create the route within a Job.

Parameters:
route - the route to create
cell - the cell in which to create the route

createRouteNoJob

public static boolean createRouteNoJob(Route route,
                                       Cell cell,
                                       java.util.Map<ArcProto,java.lang.Integer> arcsCreatedMap,
                                       java.util.Map<NodeProto,java.lang.Integer> nodesCreatedMap)
Method to create the route. Does not wrap Job around it (useful if already being called from a Job). This still must be called from within a Job context, however.

Parameters:
route - the route to create
cell - the cell in which to create the route
arcsCreatedMap - 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.
Returns:
true on error.

reportRoutingResults

public 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)

setTool

public void setTool(Tool tool)
Method to set the tool associated with this router


getArcToUse

public 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. Will instead return null if no other arc can be found to work.

Parameters:
port1 - one end point of arc (ignored if null)
port2 - other end point of arc (ignored if null)
Returns:
the arc type (an ArcProto). null if none or error.

getArcWidthToUse

public static double getArcWidthToUse(ElectricObject obj,
                                      ArcProto ap,
                                      int arcAngle,
                                      boolean ignoreAngle)
Get arc width to use to connect to PortInst pi. Arc type is ap. Uses the largest width of arc type ap already connected to pi, or the default width of ap if none found.

You may specify pi as null, in which case it just returns ap.getDefaultLambdaFullWidth().

If ignoreAngle is 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.

If ignoreAngle is true, any arcs will have their sizes used to determine the return arc size.

Parameters:
obj - the object to connect to, either a PortInst or an ArcInst
ap - the Arc type to connect with
arcAngle - of the arc that will be drawn (in tenth-degrees)
ignoreAngle - to ignore the angle of arc to be drawn and existing arcs
Returns:
the width to use to connect