Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2922/src/net/sourceforge/bprocessor/model
Modified Files:
Space.java
Log Message:
some minor fixes on the naming of functional spaces as well as a better implementation of makeUnion on a space
Index: Space.java
===================================================================
RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v
retrieving revision 1.189
retrieving revision 1.190
diff -C2 -d -r1.189 -r1.190
*** Space.java 31 Oct 2007 11:33:23 -0000 1.189
--- Space.java 31 Oct 2007 15:46:10 -0000 1.190
***************
*** 1433,1437 ****
*/
public String getKindName() {
! if (this.isContainer()) {
String lvl = getLevelName();
if (getClassification() != null) {
--- 1433,1437 ----
*/
public String getKindName() {
! if (this != getOwner().empty) {
String lvl = getLevelName();
if (getClassification() != null) {
***************
*** 2940,2944 ****
public static void makeUnion(Collection<Space> interior) {
Collection<Surface> boundary = new LinkedList<Surface>();
! Collection<Surface> innerSurfs = new LinkedList<Surface>();
Space owner = null;
for (Space s : interior) {
--- 2940,2944 ----
public static void makeUnion(Collection<Space> interior) {
Collection<Surface> boundary = new LinkedList<Surface>();
! Collection<Surface> innerSurfs = new HashSet<Surface>();
Space owner = null;
for (Space s : interior) {
***************
*** 2957,3000 ****
owner.add(union);
- Map<Geometric, Geometric> map = new HashMap<Geometric, Geometric>();
- Map<Vertex, Vertex> copiedVertices = new HashMap<Vertex, Vertex>();
- Map<Edge, Edge> copiedEdges = new HashMap<Edge, Edge>();
- Map<Surface, Surface> copiedSurfaces = new HashMap<Surface, Surface>();
- Map<Space, Space> copiedSpaces = new HashMap<Space, Space>();
- for (Space space : interior) {
- Space copy = space.copy(copiedVertices, copiedEdges, copiedSurfaces, copiedSpaces);
- map.put(space, copy);
- union.add(copy);
- }
-
- for (Surface surface : innerSurfs) {
- Surface copy = (Surface) surface.copy(map);
- Space front = surface.getFrontDomain();
- if (front != owner.getEmpty()) {
- Space newFront = (Space) map.get(front);
- if (newFront != null) {
- copy.setFrontDomain(newFront);
- }
- }
- Space back = surface.getBackDomain();
- if (back != owner.getEmpty()) {
- Space newBack = (Space) map.get(back);
- if (newBack != null) {
- copy.setBackDomain(newBack);
- }
- }
- union.add(copy);
- surface.erase();
- }
-
- Map<Geometric, Geometric> map2 = new HashMap<Geometric, Geometric>();
for (Surface surface : boundary) {
! Surface copy = copiedSurfaces.get(surface);
Space front = surface.getFrontDomain();
if (!interior.contains(front)) {
copy.setFrontDomain(union.getEmpty());
} else {
- copy.setFrontDomain((Space)map.get(front));
surface.setFrontDomain(union);
}
Space back = surface.getBackDomain();
--- 2957,2968 ----
owner.add(union);
for (Surface surface : boundary) {
! Surface copy = surface.copy(union);
Space front = surface.getFrontDomain();
if (!interior.contains(front)) {
copy.setFrontDomain(union.getEmpty());
} else {
surface.setFrontDomain(union);
+ copy.setFrontDomain(front);
}
Space back = surface.getBackDomain();
***************
*** 3002,3013 ****
copy.setBackDomain(union.getEmpty());
} else {
- copy.setBackDomain((Space)map.get(back));
surface.setBackDomain(union);
}
! union.add(copy);
}
! for (Space s : interior) {
! s.delete();
}
}
--- 2970,3004 ----
copy.setBackDomain(union.getEmpty());
} else {
surface.setBackDomain(union);
+ copy.setBackDomain(back);
}
! }
! Set<Edge> danglingEdges = new HashSet<Edge>();
! for (Surface surface : innerSurfs) {
! owner.remove(surface);
! danglingEdges.addAll(surface.getEdges());
! union.add(surface);
}
! Set<Vertex> danglingVertex = new HashSet<Vertex>();
! for (Edge e : danglingEdges) {
! if (e.getSurfaces().isEmpty()) {
! danglingVertex.add(e.getFrom());
! danglingVertex.add(e.getTo());
! owner.remove(e);
! union.add(e);
! }
! }
!
! for (Vertex v : danglingVertex) {
! if (v.getEdges().isEmpty()) {
! owner.remove(v);
! union.add(v);
! }
! }
!
! for (Space space : interior) {
! owner.elements.remove(space.getId());
! union.add(space);
}
}
|