[Bprocessor-commit] model/src/net/sourceforge/bprocessor/model Surface.java, 1.215, 1.216 SurfaceAn
Status: Pre-Alpha
Brought to you by:
henryml
From: Michael L. <he...@us...> - 2008-01-11 09:22:06
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16396/src/net/sourceforge/bprocessor/model Modified Files: Surface.java SurfaceAnalysis.java Log Message: Improved space-assignment in space-analysis Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.215 retrieving revision 1.216 diff -C2 -d -r1.215 -r1.216 *** Surface.java 10 Jan 2008 09:54:05 -0000 1.215 --- Surface.java 11 Jan 2008 09:22:08 -0000 1.216 *************** *** 35,39 **** */ public class Surface extends Geometric implements Parametric { ! private static final boolean AUTOMATIC = true; private static Logger log = Logger.getLogger(Surface.class); --- 35,39 ---- */ public class Surface extends Geometric implements Parametric { ! private static final boolean AUTOMATIC = false; private static Logger log = Logger.getLogger(Surface.class); Index: SurfaceAnalysis.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/SurfaceAnalysis.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** SurfaceAnalysis.java 10 Jan 2008 09:54:05 -0000 1.15 --- SurfaceAnalysis.java 11 Jan 2008 09:22:08 -0000 1.16 *************** *** 21,24 **** --- 21,26 ---- */ public class SurfaceAnalysis { + private static final boolean VERBOSE = false; + /** * *************** *** 162,165 **** --- 164,170 ---- */ public Collection<Surface> surfaceAnalysis(Container space, Collection<Edge> start) { + if (VERBOSE) { + System.out.println("analyze " + start); + } Collection<CoordinateSystem> systems = planeAnalysis(space, start); Collection<Surface> added = new LinkedList(); *************** *** 191,194 **** --- 196,204 ---- public Collection<Surface> surfaceAnalysis(Container space, CoordinateSystem system, Collection<Edge> start) { + + if (VERBOSE) { + System.out.println(" plane " + system.getN()); + } + Plane plane = system.plane(); Map<Vertex, VertexNode> vmap = new LinkedHashMap(); *************** *** 298,302 **** --- 308,331 ---- } + private boolean isVoid(Space space) { + if (space != null) { + return space.isVoid(); + } else { + return true; + } + } + private void assign(Surface surface, Collection<Surface> surfaces) { + if (VERBOSE) { + System.out.println(" assign " + surface); + for (Surface current : surfaces) { + String name = current.getName(); + Space front = current.getFrontDomain(); + Space back = current.getBackDomain(); + String desc = "[" + name + " " + front + " | " + back + "]"; + System.out.println(" " + desc); + } + } + Container back = null; Material backmaterial = null; *************** *** 307,324 **** Vertex n2 = other.normal(); if (n1.dot(n2) > 0) { ! if (back == null) { back = other.getBackDomain(); backmaterial = other.getBackMaterial(); } ! if (front == null) { front = other.getFrontDomain(); frontmaterial = other.getFrontMaterial(); } } else { ! if (back == null) { back = other.getFrontDomain(); backmaterial = other.getFrontMaterial(); } ! if (front == null) { front = other.getBackDomain(); frontmaterial = other.getBackMaterial(); --- 336,353 ---- Vertex n2 = other.normal(); if (n1.dot(n2) > 0) { ! if (isVoid(back)) { back = other.getBackDomain(); backmaterial = other.getBackMaterial(); } ! if (isVoid(front)) { front = other.getFrontDomain(); frontmaterial = other.getFrontMaterial(); } } else { ! if (isVoid(back)) { back = other.getFrontDomain(); backmaterial = other.getFrontMaterial(); } ! if (isVoid(front)) { front = other.getBackDomain(); frontmaterial = other.getBackMaterial(); *************** *** 326,329 **** --- 355,361 ---- } } + if (VERBOSE) { + System.out.println(" " + front + " | " + back); + } surface.setBackDomain(back); surface.setBackMaterial(backmaterial); *************** *** 343,346 **** --- 375,382 ---- Set<Surface> added, Set<Surface> removed) { if (!marked(start.left)) { + if (VERBOSE) { + System.out.println(" left-side " + start.edge); + } + SurfaceNode s = new SurfaceNode(); s.mark = true; *************** *** 367,370 **** --- 403,410 ---- } if (!marked(start.right)) { + if (VERBOSE) { + System.out.println(" right-side " + start.edge); + } + SurfaceNode s = new SurfaceNode(); s.mark = true; |