Examples of SimpleVertex


Examples of com.evelopers.unimod.glayout.graph.SimpleVertex

        ListIterator lif = gd.getFaces()
                             .listIterator();

        while (lif.hasNext()) {
            Face element    = (Face) lif.next();
            SimpleVertex sv = new SimpleVertex();
            associated.addVertex(sv);
            element.setProperty(this, sv);
        }

        ListIterator lip = paths.listIterator();

        while (lip.hasNext()) {
            Path path       = (Path) lip.next();
            SimpleVertex sv = new SimpleVertex();
            associated.addVertex(sv);
            path.setProperty(this, sv);
        }

        lip = paths.listIterator();

        while (lip.hasNext()) {
            Path path        = (Path) lip.next();
            ListIterator lic = path.getEdges()
                                   .listIterator();
            List lfaces = new ArrayList();
            List rfaces = new ArrayList();

            while (lic.hasNext()) {
                SimpleEdge edge = (SimpleEdge) lic.next();

                if (lfaces.indexOf(edge.getLeft()) == -1) {
                    lfaces.add(edge.getLeft());
                }

                if (rfaces.indexOf(edge.getRight()) == -1) {
                    rfaces.add(edge.getRight());
                }
            }

            Iterator itl = lfaces.iterator();

            while (itl.hasNext()) {
                Face lface       = (Face) itl.next();
                SimpleVertex src = lface.getVertexProperty(this);
                SimpleVertex dst = path.getVertexProperty(this);
                SimpleEdge se    = new SimpleEdge(src, dst);
                associated.addEdge(se);
            }

            Iterator itr = rfaces.iterator();

            while (itr.hasNext()) {
                Face rface       = (Face) itr.next();
                SimpleVertex src = path.getVertexProperty(this);
                SimpleVertex dst = rface.getVertexProperty(this);
                SimpleEdge se    = new SimpleEdge(src, dst);
                associated.addEdge(se);
            }
        }
    }
View Full Code Here

Examples of com.evelopers.unimod.glayout.graph.SimpleVertex

        ListIterator liv = sg.getVertices()
                             .listIterator();

        while (liv.hasNext()) {
            SimpleVertex sv      = (SimpleVertex) liv.next();
            SimpleVertex corresp = np.getCorrespondingVertex(sv);
            sv.setOrthX(corresp.getTopnum());
        }

        np.cleanProps();

        SimpleGraph nver = np.produceVertical();
        TopSorterFactory.getTopSorter(nver)
                        .unitTopSort();
        liv = sg.getVertices()
                .listIterator();

        while (liv.hasNext()) {
            SimpleVertex sv      = (SimpleVertex) liv.next();
            SimpleVertex corresp = np.getCorrespondingVertex(sv);
            sv.setOrthY(corresp.getTopnum());
        }

        np.cleanProps();
    }
View Full Code Here

Examples of com.evelopers.unimod.glayout.graph.SimpleVertex

        ListIterator li = st_list.listIterator();
        int i           = 0;

        while (li.hasNext()) {
            SimpleVertex vertex = (SimpleVertex) li.next();
            System.out.println("Vertex: " + vertex + " is " + i);
            i++;
        }
    }
View Full Code Here

