Logo Search packages:      
Sourcecode: javamorph version File versions  Download package

static void javamorph::CTriangulation::triangulate (  )  [inline, static]

Perform complete operation.

Definition at line 65 of file CTriangulation.java.

References clear(), debug(), height, order, points, width, and work().

                                    {
long time = System.currentTimeMillis();
        System.out.println("Begin triangulation.");
        Point p, l, r;
        clear();
        /* Bug fix "Array index out of bounds" in CTriangulation.add().*/
        order.clear();
        points.clear();
        width = CConfig.left_image.getWidth() + CConfig.right_image.getWidth();
        height = 
            CConfig.left_image.getHeight() + CConfig.right_image.getHeight();
        width /= 2;
        height /= 2;
        for(int i = 0; i < CConfig.left_mesh.size(); ++i)
        {
            l = CConfig.left_mesh.get(i);
            r = CConfig.right_mesh.get(i);
            p = new Point((l.x + r.x) / 2, (l.y + r.y) / 2);
            points.add(p);
            order.add(p);
        }
        work();
        debug();
System.out.println("End. Duration of triangulation = " + (System.currentTimeMillis() - time) + '.');
    }


Generated by  Doxygen 1.6.0   Back to index