[Bprocessor-commit] gl/src/net/sourceforge/bprocessor/gl/tool SpaceTool.java, 1.69, 1.70
Status: Pre-Alpha
Brought to you by:
henryml
|
From: Michael L. <he...@us...> - 2007-03-22 14:37:39
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv3078/src/net/sourceforge/bprocessor/gl/tool Modified Files: SpaceTool.java Log Message: Progress on mesh algorithms Index: SpaceTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SpaceTool.java,v retrieving revision 1.69 retrieving revision 1.70 diff -C2 -d -r1.69 -r1.70 *** SpaceTool.java 31 Jan 2007 15:22:06 -0000 1.69 --- SpaceTool.java 22 Mar 2007 14:37:29 -0000 1.70 *************** *** 40,43 **** --- 40,44 ---- import net.sourceforge.bprocessor.model.Entity; import net.sourceforge.bprocessor.model.IDTransform; + import net.sourceforge.bprocessor.model.Mesh; import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Scale; *************** *** 630,645 **** Space space = Project.getInstance().getActiveSpace(); while (!stack.empty()) { Object result = stack.pop(); if (result instanceof Vertex) { ! result = space.insert((Vertex)result); ! Selection.primary().add(result); } else if (result instanceof Edge) { ! result = space.insert((Edge)result); ! Selection.primary().add(result); } else if (result instanceof Surface) { ! result = space.insert((Surface) result); ! Selection.primary().add(result); } else if (result instanceof Space) { space.add((Space) result); Selection.primary().add(result); --- 631,650 ---- Space space = Project.getInstance().getActiveSpace(); + Collection<Vertex> vertices = new LinkedList(); + Collection<Edge> edges = new LinkedList(); + Collection<Surface> surfaces = new LinkedList(); + Collection<Space> spaces = new LinkedList(); + + while (!stack.empty()) { Object result = stack.pop(); if (result instanceof Vertex) { ! vertices.add((Vertex)result); } else if (result instanceof Edge) { ! edges.add((Edge)result); } else if (result instanceof Surface) { ! surfaces.add((Surface)result); } else if (result instanceof Space) { + spaces.add((Space) result); space.add((Space) result); Selection.primary().add(result); *************** *** 648,651 **** --- 653,664 ---- } } + edges.addAll(Surface.edges(surfaces)); + vertices.addAll(Edge.vertices(edges)); + Mesh mesh = new Mesh(surfaces, edges, vertices); + // mesh.identify(); + Mesh result = space.insert(mesh); + Selection.primary().addAll(result.vertices()); + Selection.primary().addAll(result.edges()); + Selection.primary().addAll(result.surfaces()); Project.getInstance().checkpoint(); typing = false; |