Package eas.math.geometry

Examples of eas.math.geometry.Polygon2D


    @Override
    public Vector2D getRealPosFromScreenPos(Vector2D screenPos) {
        Vector2D pos = new Vector2D(screenPos.x, screenPos.y);
        Rectangle2D box = env.getCurrentViewBox();
       
        Polygon2D pinkBorder = env.getPinkBorder();
       
        pos.sub(new Vector2D(
                pinkBorder.getBoundingBox().upperLeftCorner().x,
                pinkBorder.getBoundingBox().upperLeftCorner().y));
       
        pos.x = pos.x / env.globalScale();
        pos.y = pos.y / env.globalScale();
       
        pos.translate(box.upperLeftCorner());
View Full Code Here


  public static final double radius = 2;

  @Override
  public synchronized Polygon2D getAgentShape() {
    if (pacman == null) {
      pacman = new Polygon2D();

      for (double d = 0; d < Math.PI * 1.75; d += Math.PI * 2 / precision) {
        pacman.add(new Vector2D(Math.sin(d) * radius, Math.cos(d) * radius));
      }
      pacman.add(new Vector2D(0, 0));
View Full Code Here

     * @return Returns the eckPunkte.
     */
    @Override
    public Polygon2D getAgentShape() {
        if (pol == null) {
            pol = new Polygon2D();
            pol.add(new Vector2D(-this.ausd.x / 2, -this.ausd.y / 2));
            pol.add(new Vector2D(+this.ausd.x / 2, -this.ausd.y / 2));
            pol.add(new Vector2D(+this.ausd.x / 2, +this.ausd.y / 2));
            pol.add(new Vector2D(-this.ausd.x / 2, +this.ausd.y / 2));
        }
View Full Code Here

       
        return pol;
    }

    public Polygon2D getEckp() {
        Polygon2D pol;
       
        if (!this.eckPunkteAktuell) {
            this.berechneEckpunkte();
        }

        pol = new Polygon2D();
       
        for (Vector2D ecke : this.eckPunkte) {
            pol.add(ecke);
        }
       
        return pol;
    }
View Full Code Here

                this.umg.getFeld()[0].length - 100).erzeuge(
                        this.vAuts()[0], aktKnot);
        List<Object> zeichenListe = master.graph(darstellung);
        buffImgAut = Geometry2D.erzBuffImgAusObjekten(zeichenListe);
       
        Polygon2D rahmen = Geometry2D.rahmen(zeichenListe);
       
        BufferedImage zwisch = new BufferedImage(
                this.umg.getFeld()[0].length + 100,
                this.umg.getFeld()[0].length,
                BufferedImage.TYPE_INT_RGB);
       
        g = zwisch.createGraphics();
        g.setColor(Color.white);
        g.fillRect(0, 0, zwisch.getWidth(), zwisch.getHeight());
        g.drawImage(
                buffImgAut,
                0,
                (int) ((zwisch.getHeight()
                        - rahmen.getBoundingBox().getHeight()) / 2),
                null);
        g.setColor(Color.BLUE);

        // Sensoren.
        int i = 0;
View Full Code Here

    private Polygon2D shape;
   
    @Override
    public strictfp Polygon2D getAgentShape() {
        if (shape == null) {
            shape = new Polygon2D();
            shape.add(new Vector2D(0, 0));
            shape.add(new Vector2D(25, 0));
            shape.add(new Vector2D(25, 2));
            shape.add(new Vector2D(0, 2));
        }
View Full Code Here

        return Color.orange;
    }

    @Override
    public Polygon2D getAgentShape() {
        Polygon2D p = new Polygon2D();
        p.add(new Vector2D(-250, -width));
        p.add(new Vector2D(250, -width));
        p.add(new Vector2D(250, width));
        p.add(new Vector2D(-250, width));
        return p;
    }
View Full Code Here

   
    public Polygon2D transferPolyonToVisualizedView(final Polygon2D polygonInEnvironment) {
        if (polygonInEnvironment == null) {
            return null;
        } else {
            Polygon2D polygonInView = new Polygon2D();
           
            for (Vector2D v : polygonInEnvironment) {
                polygonInView.add(this.getPointInVisualization(v));
            }
               
            return polygonInView;
        }
    }
View Full Code Here

          env.setRandomPosition(randomReachedSheepAgent.id(), random);
        }
      }
    });

    this.shape = new Polygon2D();
    this.shape.add(new Vector2D(-.5, .5));
    this.shape.add(new Vector2D(0, 0));
    this.shape.add(new Vector2D(.5, .5));
    this.shape.add(new Vector2D(.5, -.5));
    this.shape.add(new Vector2D(-.5, -.5));
View Full Code Here

     * @return  Die Eckpunkte des Agenten.
     */
    @Override
    public synchronized Polygon2D getAgentShape() {
        if (pol == null) {
            pol = new Polygon2D();
            pol.add(new Vector2D(-1, -1));
            pol.add(new Vector2D(1, -1));
            pol.add(new Vector2D(1, 1));
            pol.add(new Vector2D(-1, 1));
        }
View Full Code Here

TOP

Related Classes of eas.math.geometry.Polygon2D

Copyright © 2018 www.massapicom. 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.