Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30367/src/net/sourceforge/bprocessor/model
Modified Files:
Command.java SurfaceAnalysis.java Space.java
Log Message:
Removed holeAnalysis from surfaceAnalysis to improve performance.
SurfaceAnalysis is linear and holeAnalysis is quadratic
Index: Space.java
===================================================================
RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v
retrieving revision 1.211
retrieving revision 1.212
diff -C2 -d -r1.211 -r1.212
*** Space.java 7 Dec 2007 13:19:54 -0000 1.211
--- Space.java 9 Dec 2007 11:04:01 -0000 1.212
***************
*** 2505,2508 ****
--- 2505,2512 ----
SurfaceAnalysis analysis = new SurfaceAnalysis();
surfaces.addAll(analysis.surfaceAnalysis(this, edges));
+
+ for (Surface current : surfaces) {
+ Geometry.holeAnalysis(current);
+ }
return new Mesh(surfaces, edges, vertices);
}
Index: Command.java
===================================================================
RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Command.java,v
retrieving revision 1.48
retrieving revision 1.49
diff -C2 -d -r1.48 -r1.49
*** Command.java 7 Dec 2007 11:00:22 -0000 1.48
--- Command.java 9 Dec 2007 11:04:01 -0000 1.49
***************
*** 1775,1778 ****
--- 1775,1780 ----
int m = round(height / dy);
+
+
Vertex[][] grid = new Vertex[n][m];
{
***************
*** 1811,1814 ****
--- 1813,1817 ----
List<Edge> all = new LinkedList();
+
all.addAll(verticals);
all.addAll(horizontals);
***************
*** 1823,1829 ****
}
}
- Geometry.insertEdges(net, all);
-
return net;
}
--- 1826,1842 ----
}
}
+ {
+
+ Collection<Vertex> points = Edge.vertices(all);
+ for (Vertex current : points) {
+ net.add(current);
+ }
+ for (Edge current : all) {
+ net.add(current);
+ }
+ SurfaceAnalysis analysis = new SurfaceAnalysis();
+ analysis.surfaceAnalysis(net, all);
+ }
return net;
}
Index: SurfaceAnalysis.java
===================================================================
RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/SurfaceAnalysis.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** SurfaceAnalysis.java 28 Sep 2007 14:07:32 -0000 1.12
--- SurfaceAnalysis.java 9 Dec 2007 11:04:01 -0000 1.13
***************
*** 249,264 ****
Set<Surface> added = new HashSet();
Set<Surface> removed = new HashSet();
- {
- for (Edge current : start) {
- if (emap.containsKey(current)) {
- //EdgeNode node = emap.get(current);
- //node.left = null;
- //node.right = null;
- }
- }
- }
for (Edge current : start) {
if (emap.containsKey(current)) {
! EdgeNode node = (EdgeNode) emap.get(current);
surfaceAnalysis(node, system, added, removed);
}
--- 249,255 ----
Set<Surface> added = new HashSet();
Set<Surface> removed = new HashSet();
for (Edge current : start) {
if (emap.containsKey(current)) {
! EdgeNode node = emap.get(current);
surfaceAnalysis(node, system, added, removed);
}
***************
*** 270,276 ****
space.add(current);
}
- for (Surface current : added) {
- Geometry.holeAnalysis(current);
- }
return added;
}
--- 261,264 ----
|