[Bprocessor-commit] model/src/net/sourceforge/bprocessor/model Command.java, 1.57, 1.58
Status: Pre-Alpha
Brought to you by:
henryml
From: Michael L. <he...@us...> - 2007-12-13 09:34:50
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28863/src/net/sourceforge/bprocessor/model Modified Files: Command.java Log Message: removed unused code Index: Command.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Command.java,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** Command.java 13 Dec 2007 08:21:34 -0000 1.57 --- Command.java 13 Dec 2007 09:34:46 -0000 1.58 *************** *** 1884,1972 **** } - private Space createGrid(Surface surface, double dx, double dy) { - Space net = Space.createNet("Grid Net"); - HashMap map = new HashMap(); - - List<Edge> contour = new LinkedList(); - for (Edge current : surface.getEdges()) { - contour.add((Edge) current.copy(map)); - } - - Vertex vertex = surface.getFirstVertex(); - Vertex normal = surface.normal(); - CoordinateSystem system = CoordinateSystem.systemFor(vertex, normal); - - List<Vertex> vertices = Offset.vertices(contour); - system.translateIt(vertices); - - BoundingBox box = new BoundingBox(vertices); - double xmin = box.xmin().getX(); - double xmax = box.xmax().getX(); - double ymin = box.ymin().getY(); - double ymax = box.ymax().getY(); - - double width = xmax - xmin; - double height = ymax - ymin; - - int n = round(width / dx); - int m = round(height / dy); - - - - Vertex[][] grid = new Vertex[n][m]; - { - double x = xmin; - for (int i = 0; i < n; i++) { - x = x + dx; - double y = ymin; - for (int j = 0; j < m; j++) { - y = y + dy; - grid[i][j] = new Vertex(x, y, 0); - } - } - } - - List<Edge> verticals = new LinkedList(); - { - for (int i = 0; i < n; i++) { - for (int j = 0; j < m - 1; j++) { - Vertex from = grid[i][j]; - Vertex to = grid[i][j + 1]; - verticals.add(new Edge(from, to)); - } - } - } - - List<Edge> horizontals = new LinkedList(); - { - for (int j = 0; j < m; j++) { - for (int i = 0; i < n - 1; i++) { - Vertex from = grid[i][j]; - Vertex to = grid[i + 1][j]; - horizontals.add(new Edge(from, to)); - } - } - } - - List<Edge> all = new LinkedList(); - - all.addAll(verticals); - all.addAll(horizontals); - - { - for (int i = 0; i < n; i++) { - for (int j = 0; j < m; j++) { - Vertex current = grid[i][j]; - Vertex global = system.unTranslate(current); - current.set(global); - } - } - } - - Shape.addEdgesTo(net, all); - - return net; - } - /** {@inheritDoc} */ @Override --- 1884,1887 ---- |