[Bprocessor-commit] model/src/net/sourceforge/bprocessor/model Surface.java, 1.191, 1.192
Status: Pre-Alpha
Brought to you by:
henryml
From: Michael L. <he...@us...> - 2007-10-09 14:02:20
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27833/src/net/sourceforge/bprocessor/model Modified Files: Surface.java Log Message: Some refactoring Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.191 retrieving revision 1.192 diff -C2 -d -r1.191 -r1.192 *** Surface.java 9 Oct 2007 12:44:10 -0000 1.191 --- Surface.java 9 Oct 2007 14:02:16 -0000 1.192 *************** *** 691,695 **** // spaces here. if (AUTOMATIC) { ! assignSpaceForExtrusion(delta, n, facemap, top); } return top; --- 691,695 ---- // spaces here. if (AUTOMATIC) { ! assignSpaceForExtrusion(delta, sides, top); } return top; *************** *** 703,707 **** * @param top the top surface */ ! private void assignSpaceForExtrusion(double delta, int n, Surface[] facemap, Surface top) { boolean flip = false; boolean inside = false; --- 703,707 ---- * @param top the top surface */ ! private void assignSpaceForExtrusion(double delta, Collection<Surface> sides, Surface top) { boolean flip = false; boolean inside = false; *************** *** 717,741 **** } ! for (int i = 0; i < n; i++) { ! Surface s = facemap[i]; ! if (s == null) { ! continue; ! } if (delta < 0) { ! s.setBackDomain(getBackDomain()); if (exterior != null && inside) { if (flip) { ! s.setFrontDomain(exterior.getFrontDomain()); } else { ! s.setFrontDomain(exterior.getBackDomain()); } } } else { ! s.setFrontDomain(getFrontDomain()); if (exterior != null && inside) { if (flip) { ! s.setBackDomain(exterior.getBackDomain()); } else { ! s.setBackDomain(exterior.getFrontDomain()); } } --- 717,737 ---- } ! for (Surface current : sides) { if (delta < 0) { ! current.setBackDomain(getBackDomain()); if (exterior != null && inside) { if (flip) { ! current.setFrontDomain(exterior.getFrontDomain()); } else { ! current.setFrontDomain(exterior.getBackDomain()); } } } else { ! current.setFrontDomain(getFrontDomain()); if (exterior != null && inside) { if (flip) { ! current.setBackDomain(exterior.getBackDomain()); } else { ! current.setBackDomain(exterior.getFrontDomain()); } } *************** *** 788,795 **** */ public Surface extrusionOnto(Plane p, double distance, Collection<Surface> sides) { - if (p == null) { - log.info("p were null for " + this); - return null; - } Vertex normal = normal(); List vertices = getVertices(); --- 784,787 ---- *************** *** 930,934 **** * @param isRootExtrusion is root extrusion * @param delta the length of extrusion in meters ! * @param sides Will contain the sides that are created * @param e2e a edge to new extruded parallel edge map * @param v2e a vertex to orthogonal edge map --- 922,926 ---- * @param isRootExtrusion is root extrusion * @param delta the length of extrusion in meters ! * @param extrusion Will contain the sides that are created * @param e2e a edge to new extruded parallel edge map * @param v2e a vertex to orthogonal edge map *************** *** 938,942 **** */ public Surface extrudeControlled(double delta, ! boolean isRootExtrusion, Set<Surface> sides, Map<Edge, Edge> e2e, Map<Vertex, Edge> v2e, Map<Edge, Surface> e2s, Map<Vertex, Direction> v2dir) { Vertex normal = normal(); --- 930,934 ---- */ public Surface extrudeControlled(double delta, ! boolean isRootExtrusion, Set<Surface> extrusion, Map<Edge, Edge> e2e, Map<Vertex, Edge> v2e, Map<Edge, Surface> e2s, Map<Vertex, Direction> v2dir) { Vertex normal = normal(); *************** *** 964,968 **** for (Surface hole : getHoles()) { ! sides.add(hole.extrudeControlled(delta, false, sides, e2e, v2e, e2s, v2dir)); } --- 956,960 ---- for (Surface hole : getHoles()) { ! hole.extrudeControlled(delta, false, extrusion, e2e, v2e, e2s, v2dir); } *************** *** 1128,1132 **** facemap[i] = new Surface(newEdges); e2s.put(b, facemap[i]); ! sides.add(facemap[i]); } } --- 1120,1124 ---- facemap[i] = new Surface(newEdges); e2s.put(b, facemap[i]); ! extrusion.add(facemap[i]); } } *************** *** 1139,1148 **** } top = new Surface(newEdges); ! sides.add(top); } else { top = this; } if (AUTOMATIC) { ! assignSpaceForExtrusion(delta, n, facemap, top); } return top; --- 1131,1146 ---- } top = new Surface(newEdges); ! extrusion.add(top); } else { top = this; } if (AUTOMATIC) { ! Collection<Surface> sides = new LinkedList(); ! for (int i = 0; i < n; i++) { ! if (facemap[i] != null) { ! sides.add(facemap[i]); ! } ! } ! assignSpaceForExtrusion(delta, sides, top); } return top; |