[Bprocessor-commit] test/src/net/sourceforge/bprocessor/test SurfaceAngles.java, 1.1, 1.2
Status: Pre-Alpha
Brought to you by:
henryml
|
From: Michael L. <he...@us...> - 2007-05-07 09:48:54
|
Update of /cvsroot/bprocessor/test/src/net/sourceforge/bprocessor/test In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16929/src/net/sourceforge/bprocessor/test Modified Files: SurfaceAngles.java Log Message: A little progress on surface sorting Index: SurfaceAngles.java =================================================================== RCS file: /cvsroot/bprocessor/test/src/net/sourceforge/bprocessor/test/SurfaceAngles.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SurfaceAngles.java 19 Apr 2007 13:38:50 -0000 1.1 --- SurfaceAngles.java 7 May 2007 09:48:47 -0000 1.2 *************** *** 10,13 **** --- 10,14 ---- import java.io.File; import java.util.Collection; + import java.util.Collections; import java.util.LinkedList; import java.util.List; *************** *** 18,21 **** --- 19,23 ---- import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Surface; + import net.sourceforge.bprocessor.model.SurfaceSorter; import net.sourceforge.bprocessor.model.Vertex; *************** *** 45,55 **** private static void printEdge(Edge edge) { Collection<Surface> surfaces = edge.getSurfaces(); ! List<Surface> sorted = new LinkedList(surfaces); ! Entity.sort(sorted); ! Vertex direction = edge.getDirection(); ! System.out.println("" + edge.getId() + " direction: " + direction); ! for (Surface surface : sorted) { ! Vertex normal = surface.normal(); ! System.out.println(" " + surface.getId() + " normal: " + normal); } } --- 47,62 ---- private static void printEdge(Edge edge) { Collection<Surface> surfaces = edge.getSurfaces(); ! if (surfaces.size() > 1) { ! List<Surface> sorted = new LinkedList(surfaces); ! Collections.shuffle(sorted); ! SurfaceSorter sorter = new SurfaceSorter(edge); ! System.out.println("sorting " + sorted); ! sorted = sorter.sort(sorted); ! Vertex direction = edge.getDirection(); ! System.out.println("" + edge.getId() + " direction: " + direction); ! for (Surface surface : sorted) { ! Vertex normal = surface.normal(); ! System.out.println(" " + surface.getId() + " normal: " + normal); ! } } } |