Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22036/src/net/sourceforge/bprocessor/model
Modified Files:
Space.java
Log Message:
solving some problems relating to holes
Index: Space.java
===================================================================
RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v
retrieving revision 1.43
retrieving revision 1.44
diff -C2 -d -r1.43 -r1.44
*** Space.java 31 Jul 2006 11:29:40 -0000 1.43
--- Space.java 31 Jul 2006 17:16:13 -0000 1.44
***************
*** 1401,1412 ****
Iterator surfaces = envelope.iterator();
Surface startSurface = null;
! if (surfaces.hasNext()) {
! startSurface = (Surface)surfaces.next();
! Set coloured = new HashSet();
! if (colour(startSurface, coloured)) {
! return coloured.containsAll(envelope);
! }
! }
! return false;
}
--- 1401,1417 ----
Iterator surfaces = envelope.iterator();
Surface startSurface = null;
! Set coloured = new HashSet();
! boolean done = false;
! while (surfaces.hasNext() && !done) {
! startSurface = (Surface)surfaces.next();
! if (!coloured.contains(startSurface)) {
! if (colour(startSurface, coloured)) {
! done = coloured.containsAll(envelope);
! } else {
! return false;
! }
! }
! }
! return true;
}
***************
*** 1468,1477 ****
}
}
! return colourable;
!
}
/**
! * Finds the next surface on an edge
* @param startSurface the surface to find neighbours for.
* @param sharedEdge the shared edge
--- 1473,1481 ----
}
}
! return colourable;
}
/**
! * Finds the next colourable surface on an edge
* @param startSurface the surface to find neighbours for.
* @param sharedEdge the shared edge
***************
*** 1514,1522 ****
Vertex notShared = findNextVertex(sharedEdge, sharedVertex, l);
angle = findAngle(sharedVertex, notShared, cs);
- Vertex normal = s.normal();
if (angle < minAngle && colourable(s, angle, i, j)) {
minAngle = angle;
neighbour = s;
! }
}
}
--- 1518,1533 ----
Vertex notShared = findNextVertex(sharedEdge, sharedVertex, l);
angle = findAngle(sharedVertex, notShared, cs);
if (angle < minAngle && colourable(s, angle, i, j)) {
minAngle = angle;
neighbour = s;
! }
! if (s.getExterior() != null) {
! angle = (angle + Math.PI) % (2 * Math.PI);
! if (angle < minAngle && colourable(s.getExterior(),
! angle, i, j)) {
! minAngle = angle;
! neighbour = s.getExterior();
! }
! }
}
}
|