Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28842/src/net/sourceforge/bprocessor/model
Modified Files:
Surface.java Geometry.java Space.java
Log Message:
Started implementing hole-analysis between element and space
Index: Surface.java
===================================================================
RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v
retrieving revision 1.131
retrieving revision 1.132
diff -C2 -d -r1.131 -r1.132
*** Surface.java 24 Jan 2007 12:08:32 -0000 1.131
--- Surface.java 30 Jan 2007 14:10:03 -0000 1.132
***************
*** 1181,1192 ****
* Tests if a surface is a hole in this surface
* @param hole The surface to test
* @return True if hole
*/
! public boolean surrounds(Surface hole) {
Iterator iter = hole.getVertices().iterator();
while (iter.hasNext()) {
Vertex current = (Vertex) iter.next();
! if (!surrounds(current)) {
! return false;
}
}
--- 1181,1201 ----
* Tests if a surface is a hole in this surface
* @param hole The surface to test
+ * @param boundary Test boundary condidition
* @return True if hole
*/
! public boolean surrounds(Surface hole, boolean boundary) {
Iterator iter = hole.getVertices().iterator();
while (iter.hasNext()) {
Vertex current = (Vertex) iter.next();
! if (boundary) {
! if (!onBoundary(current)) {
! if (!surrounds(current)) {
! return false;
! }
! }
! } else {
! if (!surrounds(current)) {
! return false;
! }
}
}
Index: Space.java
===================================================================
RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v
retrieving revision 1.116
retrieving revision 1.117
diff -C2 -d -r1.116 -r1.117
*** Space.java 29 Jan 2007 15:03:36 -0000 1.116
--- Space.java 30 Jan 2007 14:10:03 -0000 1.117
***************
*** 2521,2527 ****
Project.getInstance().setActiveSpace(this);
Selection.primary().clear();
- if (surfaces.isEmpty()) {
- copyOwnerEnvelope();
- }
Project.getInstance().changed(Project.getInstance());
}
--- 2521,2524 ----
Index: Geometry.java
===================================================================
RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Geometry.java,v
retrieving revision 1.42
retrieving revision 1.43
diff -C2 -d -r1.42 -r1.43
*** Geometry.java 5 Jan 2007 13:54:47 -0000 1.42
--- Geometry.java 30 Jan 2007 14:10:03 -0000 1.43
***************
*** 276,287 ****
{
! Collection surfaces = surface.getOwner().getSurfaces();
! Iterator iter = surfaces.iterator();
! while (iter.hasNext()) {
! Surface current = (Surface) iter.next();
if (current != surface) {
! if (current.surrounds(surface)) {
exteriors.add(current);
! } else if (surface.surrounds(current)) {
interiors.add(current);
}
--- 276,290 ----
{
! Collection<Surface> candidates = new LinkedList<Surface>();
! Collection<Surface> surfaces = surface.getOwner().getSurfaces();
! Collection<Surface> envelope = surface.getOwner().getEnvelope();
! candidates.addAll(surfaces);
! //candidates.addAll(envelope);
!
! for (Surface current : candidates) {
if (current != surface) {
! if (current.surrounds(surface, false)) {
exteriors.add(current);
! } else if (surface.surrounds(current, false)) {
interiors.add(current);
}
|