Examples of com.evelopers.unimod.glayout.graph.SimpleVertex

        ListIterator li = v.getEdges()
                           .listIterator();

        while (li.hasNext()) {
            SimpleEdge e   = (SimpleEdge) li.next();
            SimpleVertex w = e.getAnother(v);

            if (((Integer) dfsnum.get(w)).intValue() == 0) {
                tree_in.put(w, e);
                st_dfs(w, count, dfsnum, lownum, tree_in, low_out);
View Full Code Here

Examples of com.evelopers.unimod.glayout.graph.SimpleVertex

        st_list.clear();

//        int n = sg.getVertices()
//                  .size();

        SimpleVertex s = src;
        SimpleVertex t = dst;

        HashMap dfsnum = createHM(sg.getVertices(),
                                  new Integer(0));
        HashMap lownum = createHM(sg.getVertices(),
                                  new Integer(0));
        HashMap tree_in = new HashMap();
        HashMap low_out = new HashMap();

        Integer count = new Integer(1);

        //tree_in.put(t, e_st);  // dummy
        st_dfs(t, count, dfsnum, lownum, tree_in, low_out);

        HashMap used_edge = createHM(sg.getEdges(),
                                     new Boolean(false));
        HashMap used_node = createHM(sg.getVertices(),
                                     new Boolean(false));

        used_node.put(s,
                      new Boolean(true));
        used_node.put(t,
                      new Boolean(true));

        //used_edge.put(e_st, new Boolean(true));
        st_list.addLast(t);
        st_list.addLast(s);

        int st_count = 1;

        SimpleVertex top = (SimpleVertex) st_list.getFirst();

        while (true) {
            SimpleVertex v = top;
            st_count++;
            st_num.put(v,
                       new Integer(st_count));

            ListIterator lie = top.getEdges()
                                  .listIterator();

            while (lie.hasNext()) {
                SimpleEdge e = (SimpleEdge) lie.next();

                if (((Boolean) used_edge.get(e)).booleanValue()) {
                    continue;
                }

                used_edge.put(e,
                              new Boolean(true));

                SimpleVertex w = e.getAnother(v);
                LinkedList p   = new LinkedList();

                if (tree_in.get(w) == e) {
                    findpath(w, used_node, used_edge, low_out, p);
                } else {
View Full Code Here

Examples of com.evelopers.unimod.glayout.graph.SimpleVertex

            for (int j = 0; j < arr.length; j++) {
                Path path2 = arr[j];

                if (!path1.equals(path2)) {
                    if (PathHelper.haveCommonEdges(path1, path2)) {
                        SimpleVertex self =
                            path2.getVertexProperty(VisibilityFactory.PATH_KEY);
                        self.setProperty(VisibilityFactory.PATH_KEY, path1);
                        PathHelper.unifyPaths(path1, path2);
                        arr[j] = path1;
                    }
                }
            }
View Full Code Here

Examples of com.evelopers.unimod.glayout.graph.SimpleVertex

        List tpaths     = new ArrayList();
        ListIterator li = sg.getVertices()
                            .listIterator();

        while (li.hasNext()) {
            SimpleVertex element = (SimpleVertex) li.next();
            SimpleEdge e1        = null;
            SimpleEdge e2        = null;

            if ((!element.equals(gd.getSource())) && (!element.equals(gd.getTarget()))) {
                if (element.getEdgesIncoming()
                               .size() == 2) {
                    e1     = getEdgeForFace(element.getLeft(),
                                            element.getEdgesIncoming());
                    e2 = getEdgeForFace(element.getRight(),
                                        element.getEdgesOutgoing());
                } else {
                    e1     = GraphHelper.getInstance()
                                        .getMedianEdge13(element,
                                                         element.getEdgesIncoming());
                    e2 = GraphHelper.getInstance()
                                    .getMedianEdge13(element,
                                                     element.getEdgesOutgoing());
                }

                Path p = new Path(sg);
                p.addVertex(element);
                p.addVertex(e1.getAnother(element));
                p.addVertex(e2.getAnother(element));
                p.addEdge(e1);
                p.addEdge(e2);
                element.setProperty(VisibilityFactory.PATH_KEY, p);

                // property to be removed
                p.setProperty(VisibilityFactory.PATH_KEY, element);
                tpaths.add(p);
            }
View Full Code Here

Examples of com.evelopers.unimod.glayout.graph.SimpleVertex

     */
    private static List getTowardsPath(Face f, SimpleEdge e) {
        List res = new ArrayList();
        res.add(e);

        SimpleVertex curr = e.getTarget();

        while (curr != f.getDest()) {
            SimpleEdge tmp = (SimpleEdge) curr.getEdgesRelativeOutgoing(f)
                                              .get(0);
            res.add(tmp);
            curr = tmp.getTarget();
        }

View Full Code Here

Examples of com.evelopers.unimod.glayout.graph.SimpleVertex

        res.addEdge(e);

        SimpleEdge curre = e;
        res.addVertex(source);

        SimpleVertex curr = e.getAnother(source);
        res.addVertex(curr);

        while (curr != target) {
            SimpleEdge tmp;

            if (curr.getEdgesRelative(f)
                        .get(0) == curre) {
                tmp = (SimpleEdge) curr.getEdgesRelative(f)
                                       .get(1);
            } else {
                tmp = (SimpleEdge) curr.getEdgesRelative(f)
                                       .get(0);
            }

            res.addEdge(tmp);
            curr = tmp.getAnother(curr);
View Full Code Here

Examples of com.evelopers.unimod.glayout.graph.SimpleVertex

    private static SimpleVertex countOD(Face f, boolean orig) {
        ListIterator li = f.getVertices()
                           .listIterator();

        while (li.hasNext()) {
            SimpleVertex element = (SimpleVertex) li.next();
            ListIterator li2     = element.getEdgesRelative(f)
                                          .listIterator();
            int count = 0;

            while (li2.hasNext()) {
                SimpleEdge ed = (SimpleEdge) li2.next();
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.