[Bprocessor-commit] model/src/net/sourceforge/bprocessor/model Edge.java, 1.58, 1.59 Vertex.java, 1
Status: Pre-Alpha
Brought to you by:
henryml
From: Michael L. <he...@us...> - 2006-10-05 11:27:06
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17382/src/net/sourceforge/bprocessor/model Modified Files: Edge.java Vertex.java ClippingPlane.java EnergyCalc.java Project.java Log Message: Removed methods from Project to add, remove and delete geometry Index: EnergyCalc.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/EnergyCalc.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** EnergyCalc.java 11 Sep 2006 09:23:20 -0000 1.1 --- EnergyCalc.java 5 Oct 2006 11:27:04 -0000 1.2 *************** *** 19,23 **** */ public static double energyLoss() { ! Iterator it = Project.getInstance().getSurfaces().iterator(); double totalloss = 0; --- 19,23 ---- */ public static double energyLoss() { ! Iterator it = Project.getInstance().world().getSurfaces().iterator(); double totalloss = 0; *************** *** 121,125 **** Space spa = null; ! Iterator it = Project.getInstance().getSurfaces().iterator(); while (it.hasNext()) { --- 121,125 ---- Space spa = null; ! Iterator it = Project.getInstance().world().getSurfaces().iterator(); while (it.hasNext()) { *************** *** 163,167 **** public static double heatedArea() { double tha = 0; ! Iterator it = Project.getInstance().getSurfaces().iterator(); while (it.hasNext()) { --- 163,167 ---- public static double heatedArea() { double tha = 0; ! Iterator it = Project.getInstance().world().getSurfaces().iterator(); while (it.hasNext()) { Index: Edge.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Edge.java,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -d -r1.58 -r1.59 *** Edge.java 18 Sep 2006 14:10:07 -0000 1.58 --- Edge.java 5 Oct 2006 11:27:04 -0000 1.59 *************** *** 160,164 **** */ public void delete() { ! getOwner().delete(this); } --- 160,166 ---- */ public void delete() { ! if (getOwner() != null) { ! getOwner().delete(this); ! } } Index: Vertex.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Vertex.java,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** Vertex.java 29 Sep 2006 13:39:34 -0000 1.46 --- Vertex.java 5 Oct 2006 11:27:04 -0000 1.47 *************** *** 447,451 **** */ public void delete() { ! getOwner().delete(this); } --- 447,453 ---- */ public void delete() { ! if (getOwner() != null) { ! getOwner().delete(this); ! } } Index: ClippingPlane.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/ClippingPlane.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** ClippingPlane.java 18 Sep 2006 14:36:22 -0000 1.10 --- ClippingPlane.java 5 Oct 2006 11:27:04 -0000 1.11 *************** *** 169,173 **** */ public Collection findIntersections() { ! Collection edges = Project.getInstance().getEdges(); ArrayList silluet = new ArrayList(); Collection res = new ArrayList(); --- 169,173 ---- */ public Collection findIntersections() { ! Collection edges = Project.getInstance().getActiveSpace().getEdges(); ArrayList silluet = new ArrayList(); Collection res = new ArrayList(); *************** *** 190,194 **** } } ! Collection surfaces = Project.getInstance().getSurfaces(); it = surfaces.iterator(); while (it.hasNext()) { --- 190,194 ---- } } ! Collection surfaces = Project.getInstance().getActiveSpace().getSurfaces(); it = surfaces.iterator(); while (it.hasNext()) { Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.80 retrieving revision 1.81 diff -C2 -d -r1.80 -r1.81 *** Project.java 5 Oct 2006 07:46:23 -0000 1.80 --- Project.java 5 Oct 2006 11:27:04 -0000 1.81 *************** *** 16,20 **** import java.util.LinkedList; import java.util.List; - import java.util.Set; import java.util.Stack; --- 16,19 ---- *************** *** 242,255 **** while (iter.hasNext()) { Object next = iter.next(); ! if (next instanceof Edge) { ! remove((Edge)next); ! } else if (next instanceof Surface) { ! remove((Surface)next); ! } else if (next instanceof Vertex) { ! remove((Vertex)next); ! } else if (next instanceof Space) { ! remove((Space)next); ! } else if (next instanceof Constructor) { ! ((Constructor)next).delete(); } } --- 241,247 ---- while (iter.hasNext()) { Object next = iter.next(); ! if (next instanceof Entity) { ! Entity entity = (Entity) next; ! entity.delete(); } } *************** *** 370,388 **** } ! /** ! * Find all construction spaces ! * @return The construction spaces ! */ ! public Collection getConstructionSpaces() { ! Collection result = new HashSet(); ! Iterator iter = world.getElements().iterator(); ! while (iter.hasNext()) { ! Space current = (Space) iter.next(); ! if (current.getType() == Space.CONSTRUCTION) { ! result.add(current); ! } ! } ! return result; ! } /** --- 362,366 ---- } ! /** *************** *** 393,487 **** return world.getElements(); } - - /** - * Remove an Edge - * @param edge The edge - */ - private void remove(Edge edge) { - if (edge.getOwner() != null) { - edge.getOwner().delete(edge); - } else { - log.warn("Owner were null on " + edge); - } - } - - /** - * Find all edges - * @return The edges - */ - public Collection getEdges() { - return getActiveSpace().getEdges(); - } - - /** - * Remove a space dont call changed - * @param space The space to remove - */ - private void remove(Space space) { - if (space.getOwner() != null) { - space.getOwner().remove(space); - } else { - log.warn("Owner were null on " + space); - } - } - - /** - * Find all functional spaces - * @return The functional spaces - */ - public Collection getFunctionalSpaces() { - Collection result = new HashSet(); - Iterator iter = world.getElements().iterator(); - while (iter.hasNext()) { - Space current = (Space) iter.next(); - if (current.getType() == Space.FUNCTIONAL) { - result.add(current); - } - } - return result; - } - - /** - * Remove a surface - * @param surface The surface - */ - private void remove(Surface surface) { - surface.delete(); - } - - /** - * Find all surfaces - * @return The surfaces - */ - public Collection getSurfaces() { - return getActiveSpace().getSurfaces(); - } - - /** - * Find Surface by id - * @param id The id - * @return The Surface - */ - public Surface findSurfaceById(long id) { - return (Surface)world.getSurface(id); - } - - /** - * Remove a vertex dont call changed - * @param vertex The vertex - */ - private void remove(Vertex vertex) { - if (vertex.getOwner() != null) { - vertex.getOwner().delete(vertex); - } - } - - /** - * Find all vertexs - * @return The vertexs - */ - public Collection getVertices() { - return world.getVertices(); - } /** --- 371,374 ---- *************** *** 573,597 **** } - /** - * Find vertex based upon location and delta - * @param x The x coordinate - * @param y The y coordinate - * @param z The z coordinate - * @param delta The delta value - * @return The vertexs - */ - public Set findByLocation(double x, double y, double z, double delta) { - return world.findByLocation(x, y, z, delta); - } - - /** - * Find set of edges that coincides with the vertex - * @param vertex The vertex - * @return The set of edges - */ - public Set findEdge(Vertex vertex) { - return world.findEdge(vertex); - } - /** * Tells you if the projekt has been changed --- 460,463 ---- |