com.sun.electric.technology
Class AbstractShapeBuilder

java.lang.Object
  extended by com.sun.electric.technology.AbstractShapeBuilder
Direct Known Subclasses:
BoundsBuilder, Poly.Builder

public abstract class AbstractShapeBuilder
extends java.lang.Object

A support class to build shapes of arcs and nodes.


Nested Class Summary
static class AbstractShapeBuilder.Shrinkage
           
 
Field Summary
protected  double[] doubleCoords
           
protected  int[] intCoords
           
protected  int pointCount
           
 
Constructor Summary
AbstractShapeBuilder()
          Creates a new instance of AbstractShapeBuilder
AbstractShapeBuilder(boolean rotateNodes)
           
 
Method Summary
abstract  void addDoublePoly(int numPoints, Poly.Type style, Layer layer, EGraphics graphicsOverride, PrimitivePort pp)
           
 void addDoubleTextPoly(int numPoints, Poly.Type style, Layer layer, PrimitivePort pp, java.lang.String message, TextDescriptor descriptor)
           
abstract  void addIntBox(int[] coords, Layer layer)
           
abstract  void addIntPoly(int numPoints, Poly.Type style, Layer layer, EGraphics graphicsOverride, PrimitivePort pp)
           
static java.awt.geom.Point2D computeExtension(int w2, double ix1, double iy1, int angle, short shrink)
          Computes extension vector of wire,
 boolean curvedArcGridOutline(ImmutableArcInst a, long gridWidth, long gridRadius)
          Method to fill polygon "poly" with the outline in grid units of the curved arc in this ImmutableArcInst whose width in grid units is "gridWidth".
 boolean genShapeEasy(ImmutableArcInst a)
          Generate shape of this ImmutableArcInst in easy case.
 void genShapeOfArc(ImmutableArcInst a)
           
 void genShapeOfNode(ImmutableNodeInst n)
           
 void genShapeOfNode(ImmutableNodeInst n, PrimitiveNode np, Technology.NodeLayer[] primLayers, EGraphics graphicsOverride)
          Returns the polygons that describe node "ni", given a set of NodeLayer objects to use.
 CellBackup getCellBackup()
           
 CellBackup.Memoization getMemoization()
           
 AbstractShapeBuilder.Shrinkage getShrinkage()
           
 TechPool getTechPool()
           
 boolean isElectrical()
           
 boolean isReasonable()
           
 void makeGridPoly(ImmutableArcInst a, long gridWidth, Poly.Type style, Layer layer, EGraphics graphicsOverride)
          Method to fill in an AbstractShapeBuilder a polygon that describes this ImmutableArcInst in grid units.
 void pushIntBox(Layer layer)
           
 void pushIntLine(Poly.Type style, Layer layer)
           
 void pushPoint(double gridX, double gridY)
           
 void pushPoint(EPoint p)
           
 void pushPoint(EPoint p, double gridX, double gridY)
           
 void pushPoly(Poly.Type style, Layer layer, EGraphics graphicsOverride, PrimitivePort pp)
           
 void pushTextPoly(Poly.Type style, Layer layer, PrimitivePort pp, java.lang.String message, TextDescriptor descriptor)
           
 void setup(Cell cell)
           
 void setup(CellBackup cellBackup, Orientation orient, boolean electrical, boolean wipePins, boolean reasonable, Layer.Function.Set onlyTheseLayers)
           
 boolean skipLayer(Layer layer)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

doubleCoords

protected double[] doubleCoords

pointCount

protected int pointCount

intCoords

protected int[] intCoords
Constructor Detail

AbstractShapeBuilder

public AbstractShapeBuilder()
Creates a new instance of AbstractShapeBuilder


AbstractShapeBuilder

public AbstractShapeBuilder(boolean rotateNodes)
Method Detail

setup

public void setup(Cell cell)

setup

public void setup(CellBackup cellBackup,
                  Orientation orient,
                  boolean electrical,
                  boolean wipePins,
                  boolean reasonable,
                  Layer.Function.Set onlyTheseLayers)

isElectrical

public boolean isElectrical()

