~ubuntu-branches/ubuntu/oneiric/electric/oneiric

« back to all changes in this revision

Viewing changes to com/sun/electric/technology/technologies/Artwork.java

  • Committer: Bazaar Package Importer
  • Author(s): Onkar Shinde
  • Date: 2010-01-09 16:26:04 UTC
  • mfrom: (1.1.4 upstream) (3.1.6 sid)
  • Revision ID: james.westby@ubuntu.com-20100109162604-1ypvmy8ijmlc6oq7
Tags: 8.10-1
* New upstream version.
* debian/control
  - Add libjava3d-java and quilt build dependencies.
  - Update standards version to 3.8.3.
  - Add libjava3d-java as recommends to binary package.
* debian/rules
  - Use quilt patch system instead of simple patchsys.
  - Add java3d related jar files to DEB_JARS.
* debian/patches/*
  - Update as per current upstream source. Convert to quilt.
* debian/ant.properties
  - Do not disable 3D plugin anymore.
  - Use new property to disable compilation of OS X related classes.
* debian/wrappers/electric
  - Add java3d related jar files to runtime classpath.
* debian/README.source
  - Change text to the appropriate one for quilt.

Show diffs side-by-side

added added

removed removed

Lines of Context:
471
471
        }
472
472
 
473
473
        /**
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.
485
 
         */
486
 
        @Override
487
 
        protected Poly [] getShapeOfNode(CellBackup.Memoization m, ImmutableNodeInst n, boolean electrical, boolean reasonable, Technology.NodeLayer [] primLayers)
488
 
        {
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))
492
 
            return new Poly[0];
493
 
 
494
 
        EGraphics graphicsOverride = makeGraphics(n);
495
 
 
496
 
                if (np == circleNode || np == thickCircleNode)
497
 
                {
498
 
                        double [] angles = n.getArcDegrees();
499
 
                        if (n.size.getGridX() != n.size.getGridY())
500
 
                        {
501
 
                                // handle ellipses
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);
511
 
                                return polys;
512
 
                        }
513
 
 
514
 
                        // if there is arc information here, make it an arc of a circle
515
 
                        if (angles[0] != 0.0 || angles[1] != 0.0)
516
 
                        {
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);
532
 
                                return polys;
533
 
                        }
534
 
                } else if (np == splineNode)
535
 
                {
536
 
                        Point2D [] tracePoints = n.getTrace();
537
 
                        if (tracePoints != null)
538
 
                        {
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);
548
 
                                return polys;
549
 
                        }
550
 
                }
551
 
                return computeShapeOfNode(m, n, electrical, reasonable, primLayers, graphicsOverride);
552
 
        }
553
 
 
554
 
        /**
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.
610
529
    }
611
530
 
612
531
        /**
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.
618
542
         */
619
 
        public Poly getShapeOfPort(NodeInst ni, PrimitivePort pp, Point2D selectPt)
620
 
        {
621
 
                PrimitiveNode np = (PrimitiveNode)ni.getProto();
622
 
                if (np == pinNode || np == arrowNode || np == circleNode || np == thickCircleNode || np == filledCircleNode)
623
 
                {
624
 
                        return super.getShapeOfPort(ni, pp, selectPt);
625
 
                }
626
 
                Poly [] polys = getShapeOfNode(ni);
627
 
                return polys[0];
628
 
        }
 
543
    @Override
 
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)
 
546
                {
 
547
                        b.genShapeOfPort(n, pn, pp);
 
548
            return;
 
549
        }
 
550
                if (pn == splineNode)
 
551
                {
 
552
                        EPoint [] tracePoints = n.getTrace();
 
553
                        if (tracePoints != null)
 
554
                        {
 
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);
 
559
                return;
 
560
                        }
 
561
        }
 
562
        b.genShapeOfNode(n, pn, pn.getNodeLayers(), null);
 
563
    }
629
564
 
630
565
        /**
631
566
         * Fill the polygons that describe arc "a".