Examples of Polygon2D


Examples of eas.math.geometry.Polygon2D

       
        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

Examples of eas.math.geometry.Polygon2D

                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

Examples of eas.math.geometry.Polygon2D

    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

Examples of eas.math.geometry.Polygon2D

        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

Examples of eas.math.geometry.Polygon2D

   
    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

Examples of eas.math.geometry.Polygon2D

          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

Examples of eas.math.geometry.Polygon2D

     * @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

Examples of eas.math.geometry.Polygon2D

    public Polygon2D getAgentShape() {
        if (pacman == null) {
            final double radius = 0.5;

            final double precision = 7;
            pacman = new Polygon2D();
            final double beg = -1 * Math.PI / 8;
           
            for (double d = beg; d < Math.PI * 2.1 + beg; d += Math.PI * 2 / precision) {
                pacman.add(new Vector2D(Math.sin(d) * radius, Math.cos(d) * radius));
            }
View Full Code Here

Examples of eas.math.geometry.Polygon2D

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

Examples of eas.math.geometry.Polygon2D

    @Override
    public Polygon2D getAgentShape() {
        if (circle == null) {
            final double precision = 60;
            final double radius = 1;
            circle = new Polygon2D();
           
            for (double d = 0; d < Math.PI * 2; d += Math.PI * 2 / precision) {
                circle.add(new Vector2D(Math.sin(d) * radius, Math.cos(d) * radius));
            }
        }
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.