[Bprocessor-commit] model/src/net/sourceforge/bprocessor/model Surface.java, 1.164, 1.165 Geometry.
Status: Pre-Alpha
Brought to you by:
henryml
|
From: Michael L. <he...@us...> - 2007-05-31 12:42:01
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4644/src/net/sourceforge/bprocessor/model Modified Files: Surface.java Geometry.java Space.java Log Message: Refactored code in the model. delete(Surface) no longer deletes edges Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.164 retrieving revision 1.165 diff -C2 -d -r1.164 -r1.165 *** Surface.java 30 May 2007 17:28:33 -0000 1.164 --- Surface.java 31 May 2007 12:41:55 -0000 1.165 *************** *** 328,331 **** --- 328,338 ---- /** + * Remove references to this Surface in the rest of the model + */ + public void unlink() { + + } + + /** * Calculate center of gravity * @return The center of gravity *************** *** 547,550 **** --- 554,567 ---- } copy.setEdges(edges); + Space front = (Space) map.get(frontDomain); + if (front == null) { + front = frontDomain; + } + copy.setFrontDomain(front); + Space back = (Space) map.get(backDomain); + if (back == null) { + back = backDomain; + } + copy.setBackDomain(back); } return copy; *************** *** 1110,1129 **** */ public void move(double dx, double dy, double dz) { ! { ! List vertices = getVertices(); ! Iterator iter = vertices.iterator(); ! while (iter.hasNext()) { ! Vertex vertex = (Vertex) iter.next(); ! vertex.move(dx, dy, dz); ! } } ! { ! if (getHoles() != null) { ! Iterator iter = getHoles().iterator(); ! while (iter.hasNext()) { ! Surface surface = (Surface) iter.next(); ! surface.move(dx, dy, dz); ! } ! } } } --- 1127,1135 ---- */ public void move(double dx, double dy, double dz) { ! for (Vertex vertex : getVertices()) { ! vertex.move(dx, dy, dz); } ! for (Surface surface : getHoles()) { ! surface.move(dx, dy, dz); } } Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.147 retrieving revision 1.148 diff -C2 -d -r1.147 -r1.148 *** Space.java 29 May 2007 12:39:17 -0000 1.147 --- Space.java 31 May 2007 12:41:55 -0000 1.148 *************** *** 35,38 **** --- 35,40 ---- private static final long serialVersionUID = 1L; + private static final boolean DELETE_EDGES = false; + private static Logger log = Logger.getLogger(Space.class); /** Construction Type */ *************** *** 911,921 **** */ public void remove(Surface surface) { ! if (surface.getHoles() != null) { ! for (Surface curHole : surface.getHoles()) { ! if (surface.getExterior() != null) { ! surface.getExterior().addHole(curHole); ! } else { ! curHole.setExterior(null); ! } } } --- 913,921 ---- */ public void remove(Surface surface) { ! for (Surface current : surface.getHoles()) { ! if (surface.getExterior() != null) { ! surface.getExterior().addHole(current); ! } else { ! current.setExterior(null); } } *************** *** 994,1003 **** public void delete(Surface surface) { remove(surface); ! List edges = surface.getEdges(); ! Iterator it = edges.iterator(); ! while (it.hasNext()) { ! Edge edge = (Edge)it.next(); ! if (edge.getSurfaces().size() < 1) { ! delete(edge); } } --- 994,1002 ---- public void delete(Surface surface) { remove(surface); ! if (DELETE_EDGES) { ! for (Edge edge : surface.getEdges()) { ! if (edge.getSurfaces().size() < 1) { ! delete(edge); ! } } } *************** *** 1435,1439 **** @Override public String toString() { ! return "[ " + getLevelString() + getName() + "]"; } --- 1434,1438 ---- @Override public String toString() { ! return "[" + getLevelString() + " " + getName() + "]"; } Index: Geometry.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Geometry.java,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -d -r1.58 -r1.59 *** Geometry.java 30 May 2007 17:28:33 -0000 1.58 --- Geometry.java 31 May 2007 12:41:55 -0000 1.59 *************** *** 484,493 **** Surface surface = (Surface) o; vertices.addAll(surface.getVertices()); ! if (surface.getHoles() != null) { ! Iterator iter = surface.getHoles().iterator(); ! while (iter.hasNext()) { ! Surface current = (Surface) iter.next(); ! collect(current, vertices); ! } } } else if (o instanceof ClippingPlane) { --- 484,489 ---- Surface surface = (Surface) o; vertices.addAll(surface.getVertices()); ! for (Surface current : surface.getHoles()) { ! collect(current, vertices); } } else if (o instanceof ClippingPlane) { |