Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26273/src/net/sourceforge/bprocessor/gl/tool
Modified Files:
PencilTool.java
Log Message:
Almost done with pencil algo
Index: PencilTool.java
===================================================================
RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/PencilTool.java,v
retrieving revision 1.73
retrieving revision 1.74
diff -C2 -d -r1.73 -r1.74
*** PencilTool.java 11 Dec 2006 11:59:15 -0000 1.73
--- PencilTool.java 11 Dec 2006 14:56:54 -0000 1.74
***************
*** 41,45 ****
*/
public class PencilTool extends AbstractPencil {
- private Collection edges;
/**
* Constructor for Pencil
--- 41,44 ----
***************
*** 49,53 ****
public PencilTool(GLView glv, Cursor cursor) {
super(glv, cursor);
- edges = new LinkedList();
dragging = false;
}
--- 48,51 ----
***************
*** 311,317 ****
} else {
Edge edge = new Edge(start.vertex(), current.vertex());
- edges.add(edge);
glv.getView().changeColor(edge, View.CLIP_PLANE_COLOR);
! Project.getInstance().getActiveSpace().insert(edge);
Project.getInstance().changed(Project.getInstance().getActiveSpace());
Project.getInstance().checkpoint();
--- 309,317 ----
} else {
Edge edge = new Edge(start.vertex(), current.vertex());
glv.getView().changeColor(edge, View.CLIP_PLANE_COLOR);
! edge = Project.getInstance().getActiveSpace().insert(edge);
! Collection edges = new LinkedList();
! edges.add(edge);
! this.surfaceAnalysis(Project.getInstance().getActiveSpace(), edges);
Project.getInstance().changed(Project.getInstance().getActiveSpace());
Project.getInstance().checkpoint();
***************
*** 341,344 ****
--- 341,359 ----
/**
+ * Find surfaces in the space starting with the
+ * edges in collection of edges
+ * @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);
+ }
+ }
+
+ /**
* Find surfaces in specified space
* @param space Space
***************
*** 349,353 ****
while (iter.hasNext()) {
CoordinateSystem current = (CoordinateSystem) iter.next();
! surfaceAnalysis(space, current);
}
}
--- 364,368 ----
while (iter.hasNext()) {
CoordinateSystem current = (CoordinateSystem) iter.next();
! surfaceAnalysis(space, current, space.getEdges());
}
}
***************
*** 358,367 ****
* @param space Space
* @param system CoordinateSystem
*/
! public void surfaceAnalysis(Space space, CoordinateSystem system) {
! if (system.determinant() < 0) {
! System.out.println("LEFT HAND OF DARKNESS");
! }
!
Plane plane = system.plane();
Map vmap = new LinkedHashMap();
--- 373,379 ----
* @param space Space
* @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();
***************
*** 440,448 ****
Set removed = new HashSet();
{
! Iterator iter = emap.values().iterator();
System.out.println("-- analysis --");
while (iter.hasNext()) {
! EdgeNode current = (EdgeNode) iter.next();
! surfaceAnalysis(current, system, added, removed);
}
}
--- 452,463 ----
Set removed = new HashSet();
{
! Iterator iter = start.iterator();
System.out.println("-- analysis --");
while (iter.hasNext()) {
! Edge current = (Edge) iter.next();
! if (emap.containsKey(current)) {
! EdgeNode node = (EdgeNode) emap.get(current);
! surfaceAnalysis(node, system, added, removed);
! }
}
}
|