Package com.evelopers.unimod.glayout.graph.containers

Examples of com.evelopers.unimod.glayout.graph.containers.Face


        // to prevent going this way
        dontgo.setProperty(GraphHelper.getInstance(),
                           GraphHelper.getInstance());

        // chain for face
        Face tface = new Face(sg);
        Chain ac   = new Chain(tface);
        GraphHelper.instanceCopy(gd.getOuterLeft(),
                                 tface);
        GraphHelper.instanceCopy(gd.getOuterRight(),
                                 tface);
        ac = GraphHelper.getInstance()
                        .dfsChainSearchUnOri(tface, ac, v1, v2);
        sg.removePropertyAsc(GraphHelper.getInstance());

        Face f = new Face(sg);

        GraphsContainer vgc = new GraphsContainer(sg, f);
        f.addEdges(ac.getEdges());
        f.addVertices(ac.getVertices());
        f.setProperty(FICTIVE_KEY, FICTIVE_VALUE);
        gd.getFaces()
          .add(f);

        return vgc;
    }
View Full Code Here


    private void iterateFaces() {
        ListIterator li = gd.getFaces()
                            .listIterator();

        while (li.hasNext()) {
            Face face = (Face) li.next();

            if ((!face.equals(gd.getOuterLeft())) && (!face.equals(gd.getOuterRight()))) {
                FaceRectangulator.getInstance(face, sg)
                                 .rectangulate();
            }
        }
    }
View Full Code Here

    }

    private void fixOuter() {
        ListIterator li = gd.getFaces()
                            .listIterator();
        Face curr = (Face) li.next();

        while (li.hasNext()) {
            Face face = (Face) li.next();

            if (face.getVertices()
                        .size() > curr.getVertices()
                                          .size()) {
                curr = face;
            }
        }
View Full Code Here

    /**
     * Set outer face for graph
     * @param gcont
     */
    protected void setOuter(GContainer gcont) {
        Face f = new Face(planarg);
        gd.setOuter(new Face(planarg));
        GraphHelper.instanceCopy(gcont, f);
        GraphHelper.instanceCopy(gcont,
                                 gd.getOuter());
        GraphHelper.instanceCopy(gcont, planarg);
        tempg.removeEdges(gcont.getEdges());
View Full Code Here

            ListIterator li2 = gd.getFaces()
                                 .listIterator();
            int count = 0;

            while (li2.hasNext()) {
                Face element2 = (Face) li2.next();

                if (element2.isAdmissible(element)) {
                    count++;
                }
            }

            if (count == 0) {
View Full Code Here

        ListIterator li = gd.getFaces()
                            .listIterator();
        Chain ac            = null;
        SimpleVertex source = null;
        SimpleVertex target = null;
        Face cface          = null;

        while (li.hasNext()) {
            cface = (Face) li.next();

            if (cface.isAdmissible(s)) {
                List contactvertices = s.getCV();

                if (contactvertices.size() > 0) {
                    source = (SimpleVertex) contactvertices.get(0);

                    if (contactvertices.size() == 1) {
                        target = source;
                    } else {
                        target = (SimpleVertex) contactvertices.get(1);
                    }

                    ac = s.getAChain(tempg, source, target);

                    break;
                }
            }
        }

        Face f = cface.split(ac, source, target);
        gd.getFaces()
          .add(f);
        GraphHelper.instanceCopy(ac, planarg);
        tempg.removeEdges(ac.getEdges());
        tempg.removeVertices(ac.getVertices());
View Full Code Here

        SimpleEmbedding emb = new SimpleEmbedding(sg, gd);
        emb.construct();

        ListIterator li = gd.getFaces()
                            .listIterator();
        Face curr = (Face) li.next();

        while (li.hasNext()) {
            Face face = (Face) li.next();

            if (face.getVertices()
                        .size() > curr.getVertices()
                                          .size()) {
                curr = face;
            }
        }
View Full Code Here

    /*
     *  (non-Javadoc)
     * @see com.evelopers.unimod.glayout.representations.embedding.SimpleEmbedding#setOuter(com.evelopers.unimod.glayout.graph.containers.GContainer)
     */
    protected void setOuter(GContainer gcont) {
        Face f1 = new Face(planarg);
        Face f2 = new Face(planarg);
        gd.setOuter(f2);
        GraphHelper.instanceCopy(gcont, f1);
        GraphHelper.instanceCopy(gcont, f2);
        GraphHelper.instanceCopy(gcont, planarg);
        tempg.removeEdges(gcont.getEdges());
View Full Code Here

     * Sets source and target too.
     * @param f face to split
     * @return new faces array generated
     */
    public Face[] faceTravel(Face f) {
        Face resLeft  = new Face(f.getGraph());
        Face resRight = new Face(f.getGraph());
        GraphHelper.instanceCopy(f, resRight);

        int route = f.getVertices()
                     .size() / 2;
        SimpleVertex prev = null;
        SimpleVertex curr = (SimpleVertex) f.getVertices()
                                            .get(0);
        gd.setSource(curr);
        resLeft.addVertex(curr);

        while (route > 0) {
            ListIterator li = curr.getEdges()
                                  .listIterator();

            while (li.hasNext()) {
                SimpleEdge element = (SimpleEdge) li.next();

                if ((f.getEdges()
                          .indexOf(element) != -1) && (element.getAnother(curr) != prev)) {
                    prev     = curr;
                    curr     = element.getAnother(curr);
                    resLeft.addVertex(curr);
                    resLeft.addEdge(element);
                    route--;

                    break;
                }
            }
        }

        gd.setTarget(curr);
        resRight.removeVertices(resLeft.getVertices());
        resRight.removeEdges(resLeft.getEdges());
        resRight.addVertex(gd.getSource());
        resRight.addVertex(gd.getTarget());

        return new Face[] { resLeft, resRight };
    }
View Full Code Here

        List res        = new ArrayList();
        ListIterator li = gd.getFaces()
                            .listIterator();

        while (li.hasNext()) {
            Face element = (Face) li.next();

            if (element.getVertices()
                           .indexOf(sv) != -1) {
                res.add(element);
            }
        }
View Full Code Here

TOP

Related Classes of com.evelopers.unimod.glayout.graph.containers.Face

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.