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  boolean electrical
           
 int[] intCoords
           
protected  Layer.Function.Set onlyTheseLayers
           
protected  int pointCount
           
protected  boolean reasonable
           
 
Constructor Summary
AbstractShapeBuilder()
          Creates a new instance of AbstractShapeBuilder
 
Method Summary
abstract  void addDoublePoly(int numPoints, Poly.Type style, Layer layer)
           
abstract  void addIntBox(int[] coords, Layer layer)
           
abstract  void addIntLine(int[] coords, Poly.Type style, Layer layer)
           
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)
           
 CellBackup.Memoization getMemoization()
           
 Layer.Function.Set getOnlyTheseLayers()
           
 AbstractShapeBuilder.Shrinkage getShrinkage()
           
 TechPool getTechPool()
           
 void makeGridPoly(ImmutableArcInst a, long gridWidth, Poly.Type style, Layer layer)
          Method to fill in an AbstractShapeBuilder a polygon that describes this ImmutableArcInst in grid units.
 void pushBox(int minX, int minY, int maxX, int maxY, 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)
           
 void setElectrical(boolean b)
           
 void setOnlyTheseLayers(Layer.Function.Set onlyTheseLayers)
           
 void setReasonable(boolean b)
           
 void setup(Cell cell)
           
 void setup(CellBackup cellBackup)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

onlyTheseLayers

protected Layer.Function.Set onlyTheseLayers

reasonable

protected boolean reasonable

electrical

protected boolean electrical

doubleCoords

protected double[] doubleCoords

pointCount

protected int pointCount

intCoords

public int[] intCoords
Constructor Detail

AbstractShapeBuilder

public AbstractShapeBuilder()
Creates a new instance of AbstractShapeBuilder

Method Detail

getOnlyTheseLayers

public Layer.Function.Set getOnlyTheseLayers()

setOnlyTheseLayers

public void setOnlyTheseLayers(Layer.Function.Set onlyTheseLayers)

setReasonable

public void setReasonable(boolean b)

setElectrical

public void setElectrical(boolean b)

setup

public void setup(Cell cell)

setup

public void setup(CellBackup cellBackup)

getMemoization

public CellBackup.Memoization getMemoization()

getShrinkage

public AbstractShapeBuilder.Shrinkage getShrinkage()

getTechPool

public TechPool getTechPool()

genShapeOfArc

public void genShapeOfArc(ImmutableArcInst a)

makeGridPoly

public void makeGridPoly(ImmutableArcInst a,
                         long gridWidth,
                         Poly.Type style,
                         Layer layer)
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.

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)

pushBox

public void pushBox(int minX,
                    int minY,
                    int maxX,
                    int maxY,
                    Layer layer)

addDoublePoly

public abstract void addDoublePoly(int numPoints,
                                   Poly.Type style,
                                   Layer layer)

addIntLine

public abstract void addIntLine(int[] coords,
                                Poly.Type style,
                                Layer layer)

addIntBox

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