isReasonable

public boolean isReasonable()

skipLayer

public boolean skipLayer(Layer layer)

getMemoization

public CellBackup.Memoization getMemoization()

getCellBackup

public CellBackup getCellBackup()

getShrinkage

public AbstractShapeBuilder.Shrinkage getShrinkage()

getTechPool

public TechPool getTechPool()

genShapeOfArc

public void genShapeOfArc(ImmutableArcInst a)

genShapeOfNode

public void genShapeOfNode(ImmutableNodeInst n)

genShapeOfNode

public void genShapeOfNode(ImmutableNodeInst n,
                           PrimitiveNode np,
                           Technology.NodeLayer[] primLayers,
                           EGraphics graphicsOverride)
Returns the polygons that describe node "ni", given a set of NodeLayer objects to use. This method is called by the specific Technology overrides of getShapeOfNode().

Parameters:
n - the ImmutableNodeInst that is being described.
np - PrimitiveNode proto of give ImmutableNodeInst in TechPool of Memoization
primLayers - an array of NodeLayer objects to convert to Poly objects.
graphicsOverride - the graphics override to use for all generated polygons (if not null). The prototype of this NodeInst must be a PrimitiveNode and not a Cell.

makeGridPoly

public void makeGridPoly(ImmutableArcInst a,
                         long gridWidth,
                         Poly.Type style,
                         Layer layer,
                         EGraphics graphicsOverride)
Method to fill in an AbstractShapeBuilder a polygon that describes this ImmutableArcInst in grid units. The polygon is described by its width, and style.

Parameters:
a - the arc information.
gridWidth - the gridWidth of the Poly.
style - the style of the Poly.
layer - layer of the Poly
graphicsOverride - graphics override of the Poly

computeExtension

public static java.awt.geom.Point2D computeExtension(int w2,
                                                     double ix1,
                                                     double iy1,
                                                     int angle,
                                                     short shrink)
Computes extension vector of wire,


curvedArcGridOutline

public boolean curvedArcGridOutline(ImmutableArcInst a,
                                    long gridWidth,
                                    long gridRadius)
Method to fill polygon "poly" with the outline in grid units of the curved arc in this ImmutableArcInst whose width in grid units is "gridWidth". If there is no curvature information in the arc, the routine returns false, otherwise it returns the curved polygon.

Parameters:
a - the arc information.
gridWidth - width in grid units.
gridRadius - radius in grid units.
Returns:
true if point were filled to the buuilder

genShapeEasy

public boolean genShapeEasy(ImmutableArcInst a)
Generate shape of this ImmutableArcInst in easy case.

Parameters:
a - the arc information.
Returns:
true if shape was generated.

pushPoint

public void pushPoint(EPoint p,
                      double gridX,
                      double gridY)

pushPoint

public void pushPoint(double gridX,
                      double gridY)

pushPoint

public void pushPoint(EPoint p)

pushPoly

public void pushPoly(Poly.Type style,
                     Layer layer,
                     EGraphics graphicsOverride,
                     PrimitivePort pp)

pushTextPoly

public void pushTextPoly(Poly.Type style,
                         Layer layer,
                         PrimitivePort pp,
                         java.lang.String message,
                         TextDescriptor descriptor)

pushIntBox

public void pushIntBox(Layer layer)

pushIntLine

public void pushIntLine(Poly.Type style,
                        Layer layer)

addDoublePoly

public abstract void addDoublePoly(int numPoints,
                                   Poly.Type style,
                                   Layer layer,
                                   EGraphics graphicsOverride,
                                   PrimitivePort pp)

addDoubleTextPoly

public void addDoubleTextPoly(int numPoints,
                              Poly.Type style,
                              Layer layer,
                              PrimitivePort pp,
                              java.lang.String message,
                              TextDescriptor descriptor)

addIntPoly

public abstract void addIntPoly(int numPoints,
                                Poly.Type style,
                                Layer layer,
                                EGraphics graphicsOverride,
                                PrimitivePort pp)

addIntBox

public abstract void addIntBox(int[] coords,
                               Layer layer)