Examples of toPol2D()


Examples of eas.math.geometry.LineSegment2D.toPol2D()

        float epsilon = (float) 0.5;
       
        Rectangle2D r = new Rectangle2D(new Vector2D(0 - epsilon, 0 - epsilon), new Vector2D(width - epsilon, height - epsilon));
        LineSegment2D l = new LineSegment2D(new Vector2D(0 - epsilon, heightGO + epsilon), new Vector2D(this.getWidth() - epsilon, heightGO + epsilon));
        g.setColor(Color.red);
        g.drawPolygon(this.getPolygonInVisualization(l.toPol2D()).toPol());
        g.setStroke(new BasicStroke(5));
        g.setColor(Color.orange);
        g.drawPolygon(this.getPolygonInVisualization(r.toPol2D()).toPol());
       
        g.setColor(Color.black);
View Full Code Here

Examples of eas.math.geometry.LineSegment2D.toPol2D()

        }
       
        LineSegment2D l2 = new LineSegment2D(
                new Vector2D(minX - epsilon, this.getGridHeight() - epsilon),
                new Vector2D(maxX + epsilon, this.getGridHeight() - epsilon));
        g.drawPolygon(this.getPolygonInVisualization(l2.toPol2D()).toPol());
       
        // Show text.
        if (this.showText != null) {
            this.showCyclesText = 20 + this.showText.length() * 2;
            this.showNewText = this.showText;
View Full Code Here

Examples of eas.math.geometry.Rectangle2D.toPol2D()

        LineSegment2D l = new LineSegment2D(new Vector2D(0 - epsilon, heightGO + epsilon), new Vector2D(this.getWidth() - epsilon, heightGO + epsilon));
        g.setColor(Color.red);
        g.drawPolygon(this.getPolygonInVisualization(l.toPol2D()).toPol());
        g.setStroke(new BasicStroke(5));
        g.setColor(Color.orange);
        g.drawPolygon(this.getPolygonInVisualization(r.toPol2D()).toPol());
       
        g.setColor(Color.black);
        g.setStroke(new BasicStroke(8));
       
        float maxX = Float.NEGATIVE_INFINITY;
View Full Code Here

Examples of eas.math.geometry.Rectangle2D.toPol2D()

                                    - width / 2,
                                    this.getAgentPosition(a.id()).y - width / 2),
                            new Vector2D(this.getAgentPosition(a.id()).x
                                    + width / 2,
                                    this.getAgentPosition(a.id()).y + width / 2));
                    pol = rect.toPol2D();
                    pol = this.getPolygonInVisualization(pol);
                    g.drawPolygon(pol.toPol());
                }
            }
        }
View Full Code Here

Examples of eas.math.geometry.Rectangle2D.toPol2D()

   
    public Polygon2D getPinkBorder() {
        double globalScale = this.globalScale();
        Rectangle2D visibleBox = this.getCurrentViewBox();

        Polygon2D b = visibleBox.toPol2D();
        b.scale(Vector2D.NULL_VECTOR, new Vector2D(globalScale, globalScale));
        Vector2D midTranslation = new Vector2D(screenWidth / 2, screenHeight / 2);
        midTranslation.sub(b.centerPoint());
        Polygon2D bound = visibleBox.toPol2D();
        bound.scale(Vector2D.NULL_VECTOR, new Vector2D(globalScale, globalScale));
View Full Code Here

Examples of eas.math.geometry.Rectangle2D.toPol2D()

        Polygon2D b = visibleBox.toPol2D();
        b.scale(Vector2D.NULL_VECTOR, new Vector2D(globalScale, globalScale));
        Vector2D midTranslation = new Vector2D(screenWidth / 2, screenHeight / 2);
        midTranslation.sub(b.centerPoint());
        Polygon2D bound = visibleBox.toPol2D();
        bound.scale(Vector2D.NULL_VECTOR, new Vector2D(globalScale, globalScale));
        bound.translate(midTranslation);
        return bound;
    }
   
View Full Code Here

Examples of eas.math.geometry.Rectangle2D.toPol2D()

       
        g.setBackground(this.backgroundColor);
        g.clearRect(0, 0, this.field.getWidth(), this.field.getHeight());

        double globalScale = this.globalScale();
        Polygon2D b = visibleBox.toPol2D();
        b.scale(Vector2D.NULL_VECTOR, new Vector2D(globalScale, globalScale));
        Vector2D midTranslation = new Vector2D(screenWidth / 2, screenHeight / 2);
        midTranslation.sub(b.centerPoint());
        Rectangle2D border = new Rectangle2D(
                new Vector2D(screenLeft, screenUp),
View Full Code Here

Examples of eas.math.geometry.Rectangle2D.toPol2D()

        if (showTiles) {
        for (int i = 0; i < this.tileNumHorizontally; i++) {
                for (int j = 0; j < this.tileNumVertically; j++) {
                    Rectangle2D r = this.getTileRectangle(new Vector2D(i, j));
                    Polygon2D polInVis = super.getPolygonInVisualization(r.toPol2D());
                    Vector2D pos = polInVis.centerPoint();
                    g.setColor(Color.orange);
                    g.drawPolygon(polInVis.toPol());
//                    g.drawString(i + " / " + j, (float) pos.x, (float) pos.y);
                    g.drawString("" + this.getAgentsTouchingTile(new Vector2D(i, j)).size(), (float) pos.x, (float) pos.y);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.