474
* Method to return a list of Polys that describe a given NodeInst.
475
* This method overrides the general one in the Technology object
476
* because of the unusual primitives in this Technology.
477
* @param m information about including cell which is necessary for computing
478
* @param n the ImmutableNodeInst that is being described.
479
* @param electrical true to get the "electrical" layers.
480
* This makes no sense for Artwork primitives.
481
* @param reasonable true to get only a minimal set of contact cuts in large contacts.
482
* This makes no sense for Artwork primitives.
483
* @param primLayers an array of NodeLayer objects to convert to Poly objects.
484
* @return an array of Poly objects.
487
protected Poly [] getShapeOfNode(CellBackup.Memoization m, ImmutableNodeInst n, boolean electrical, boolean reasonable, Technology.NodeLayer [] primLayers)
489
PrimitiveNode np = m.getTechPool().getPrimitiveNode((PrimitiveNodeId)n.protoId);
490
// if node is erased, remove layers
491
if ((ALWAYS_SKIP_WIPED_PINS || !electrical) && m.isWiped(n))
494
EGraphics graphicsOverride = makeGraphics(n);
496
if (np == circleNode || np == thickCircleNode)
498
double [] angles = n.getArcDegrees();
499
if (n.size.getGridX() != n.size.getGridY())
502
Point2D [] pointList = fillEllipse(n.anchor, n.size.getLambdaX(), n.size.getLambdaY(),
503
angles[0], angles[1]);
504
Poly [] polys = new Poly[1];
505
polys[0] = new Poly(pointList);
506
if (np == circleNode) polys[0].setStyle(Poly.Type.OPENED); else
507
polys[0].setStyle(Poly.Type.OPENEDT3);
508
// Technology.NodeLayer primLayer = primLayers[0];
509
polys[0].setLayer(defaultLayer);
510
polys[0].setGraphicsOverride(graphicsOverride);
514
// if there is arc information here, make it an arc of a circle
515
if (angles[0] != 0.0 || angles[1] != 0.0)
517
// fill an arc of a circle here
518
Poly [] polys = new Poly[1];
519
Point2D [] pointList = new Point2D.Double[3];
520
double cX = n.anchor.getLambdaX();
521
double cY = n.anchor.getLambdaY();
522
double dist = n.size.getLambdaX() / 2;
523
pointList[0] = new Point2D.Double(cX, cY);
524
pointList[1] = new Point2D.Double(cX + Math.cos(angles[0]+angles[1])*dist, cY + Math.sin(angles[0]+angles[1])*dist);
525
pointList[2] = new Point2D.Double(cX + Math.cos(angles[0])*dist, cY + Math.sin(angles[0])*dist);
526
polys[0] = new Poly(pointList);
527
if (np == circleNode) polys[0].setStyle(Poly.Type.CIRCLEARC); else
528
polys[0].setStyle(Poly.Type.THICKCIRCLEARC);
529
// Technology.NodeLayer primLayer = primLayers[0];
530
polys[0].setLayer(defaultLayer);
531
polys[0].setGraphicsOverride(graphicsOverride);
534
} else if (np == splineNode)
536
Point2D [] tracePoints = n.getTrace();
537
if (tracePoints != null)
539
double cX = n.anchor.getLambdaX();
540
double cY = n.anchor.getLambdaY();
541
Point2D [] pointList = fillSpline(cX, cY, tracePoints);
542
Poly [] polys = new Poly[1];
543
polys[0] = new Poly(pointList);
544
polys[0].setStyle(Poly.Type.OPENED);
545
// Technology.NodeLayer primLayer = primLayers[0];
546
polys[0].setLayer(defaultLayer);
547
polys[0].setGraphicsOverride(graphicsOverride);
551
return computeShapeOfNode(m, n, electrical, reasonable, primLayers, graphicsOverride);
555
474
* Puts into shape builder s the polygons that describe node "n", given a set of
556
475
* NodeLayer objects to use.
557
476
* This method is overridden by specific Technologys.
613
* Returns a polygon that describes a particular port on a NodeInst.
614
* @param ni the NodeInst that has the port of interest.
532
* Puts into shape builder s the polygons that describe node "n", given a set of
533
* NodeLayer objects to use.
534
* This method is overridden by specific Technologys.
535
* @param b shape builder where to put polygons
536
* @param n the ImmutableNodeInst that is being described.
537
* @param pn proto of the ImmutableNodeInst in this Technology
538
* @param selectPt if not null, it requests a new location on the port,
539
* away from existing arcs, and close to this point.
540
* This is useful for "area" ports such as the left side of AND and OR gates.
615
541
* The prototype of this NodeInst must be a PrimitiveNode and not a Cell.
616
* @param pp the PrimitivePort on that NodeInst that is being described.
617
* @return a Poly object that describes this PrimitivePort graphically.
619
public Poly getShapeOfPort(NodeInst ni, PrimitivePort pp, Point2D selectPt)
621
PrimitiveNode np = (PrimitiveNode)ni.getProto();
622
if (np == pinNode || np == arrowNode || np == circleNode || np == thickCircleNode || np == filledCircleNode)
624
return super.getShapeOfPort(ni, pp, selectPt);
626
Poly [] polys = getShapeOfNode(ni);
544
protected void genShapeOfPort(AbstractShapeBuilder b, ImmutableNodeInst n, PrimitiveNode pn, PrimitivePort pp, Point2D selectPt) {
545
if (pn == pinNode || pn == arrowNode || pn == circleNode || pn == thickCircleNode || pn == filledCircleNode)
547
b.genShapeOfPort(n, pn, pp);
550
if (pn == splineNode)
552
EPoint [] tracePoints = n.getTrace();
553
if (tracePoints != null)
555
Point2D [] pointList = fillSpline(0, 0, tracePoints);
556
for (Point2D p: pointList)
557
b.pushPoint(p.getX()*DBMath.GRID, p.getY()*DBMath.GRID);
558
b.pushPoly(Poly.Type.OPENED, null, null, null);
562
b.genShapeOfNode(n, pn, pn.getNodeLayers(), null);
631
566
* Fill the polygons that describe arc "a".