Package fmg.fmg8.endlAutomat

Examples of fmg.fmg8.endlAutomat.EndlicherAutomat


     *                werden soll.
     * @param x       X-Koordinate.
     * @param y       Y-Koordinate.
     */
    public void neueKoord(final Knoten knoten, final int x, final int y) {
        Vektor2D koord;

        if (this.gesetzteKn.containsKey(knoten.holeName())) {
            koord = this.gesetzteKn.get(knoten.holeName());
            koord.x = x;
            koord.y = y;
        } else {
            this.gesetzteKn.put(knoten.holeName(), new Vektor2D(x, y));
        }
    }
View Full Code Here


                    this.drehen.set(i, !this.drehen.get(i));
                    this.winkel.set(i, this.random.nextDouble() * 0.5);
                }
            }
            if (this.versch.get(i)) {
                Vektor2D vSchiebg = umg.getDynVersch()[this.waende.get(i)];
                vSchiebg.add(new Vektor2D(
                        this.xRicht.get(i),
                        this.yRicht.get(i)));
               
                if (null != umg.verschWand(
                        this.waende.get(i),
                        vSchiebg)) {
                    this.versch.set(i, !this.versch.get(i));
                    this.xRicht.set(i, this.random.nextDouble() * 0.5);
                    this.yRicht.set(i, this.random.nextDouble() * 0.5);
                }
            } else {
                Vektor2D vSchiebg = umg.getDynVersch()[this.waende.get(i)];
                vSchiebg.add(new Vektor2D(
                        -this.xRicht.get(i),
                        -this.yRicht.get(i)));
               
                if (null != umg.verschWand(
                        this.waende.get(i),
View Full Code Here

            this.versch2--;
        }   

        if (null != umg.verschWand(
                wandNum1,
                new Vektor2D(0, this.versch1 * 2))) {
            this.b1 = !this.b1;
        }

        if (null != umg.verschWand(
                wandNum2,
                new Vektor2D(0, this.versch2 * 2))) {
            this.b2 = !this.b2;
        }
    }
View Full Code Here

     */
    public Vektor2D schneidet(final Strecke2D s1) {
        Strecke2D s2
            = new Strecke2D(this.get(this.nPoints() - 1), this.get(0));
        boolean flip = false;
        Vektor2D schnitt;
       
        for (int i = 1; i <= this.nPoints(); i++) {
            schnitt = s1.schnPkt(s2);
           
            if (schnitt != null) {
View Full Code Here

    private void createBoundingBox() {
        if (this.nPoints() == 0) {
            return;
        }
       
        Vektor2D punkt = this.get(0);
       
        this.boundingBox = new Rechteck2D(punkt, punkt);
       
        for (int i = 1; i < this.nPoints(); i++) {
            this.erweitereBoundingBox(this.get(i));
View Full Code Here

     *          nicht gesetzt werden konnte, wird <code>null</code>
     *          zur�ckgegeben.
     */
    @Override
    public Vektor2D set(final int index, final Vektor2D element) {
        Vektor2D alt = this.get(index);
       
        this.remove(index);
        this.add(index, element);
       
        if (this.garantiereEinfach) {
View Full Code Here

     * @return  Polygon.
     */
    public Polygon toPol(final double skalierung, final Vektor2D versch) {
        Polygon pol = new Polygon();
        Iterator<Vektor2D> it = this.iterator();
        Vektor2D punkt;
       
        while (it.hasNext()) {
            punkt = it.next();
            pol.addPoint((int) (punkt.x * skalierung + versch.x),
                         (int) (punkt.y * skalierung + versch.y));
View Full Code Here

     */
    public void normalisiere2() {
        Polygon2D normArr = new Polygon2D(this.nPoints());
        ArrayList<Double> abstaende = new ArrayList<Double>(this.nPoints());
        Iterator<Vektor2D> it = this.iterator();
        Vektor2D letztV;
        Vektor2D aktV = new Vektor2D(Vektor2D.NULL_VEKTOR);
        double aktAbst;
        double letztAbst;
        Vektor2D aktRicht;
        double durchAbst;
        int i = 0;

        if (this.nPoints() <= 2) {
            return;
        }
       
        letztV = this.get(0);
        letztAbst = 0;
        while (it.hasNext()) {
            aktV = it.next();
           
            aktAbst = aktV.distanz(letztV) + letztAbst;
            abstaende.add(aktAbst);
           
            letztAbst = aktAbst;
            letztV = aktV;
        }

        durchAbst = abstaende.get(abstaende.size() - 1)
                    / (abstaende.size() - 1);
       
        aktV = new Vektor2D(this.get(0));
        normArr.add(aktV);
        aktAbst = 0;
        while (i < this.nPoints()) {
            if (i + 1 < this.nPoints()) {
                aktRicht = new Vektor2D(this.get(i + 1));
                aktRicht.sub(this.get(i));
               
                if (this.get(i).distanz(this.get(i + 1)) >= durchAbst) {
                    aktRicht.laengeFestlegen(durchAbst);
                   
                    while (aktAbst < abstaende.get(i + 1)) {
                        aktV = new Vektor2D(aktV);
                        aktV.add(aktRicht);
                        normArr.add(aktV);
                        aktAbst += durchAbst;
                    }
                } else {
                    double zwischAbst = 0;
                    double aktDist;
                   
                    while (i + 1 < nPoints()) {
                        aktDist = this.get(i).distanz(this.get(i + 1));
                       
                        if (zwischAbst + aktDist
                                < durchAbst) {
                            zwischAbst += aktDist;
                            i++;
                        } else {
                            aktRicht = new Vektor2D(this.get(i + 1));
                            aktRicht.sub(this.get(i));
                            aktRicht.laengeFestlegen(durchAbst - zwischAbst);
                            aktV = new Vektor2D(this.get(i));
                            aktV.add(aktRicht);
                            normArr.add(aktV);
                            aktAbst += durchAbst;
                            break;
                        }
View Full Code Here

     */
    public Polygon2D normalisiere() {
        Polygon2D normArr = new Polygon2D(this.nPoints());
        ArrayList<Double> abstaende = new ArrayList<Double>(this.nPoints());
        Iterator<Vektor2D> it = this.iterator();
        Vektor2D letztV;
        Vektor2D aktV = new Vektor2D(Vektor2D.NULL_VEKTOR);
        double aktAbst;
        double letztAbst;
        Vektor2D aktRicht;
        double durchAbst;
        int i = 0;
       
        if (this.nPoints() <= 1) {
            return this;
        }
       
        letztV = this.get(0);
        letztAbst = 0;
        while (it.hasNext()) {
            aktV = it.next();
           
            aktAbst = aktV.distanz(letztV) + letztAbst;
            abstaende.add(aktAbst);
           
            letztAbst = aktAbst;
            letztV = aktV;
        }

        durchAbst = abstaende.get(abstaende.size() - 1)
                    / (abstaende.size() - 1);
       
        aktV = new Vektor2D(this.get(0));
        normArr.add(aktV);
        aktAbst = 0;
        while (i < this.nPoints()) {
            if (i + 1 < this.nPoints()) {
                aktRicht = new Vektor2D(this.get(i + 1));
                aktRicht.sub(this.get(i));
                aktRicht.laengeFestlegen(durchAbst);
               
                while (aktAbst < abstaende.get(i + 1)) {
                    aktV = new Vektor2D(aktV);
                    aktV.add(aktRicht);
                    normArr.add(aktV);
                    aktAbst += durchAbst;
                }
            }
View Full Code Here

    /**
     * @return  Eine einfache Variante von <code>this</code>.
     */
    public Polygon2D toEinfach() {
        Polygon2D neu = new Polygon2D(this.nPoints());
        Vektor2D akt;
        Iterator<Vektor2D> it = this.iterator();
        neu.erzwingeEinfach(true);
       
        while (it.hasNext()) {
            akt = it.next();
View Full Code Here

TOP

Related Classes of fmg.fmg8.endlAutomat.EndlicherAutomat

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.