Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv7456/src/net/sourceforge/bprocessor/gl/tool
Modified Files:
PencilTool.java
Log Message:
New pencil tool algorithm done
Index: PencilTool.java
===================================================================
RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/PencilTool.java,v
retrieving revision 1.74
retrieving revision 1.75
diff -C2 -d -r1.74 -r1.75
*** PencilTool.java 11 Dec 2006 14:56:54 -0000 1.74
--- PencilTool.java 11 Dec 2006 16:51:56 -0000 1.75
***************
*** 29,32 ****
--- 29,33 ----
import net.sourceforge.bprocessor.model.CoordinateSystem;
import net.sourceforge.bprocessor.model.Entity;
+ import net.sourceforge.bprocessor.model.Geometry;
import net.sourceforge.bprocessor.model.Plane;
import net.sourceforge.bprocessor.model.Project;
***************
*** 268,278 ****
while (it.hasNext()) {
Edge edge = (Edge) it.next();
! if (!contains(pls, edge)) {
! CoordinateSystem system = CoordinateSystem.create(current, edge);
! if (system != null) {
if (!contains(systems, system)) {
pls.add(system);
}
}
}
}
--- 269,281 ----
while (it.hasNext()) {
Edge edge = (Edge) it.next();
! CoordinateSystem system = CoordinateSystem.create(current, edge);
! if (system != null) {
! if (!contains(pls, edge)) {
if (!contains(systems, system)) {
pls.add(system);
}
}
+ } else {
+ queue.addLast(edge);
}
}
***************
*** 313,323 ****
Collection edges = new LinkedList();
edges.add(edge);
! this.surfaceAnalysis(Project.getInstance().getActiveSpace(), edges);
Project.getInstance().changed(Project.getInstance().getActiveSpace());
Project.getInstance().checkpoint();
hooverEdge = edge;
start = current;
incident = null;
! cleanUp();
}
}
--- 316,330 ----
Collection edges = new LinkedList();
edges.add(edge);
! Collection surfaces
! = surfaceAnalysis(Project.getInstance().getActiveSpace(), edges);
Project.getInstance().changed(Project.getInstance().getActiveSpace());
Project.getInstance().checkpoint();
+
hooverEdge = edge;
start = current;
incident = null;
! if (!surfaces.isEmpty()) {
! cleanUp();
! }
}
}
***************
*** 345,356 ****
* @param space Space
* @param start collection of edges
*/
! public void surfaceAnalysis(Space space, Collection start) {
Collection systems = planeAnalysis(space, start);
Iterator iter = systems.iterator();
while (iter.hasNext()) {
CoordinateSystem current = (CoordinateSystem) iter.next();
! surfaceAnalysis(space, current, start);
}
}
--- 352,366 ----
* @param space Space
* @param start collection of edges
+ * @return collection of surfaces
*/
! public Collection surfaceAnalysis(Space space, Collection start) {
Collection systems = planeAnalysis(space, start);
Iterator iter = systems.iterator();
+ Collection added = new LinkedList();
while (iter.hasNext()) {
CoordinateSystem current = (CoordinateSystem) iter.next();
! added.addAll(surfaceAnalysis(space, current, start));
}
+ return added;
}
***************
*** 374,379 ****
* @param system CoordinateSystem
* @param start collection of edges
*/
! public void surfaceAnalysis(Space space, CoordinateSystem system, Collection start) {
Plane plane = system.plane();
Map vmap = new LinkedHashMap();
--- 384,390 ----
* @param system CoordinateSystem
* @param start collection of edges
+ * @return collection of Surfaces
*/
! public Collection surfaceAnalysis(Space space, CoordinateSystem system, Collection start) {
Plane plane = system.plane();
Map vmap = new LinkedHashMap();
***************
*** 476,479 ****
--- 487,498 ----
}
}
+ {
+ Iterator iter = added.iterator();
+ while (iter.hasNext()) {
+ Surface current = (Surface) iter.next();
+ Geometry.holeAnalysis(current);
+ }
+ }
+ return added;
}
|