[Bprocessor-commit] model/src/net/sourceforge/bprocessor/model Geometry.java, 1.71, 1.72 Container.
Status: Pre-Alpha
Brought to you by:
henryml
From: Michael L. <he...@us...> - 2008-02-06 14:41:56
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6086/src/net/sourceforge/bprocessor/model Modified Files: Geometry.java Container.java Log Message: more examples Index: Geometry.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Geometry.java,v retrieving revision 1.71 retrieving revision 1.72 diff -C2 -d -r1.71 -r1.72 *** Geometry.java 25 Jan 2008 13:06:02 -0000 1.71 --- Geometry.java 6 Feb 2008 14:41:52 -0000 1.72 *************** *** 32,35 **** --- 32,37 ---- public static final double EPS = 0.0000000001; + private static final boolean EXTERIOR_HOLE_ANALYSIS = false; + /** * *************** *** 185,196 **** Collection<Surface> surfaces = surface.getOwner().getSurfaces(); candidates.addAll(surfaces); - if (surface.getOwner().isUnion()) { - Collection<Surface> surrounding = surface.getOwner().getOwner().getSurfaces(); - candidates.addAll(surrounding); - } else { - Collection<Surface> envelope = surface.getOwner().getEnvelope(); - candidates.addAll(envelope); - } --- 187,200 ---- Collection<Surface> surfaces = surface.getOwner().getSurfaces(); candidates.addAll(surfaces); + if (EXTERIOR_HOLE_ANALYSIS) { + if (surface.getOwner().isUnion()) { + Collection<Surface> surrounding = surface.getOwner().getOwner().getSurfaces(); + candidates.addAll(surrounding); + } else { + Collection<Surface> envelope = surface.getOwner().getEnvelope(); + candidates.addAll(envelope); + } + } Index: Container.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Container.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Container.java 23 Jan 2008 14:49:33 -0000 1.14 --- Container.java 6 Feb 2008 14:41:52 -0000 1.15 *************** *** 1511,1518 **** --- 1511,1533 ---- if (ns == 0) { Collection<Surface> surfaces = new LinkedList(); + Collection<Surface> originals = new HashSet(); + Map map = new HashMap(); for (Surface current : envelope) { + originals.add(current); + originals.addAll(current.getHoles()); + } + for (Surface current : originals) { surfaces.add((Surface) current.copy(map)); } + for (Surface current : originals) { + Surface surface = (Surface) map.get(current); + if (current.getExterior() != null) { + Surface exterior = (Surface) map.get(current.getExterior()); + if (exterior != null) { + exterior.addHole(surface); + } + } + } Collection<Edge> edges = Surface.edges(surfaces); Collection<Vertex> vertices = Edge.vertices(edges); |